From d1ab259186e2341a0839c87300065e9bb5f14e9c Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期二, 12 十一月 2019 10:42:14 +0800 Subject: [PATCH] 2019.11.12 --- ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs | 47 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 37 insertions(+), 10 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs index e31d18c..099699a 100644 --- a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs +++ b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs @@ -208,7 +208,7 @@ case DeviceType.Thermostat: //AC鍔熻兘 - if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513) + if (common.DeviceStatusReport.CluterID == 513) { var ac = deviceUI.CommonDevice as ZigBee.Device.AC; ac.DeviceStatusReport = common.DeviceStatusReport; @@ -217,29 +217,31 @@ { continue; } + + var curTemp = (attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default; switch (attriButeList[0].AttributeId) { case 0: //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝 - ac.currentLocalTemperature = (attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default; + ac.currentLocalTemperature = curTemp; ac.LastDateTime = DateTime.Now; break; case 17: //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鍐锋俯搴︼紝瀹為檯娓╁害涓衡�淐oolingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆� - ac.currentCoolingSetpoint = (attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default; + ac.currentCoolingSetpoint = curTemp; ac.LastDateTime = DateTime.Now; break; case 18: //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆� - ac.currentHeatingSetpoint = (attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default; + ac.currentHeatingSetpoint = curTemp; ac.LastDateTime = DateTime.Now; break; case 4096: //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆� - ac.currentAutoSetpoint = (attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default; + ac.currentAutoSetpoint = curTemp; ac.LastDateTime = DateTime.Now; break; @@ -252,8 +254,31 @@ (rowFL.GetChildren(0) as FunctionMainView).IsSelected = ac.currentSystemMode != 0; (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu(); } + if (common.DeviceStatusReport.CluterID == 514) + { + var ac = deviceUI.CommonDevice as ZigBee.Device.AC; + var attriButeList = common.DeviceStatusReport.AttriBute; + if (attriButeList == null || attriButeList.Count == 0) + { + return; + } + ac.DeviceStatusReport = common.DeviceStatusReport; + switch (attriButeList[0].AttributeId) + { + case 0: + ac.currentFanMode = attriButeList[0].AttriButeData; + ac.LastDateTime = DateTime.Now; + break; + case 4096: + ac.currentFanSwingMode = attriButeList[0].AttriButeData; + ac.LastDateTime = DateTime.Now; + break; + } + (rowFL.GetChildren(0) as FunctionMainView).IsSelected = ac.currentSystemMode != 0; + (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu(); + } //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� - if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3) + if (common.DeviceStatusReport.CluterID == 3) { var ac = deviceUI.CommonDevice as AC; ac.IsOnline = 1; @@ -311,7 +336,7 @@ } }); } - + } /// <summary> /// Changeds the IL ogic status. @@ -919,7 +944,7 @@ /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> private void GoToAddGateWay(object sender, MouseEventArgs mouseEventArgs) { - var selectNewGateWayForm = new UserCenter.GatewayAdd.NewGateWaySelectForm { }; + var selectNewGateWayForm = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm { }; selectNewGateWayForm.AddForm(selectNewGateWayForm); } @@ -972,7 +997,7 @@ else { deviceVerticalScrolViewLayout = new VerticalScrolViewLayout { }; - + functionSceneBodyView.AddChidren(deviceVerticalScrolViewLayout); for(int i=0;i<deviceList.Count;i++) { @@ -996,7 +1021,7 @@ deviceVerticalScrolViewLayout.AddChidren(itemView); } - + //鍒犻櫎璁惧 EventHandler<MouseEventArgs> delEvent = (sender, e) => { @@ -1398,6 +1423,7 @@ ac.ReadAutoSetpoint(); ac.ReadFanMode(); ac.ReadSystemMode(); + ac.ReadSystemFansSwingMode(); }); } else @@ -1412,6 +1438,7 @@ ac.ReadAutoSetpoint(); ac.ReadFanMode(); ac.ReadSystemMode(); + ac.ReadSystemFansSwingMode(); } } var lightView = new FunctionMainView(xx, yy); -- Gitblit v1.8.0