10 int level = 1; ///< Keyboard level. |
10 int level = 1; ///< Keyboard level. |
11 |
11 |
12 extern uint8_t VNC_pointer_button; ///< Mouse buttons mask |
12 extern uint8_t VNC_pointer_button; ///< Mouse buttons mask |
13 extern uint16_t VNC_pointer_x; ///< Mouse coordinate X |
13 extern uint16_t VNC_pointer_x; ///< Mouse coordinate X |
14 extern uint16_t VNC_pointer_y; ///< Mouse coordinate Y |
14 extern uint16_t VNC_pointer_y; ///< Mouse coordinate Y |
|
15 |
|
16 const char *mashTypes[] = { "Infusion", "Temperature", "Decoction" }; |
|
17 const char *SSR2Types[] = { "Uit", "HLT of MLT", "HLT en MLT", "Idle" }; |
15 |
18 |
16 |
19 |
17 #define EDIT_TYPE_TEXT 0 ///< Editor type is text |
20 #define EDIT_TYPE_TEXT 0 ///< Editor type is text |
18 #define EDIT_TYPE_INT 1 ///< Editor type is integer |
21 #define EDIT_TYPE_INT 1 ///< Editor type is integer |
19 #define EDIT_TYPE_FLOAT 2 ///< Editor type is float |
22 #define EDIT_TYPE_FLOAT 2 ///< Editor type is float |
608 |
611 |
609 void ShowSSR2(uint16_t x, uint16_t y, int val) |
612 void ShowSSR2(uint16_t x, uint16_t y, int val) |
610 { |
613 { |
611 _fg = TFT_LIGHTGREY; |
614 _fg = TFT_LIGHTGREY; |
612 TFT_print("SSR2 ", x, y); |
615 TFT_print("SSR2 ", x, y); |
613 _fg = TFT_YELLOW; |
616 _fg = TFT_YELLOW; |
614 TFT_clearStringRect(TFT_X, TFT_Y, "HLT en MLT"); |
617 TFT_clearStringRect(TFT_X, TFT_Y, "HLT en MLT"); |
615 |
618 TFT_print((char *)SSR2Types[val], LASTX, LASTY); |
616 switch (val) { |
|
617 case SSR2_OFF: TFT_print("Uit", LASTX, LASTY); |
|
618 break; |
|
619 case SSR2_HLT_SHARE: TFT_print("HLT of MLT", LASTX, LASTY); |
|
620 break; |
|
621 |
|
622 case SSR2_HLT_IND: TFT_print("HLT en MLT", LASTX, LASTY); |
|
623 break; |
|
624 |
|
625 case SSR2_ON_IDLE: TFT_print("Idle", LASTX, LASTY); |
|
626 break; |
|
627 |
|
628 default: TFT_print("N/A", LASTX, LASTY); |
|
629 } |
|
630 } |
619 } |
631 |
620 |
632 |
621 |
633 |
622 |
634 void ShowFloat(uint16_t x, uint16_t y, char *label, char *suffix, float val, int decimals) |
623 void ShowFloat(uint16_t x, uint16_t y, char *label, char *suffix, float val, int decimals) |
943 |
932 |
944 _bg = TFT_BLACK; |
933 _bg = TFT_BLACK; |
945 TFT_fillScreen(_bg); |
934 TFT_fillScreen(_bg); |
946 TFT_resetclipwin(); |
935 TFT_resetclipwin(); |
947 TopMessage("Wijzigen"); |
936 TopMessage("Wijzigen"); |
948 TFT_setFont(DEFAULT_FONT, NULL); |
|
949 ShowSSR2(2, 28, value); |
|
950 |
937 |
951 Buttons_Clear(); |
938 Buttons_Clear(); |
952 Buttons_Add( 20, 60,120, 40, "Uit", 0); |
939 Buttons_Add( 20, 60,120, 40, (char *)SSR2Types[0], 0); |
953 Buttons_Add(180, 60,120, 40, "HLT of MLT", 1); |
940 Buttons_Add(180, 60,120, 40, (char *)SSR2Types[1], 1); |
954 Buttons_Add( 20, 130,120, 40, "HLT en MLT", 2); |
941 Buttons_Add( 20, 130,120, 40, (char *)SSR2Types[2], 2); |
955 Buttons_Add(180, 130,120, 40, "Idle", 3); |
942 Buttons_Add(180, 130,120, 40, (char *)SSR2Types[3], 3); |
956 Buttons_Add(120, 200, 80, 40, "Ok", 4); |
943 Buttons_Add(120, 200, 80, 40, "Ok", 4); |
|
944 Buttons[4].dark = true; |
|
945 Buttons[value].lock = true; |
957 Buttons_Show(); |
946 Buttons_Show(); |
958 |
947 |
959 while (loop) { |
948 while (loop) { |
960 key = Buttons_Scan(); |
949 key = Buttons_Scan(); |
961 |
950 |
962 if (key >= 0 && key <= 3) { |
951 if (key >= 0 && key <= 3) { |
|
952 Buttons[value].lock = false; |
963 value = key; |
953 value = key; |
964 TFT_setFont(DEFAULT_FONT, NULL); |
954 Buttons[value].lock = true; |
965 ShowSSR2(2, 28, value); |
955 Buttons_Show(); |
966 } else if (key == 4) { |
956 } else if (key == 4) { |
967 loop = false; |
957 loop = false; |
968 } |
958 } |
969 vTaskDelay(20 / portTICK_PERIOD_MS); |
959 vTaskDelay(20 / portTICK_PERIOD_MS); |
970 } |
960 } |
971 *val = value; |
961 *val = value; |
|
962 } |
|
963 |
|
964 |
|
965 |
|
966 void EditMashType(uint8_t *val) |
|
967 { |
|
968 bool loop = true; |
|
969 int value = (int)*val; |
|
970 int key; |
|
971 |
|
972 _bg = TFT_BLACK; |
|
973 TFT_fillScreen(_bg); |
|
974 TFT_resetclipwin(); |
|
975 TopMessage("Wijzigen"); |
|
976 |
|
977 Buttons_Clear(); |
|
978 Buttons_Add( 80, 40,160, 40, (char *)mashTypes[0], 0); |
|
979 Buttons_Add( 80, 90,160, 40, (char *)mashTypes[1], 1); |
|
980 Buttons_Add( 80, 140,160, 40, (char *)mashTypes[2], 2); |
|
981 Buttons_Add(120, 200, 80, 40, "Ok", 3); |
|
982 Buttons[3].dark = true; |
|
983 Buttons[value].lock = true; |
|
984 Buttons_Show(); |
|
985 |
|
986 while (loop) { |
|
987 key = Buttons_Scan(); |
|
988 |
|
989 if (key >= 0 && key <= 2) { |
|
990 Buttons[value].lock = false; |
|
991 value = key; |
|
992 Buttons[value].lock = true; |
|
993 Buttons_Show(); |
|
994 } else if (key == 3) { |
|
995 loop = false; |
|
996 } |
|
997 vTaskDelay(20 / portTICK_PERIOD_MS); |
|
998 } |
|
999 Buttons[value].lock = false; |
|
1000 *val = (uint8_t)value; |
972 } |
1001 } |
973 |
1002 |
974 |
1003 |
975 |
1004 |
976 int Confirm(char *top, char *ack, char *nak) |
1005 int Confirm(char *top, char *ack, char *nak) |