From e13d42b5b5d1234293e67d162affb6499956b180 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Sat, 31 Aug 2024 12:41:57 -0400 Subject: [PATCH 1/3] mode=movement_move_to_next_face & longmode = face0 --- .../watch_faces/complication/simple_calculator_face.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/movement/watch_faces/complication/simple_calculator_face.c b/movement/watch_faces/complication/simple_calculator_face.c index 95804ced..ada289df 100644 --- a/movement/watch_faces/complication/simple_calculator_face.c +++ b/movement/watch_faces/complication/simple_calculator_face.c @@ -380,6 +380,14 @@ bool simple_calculator_face_loop(movement_event_t event, movement_settings_t *se case EVENT_MODE_BUTTON_UP: if (state->mode == MODE_ERROR) { reset_from_error(state); + } else if (state->mode == MODE_ENTERING_FIRST_NUM && + state->first_num.hundredths == 0 && + state->first_num.tenths == 0 && + state->first_num.ones== 0 && + state->first_num.tens == 0 && + state->first_num.hundreds == 0 && + state->first_num.thousands == 0) { + movement_move_to_next_face(); } else { state->placeholder = PLACEHOLDER_ONES; state->mode = (state->mode + 1) % 4; @@ -392,7 +400,7 @@ bool simple_calculator_face_loop(movement_event_t event, movement_settings_t *se break; case EVENT_MODE_LONG_PRESS: - movement_move_to_next_face(); + movement_move_to_face(0); break; case EVENT_TIMEOUT: From b607b6f7a9177f3fc7e16d842f0b7f6f18a86d9e Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Sat, 31 Aug 2024 12:44:29 -0400 Subject: [PATCH 2/3] removed note about mode long press --- movement/watch_faces/complication/simple_calculator_face.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/movement/watch_faces/complication/simple_calculator_face.h b/movement/watch_faces/complication/simple_calculator_face.h index 4f1e8d5a..1f77dc08 100644 --- a/movement/watch_faces/complication/simple_calculator_face.h +++ b/movement/watch_faces/complication/simple_calculator_face.h @@ -32,8 +32,6 @@ * * How to use: * - * Important note: LONG PRESS MODE to move to next watch face - * * Flow: * Enter first number -> Select operator -> Enter second number -> View Results * From c75a21196f088064d0763d07065df076311e940c Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Sat, 31 Aug 2024 14:46:23 -0400 Subject: [PATCH 3/3] commented out debugging printf() statements --- .../complication/simple_calculator_face.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/movement/watch_faces/complication/simple_calculator_face.c b/movement/watch_faces/complication/simple_calculator_face.c index ada289df..3221981c 100644 --- a/movement/watch_faces/complication/simple_calculator_face.c +++ b/movement/watch_faces/complication/simple_calculator_face.c @@ -115,7 +115,7 @@ static void set_operation(simple_calculator_state_t *state) { static void cycle_operation(simple_calculator_state_t *state) { state->operation = (state->operation + 1) % OPERATIONS_COUNT; // Assuming there are 6 operations - printf("Current operation: %d\n", state->operation); // For debugging + //printf("Current operation: %d\n", state->operation); // For debugging } @@ -131,9 +131,9 @@ static calculator_number_t convert_to_string(float number) { int int_part = (int)number; float decimal_part_float = ((number - int_part) * 100); // two decimal places - printf("decimal_part_float = %f\n", decimal_part_float); //For debugging + //printf("decimal_part_float = %f\n", decimal_part_float); //For debugging int decimal_part = round(decimal_part_float); - printf("decimal_part = %d\n", decimal_part); //For debugging + //printf("decimal_part = %d\n", decimal_part); //For debugging result.thousands = int_part / 1000 % 10; result.hundreds = int_part / 100 % 10; @@ -183,10 +183,10 @@ static void view_results(simple_calculator_state_t *state, char *display_string) // Convert the numbers to float first_num_float = convert_to_float(state->first_num); if (state->first_num.negative) first_num_float = first_num_float * -1; - printf("first_num_float = %f\n", first_num_float); // For debugging // For debugging + //printf("first_num_float = %f\n", first_num_float); // For debugging // For debugging second_num_float = convert_to_float(state->second_num); if (state->second_num.negative) second_num_float = second_num_float * -1; - printf("second_num_float = %f\n", second_num_float); // For debugging + //printf("second_num_float = %f\n", second_num_float); // For debugging // Perform the calculation based on the selected operation switch (state->operation) { @@ -229,7 +229,7 @@ static void view_results(simple_calculator_state_t *state, char *display_string) } result_float = roundf(result_float * 100.0f) / 100.0f; // Might not be needed - printf("result as float = %f\n", result_float); // For debugging + //printf("result as float = %f\n", result_float); // For debugging // Convert the float result to a string state->result = convert_to_string(result_float); @@ -341,7 +341,7 @@ bool simple_calculator_face_loop(movement_event_t event, movement_settings_t *se break; case MODE_CHOOSING: // Confirm and select the current operation - printf("Selected operation: %d\n", state->operation); // For debugging + //printf("Selected operation: %d\n", state->operation); // For debugging state->mode = MODE_ENTERING_SECOND_NUM; break; case MODE_ENTERING_SECOND_NUM: @@ -395,7 +395,7 @@ bool simple_calculator_face_loop(movement_event_t event, movement_settings_t *se state->first_num = state->result; reset_to_zero(&state->second_num); } - printf("Current mode: %d\n", state->mode); // For debugging + //printf("Current mode: %d\n", state->mode); // For debugging } break;