From 96c686f89f126ad4cf1e262b83301fb7cc8bf2d5 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期四, 07 十一月 2019 10:57:31 +0800 Subject: [PATCH] 2019.11.7 --- ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml | 22 +++++----- ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs | 14 +++--- ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide | 0 ZigbeeApp/Shared/Common/DeviceUI.cs | 28 ++++++------- 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml index 7bf50aa..6faa49c 100644 --- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml +++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml @@ -2,17 +2,17 @@ <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.M7BBB18B19152766" /> <MonoDevelop.Ide.ItemProperties.GateWay.Ios PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.8c0bdb303f25d82c2a42fb8bfca449bfaca00260" /> <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.M7BBB18B19152766" /> - <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/ZigBee/Device/AC.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Common/DeviceUI.cs"> <Files> <File FileName="Shared/R.cs" Line="546" Column="15" /> <File FileName="GateWay.Droid/Assets/Language.ini" /> <File FileName="Shared/Phone/Device/Category/Category.cs" /> - <File FileName="Shared/Phone/UserView/UserHomeView.cs" Line="123" Column="1" /> - <File FileName="Shared/Phone/Device/AC/ACControl.cs" Line="1027" Column="22" /> - <File FileName="Shared/Phone/Device/Category/CategorySceneSelectDevice.cs" Line="1" Column="1" /> - <File FileName="Shared/Common/DeviceUI.cs" Line="345" Column="61" /> - <File FileName="Shared/Phone/Device/AC/ACControlBase.cs" Line="399" Column="10" /> - <File FileName="Shared/Phone/ZigBee/Device/AC.cs" Line="655" Column="81" /> + <File FileName="Shared/Phone/UserView/UserHomeView.cs" /> + <File FileName="Shared/Phone/Device/AC/ACControl.cs" /> + <File FileName="Shared/Phone/Device/Category/CategorySceneSelectDevice.cs" /> + <File FileName="Shared/Common/DeviceUI.cs" Line="415" Column="1" /> + <File FileName="Shared/Phone/Device/AC/ACControlBase.cs" /> + <File FileName="Shared/Phone/ZigBee/Device/AC.cs" /> </Files> <Pads> <Pad Id="ProjectPad"> @@ -27,7 +27,9 @@ </Node> </Node> <Node name="Shared" expanded="True"> - <Node name="Common" expanded="True" /> + <Node name="Common" expanded="True"> + <Node name="DeviceUI.cs" selected="True" /> + </Node> <Node name="Phone" expanded="True"> <Node name="Device" expanded="True"> <Node name="AC" expanded="True" /> @@ -39,9 +41,7 @@ <Node name="UserView" expanded="True" /> <Node name="ZigBee" expanded="True"> <Node name="Common" expanded="True" /> - <Node name="Device" expanded="True"> - <Node name="AC.cs" selected="True" /> - </Node> + <Node name="Device" expanded="True" /> </Node> </Node> </Node> diff --git a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide index a3f97a0..2a25a7c 100644 --- a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide +++ b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide Binary files differ diff --git a/ZigbeeApp/Shared/Common/DeviceUI.cs b/ZigbeeApp/Shared/Common/DeviceUI.cs index 6df30d6..6d543cf 100644 --- a/ZigbeeApp/Shared/Common/DeviceUI.cs +++ b/ZigbeeApp/Shared/Common/DeviceUI.cs @@ -342,39 +342,40 @@ /// <returns></returns> public string GetDeviceStatu() { - if (CommonDevice.Type == DeviceType.OnOffOutput) + var device = CommonDevice; + if (device.Type == DeviceType.OnOffOutput) { - if ((CommonDevice as ToggleLight).OnOffStatus == 1) + if ((device as ToggleLight).OnOffStatus == 1) { return Language.StringByID(R.MyInternationalizationString.Open); } return Language.StringByID(R.MyInternationalizationString.Shut); } - else if (CommonDevice.Type == DeviceType.AirSwitch) + else if (device.Type == DeviceType.AirSwitch) { - if ((CommonDevice as ZigBee.Device.AirSwitch).OnOffStatus == 1) + if ((device as ZigBee.Device.AirSwitch).OnOffStatus == 1) { return Language.StringByID(R.MyInternationalizationString.Open); } return Language.StringByID(R.MyInternationalizationString.Shut); } - else if (CommonDevice.Type == DeviceType.DimmableLight) + else if (device.Type == DeviceType.DimmableLight) { - if ((CommonDevice as DimmableLight).OnOffStatus == 0 || (CommonDevice as DimmableLight).Level == 0) + if ((device as DimmableLight).OnOffStatus == 0 || (device as DimmableLight).Level == 0) { return Language.StringByID(R.MyInternationalizationString.Shut); } - return $"{(int)((CommonDevice as DimmableLight).Level * 1.0 / 254 * 100)}%"; + return $"{(int)((device as DimmableLight).Level * 1.0 / 254 * 100)}%"; } - else if (CommonDevice.Type == DeviceType.WindowCoveringDevice) + else if (device.Type == DeviceType.WindowCoveringDevice) { - if ((CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage == 0) + if ((device as Rollershade).WcdCurrentPositionLiftPercentage == 0) { return Language.StringByID(R.MyInternationalizationString.Shut); } - return $"{(CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage}%"; + return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%"; } - else if (CommonDevice.Type == DeviceType.Thermostat) + else if (device.Type == DeviceType.Thermostat) { //娓╁害锛屾ā寮忥紝椋庨�� string tempareture = string.Empty; @@ -429,10 +430,7 @@ { return $"{model},{wind}"; } - else - { - return $"{model},{wind},{tempareture}"; - } + return $"{model},{wind},{tempareture}"; } else { diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs index 2ec303f..1cad5f8 100644 --- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs @@ -143,12 +143,12 @@ //Thermostat鍔熻兘 if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513) { - var attriButeList = (common as ZigBee.Device.AC).DeviceStatusReport.AttriBute; + var attriButeList = common.DeviceStatusReport.AttriBute; if (attriButeList == null || attriButeList.Count == 0) { return; } - ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport; + ac.DeviceStatusReport = common.DeviceStatusReport; switch (attriButeList[0].AttributeId) { case 0: @@ -306,13 +306,13 @@ /// <summary> /// 鍒濆鍖� /// </summary> - /// <param name="device">Device.</param> - /// <param name="room">Room.</param> - private void InitAC(DeviceUI device, Common.Room room) + /// <param name="dev">Device.</param> + /// <param name="curRoom">Room.</param> + private void InitAC(DeviceUI dev, Common.Room curRoom) { ZbGateway.StatusList.Add(this); - this.device = device; - this.room = room; + this.device = dev; + this.room = curRoom; this.ac = device.CommonDevice as ZigBee.Device.AC; //娣诲姞topview -- Gitblit v1.8.0