Files
CHJ/user/Interface/StdKeyEditDefine.h
2026-03-20 21:16:58 +08:00

139 lines
5.4 KiB
C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __StdKeyEditDefine_h__
#define __StdKeyEditDefine_h__
//low power keyboard define
#define KEYBOARD_IDLE_TIME_BASIC (4095) // 键盘闲置时间 1S
#define KEYBOARD_IDLE_TIME (60)
#define LEVEL_1_PASSWORD 85139
#define LEVEL_2_PASSWORD 22222 //22222
#define LEVEL_3_PASSWORD 00520
#define LEVEL_4_PASSWORD 44444 //44444
#define KEY_INIT_PASSWORD 0
#define KEY_SET_METERFACTOR 1
#define KEY_SET_COEFFIC 2
#define KEY_CALIB_OFFSETC 3
#define KEY_SET_PULSE 4
#define KEY_SET_ADDR 5
#define KEY_SET_DECIMAL_POINT 6
#define KEY_SET_RETURN 7
//******************************************************************************
// KEY FUNCTION DEFINE
#define STD_INIT_PASSWORD 0
//接口类F1-F10
#define STD_KEY_PRTCL 1 // F1 通讯协议 PRTCL
#define STD_KEY_ADDR 2 // F2 从机地址 ADDR
#define STD_KEY_BPS 3 // F3 波特率 BPS
// 流量类F11-F30
#define STD_KEY_OFFST 11 // F11 校准零点 OFFST
#define STD_KEY_GCF 12 // F12 GCF GCF
#define STD_KEY_FACTR 13 // F13 仪表系数 FACTR
#define STD_KEY_CORR 14 // F14 二次修正系数 CORR
#define STD_KEY_FS 15 // F15 量程设置 FS
#define STD_KEY_RESPS 16 // F16 响应时间 RESPS
#define STD_KEY_CUT_F 28 // F28 小流量切除 CUT-F
#define STD_KEY_DIAM 29 // F29 管径设置 DIAM
// 显示类F31-F40
#define STD_KEY_UNT_A 31 // F31 累积流量单位 UNT-A
#define STD_KEY_UNT_F 32 // F32 实时流量单位 UNT-F
#define STD_KEY_UNT_P 33 // F33 压力单位 UNT-P
#define STD_KEY_DISP 38 // F38 显示模式 DISP
#define STD_KEY_DIS_LANGUAGE 39 // F39 显示语言模式 LANG
// 模拟接口类F31-F40
#define STD_KEY_PULSE 41 // F41 脉冲当量 PULSE
// 报警类F41-F50
#define STD_KEY_ALM_H 51 // F51 高流量报警 ALM-H
#define STD_KEY_ALM_L 52 // F52 低流量报警 ALM-L
#define STD_KEY_ALM_A 53 // F53 总量报警上限 ALM-A
#define STD_KEY_ALM_T 54 // F54 时间报警 ALM-T
// 无线类F71-F90
#define STD_KEY_LORA_ADDR 71 // F71 LORA本机地址 LR-ID
#define STD_KEY_LORA_ID 72 // F72 LORA上级地址 NETID
#define STD_KEY_LORA_CHAN 73 // F73 LORA信道 LR_CH
// 操作类F91-F98
#define STD_KEY_PASS 91 // F91 设置密码 PASS
#define STD_KEY_CLR_A 92 // F92 清除总流量 CLR-A
#define STD_KEY_CLR_T 93 // F93 清除时间 CLR-T
#define STD_KEY_RESET_DCOEF 94 // F94 恢复二次修正 RS2ND
// 退出
#define STD_KEY_QUIT 99 // F99 退出设置 QUIT
#define STD_RETURN 100 // 退出键盘操作
//******************************************************************************
// 按键功能显示区定义
#define MAX_SET_BIT 6
#define LIST_PROMPT_BASE 9
#define LIST_VALUE_BASE 9
// 按键功能显示区定义
#define FUN_PROMPT1 0
#define FUN_PROMPT2 1
#define FUN_PROMPT3 2
#define FUN_PROMPT4 3
#define FUN_PROMPT5 4
#define FUN_DECIMAL 5 //
#define FUN_CODE_1 10
#define FUN_CODE_2 11
#define FUN_CODE_3 12
#define FUN_CODE_4 13
//******************************************************************************
// 按键保持时间定义
#define KEY_RESPONSE_TIME 1600 //300
#define FLASH_500mS 3000 // for 125ms sampling interrupt //3000
#define LONG_KEY_TIME (FLASH_500mS*5) //(FLASH_1S*3)
#define COMM_KEY_TIME (FLASH_500mS*9) //(FLASH_1S*3)
#define KEY_MAX_TIME 60000
#define KEY_HOLD_TIME 32768
#define KEY_FREE_TIME 1600
//******************************************************************************
#define PARM_LIST_SEL 0x8000
#define NO_SAVE 0x4000
#define NEED_PASSWORD 0x2000
#define NEED_DOT 0x1000
#define OPERATION_CLASS 0x0800
#define FOUR_BIT 4
//******************************************************************************
#define DIS_SET_OFF 0
#define DIS_PARA_INT 1
#define DISPLAY_MENU 2
#define FLASH_BIT 3
#define NO_FLASH_BIT 4
//******************************************************************************
#define NEXT 2
#define SAVE 1
#define NO 0
#define YES 1
//******************************************************************************
#define KEY_NOT_RESPONDING 0
#define KEY_RESPONSE_INPUT 1
#define KEY_IN_SETUP 2
//******************************************************************************
// for key setup pulse unit
#define PULSE_0_1ML_INDEX 0
#define PULSE_1ML_INDEX 1
#define PULSE_10ML_INDEX 2
#define PULSE_100ML_INDEX 3
#define PULSE_1L_INDEX 4
#define PULSE_10L_INDEX 5
#define PULSE_100L_INDEX 6
#define PULSE_1000L_INDEX 7
#define PULSE_MIN_UNIT PULSE_0_1ML
#endif