240717班级,工业化控制系统,煤矿相关行业,昆仑系统
congmu
2024-11-04 001b6dd04b25c54be1be89543ab21d5b305b92d1
Client/ÀèºëÁØ/code/Devices_Management_Struct.h
@@ -1,107 +1,88 @@
#pragma once
enum TypeInfo
{
   AD_Req,//添加设备请求
   AD_Res,//添加设备响应
   DD_Req,//关闭设备请求
   DD_Res,//关闭设备请求
   PD_Req,//暂停设备请求
   PD_Res,//暂停设备请求
   AD_REQ,//添加设备请求
   AD_RES,//添加设备响应
   MD_REQ,//修改设备请求
   MD_RES,//修改设备响应
   QD_REQ,//查询设备请求
   QD_RES,//查询设备响应
};
struct Head
{
   int type;
   int len;
};
struct DevicesInfo
{
   int deviceID;
   char deviceName[32];//设备名称
   char deviceStatus[32];//设备状态
   char manufacturer[100];//厂家
   char devicesType[32];//设备类型
   double longitude;//经度
   double latitude;//纬度
   char purchasingTime[15];//购买时间
   char installTime[15];//安装时间
   char devicesSerialNumber[32];//设备编码
};
//添加设备
struct ADReq
struct ADReq//添加请求
{
   Head head;
   char Device_Name[32];
   char deviceName[32];
   ADReq() {
      head.type = AD_Req;
      head.len = sizeof(AD_Req);
      head.type = AD_REQ;
      head.len = sizeof(ADReq);
   }
};
struct ADPermission
{
   char Device_Name[32];
   char Device_Status[32];
   char Start_Time[32];
   char Work_Time[32];
   char Manufacturer[100];
   char Devices_Type[32];
};
struct ADRes
struct ADRes//添加响应
{
   Head head;
   ADPermission per;
   int type;
   ADRes() {
      head.type = AD_Res;
      head.type = AD_RES;
      head.len = sizeof(ADRes);
   }
};
//关闭设备
struct DDReq
//修改设备
struct MDRes//修改请求
{
   Head head;
   char Device_Name[32];
   DDReq() {
      head.type = DD_Req;
      head.len = sizeof(DDReq);
   DevicesInfo info;
   MDRes() {
      head.type = MD_RES;
      head.len = sizeof(MDRes);
   }
};
struct DDPermission
{
   char Device_Name[32];
   char Device_Status[32];
   char Start_Time[32];
   char Work_Time[32];
   char Manufacturer[100];
   char Devices_Type[32];
};
struct DDRes
struct MDReq//修改响应
{
   Head head;
   DDPermission per;
   DDRes() {
      head.type = DD_Res;
      head.len = sizeof(DDRes);
   int type;
   MDReq() {
      head.type = MD_REQ;
      head.len = sizeof(MDReq);
   }
};
//暂停设备
struct PDReq
//查询设备
struct QDReq//查询请求
{
   Head head;
   char Device_Name[32];
   PDReq() {
      head.type = PD_Req;
      head.len = sizeof(PDReq);
   DevicesInfo info;
   QDReq() {
      head.type = QD_REQ;
      head.len = sizeof(QDReq);
   }
};
struct PDPermission
{
   char Device_Name[32];
   char Device_Status[32];
   char Start_Time[32];
   char Work_Time[32];
   char Manufacturer[100];
   char Devices_Type[32];
};
struct PDRes
struct QDRes//查询响应
{
   Head head;
   PDPermission per;
   PDRes() {
      head.type = PD_Res;
      head.len = sizeof(PDRes);
   int type;
   QDRes() {
      head.type = QD_RES;
      head.len = sizeof(QDRes);
   }
};