forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

wujiazhi
2024-06-07 d0cca79a4aa7efce979c6aed275fe1bb75af4cc4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef _UPPER_COMPUTER_READ_LOG_TEMP_H_
#define _UPPER_COMPUTER_READ_LOG_TEMP_H_
 
#include "define_all.h" 
#include "administrator.h"
 
#define UC_AMEND_LOG_PACK_HEAD_LEN (sizeof(UC_AMEND_LOG_T) - sizeof(UC_AMEND_LOG_UNION_T))
 
#define UC_AMEND_LOG_PULSE_PARA_PACK_LEN (sizeof(struct pulse_para) + UC_AMEND_LOG_PACK_HEAD_LEN)
#define UC_AMEND_LOG_FLOW_PARA_PACK_LEN (sizeof(struct flow_para) + UC_AMEND_LOG_PACK_HEAD_LEN)
#define UC_AMEND_LOG_PRESS_PARA_PACK_LEN (sizeof(struct press_para) + UC_AMEND_LOG_PACK_HEAD_LEN)
#define UC_AMEND_LOG_TEMP_PARA_PACK_LEN (sizeof(struct temp_para) + UC_AMEND_LOG_PACK_HEAD_LEN)
 
 
#pragma pack(1)
 
typedef struct{
    uint32_t cal_pulse_fator;
    uint16_t cal_pulse_width;
    uint8_t flow_type;
}PULSE_PARA_T;
 
typedef struct{
    float flow_up;
    float flow_up_up;
    float flow_down;
    float flow_up_up_replace_value;
    float small_flow_excision_value;
}FLOW_PARA_T;
 
typedef struct{
    float press_correction_factor; // 修正系数 也叫斜率
    float press_intercept;         // 修正截距
    float press_up_valve;
    float press_up_up_valve;
    float press_down_valve;
    float press_down_down_valve;
    float press_up_scope;
    float press_down_scope;
    float press_down_down_replace;
}PRESS_PARA_T;
 
typedef struct{
    float temp_correction_factor;
    float temp_intercept;
    int16_t temp_up_valve;
    int16_t temp_up_up_valve;
    int16_t temp_down_valve;
    int16_t temp_down_down_valve;
    int16_t temp_up_scope;
    int16_t temp_down_scope;
    int16_t reserve_16;
    float reserve_f;
    int16_t cpu_temp_up_scope;
    int16_t cpu_temp_down_scope;
}TEMP_PARA_T;
 
typedef union{
    struct pulse_para{
        PULSE_PARA_T before;
        PULSE_PARA_T now;
    }pulse_para_s;
    struct flow_para{
        FLOW_PARA_T before;
        FLOW_PARA_T now;
    }flow_para_s;
    struct press_para{
        PRESS_PARA_T before;
        PRESS_PARA_T now;
    }press_para_s;
    struct temp_para{
        TEMP_PARA_T before;
        TEMP_PARA_T now;
    }temp_para_s;
 
}UC_AMEND_LOG_UNION_T;
 
typedef struct{
    uint8_t record_num;
    uint8_t mender;
    uint8_t record_time[6];
    uint8_t amend_id;
    UC_AMEND_LOG_UNION_T uc_amend_data;
}UC_AMEND_LOG_T;
 
#define UC_ALARM_DATA_LOG_PACK_LEN     sizeof(UC_ALARM_DATA_LOG_T)
typedef struct{
  uint16_t record_num;
  uint8_t record_time[6];
  uint16_t alarm_id;
    double forward_cumulate_sc; // 正向标况累积量
  double forward_cumulate_wc;
    double reverse_cumulate_sc; // 反向标况累积量
  double reverse_cumulate_wc;
    float instant_sc;
  float instant_wc;
  float temperature;
  float pressure;
  float cpu_temperature; // 环境温度
  uint8_t lith_vcc;
  uint8_t alka_vcc;
  uint16_t status_bytes[SYS_STATUS_BYTES_TYPE_LENGTH >> 1];
}UC_ALARM_DATA_LOG_T;
 
typedef struct
{
    uint8_t record_time[6];
    double forward_cumulate_sc;
    double forward_cumulate_wc;
    double reverse_cumulate_sc;
    double reverse_cumulate_wc;
    float instant_sc;
    float temperature;
    float pressure;
}    SYS_UPCOMPUTER_SYSLOG_FORMAT_T;    //50bytes
 
 
 
 
 
#pragma pack()
 
 
#endif