From 68ab5911d454af832828b2a75e21db88ab6cc200 Mon Sep 17 00:00:00 2001
From: lhl <1281544429@qq.com>
Date: 星期三, 06 十一月 2024 15:01:56 +0800
Subject: [PATCH] 提交日志

---
 common.h |  152 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 110 insertions(+), 42 deletions(-)

diff --git a/common.h b/common.h
index e52d8d8..6d36e1f 100644
--- a/common.h
+++ b/common.h
@@ -90,6 +90,14 @@
 	//鏃ュ織
 	LOGSEARCH_REQ,//鏃ュ織鏌ヨ璇锋眰
 	LOGSEARCH_RES,//鏃ュ織鏌ヨ鍝嶅簲
+	
+	//鍘嗗彶鏌ヨ鍒嗘瀽
+	HISTORY_DEV_REQ,        //鍘嗗彶鏌ヨ纭欢璇锋眰
+	HISTORY_DEV_RES,        //鍘嗗彶鏌ヨ纭欢鍝嶅簲
+	HISTORY_PRODUCE_REQ,    //鍘嗗彶鏌ヨ鐢熶骇璇锋眰
+	HISTORY_PRODUCE_RES,    //鍘嗗彶鏌ヨ鐢熶骇鍝嶅簲
+	HISTORY_ENV_REQ,    //鍘嗗彶鏌ヨ鐜璇锋眰
+	HISTORY_ENV_RES,    //鍘嗗彶鏌ヨ鐜鍝嶅簲
 
 };
 
@@ -276,22 +284,22 @@
 //璁惧绠$悊
 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);
@@ -302,7 +310,7 @@
 struct ADRes//娣诲姞鍝嶅簲
 {
 	Head head;
-	int type;
+	int status;
 	ADRes() {
 		head.type = AD_RES;
 		head.len = sizeof(ADRes);
@@ -310,22 +318,23 @@
 
 };
 //淇敼璁惧
-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);
 	}
 };
 //鏌ヨ璁惧
@@ -341,7 +350,7 @@
 struct QDRes//鏌ヨ鍝嶅簲
 {
 	Head head;
-	int type;
+	int status;
 	QDRes() {
 		head.type = QD_RES;
 		head.len = sizeof(QDRes);
@@ -436,6 +445,8 @@
 //鐜鏁版嵁鍝嶅簲
 struct Environment
 {
+	double longitude;//缁忓害
+	double latitude;//绾害
 	float temp;//娓╁害
 	float humidity;//婀垮害
 	float oxygen;//姘ф皵娴撳害
@@ -463,6 +474,8 @@
 //璁惧鐘舵�佸搷搴�
 struct DeviceStatus
 {
+	double longitude;//缁忓害
+	double latitude;//绾害
 	int deviceID;//璁惧缂栧彿
 	char deviceName[32];//璁惧鍚嶇О
 	char deviceStatus[32];//璁惧鐘舵��
@@ -489,6 +502,8 @@
 //鎿嶄綔鏃ュ織鍝嶅簲
 struct MovementRecord
 {
+	double longitude;//缁忓害
+	double latitude;//绾害
 	char userName;//鎿嶄綔鐢ㄦ埛鍚�
 	char operateTime[32];//鎿嶄綔鏃堕棿
 	char deviceName[32];//鎿嶄綔璁惧
@@ -516,8 +531,10 @@
 //璀︽姤璁板綍鍝嶅簲
 struct AlarmRecord
 {
+	double longitude;//缁忓害
+	double latitude;//绾害
 	char alarmTime[32];//璀︽姤鏃堕棿
-	char alarmtype[32];//閫氱煡鏃堕棿
+	char alarmtype[32];//澶勭悊鏃堕棿
 	char alarmContent[256];//璀︽姤鍐呭
 };
 struct AlarmRecordRes
@@ -819,40 +836,91 @@
 
 
 //鍘嗗彶鏌ヨ鍒嗘瀽
-// 鍘嗗彶鏌ヨ璇锋眰缁撴瀯浣�
-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);
 	}
 };
 

--
Gitblit v1.8.0