From 1a0a7f736c6d2e7129e7591d40bed67ec7c0f09a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 05 二月 2021 10:47:42 +0800 Subject: [PATCH] 2021-02-05 1.编译冲突修改 --- HDL_ON/DAL/DriverLayer/Control.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 50 insertions(+), 6 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 84a426e..5d85428 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -279,8 +279,9 @@ /// </summary> /// <param name="commandString"></param> /// <param name="function"></param> + /// <param name="useRemote">鏄惁鐩存帴浣跨敤杩滅▼鍙戦��</param> /// <returns></returns> - public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary) + public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false) { function.controlCounter++; function.refreshTime = DateTime.Now; @@ -309,8 +310,9 @@ MainPage.Log($"鍙戦�佹暟鎹�:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}"); + //useRemote = true; //杩滅▼閫氳 - if (Ins.IsRemote) + if (Ins.IsRemote || useRemote == true) { DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); //ALink鎺у埗銆丅us鎺у埗浣跨敤鍚屼竴涓帴鍙f帶鍒讹紝鐢变簯绔礋璐hВ鏋� @@ -379,6 +381,34 @@ { var pm = new DAL.Server.HttpServerRequest(); var pack = pm.RefreshDeviceStatus(functionIds); + } + /// <summary> + /// 璇诲彇鍔熻兘璇︾粏鏁版嵁 + /// </summary> + /// <param name="functionIds"></param> + public void ReadFunctionsInfo(List<string> functionIds) + { + var pm = new DAL.Server.HttpServerRequest(); + var pack = pm.GetDeviceInfoList(functionIds); + if(pack!= null&& pack.Data!=null) + { + var ddd = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Function>>(pack.Data.ToString()); + if(ddd!= null) + { + foreach(var function in ddd) + { + var temp = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.deviceId == function.deviceId); + if(temp!= null) + { + temp = function; + if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(temp.spk)) + { + Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(temp.sid, temp.status); + } + } + } + } + } } /// <summary> @@ -875,14 +905,28 @@ } break; case SPK.ElectricTV: + break; + case SPK.ElectricTuyaAirCleaner: + case SPK.ElectricTuyaFan: + case SPK.ElectricTuyaWeepRobot: + case SPK.ElectricTuyaWaterValve: + //璁惧鐘舵�佹帹閫� + var myDevice = Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid,updateTemp.status); + if (myDevice != null) + { + localObj = myDevice; + } break; default: break; } - HomePage.UpdataFunctionStates(localObj); - RoomPage.UpdataStates(localObj); - FunctionPage.UpdataStates(localObj); - ClassificationPage.UpdataInfo(localObj); + if (localObj != null) + { + HomePage.UpdataFunctionStates(localObj); + RoomPage.UpdataStates(localObj); + FunctionPage.UpdataStates(localObj); + ClassificationPage.UpdataInfo(localObj); + } } } catch (Exception ex) -- Gitblit v1.8.0