240717班级,工业化控制系统,煤矿相关行业,昆仑系统
lzx
2024-11-09 204ed8bff86568e57acae30cd905a4ba70f5f0f0
common.h
@@ -83,9 +83,9 @@
   //历史查询
   HISTORY_DEV_REQ,        //历史查询硬件请求
    HISTORY_DEV_RES,     //历史查询硬件响应
    HISTORY_PRODUCE_REQ, //历史查询生产请求
    HISTORY_PRODUCE_RES, //历史查询生产响应
    HISTORY_DEV_RES,        //历史查询硬件响应
    HISTORY_PRODUCE_REQ,    //历史查询生产请求
    HISTORY_PRODUCE_RES,    //历史查询生产响应
    HISTORY_ENV_REQ,    //历史查询环境请求
    HISTORY_ENV_RES,    //历史查询环境响应
    HISTORY_MON_REQ,    //历史查询月产量请求
@@ -98,6 +98,14 @@
   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,//日志查询请求
@@ -292,16 +300,17 @@
//设备管理
struct DevicesInfo
{
   char deviceName[32];//设备名称
   char deviceStatus[32];//设备状态
   char area[32];//地区
   double longitude;//经度
   double latitude;//纬度
   char purchasingTime[15];//购买时间
   char installTime[15];//安装时间
   char manufacturer[100];//厂家
    char deviceSerialNumber[32];//设备编码
    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//添加请求
@@ -330,6 +339,9 @@
{
   Head head;
   DevicesInfo info;
    char condition[32];
    char modifiedContent[100];
    double laOrLo;
   MDReq() {
      head.type = MD_REQ;
      head.len = sizeof(MDReq);
@@ -339,6 +351,9 @@
{
   Head head;
   int status;
    char conditon[32];
    char modifiedContent[100];
    double laOrLo;
   MDRes() {
      head.type = MD_RES;
      head.len = sizeof(MDRes);
@@ -615,7 +630,7 @@
    Head head;
   int status;
    CoaMinRod coaMinRod[0];
        CoaMinRodReS(){
        CoaMinRodRes(){
        head.type = COAL_MINE_RODER_RES;
        head.len = sizeof(CoaMinRodReS);
    }
@@ -730,10 +745,17 @@
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
};
//添加生产计划的请求结构体
@@ -745,7 +767,7 @@
      head.type = ADD_PDPLAN_REQ;
      head.len = sizeof(AddPdplanReq);
   }
}
};
//添加一条生产计划的响应结构体
struct AddPdplanRes
{
@@ -940,6 +962,7 @@
    char keyWord[32];
    HistoryDevReq() {
        // 初始化数据头
        memset(this,0,sizeof(HistoryDevReq));
        head.type = HISTORY_DEV_REQ;
        head.len = sizeof(HISTORY_DEV_REQ);
        // 初始化查询条件字段
@@ -955,6 +978,7 @@
    char keyWord[32];
    HistoryProReq() {
        // 初始化数据头
        memset(this,0,sizeof(HistoryProReq ));
        head.type = HISTORY_PRODUCE_REQ;
        head.len = sizeof(HistoryProReq);
        // 初始化查询条件字段
@@ -970,6 +994,7 @@
    char keyWord[32];
    HistoryMonReq() {
        // 初始化数据头
       memset(this,0,sizeof(HistoryMonReq));
        head.type = HISTORY_MON_REQ;
        head.len = sizeof(HistoryMonReq);
        // 初始化查询条件字段
@@ -985,6 +1010,7 @@
    char keyWord[32];
    HistoryEnvReq() {
        // 初始化数据头
        memset(this,0,sizeof(HistoryEnvReq));
        head.type = HISTORY_ENV_REQ;
        head.len = sizeof(HistoryEnvReq);
        // 初始化查询条件字段
@@ -1103,6 +1129,86 @@
   }
};
//版本管理
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]; // 时间戳