From 41f9c8837b0551c68f8fd798c06951fa716b7ab8 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 11 一月 2021 14:05:29 +0800 Subject: [PATCH] Merge branch 'NewFilePath' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into NewFilePath --- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 99 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 87 insertions(+), 12 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index e46520b..6d5a498 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -1,6 +1,8 @@ -锘縰sing System; +using System; using Shared; using System.Collections.Generic; +using HDL_ON.Entity; + namespace HDL_ON.UI.UI2.Intelligence.Automation { public class ConditionDeviceFunList : FrameLayout @@ -36,22 +38,22 @@ }; this.AddChidren(fLayout); #endregion - switch (device.functionType) + switch (device.spk) { //寮�鍏崇伅鍏� light.Switch - case FunctionType.Dimmer: - case FunctionType.RGB: - case FunctionType.RGBW: - case FunctionType.ColorTemperature: - case FunctionType.Relay: + case SPK.LightDimming: + case SPK.LightRGB: + case SPK.LightRGBW: + case SPK.LightCCT: + case SPK.LightSwitch: //绐楀笜 - case FunctionType.Curtain: - case FunctionType.RollingShutter: - case FunctionType.MotorCurtain: + case SPK.CurtainSwitch: + case SPK.CurtainRoller: + case SPK.CurtainTrietex: //绌鸿皟 - case FunctionType.AC: + case SPK.AcStandard: //鍦扮儹 - case FunctionType.FloorHeating: + case SPK.FloorHeatStandard: { LogicView.FunTypeView lightSwitchView = new LogicView.FunTypeView(); lightSwitchView.btnText.TextID = StringId.switchLogic; @@ -147,6 +149,46 @@ } /// <summary> + /// 寮�鍏冲姛鑳藉睍寮�鐣岄潰 + /// </summary> + /// <param name="frame"></param> + /// <param name="device"></param> + /// <param name="button"></param> + /// <param name="len"></param> + public void SwitchViewMethod(FrameLayout frame, Entity.Function device, Button button, int len) + { + + LogicView.SwitchView switchView = new LogicView.SwitchView(); + switchView.FLayoutView(frame, len, button.Text, (Action<string>)((strValue) => + { + int id = 0; + switch (strValue) + { + case "on": + { + id = StringId.onLogic; + } + break; + case "off": + { + id = StringId.offLogic; + } + break; + } + button.TextID = id; + keyVlaue = "on_off"; + Dictionary<string, string> dic = new Dictionary<string, string>(); + LogicMethod.dictionary(dic, "key", "on_off"); + LogicMethod.dictionary(dic, "comparator", "="); + LogicMethod.dictionary(dic, "data_type", "string"); + LogicMethod.dictionary(dic, "value", strValue); + AddDictionaryData(dicSateteList, keyVlaue, dic); + selectedState = device.spk + "_" + strValue; + + })); + + } + /// <summary> /// 鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� /// </summary> /// <param name="device">缂栬緫璁惧</param> @@ -166,6 +208,39 @@ //鏈夋暟鎹噸鏂拌祴鍊� dicSateteList = dicList; } + switch (device.spk) + { + //寮�鍏崇伅鍏� light.Switch + case SPK.LightDimming: + case SPK.LightRGB: + case SPK.LightRGBW: + case SPK.LightCCT: + case SPK.LightSwitch: + //绐楀笜 + case SPK.CurtainSwitch: + case SPK.CurtainRoller: + case SPK.CurtainTrietex: + //绌鸿皟 + case SPK.AcStandard: + //鍦扮儹 + case SPK.FloorHeatStandard: + { + foreach (var dic in dicList) + { + string value = dic["value"]; + if (value == "on") + { + button1.Text = Language.StringByID(StringId.onLogic); + } + else + { + button1.Text = Language.StringByID(StringId.offLogic); + } + } + } + break; + + } InpOrOutLogicMethod.EditState(device, dicList, button1, button2, button3, button4); } /// <summary> -- Gitblit v1.8.0