128 lines
3.0 KiB
C
128 lines
3.0 KiB
C
#ifndef ENUMS_H
|
|
#define ENUMS_H
|
|
|
|
#include "stdint.h"
|
|
#include <QObject>
|
|
|
|
typedef enum { NO_ERROR =0, ERROR } typeError;
|
|
|
|
typedef enum { CHARGE = 0} typeIIN;
|
|
typedef enum { Ku0_1 = 0, Ku0_2, Ku0_5, Ku1, Ku2, Ku5, Ku10, Ku20, Ku50, Ku100, Ku200, Ku500, Ku1000 } typeIKU;
|
|
typedef enum { Hp0_2 = 0, Hp1, Hp2, Hp10 } typeIFV;
|
|
typedef enum { Lp100 = 0, Lp300, Lp1000, Lp3000, Lp10000, Lp30000, Lp100000 } typeIFN;
|
|
|
|
typedef enum{Accel = 0,
|
|
Velocity,
|
|
Pascal,
|
|
k_Pascal,
|
|
M_Pascal,
|
|
Nython,
|
|
k_Nuthon,
|
|
mV,
|
|
} typeUnit;
|
|
|
|
|
|
//typedef enum{MS2=0, PA, H } typeUnit;
|
|
|
|
|
|
typedef enum{Oz=0, Pz } typePlavGround;
|
|
typedef enum{Norm=0, Overload } typeOverload;
|
|
|
|
typedef enum{SENS_REQ_TYPE=0, STATE_REQ_TYPE} typeReq;
|
|
|
|
typedef enum{in=0, ku, fv,fn,unit,overload,pz } typeParam;
|
|
|
|
typedef enum {UART_PARITY_NONE=0, UART_PARITY_ODD, UART_PARITY_EVEN} Parity;
|
|
|
|
static const uint32_t BAUDRATE[] = {4800, 7200, 9600, 14400, 19200, 38400, 57600, 115200, 128000, 230400};
|
|
|
|
typedef enum {s4800, s7200, s9600, s14400, s19200, s38400, s57600, s115200, s128000, s230400} Baudrate;
|
|
|
|
typedef enum {}setConnectionParameterNotyfy;
|
|
|
|
typedef struct{uint adress;
|
|
typeIIN in;
|
|
typeIKU ku;
|
|
typeIFV fv;
|
|
typeIFN fn;
|
|
typeUnit unit;
|
|
typeOverload overload;
|
|
typePlavGround pz;
|
|
bool crcOk;
|
|
}stateStruct;
|
|
|
|
typedef struct{uint adress;
|
|
float sens;
|
|
bool crcOk;
|
|
}sensStruct;
|
|
|
|
|
|
typedef struct{//адрес скорость четность
|
|
}conSet;
|
|
|
|
|
|
typedef enum{OWN = 4001,
|
|
BAUD = 4002,
|
|
INFB=4003,
|
|
IIN=5001,
|
|
IFV=5002,
|
|
IFN=5003,
|
|
IKU=5004,
|
|
IKE=5005,
|
|
IKD=5006,
|
|
IKS=5007,
|
|
IPZ=5008,
|
|
OPZ=5009,
|
|
UNIT=5010,
|
|
OVERLOAD=5011,
|
|
IK0=5012,
|
|
IK1=5013,
|
|
IK2=5014,
|
|
IK3=5015,
|
|
IK4=5016,
|
|
IK5=5017,
|
|
KCOND=7501,
|
|
SENS=7002,
|
|
SENS2=7502,
|
|
ACCEL=7503,
|
|
|
|
}regEnum;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{ QString port;
|
|
uint16_t adress;//адрес
|
|
uint32_t speed; //скорость
|
|
Parity parity; //четность
|
|
}PrborConnectonAtr;
|
|
|
|
|
|
typedef struct{ uint16_t adress;
|
|
float sens;
|
|
typeIIN in;
|
|
typeIKU ku;
|
|
typeIFV fv;
|
|
typeIFN fn;
|
|
typeUnit unit;
|
|
typeOverload overload;
|
|
typePlavGround pz; //четность
|
|
}DataStruct;
|
|
|
|
|
|
typedef enum{ ALL_RIGHT=0,
|
|
IS_BUSY,
|
|
MODEBUS_ERROR //четность
|
|
}ErrorCode;
|
|
|
|
|
|
|
|
typedef union{
|
|
uint8_t ch[4];
|
|
uint16_t sh[2];
|
|
float fl;
|
|
} usfloat;
|
|
|
|
#endif // ENUMS_H
|