From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期二, 21 七月 2020 09:46:53 +0800 Subject: [PATCH] 请合并最新多功能面板代码 --- ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs | 1145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 1,145 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs new file mode 100755 index 0000000..098d1b9 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs @@ -0,0 +1,1145 @@ +锘縰sing Shared.Common; +using Shared.Phone.UserCenter; +using System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.MainPage.ControlForm +{ + /// <summary> + /// 绌鸿皟绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� + /// </summary> + public class DeviceAcDetailCardForm : DeviceDetailCardCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鐣岄潰涓婂彲浠ユ搷浣滅殑鎺т欢 + /// </summary> + private List<ButtonBase> listControl = new List<ButtonBase>(); + /// <summary> + /// 绌鸿皟鎺т欢 + /// </summary> + private ArcScaleSeekBar arcScaleSeekBar = null; + /// <summary> + /// 绌鸿皟鎺т欢閲岄潰鐨勯偅涓樉绀哄埗鐑�,鍒跺喎鐨勬帶浠� + /// </summary> + private NormalViewControl btnNowModeView = null; + /// <summary> + /// 鍑忓彿鎺т欢 + /// </summary> + private IconViewControl btnReduce = null; + /// <summary> + /// 鍔犲彿鎺т欢 + /// </summary> + private IconViewControl btnAdd = null; + /// <summary> + /// 鏄惁璁剧疆杩涘害鍊�(鍙娇鐢ㄤ竴娆″悗,灏卞彉鏇村��) + /// </summary> + private bool notSetProgress = false; + /// <summary> + /// 鑳藉惁鍙戦�佽繘搴﹀�煎懡浠� + /// </summary> + private bool canSetProgress = true; + /// <summary> + /// 娓呮礂婊ょ綉鎻愮ず鐨凢rameLayout + /// </summary> + private FrameLayout frameClrean = null; + /// <summary> + /// 褰撳墠鐨勬俯搴﹁繘搴﹀�� + /// </summary> + private int nowProgressValue = -1; + /// <summary> + /// 绌鸿皟鎺т欢 + /// </summary> + private AC deviceAc = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 搴曞眰鍒濆鍖栦腑閮ㄦ帶浠跺畬鎴愪箣鍚� + /// </summary> + /// <param name="frameWhiteBack"></param> + public override void InitMiddleFrameAfter(FrameLayout frameWhiteBack) + { + //宸︽粦涓嶈兘 + this.ScrollEnabled = false; + this.deviceAc = (AC)this.device; + //鍏堟竻绌� + this.listControl = new List<ButtonBase>(); + if (device.HadReadDeviceStatu == true && DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) + { + //璁剧疆鐘舵�佹枃瀛� 褰撳墠瀹ゆ俯 + this.SetStatuText(deviceAc.currentLocalTemperature + "鈩�"); + } + else + { + //璁剧疆鐘舵�佹枃瀛� 鍏抽棴 + this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close)); + } + + //娓呮礂婊ょ綉鎻愮ず鐨凢rameLayout + this.frameClrean = new FrameLayout(); + frameClrean.Width = Application.GetRealWidth(600); + frameClrean.Height = this.GetPictrueRealSize(69); + frameClrean.X = ControlCommonResourse.XXLeft; + frameClrean.Y = Application.GetRealHeight(35); + frameWhiteBack.AddChidren(frameClrean); + frameClrean.Visible = false; + //娓呮礂婊ょ綉鎻愮ず鐨勫浘鏍� + var btnTipIcon = new IconViewControl(69); + btnTipIcon.UnSelectedImagePath = "AC/AC_TIP.png"; + frameClrean.AddChidren(btnTipIcon); + //璇锋敞鎰忔竻娲楁护缃戝摝 + var btnClrean = new NormalViewControl(Application.GetRealWidth(400), frameClrean.Height, false); + btnClrean.TextID = R.MyInternationalizationString.uPleaseClreanACfilter; + btnClrean.X = frameClrean.Right + Application.GetRealWidth(12); + frameClrean.AddChidren(btnClrean); + + //璋冩暣璁惧鍜岀姸鎬佹帶浠剁殑Y杞� + this.ResetDeviceNameAndStatuPoint(Application.GetRealHeight(184), Application.GetRealHeight(256)); + + //鍒濆鍖栫┖璋冩帶浠� + this.InitAcControl(frameWhiteBack); + } + + /// <summary> + /// 鍒濆鍖栫┖璋冩帶浠� + /// </summary> + /// <param name="frameWhiteBack"></param> + private void InitAcControl(FrameLayout frameWhiteBack) + { + bool isAcOpen = DeviceAcDetailCardMethord.IsOpen(deviceAc); + + //绌鸿皟鎺т欢鐨勫鍣� + var frameAcBack = new FrameLayout(); + frameAcBack.Y = Application.GetRealHeight(412); + frameAcBack.Width = this.GetPictrueRealSize(671); + frameAcBack.Height = this.GetPictrueRealSize(671); + frameAcBack.Gravity = Gravity.CenterHorizontal; + frameWhiteBack.AddChidren(frameAcBack); + + this.nowProgressValue = DeviceAcDetailCardMethord.GetCurrentModeTemperature(deviceAc); + if (nowProgressValue < 16) { nowProgressValue = 16; } + if (nowProgressValue > 32) { nowProgressValue = 32; } + //绌鸿皟鎺т欢 + this.arcScaleSeekBar = new ArcScaleSeekBar(); + arcScaleSeekBar.Width = frameAcBack.Width; + arcScaleSeekBar.Height = frameAcBack.Height; + arcScaleSeekBar.MinValue = 16; + arcScaleSeekBar.MaxValue = 32; + arcScaleSeekBar.Progress = nowProgressValue; + arcScaleSeekBar.IsClickable = isAcOpen; + arcScaleSeekBar.ProgressBarUnitSring = string.Empty; + frameAcBack.AddChidren(arcScaleSeekBar); + if (isAcOpen == true) + { + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); + } + else + { + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + } + + //绌鸿皟鎺т欢閲岄潰鐨勯偅涓樉绀哄埗鐑�,鍒跺喎鐨勬帶浠� + this.btnNowModeView = new NormalViewControl(200, 55, true); + btnNowModeView.Y = this.GetPictrueRealSize(184); + btnNowModeView.Gravity = Gravity.CenterHorizontal; + btnNowModeView.Text = DeviceAcDetailCardMethord.GetModeNameByModeId(deviceAc.currentSystemMode); + btnNowModeView.TextSize = 12; + btnNowModeView.TextAlignment = TextAlignment.Center; + frameAcBack.AddChidren(btnNowModeView); + + //鍑忓彿 + this.btnReduce = new IconViewControl(81); + btnReduce.CanClick = isAcOpen; + btnReduce.UnSelectedImagePath = "AC/Reduce.png"; + btnReduce.X = this.GetPictrueRealSize(132); + btnReduce.Y = this.GetPictrueRealSize(268); + frameAcBack.AddChidren(btnReduce); + btnReduce.ButtonClickEvent += (sender, e) => + { + if (arcScaleSeekBar.Progress > 16) + { + this.nowProgressValue = arcScaleSeekBar.Progress - 1; + arcScaleSeekBar.Progress = this.nowProgressValue; + } + }; + + //鍔犲彿 + this.btnAdd = new IconViewControl(81); + btnAdd.CanClick = isAcOpen; + btnAdd.UnSelectedImagePath = "AC/Add.png"; + btnAdd.X = frameAcBack.Width - this.GetPictrueRealSize(81 + 132); + btnAdd.Y = btnReduce.Y; + frameAcBack.AddChidren(btnAdd); + btnAdd.ButtonClickEvent += (sender, e) => + { + if (arcScaleSeekBar.Progress < 32) + { + this.nowProgressValue = arcScaleSeekBar.Progress + 1; + arcScaleSeekBar.Progress = this.nowProgressValue; + } + }; + + //鈩� + var btnUint = new NormalViewControl(100, 66, true); + btnUint.Y = this.GetPictrueRealSize(366); + btnUint.Gravity = Gravity.CenterHorizontal; + btnUint.TextAlignment = TextAlignment.Center; + btnUint.Text = "鈩�"; + btnUint.TextSize = 18; + frameAcBack.AddChidren(btnUint); + + //閫侀娌℃湁娓╁害鐨勬蹇� + if (deviceAc.currentSystemMode == 7) + { + //棰滆壊鍙樻洿 + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + arcScaleSeekBar.IsClickable = false; + this.btnReduce.CanClick = false; + this.btnAdd.CanClick = false; + } + + //鏄惁鍚敤鎽嗛 + int IconSpace = Application.GetRealWidth(156); + int YY = frameAcBack.Bottom + Application.GetRealHeight(69); + int XX = Application.GetRealWidth(207); + + //鎵妯″紡(绗竴涓浘鏍�) + var btnFanSwingMode = new IconViewControl(81); + if (deviceAc.UseSwingFunction) + { + IconSpace = Application.GetRealWidth(109); + XX = Application.GetRealWidth(156); + + btnFanSwingMode.X = XX; + btnFanSwingMode.Y = YY; + btnFanSwingMode.UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + btnFanSwingMode.SelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + btnFanSwingMode.IsSelected = isAcOpen; + frameWhiteBack.AddChidren(btnFanSwingMode); + btnFanSwingMode.ButtonClickEvent += (sender, e) => + { + //绌鸿皟鎵撳紑鐘舵�佹墠鑳界偣鍑� + if (DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) + { + //閫夋嫨鎽嗛 + this.SelectFanSwing(frameWhiteBack); + } + }; + + XX = btnFanSwingMode.Right + IconSpace; + } + this.listControl.Add(btnFanSwingMode); + + //绌鸿皟妯″紡(绗簩涓浘鏍�) + var btnModel = new IconViewControl(81); + btnModel.X = XX; + btnModel.Y = YY; + btnModel.UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByModeId(deviceAc.currentSystemMode); + btnModel.SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByModeId(deviceAc.currentSystemMode); + btnModel.IsSelected = isAcOpen; + frameWhiteBack.AddChidren(btnModel); + XX = btnModel.Right + IconSpace; + this.listControl.Add(btnModel); + btnModel.ButtonClickEvent += (sender, e) => + { + //绌鸿皟鎵撳紑鐘舵�佹墠鑳界偣鍑� + if (DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) + { + //閫夋嫨妯″紡 + this.SelectAcModel(frameWhiteBack); + } + }; + + //寮�鍏�(绗笁涓浘鏍�) + var btnSwitch = new IconViewControl(81); + btnSwitch.X = XX; + btnSwitch.Y = YY; + btnSwitch.UnSelectedImagePath = "AC/OpenOrClose.png"; + btnSwitch.SelectedImagePath = "AC/OpenOrCloseSelected.png"; + btnSwitch.IsSelected = isAcOpen; + frameWhiteBack.AddChidren(btnSwitch); + XX = btnSwitch.Right + IconSpace; + this.listControl.Add(btnSwitch); + btnSwitch.ButtonClickEvent += (sender, e) => + { + this.SetSwitchComand(!btnSwitch.IsSelected); + }; + + //椋庨�熸ā寮�(绗洓涓浘鏍�) + var btnFanMode = new IconViewControl(81); + btnFanMode.X = XX; + btnFanMode.Y = YY; + btnFanMode.UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanModeUnSelectedImagePathByFanModeId(deviceAc.currentFanMode); + btnFanMode.SelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanModeId(deviceAc.currentFanMode); + btnFanMode.IsSelected = isAcOpen; + frameWhiteBack.AddChidren(btnFanMode); + this.listControl.Add(btnFanMode); + btnFanMode.ButtonClickEvent += (sender, e) => + { + //绌鸿皟鎵撳紑鐘舵�佹墠鑳界偣鍑� + if (DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) + { + //閫夋嫨妯″紡 + this.SelectAcWindSpeed(frameWhiteBack); + } + }; + + //鍒濆鍖栫┖璋冩帶浠朵簨浠� + this.InitAcControlEvent(); + } + + /// <summary> + /// 鍒濆鍖栫┖璋冩帶浠朵簨浠� + /// </summary> + private void InitAcControlEvent() + { + //婊戝姩杩囩▼涓� + int oldProgressValue = arcScaleSeekBar.Progress;//涔嬪墠鐨勫�� + arcScaleSeekBar.OnProgressChangedEvent += (send2, value) => + { + nowProgressValue = value; + }; + + //寮�涓�涓嚎绋�,鐩戣鏄惁婊戝姩鐨勬粦鍔ㄦ潯,姣忕妫�娴嬩竴娆� + HdlThreadLogic.Current.RunThread(() => + { + int timeCount = 0; + while (this.Parent != null) + { + if (this.canSetProgress == false) + { + //缃戝叧娌℃湁鍥炲鍓�,涓嶅啀鍙戦�� + timeCount++; + if (timeCount <= 3) + { + System.Threading.Thread.Sleep(1000); + continue; + } + //濡傛灉3绉掑唴杩樻病鏈夋帴鏀跺埌鏁版嵁鐨勮瘽,鍙互缁х画鍙戦�� + } + //璁℃暟缃┖ + timeCount = 0; + + if (nowProgressValue == oldProgressValue) + { + //鍊间竴鏍� + continue; + } + //鍙戦�佷竴娆″悗,涓嶈兘鍐嶆鍙戦�� + this.canSetProgress = false; + oldProgressValue = nowProgressValue; + //鍙戦�佽繘搴﹀�肩粰璁惧 + this.SetProgressValueToDevice(oldProgressValue); + + System.Threading.Thread.Sleep(1000); + } + if (nowProgressValue != oldProgressValue) + { + //褰撶晫闈㈠叧闂椂,鍊艰繕澶勪簬涓嶄竴鏍锋椂,鐩存帴鍙戦�� + this.SetProgressValueToDevice(nowProgressValue); + } + }); + } + + /// <summary> + /// 鍙戦�佽繘搴﹀�肩粰璁惧 + /// </summary> + /// <param name="value"></param> + private void SetProgressValueToDevice(int value) + { + //鑷繁鍙戣繃鍘荤殑涓滆タ,涓嶉渶瑕佸啀娆¤缃�(闃叉杩涘害鏉℃潵鍥炶烦鍔�),鍙娇鐢ㄤ竴娆� + this.notSetProgress = true; + //鍙戦�佽繘搴﹀�� + if (deviceAc.currentSystemMode == 3 || deviceAc.currentSystemMode == 8) + { + //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + this.canSetProgress = true; + deviceAc.currentCoolingSetpoint = value; + return; + } + deviceAc.SetCoolingTemperatureAsync(value * 100); + } + else if (deviceAc.currentSystemMode == 4) + { + //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + this.canSetProgress = true; + deviceAc.currentHeatingSetpoint = value; + return; + } + deviceAc.SetHeatingTemperatureAsync(value * 100); + } + else if (deviceAc.currentSystemMode == 1) + { + //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + this.canSetProgress = true; + deviceAc.currentAutoSetpoint = value; + return; + } + deviceAc.SetAutoTemperatureAsync(value * 100); + } + } + + #endregion + + #region 鈻� 閫夋嫨鎽嗛(绗竴涓浘鏍�)_______________ + + /// <summary> + /// 閫夋嫨鎽嗛 + /// </summary> + private void SelectFanSwing(FrameLayout frameWhiteBack) + { + var form = new DialogCommonForm(); + //涓嶈皟鐢ㄥ簳灞傜殑鏄剧ず鐣岄潰鏂规硶 + form.AutoLoadShowFormMethord = false; + form.AddForm(); + //鐧借壊鑳屾櫙妗� + var frameBack = new FrameLayout(); + //璁$畻鍑哄畠鐨勭澶存瀵圭潃鍥剧墖涓棿鐨刋杞� + frameBack.X = frameWhiteBack.X + this.listControl[0].X - (Application.GetRealWidth(449) - this.listControl[0].Width) / 2; + //璁$畻鍑哄畠鐨刌杞� 35涓哄簳閮ㄧ澶翠笌鍥炬爣鐨勯棿璺� + frameBack.Y = topFrameLayout.Bottom + frameWhiteBack.Y + this.listControl[0].Y - Application.GetRealHeight(1089 + 35); + frameBack.Height = Application.GetRealHeight(1089); + frameBack.Width = Application.GetRealWidth(449); + frameBack.BackgroundImagePath = "AC/SwingBackground.png"; + form.bodyFrameLayout.AddChidren(frameBack); + + //閫夋嫨鎽嗛 + var frameTitle = new FrameLayout(); + frameTitle.Width = frameBack.Width; + frameTitle.Height = Application.GetRealHeight(150); + frameBack.AddChidren(frameTitle); + var btnTitle = new NormalViewControl(frameBack.Width - Application.GetRealWidth(81), Application.GetRealHeight(60), false); + btnTitle.X = Application.GetRealWidth(81); + btnTitle.Y = Application.GetRealHeight(57); + btnTitle.IsBold = true; + btnTitle.TextID = R.MyInternationalizationString.SelectSwing; + frameTitle.AddChidren(btnTitle); + + //1鎸� + this.InitFanSwingSelectRow(frameBack, AC.FanSwingMode.First, + R.MyInternationalizationString.Swing_First, "AC/Swing_1.png", "AC/Swing_1Selected.png"); + //2鎸� + this.InitFanSwingSelectRow(frameBack, AC.FanSwingMode.Second, + R.MyInternationalizationString.Swing_Second, "AC/Swing_2.png", "AC/Swing_2Selected.png"); + //3鎸� + this.InitFanSwingSelectRow(frameBack, AC.FanSwingMode.Thrid, + R.MyInternationalizationString.Swing_Thrid, "AC/Swing_3.png", "AC/Swing_3Selected.png"); + //4鎸� + this.InitFanSwingSelectRow(frameBack, AC.FanSwingMode.Fourth, + R.MyInternationalizationString.Swing_Fourth, "AC/Swing_4.png", "AC/Swing_4Selected.png"); + //5鎸� + this.InitFanSwingSelectRow(frameBack, AC.FanSwingMode.Fifth, + R.MyInternationalizationString.Swing_Fifth, "AC/Swing_5.png", "AC/Swing_5Selected.png"); + //鑷姩 + this.InitFanSwingSelectRow(frameBack, AC.FanSwingMode.Auto, + R.MyInternationalizationString.Swing_Auto, "AC/Swing_Auto.png", "AC/Swing_AutoSelected.png"); + } + + /// <summary> + /// 鍒濆鍖栨憜椋庨�夋嫨琛屾帶浠� + /// </summary> + /// <param name="frameBack"></param> + /// <param name="i_div"></param> + /// <param name="textId"></param> + /// <param name="unSelectPath"></param> + /// <param name="selectPath"></param> + private void InitFanSwingSelectRow(FrameLayout frameBack, AC.FanSwingMode i_div, int textId, + string unSelectPath, string selectPath) + { + var rowFrame = new FrameRowControl(); + rowFrame.Y = frameBack.GetChildren(frameBack.ChildrenCount - 1).Bottom; + rowFrame.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft; + rowFrame.Height = Application.GetRealHeight(150); + frameBack.AddChidren(rowFrame); + + //鍥炬爣 + var btnIcon = rowFrame.AddLeftIcon(81); + btnIcon.UnSelectedImagePath = unSelectPath; + btnIcon.SelectedImagePath = selectPath; + //鏄剧ず鏂囧瓧 + var btnText = rowFrame.AddLeftCaption(Language.StringByID(textId), 288); + btnText.TextColor = ZigbeeColor.Current.GXCTextGrayColor; + btnText.SelectedTextColor = ZigbeeColor.Current.GXCACSelectedTextColor2; + btnText.X = Application.GetRealWidth(173); + //搴曠嚎 + if (i_div != AC.FanSwingMode.Auto) + { + var btnLine = rowFrame.AddBottomLine(); + btnLine.X = Application.GetRealWidth(81); + } + if (deviceAc.currentFanSwingMode == (int)i_div) + { + //璁剧疆涓洪�夋嫨鐘舵�� + btnIcon.IsSelected = true; + btnText.IsSelected = true; + btnText.IsBold = true; + } + //鎸夐敭鐐瑰嚮 + rowFrame.ButtonClickEvent += (sender, e) => + { + ((DialogCommonForm)frameBack.Parent.Parent).CloseForm(); + //鍙戦�佹憜椋庡懡浠� + this.SetFanSwingComand(i_div); + }; + } + + /// <summary> + /// 鍙戦�佹憜椋庡懡浠� + /// </summary> + /// <param name="fanSwingMode">Fan mode.</param> + private void SetFanSwingComand(AC.FanSwingMode fanSwingMode) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentFanSwingMode = (int)fanSwingMode; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 4096 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + return; + } + var oldModel = (AC.FanSwingMode)deviceAc.currentFanSwingMode; + if (oldModel == fanSwingMode) + { + //閫夋嫨鐨勬槸鍚屼竴涓� + return; + } + //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 + this.StartCheckResponeResult(this.listControl, (result) => + { + if (result == true) + { + //鎺ユ敹鍒扮綉鍏崇殑鍥炲 + HdlThreadLogic.Current.RunMain(() => + { + listControl[0].SelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeSelectedImagePathByFanSwingMode(fanSwingMode); + listControl[0].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeUnSelectedImagePathByFanSwingMode(fanSwingMode); + }); + } + }); + + deviceAc.SetFanSwingAsyncMode(fanSwingMode); + } + + #endregion + + #region 鈻� 閫夋嫨妯″紡(绗簩涓浘鏍�)_______________ + + /// <summary> + /// 閫夋嫨妯″紡 + /// </summary> + private void SelectAcModel(FrameLayout frameWhiteBack) + { + //鑾峰彇妯″紡鑿滃崟涓暟 + int menuCount = this.GetSupportModelMenuCount(); + if (menuCount == 0) + { + //绌鸿皟妯″紡涓虹┖锛岃鍏堥厤缃� + this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AC_Model_None)); + return; + } + int frameBackHeight = 183 + menuCount * 150; + + var form = new DialogCommonForm(); + //涓嶈皟鐢ㄥ簳灞傜殑鏄剧ず鐣岄潰鏂规硶 + form.AutoLoadShowFormMethord = false; + form.AddForm(); + //鐧借壊鑳屾櫙妗� + var frameBack = new FrameLayout(); + //璁$畻鍑哄畠鐨勭澶存瀵圭潃鍥剧墖涓棿鐨刋杞� + frameBack.X = frameWhiteBack.X + this.listControl[1].X - (Application.GetRealWidth(449) - this.listControl[1].Width) / 2; + //璁$畻鍑哄畠鐨刌杞� 35涓哄簳閮ㄧ澶翠笌鍥炬爣鐨勯棿璺� + frameBack.Y = topFrameLayout.Bottom + frameWhiteBack.Y + this.listControl[1].Y - Application.GetRealHeight(frameBackHeight + 35); + frameBack.Height = Application.GetRealHeight(frameBackHeight); + frameBack.Width = Application.GetRealWidth(449); + frameBack.BackgroundImagePath = "AC/SelectedModeBG.png"; + form.bodyFrameLayout.AddChidren(frameBack); + + //閫夋嫨妯″紡 + var frameTitle = new FrameLayout(); + frameTitle.Width = frameBack.Width; + frameTitle.Height = Application.GetRealHeight(150); + frameBack.AddChidren(frameTitle); + var btnTitle = new NormalViewControl(frameBack.Width - Application.GetRealWidth(81), Application.GetRealHeight(60), false); + btnTitle.X = Application.GetRealWidth(81); + btnTitle.Y = Application.GetRealHeight(57); + btnTitle.IsBold = true; + btnTitle.TextID = R.MyInternationalizationString.SelectMode; + frameTitle.AddChidren(btnTitle); + + if (deviceAc.listSupportMode[4] == 1) + { + //鑷姩 + this.InitAcModelSelectRow(frameBack, AC.AcMode.Auto, + R.MyInternationalizationString.Mode_Auto, "AC/Mode_Auto.png", "AC/Mode_AutoSelected.png", ZigbeeColor.Current.GXCTextBlackColor, frameBack.ChildrenCount != menuCount); + } + if (deviceAc.listSupportMode[0] == 1) + { + //鍒跺喎 + this.InitAcModelSelectRow(frameBack, AC.AcMode.Cool, + R.MyInternationalizationString.Mode_Cool, "AC/Mode_Cool.png", "AC/Mode_CoolSelected.png", ZigbeeColor.Current.GXCACSelectedTextColor_Cool, frameBack.ChildrenCount != menuCount); + } + if (deviceAc.listSupportMode[1] == 1) + { + //鍒剁儹 + this.InitAcModelSelectRow(frameBack, AC.AcMode.Heat, + R.MyInternationalizationString.Mode_Heat, "AC/Mode_Heat.png", "AC/Mode_HeatSelected.png", ZigbeeColor.Current.GXCACSelectedTextColor_Heat, frameBack.ChildrenCount != menuCount); + } + if (deviceAc.listSupportMode[3] == 1) + { + //闄ゆ箍 + this.InitAcModelSelectRow(frameBack, AC.AcMode.Dry, + R.MyInternationalizationString.Mode_Dry, "AC/Mode_Dry.png", "AC/Mode_DrySelected.png", ZigbeeColor.Current.GXCACSelectedTextColor_Dry, frameBack.ChildrenCount != menuCount); + } + if (deviceAc.listSupportMode[2] == 1) + { + //閫侀 + this.InitAcModelSelectRow(frameBack, AC.AcMode.FanOnly, + R.MyInternationalizationString.Mode_FanOnly, "AC/Mode_Fan.png", "AC/Mode_FanSelected.png", ZigbeeColor.Current.GXCACSelectedTextColor_Fan, frameBack.ChildrenCount != menuCount); + } + } + + /// <summary> + /// 鍒濆鍖栨ā寮忛�夋嫨琛屾帶浠� + /// </summary> + /// <param name="frameBack"></param> + /// <param name="i_div"></param> + /// <param name="textId"></param> + /// <param name="unSelectPath"></param> + /// <param name="selectPath"></param> + private void InitAcModelSelectRow(FrameLayout frameBack, AC.AcMode i_div, int textId, + string unSelectPath, string selectPath, uint selectColor, bool addLine) + { + var rowFrame = new FrameRowControl(); + rowFrame.Y = frameBack.GetChildren(frameBack.ChildrenCount - 1).Bottom; + rowFrame.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft; + rowFrame.Height = Application.GetRealHeight(150); + frameBack.AddChidren(rowFrame); + + //鍥炬爣 + var btnIcon = rowFrame.AddLeftIcon(81); + btnIcon.UnSelectedImagePath = unSelectPath; + btnIcon.SelectedImagePath = selectPath; + //鏄剧ず鏂囧瓧 + var btnText = rowFrame.AddLeftCaption(Language.StringByID(textId), 288); + btnText.TextColor = ZigbeeColor.Current.GXCTextGrayColor; + btnText.SelectedTextColor = selectColor; + btnText.X = Application.GetRealWidth(173); + //搴曠嚎 + if (addLine == true) + { + var btnLine = rowFrame.AddBottomLine(); + btnLine.X = Application.GetRealWidth(81); + } + if (deviceAc.currentSystemMode == (int)i_div) + { + //璁剧疆涓洪�夋嫨鐘舵�� + btnIcon.IsSelected = true; + btnText.IsSelected = true; + btnText.IsBold = true; + } + //鎸夐敭鐐瑰嚮 + rowFrame.ButtonClickEvent += (sender, e) => + { + ((DialogCommonForm)frameBack.Parent.Parent).CloseForm(); + //鍙戦�佹ā寮忓懡浠� + this.SetAcModelComand(i_div); + }; + } + + /// <summary> + /// 鍙戦�佹ā寮忓懡浠� + /// </summary> + /// <param name="mode">mode.</param> + private void SetAcModelComand(AC.AcMode mode) + { + var oldModel = (AC.AcMode)deviceAc.currentSystemMode; + if (oldModel == mode) + { + //閫夋嫨鐨勬槸鍚屼竴涓� + return; + } + + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentSystemMode = (int)mode; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + //閫侀鐨勬椂鍊�,娌℃湁娓╁害鐨勬蹇� + if (mode == AC.AcMode.FanOnly) + { + //鍔犲噺涓嶅彲浠ョ偣鍑� + btnAdd.CanClick = false; + btnReduce.CanClick = false; + } + //濡傛灉鍘熸潵鐨勭姸鎬佹槸閫侀鐨勮瘽 + else if (oldModel == AC.AcMode.FanOnly) + { + //鍔犲噺鍙互鐐瑰嚮 + btnAdd.CanClick = true; + btnReduce.CanClick = true; + } + return; + } + + //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 + this.StartCheckResponeResult(this.listControl, (result) => + { + if (result == true) + { + //鎺ユ敹鍒扮綉鍏冲洖澶� + HdlThreadLogic.Current.RunMain(() => + { + listControl[1].SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByMode(mode); + listControl[1].UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByMode(mode); + + //閫侀鐨勬椂鍊�,娌℃湁娓╁害鐨勬蹇� + if (mode == AC.AcMode.FanOnly) + { + //棰滆壊鍙樻洿 + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + arcScaleSeekBar.IsClickable = false; + //鍔犲噺涓嶅彲浠ョ偣鍑� + btnAdd.CanClick = false; + btnReduce.CanClick = false; + } + else if (oldModel == AC.AcMode.FanOnly) + { + //濡傛灉鍘熸潵鐨勭姸鎬佹槸閫侀鐨勮瘽 + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); + arcScaleSeekBar.IsClickable = true; + //鍔犲噺鍙互鐐瑰嚮 + btnAdd.CanClick = true; + btnReduce.CanClick = true; + } + }); + } + }); + deviceAc.SetSystemModeAsync(mode); + } + + /// <summary> + /// 鑾峰彇妯″紡鑿滃崟涓暟 + /// </summary> + /// <returns></returns> + private int GetSupportModelMenuCount() + { + int count = 0; + foreach (var m in deviceAc.listSupportMode) + { + if (m == 1) + { + count++; + } + } + return count; + } + + #endregion + + #region 鈻� 寮�鍏虫寜閽�(绗笁涓浘鏍�)_______________ + + /// <summary> + /// 鍙戦�佸紑鍏冲懡浠� + /// </summary> + /// <param name="isOpen"></param> + private void SetSwitchComand(bool isOpen) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentSystemMode = isOpen == true ? 3 : 0; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + //鍔犲噺鏄惁鍙互鐐瑰嚮 + btnAdd.CanClick = isOpen; + btnReduce.CanClick = isOpen; + return; + } + + //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 + this.StartCheckResponeResult(this.listControl, (result) => + { + //鎺ユ敹鍒扮綉鍏冲洖澶� + if (result == true) + { + HdlThreadLogic.Current.RunMain(() => + { + //閭e洓涓浘鏍囧彉鏇� + this.listControl[0].IsSelected = isOpen; + this.listControl[1].IsSelected = isOpen; + this.listControl[2].IsSelected = isOpen; + this.listControl[3].IsSelected = isOpen; + if (isOpen == true) + { + //棰滆壊鍙樻洿 + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); + arcScaleSeekBar.IsClickable = true; + //鍔犲噺鍙互鐐瑰嚮 + btnAdd.CanClick = true; + btnReduce.CanClick = true; + } + else + { + //棰滆壊鍙樻洿 + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + arcScaleSeekBar.IsClickable = false; + //鍔犲噺涓嶅彲浠ョ偣鍑� + btnAdd.CanClick = false; + btnReduce.CanClick = false; + } + }); + } + }); + + if (isOpen == true) + { + deviceAc.Open(); + } + else + { + deviceAc.Close(); + } + } + + #endregion + + #region 鈻� 閫夋嫨椋庨��(绗洓涓浘鏍�)_______________ + + /// <summary> + /// 閫夋嫨椋庨�� + /// </summary> + private void SelectAcWindSpeed(FrameLayout frameWhiteBack) + { + var form = new DialogCommonForm(); + //涓嶈皟鐢ㄥ簳灞傜殑鏄剧ず鐣岄潰鏂规硶 + form.AutoLoadShowFormMethord = false; + form.AddForm(); + //鐧借壊鑳屾櫙妗� + var frameBack = new FrameLayout(); + //璁$畻鍑哄畠鐨勭澶存瀵圭潃鍥剧墖涓棿鐨刋杞� + frameBack.X = frameWhiteBack.X + this.listControl[3].X - (Application.GetRealWidth(449) - this.listControl[3].Width) / 2; + //璁$畻鍑哄畠鐨刌杞� 35涓哄簳閮ㄧ澶翠笌鍥炬爣鐨勯棿璺� + frameBack.Y = topFrameLayout.Bottom + frameWhiteBack.Y + this.listControl[3].Y - Application.GetRealHeight(625 + 35); + frameBack.Height = Application.GetRealHeight(625); + frameBack.Width = Application.GetRealWidth(449); + frameBack.BackgroundImagePath = "AC/SelectedFanModeBG.png"; + form.bodyFrameLayout.AddChidren(frameBack); + + //閫夋嫨椋庨�� + var frameTitle = new FrameLayout(); + frameTitle.Width = frameBack.Width; + frameTitle.Height = Application.GetRealHeight(150); + frameBack.AddChidren(frameTitle); + var btnTitle = new NormalViewControl(frameBack.Width - Application.GetRealWidth(81), Application.GetRealHeight(60), false); + btnTitle.X = Application.GetRealWidth(81); + btnTitle.Y = Application.GetRealHeight(57); + btnTitle.IsBold = true; + btnTitle.TextID = R.MyInternationalizationString.SelectFanMode; + frameTitle.AddChidren(btnTitle); + + //浣庨 + this.InitAcWindSpeedSelectRow(frameBack, AC.FanMode.Low, + R.MyInternationalizationString.Fan_Low, "AC/Fan_Low.png", "AC/Fan_LowSelected.png"); + //涓 + this.InitAcWindSpeedSelectRow(frameBack, AC.FanMode.Medium, + R.MyInternationalizationString.Fan_Middle, "AC/Fan_Middle.png", "AC/Fan_MiddleSelected.png"); + //楂橀 + this.InitAcWindSpeedSelectRow(frameBack, AC.FanMode.High, + R.MyInternationalizationString.Fan_Height, "AC/Fan_Height.png", "AC/Fan_HeightSelected.png"); + } + + /// <summary> + /// 鍒濆鍖栭閫熼�夋嫨琛屾帶浠� + /// </summary> + /// <param name="frameBack"></param> + /// <param name="i_div"></param> + /// <param name="textId"></param> + /// <param name="unSelectPath"></param> + /// <param name="selectPath"></param> + private void InitAcWindSpeedSelectRow(FrameLayout frameBack, AC.FanMode i_div, int textId, + string unSelectPath, string selectPath) + { + var rowFrame = new FrameRowControl(); + rowFrame.Y = frameBack.GetChildren(frameBack.ChildrenCount - 1).Bottom; + rowFrame.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft; + rowFrame.Height = Application.GetRealHeight(150); + frameBack.AddChidren(rowFrame); + + //鍥炬爣 + var btnIcon = rowFrame.AddLeftIcon(81); + btnIcon.UnSelectedImagePath = unSelectPath; + btnIcon.SelectedImagePath = selectPath; + //鏄剧ず鏂囧瓧 + var btnText = rowFrame.AddLeftCaption(Language.StringByID(textId), 288); + btnText.TextColor = ZigbeeColor.Current.GXCTextGrayColor; + btnText.SelectedTextColor = ZigbeeColor.Current.GXCACSelectedTextColor_FanModel; + btnText.X = Application.GetRealWidth(173); + //搴曠嚎 + if (i_div != AC.FanMode.High) + { + var btnLine = rowFrame.AddBottomLine(); + btnLine.X = Application.GetRealWidth(81); + } + if (deviceAc.currentFanMode == (int)i_div) + { + //璁剧疆涓洪�夋嫨鐘舵�� + btnIcon.IsSelected = true; + btnText.IsSelected = true; + btnText.IsBold = true; + } + //鎸夐敭鐐瑰嚮 + rowFrame.ButtonClickEvent += (sender, e) => + { + ((DialogCommonForm)frameBack.Parent.Parent).CloseForm(); + + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentFanMode = (int)i_div; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 0 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + return; + } + //鍙戦�侀閫熷懡浠� + this.SetAcWindSpeedComand(i_div); + }; + } + + /// <summary> + /// 鍙戦�侀閫熷懡浠� + /// </summary> + /// <param name="mode">mode.</param> + private void SetAcWindSpeedComand(AC.FanMode mode) + { + var oldModel = (AC.FanMode)deviceAc.currentFanMode; + if (oldModel == mode) + { + //閫夋嫨鐨勬槸鍚屼竴涓� + return; + } + //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 + this.StartCheckResponeResult(this.listControl, (result) => + { + //鎺ユ敹鍒扮綉鍏冲洖澶� + if (result == true) + { + HdlThreadLogic.Current.RunMain(() => + { + listControl[3].SelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanMode(mode); + listControl[3].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanMode(mode); + }); + } + }); + + deviceAc.SetFanModeAsync(mode); + } + + #endregion + + #region 鈻� 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋淿____________ + + /// <summary> + /// 妫�娴嬬綉鍏崇殑鍙嶉缁撴灉(灞炴�т笂鎶ョ殑瀵硅薄锛歞evice.DeviceStatusReport) + /// </summary> + /// <param name="comandDiv">鍛戒护鍖哄垎</param> + /// <param name="report">涓婃姤鏁版嵁</param> + /// <returns></returns> + public override bool CheckResponeResultStatu(ReceiveComandDiv comandDiv, CommonDevice report) + { + if (comandDiv == ReceiveComandDiv.A璁惧灞炴�т笂鎶�) + { + if (report.DeviceStatusReport.CluterID == 513) + { + var attriButeList = report.DeviceStatusReport.AttriBute; + foreach (var attList in attriButeList) + { + if (attList.AttributeId == 0) + { + HdlThreadLogic.Current.RunMain(() => + { + //璁剧疆鐘舵�佹枃瀛� 褰撳墠瀹ゆ俯 + this.SetStatuText(deviceAc.currentLocalTemperature + "鈩�"); + }); + } + else if (attList.AttributeId == 17) + { + if (deviceAc.currentSystemMode == 3 || deviceAc.currentSystemMode == 8) + { + //鍏佽鍚屾杩涘害鍊兼椂鎵嶅悓姝� + if (this.notSetProgress == false) + { + //鍒跺喎 + HdlThreadLogic.Current.RunMain(() => + { + arcScaleSeekBar.Progress = deviceAc.currentCoolingSetpoint; + }); + } + //鎺ユ敹鍒版暟鎹弽棣� + this.canSetProgress = true; + //鐘舵�佽繕鍘�(鍙娇鐢ㄤ竴娆�) + this.notSetProgress = false; + } + } + else if (attList.AttributeId == 18) + { + if (deviceAc.currentSystemMode == 4) + { + //鍏佽鍚屾杩涘害鍊兼椂鎵嶅悓姝� + if (this.notSetProgress == false) + { + //鍒剁儹 + HdlThreadLogic.Current.RunMain(() => + { + arcScaleSeekBar.Progress = deviceAc.currentHeatingSetpoint; + }); + } + //鎺ユ敹鍒版暟鎹弽棣� + this.canSetProgress = true; + //鐘舵�佽繕鍘�(鍙娇鐢ㄤ竴娆�) + this.notSetProgress = false; + } + } + else if (attList.AttributeId == 4096) + { + if (deviceAc.currentSystemMode == 1) + { + //鍏佽鍚屾杩涘害鍊兼椂鎵嶅悓姝� + if (this.notSetProgress == false) + { + //鑷姩 + HdlThreadLogic.Current.RunMain(() => + { + arcScaleSeekBar.Progress = deviceAc.currentAutoSetpoint; + }); + } + //鎺ユ敹鍒版暟鎹弽棣� + this.canSetProgress = true; + //鐘舵�佽繕鍘�(鍙娇鐢ㄤ竴娆�) + this.notSetProgress = false; + } + } + else if (attList.AttributeId == 28) + { + HdlThreadLogic.Current.RunMain(() => + { + //濡傛灉鏄叧闂┖璋冪殑璇�,鐩存帴鍙樻殫鍗冲彲 + if (deviceAc.currentSystemMode == 0) + { + if (this.listControl[1].IsSelected == true) + { + this.listControl[0].IsSelected = false; + this.listControl[1].IsSelected = false; + this.listControl[2].IsSelected = false; + this.listControl[3].IsSelected = false; + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + } + //璁剧疆鐘舵�佹枃瀛� 鍏抽棴 + this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close)); + return; + } + else if (deviceAc.currentSystemMode == 1 || deviceAc.currentSystemMode == 3 || + deviceAc.currentSystemMode == 4 || deviceAc.currentSystemMode == 7 || + deviceAc.currentSystemMode == 8) + { + if (this.listControl[1].IsSelected == false) + { + this.listControl[0].IsSelected = true; + this.listControl[1].IsSelected = true; + this.listControl[2].IsSelected = true; + this.listControl[3].IsSelected = true; + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); + } + } + this.listControl[1].SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByModeId(deviceAc.currentSystemMode); + this.listControl[1].UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByModeId(deviceAc.currentSystemMode); + this.btnNowModeView.Text = DeviceAcDetailCardMethord.GetModeNameByModeId(deviceAc.currentSystemMode); + arcScaleSeekBar.Progress = DeviceAcDetailCardMethord.GetCurrentModeTemperature(deviceAc); + arcScaleSeekBar.IsClickable = DeviceAcDetailCardMethord.IsOpen(deviceAc); + //璁剧疆鐘舵�佹枃瀛� 褰撳墠瀹ゆ俯 + this.SetStatuText(deviceAc.currentLocalTemperature + "鈩�"); + //閫侀娌℃湁娓╁害鐨勬蹇� + if (deviceAc.currentSystemMode == 7) + { + //棰滆壊鍙樻洿 + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + arcScaleSeekBar.IsClickable = false; + } + }); + //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 + return true; + } + else if (attList.AttributeId == 4097) + { + //娓呯悊婊ょ綉 + HdlThreadLogic.Current.RunMain(() => + { + frameClrean.Visible = deviceAc.CleanStatu; + }); + } + } + } + else if (report.DeviceStatusReport.CluterID == 514) + { + var attriButeList = report.DeviceStatusReport.AttriBute; + foreach (var attList in attriButeList) + { + if (attList.AttributeId == 0) + { + //椋庨�� + HdlThreadLogic.Current.RunMain(() => + { + if (this.listControl[3].IsSelected == false) + { + this.listControl[3].IsSelected = true; + } + this.listControl[3].SelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanModeId(deviceAc.currentFanMode); + this.listControl[3].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanModeUnSelectedImagePathByFanModeId(deviceAc.currentFanMode); + }); + //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 + return true; + } + else if (attList.AttributeId == 4096) + { + //鎵 + HdlThreadLogic.Current.RunMain(() => + { + if (this.listControl[0].IsSelected == false) + { + this.listControl[0].IsSelected = true; + } + this.listControl[0].SelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + this.listControl[0].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + }); + //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 + return true; + } + } + } + } + return false; + } + + #endregion + } +} -- Gitblit v1.8.0