#ifndef COMMON_H
|
#define COMMON_H
|
|
#include <string.h>
|
|
enum TypeInfo {
|
|
//×¢²áµÇ¼
|
LOGIN_REQ, // µÇ¼ÇëÇó
|
LOGIN_RES, // µÇ¼ÏìÓ¦
|
REGISTER_REQ, //×¢²áÇëÇó
|
REGISTER_RES, //×¢²áÏìÓ¦
|
RESET_REQ, //ÖØÖÃÃÜÂëÇëÇó
|
RESET_RES, //ÖØÖÃÃÜÂëÏìÓ¦
|
|
|
//ȨÏÞ¹ÜÀí
|
QUERY_PMS_REQ, // °´Ô±¹¤±àºÅ¡¢Ãû×Ö»òְλ²éѯÈËԱȨÏÞÐÅÏ¢ÇëÇó
|
UPDATE_PMS_REQ, // °´½ÇÉ«id¸üÐÂȨÏÞÐÅÏ¢ÇëÇó
|
QUERY_PMS_RES, // ²éѯÈËÔ±ºÍ½ÇÉ«ÐÅÏ¢µÄÏìÓ¦½á¹¹Ìå
|
UPDATE_PMS_RES, // ȨÏÞ¸üнá¹ûÏìÓ¦Ìå
|
|
//É豸¹ÜÀí
|
AD_REQ,//Ìí¼ÓÉ豸ÇëÇó
|
AD_RES,//Ìí¼ÓÉ豸ÏìÓ¦
|
MD_REQ,//ÐÞ¸ÄÉ豸ÇëÇó
|
MD_RES,//ÐÞ¸ÄÉ豸ÏìÓ¦
|
QD_REQ,//²éѯÉ豸ÇëÇó
|
QD_RES,//²éѯÉ豸ÏìÓ¦
|
|
//µØÍ¼±ê×¢
|
MML_REQ,//µØÍ¼±ê×¢¼ÓÔØÇëÇó
|
MML_RES,//µØÍ¼±ê×¢¼ÓÔØÏìÓ¦
|
MMI_REQ,//µØÍ¼±ê×¢²åÈëÇëÇó
|
MMI_RES,//µØÍ¼±ê×¢²åÈëÏìÓ¦
|
MMD_REQ,//µØÍ¼±êעɾ³ýÇëÇó
|
MMD_RES,//µØÍ¼±êעɾ³ýÏìÓ¦
|
|
//´óÆÁÏÔʾ
|
ENVIRONMENT_REQ,//»·¾³Êý¾ÝÇëÇó
|
ENVIRONMENT_RES,//»·¾³Êý¾ÝÏìÓ¦
|
DEVICESTATUS_REQ,//É豸״̬ÇëÇó
|
DEVICESTATUS_RES,//É豸״̬ÏìÓ¦
|
MOVEMENTRECORD_REQ,//²Ù×÷ÈÕÖ¾ÇëÇó
|
MOVEMENTRECORD_RES,//²Ù×÷ÈÕÖ¾ÏìÓ¦
|
ALARMRECORD_REQ,//¾¯±¨¼Ç¼ÇëÇó
|
ALARMRECORD_RES,//¾¯±¨¼Ç¼ÏìÓ¦
|
YIELD_REQ,//ú¿ó²úÁ¿ÇëÇó
|
YIELD_RES,//ú¿ó²úÁ¿ÏìÓ¦
|
COAL_MINE_RODER_REQ,//ú¿ó¶©µ¥ÇëÇó
|
COAL_MINE_RODER_RES,//ú¿ó¶©µ¥ÏìÓ¦
|
|
//¾¯±¨¹ÜÀí
|
WARNING_REQ, // ¾¯±¨ÇëÇó
|
WARNING_RES, // ¾¯±¨ÏìÓ¦
|
DATA_REQ, // Êý¾ÝÇëÇó
|
DATA_RES, // Êý¾ÝÏìÓ¦
|
THRESHOLD_REQ, //ãÐÖµÇëÇó
|
THRESHOLD_RES, //ãÐÖµÏìÓ¦
|
|
|
|
//Éú²ú¼Æ»®¹ÜÀí
|
ADD_PDPLAN_REQ,//Ìí¼ÓÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå
|
ADD_PDPLAN_RES,//Ìí¼ÓÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
DEL_PDPLAN_REQ,//ɾ³ýÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå
|
DEL_PDPLAN_RES,//ɾ³ýÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
UPDATE_PDPLAN_REQ,//¸ü¸ÄÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå
|
UPDATE_PDPLAN_RES,//¸ü¸ÄÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
QUERY_PDPLAN_REQ,//²éѯÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå
|
QUERY_PDPLAN_RES,//²éѯÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
|
|
ADD_MONOUTPUT_REQ,//Ìí¼ÓÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå
|
ADD_MONOUTPUT_RES,//Ìí¼ÓÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
DEL_MONOUTPUT_REQ,//ɾ³ýÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå
|
DEL_MONOUTPUT_RES,//ɾ³ýÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
UPDATE_MONOUTPUT_REQ,//¸üÐÂÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå
|
UPDATE_MONOUTPUT_RES,//¸üÐÂÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
QUERY_MONOUTPUT_REQ,//²éѯÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå
|
QUERY_MONOUTPUT_RES,//²éѯÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
|
|
//ÀúÊ·²éѯ
|
HISTORY_DEV_REQ, //ÀúÊ·²éѯӲ¼þÇëÇó
|
HISTORY_DEV_RES, //ÀúÊ·²éѯӲ¼þÏìÓ¦
|
HISTORY_PRODUCE_REQ, //ÀúÊ·²éѯÉú²úÇëÇó
|
HISTORY_PRODUCE_RES, //ÀúÊ·²éѯÉú²úÏìÓ¦
|
HISTORY_ENV_REQ, //ÀúÊ·²éѯ»·¾³ÇëÇó
|
HISTORY_ENV_RES, //ÀúÊ·²éѯ»·¾³ÏìÓ¦
|
HISTORY_MON_REQ, //ÀúÊ·²éѯÔ²úÁ¿ÇëÇó
|
HISTORY_MON_RES, //ÀúÊ·²éѯÔ²úÁ¿ÏìÓ¦
|
|
|
//×Ô¶¯Éý¼¶
|
VERSION_UPDATE_REQ, // °æ±¾¸üÐÂÇëÇó
|
VERSION_UPDATE_RES, // °æ±¾¸üÐÂÏìÓ¦
|
FILE_DOWNLOADS_REQ, // °æ±¾¸üÐÂÎļþÏÂÔØÇëÇó
|
FILE_DOWNLOADS_RES, // °æ±¾¸üÐÂÎļþÏÂÔØÏìÓ¦
|
DOWNLOAD_SUCCESSFULLY_RES, // ¸üÐÂÎļþÏÂÔØ³É¹¦µÄÏìÓ¦
|
|
//°æ±¾¹ÜÀí
|
VERSION_NUM_REQ, // °æ±¾ºÅÇëÇó
|
VERSION_NUM_RES, // °æ±¾ºÅÏìÓ¦
|
UPLOAD_FILE_REQ, // ÉÏ´«ÎļþµÄÇëÇó
|
UPLOAD_FILE_RES, // ÉÏ´«ÎļþµÄÏìÓ¦
|
VERSION_INFOENTRY_REQ, // °æ±¾ÐÅϢ¼ÈëÇëÇó
|
VERSION_INFOENTRY_RES, //°æ±¾ÐÅϢ¼ÈëÏìÓ¦
|
|
//ÈÕÖ¾
|
LOGSEARCH_REQ,//ÈÕÖ¾²éѯÇëÇó
|
LOGSEARCH_RES,//ÈÕÖ¾²éѯÏìÓ¦
|
|
};
|
|
struct Head {
|
int type;
|
int len;
|
};
|
|
//×¢²áµÇ¼
|
//µÇ¼ÇëÇó
|
struct LoginReq
|
{
|
Head head;
|
char userName[32];
|
char password[100];
|
LoginReq() {
|
head.type = LOGIN_REQ;
|
head.len = sizeof(LoginReq);
|
}
|
};
|
|
struct Permission
|
{
|
int admin;//³¬¼¶¹ÜÀíÔ±
|
int loggerSearch; //ÈÕÖ¾²éѯ
|
int queryHistory; //ÀúÊ·¼Ç¼
|
int mapMark;//µØÍ¼
|
int versionManage; // °æ±¾¹ÜÀí
|
int warning; //¾¯±¨
|
int devManage; //É豸¹ÜÀí
|
int productPlan;//Éú²ú¼Æ»®
|
char roleName[32]; // ½ÇÉ«Ãû
|
};
|
|
//µÇ¼ÏìÓ¦
|
struct LoginRes
|
{
|
Head head;
|
char userName[32];
|
int status; // µÇ¼״̬
|
// µÇ¼³É¹¦Ê±£¬¸ÃÕ˺ŶÔÓ¦µÄȨÏÞ×éºÏ
|
Permission per;
|
LoginRes()
|
{
|
head.type = LOGIN_RES;
|
head.len = sizeof(LoginRes);
|
}
|
};
|
|
//×¢²áÇëÇó
|
struct RegisterReq
|
{
|
Head head;
|
char userName[32];
|
char password[100];
|
char email[32];
|
char telephone[32];
|
RegisterReq() {
|
head.type = REGISTER_REQ;
|
head.len = sizeof(RegisterReq);
|
}
|
};
|
|
//×¢²áÏìÓ¦
|
struct RegisterRes
|
{
|
Head head;
|
char userName[32];
|
int status; // ×¢²á״̬
|
RegisterRes()
|
{
|
head.type = REGISTER_RES;
|
head.len = sizeof(RegisterRes);
|
}
|
};
|
|
//ÖØÖÃÃÜÂëÇëÇó
|
struct ResetReq
|
{
|
Head head;
|
char userName[32];
|
char email[32];
|
char password[100];//ÐÂÃÜÂë
|
ResetReq() {
|
head.type = RESET_REQ;
|
head.len = sizeof(ResetReq);
|
}
|
};
|
|
//ÖØÖÃÃÜÂëÏìÓ¦
|
struct ResetRes
|
{
|
Head head;
|
char userName[32];
|
int status; // ÖØÖÃÃÜÂë״̬
|
ResetRes()
|
{
|
head.type = RESET_RES;
|
head.len = sizeof(ResetRes);
|
}
|
};
|
|
//ȨÏÞ¹ÜÀí
|
// °´Ô±¹¤±àºÅ¡¢Ãû×Ö»òְλ²éѯÈËԱȨÏÞÐÅÏ¢ÇëÇó
|
typedef struct QueryPmsReq {
|
Head head;
|
char userNo[32];
|
char name[32];
|
char permissonType[32];
|
QueryPmsReq() {
|
head.type = QUERY_PMS_REQ;
|
memset(userNo, 0, 32);
|
memset(permissonType, 0, 32);
|
memset(name, 0, 32);
|
head.len = sizeof(QueryPmsReq);
|
}
|
} QueryPmsReq;
|
|
// °´½ÇÉ«id¸üÐÂȨÏÞÐÅÏ¢ÇëÇó
|
typedef struct UpdatePmsReq {
|
Head head;
|
// ÈËÔ±±íÖ÷¼üid
|
int id;
|
int queryHistory;
|
int loggerSearch;
|
int mapMark;
|
int devManage;
|
int productPlan;
|
int warningManage;
|
int versionManage; //°æ±¾¹ÜÀí
|
int admin; //ϵͳ¹ÜÀíÔ±
|
|
char permissonType[32];
|
UpdatePmsReq() {
|
head.type = QUERY_PMS_RES;
|
head.len = sizeof(UpdatePmsReq);
|
}
|
} UpdatePmsReq;
|
|
// µ¥¸öÈËÔ±ºÍȨÏÞÁªºÏ²éѯ½á¹¹Ìå
|
typedef struct PmsRes {
|
int queryHistory;
|
int loggerSearch;
|
int mapMark;
|
int devManage;
|
int productPlan;
|
int versionManage; //°æ±¾¹ÜÀí
|
int warningManage;
|
int admin; //ϵͳ¹ÜÀíÔ±
|
|
int id;
|
|
char userNo[32];
|
char name[32];
|
|
char permissonType[32]; // ½ÇÉ«ÀàÐÍ
|
|
char department[32];
|
char loginTime[32];
|
char registerTime[32];
|
} PmsRes;
|
|
// ²éѯÈËÔ±ºÍ½ÇÉ«ÐÅÏ¢µÄÏìÓ¦½á¹¹Ìå
|
typedef struct QueryPmsRes {
|
Head head;
|
int success; // 1Ϊ³É¹¦ ,0Ϊʧ°Ü
|
PmsRes pmsList[0];
|
QueryPmsRes() {
|
head.type = QUERY_PMS_REQ;
|
}
|
} QueryPmsRes;
|
|
// ȨÏÞ¸üнá¹ûÏìÓ¦Ìå
|
struct UpdatePmsRes {
|
Head head;
|
int success; // 1Ϊ³É¹¦ ,0Ϊʧ°Ü
|
UpdatePmsRes() {
|
head.type = UPDATE_PMS_RES;
|
head.len = sizeof(UpdatePmsRes);
|
}
|
|
};
|
|
|
|
|
|
//É豸¹ÜÀí
|
struct DevicesInfo
|
{
|
int id;//É豸ID
|
char deviceName[32];//É豸Ãû³Æ
|
char deviceType[32];//É豸ÀàÐÍ
|
char deviceSerialNumber[32];//É豸±àÂë
|
char deviceStatus[32];//É豸״̬
|
char area[100];//µØÇø
|
double longitude;//¾¶È
|
double latitude;//γ¶È
|
char purchasingTime[15];//¹ºÂòʱ¼ä
|
char installTime[15];//°²×°Ê±¼ä
|
char manufacturer[100];//³§¼Ò
|
};
|
//Ìí¼ÓÉ豸
|
struct ADReq//Ìí¼ÓÇëÇó
|
{
|
Head head;
|
DevicesInfo devInfo[0];
|
ADReq() {
|
head.type = AD_REQ;
|
head.len = sizeof(ADReq);
|
}
|
|
};
|
|
struct ADRes//Ìí¼ÓÏìÓ¦
|
{
|
Head head;
|
int status;
|
ADRes() {
|
head.type = AD_RES;
|
head.len = sizeof(ADRes);
|
}
|
|
};
|
//ÐÞ¸ÄÉ豸
|
struct MDReq//ÐÞ¸ÄÇëÇó
|
{
|
Head head;
|
DevicesInfo info;
|
char condition[32];
|
char modifiedContent[100];
|
double laOrLo;
|
MDReq() {
|
head.type = MD_REQ;
|
head.len = sizeof(MDReq);
|
}
|
};
|
struct MDRes//ÐÞ¸ÄÏìÓ¦
|
{
|
Head head;
|
int status;
|
char conditon[32];
|
char modifiedContent[100];
|
double laOrLo;
|
MDRes() {
|
head.type = MD_RES;
|
head.len = sizeof(MDRes);
|
}
|
};
|
//²éѯÉ豸
|
struct QDReq//²éѯÇëÇó
|
{
|
Head head;
|
DevicesInfo info;
|
char buyTimeBegin[15];
|
char buyTimeEnd[15];
|
char installTimeBegin[15];
|
char installTimeEnd[15];
|
QDReq() {
|
head.type = QD_REQ;
|
head.len = sizeof(QDReq);
|
}
|
};
|
struct QDRes//²éѯÏìÓ¦
|
{
|
Head head;
|
int status;
|
DevicesInfo info[0];
|
QDRes() {
|
head.type = QD_RES;
|
head.len = sizeof(QDRes);
|
}
|
};
|
|
|
//µØÍ¼±ê×¢
|
struct MarkInfo
|
{
|
char markId[32];//±ê×¢µãidÉ豸±àºÅ
|
double latitude;//γ¶È
|
double longitude;//¾¶È
|
char deviceStatus[32];//É豸״̬
|
char deviceName[32];//É豸Ãû³Æ
|
};
|
//µØÍ¼±ê×¢¼ÓÔØÇëÇó
|
struct MMLReq//µØÍ¼
|
{
|
Head head;
|
MMLReq() {
|
head.type = MML_REQ;
|
head.len = sizeof(MMLReq);
|
}
|
};
|
//µØÍ¼±ê×¢¼ÓÔØÏìÓ¦£º
|
struct MMLRes
|
{
|
Head head;
|
int status;//²Ù×÷״̬
|
MarkInfo info[0];
|
MMLRes() {
|
head.type = MML_RES;
|
head.len = sizeof(MMLRes);
|
}
|
};
|
//µØÍ¼±ê×¢²åÈëÇëÇó
|
struct MMIReq//µØÍ¼
|
{
|
Head head;
|
MarkInfo info[0];
|
MMIReq() {
|
head.type = MMI_REQ;
|
head.len = sizeof(MMIReq);
|
}
|
};
|
//µØÍ¼±ê×¢²åÈëÏìÓ¦£º
|
struct MMIRes
|
{
|
Head head;
|
int status;//²Ù×÷״̬
|
MarkInfo info[0];
|
MMIRes() {
|
head.type = MMI_RES;
|
head.len = sizeof(MMIRes);
|
}
|
};
|
|
//µØÍ¼±êעɾ³ýÇëÇó
|
struct MMDReq//µØÍ¼
|
{
|
Head head;
|
MarkInfo info[0];
|
MMDReq() {
|
head.type = MMD_REQ;
|
head.len = sizeof(MMDReq);
|
}
|
};
|
//µØÍ¼±êעɾ³ýÏìÓ¦£º
|
struct MMDRes
|
{
|
Head head;
|
int status;//²Ù×÷״̬
|
MarkInfo info[0];
|
MMDRes() {
|
head.type = MMD_RES;
|
head.len = sizeof(MMDRes);
|
}
|
};
|
|
//´óÆÁÏÔʾ
|
//»·¾³Êý¾ÝÇëÇó
|
struct EnvironmentReq
|
{
|
Head head;
|
char place[32];//µØÇø
|
char nowTime[32];//µ±Ê±Ê±¼ä
|
EnvironmentReq(){
|
head.type = ENVIRONMENT_REQ;
|
head.len = sizeof(EnvironmentReq);
|
}
|
};
|
//»·¾³Êý¾ÝÏìÓ¦
|
struct Environment
|
{
|
char dataType[32];//Êý¾ÝÀàÐÍ
|
float envdata;//Êý¾Ý
|
};
|
struct EnvironmentRes
|
{
|
Head head;
|
int status;
|
Environment environment[0];
|
EnvironmentRes(){
|
head.type = ENVIRONMENT_RES;
|
head.len = sizeof(EnvironmentRes);
|
}
|
};
|
//É豸״̬ÇëÇó
|
struct DeviceStatusReq
|
{
|
Head head;
|
DeviceStatusReq(){
|
head.type = DEVICESTATUS_REQ;
|
head.len = sizeof(DeviceStatusReq);
|
}
|
};
|
//É豸״̬ÏìÓ¦
|
struct Area
|
{
|
double longitude;//¾¶È
|
double latitude;//γ¶ÈAA
|
char area[64];//µØÇø
|
};
|
struct DeviceStatus
|
{
|
int deviceID;//É豸±àºÅ
|
char deviceName[32];//É豸Ãû³Æ
|
double longitude;//¾¶È
|
double latitude;//γ¶ÈAA
|
char deviceStatus[32];//É豸״̬
|
char area[64];//µØÇø
|
};
|
struct DeviceStatusRes
|
{
|
Head head;
|
int status;
|
DeviceStatus deviceStatus[0];
|
DeviceStatusRes(){
|
head.type = DEVICESTATUS_RES;
|
head.len = sizeof(DeviceStatusRes);
|
}
|
};
|
//²Ù×÷ÈÕÖ¾ÇëÇó
|
struct MovementRecordReq
|
{
|
Head head;
|
MovementRecordReq(){
|
head.type = MOVEMENTRECORD_REQ;
|
head.len = sizeof(MovementRecordReq);
|
}
|
};
|
//²Ù×÷ÈÕÖ¾ÏìÓ¦
|
struct MovementRecord
|
{
|
char userName[32];//²Ù×÷Óû§Ãû
|
char operateTime[32];//²Ù×÷ʱ¼ä
|
char deviceName[32];//²Ù×÷É豸
|
double longitude;//¾¶È
|
double latitude;//γ¶È
|
char movement[256];//²Ù×÷ÃèÊö
|
};
|
struct MovementRecordRes
|
{
|
Head head;
|
int status;
|
MovementRecord movementRecord[0];
|
MovementRecordRes(){
|
head.type = MOVEMENTRECORD_RES;
|
head.len = sizeof(MovementRecordRes);
|
}
|
};
|
//¾¯±¨¼Ç¼ÇëÇó
|
struct AlarmRecordReq
|
{
|
Head head;
|
AlarmRecordReq(){
|
head.type = ALARMRECORD_REQ;
|
head.len = sizeof(AlarmRecordReq);
|
}
|
};
|
//¾¯±¨¼Ç¼ÏìÓ¦
|
struct AlarmRecord
|
{
|
char alarmTime[32];//¾¯±¨Ê±¼ä
|
char alarmtype[32];//´¦Àí״̬
|
double longitude;//¾¶È
|
double latitude;//γ¶È
|
char alarmContent[256];//¾¯±¨ÄÚÈÝ
|
};
|
struct AlarmRecordRes
|
{
|
Head head;
|
int status;
|
AlarmRecord alarmRecord[0];
|
AlarmRecordRes(){
|
head.type = ALARMRECORD_RES;
|
head.len = sizeof(AlarmRecordRes);
|
}
|
};
|
//ú¿ó²úÁ¿ÇëÇó
|
struct YieldReq
|
{
|
Head head;
|
char startTime[64];//¿ªÊ¼Ê±¼ä
|
char finishTime[64];//½áÊøÊ±¼ä
|
YieldReq(){
|
head.type = YIELD_REQ;
|
head.len = sizeof(YieldReq);
|
}
|
};
|
//ú¿ó²úÁ¿ÏìÓ¦
|
struct Yield
|
{
|
double sumA;//A²úÁ¿
|
double sumB;//B²úÁ¿
|
double sumC;//C²úÁ¿
|
};
|
struct YieldRes
|
{
|
Head head;
|
int status;
|
Yield yield[0];
|
YieldRes(){
|
head.type = YIELD_RES;
|
head.len = sizeof(YieldRes);
|
}
|
};
|
//¶©µ¥²éѯÇëÇó
|
struct CoaMinRodReq
|
{
|
Head head;
|
char planName[64];//¶©µ¥Ãû
|
CoaMinRodReq(){
|
head.type = COAL_MINE_RODER_REQ;
|
head.len = sizeof(CoaMinRodReq);
|
}
|
};
|
//¶©µ¥²éѯÏìÓ¦
|
struct CoaMinRod
|
{
|
char startTime[64];//ÆðʼÈÕÆÚ
|
char finishTime[64];//½»¸¶ÈÕÆÚ
|
char proName[64];//²úÆ·Ãû
|
double planPro;//¼Æ»®Éú²úÁ¿
|
double actPro;//ʵ¼ÊÉú²úÁ¿
|
};
|
struct CoaMinRodRes
|
{
|
Head head;
|
int status;
|
CoaMinRod coaMinRod[0];
|
CoaMinRodRes(){
|
head.type = COAL_MINE_RODER_RES;
|
head.len = sizeof(CoaMinRodReS);
|
}
|
};
|
|
//¾¯±¨¹ÜÀí
|
struct warningInfo {
|
char device_name[32];//É豸Ãû³Æ
|
char des[32];//¾¯±¨ÃèÊö
|
char time[32];//¾¯±¨Ê±¼ä
|
float warningdata;//¾¯±¨Êý¾Ý
|
char type[16];//¾¯±¨ÀàÐÍ
|
char status[16];//¾¯±¨×´Ì¬
|
};
|
|
struct dataInfo {
|
char device_name[32];
|
char type[16];//»·¾³Êý¾ÝÀàÐÍ
|
float data;
|
char time[32];//ÉÏ´«Êý¾Ýʱ¼ä
|
};
|
|
struct threshInfo {
|
char device_name[32];
|
char type[16];//»·¾³ÀàÐÍ
|
float min;//×îСãÐÖµ
|
float max;//×î´óãÐÖµ
|
char time[32];//ãÐÖµÐÞ¸Äʱ¼ä
|
};
|
|
//¾¯±¨ÇëÇó½á¹¹Ìå
|
struct WarningReq {
|
Head head;
|
warningInfo info[0];
|
|
WarningReq() {
|
head.type = WARNING_REQ;
|
head.len = sizeof(WarningReq);
|
}
|
};
|
|
//Êý¾ÝÇëÇó½á¹¹Ìå
|
struct DataReq {
|
Head head;
|
dataInfo Info[0];
|
|
DataReq() {
|
head.type = DATA_REQ;
|
head.len = sizeof(DataReq);
|
}
|
};
|
|
//ãÐÖµÇëÇó½á¹¹Ìå
|
struct ThresholdReq {
|
Head head;
|
threshInfo threInfo[0];
|
|
ThresholdReq() {
|
head.type = THRESHOLD_REQ;
|
head.len = sizeof(ThresholdReq);
|
}
|
};
|
|
|
//¾¯±¨ÏìÓ¦½á¹¹Ìå
|
struct WarningRes {
|
Head head;
|
int status;// ÏìӦ״̬
|
warningInfo warninginfo[0];
|
|
WarningRes() {
|
head.type = WARNING_RES;
|
head.len = sizeof(WarningRes);
|
}
|
};
|
|
struct DataRes {
|
Head head;
|
int status;// ÏìӦ״̬
|
dataInfo datainfo[0];
|
|
DataRes() {
|
head.type = DATA_RES;
|
head.len = sizeof(DataRes);
|
}
|
};
|
|
struct ThresholdRes {
|
Head head;
|
int status;// ÏìӦ״̬
|
threshInfo threInfo[0];
|
|
ThresholdRes() {
|
head.type = THRESHOLD_RES;
|
head.len = sizeof(ThresholdRes);
|
}
|
};
|
|
|
//Éú²ú¼Æ»®¹ÜÀí
|
struct PdplanInfo
|
{
|
char planName[32];//¶©µ¥»®Ãû×Ö
|
char startDate[32];//ÆðʼÈÕÆÚ
|
char closingDate[32];//½»¸¶ÈÕÆÚ
|
char pdName[8];//²úÆ·Ãû
|
double plannedPd;//¼Æ»®Éú²úÁ¿
|
double actualPd;//ʵ¼ÊÉú²úÁ¿
|
double progress;//Éú²ú½ø¶È
|
int finishOntime;//ÊÇ·ñ°´ÆÚÍê³É
|
};
|
|
struct MonoutputInfo
|
{
|
<<<<<<< HEAD
|
char month[32];//æä»½
|
double aOutput;//a产åæäº§é
|
double bOutput;//b产åæäº§é
|
double cOutput;//c产åæäº§é
|
=======
|
char date[32];//ÈÕÆÚ
|
double aOutput;//a²úÆ·Ô²úÁ¿
|
double bOutput;//b²úÆ·Ô²úÁ¿
|
double cOutput;//c²úÆ·Ô²úÁ¿
|
>>>>>>> 83817169914cd859e4a7e0b5f0685dd0c072a974
|
};
|
|
//Ìí¼ÓÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå
|
struct AddPdplanReq
|
{
|
Head head;
|
PdplanInfo info[0];
|
AddPdplanReq() {
|
head.type = ADD_PDPLAN_REQ;
|
head.len = sizeof(AddPdplanReq);
|
}
|
};
|
//Ìí¼ÓÒ»ÌõÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
struct AddPdplanRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñÌí¼Ó³É¹¦£¬0·ñ1ÊÇ
|
AddPdplanRes() {
|
head.type = ADD_PDPLAN_RES;
|
head.len = sizeof(AddPdplanRes);
|
}
|
};
|
|
//ɾ³ýÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå
|
struct DelPdplanReq
|
{
|
Head head;
|
PdplanInfo info[0];
|
DelPdplanReq() {
|
head.type = DEL_PDPLAN_REQ;
|
head.len = sizeof(DelPdplanReq);
|
}
|
};
|
|
//ɾ³ýÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
struct DelPdplanRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñɾ³ý³É¹¦£¬0·ñ1ÊÇ
|
DelPdplanRes() {
|
head.type = DEL_PDPLAN_RES;
|
head.len = sizeof(DelPdplanRes);
|
}
|
};
|
|
//¸ü¸ÄÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå.
|
struct UpdatePdplanReq
|
{
|
Head head;
|
PdplanInfo info;
|
UpdatePdplanReq() {
|
head.type = UPDATE_PDPLAN_REQ;
|
head.len = sizeof(UpdatePdplanReq);
|
}
|
};
|
|
//¸ü¸ÄÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
struct UpdatePdplanRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñ¸üгɹ¦£¬0·ñ1ÊÇ
|
UpdatePdplanRes() {
|
head.type = UPDATE_PDPLAN_RES;
|
head.len = sizeof(UpdatePdplanRes);
|
}
|
};
|
|
//²éѯÉú²ú¼Æ»®µÄÇëÇó½á¹¹Ìå
|
struct QueryPdplanReq
|
{
|
Head head;
|
int planId;//¶©µ¥±àºÅ
|
char planName[32];//¶©µ¥»®Ãû×Ö
|
char startDate[32];//ÆðʼÈÕÆÚ
|
char closingDate[32];//½»¸¶ÈÕÆÚ
|
char pdName[8];//²úÆ·Ãû
|
double plannedPd;//¼Æ»®Éú²úÁ¿
|
double actualPd;//ʵ¼ÊÉú²úÁ¿
|
double progress;//Éú²ú½ø¶È
|
int finishOntime;//ÊÇ·ñ°´ÆÚÍê³É
|
QueryPdplanReq() {
|
head.type = QUERY_PDPLAN_REQ;
|
head.len = sizeof(QueryPdplanReq);
|
}
|
};
|
|
//²éѯÉú²ú¼Æ»®µÄÏìÓ¦½á¹¹Ìå
|
struct QueryPdplanRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñÌí¼Ó³É¹¦£¬0·ñ1ÊÇ
|
PdplanInfo info[0];
|
QueryPdplanRes() {
|
head.type = QUERY_PDPLAN_RES;
|
head.len = sizeof(QueryPdplanRes);
|
}
|
};
|
|
|
//Ìí¼ÓÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå
|
struct AddMonoutputReq
|
{
|
Head head;
|
MonoutputInfo info[0];
|
AddMonoutputReq() {
|
head.type = ADD_MONOUTPUT_REQ;
|
head.len = sizeof(AddMonoutputReq);
|
}
|
};
|
|
//Ìí¼ÓÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
struct AddMonoutputRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñÌí¼Ó³É¹¦£¬0·ñ1ÊÇ
|
AddMonoutputRes() {
|
head.type = ADD_MONOUTPUT_RES;
|
head.len = sizeof(AddMonoutputRes);
|
}
|
};
|
|
//ɾ³ýÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå
|
struct DelMonoutputReq
|
{
|
Head head;
|
MonoutputInfo info[0];
|
DelMonoutputReq() {
|
head.type = DEL_MONOUTPUT_REQ;
|
head.len = sizeof(DelMonoutputReq);
|
}
|
};
|
|
//ɾ³ýÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
struct DelMonoutputRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñɾ³ý³É¹¦£¬0·ñ1ÊÇ
|
DelMonoutputRes() {
|
head.type = DEL_MONOUTPUT_RES;
|
head.len = sizeof(DelMonoutputRes);
|
}
|
};
|
|
//¸ü¸ÄÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå.
|
struct UpdateMonoutputReq
|
{
|
Head head;
|
MonoutputInfo info[0];
|
UpdateMonoutputReq() {
|
head.type = UPDATE_MONOUTPUT_REQ;
|
head.len = sizeof(UpdateMonoutputReq);
|
}
|
};
|
|
//¸ü¸ÄÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
struct UpdateMonoutputRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñ¸üгɹ¦£¬0·ñ1ÊÇ
|
MonoutputInfo info[0];
|
UpdateMonoutputRes() {
|
head.type = UPDATE_MONOUTPUT_RES;
|
head.len = sizeof(UpdateMonoutputRes);
|
}
|
};
|
|
//²éѯÈÕ²úÁ¿µÄÇëÇó½á¹¹Ìå
|
struct QueryMonoutputReq
|
{
|
Head head;
|
int date;//ÈÕÆÚ
|
double aOutput;//a²úÆ·Ô²úÁ¿
|
double bOutput;//b²úÆ·Ô²úÁ¿
|
double cOutput;//c²úÆ·Ô²úÁ¿
|
|
QueryMonoutputReq() {
|
head.type = QUERY_MONOUTPUT_REQ;
|
head.len = sizeof(QueryMonoutputReq);
|
}
|
};
|
|
//²éѯÈÕ²úÁ¿µÄÏìÓ¦½á¹¹Ìå
|
struct QueryMonoutputRes
|
{
|
Head head;
|
int status;//±íʾÊÇ·ñÌí¼Ó³É¹¦£¬0·ñ1ÊÇ
|
MonoutputInfo info[0];
|
QueryMonoutputRes() {
|
head.type = QUERY_MONOUTPUT_RES;
|
head.len = sizeof(QueryMonoutputRes);
|
}
|
};
|
|
|
|
//ÀúÊ·²éѯ
|
// ÀúÊ·²éѯÉ豸ÐÅÏ¢ÇëÇó½á¹¹Ìå
|
struct HistoryDevReq {
|
Head head;
|
//¸ù¾Ýʱ¼ä·¶Î§²éѯ
|
char startTime[32];
|
char endTime[32];
|
//¹Ø¼ü×Ö²éѯ
|
char keyWord[32];
|
HistoryDevReq() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
memset(this,0,sizeof(HistoryDevReq));
|
head.type = HISTORY_DEV_REQ;
|
head.len = sizeof(HISTORY_DEV_REQ);
|
// ³õʼ»¯²éѯÌõ¼þ×Ö¶Î
|
}
|
};
|
// ÀúÊ·²éѯÉú²ú¼Æ»®ÇëÇó½á¹¹Ìå
|
struct HistoryProReq {
|
Head head;
|
//¸ù¾Ýʱ¼ä·¶Î§²éѯ
|
char startTime[32];
|
char endTime[32];
|
//¹Ø¼ü×Ö²éѯ
|
char keyWord[32];
|
HistoryProReq() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
memset(this,0,sizeof(HistoryProReq ));
|
head.type = HISTORY_PRODUCE_REQ;
|
head.len = sizeof(HistoryProReq);
|
// ³õʼ»¯²éѯÌõ¼þ×Ö¶Î
|
}
|
};
|
// ÀúÊ·²éѯÔ²úÁ¿ÇëÇó½á¹¹Ìå
|
struct HistoryMonReq {
|
Head head;
|
//¸ù¾Ýʱ¼ä·¶Î§²éѯ
|
char startTime[32];
|
char endTime[32];
|
//¹Ø¼ü×Ö²éѯ
|
char keyWord[32];
|
HistoryMonReq() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
memset(this,0,sizeof(HistoryMonReq));
|
head.type = HISTORY_MON_REQ;
|
head.len = sizeof(HistoryMonReq);
|
// ³õʼ»¯²éѯÌõ¼þ×Ö¶Î
|
}
|
};
|
// ÀúÊ·²éѯ»·¾³ÐÅÏ¢ÇëÇó½á¹¹Ìå
|
struct HistoryEnvReq {
|
Head head;
|
//¸ù¾Ýʱ¼ä·¶Î§²éѯ
|
char startTime[32];
|
char endTime[32];
|
//¹Ø¼ü×Ö²éѯ
|
char keyWord[32];
|
HistoryEnvReq() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
memset(this,0,sizeof(HistoryEnvReq));
|
head.type = HISTORY_ENV_REQ;
|
head.len = sizeof(HistoryEnvReq);
|
// ³õʼ»¯²éѯÌõ¼þ×Ö¶Î
|
}
|
};
|
//²éѯÉ豸ÐÅÏ¢ÏìÓ¦½á¹¹Ìå
|
struct HistoryDevRes {
|
Head head;
|
DevicesInfo dev[0];
|
HistoryDevRes() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
head.type = HISTORY_DEV_RES;
|
head.len = sizeof(HistoryDevRes);
|
}
|
};
|
//²éѯÉú²ú¼Æ»®ÏìÓ¦½á¹¹Ìå
|
struct HistoryProRes {
|
Head head;
|
PdplanInfo pro[0];
|
HistoryProRes() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
head.type = HISTORY_PRODUCE_RES;
|
head.len = sizeof(HistoryProRes);
|
}
|
};
|
|
//²éѯ»·¾³ÐÅÏ¢ÏìÓ¦½á¹¹Ìå
|
struct HistoryEnvRes {
|
Head head;
|
dataInfo env[0];
|
HistoryEnvRes() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
head.type = HISTORY_ENV_RES;
|
head.len = sizeof(HistoryEnvRes);
|
}
|
};
|
//²éѯÔ²úÁ¿
|
struct HistoryMonRes {
|
Head head;
|
MonoutputInfo mon[0];
|
HistoryMonRes() {
|
// ³õʼ»¯Êý¾ÝÍ·
|
head.type = HISTORY_MON_RES;
|
head.len = sizeof(HistoryMonRes);
|
}
|
};
|
|
|
//×Ô¶¯Éý¼¶
|
// °æ±¾¸üÐÂÇëÇó
|
struct VersionUpdateReq {
|
Head head;
|
|
char curVersionId[64]; // °æ±¾ºÅ
|
VersionUpdateReq()
|
{
|
head.type = VERSION_UPDATE_REQ;
|
head.len = sizeof(VersionUpdateReq);
|
}
|
};
|
|
|
// °æ±¾¸üÐÂÏìÓ¦
|
struct VersionUpdateRes {
|
Head head;
|
bool state = false;
|
char versionId[64]; // °æ±¾ºÅ
|
char updateDate[32]; // ¸üÐÂʱ¼ä
|
char versionDescription[1024]; //¸üÐÂÃèÊö
|
|
VersionUpdateRes()
|
{
|
head.type = VERSION_UPDATE_RES;
|
head.len = sizeof(VersionUpdateRes);
|
}
|
};
|
|
// °æ±¾¸üÐÂÎļþÏÂÔØÇëÇó
|
struct FileDownloadsReq {
|
Head head;
|
char versionId[64]; // °æ±¾ºÅ
|
FileDownloadsReq()
|
{
|
head.type = FILE_DOWNLOADS_REQ;
|
head.len = sizeof(FileDownloadsReq);
|
}
|
};
|
|
// °æ±¾¸üÐÂÎļþÏÂÔØÏìÓ¦
|
struct FileDownloadsRes {
|
Head head;
|
char versionId[64]; // °æ±¾ºÅ
|
char filename[128]; //ÎļþÃû
|
long long filesize; //Îļþ´óС
|
char c_filepath[128]; //¿Í»§¶Ë·Å×îа汾µÄ±¾µØÂ·¾¶
|
int fileNum; // ÎļþÊýÁ¿
|
long long allFileSize; // Îļþ×Ü´óС
|
char content[0];
|
FileDownloadsRes()
|
{
|
head.type = FILE_DOWNLOADS_RES;
|
head.len = sizeof(FileDownloadsRes);
|
}
|
};
|
|
// ¸üÐÂÎļþÏÂÔØ³É¹¦µÄÏìÓ¦
|
struct DownloadSuccessfullyRes {
|
Head head;
|
bool state = false;
|
char fileName[256];
|
long long fileSize;
|
DownloadSuccessfullyRes()
|
{
|
head.type = DOWNLOAD_SUCCESSFULLY_RES;
|
head.len = sizeof(DownloadSuccessfullyRes);
|
}
|
};
|
|
//°æ±¾¹ÜÀí
|
struct VersionNumReq // °æ±¾ºÅÇëÇó
|
{
|
Head head;
|
VersionNumReq() {
|
head.type = VERSION_NUM_REQ;
|
head.len = sizeof(VersionNumReq);
|
}
|
};
|
|
struct VersionNumRes // °æ±¾ºÅÏìÓ¦
|
{
|
Head head;
|
char versionId[64]; // °æ±¾ºÅ
|
VersionNumRes() {
|
head.type = VERSION_NUM_RES;
|
head.len = sizeof(VersionNumRes);
|
}
|
};
|
|
// Îļþ´«Êä
|
struct FileInfo
|
{
|
char fileName[256];
|
long long fileSize;
|
char s_filepath[128];
|
};
|
|
struct UploadFileReq // ÉÏ´«ÎļþµÄÇëÇó
|
{
|
Head head;
|
FileInfo fileInfo;
|
UploadFileReq() {
|
head.type = UPLOAD_FILE_REQ;
|
head.len = sizeof(UploadFileReq);
|
}
|
};
|
|
struct UploadFileRes { // ÉÏ´«ÎļþµÄÏìÓ¦
|
Head head;
|
bool state = false;
|
char fileName[256];
|
long long file_size;
|
UploadFileRes()
|
{
|
head.type = UPLOAD_FILE_RES;
|
head.len = sizeof(UploadFileRes);
|
}
|
};
|
|
// °æ±¾ÐÅϢ¼Èë
|
// ÇëÇó
|
struct VersionInfoEntryReq {
|
Head head;
|
char versionId[64]; // °æ±¾ºÅ
|
char versionIdOld[64]; // ÉÏÒ»¸ö°æ±¾ºÅ
|
int fileNum;
|
char c_filepath[32]; //·þÎñÆ÷·Å×îа汾µÄ·¾¶
|
char versionDescription[256]; //¸üÐÂÄÚÈÝ
|
char versionCreattime[32]; // ¸üÐÂʱ¼ä
|
FileInfo fileInfo[0] ; //°üº¬ÏÂÔØÎļþÐÅÏ¢
|
|
VersionInfoEntryReq()
|
{
|
head.type = VERSION_INFOENTRY_REQ;
|
head.len = sizeof(VersionInfoEntryReq);
|
}
|
};
|
|
// °æ±¾ÐÅϢ¼ÈëÏìÓ¦
|
struct VersionInfoEntryRes {
|
Head head;
|
bool state = false;
|
VersionInfoEntryRes()
|
{
|
head.type = VERSION_INFOENTRY_RES;
|
head.len = sizeof(VersionInfoEntryRes);
|
}
|
};
|
|
//ÈÕÖ¾
|
struct ParsedLog {
|
char timeStamp[64]; // ʱ¼ä´Á
|
char deviceId[64]; // É豸ID
|
char level[16]; // ÈÕÖ¾¼¶±ð
|
char content[256]; // ÈÕÖ¾ÄÚÈÝ
|
char userId[64]; // Óû§ID
|
char fileName[32]; //ÎļþÃû
|
int problemLine; //²úÉú´íÎóÐкÅ
|
char functionName[32]; //º¯ÊýÃû
|
};
|
|
// ÈÕÖ¾²éѯÇëÇó½á¹¹Ìå
|
struct LogQueryReq {
|
Head head; // Êý¾ÝÍ·
|
int logLimit; //·þÎñ¶Ë·¢ËÍÈÕÖ¾ÊýÁ¿ÏÞÖÆ
|
char startTime[20]; // ¸ù¾Ýʵ¼ÊÐèÒªµ÷Õû´óС
|
char endTime[20]; // ¸ù¾Ýʵ¼ÊÐèÒªµ÷Õû´óС
|
char content[256]; // ÈÕÖ¾ÄÚÈÝ
|
char level[16]; //ÈÕÖ¾¼¶±ð
|
char deviceId[64]; // É豸ID
|
// Î޲ι¹Ô캯Êý
|
LogQueryReq() {
|
head.type = LOGSEARCH_REQ;
|
head.len = sizeof(LogQueryReq);
|
}
|
};
|
|
// ÈÕÖ¾²éѯÏìÓ¦½á¹¹Ìå
|
struct LogQueryRes {
|
Head head;
|
int status; // ÏìӦ״̬ (Èç 1 ±íʾ³É¹¦)
|
ParsedLog parsedLog[0]; // ʹÓÃÈáÐÔÊý×é´æ´¢²éѯ½á¹û
|
|
// Î޲ι¹Ô캯Êý
|
LogQueryRes() {
|
head.type = LOGSEARCH_RES;
|
head.len = sizeof(LogQueryRes);
|
}
|
};
|
|
|
|
|
|
#endif // COMMON_H
|