TSI_Config/data_config.h

98 lines
1.8 KiB
C
Raw Normal View History

2025-02-15 11:50:15 +08:00
#ifndef DATA_CONFIG_H
#define DATA_CONFIG_H
#include <QString>
#include <QPushButton>
2025-02-18 10:55:51 +08:00
#include <QList>
2025-02-15 11:50:15 +08:00
2025-03-01 13:40:11 +08:00
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
2025-02-18 10:55:51 +08:00
#define CHANNLE_COUNT 4
2025-02-15 11:50:15 +08:00
typedef struct {
int slot;
int slot_type;
QString chan_display;
QString rack_type;
QPushButton* slot_btn;
}SlotConfig;
enum SlotType{
POWER = 10,
CONFIG = 20,
KEYPHASOR = 25,
RELAY = 30,
VIBRATE = 40,
RPM = 50
};
2025-02-18 10:55:51 +08:00
typedef struct{
int id;
2025-02-25 11:18:20 +08:00
QString channel_name;
2025-02-18 10:55:51 +08:00
bool standby;
bool active;
QString rack_type;
QString tmr_group;
QString channel_type;
QString transducer_name;
QString scale_factor;
QString sample_rate;
float normal_voltage_low;
float normal_voltage_high;
}SeismicMonitor;
2025-02-25 11:18:20 +08:00
typedef struct{
QString type;
int low;
int high;
bool checked;
} Filter;
typedef struct{
QString type;
QString full_sacle_range;
int bias_voltage;
float clamp_value;
int phase_lag;
bool checked;
} Variables;
typedef struct{
int alert;
float danger;
bool active_100ms;
} Dealy;
typedef struct{
bool rms_active;
bool integrate_active;
bool alert_latching;
bool danger_latching;
bool timed_ok;
QString recorder_output;
bool two_ma_clamp;
float trip_mutiply;
QString comparision;
int comparision_percentage;
} Alert_Variables;
2025-03-01 13:40:11 +08:00
#pragma pack(1)
typedef struct {
uint8_t head[3]; // 固定值0xAA55AA
uint8_t cmd; // 命令
int len; // 数据长度
uint8_t crc; // 数据 CRC 校验和
char data[0]; // 文件内容
} PackageHead;
typedef struct {
uint8_t card_id; // 0xff是本机其它子卡是115
char data[0];
} UpgradeCardReq;
typedef struct {
uint8_t code; // 0: 上传成功
} UpgradeRsp;
#pragma pack()
2025-02-15 11:50:15 +08:00
#endif // DATA_CONFIG_H