comparison Discovery/Src/tMenuEditSystem.c @ 520:970d8040c0e3

Moved custom view menu to new tab: In previous version old location of custom views was kept for easier development. After establishing new tab the old implementation has been removed from MenuSystem unit.
author Ideenmodellierer
date Tue, 08 Sep 2020 21:24:14 +0200
parents 06b21f1e47a5
children a9c195be907e
comparison
equal deleted inserted replaced
519:2c49561c8062 520:970d8040c0e3
36 #include "settings.h" // for getLicence() 36 #include "settings.h" // for getLicence()
37 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() 37 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass()
38 #include "tMenu.h" 38 #include "tMenu.h"
39 #include "tMenuEdit.h" 39 #include "tMenuEdit.h"
40 #include "tMenuSystem.h" 40 #include "tMenuSystem.h"
41 #include "tMenuEditCustom.h"
41 #include "motion.h" 42 #include "motion.h"
42 #include "t7.h" 43 #include "t7.h"
43 44
44 45
45 #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */
46 /*#define HAVE_DEBUG_VIEW */ 46 /*#define HAVE_DEBUG_VIEW */
47 static uint8_t infoPage = 0; 47 static uint8_t infoPage = 0;
48 48
49 /* Private function prototypes -----------------------------------------------*/ 49 /* Private function prototypes -----------------------------------------------*/
50 void openEdit_DateTime(void); 50 void openEdit_DateTime(void);
51 void openEdit_Language(void); 51 void openEdit_Language(void);
52 void openEdit_Design(void); 52 void openEdit_Design(void);
53 void openEdit_Customview(void);
54 void openEdit_Information(void); 53 void openEdit_Information(void);
55 void openEdit_Reset(void); 54 void openEdit_Reset(void);
56 void openEdit_CustomviewDivemode(uint8_t line);
57 //void openEdit_ShowDebugInfo(void); 55 //void openEdit_ShowDebugInfo(void);
58 //void openEdit_Salinity(void); 56 //void openEdit_Salinity(void);
59 57
60 /* Announced function prototypes -----------------------------------------------*/ 58 /* Announced function prototypes -----------------------------------------------*/
61 uint8_t OnAction_Date (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 59 uint8_t OnAction_Date (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
74 //uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 72 //uint8_t OnAction_Design_t3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
75 73
76 uint8_t OnAction_Units (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 74 uint8_t OnAction_Units (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
77 uint8_t OnAction_Colorscheme (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 75 uint8_t OnAction_Colorscheme (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
78 uint8_t OnAction_DebugInfo (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 76 uint8_t OnAction_DebugInfo (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
79
80 uint8_t OnAction_CViewTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
81 uint8_t OnAction_CViewStandard (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
82 uint8_t OnAction_CornerTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
83 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
84 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
85 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
86 77
87 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 78 uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
88 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 79 uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
89 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 80 uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
90 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 81 uint8_t OnAction_ResetDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
127 break; 118 break;
128 case 3: 119 case 3:
129 openEdit_Design(); 120 openEdit_Design();
130 break; 121 break;
131 case 4: 122 case 4:
132 openEdit_Customview(); 123 openEdit_Information();
133 break; 124 break;
134 case 5: 125 case 5:
135 openEdit_Information();
136 break;
137 case 6:
138 openEdit_Reset(); 126 openEdit_Reset();
139 break; 127 break;
140 /* 128 /*
141 case 3: 129 case 3:
142 openEdit_DecoFutureTTS(); 130 openEdit_DecoFutureTTS();
147 */ 135 */
148 } 136 }
149 } 137 }
150 else 138 else
151 { 139 {
152 openEdit_CustomviewDivemode(line); 140 openEdit_CustomviewDivemodeMenu(line);
153 } 141 }
154 142
155 } 143 }
156 144
157 /* Private functions ---------------------------------------------------------*/ 145 /* Private functions ---------------------------------------------------------*/
158
159 void openEdit_CustomviewDivemode(uint8_t line)
160 {
161 static uint8_t customviewsSubpage = 0;
162 SSettings *pSettings = settingsGetPointer();
163 extern _Bool WriteSettings;
164 char text[MAX_PAGE_TEXTSIZE];
165 uint16_t tabPosition;
166 uint32_t id;
167
168
169 if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */
170 {
171 customviewsSubpage++;
172 if(customviewsSubpage == CV_SUBPAGE_MAX)
173 {
174 customviewsSubpage = 0;
175 }
176 set_CustomsviewsSubpage(customviewsSubpage);
177 /* rebuild the selection page with the next set of customer views */
178 id = tMSystem_refresh(0, text, &tabPosition, NULL);
179 tM_build_page(id, text, tabPosition, NULL);
180 openMenu(0);
181 }
182 else
183 {
184 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]);
185 if(t7_GetEnabled_customviews() == 0)
186 {
187 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug);
188 }
189 InitMotionDetection(); /* consider new view setup for view selection by motion */
190 exitMenuEdit_to_Menu_with_Menu_Update();
191 }
192 }
193 146
194 147
195 void openEdit_DateTime(void) 148 void openEdit_DateTime(void)
196 { 149 {
197 RTC_DateTypeDef Sdate; 150 RTC_DateTypeDef Sdate;
760 return UPDATE_DIVESETTINGS; 713 return UPDATE_DIVESETTINGS;
761 } 714 }
762 */ 715 */
763 716
764 717
765 void openEdit_Customview(void)
766 {
767 refresh_Customviews();
768
769 write_field_button(StMSYS4_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, "");
770 write_field_button(StMSYS4_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, "");
771
772 write_field_button(StMSYS4_CornerTimeout, 400, 700, ME_Y_LINE3, &FontT48, "");
773 write_field_button(StMSYS4_CornerStandard, 400, 700, ME_Y_LINE4, &FontT48, "");
774
775 write_field_button(StMSYS4_ExtraDisplay, 400, 700, ME_Y_LINE5, &FontT48, "");
776 write_field_button(StMSYS4_MotionCtrl, 400, 700, ME_Y_LINE6, &FontT48, "");
777
778 setEvent(StMSYS4_CViewTimeout, (uint32_t)OnAction_CViewTimeout);
779 setEvent(StMSYS4_CViewStandard, (uint32_t)OnAction_CViewStandard);
780
781 setEvent(StMSYS4_CornerTimeout, (uint32_t)OnAction_CornerTimeout);
782 setEvent(StMSYS4_CornerStandard, (uint32_t)OnAction_CornerStandard);
783
784 setEvent(StMSYS4_ExtraDisplay, (uint32_t)OnAction_ExtraDisplay);
785 setEvent(StMSYS4_MotionCtrl, (uint32_t)OnAction_MotionCtrl);
786 }
787
788
789 void refresh_Customviews(void)
790 {
791 char text[32];
792 uint8_t textpointer = 0;
793
794 // header
795 text[0] = '\001';
796 text[1] = TXT_2BYTE;
797 text[2] = TXT2BYTE_Customviews;
798 text[3] = 0;
799 write_topline(text);
800
801 // custom view center return
802 textpointer = 0;
803 text[textpointer++] = TXT_2BYTE;
804 text[textpointer++] = TXT2BYTE_CViewTimeout;
805 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_customViewTimeout,TXT_Seconds);
806 write_label_var( 30, 700, ME_Y_LINE1, &FontT48, text);
807
808 // custom view center primary
809 text[0] = TXT_2BYTE;
810 text[1] = TXT2BYTE_CViewStandard;
811 text[2] = ' ';
812 text[3] = ' ';
813 switch(settingsGetPointer()->tX_customViewPrimary)
814 {
815 case CVIEW_sensors:
816 text[4] = TXT_2BYTE;
817 text[5] = TXT2BYTE_O2monitor;
818 break;
819 case CVIEW_sensors_mV:
820 text[4] = TXT_2BYTE;
821 text[5] = TXT2BYTE_O2voltage;
822 break;
823 case CVIEW_Compass:
824 text[4] = TXT_2BYTE;
825 text[5] = TXT2BYTE_Compass;
826 break;
827 case CVIEW_Decolist:
828 text[4] = TXT_2BYTE;
829 text[5] = TXT2BYTE_Decolist;
830 break;
831 case CVIEW_Tissues:
832 text[4] = TXT_2BYTE;
833 text[5] = TXT2BYTE_Tissues;
834 break;
835 case CVIEW_Profile:
836 text[4] = TXT_2BYTE;
837 text[5] = TXT2BYTE_Profile;
838 break;
839 case CVIEW_Gaslist:
840 text[4] = TXT_2BYTE;
841 text[5] = TXT2BYTE_Gaslist;
842 break;
843 case CVIEW_EADTime:
844 text[4] = TXT_2BYTE;
845 text[5] = TXT2BYTE_Info;
846 break;
847 case CVIEW_SummaryOfLeftCorner:
848 text[4] = TXT_2BYTE;
849 text[5] = TXT2BYTE_Summary;
850 break;
851 case CVIEW_noneOrDebug:
852 text[4] = ' ';
853 text[5] = '-';
854 break;
855 default:
856 snprintf(&text[4],3,"%02u",settingsGetPointer()->tX_customViewPrimary);
857 break;
858 }
859 text[6] = 0;
860 write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text);
861
862
863 // field corner return
864 textpointer = 0;
865 text[textpointer++] = TXT_2BYTE;
866 text[textpointer++] = TXT2BYTE_CornerTimeout;
867 textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout,TXT_Seconds);
868 write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text);
869
870 // field corner primary
871 text[0] = TXT_2BYTE;
872 text[1] = TXT2BYTE_CornerStandard;
873 text[2] = ' ';
874 text[3] = ' ';
875 switch(settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary)
876 {
877 /* Temperature */
878 case LLC_Temperature:
879 text[4] = TXT_Temperature;
880 break;
881 /* Average Depth */
882 case LLC_AverageDepth:
883 text[4] = TXT_AvgDepth;
884 break;
885 /* ppO2 */
886 case LLC_ppO2:
887 text[4] = TXT_ppO2;
888 break;
889 /* Stop Uhr */
890 case LLC_Stopwatch:
891 text[4] = TXT_Stopwatch;
892 break;
893 /* Ceiling */
894 case LLC_Ceiling:
895 text[4] = TXT_Ceiling;
896 break;
897 /* Future TTS */
898 case LLC_FutureTTS:
899 text[4] = TXT_FutureTTS;
900 break;
901 /* CNS */
902 case LLC_CNS:
903 text[4] = TXT_CNS;
904 break;
905 case LLC_GF:
906 text[4] = TXT_ActualGradient;
907 break;
908 #ifdef ENABLE_BOTTLE_SENSOR
909 case LCC_BottleBar:
910 text[4] = TXT_AtemGasVorrat;
911 break;
912 #endif
913 /* none */
914 case LLC_Empty:
915 text[4] = '-';
916 break;
917 default:
918 snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary);
919 break;
920 }
921 text[5] = 0;
922 write_label_var( 30, 700, ME_Y_LINE4, &FontT48, text);
923
924
925 // extra display
926 text[0] = TXT_2BYTE;
927 text[1] = TXT2BYTE_ExtraDisplay;
928 text[2] = ' ';
929 text[3] = ' ';
930 text[4] = TXT_2BYTE;
931 switch(settingsGetPointer()->extraDisplay)
932 {
933 /* BigFont */
934 case EXTRADISPLAY_BIGFONT:
935 text[5] = TXT2BYTE_ExtraBigFont;
936 break;
937 /* DecoGame */
938 case EXTRADISPLAY_DECOGAME:
939 text[5] = TXT2BYTE_ExtraDecoGame;
940 break;
941 /* none */
942 case EXTRADISPLAY_none:
943 text[5] = TXT2BYTE_ExtraNone;
944 break;
945
946 default:
947 snprintf(&text[4],2,"%u",settingsGetPointer()->extraDisplay);
948 break;
949 }
950 text[6] = 0;
951 write_label_var( 30, 700, ME_Y_LINE5, &FontT48, text);
952
953
954 /* MotionCtrl */
955 text[0] = TXT_2BYTE;
956 text[1] = TXT2BYTE_MotionCtrl;
957 text[2] = ' ';
958 text[3] = ' ';
959 text[4] = TXT_2BYTE;
960 switch(settingsGetPointer()->MotionDetection)
961 {
962 case MOTION_DETECT_OFF:
963 text[5] = TXT2BYTE_MoCtrlNone;
964 break;
965 case MOTION_DETECT_MOVE:
966 text[5] = TXT2BYTE_MoCtrlPitch;
967 break;
968 case MOTION_DETECT_SECTOR:
969 text[5] = TXT2BYTE_MoCtrlSector;
970 break;
971 case MOTION_DETECT_SCROLL:
972 text[5] = TXT2BYTE_MoCtrlScroll;
973 break;
974 default:
975 snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection);
976 break;
977 }
978 text[6] = 0;
979 write_label_var( 30, 700, ME_Y_LINE6, &FontT48, text);
980
981 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
982 }
983
984
985 uint8_t OnAction_CViewTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
986 {
987 uint8_t value;
988 value = settingsGetPointer()->tX_customViewTimeout;
989
990 if(value < 5)
991 value = 5;
992 else if(value < 10)
993 value = 10;
994 else if(value < 15)
995 value = 15;
996 else if(value < 20)
997 value = 20;
998 else if(value < 30)
999 value = 30;
1000 else if(value < 45)
1001 value = 45;
1002 else if(value < 60)
1003 value = 60;
1004 else
1005 value = 0;
1006
1007 settingsGetPointer()->tX_customViewTimeout = value;
1008 return UPDATE_DIVESETTINGS;
1009 }
1010
1011
1012 uint8_t OnAction_CViewStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
1013 {
1014 uint8_t newValue;
1015 switch(settingsGetPointer()->tX_customViewPrimary)
1016 {
1017 case CVIEW_sensors:
1018 newValue = CVIEW_sensors_mV;
1019 break;
1020 case CVIEW_sensors_mV:
1021 newValue = CVIEW_Compass;
1022 break;
1023 case CVIEW_Compass:
1024 newValue = CVIEW_Decolist;
1025 break;
1026 case CVIEW_Decolist:
1027 newValue = CVIEW_Tissues;
1028 break;
1029 case CVIEW_Tissues:
1030 newValue = CVIEW_Profile;
1031 break;
1032 case CVIEW_Profile:
1033 newValue = CVIEW_Gaslist;
1034 break;
1035 case CVIEW_Gaslist:
1036 newValue = CVIEW_EADTime;
1037 break;
1038 case CVIEW_EADTime:
1039 newValue = CVIEW_SummaryOfLeftCorner;
1040 break;
1041 case CVIEW_SummaryOfLeftCorner:
1042 newValue = CVIEW_noneOrDebug;
1043 break;
1044 case CVIEW_noneOrDebug:
1045 default:
1046 newValue = CVIEW_sensors;
1047 break;
1048 }
1049 settingsGetPointer()->tX_customViewPrimary = newValue;
1050 return UPDATE_DIVESETTINGS;
1051 }
1052
1053
1054 uint8_t OnAction_CornerTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
1055 {
1056 uint8_t value;
1057 value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout;
1058
1059 if(value < 5)
1060 value = 5;
1061 else if(value < 10)
1062 value = 10;
1063 else if(value < 15)
1064 value = 15;
1065 else if(value < 20)
1066 value = 20;
1067 else if(value < 30)
1068 value = 30;
1069 else if(value < 45)
1070 value = 45;
1071 else if(value < 60)
1072 value = 60;
1073 else
1074 value = 0;
1075
1076 settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout = value;
1077 return UPDATE_DIVESETTINGS;
1078 }
1079
1080
1081 uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
1082 {
1083 uint8_t value;
1084 value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
1085
1086 value += 1;
1087
1088 if(value >= LLC_END)
1089 value = 0;
1090
1091 settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary = value;
1092 return UPDATE_DIVESETTINGS;
1093 }
1094
1095
1096 uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
1097 {
1098 uint8_t newValue;
1099
1100 newValue = settingsGetPointer()->extraDisplay + 1;
1101 if(newValue == EXTRADISPLAY_DECOGAME) /* Decogame not yet implemented */
1102 {
1103 newValue++;
1104 }
1105 if(newValue >= EXTRADISPLAY_END)
1106 {
1107 newValue = EXTRADISPLAY_none;
1108 }
1109 settingsGetPointer()->extraDisplay = newValue;
1110 return UNSPECIFIC_RETURN;
1111 }
1112
1113
1114 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
1115 {
1116 uint8_t newValue;
1117 switch(settingsGetPointer()->MotionDetection)
1118 {
1119 case MOTION_DETECT_OFF:
1120 newValue = MOTION_DETECT_MOVE;
1121 break;
1122 case MOTION_DETECT_MOVE:
1123 newValue = MOTION_DETECT_SECTOR;
1124 break;
1125 case MOTION_DETECT_SECTOR:
1126 newValue = MOTION_DETECT_SCROLL;
1127 break;
1128 case MOTION_DETECT_SCROLL:
1129 newValue = MOTION_DETECT_OFF;
1130 break;
1131 default:
1132 newValue = MOTION_DETECT_OFF;
1133 break;
1134 }
1135 settingsGetPointer()->MotionDetection = newValue;
1136 InitMotionDetection();
1137 return UNSPECIFIC_RETURN;
1138 }
1139 718
1140 void openEdit_Information(void) 719 void openEdit_Information(void)
1141 { 720 {
1142 char text[70]; 721 char text[70];
1143 722
1150 729
1151 text[0] = TXT_2BYTE; 730 text[0] = TXT_2BYTE;
1152 text[1] = TXT2BYTE_ButtonNext; 731 text[1] = TXT2BYTE_ButtonNext;
1153 text[2] = 0; 732 text[2] = 0;
1154 733
1155 write_field_button(StMSYS5_Info, 30, 800, ME_Y_LINE6, &FontT48, text); 734 write_field_button(StMSYS4_Info, 30, 800, ME_Y_LINE6, &FontT48, text);
1156 735
1157 setEvent(StMSYS5_Info, (uint32_t)OnAction_Information); 736 setEvent(StMSYS4_Info, (uint32_t)OnAction_Information);
1158 } 737 }
1159 738
1160 739
1161 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) 740 uint8_t OnAction_Information (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
1162 { 741 {
1338 text_button[2] = 0; 917 text_button[2] = 0;
1339 break; 918 break;
1340 } 919 }
1341 920
1342 write_topline(text_header); 921 write_topline(text_header);
1343 tMenuEdit_newButtonText(StMSYS5_Info, text_button); 922 tMenuEdit_newButtonText(StMSYS4_Info, text_button);
1344 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0); 923 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0);
1345 } 924 }
1346 925
1347 926
1348 void openEdit_Reset(void) 927 void openEdit_Reset(void)
1359 text[1] = TXT2BYTE_LogbookOffset; 938 text[1] = TXT2BYTE_LogbookOffset;
1360 text[7] = 0; 939 text[7] = 0;
1361 940
1362 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text); 941 write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text);
1363 942
1364 write_field_udigit(StMSYS6_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); 943 write_field_udigit(StMSYS5_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0);
1365 944
1366 text[0] = TXT_2BYTE; 945 text[0] = TXT_2BYTE;
1367 text[2] = 0; 946 text[2] = 0;
1368 947
1369 text[1] = TXT2BYTE_ResetAll; 948 text[1] = TXT2BYTE_ResetAll;
1370 write_field_button(StMSYS6_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); 949 write_field_button(StMSYS5_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text);
1371 950
1372 text[1] = TXT2BYTE_ResetDeco; 951 text[1] = TXT2BYTE_ResetDeco;
1373 write_field_button(StMSYS6_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); 952 write_field_button(StMSYS5_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text);
1374 953
1375 text[1] = TXT2BYTE_Reboot; 954 text[1] = TXT2BYTE_Reboot;
1376 write_field_button(StMSYS6_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); 955 write_field_button(StMSYS5_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text);
1377 956
1378 text[1] = TXT2BYTE_Maintenance; 957 text[1] = TXT2BYTE_Maintenance;
1379 write_field_button(StMSYS6_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); 958 write_field_button(StMSYS5_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text);
1380 959
1381 #ifndef RESETLOGBLOCK 960 #ifndef RESETLOGBLOCK
1382 text[1] = TXT2BYTE_ResetLogbook; 961 text[1] = TXT2BYTE_ResetLogbook;
1383 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); 962 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text);
1384 #else 963 #else
1385 text[0] = '\021'; 964 text[0] = '\021';
1386 text[1] = TXT_2BYTE; 965 text[1] = TXT_2BYTE;
1387 text[2] = TXT2BYTE_ResetLogbook; 966 text[2] = TXT2BYTE_ResetLogbook;
1388 text[3] = 0; 967 text[3] = 0;
1389 write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); 968 write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text);
1390 text[0] = TXT_2BYTE; 969 text[0] = TXT_2BYTE;
1391 text[2] = 0; 970 text[2] = 0;
1392 #endif 971 #endif
1393 972
1394 setEvent(StMSYS6_LogbookOffset, (uint32_t)OnAction_LogbookOffset); 973 setEvent(StMSYS5_LogbookOffset, (uint32_t)OnAction_LogbookOffset);
1395 setEvent(StMSYS6_ResetAll, (uint32_t)OnAction_Confirm); 974 setEvent(StMSYS5_ResetAll, (uint32_t)OnAction_Confirm);
1396 setEvent(StMSYS6_ResetDeco, (uint32_t)OnAction_Confirm); 975 setEvent(StMSYS5_ResetDeco, (uint32_t)OnAction_Confirm);
1397 setEvent(StMSYS6_Reboot, (uint32_t)OnAction_Confirm); 976 setEvent(StMSYS5_Reboot, (uint32_t)OnAction_Confirm);
1398 setEvent(StMSYS6_Maintenance, (uint32_t)OnAction_Confirm); 977 setEvent(StMSYS5_Maintenance, (uint32_t)OnAction_Confirm);
1399 #ifndef RESETLOGBLOCK 978 #ifndef RESETLOGBLOCK
1400 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Confirm); 979 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Confirm);
1401 #else 980 #else
1402 setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Nothing); 981 setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Nothing);
1403 #endif 982 #endif
1404 983
1405 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); 984 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
1406 } 985 }
1407 986
1420 999
1421 text[0] = TXT_2BYTE; 1000 text[0] = TXT_2BYTE;
1422 text[2] = 0; 1001 text[2] = 0;
1423 text[1] = TXT2BYTE_Abort; 1002 text[1] = TXT2BYTE_Abort;
1424 1003
1425 write_field_button(StMSYS6_Exit, 30, 800, ME_Y_LINE1, &FontT48, text); 1004 write_field_button(StMSYS5_Exit, 30, 800, ME_Y_LINE1, &FontT48, text);
1426 1005
1427 text[2] = 0; 1006 text[2] = 0;
1428 text[3] = 0; 1007 text[3] = 0;
1429 switch(editIdOfCaller) 1008 switch(editIdOfCaller)
1430 { 1009 {
1431 case StMSYS6_Reboot: 1010 case StMSYS5_Reboot:
1432 case StMSYS6_RebootRTE: 1011 case StMSYS5_RebootRTE:
1433 case StMSYS6_RebootMainCPU: 1012 case StMSYS5_RebootMainCPU:
1434 text[1] = TXT2BYTE_RebootMainCPU; 1013 text[1] = TXT2BYTE_RebootMainCPU;
1435 write_field_button(StMSYS6_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text); 1014 write_field_button(StMSYS5_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text);
1436 text[1] = TXT2BYTE_RebootRTE; 1015 text[1] = TXT2BYTE_RebootRTE;
1437 write_field_button(StMSYS6_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text); 1016 write_field_button(StMSYS5_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text);
1438 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); 1017 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
1439 setEvent(StMSYS6_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU); 1018 setEvent(StMSYS5_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU);
1440 setEvent(StMSYS6_RebootRTE, (uint32_t)OnAction_RebootRTE); 1019 setEvent(StMSYS5_RebootRTE, (uint32_t)OnAction_RebootRTE);
1441 text[0] = '\025'; 1020 text[0] = '\025';
1442 text[1] = TXT_2BYTE; 1021 text[1] = TXT_2BYTE;
1443 text[2] = TXT2BYTE_DecoDataLost; 1022 text[2] = TXT2BYTE_DecoDataLost;
1444 text[3] = 0; 1023 text[3] = 0;
1445 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); 1024 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text);
1446 break; 1025 break;
1447 1026
1448 case StMSYS6_ResetDeco: 1027 case StMSYS5_ResetDeco:
1449 text[1] = TXT2BYTE_ResetDeco; 1028 text[1] = TXT2BYTE_ResetDeco;
1450 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); 1029 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
1451 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); 1030 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
1452 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco); 1031 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco);
1453 text[0] = '\025'; 1032 text[0] = '\025';
1454 text[1] = TXT_2BYTE; 1033 text[1] = TXT_2BYTE;
1455 text[2] = TXT2BYTE_DecoDataLost; 1034 text[2] = TXT2BYTE_DecoDataLost;
1456 text[3] = 0; 1035 text[3] = 0;
1457 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); 1036 write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text);
1458 break; 1037 break;
1459 1038
1460 case StMSYS6_ResetAll: 1039 case StMSYS5_ResetAll:
1461 text[1] = TXT2BYTE_ResetAll; 1040 text[1] = TXT2BYTE_ResetAll;
1462 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); 1041 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
1463 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); 1042 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
1464 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll); 1043 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll);
1465 break; 1044 break;
1466 1045
1467 case StMSYS6_ResetLogbook: 1046 case StMSYS5_ResetLogbook:
1468 text[1] = TXT2BYTE_ResetLogbook; 1047 text[1] = TXT2BYTE_ResetLogbook;
1469 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); 1048 write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text);
1470 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); 1049 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
1471 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook); 1050 setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook);
1472 break; 1051 break;
1473 1052
1474 case StMSYS6_Maintenance: 1053 case StMSYS5_Maintenance:
1475 case StMSYS6_SetBattCharge: 1054 case StMSYS5_SetBattCharge:
1476 case StMSYS6_SetSampleIndx: 1055 case StMSYS5_SetSampleIndx:
1477 text[0] = TXT_2BYTE; 1056 text[0] = TXT_2BYTE;
1478 text[1] = TXT2BYTE_SetFactoryDefaults; 1057 text[1] = TXT2BYTE_SetFactoryDefaults;
1479 text[2] = 0; 1058 text[2] = 0;
1480 write_field_button(StMSYS6_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); 1059 write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text);
1481 1060
1482 #ifdef ENABLE_ANALYSE_SAMPLES 1061 #ifdef ENABLE_ANALYSE_SAMPLES
1483 text[0] = TXT_2BYTE; 1062 text[0] = TXT_2BYTE;
1484 text[1] = TXT2BYTE_SetSampleIndex; 1063 text[1] = TXT2BYTE_SetSampleIndex;
1485 text[2] = 0; 1064 text[2] = 0;
1486 write_field_button(StMSYS6_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text); 1065 write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text);
1487 #endif 1066 #endif
1488 1067
1489 1068
1490 if(stateRealGetPointer()->lifeData.battery_charge == 0) 1069 if(stateRealGetPointer()->lifeData.battery_charge == 0)
1491 { 1070 {
1492 text[0] = TXT_2BYTE; 1071 text[0] = TXT_2BYTE;
1493 text[1] = TXT2BYTE_SetBatteryCharge; 1072 text[1] = TXT2BYTE_SetBatteryCharge;
1494 text[2] = 0; 1073 text[2] = 0;
1495 snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage); 1074 snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage);
1496 #ifdef ENABLE_ANALYSE_SAMPLES 1075 #ifdef ENABLE_ANALYSE_SAMPLES
1497 write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text); 1076 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text);
1498 #else 1077 #else
1499 write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); 1078 write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text);
1500 #endif 1079 #endif
1501 1080
1502 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); 1081 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
1503 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); 1082 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults);
1504 #ifdef ENABLE_ANALYSE_SAMPLES 1083 #ifdef ENABLE_ANALYSE_SAMPLES
1505 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); 1084 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx);
1506 #endif 1085 #endif
1507 setEvent(StMSYS6_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); 1086 setEvent(StMSYS5_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge);
1508 } 1087 }
1509 else 1088 else
1510 { 1089 {
1511 setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); 1090 setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit);
1512 setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); 1091 setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults);
1513 #ifdef ENABLE_ANALYSE_SAMPLES 1092 #ifdef ENABLE_ANALYSE_SAMPLES
1514 setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); 1093 setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx);
1515 #endif 1094 #endif
1516 } 1095 }
1517 // write_field_button(StMSYS6_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); 1096 // write_field_button(StMSYS5_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test");
1518 // setEvent(StMSYS6_ScreenTest, (uint32_t)OnAction_ScreenTest); 1097 // setEvent(StMSYS5_ScreenTest, (uint32_t)OnAction_ScreenTest);
1519 1098
1520 text[0] = TXT_2BYTE; 1099 text[0] = TXT_2BYTE;
1521 text[1] = TXT2BYTE_WarnBatteryLow; 1100 text[1] = TXT2BYTE_WarnBatteryLow;
1522 text[2] = 0; 1101 text[2] = 0;
1523 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage); 1102 snprintf(&text[2],10,": %01.2fV",stateRealGetPointer()->lifeData.battery_voltage);
1659 tTestScreen.FBStartAdress = 0; 1238 tTestScreen.FBStartAdress = 0;
1660 tTestScreen.ImageHeight = 480; 1239 tTestScreen.ImageHeight = 480;
1661 tTestScreen.ImageWidth = 800; 1240 tTestScreen.ImageWidth = 800;
1662 tTestScreen.LayerIndex = 1; 1241 tTestScreen.LayerIndex = 1;
1663 1242
1664 set_globalState(StMSYS6_ScreenTest); 1243 set_globalState(StMSYS5_ScreenTest);
1665 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount); 1244 tTestScreen.FBStartAdress = getFrameByNumber(FrameCount);
1666 if(tTestScreen.FBStartAdress == 0) 1245 if(tTestScreen.FBStartAdress == 0)
1667 { 1246 {
1668 extern uint8_t bootToBootloader; 1247 extern uint8_t bootToBootloader;
1669 bootToBootloader = 1; 1248 bootToBootloader = 1;