Skip to content

Commit

Permalink
feat(fmw): icons for replayer
Browse files Browse the repository at this point in the history
icons and some typos
  • Loading branch information
xpeqex committed Nov 8, 2024
1 parent a900d7e commit ac1388a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 51 deletions.
Binary file added Canbus_app/assets/FILERROR27x38.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/MSGERROR41x38.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/MSGOK41x38.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/RPLYOK49x38.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/WIP45x38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions Canbus_app/draw_functions/drawWidgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// Draws a developmet
void draw_in_development(App* app) {
widget_reset(app->widget);

widget_add_icon_element(app->widget, 41, 0, &I_WIP45x38);
widget_add_string_multiline_element(
app->widget, 65, 40, AlignCenter, AlignBottom, FontPrimary, "SCENE IN\nDEVELOPMENT");
app->widget, 65, 60, AlignCenter, AlignBottom, FontPrimary, "WORK IN\nPROGRESS");

}

Expand All @@ -21,22 +21,24 @@ void draw_device_no_connected(App* app) {
// draw when a message is not recognized
void draw_transmition_failure(App* app) {
widget_reset(app->widget);

widget_add_string_element(
app->widget, 65, 40, AlignCenter, AlignBottom, FontPrimary, "TRANSMITION\nFAILURE");
widget_add_icon_element(app->widget, 43, 0, &I_MSGERROR41x38);
widget_add_string_multiline_element(
app->widget, 65, 60, AlignCenter, AlignBottom, FontPrimary, "TRANSMISSION\nFAILURE");

}

// draw when a message is send OK
void draw_send_wrong(App* app) {
widget_reset(app->widget);
widget_add_icon_element(app->widget, 43, 0, &I_MSGERROR41x38);
widget_add_string_multiline_element(
app->widget, 65, 40, AlignCenter, AlignCenter, FontPrimary, "ERROER SENDING\nMESSAGE");
app->widget, 65, 60, AlignCenter, AlignBottom, FontPrimary, "ERROR SENDING\nMESSAGE");
}

// draw when a message is send ok
void draw_send_ok(App* app) {
widget_reset(app->widget);
widget_add_icon_element(app->widget, 43, 0, &I_MSGOK41x38);
widget_add_string_element(
app->widget, 65, 24, AlignCenter, AlignCenter, FontPrimary, "MESSAGE SEND OK");
app->widget, 65, 50, AlignCenter, AlignCenter, FontPrimary, "MESSAGE SENT OK");
}
16 changes: 2 additions & 14 deletions Canbus_app/scenes/Obd2Options/getCarDataOption.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ static int32_t obdii_get_car_data(void* context) {
widget_add_string_element(
app->widget, 64, 36, AlignCenter, AlignCenter, FontPrimary, "VIN Number:");
widget_add_string_element(
app->widget,
64,
51,
AlignCenter,
AlignCenter,
FontSecondary,
furi_string_get_cstr(app->text));
app->widget, 64, 51, AlignCenter, AlignCenter, FontSecondary, furi_string_get_cstr(app->text));
} else {
draw_transmition_failure(app);
}
Expand All @@ -73,13 +67,7 @@ static int32_t obdii_get_car_data(void* context) {
app->widget, 65, 40, AlignCenter, AlignCenter, FontPrimary, "ECU Name:");

widget_add_string_element(
app->widget,
64,
55,
AlignCenter,
AlignCenter,
FontSecondary,
furi_string_get_cstr(app->text));
app->widget, 64, 55, AlignCenter, AlignCenter, FontSecondary, furi_string_get_cstr(app->text));
} else {
draw_transmition_failure(app);
}
Expand Down
40 changes: 10 additions & 30 deletions Canbus_app/scenes/playLogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,59 +87,39 @@ void path_file_name(const char* path, FuriString* file_name) {
}
}

// For the device no connected
void draw_device_fail_connected(App* app) {
widget_reset(app->widget);

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

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

// For the message
void draw_message_send(App* app) {
widget_reset(app->widget);
widget_add_string_element(
app->widget, 62, 30, AlignCenter, AlignBottom, FontPrimary, "Sending Ok...");
app->widget, 62, 25, AlignCenter, AlignBottom, FontPrimary, "Sending...");

widget_add_string_element(
app->widget,
62,
50,
AlignCenter,
AlignBottom,
FontSecondary,
furi_string_get_cstr(app->text));
app->widget, 62, 40, AlignCenter, AlignBottom, FontSecondary, furi_string_get_cstr(app->text));

}

// Message sent fail
void draw_message_fail(App* app) {
widget_reset(app->widget);
widget_add_string_element(
app->widget, 62, 30, AlignCenter, AlignBottom, FontPrimary, "Sending Fail...");
app->widget, 62, 30, AlignCenter, AlignBottom, FontPrimary, "Sending Failed...");

widget_add_string_element(
app->widget,
62,
50,
AlignCenter,
AlignBottom,
FontSecondary,
furi_string_get_cstr(app->text));
app->widget, 62, 50, AlignCenter,AlignBottom, FontSecondary, furi_string_get_cstr(app->text));
}

void draw_finished(App* app) {
widget_reset(app->widget);
widget_add_icon_element(app->widget, 39, 0, &I_RPLYOK49x38);
widget_add_string_element(
app->widget, 62, 32, AlignCenter, AlignBottom, FontPrimary, "Replay Finished");
app->widget, 62, 47, AlignCenter, AlignCenter, FontPrimary, "REPLAY FINISHED");
}

void draw_file_no_opened(App* app) {
widget_reset(app->widget);
widget_add_icon_element(app->widget, 50, 0, &I_FILERROR27x38);
widget_add_string_element(
app->widget, 62, 32, AlignCenter, AlignBottom, FontPrimary, "File cannot be opened");
app->widget, 62, 47, AlignCenter, AlignCenter, FontPrimary, "File cannot be opened");
}

void draw_starting_transmition(App* app) {
Expand All @@ -156,7 +136,7 @@ void play_data_frames_bk(void* context, int frame_interval) {
debug = mcp2515_init(app->mcp_can);

if(debug != ERROR_OK) {
draw_device_fail_connected(app);
draw_device_no_connected(app);
return;
}

Expand Down

0 comments on commit ac1388a

Please sign in to comment.