From 7232642ff48a7fbde2018cde652f3e771fa58025 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期三, 27 一月 2021 14:32:55 +0800 Subject: [PATCH] 20200127-英文版处理 --- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 92 ++++----------------------------------------- 1 files changed, 9 insertions(+), 83 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 6d5a498..e1e05bc 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -85,7 +85,7 @@ } //鏄剧ず鏂囨湰 lightSwitchView.btnState.TextID = id; - selectedState = device.functionType + "_" + strValue; + selectedState = device.spk + "_" + strValue; //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "on_off"; AddDictionary(keyVlaue, strValue); @@ -149,46 +149,6 @@ } /// <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> @@ -208,39 +168,6 @@ //鏈夋暟鎹噸鏂拌祴鍊� 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> @@ -256,21 +183,20 @@ LogicMethod.dictionary(dic, "comparator", "="); LogicMethod.dictionary(dic, "data_type", "string"); LogicMethod.dictionary(dic, "value", selectedValue); - AddDictionaryList(KeyValue, dic, dicSateteList); + AddDictionaryList(KeyValue, dic); } /// <summary> /// 鏇存柊鏁版嵁鍒楄〃 /// </summary> /// <param name="keyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param> - /// <param name="dictionary">閫変腑鏁版嵁</param> - /// <param name="dicList">瀛樺偍鏁版嵁鍒楄〃</param> + /// <param name="dictionary">娣诲姞閫変腑鏁版嵁</param> /// <returns></returns> - private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary, List<Dictionary<string, string>> dicList) + private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary) { int indexValue = -1; - for (int i = 0; i < dicList.Count; i++) + for (int i = 0; i < dicSateteList.Count; i++) { - var dic = dicList[i]; + var dic = dicSateteList[i]; if (dic.ContainsValue(keyValue)) { //鍒ゆ柇鏄惁瀛樺湪 @@ -282,14 +208,14 @@ if (indexValue != -1) { //瀛樺湪绉婚櫎 - dicList.RemoveAt(indexValue); + dicSateteList.RemoveAt(indexValue); //閲嶆柊娣诲姞 - dicList.Insert(indexValue, dictionary); + dicSateteList.Insert(indexValue, dictionary); } else { //鏂版坊鍔� - dicList.Add(dictionary); + dicSateteList.Add(dictionary); } } -- Gitblit v1.8.0