From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs | 54 +++++++++++++++++++++++++++++++++--------------------- 1 files changed, 33 insertions(+), 21 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs index 3475abe..5ce1f29 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs @@ -16,13 +16,13 @@ string selectedDeviceStatus = ""; Dictionary<string, object> actionsInfo = null; List<Dictionary<string, string>> TaskList = null; - public void Show(CommonDevice common, bool edit, Dictionary<string, object> editdeviceActionInfo = null) + public void Show(CommonDevice common, bool edit,string str_if,Dictionary<string, object> editdeviceActionInfo = null) { actionsInfo = editdeviceActionInfo; this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; TopView view = new TopView(); this.AddChidren(view.TopRowView()); - view.toptitleNameBtn.Text = Name; + view.toptitleNameBtn.Text = LocalDevice.Current.GetDeviceEpointName(common); view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); @@ -40,12 +40,12 @@ middle.AddChidren(openView.Show()); openView.clickviewBtn.MouseUpEventHandler += (sender, e) => { - CurrentDeviceView("澶滅伅寮�鍏�", common, edit,openView.seletecdTextBtn); + CurrentDeviceView("澶滅伅寮�鍏�", common, edit, openView.seletecdTextBtn); }; LogicView.LightView brightnessView = new LogicView.LightView(); brightnessView.frameLayout.Y = openView.frameLayout.Bottom; - brightnessView.titleBtn.Text = Language.StringByID(MyInternationalizationString.brightness); + brightnessView.titleBtn.Text = Language.StringByID(MyInternationalizationString.brightness); middle.AddChidren(brightnessView.Show()); brightnessView.clickviewBtn.MouseUpEventHandler += (sender, e) => { @@ -54,7 +54,7 @@ LogicView.LightView colorTemperatureView = new LogicView.LightView(); colorTemperatureView.frameLayout.Y = brightnessView.frameLayout.Bottom; - colorTemperatureView.titleBtn.Text = Language.StringByID(MyInternationalizationString.colorTemperature); + colorTemperatureView.titleBtn.Text = Language.StringByID(MyInternationalizationString.colorTemperature); middle.AddChidren(colorTemperatureView.Show()); colorTemperatureView.clickviewBtn.MouseUpEventHandler += (sender, e) => { @@ -91,10 +91,22 @@ } } - var logicCommunalPage = new LogicCommunalPage(); - UserView.HomePage.Instance.AddChidren(logicCommunalPage); - UserView.HomePage.Instance.PageIndex += 1; - logicCommunalPage.Show(() => { }); + + if (str_if == "logic") + { + var logicCommunalPage = new LogicCommunalPage(); + UserView.HomePage.Instance.AddChidren(logicCommunalPage); + UserView.HomePage.Instance.PageIndex += 1; + logicCommunalPage.Show(() => { }); + } + else if (str_if == "lockaction") + { + //闂ㄩ攣鑱斿姩浜嬩欢 + var lockLogicCommunalPage = new DoorLockLogic.LockLogicCommunalPage(); + UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); + UserView.HomePage.Instance.PageIndex += 1; + lockLogicCommunalPage.Show(() => { }); + } }; @@ -146,7 +158,7 @@ case "8": { var intvalue = int.Parse(tasks["Data1"]); - var lightbrightnessvalue = intvalue / 100; + var lightbrightnessvalue = 1000000 / (intvalue * 100); colorTemperatureView.seletecdTextBtn.Text = lightbrightnessvalue.ToString() + "K"; } break; @@ -158,7 +170,7 @@ } } } - public void CurrentDeviceView(string if_str, CommonDevice common, bool edit,Button button) + public void CurrentDeviceView(string if_str, CommonDevice common, bool edit, Button button) { var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; this.AddChidren(flMain); @@ -189,7 +201,7 @@ { case "澶滅伅寮�鍏�": { - + Dictionary<string, string> switchDictionary = new Dictionary<string, string>(); Send.dictionary(switchDictionary, "TaskType", "1"); Send.dictionary(switchDictionary, "Data2", "0"); @@ -228,7 +240,7 @@ status = Language.StringByID(MyInternationalizationString.close); }; - if ( TaskList != null&& TaskList.Count!=0) + if (TaskList != null && TaskList.Count != 0) { foreach (var value in TaskList) { @@ -258,10 +270,10 @@ Send.dictionary(brightnessDictionary, "Data2", "0"); var horizontalSeekBarVol = new DiyImageSeekBar { - Y = Application.GetRealHeight(140), - X = Application.GetRealWidth(78), - Width = Application.GetRealWidth(918), - Height = Application.GetRealHeight(320),//婊戝姩鏉$埗鎺т欢楂樺害 + Y = Application.GetRealHeight(140),//杩涘害鏉$埗鎺т欢Y鍧愭爣 + X = Application.GetRealWidth(78),//杩涘害鏉鍧愭爣 + Width = Application.GetRealWidth(918),//杩涘害鏉$殑闀垮害 + Height = Application.GetRealHeight(320),//杩涘害鏉$埗鎺ф帶浠堕珮搴� IsProgressTextShow = true,//鏄剧ず鐧惧垎姣� IsClickable = true,//杩涘害鏉℃槸鍚︽粦鍔� ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹� @@ -330,13 +342,13 @@ SeekBarViewHeight = Application.GetRealHeight(12),//杩涘害鏉$殑楂樺害10 MinValue = 30, MaxValue = 60, - ProgressBarUnitSring="K",//鍒囨崲鍗曚綅 + ProgressBarUnitSring = "K",//鍒囨崲鍗曚綅 }; completeView.Show(2).AddChidren(horizontalSeekBarVol); EventHandler<int> progressclick = (sender, e) => { selectedDeviceStatus = "8"; - var lightbrightnessvalue = (100 * horizontalSeekBarVol.Progress); + var lightbrightnessvalue = 1000000 / (100 * horizontalSeekBarVol.Progress); Send.dictionary(brightnessDictionary, "Data1", lightbrightnessvalue.ToString()); DicValue("8", brightnessDictionary); status = horizontalSeekBarVol.Progress.ToString() + "K"; @@ -352,7 +364,7 @@ if (value["TaskType"] == "8") { var intvalue = int.Parse(value["Data1"]); - var lightbrightnessvalue = intvalue / 100; + var lightbrightnessvalue = 1000000 / (intvalue * 100); horizontalSeekBarVol.Progress = lightbrightnessvalue; break; } @@ -366,7 +378,7 @@ Dictionary<string, string> switchDictionary = new Dictionary<string, string>(); Send.dictionary(switchDictionary, "TaskType", "7"); Send.dictionary(switchDictionary, "Data2", "0"); - + mFunView openView = new mFunView(); openView.frameLayout.Y = Application.GetRealHeight(140 + 20); -- Gitblit v1.8.0