From af1cb3ecd0f4b0589e00b28f7f9edccf39e6e12b Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 10 九月 2020 16:15:11 +0800 Subject: [PATCH] 202009101 --- HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs | 41 ++++++++++++++++++++++++++++------------- 1 files changed, 28 insertions(+), 13 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs index b12f9e7..d1834f0 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs @@ -18,14 +18,14 @@ { return; } - bodyView.arcBar.ProgressBarColor = bodyView.fh.on_off == "on" ? CSS_Color.MainColor : CSS_Color.PromptingColor2; + bodyView.arcBar.ProgressBarColor = bodyView.fh.trait_on_off.value.ToString() == "on" ? CSS_Color.MainColor : CSS_Color.PromptingColor2; bodyView.btnTemp.Text = uFh.curTemp.ToString(); bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + uFh.indoorTemp + "掳C"; bodyView.btnMode.UnSelectedImagePath = uFh.curModeImage; - bodyView.btnSwitch.IsSelected = uFh.on_off == "on"; + bodyView.btnSwitch.IsSelected = uFh.trait_on_off.value.ToString() == "on"; if (uFh.refreshTime.AddMilliseconds(1000) < DateTime.Now) { - bodyView.arcBar.Progress = uFh.curTemp; + bodyView.arcBar.Progress = (int)uFh.curTemp; } }); } @@ -56,7 +56,7 @@ btnCollection.MouseUpEventHandler += (sender, e) => { btnCollection.IsSelected = fh.collection = btnCollection_Out.IsSelected = !btnCollection.IsSelected; - DB_ResidenceData.residenceData.SaveResidenceData(); + fh.SaveFunctionData(); }; } @@ -72,9 +72,12 @@ return; } fh.curTemp--; - arcBar.Progress = fh.curTemp; + arcBar.Progress = (int)fh.curTemp; btnTemp.Text = fh.curTemp.ToString(); - Control.Send(CommandType_A.write, fh); + //Control.Send(CommandType_A.write, fh); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add("temp", fh.curTemp.ToString()); + Control.SendWriteCommand(fh, d); }; btnPlus.MouseUpEventHandler = (sender, e) => { @@ -83,15 +86,21 @@ return; } fh.curTemp++; - arcBar.Progress = fh.curTemp; + arcBar.Progress = (int)fh.curTemp; btnTemp.Text = fh.curTemp.ToString(); - Control.Send(CommandType_A.write, fh); + //Control.Send(CommandType_A.write, fh); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add("temp", fh.curTemp.ToString()); + Control.SendWriteCommand(fh, d); }; arcBar.OnStopTrackingTouchEvent = (sender, e) => { fh.curTemp = arcBar.Progress; btnTemp.Text = fh.curTemp.ToString(); - Control.Send(CommandType_A.write, fh); + //Control.Send(CommandType_A.write, fh); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add("temp", fh.curTemp.ToString()); + Control.SendWriteCommand(fh, d); }; arcBar.OnProgressChangedEvent = (sender, e) => { @@ -112,8 +121,11 @@ btnSwitch.MouseUpEventHandler = (sender, e) => { btnSwitch.IsSelected = !btnSwitch.IsSelected; - fh.on_off = btnSwitch.IsSelected ? "on" : "off"; - Control.Send(CommandType_A.write, fh); + fh.trait_on_off.value = btnSwitch.IsSelected ? "on" : "off"; + //Control.Send(CommandType_A.write, fh); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add("on_off", fh.trait_on_off.value.ToString()); + Control.SendWriteCommand(fh, d); }; } @@ -130,8 +142,11 @@ EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => { btn1.IsSelected = btn2.IsSelected = true; - fh.curMode = curMode; - Control.Send(CommandType_A.write, fh); + fh.trait_mode.value = curMode; + //Control.Send(CommandType_A.write, fh); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add("mode", fh.curModeIndex.ToString()); + Control.SendWriteCommand(fh, d); dialog.Close(); }; btn1.MouseUpEventHandler = eventHandler1; -- Gitblit v1.8.0