Skip to content

Commit

Permalink
feat: icons and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
xpeqex committed Nov 8, 2024
1 parent ac1388a commit 7e3a14b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 54 deletions.
Binary file added Canbus_app/assets/DTCLN47x20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Canbus_app/assets/ENG28x20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 13 additions & 33 deletions Canbus_app/scenes/Obd2Options/dtcPIDOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,39 +96,31 @@ static int32_t obdii_thread_dtc_on_work(void* context) {
if(delete_dtc && run) {
if(clear_dtc(&scanner)) {
widget_reset(app->widget);
widget_add_icon_element(app->widget, 40, 0, &I_DTCLN47x20);
widget_add_string_multiline_element(
app->widget, 65, 43, AlignCenter, AlignBottom, FontPrimary, "ALL DTC\nCLEARED");

widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignBottom, FontPrimary, "ALL DTC");

widget_add_string_element(
app->widget, 65, 35, AlignCenter, AlignBottom, FontPrimary, "CLEARED");
} else {
widget_reset(app->widget);

widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignBottom, FontPrimary, "ERROR");

widget_add_string_element(
app->widget, 65, 35, AlignCenter, AlignBottom, FontPrimary, "CLEARING");
widget_add_string_multiline_element(
app->widget, 65, 43, AlignCenter, AlignBottom, FontPrimary, "E R R O R\nCLEARING");

}
} else if(!delete_dtc && run) {
if(request_dtc(&scanner, &(count_dtc), codes)) {
if(count_dtc == 0) {
widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignBottom, FontPrimary, "NO DTC");

widget_add_string_element(
app->widget, 65, 35, AlignCenter, AlignBottom, FontPrimary, "DETECTED");
widget_add_string_multiline_element(
app->widget, 65, 43, AlignCenter, AlignBottom, FontPrimary, "NO DTC\nDETECTED");

} else
loop = true;

} else {
widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignBottom, FontPrimary, "REQUESTED");
widget_add_icon_element(app->widget, 43, 0, &I_MSGERROR41x38);
widget_add_string_multiline_element(
app->widget, 65,60, AlignCenter, AlignBottom, FontPrimary, "REQUEST\nERROR");

widget_add_string_element(
app->widget, 65, 35, AlignCenter, AlignBottom, FontPrimary, "ERROR");
}

} else {
Expand Down Expand Up @@ -157,26 +149,14 @@ static int32_t obdii_thread_dtc_on_work(void* context) {
furi_string_printf(text, "%u of %u DTC", dtc_selector + 1, count_dtc);

widget_add_string_element(
app->widget,
65,
20,
AlignCenter,
AlignBottom,
FontSecondary,
furi_string_get_cstr(text));
app->widget, 65, 20, AlignCenter, AlignBottom, FontSecondary, furi_string_get_cstr(text));

furi_string_reset(text);

furi_string_printf(text, "%s", codes[dtc_selector]);

widget_add_string_element(
app->widget,
65,
35,
AlignCenter,
AlignBottom,
FontPrimary,
furi_string_get_cstr(text));
app->widget, 65, 35, AlignCenter, AlignBottom, FontPrimary, furi_string_get_cstr(text));

past_selector = dtc_selector;
}
Expand Down
6 changes: 3 additions & 3 deletions Canbus_app/scenes/Obd2Options/typicalPIDOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ void app_scene_obdii_typical_codes_on_enter(void* context) {
submenu_add_item(app->submenu, "Engine Speed", 0, typical_menu_callback, app);
submenu_add_item(app->submenu, "Vehicle Speed", 1, typical_menu_callback, app);
submenu_add_item(app->submenu, "Calculated Engine Load", 2, typical_menu_callback, app);
submenu_add_item(app->submenu, "Thortle Position", 3, typical_menu_callback, app);
submenu_add_item(app->submenu, "Throttle Position", 3, typical_menu_callback, app);
submenu_add_item(app->submenu, "Fuel Tank Input Level", 4, typical_menu_callback, app);
submenu_add_item(app->submenu, "Thortle Relative Position", 5, typical_menu_callback, app);
submenu_add_item(app->submenu, "Throttle Relative Position", 5, typical_menu_callback, app);
submenu_add_item(app->submenu, "Time Engine Running", 6, typical_menu_callback, app);

submenu_set_selected_item(
Expand Down Expand Up @@ -247,7 +247,7 @@ static int32_t obdii_thread_on_work(void* context) {
draw_scene(app, option, calculate_engine_load(data[3]));
break;

case 3: // Thortle Position
case 3: // Throttle Position
draw_scene(app, option, calculate_engine_load(data[3]));
break;

Expand Down
22 changes: 4 additions & 18 deletions Canbus_app/scenes/senderOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void app_scene_send_message_on_enter(void* context) {

widget_reset(app->widget);
widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignCenter, FontPrimary, "Wait to send it Message...");
app->widget, 65, 32, AlignCenter, AlignCenter, FontPrimary, "Waiting to send...");

view_dispatcher_switch_to_view(app->view_dispatcher, ViewWidget);

Expand Down Expand Up @@ -347,24 +347,10 @@ void app_scene_warning_log_on_enter(void* context) {
widget_reset(app->widget);

widget_add_string_element(
app->widget, 65, 20, AlignCenter, AlignBottom, FontPrimary, "W A R N I N G");
app->widget, 65, 20, AlignCenter, AlignBottom, FontPrimary, "W A R N I N G !");

widget_add_string_element(
app->widget,
65,
40,
AlignCenter,
AlignBottom,
FontSecondary,
"First go to the Sniffing option");
widget_add_string_element(
app->widget,
65,
50,
AlignCenter,
AlignBottom,
FontSecondary,
"in the menu and get the Id's");
widget_add_string_multiline_element(
app->widget, 65, 35, AlignCenter, AlignCenter, FontSecondary, "First go to the Sniffing option\nin the menu and get the ID's");

view_dispatcher_switch_to_view(app->view_dispatcher, ViewWidget);
}
Expand Down

0 comments on commit 7e3a14b

Please sign in to comment.