| | |
| | | //日志 |
| | | LOGSEARCH_REQ,//日志查询请求 |
| | | LOGSEARCH_RES,//日志查询响应 |
| | | |
| | | //历史查询分析 |
| | | HISTORY_DEV_REQ, //历史查询硬件请求 |
| | | HISTORY_DEV_RES, //历史查询硬件响应 |
| | | HISTORY_PRODUCE_REQ, //历史查询生产请求 |
| | | HISTORY_PRODUCE_RES, //历史查询生产响应 |
| | | HISTORY_ENV_REQ, //历史查询环境请求 |
| | | HISTORY_ENV_RES, //历史查询环境响应 |
| | | |
| | | }; |
| | | |
| | |
| | | //设备管理 |
| | | struct DevicesInfo |
| | | { |
| | | int deviceID; |
| | | char deviceName[32];//设备名称 |
| | | char deviceStatus[32];//设备状态 |
| | | char area[32]; // 地区 |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | char purchasingTime[15];//购买时间 |
| | | char installTime[15];//安装时间 |
| | | char manufacturer[100];//厂家 |
| | | char devicesSerialNumber[32];//设备编码 |
| | | char devicesType[32];//设备类型 |
| | | double longitude;//经度 |
| | | double latitude;//纬度 |
| | | char purchasingTime[15];//购买时间 |
| | | char installTime[15];//安装时间 |
| | | char devicesSerialNumber[32];//设备编码 |
| | | }; |
| | | //添加设备 |
| | | struct ADReq//添加请求 |
| | | { |
| | | Head head; |
| | | char deviceName[32]; |
| | | DevicesInfo devInfo[0]; |
| | | ADReq() { |
| | | head.type = AD_REQ; |
| | | head.len = sizeof(ADReq); |
| | |
| | | struct ADRes//添加响应 |
| | | { |
| | | Head head; |
| | | int type; |
| | | int status; |
| | | ADRes() { |
| | | head.type = AD_RES; |
| | | head.len = sizeof(ADRes); |
| | |
| | | |
| | | }; |
| | | //修改设备 |
| | | struct MDRes//修改请求 |
| | | struct MDReq//修改请求 |
| | | { |
| | | Head head; |
| | | DevicesInfo info; |
| | | MDRes() { |
| | | head.type = MD_RES; |
| | | head.len = sizeof(MDRes); |
| | | } |
| | | }; |
| | | struct MDReq//修改响应 |
| | | { |
| | | Head head; |
| | | int type; |
| | | |
| | | MDReq() { |
| | | head.type = MD_REQ; |
| | | head.len = sizeof(MDReq); |
| | | } |
| | | }; |
| | | struct MDRes//修改响应 |
| | | { |
| | | Head head; |
| | | DevicesInfo info; |
| | | int status; |
| | | MDRes() { |
| | | head.type = MD_RES; |
| | | head.len = sizeof(MDRes); |
| | | } |
| | | }; |
| | | //查询设备 |
| | |
| | | struct QDRes//查询响应 |
| | | { |
| | | Head head; |
| | | int type; |
| | | int status; |
| | | QDRes() { |
| | | head.type = QD_RES; |
| | | head.len = sizeof(QDRes); |
| | |
| | | //生产计划管理 |
| | | struct PdplanInfo |
| | | { |
| | | int id;//生产计划编号 |
| | | char planName[32];//生产计划名字 |
| | | int planId;//订单编号 |
| | | char planName[32];//订单名字 |
| | | char startDate[32];//起始日期 |
| | | char closingDate[32];//截至日期 |
| | | char closingDate[32];//交付日期 |
| | | char pdName[8];//产品名 |
| | | double plannedPd;//计划生产量 |
| | | double actualPd;//实际生产量 |
| | | double progress;//生产进度 |
| | |
| | | struct MonoutputInfo |
| | | { |
| | | int month;//月份 |
| | | double output;//月产量 |
| | | double aOutput;//a产品月产量 |
| | | double bOutput;//b产品月产量 |
| | | double cOutput;//c产品月产量 |
| | | }; |
| | | |
| | | //添加一条生产计划的请求结构体 |
| | |
| | | struct QueryPdplanReq |
| | | { |
| | | Head head; |
| | | int id;//生产计划编号 |
| | | char planName[32];//生产计划名字 |
| | | int planId;//订单编号 |
| | | char planName[32];//订单划名字 |
| | | char startDate[32];//起始日期 |
| | | char closingDate[32];//截至日期 |
| | | char closingDate[32];//交付日期 |
| | | char pdName[8];//产品名 |
| | | double plannedPd;//计划生产量 |
| | | double actualPd;//实际生产量 |
| | | double progress;//生产进度 |
| | | int finishOntime;//是否按期完成 |
| | | QueryPdplanReq() { |
| | | head.type = QUERY_PDPLAN_REQ; |
| | |
| | | { |
| | | Head head; |
| | | int month;//月份 |
| | | double output;//月产量 |
| | | double aOutput;//a产品月产量 |
| | | double bOutput;//b产品月产量 |
| | | double cOutput;//c产品月产量 |
| | | QueryMonoutputReq() { |
| | | head.type = QUERY_MONOUTPUT_REQ; |
| | | head.len = sizeof(QueryMonoutputReq); |
| | |
| | | |
| | | |
| | | //历史查询分析 |
| | | // 历史查询请求结构体 |
| | | struct HistoryQueryReq { |
| | | |
| | | //历史查询分析 |
| | | |
| | | struct warningInfo { |
| | | int device_id; |
| | | char des[32]; |
| | | char time[32]; |
| | | float data; |
| | | char type[16]; |
| | | char status[16]; |
| | | }; |
| | | // 历史查询设备信息请求结构体 |
| | | struct HistoryDevReq { |
| | | Head head; |
| | | //根据时间范围查询 |
| | | char startTime[32]; |
| | | char endTime[32]; |
| | | //关键字查询 |
| | | char keyWord[32]; |
| | | HistoryQueryReq() { |
| | | HistoryDevReq() { |
| | | // 初始化数据头 |
| | | head.type = QUERY_MONOUTPUT_REQ; |
| | | head.len = sizeof(HistoryQueryReq); |
| | | head.type = HISTORY_DEV_REQ; |
| | | head.len = sizeof(HISTORY_DEV_REQ); |
| | | // 初始化查询条件字段 |
| | | std::memset(startTime, 0, sizeof(startTime)); |
| | | std::memset(endTime, 0, sizeof(endTime)); |
| | | |
| | | } |
| | | }; |
| | | // 历史查询生产计划请求结构体 |
| | | struct HistoryProReq { |
| | | Head head; |
| | | //根据时间范围查询 |
| | | char startTime[32]; |
| | | char endTime[32]; |
| | | //关键字查询 |
| | | char keyWord[32]; |
| | | HistoryProReq() { |
| | | // 初始化数据头 |
| | | head.type = HISTORY_PRODUCE_REQ; |
| | | head.len = sizeof(HistoryProReq); |
| | | // 初始化查询条件字段 |
| | | } |
| | | }; |
| | | // 历史查询环境信息请求结构体 |
| | | struct HistoryEnvReq { |
| | | Head head; |
| | | //根据时间范围查询 |
| | | char startTime[32]; |
| | | char endTime[32]; |
| | | //关键字查询 |
| | | char keyWord[32]; |
| | | HistoryEnvReq() { |
| | | // 初始化数据头 |
| | | head.type = HISTORY_ENV_REQ; |
| | | head.len = sizeof(HistoryEnvReq); |
| | | // 初始化查询条件字段 |
| | | } |
| | | }; |
| | | |
| | | // 历史查询响应结构体 |
| | | |
| | | // 系统运行状态表相关信息 |
| | | struct HistroyInfo { |
| | | WarningRes warn;//警报查询 |
| | | QDRes dev;//设备查询 |
| | | QueryPdplanRes pro;//生产计划查询 |
| | | }; |
| | | struct HistoryQueryRes { |
| | | //查询设备信息响应结构体 |
| | | struct HistoryDevRes { |
| | | Head head; |
| | | HistroyInfo sys[0]; |
| | | HistoryQueryRes() { |
| | | DevicesInfo dev[0]; |
| | | HistoryDevRes() { |
| | | // 初始化数据头 |
| | | head.type = QUERY_MONOUTPUT_RES; |
| | | head.len = sizeof(HistoryQueryRes); |
| | | 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; |
| | | warningInfo env[0]; |
| | | HistoryEnvRes() { |
| | | // 初始化数据头 |
| | | head.type = HISTORY_ENV_RES; |
| | | head.len = sizeof(HistoryEnvRes); |
| | | } |
| | | }; |
| | | |