From 9a6f9cfe3ddcf564261ddae823eda21d4539515c Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 29 六月 2020 17:08:14 +0800 Subject: [PATCH] 2020-6-29-1 --- ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs | 44 ++++++++++++++++++++++++++++---------------- 1 files changed, 28 insertions(+), 16 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs index 3475abe..8383026 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs @@ -16,7 +16,7 @@ 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; @@ -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) { @@ -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