6 #define RATE_MAX_NUMBER 4
7 #define POWER_MAX_NUMBER 8
8 #define RATIO_MAX_NUMBER 8
9 #define POWERSAVING_MAX_NUMBER 2
10 #define SMARTFAN_MAX_NUMBER 3
12 #define VERSION_MAX_LENGTH 6
17 #define IMAGE_MOTION 3
25 MAIN_MENU_RATE_INDEX
= 1,
26 MAIN_MENU_POWER_INDEX
,
27 MAIN_MENU_RATIO_INDEX
,
28 MAIN_MENU_POWERSAVING_INDEX
,
29 MAIN_MENU_SMARTFAN_INDEX
,
31 MAIN_MENU_UPDATEFW_INDEX
32 } Screen_MainMenuIndex_t
;
36 PAGE_MAIN_MENU_INDEX
= 0,
37 PAGE_SUB_RATE_INDEX
= 1,
38 PAGE_SUB_POWER_INDEX
= 2,
39 PAGE_SUB_RATIO_INDEX
= 3,
40 PAGE_SUB_POWERSAVING_INDEX
= 4,
41 PAGE_SUB_SMARTFAN_INDEX
= 5,
43 PAGE_SUB_BIND_INDEX
= 6,
44 PAGE_SUB_UPDATEFW_INDEX
= 7,
46 PAGE_SUB_BINDING_INDEX
= 16
55 USER_ACTION_RIGHT
= 4,
56 USER_ACTION_CONFIRM
= 5
61 SCREEN_STATUS_INIT
= 0,
62 SCREEN_STATUS_IDLE
= 1,
63 SCREEN_STATUS_WORK
= 2,
64 SCREEN_STATUS_BINDING
= 3
70 USER_POWERSAVING_OFF
= 0,
71 USER_POWERSAVING_ON
= 1
72 } Screen_User_PowerSaving_t
;
76 USER_SMARTFAN_AUTO
= 0,
77 USER_SMARTFAN_ALAYWS_ON
= 1,
79 } Screen_User_SMARTFAN_t
;
84 USER_UPDATE_TYPE_RATE
= 0,
85 USER_UPDATE_TYPE_POWER
= 1,
86 USER_UPDATE_TYPE_RATIO
= 2,
87 USER_UPDATE_TYPE_POWERSAVING
= 3,
88 USER_UPDATE_TYPE_SMARTFAN
= 4,
89 USER_UPDATE_TYPE_BINDING
= 5,
90 USER_UPDATE_TYPE_EXIT_BINDING
= 6,
91 USER_UPDATE_TYPE_WIFI
= 7,
92 USER_UPDATE_TYPE_EXIT_WIFI
= 8
93 } Screen_Update_Type_t
;
97 SCREEN_BACKLIGHT_ON
= 0,
98 SCREEN_BACKLIGHT_OFF
= 1
105 void doMainMenuPage(int action
);
107 void doPageForward();
108 void doValueConfirm();
112 int current_page_index
;
113 int main_menu_page_index
;
114 int current_rate_index
;
115 int current_power_index
;
116 int current_ratio_index
;
117 int current_powersaving_index
;
118 int current_smartfan_index
;
120 int current_screen_status
;
122 uint8_t system_temperature
;
124 void nextIndex(int &index
, int action
, int min
, int max
);
125 void nextIndex(int &index
, int action
, int max
) { nextIndex(index
, action
, 0, max
); }
126 void doValueSelection(int action
);
128 virtual void doRateValueSelect(int action
) = 0;
129 virtual void doPowerValueSelect(int action
) = 0;
130 virtual void doRatioValueSelect(int action
) = 0;
131 virtual void doPowerSavingValueSelect(int action
) = 0;
132 virtual void doSmartFanValueSelect(int action
) = 0;
134 virtual void updateMainMenuPage() = 0;
135 virtual void updateSubFunctionPage() = 0;
136 virtual void updateSubWIFIModePage() = 0;
137 virtual void updateSubBindConfirmPage() = 0;
138 virtual void updateSubBindingPage() = 0;
141 static const char *rate_string
[RATE_MAX_NUMBER
];
142 static const char *power_string
[POWER_MAX_NUMBER
];
143 static const char *ratio_string
[RATIO_MAX_NUMBER
];
144 static const char *powersaving_string
[POWERSAVING_MAX_NUMBER
];
145 static const char *smartfan_string
[SMARTFAN_MAX_NUMBER
];
146 static const char *main_menu_line_1
[];
147 static const char *main_menu_line_2
[];
150 static void nullCallback(int updateType
);
151 static void (*updatecallback
)(int updateType
);
153 virtual void init(bool reboot
) = 0;
154 virtual void idleScreen() = 0;
155 virtual void doParamUpdate(uint8_t rate_index
, uint8_t power_index
, uint8_t ratio_index
, uint8_t motion_index
, uint8_t fan_index
) = 0;
156 virtual void doTemperatureUpdate(uint8_t temperature
) = 0;
157 virtual void doScreenBackLight(int state
) = 0;
160 void doUserAction(int action
);
161 void setInWifiMode();
163 int getUserRateIndex() { return current_rate_index
; }
164 int getUserPowerIndex() { return current_power_index
; }
165 int getUserRatioIndex() { return current_ratio_index
; }
166 int getScreenStatus() { return current_screen_status
; }
167 int getUserPowerSavingIndex() { return current_powersaving_index
; }
168 int getUserSmartFanIndex() { return current_smartfan_index
; }