From 5986f63b75bd81c6cef262c670e9251c038cbf5d Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期二, 17 十二月 2019 17:21:07 +0800 Subject: [PATCH] 合并一个版本 --- ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs index 6d52a0a..94c1dc7 100755 --- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs @@ -126,10 +126,10 @@ } if (deviceUI.CommonDevice.Type == DeviceType.DimmableLight) { - if ((common as DimmableLight).DeviceStatusReport.CluterID == 6) + if (common.DeviceStatusReport.CluterID == 6) { dimmableLight = deviceUI.CommonDevice as DimmableLight; - dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport; + dimmableLight.DeviceStatusReport = common.DeviceStatusReport; //璁板綍銆佹洿鏂扮姸鎬� if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) { @@ -142,20 +142,22 @@ { levelSeekBar.IsClickable = true; levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor; + //levelSeekBar.Progress = 100; } else { levelSeekBar.IsClickable = false; levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor; + //levelSeekBar.Progress = 0; } //change color dimmableLight.LastDateTime = DateTime.Now; } //浜害 - if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8) + if (common.DeviceStatusReport.CluterID == 8) { dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; - dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport; + dimmableLight.DeviceStatusReport = common.DeviceStatusReport; var attriButeList = dimmableLight.DeviceStatusReport.AttriBute; if (attriButeList == null || attriButeList.Count == 0) { @@ -375,7 +377,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterHorizontal, TextColor = ZigbeeColor.Current.GXCTextGrayColor, - Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1) + Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as DimmableLight).OnOffStatus == 1) }; itemView.AddChidren(StatuBtn); @@ -392,7 +394,7 @@ }; itemView.AddChidren(levelSeekBar); - if (dimmableLight.OnOffStatus==1) + if (dimmableLight.OnOffStatus == 1) { levelSeekBar.IsClickable = true; levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor; @@ -405,7 +407,7 @@ levelSeekBar.OnProgressChangedEvent += (send2, e2) => { - dimmableLight.SetLevel((int)(levelSeekBar.Progress*MaxLevel/100.0)); + dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0)); }; switchBtn = new Button() -- Gitblit v1.8.0