From fa6053f85287163f6e2d5dba690bec05cbc95f4a Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Fri, 07 Jun 2024 17:00:49 +0800
Subject: [PATCH] 增加阀控事件记录及修改阀控命令
---
Function/STORAGE/system_mem_para.h | 105 +++++++++++++++++++++++++++++++++++++---------------
1 files changed, 74 insertions(+), 31 deletions(-)
diff --git a/Function/STORAGE/system_mem_para.h b/Function/STORAGE/system_mem_para.h
index 7af8bb1..96c3d4a 100644
--- a/Function/STORAGE/system_mem_para.h
+++ b/Function/STORAGE/system_mem_para.h
@@ -13,12 +13,12 @@
#define SOFT_SERIAL_NUMBER3 0x05
#define SOFT_SERIAL_NUMBER4 0x07
-#define EEP_PARA_INIT_ID 0x24041601 //BCD��ʽYYMMDDXX�����ܳ�����ĸ
+#define EEP_PARA_INIT_ID 0x24060605 //BCD��ʽYYMMDDXX�����ܳ�����ĸ
#define LAST_PATCH_ID EEP_PARA_PATCH_ID_1 //BCD��ʽYYMMDDXX�����ܳ�����ĸ��ע��˴�ָ�����һ������
/************������ʶ���������������ӣ�BCD��ʽYYMMDDXX�����ܳ�����ĸ************/
/************ÿ�����Ӻ�LAST_PATCH_IDָ�����һ������***************************/
-#define EEP_PARA_PATCH_ID_1 0x24041601
+#define EEP_PARA_PATCH_ID_1 0x24060605
/****************************************************/
@@ -114,9 +114,9 @@
{
uint8_t price_type_mode_now; //�Ʒ����ͣ� ��һ�Ʒѡ����ݼƷѡ���ʱ�Ʒ�
uint32_t price_now; //���ۣ��Ŵ�10000��
- double use_fee_sum; //���������
double balance_now;
-
+ double use_fee_sum; //����������Ҫ��˼Ʒ�ͳ����
+ double use_gas_sum; //������������Ҫ��˼Ʒ�ͳ����
double ladder_cumulate_sc; //������������
uint8_t ladder_now; //��ǰ����
@@ -124,7 +124,7 @@
double SC_base ; //��������
double balance_base ;//������
double gas_use_base ;//������������
- double fee_use__base ;//������������
+ double fee_use_base ;//������������
double ladder_SC_base ;//��������������
double ladder_first_time_up_flag; //���ݼƷѵ�һ������ʱ�䵽���־
@@ -141,6 +141,7 @@
//������ز���
typedef struct
{
+ uint16_t CRC16_MODBUS;
VALVE_STATUS valve_status ;
VALVE_LOCK_STATE_T valve_lock_state; //��������״̬
uint16_t open_times;//��������
@@ -153,6 +154,7 @@
//�����Ʋ���
typedef struct
{
+ uint16_t CRC16_MODBUS;
FLOW_METER_CONN_TYPE flow_meter_conn_type;
uint16_t flow_meter_code;
float pulse_coe;
@@ -172,6 +174,7 @@
//��ѹ���ò���
typedef struct
{
+ uint16_t CRC16_MODBUS;
int16_t tem_up_limit;
int16_t tem_up_up_limit;
int16_t tem_low_limit;
@@ -188,6 +191,7 @@
//�����������
typedef struct
{
+ uint16_t CRC16_MODBUS;
uint16_t freeze_interval;
uint8_t daily_freeze_time_BCD[2];
}MEASURE_FREEZE_PARA_T;
@@ -195,6 +199,7 @@
//��ز���
typedef struct
{
+ uint16_t CRC16_MODBUS;
uint8_t lith_bat_low_v;
uint8_t lith_bat_under_v;
uint8_t alka_bat_low_v;
@@ -208,6 +213,7 @@
//���\APP��������
typedef struct
{
+ uint16_t CRC16_MODBUS;
uint8_t PC_general_user_password[2];
uint8_t PC_advanced_user_password[2];
uint8_t PC_manage_user_password[2];
@@ -219,6 +225,7 @@
//��λ������������Ϣ
typedef struct
{
+ uint16_t CRC16_MODBUS;
uint8_t slave_address;
BAUDRATE_CODE baudrate_code;
PARITY_BIT parity_bit;
@@ -229,6 +236,7 @@
//����Զ��ͨѶ���ò���
typedef struct
{
+ uint16_t CRC16_MODBUS;
uint8_t ip1[4];
uint16_t ip_port1;
LINK_TYPE ip1_connect_type; //IP����ģʽ 0��TCPֱ�� 1�����ӵ���ƽ̨ 2�������ƶ�onenetƽ̨
@@ -255,6 +263,7 @@
typedef struct
{
+ uint16_t CRC16_MODBUS;
uint16_t report_data_save_num;
uint16_t report_data_left_num;
@@ -270,6 +279,7 @@
//���/�����ط����ò���
typedef struct
{
+ uint16_t CRC16_MODBUS;
VALVE_BILLING_CHANGE_1_T balance_valve_ctrl_byte;
VALVE_BILLING_CHANGE_2_T conditional_valve_ctrl_byte;
int32_t balance_small_value[5];
@@ -281,64 +291,88 @@
-/*****************���¼�����������sizhu_ctrl_word.h��******************************/
+/*****************���¼��������־��嶨����sizhu_ctrl_word.h��******************************/
//���ܿ�����
+typedef struct
+{
+ uint16_t CRC16_MODBUS;
+ SYSTEM_FUNCTION_CTRL_WORD_T fun_ctrl_word;
+} SAVE_FUN_CTRL_WORD_T; //�洢���ܿ�����
+
//ϵͳ����������/ϵͳ�����ϱ�������
+typedef struct
+{
+ uint16_t CRC16_MODBUS;
+ SYSTEM_ALARM_CTRL_WORD_T alarm_ctrl_word;
+ SYSTEM_ALARM_CTRL_WORD_T alarm_report_ctrl_word;
+} SAVE_ALARM_CTRL_WORD_T; //�洢����������
+
//�ط�������
+typedef struct
+{
+ uint16_t CRC16_MODBUS;
+ VALVE_CTL_BYTES_UNION_T valve_ctrl_word;
+} SAVE_VALVE_CTRL_WORD_T; //�洢�ط�������
/***********************************************/
/*****************��־���Ʋ���******************************/
//��־���Ʋ���
-typedef struct log_sizhu_run_t
+typedef struct LOG_SIZHU_CTRL_T
{
uint16_t log_count;
- uint32_t log_addr_save;
+ uint32_t log_addr_save; //ָ����һ��Ҫд��ĵ�ַ
// uint32_t log_addr_begin;
uint8_t reserve[16];
-}LOG_SIZHU_RUN_T;
+}LOG_SIZHU_CTRL_T; //����ռ22�ֽ�
//������ʷ��¼
typedef struct
{
- LOG_SIZHU_RUN_T per_period_log;
- LOG_SIZHU_RUN_T per_hour_log;
- LOG_SIZHU_RUN_T per_day_log;
- LOG_SIZHU_RUN_T per_month_log;
+ uint16_t CRC16_MODBUS;
+ LOG_SIZHU_CTRL_T per_month_log;
+ LOG_SIZHU_CTRL_T per_day_log;
+ LOG_SIZHU_CTRL_T per_hour_log;
+ LOG_SIZHU_CTRL_T per_interval_log;
}LOG_SIZHU_HISTORY_CTRL_T;
//������¼
typedef struct
{
- LOG_SIZHU_RUN_T system_alarm_log;
+ uint16_t CRC16_MODBUS;
+ LOG_SIZHU_CTRL_T system_alarm_log;
}LOG_ALARM_CTRL_T;
-
-//������
-typedef struct
-{
- LOG_SIZHU_RUN_T basic_info_modify_log;
- LOG_SIZHU_RUN_T cumulate_modify_log;
- LOG_SIZHU_RUN_T balance_modify_log;
- LOG_SIZHU_RUN_T flow_meter_para_modify_log;
- LOG_SIZHU_RUN_T conditional_close_valve_para_modify_log;
- LOG_SIZHU_RUN_T fun_ctrl_word_modify_log;
- LOG_SIZHU_RUN_T alarm_ctrl_word_modify_log;
- LOG_SIZHU_RUN_T close_valve_ctrl_word_modify_log;
-
-}LOG_PARA_MODIFY_CTRL_T;
//�¼���¼
typedef struct LOG_EVENT_CTRL_T
{
- LOG_SIZHU_RUN_T valve_action_log;
+ uint16_t CRC16_MODBUS;
+ LOG_SIZHU_CTRL_T valve_operation_log;
- LOG_SIZHU_RUN_T factory_reset_log;
+ LOG_SIZHU_CTRL_T factory_reset_log;
- LOG_SIZHU_RUN_T calibration_time_log;
+ LOG_SIZHU_CTRL_T set_time_log;
}LOG_EVENT_CTRL_T;
+
+//������
+typedef struct
+{
+ uint16_t CRC16_MODBUS;
+ LOG_SIZHU_CTRL_T basic_info_modify_log;
+ LOG_SIZHU_CTRL_T cumulate_modify_log;
+ LOG_SIZHU_CTRL_T balance_modify_log;
+ LOG_SIZHU_CTRL_T flow_meter_para_modify_log;
+ LOG_SIZHU_CTRL_T conditional_close_valve_para_modify_log;
+ LOG_SIZHU_CTRL_T fun_ctrl_word_modify_log;
+ LOG_SIZHU_CTRL_T alarm_ctrl_word_modify_log;
+ LOG_SIZHU_CTRL_T close_valve_ctrl_word_modify_log;
+
+}LOG_PARA_MODIFY_CTRL_T;
+
+
@@ -361,11 +395,20 @@
extern WRC_DATA_NUM_CTRL_PARA_SIZHU_T wrc_data_num_ctrl_para_sizhu_g;
extern BILLING_VALVE_CTRL_PATA_T billing_valve_ctrl_para_g;
+extern LOG_SIZHU_HISTORY_CTRL_T log_sizhu_history_ctrl_g;
+extern LOG_ALARM_CTRL_T log_alarm_ctrl_g;
+extern LOG_EVENT_CTRL_T log_event_ctrl_g;
+extern LOG_PARA_MODIFY_CTRL_T log_para_modify_ctrl_g;
void allParaDefaultInit(void);
void allParaReadFromEep(void);
void allParaPatchPro(void);
+
+
+
+ErrorStatus paraCalcCrcAndWriteEepAB(uint8_t * write_data,uint32_t addrA,uint32_t addrB,uint16_t length);
+
#endif
--
Gitblit v1.9.3