From 30ebeb780347d7cfd076edac9a0ccf90c7edc7b9 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 30 八月 2021 10:39:23 +0800
Subject: [PATCH] 新风单控
---
HDL_ON/DAL/DriverLayer/Control.cs | 43 ++++++++++++++++++++++++++++++-------------
1 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index e3d0166..214efec 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -467,6 +467,7 @@
var actionObjs = new List<ApiAlinkControlActionObj>();
actionObjs.Add(apiControlData);
var pack = httpServer.ControlDevice(actionObjs);
+ MainPage.Log($"杩滅▼鎺у埗鍙嶉:{pack.message}");
}
}
@@ -633,6 +634,7 @@
gatewayId = DB_ResidenceData.Instance.HomeGateway.gatewayId,
sid = securityAlarm.sid, status = state, userSecurityId = securityAlarm.userSecurityId
} });
+ MainPage.Log($"瀹夐槻鎺у埗缁撴灉:{result.Code}");
}
else
{
@@ -770,7 +772,7 @@
{
Ins.GatewayId = device.device_mac;
}
- reportIp = "239.0.168.188";// device.ip_address;//涓绘挱鍦板潃涔熻兘鎺у埗璁惧
+ reportIp = device.ip_address;//涓绘挱鍦板潃涔熻兘鎺у埗璁惧//"239.0.168.188";//
}
}
else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" ||
@@ -784,21 +786,31 @@
|| receiveObj.Topic == CommunicationTopic.ct.ReadSecurityStatus + "_reply"
|| receiveObj.Topic == CommunicationTopic.ct.SecurityStatusUp)
{
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(receiveObj.BodyDataString);
- if (temp != null)
+ try
{
- Control_Udp.ReceiveRepeatManager(temp.id, null);
- foreach (var updataSecurity in temp.objects)
- {
- var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid);
- if (updataLocalSecurity != null)
+ MainPage.Log($"灞�鍩熺綉瀹夐槻淇℃伅: {receiveObj.Topic} : 鍐呭: {res[1]}");
+ var tt = "";
+ lock (tt) {
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(receiveObj.BodyDataString);
+ if (temp != null)
{
- updataLocalSecurity.status = updataSecurity.status;
- updataLocalSecurity.alarm = updataSecurity.alarm;
+ Control_Udp.ReceiveRepeatManager(temp.id, null);
+ foreach (var updataSecurity in temp.objects)
+ {
+ var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid);
+ if (updataLocalSecurity != null)
+ {
+ updataLocalSecurity.status = updataSecurity.status;
+ updataLocalSecurity.alarm = updataSecurity.alarm;
+ ArmCenterPage.LoadEvent_RefreshSecurityStatus(updataLocalSecurity);
+ }
+ }
+ HomePage.LoadEvent_RefreshSecurityStatus();
}
}
- HomePage.LoadEvent_RefreshSecurityStatus();
- ArmCenterPage.LoadEvent_RefreshSecurityStatus();
+ }
+ catch (Exception ex){
+ MainPage.Log($"瀹夐槻灞�鍩熺綉寮傚父锛歿ex.Message}");
}
}
else
@@ -855,7 +867,7 @@
return;
}
}
- MainPage.Log($"A鍗忚鏇存柊鐘舵��:{revString}");
+ //MainPage.Log($"A鍗忚鏇存柊鐘舵��:{revString}");
foreach (var attr in updateTemp.status)
{
localFunction.time_stamp = temp.time_stamp;
@@ -866,6 +878,9 @@
Function localObj = null;
switch (localFunction.spk)
{
+ case SPK.AirSwitch:
+ AirSwitchPage.UpdataState(localFunction);
+ break;
case SPK.ElectricEnergy:
EnergyMainPage.UpdataStatus(localFunction);
break;
@@ -949,6 +964,7 @@
}
break;
case SPK.FloorHeatStandard:
+ localFunction.lastState = "";
switch (localFunction.GetAttrState(FunctionAttributeKey.Mode))
{
case "normal":
@@ -1014,6 +1030,7 @@
case SPK.ClothesHanger:
case SPK.AcIr:
case SPK.SenesorMegahealth:
+ case SPK.AirFreshStandard:
//璁惧鐘舵�佹帹閫�
//鐘舵�佹洿鏂�
Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status);
--
Gitblit v1.8.0