From 9cc8fd11b13813adbdd3c6c31554e5c0bebf4026 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 21 八月 2020 19:53:49 +0800 Subject: [PATCH] 发布到商店的版本 --- ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs | 78 ++++++++++++++++++++++++++++----------- 1 files changed, 56 insertions(+), 22 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs index 9493372..693b662 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs @@ -123,27 +123,29 @@ btnColorBack.X = Application.GetRealWidth(266); btnColorBack.Y = btnColorView.Y + btnColorView.Height / 2 - HdlControlLogic.Current.GetPictrueRealSize(20) / 2; frameWhiteBack.AddChidren(btnColorBack); - //杩涘害鏉�(+60鐨勫亸绉婚噺,鑹叉俯鐨勮寖鍥存槸 3400~6000) + //杩涘害鏉�(+60鐨勫亸绉婚噺,鑹叉俯鐨勮寖鍥存槸 3000~6000) this.seekBarColor = new SeekBarControl(611 + 120); - seekBarColor.Y = btnLightLine.Bottom + Application.GetRealHeight(58); + seekBarColor.Y = btnLightLine.Bottom + Application.GetRealHeight(88); seekBarColor.X = Application.GetRealWidth(266 - 60); - seekBarColor.Height = Application.GetRealHeight(144); seekBarColor.SeekBarViewHeight = Application.GetRealHeight(20); seekBarColor.SeekBarPadding = Application.GetRealWidth(60); - seekBarColor.IsProgressTextShow = true; seekBarColor.ProgressBarColor = UserCenterColor.Current.Transparent; + seekBarColor.ProgressBarUnEnableColor = UserCenterColor.Current.Transparent; seekBarColor.SeekBarBackgroundColor = UserCenterColor.Current.Transparent; seekBarColor.ProgressTextSize = 14; seekBarColor.ProgressTextColor = UserCenterColor.Current.TextGrayColor2; seekBarColor.Gravity = Gravity.Frame; - seekBarColor.ProgressBarUnitSring = "K"; - seekBarColor.MinValue = 34; + seekBarColor.MinValue = 30; seekBarColor.MaxValue = 60; + seekBarColor.ProgressChangeDelayTime = 0; frameWhiteBack.AddChidren(seekBarColor); + //鏄剧ず鑷畾涔夋枃鏈� + seekBarColor.ShowCustomTextView(Application.GetRealWidth(150), 15, UserCenterColor.Current.TextGrayColor3); //璁剧疆鍒濆鍊� int colorValue = ((ColorTemperatureLight)this.device).ColorTemperature; - if (colorValue == 0) { colorValue = 3400; } + if (colorValue == 0) { colorValue = 3000; } seekBarColor.Progress = colorValue / 100; + seekBarColor.SetCustomText(seekBarColor.Progress * 100 + "K"); //铚傞福鍣ㄥ紑鍏筹細 var btnBuzzerView = new NormalViewControl(300, 60, true); @@ -161,6 +163,7 @@ this.btnBuzzerSwitch = new IconBigViewControl(81, 81); btnBuzzerSwitch.UnSelectedImagePath = "Item/Switch.png"; btnBuzzerSwitch.SelectedImagePath = "Item/SwitchSelected.png"; + btnBuzzerSwitch.IsSelected = ((ColorTemperatureLight)this.device).IsBuzzerRing; frameWhiteBack.AddChidren(btnBuzzerSwitch); btnBuzzerSwitch.InitControl(); btnBuzzerSwitch.UseClickStatu = false; @@ -200,6 +203,12 @@ }; btnMiniSwitch.IsSelected = ((LightBase)this.device).OnOffStatus == 1; this.canSetProgressValue = btnMiniSwitch.IsSelected; + if (btnMiniSwitch.IsSelected == false) + { + //鍦ㄦ病鏈夋墦寮�澶滅伅寮�鍏充箣鍓�,涓嶅厑璁告粦鍔� + seekBarLight.Enable = false; + seekBarColor.Enable = false; + } //浜害寮�濮嬫粦鍔ㄧ殑浜嬩欢 seekBarLight.OnStartTrackingTouchEvent += (sender, e) => @@ -257,6 +266,8 @@ int nowColorValue = oldColorValue;//鍙樻洿鐨勫�� seekBarColor.OnProgressChangedEvent += (sender, value) => { + //璁剧疆鑷畾涔夌殑鏂囨湰 + seekBarColor.SetCustomText(value * 100 + "K"); if (Common.Config.Instance.Home.IsVirtually == false) { if (this.canSetProgressValue == true) @@ -288,7 +299,8 @@ if (nowColorValue != oldColorValue) { oldColorValue = nowColorValue; - ((ColorTemperatureLight)this.device).SetColorTemperature(oldColorValue * 100); + int value = 1000000 / (oldColorValue * 100); + ((ColorTemperatureLight)this.device).SetColorTemperature(value); } } if (this.canSetProgressValue == true) @@ -302,7 +314,8 @@ if (nowColorValue != oldColorValue) { //鍙戦�佽壊娓╁�� - ((ColorTemperatureLight)this.device).SetColorTemperature(nowColorValue * 100); + int value = 1000000 / (nowColorValue * 100); + ((ColorTemperatureLight)this.device).SetColorTemperature(value); } } }); @@ -345,7 +358,13 @@ { //褰撴槸鎵撳紑鐘舵�佹椂,缃戝叧璇村畠浼氶粯璁ゆ妸浜害鍙樻垚100% //浠ラ槻涓囦竴,杩欓噷鍐嶆璇诲彇涓�涓� - ((ColorTemperatureLight)device).ReadLevel(); + HdlThreadLogic.Current.RunThread(() => + { + ((ColorTemperatureLight)device).ReadLevel(); + System.Threading.Thread.Sleep(300); + ((ColorTemperatureLight)device).ReadColorTemperature(); + }); + } } }); @@ -377,24 +396,23 @@ //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - //((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0; - ////鍒锋柊寮�鍏崇姸鎬� - //this.RefreshSwitchStatu(isOpen); + ((ColorTemperatureLight)this.device).IsBuzzerRing = isOpen; + //鍒锋柊寮�鍏崇姸鎬� + this.RefreshSwitchStatu(isOpen); return; } //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 - this.StartCheckResponeResult(new List<ButtonBase> { this.btnBuzzerSwitch.btnIcon }, (result) => + this.btnBuzzerSwitch.CanClick = false; + this.StartCheckResponeResult(new List<ButtonBase>(), (result) => { HdlThreadLogic.Current.RunMain(() => { //鎺ユ敹鍒扮綉鍏冲洖澶� + this.btnBuzzerSwitch.CanClick = true; if (result == true) { this.btnBuzzerSwitch.IsSelected = isOpen; - //bool statu = ((LightBase)this.device).OnOffStatus == 1; - ////鍒锋柊寮�鍏崇姸鎬� - //this.RefreshSwitchStatu(statu); } }); }); @@ -461,11 +479,13 @@ /// <param name="isOpen">鎵撳紑鐘舵��</param> private void RefreshSwitchStatu(bool isOpen) { - if (this.isColorProgressing == true) + //鍒锋柊铚傞福鍣ㄥ紑鍏崇姸鎬� + bool isBuzzerRing = ((ColorTemperatureLight)this.device).IsBuzzerRing; + if (this.btnBuzzerSwitch.IsSelected != isBuzzerRing) { - //濡傛灉鏄壊娓╂粦鍔ㄧ殑璇�,涓嶉渶瑕佸埛鏂扮晫闈� - return; + this.btnBuzzerSwitch.IsSelected = isBuzzerRing; } + if (isOpen == true) { //浜害鏄繀椤昏鍒锋柊鐨� 浜害 XX @@ -479,14 +499,28 @@ { //褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫� seekBarColor.Progress = (int)(((ColorTemperatureLight)this.device).ColorTemperature / 100); + //璁剧疆鑷畾涔夌殑鏂囨湰 + seekBarColor.SetCustomText(seekBarColor.Progress * 100 + "K"); } - this.btnMiniSwitch.IsSelected = true; + if (this.btnMiniSwitch.IsSelected == false) + { + this.btnMiniSwitch.IsSelected = true; + } + //婊戝姩鏉″彲浠ユ粦鍔� + seekBarLight.Enable = true; + seekBarColor.Enable = true; } else { //鍙樻洿瀛楁牱:鍏抽棴 this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close)); - this.btnMiniSwitch.IsSelected = false; + if (this.btnMiniSwitch.IsSelected == true) + { + this.btnMiniSwitch.IsSelected = false; + } + //婊戝姩鏉′笉鍙互婊戝姩 + seekBarLight.Enable = false; + seekBarColor.Enable = false; } //鍥炲鐨勭粨鏋滆,澶勪簬鎵撳紑鐘舵�佹墠鑳藉彂閫� -- Gitblit v1.8.0