Вс ноя 19, 2023 12:32:32
LCDML_add (0 , LCDML_0 , 1 , "Finance" , NULL); // NULL = no menu function
LCDML_add (1 , LCDML_0 , 2 , "Devices" , NULL); // NULL = no menu function
LCDML_add (2 , LCDML_0 , 3 , "Settings", NULL); // NULL = no menu function
LCDML_add (3 , LCDML_0 , 4 , "Prices" , NULL); // NULL = no menu function
LCDML_add (4 , LCDML_0 , 5 , "Operating Mode" , NULL); // NULL = no menu function
LCDML_add (5 , LCDML_0 , 6 , "Encashment", NULL); // NULL = no menu function
LCDML_add (6 , LCDML_0 , 7 , "Control" , NULL); // NULL = no menu function
LCDML_add (7 , LCDML_0 , 8 , "Log" , NULL); // NULL = no menu function
Вс ноя 19, 2023 16:04:06
Вс ноя 19, 2023 17:15:58
Вс ноя 19, 2023 21:59:36
Пн ноя 20, 2023 15:42:09
//==================
#ifndef MENU_H
#define MENU_H
#include "menu.h"
#include "main_def_func.h"
//==================
//==================
// Typedefs:
typedef void (*FuncPtr)(void);
//==================
//==================
typedef struct menu_item
{
void *Parent;
void *Child;
void *Next;
void *Prev;
FuncPtr Esc_Func;
FuncPtr Enter_Func;
FuncPtr Next_Func;
FuncPtr Prev_Func;
FuncPtr Plus_Func;
FuncPtr Minus_Func;
FuncPtr Num_Func;
FuncPtr Menu_Init_Func;
FuncPtr Prm_Func;
char __flash *Text;
} menu_item;
//==================
// Externs:
//==================
extern menu_item __flash *CurrMenuItem; // Текущий пункт меню.
extern menu_item __flash Null_Menu;
//==================
// Defines and Macros:
//==================
#define NULL_ENTRY Null_Menu
#define NULL_FUNC (void*)0
#define NULL_TEXT ""
#define PAGE_MENU 3
//==================
//==================
#define MAKE_MENU(Name, Parent, Child, Next, Prev, Esc_Func, Enter_Func, Next_Func, Prev_Func, Plus_Func, Minus_Func, Num_Func, Menu_Init_Func, Prm_Func, Text) \
extern menu_item __flash Parent; \
extern menu_item __flash Child; \
extern menu_item __flash Next; \
extern menu_item __flash Prev; \
menu_item __flash Name = \
{ \
(menu_item*) &Parent, \
(menu_item*) &Child, \
(menu_item*) &Next, \
(menu_item*) &Prev, \
Esc_Func, \
Enter_Func, \
Next_Func, \
Prev_Func, \
Plus_Func, \
Minus_Func, \
Num_Func, \
Menu_Init_Func, \
Prm_Func, \
{Text} \
}
//==================
//==================
#define PARENT *((menu_item __flash*) (CurrMenuItem->Parent))
#define CHILD *((menu_item __flash*) (CurrMenuItem->Child))
#define NEXT *((menu_item __flash*) (CurrMenuItem->Next))
#define PREV *((menu_item __flash*) (CurrMenuItem->Prev))
#define ESC_FUNC *((FuncPtr) (CurrMenuItem->Esc_Func))
#define ENTER_FUNC *((FuncPtr) (CurrMenuItem->Enter_Func))
#define NEXT_FUNC *((FuncPtr) (CurrMenuItem->Next_Func))
#define PREV_FUNC *((FuncPtr) (CurrMenuItem->Prev_Func))
#define PLUS_FUNC *((FuncPtr) (CurrMenuItem->Plus_Func))
#define MINUS_FUNC *((FuncPtr) (CurrMenuItem->Minus_Func))
#define NUM_FUNC *((FuncPtr) (CurrMenuItem->Num_Func))
#define MENU_INIT_FUNC *((FuncPtr) (CurrMenuItem->Menu_Init_Func))
#define PRM_FUNC *((FuncPtr) (CurrMenuItem->Prm_Func))
//==================
//==================
#define SET_MENU_LEVEL(x) \
Set_Menu_Level(&x)
#define SET_MENU_ITEM(x) \
Set_Menu_Item(&x)
#define GO_MENU_FUNC(x) \
MenuFunc((FuncPtr*)&x)
#define EXTERN_MENU(Name) \
extern menu_item __flash Name;
#define CHK_CHANGE_MENU(x) \
chk_change_menu(&x)
//==================
//==================
enum
{
SET_LEVEL = 0,
SET_NEXT,
SET_PREV,
};
//==================
// Prototypes:
//==================
bool Set_Menu_Level (menu_item __flash *NewMenu);
bool Set_Menu_Item (menu_item __flash *NewMenu);
bool MenuFunc (FuncPtr* Function);
bool chk_change_menu (menu_item __flash *NewMenu);
//==================
//==================
bool proc_menu_keys (void);
//==================
//==================
void Out_Menu_Items_Init (void);
void Out_Menu_Items (void);
//==================
//==================
void Out_Name_Level (void);
u08 Count_Chars (char __flash *data);
void Make_Page_Menu (void);
void Inc_Pos_Y_Curs (void);
void Dec_Pos_Y_Curs (void);
void Set_Pos_Curs (void);
//==================
//==================
bool Proc_Menu_Keys (void);
//==================
//==================
u08 Get_Pos_y_Curs (void);
//==================
//==================
u08 Get_Quant_Items (void);
//==================
//==================
menu_item __flash * Get_BeginCurrMenuLevel (void);
//==================
//==================
menu_item __flash * Get_CurrMenuItem (void);
//==================
//==================
char __flash * Get_Menu_Item_Text (u08 i);
//==================
//==================
u08 Get_Count_Chars (void);
//==================
#endif
MAKE_MENU (L_TENS, L_OUT_MODE, L_TEN_1, L_DEFLATE, NULL_ENTRY, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "ТЭНЫ");
MAKE_MENU (L_DEFLATE, L_OUT_MODE, L_DEFLATE_MODE, L_TIMEOUTS, L_TENS, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "СДУВ");
MAKE_MENU (L_TIMEOUTS, L_OUT_MODE, L_SENS_1, L_PART, L_DEFLATE, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "ТАЙМАУТЫ");
MAKE_MENU (L_PART, L_OUT_MODE, L_SUB_PART, L_BRIGHT, L_TIMEOUTS, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "ПАРТИЯ");
MAKE_MENU (L_BRIGHT, L_OUT_MODE, L_SUB_BRIGHT, L_TEST_INPUTS, L_PART, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "ЯРКОСТЬ");
MAKE_MENU (L_TEST_INPUTS, L_OUT_MODE, L_TEST_INPUTS_1, L_TEST_AUTOMAT, L_BRIGHT, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "TEST INPUTS");
MAKE_MENU (L_TEST_AUTOMAT, L_OUT_MODE, L_SUB_TEST_AUTOMAT_1, L_TEST_ERRORS_VAL, L_TEST_INPUTS, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "TEST AUTOMAT");
MAKE_MENU (L_TEST_ERRORS_VAL, L_OUT_MODE, L_SUB_TEST_ERRORS_VAL_1, NULL_ENTRY, L_TEST_AUTOMAT, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, NULL_FUNC, Info_Service_Out_Menu_Init, NULL_FUNC, "TEST ERRORS VAL");
Пн ноя 20, 2023 18:54:47
Пн ноя 20, 2023 23:05:09
Пн ноя 20, 2023 23:13:18
Вт ноя 21, 2023 09:47:23
Чт ноя 23, 2023 12:14:51