From 145b157ba183ebf877c93ed2dbb01ec737c993d3 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 08 十二月 2020 18:59:33 +0800 Subject: [PATCH] Merge branch 'WJC' --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunTypeView.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs | 10 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/CheckView.cs | 4 HDL-ON_Android/Assets/Language.ini | 7 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 325 +++++++++++- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 12 HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs | 8 HDL-ON_iOS/Resources/Language.ini | 12 HDL_ON/Common/HDLCommon.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 236 ++------ HDL_ON/Entity/Enumerative/MyEnum.cs | 21 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs | 8 .vs/HDL_APP_Project/xs/sqlite3/storage.ide | 0 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs | 8 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs | 8 HDL_ON/Entity/DB_ResidenceData.cs | 22 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs | 10 HDL_ON/Entity/FunctionList.cs | 5 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 637 +++++++++++++++++++++++- /dev/null | 0 HDL-ON_Android/Assets/.DS_Store | 0 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs | 47 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs | 22 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs | 4 HDL_ON/Common/R.cs | 12 HDL-ON_iOS/Resources/Phone/.DS_Store | 0 HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs | 4 33 files changed, 1,111 insertions(+), 339 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide index a4d5952..b86f705 100644 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide +++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide Binary files differ diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm deleted file mode 100644 index 2f2c603..0000000 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm +++ /dev/null Binary files differ diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal deleted file mode 100644 index 9d4ce8e..0000000 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal +++ /dev/null Binary files differ diff --git a/HDL-ON_Android/Assets/.DS_Store b/HDL-ON_Android/Assets/.DS_Store new file mode 100644 index 0000000..bdf1fa8 --- /dev/null +++ b/HDL-ON_Android/Assets/.DS_Store Binary files differ diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 18c281a..30fd22a 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -495,6 +495,13 @@ 7059=鍒剁儹 7060=鑷姩 7061=闄ゆ箍 +7062=娓╁害 +7063=椋庨�� +7064=鐧藉ぉ +7065=澶滄櫄 +7066=绂诲紑 +7067=涓�鑸� +7068=鏃堕棿 diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index ebcf1a7..0b9190a 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -495,6 +495,18 @@ 7054=鏆傚仠 7055=浜害 7056=鐧惧垎姣� +7057=妯″紡 +7058=鍒跺喎 +7059=鍒剁儹 +7060=鑷姩 +7061=闄ゆ箍 +7062=娓╁害 +7063=椋庨�� +7064=鐧藉ぉ +7065=澶滄櫄 +7066=绂诲紑 +7067=涓�鑸� +7068=鏃堕棿 9000=璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP diff --git a/HDL-ON_iOS/Resources/Phone/.DS_Store b/HDL-ON_iOS/Resources/Phone/.DS_Store index ec1b415..febdb73 100644 --- a/HDL-ON_iOS/Resources/Phone/.DS_Store +++ b/HDL-ON_iOS/Resources/Phone/.DS_Store Binary files differ diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 7b335c1..9eec670 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -254,6 +254,7 @@ { Shared.Application.RunOnMainThread(() => { + //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); //2020-12-04 寰呭鍔犻��鍑虹櫥褰曟搷浣� @@ -282,6 +283,7 @@ /// </summary> public void Logout() { + return; try { //鏈櫥褰曚笉鐢ㄥ鐞� diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index f5bc7e8..d83df1c 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -494,8 +494,16 @@ public const int heatingLogic = 7059; public const int autoLogic = 7060; public const int dehumidifyLogic = 7061; - - + public const int temperatureLogic = 7062; + public const int speedLogic = 7063; + public const int dayMode = 7064; + public const int nightMode = 7065; + public const int leaveMode = 7066; + public const int ordinaryMode = 7067; + public const int timeMode = 7068; + + + #region LE鏂板 /// <summary> diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index f11328a..5cb0446 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -269,9 +269,29 @@ #region 鍔熻兘鏁版嵁 static FunctionList _functionList; - public static FunctionList functionList { + public static FunctionList functionList + { get { + if (_functionList == null) + { + _functionList = FunctionList.List; + } + return _functionList; + } + set + { + _functionList = value; + } + } + + /// <summary> + /// 鍒锋柊浣忓畢閲岄潰鐨勬悳绱㈣澶囩姸鎬� + /// </summary> + public void RefreshResidenceFunctionStatus() + { + new Thread(() => + { if(_functionList == null) { _functionList = FunctionList.List; diff --git a/HDL_ON/Entity/Enumerative/MyEnum.cs b/HDL_ON/Entity/Enumerative/MyEnum.cs index 7ca71d6..eaa4801 100644 --- a/HDL_ON/Entity/Enumerative/MyEnum.cs +++ b/HDL_ON/Entity/Enumerative/MyEnum.cs @@ -65,17 +65,17 @@ /// 鑹叉俯 /// cct /// </summary> - ColorTemperature = 0x0203, + ColorTemperature= 0x0203, RGB = 0x0204, Curtain = 0x0301, /// <summary> /// 寮�鍚堝笜 /// </summary> - MotorCurtain = 0x0303, + MotorCurtain= 0x0303, /// <summary> /// 鍗峰笜 /// </summary> - RollingShutter = 0x0304, + RollingShutter= 0x0304, AC = 0x0401, FloorHeating = 0x0402, @@ -96,18 +96,9 @@ /// RGBW /// </summary> RGBW = 0x0102, - /// <summary> - /// CCT鐏� - /// </summary> - CCT = 0x0103, - /// <summary> - /// 寮�鍚堝笜 - /// </summary> - TrietexCurtain = 0x0104, - /// <summary> - /// 鍗峰笜 - /// </summary> - RollerCurtain = 0x0105, + + + } diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 22da38f..5f27046 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -112,6 +112,11 @@ var functionDataBytes = FileUtils.ReadFile(filePath); var functionDataString = System.Text.Encoding.UTF8.GetString(functionDataBytes); var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString); + if (tempFunction == null) + { + FileUtils.DeleteFile(filePath); + return; + } if (tempFunction.DeleteSign) { //todo 鍒犻櫎浜戠鏁版嵁 20201203--App涓嶈兘鍒犻櫎鍔熻兘鏁版嵁 diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs index 8640e96..2e1e555 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs @@ -140,26 +140,26 @@ #endregion #region 鎵ц鎺ㄩ�� 鍙戦�侀�氱煡 - ///涓婁笅闂撮殧12鍍忕礌 - viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) }); - ///鎵ц鎺ㄩ�乮ew - LogicView.LogicTypeTitleView push = new LogicView.LogicTypeTitleView(); - push.frameLayout.Height = Application.GetRealHeight(50); - push.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); - push.btnText.TextID = StringId.push; - push.btnNextIcon.Width = Application.GetMinRealAverage(36); - push.btnNextIcon.Height = Application.GetMinRealAverage(36); - push.btnNextIcon.X = Application.GetRealWidth(305); - push.btnNextIcon.UnSelectedImagePath = "LogicIcon/off.png"; - push.btnNextIcon.SelectedImagePath = "LogicIcon/on.png"; - viewLayout.AddChidren(push.FLayoutView()); - ///鍙戦�侀�氱煡View - LogicView.LogicTypeTitleView notification = new LogicView.LogicTypeTitleView(); - notification.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); - notification.btnText.TextID = StringId.notification; - viewLayout.AddChidren(notification.FLayoutView()); - ///涓婁笅闂撮殧62鍍忕礌 - viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(62) }); + /////涓婁笅闂撮殧12鍍忕礌 + //viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) }); + /////鎵ц鎺ㄩ�乮ew + //LogicView.LogicTypeTitleView push = new LogicView.LogicTypeTitleView(); + //push.frameLayout.Height = Application.GetRealHeight(50); + //push.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); + //push.btnText.TextID = StringId.push; + //push.btnNextIcon.Width = Application.GetMinRealAverage(36); + //push.btnNextIcon.Height = Application.GetMinRealAverage(36); + //push.btnNextIcon.X = Application.GetRealWidth(305); + //push.btnNextIcon.UnSelectedImagePath = "LogicIcon/off.png"; + //push.btnNextIcon.SelectedImagePath = "LogicIcon/on.png"; + //viewLayout.AddChidren(push.FLayoutView()); + /////鍙戦�侀�氱煡View + //LogicView.LogicTypeTitleView notification = new LogicView.LogicTypeTitleView(); + //notification.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); + //notification.btnText.TextID = StringId.notification; + //viewLayout.AddChidren(notification.FLayoutView()); + /////涓婁笅闂撮殧62鍍忕礌 + //viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(62) }); #endregion #region 淇濆瓨 @@ -245,6 +245,7 @@ dateTypeView.btnLine.Width = Application.GetRealWidth(303); dateView.frameLayout.AddChidren(dateTypeView.FLayoutView()); dateTypeView.btnClick.Tag = i;//鏍囪绫诲瀷 + switch (i) { case 0: @@ -506,9 +507,9 @@ { Button monTextBtn = new Button { - Width = Application.GetMinRealAverage(30), - Height = Application.GetMinRealAverage(30), - Radius = (uint)Application.GetRealHeight(15), + Width = Application.GetRealWidth(30), + Height = Application.GetRealWidth(30), + Radius = (uint)Application.GetRealWidth(15), Text = i.ToString(), TextSize = LogicView.TextSize.text14, TextColor = CSS.CSS_Color.textColor, diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs index f839d4c..fca082a 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs @@ -47,7 +47,7 @@ delayView.frameLayout.Y = sceneView.frameLayout.Bottom; delayView.btnText.TextID = StringId.delayLogic; delayView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png"; - viewLayout.AddChidren(delayView.FLayoutView()); + //viewLayout.AddChidren(delayView.FLayoutView()); #endregion #region 鎵�鏈夌偣鍑讳簨浠� diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 5474311..ce1e8f8 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -46,12 +46,12 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: case FunctionType.Relay: //绐楀笜 case FunctionType.Curtain: - case FunctionType.RollerCurtain: - case FunctionType.TrietexCurtain: + case FunctionType.RollingShutter: + case FunctionType.MotorCurtain: //绌鸿皟 case FunctionType.AC: //鍦扮儹 @@ -166,12 +166,12 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: case FunctionType.Relay: //绐楀笜 case FunctionType.Curtain: - case FunctionType.RollerCurtain: - case FunctionType.TrietexCurtain: + case FunctionType.RollingShutter: + case FunctionType.MotorCurtain: //绌鸿皟 case FunctionType.AC: //鍦扮儹 diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index bff9973..eedb16c 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -67,12 +67,12 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: case FunctionType.Relay: //绐楀笜 case FunctionType.Curtain: - case FunctionType.RollerCurtain: - case FunctionType.TrietexCurtain: + case FunctionType.RollingShutter: + case FunctionType.MotorCurtain: //绌鸿皟 case FunctionType.AC: //鍦扮儹 @@ -163,7 +163,7 @@ public static void OutputTarget(FrameLayout thisView, VerticalScrolViewLayout viewLayout) { - for (int i = 0; i < Logic.currlogic.output.Count; i++) + for (int i = 0; i < Logic.currlogic.output.Count; i++) { Output outputTarget = Logic.currlogic.output[i]; ///鍚勭鏉′欢鐨刅iew @@ -195,9 +195,9 @@ { case FunctionType.Relay: {//寮�鍏崇伅 + foreach (var dic in dicList) { - string value = dic["value"]; if (value == "on") { @@ -212,39 +212,40 @@ targetView.btnState.Text = stateStr; } break; + case FunctionType.RGB: + case FunctionType.RGBW: + case FunctionType.ColorTemperature: case FunctionType.Dimmer: { - bool _if = false; - foreach (var dic in dicList) + string on_off = GetKeyValue("on_off", dicList); + string brightness = GetKeyValue("brightness", dicList); + if (on_off != "") { - - if (dic["key"] == "on_off") + if (on_off == "on") { - string value = dic["value"]; - if (value == "on") - { - targetView.btnState.Text = Language.StringByID(StringId.onLogic); - _if = false; - } - else - { - targetView.btnState.Text = Language.StringByID(StringId.offLogic); - _if = true; - } + stateStr = Language.StringByID(StringId.onLogic); + } - - } - foreach (var dic in dicList) - { - if (dic["key"] == "brightness") + else { - string value = dic["value"]; - if (!_if) - { - targetView.btnState.Text += value; - } + stateStr = Language.StringByID(StringId.offLogic); + } } + if (brightness != "") + { + stateStr += brightness + "%"; + } + if (on_off != "" && on_off == "off") + { + targetView.btnState.Text = Language.StringByID(StringId.offLogic); + } + else + { + targetView.btnState.Text = stateStr; + + } + } break; case FunctionType.Curtain: @@ -274,6 +275,245 @@ targetView.btnState.Text = stateStr; } break; + case FunctionType.MotorCurtain: + case FunctionType.RollingShutter: + {//寮�鍏崇伅 + string on_off = GetKeyValue("on_off", dicList); + string brightness = GetKeyValue("brightness", dicList); + if (on_off != "") + { + switch (on_off) + { + case "on": + { + stateStr = Language.StringByID(StringId.onLogic); + + } + break; + case "off": + { + stateStr = Language.StringByID(StringId.offLogic); + + } + break; + case "stop": + { + stateStr = Language.StringByID(StringId.stop); + } + break; + } + } + if (brightness != "") + { + stateStr += brightness + "%"; + + } + + if (on_off != "" && on_off == "stop"|| on_off != "" && on_off == "off") + { + targetView.btnState.Text = Language.StringByID(StringId.stop); + } + else + { + targetView.btnState.Text = stateStr; + + } + + } + break; + case FunctionType.AC: { + string on_off = GetKeyValue("on_off", dicList); + string set_temp = GetKeyValue("set_temp", dicList); + string mode = GetKeyValue("mode", dicList); + string fan = GetKeyValue("fan", dicList); + if (on_off != "") { + switch (on_off) + { + case "on": + { + stateStr = Language.StringByID(StringId.onLogic)+";"; + } + break; + case "off": + { + stateStr = Language.StringByID(StringId.offLogic) + ";"; + } + break; + + } + } + + if (set_temp != "") + { + + stateStr += set_temp + "鈩�;"; + } + + if (mode != "") + { + + switch (mode) + { + case "cool": + { + stateStr += Language.StringByID(StringId.coolLogic)+";"; + } + break; + case "heat": + { + stateStr += Language.StringByID(StringId.heatingLogic) + ";"; + } + break; + case "auto": + { + stateStr += Language.StringByID(StringId.autoLogic) + ";"; + } + break; + case "dry": + { + stateStr += Language.StringByID(StringId.dehumidifyLogic) + ";"; + } + break; + } + + } + + if (fan != "") + { + + switch (fan) + { + case "high": + { + stateStr += Language.StringByID(StringId.HighWindSpeed)+";"; + } + break; + case "medium": + { + stateStr += Language.StringByID(StringId.MiddleWindSpeed) + ";"; + } + break; + case "low": + { + stateStr += Language.StringByID(StringId.LowWindSpeed) + ";"; + } + break; + case "auto": + { + stateStr += Language.StringByID(StringId.Auto) + ";"; + } + break; + } + + } + if (on_off != "" && on_off == "off") + { + targetView.btnState.Text = Language.StringByID(StringId.offLogic); + } + else { + targetView.btnState.Text = stateStr.TrimEnd(';'); + + } + + } + break; + case FunctionType.FloorHeating: + { + string on_off = GetKeyValue("on_off", dicList); + string set_temp = GetKeyValue("set_temp", dicList); + string mode = GetKeyValue("mode", dicList); + if (on_off != "") + { + switch (on_off) + { + case "on": + { + stateStr = Language.StringByID(StringId.onLogic) + ";"; + } + break; + case "off": + { + stateStr = Language.StringByID(StringId.offLogic) + ";"; + } + break; + + } + } + if (set_temp != "") + { + + stateStr += set_temp + "鈩�;"; + } + if (mode != "") + { + + switch (mode) + { + case "day": + { + stateStr += Language.StringByID(StringId.dayMode)+";"; + } + break; + case "night": + { + stateStr += Language.StringByID(StringId.nightMode) + ";"; + } + break; + + case "away": + { + stateStr += Language.StringByID(StringId.leaveMode) + ";"; + } + break; + case "normal": + { + stateStr += Language.StringByID(StringId.ordinaryMode) + ";"; + } + break; + case "timer": + { + stateStr += Language.StringByID(StringId.timeMode) + ";"; + } + break; + } + + + switch (mode) + { + case "cool": + { + stateStr += Language.StringByID(StringId.coolLogic) + ";"; + } + break; + case "heat": + { + stateStr += Language.StringByID(StringId.heatingLogic) + ";"; + } + break; + case "auto": + { + stateStr += Language.StringByID(StringId.autoLogic) + ";"; + } + break; + case "dry": + { + stateStr += Language.StringByID(StringId.dehumidifyLogic) + ";"; + } + break; + } + + } + if (on_off != "" && on_off == "off") + { + targetView.btnState.Text =Language.StringByID(StringId.offLogic); + } + else + { + targetView.btnState.Text = stateStr.TrimEnd(';'); + + } + } + break; } } break; @@ -293,7 +533,7 @@ foreach (var dic in dicList) { string value = dic["value"]; - targetView.btnText.Text =value; + targetView.btnText.Text = value; } } break; @@ -329,7 +569,7 @@ AddTarget addTarget = new AddTarget(); addTarget.Delayed(fLayout, edit, indexVulae); - + } break; } @@ -343,5 +583,26 @@ } } + /// <summary> + /// 鑾峰彇value閿�� + /// </summary> + /// <param name="keyValue"></param> + /// <param name="dicList"></param> + /// <returns></returns> + private static string GetKeyValue(string keyValue, List<Dictionary<string, string>> dicList) + { + + string valueStr = ""; + foreach (var dic in dicList) + { + if (dic["key"] == keyValue) + { + valueStr = dic["value"]; + break; + } + + } + return valueStr; + } } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 1dbe612..33fc008 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -22,6 +22,47 @@ { MainPage.BasePageView.RemoveViewByTag("Logic"); } + + /// <summary> Converts an array of bytes into a formatted string of hex digits (ex: E4 CA B2)</summary> + /// <param name="data"> The array of bytes to be translated into a string of hex digits. </param> + /// <returns> Returns a well formatted string of hex digits with spacing. </returns> + static string byteArrayToHexString(byte[] data) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + foreach (byte b in data) + { + sb.Append(Convert.ToString(b, 16).PadLeft(2, '0')); + } + + return sb.ToString().ToUpper(); + } + + /** + * int杞琤yte[] + * 璇ユ柟娉曞皢涓�涓猧nt绫诲瀷鐨勬暟鎹浆鎹负byte[]褰㈠紡锛屽洜涓篿nt涓�32bit锛岃�宐yte涓�8bit鎵�浠ュ湪杩涜绫诲瀷杞崲鏃讹紝鐭ヤ細鑾峰彇浣�8浣嶏紝 + * 涓㈠純楂�24浣嶃�傞�氳繃浣嶇Щ鐨勬柟寮忥紝灏�32bit鐨勬暟鎹浆鎹㈡垚4涓�8bit鐨勬暟鎹�傛敞鎰� &0xff锛屽湪杩欏綋涓紝&0xff绠�鍗曠悊瑙d负涓�鎶婂壀鍒�锛� + * 灏嗘兂瑕佽幏鍙栫殑8浣嶆暟鎹埅鍙栧嚭鏉ャ�� + * @param i 涓�涓猧nt鏁板瓧 + * @return byte[] + */ + public static byte[] int2ByteArray(int i) + { + byte[] result = new byte[4]; + result[0] = (byte)((i >> 24) & 0xFF); + result[1] = (byte)((i >> 16) & 0xFF); + result[2] = (byte)((i >> 8) & 0xFF); + result[3] = (byte)(i & 0xFF); + return result; + } + /// <summary> + /// 鑾峰彇鏃堕棿鎴� + /// </summary> + /// <returns></returns> + static int getTimeStamp() + { + TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); + return (int)ts.TotalSeconds; + } /// <summary> /// 鐢熸垚閫昏緫sid鏂规硶 /// </summary> @@ -34,38 +75,28 @@ DateTime dt = DateTime.Now; DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1)); long m = (long)((dt - startTime).TotalMilliseconds / 10); - string sTimeSpan = "00000000"; + string sTimeSpan = byteArrayToHexString(int2ByteArray(getTimeStamp())); - byte[] arry = new byte[4]; - arry[0] = (byte)(m & 0xFF); - arry[1] = (byte)((m & 0xFF00) >> 8); - arry[2] = (byte)((m & 0xFF0000) >> 16); - arry[3] = (byte)((m >> 24) & 0xFF); - sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2"); - - - if (sTimeSpan.Length > 8) - { - sTimeSpan = sTimeSpan.Substring(0, 8); - } - else - { - sTimeSpan = "00000000"; - } + logicId = sOidBeginsWith + sTimeSpan; - logicId += "0A"; - logicId += "0A01"; - //0A01 鐗╂ā鍨嬩负閫昏緫锛� 0001 琛ㄧず 1 鍙烽�昏緫鍔熻兘 - int iTopLogicId = 1; + logicId += "15"; + logicId += "1501"; + //1501 鐗╂ā鍨嬩负閫昏緫锛� 0001 琛ㄧず 1 鍙烽�昏緫鍔熻兘 + int maxId = 1; - Random random = new Random(); - iTopLogicId = random.Next(0, 255); - iTopLogicId += random.Next(0, 255); - logicId += iTopLogicId.ToString("X4");//閫昏緫鍙� 涓や釜byte - logicId += "1100"; + for (int i = 0; i < Logic.LogicList.Count; i++) + { + string s = Logic.LogicList[i].sid.Substring(20, 4); + int iThisSceneId = Convert.ToInt16(s, 16); + if (iThisSceneId > maxId) + maxId = iThisSceneId ; + } + + logicId += (maxId+1).ToString("X4");//閫昏緫鍙� 涓や釜byte + logicId += "0000"; } catch { @@ -73,53 +104,6 @@ } return logicId; } - - /// <summary> - /// 鐢熸垚閫昏緫sid鏂规硶 - /// </summary> - //public static string NewSid() - //{ - // String sLogicid = ""; - // try - // { - // String sOidBeginsWith = "000101";//鍘傚晢 + 閫氳鏂瑰紡 - // //鐢熸垚4涓猙yte鏃堕棿鎴� - // DateTime dt = DateTime.Now; - // long sTimeSp = GateWay.ConvertDateTimeLong(dt); - // string sTimeSpan = ""; - // GateWay.ConvertIntToByteArray(sTimeSp, ref sTimeSpan); - // if (sTimeSpan.Length != 8) return sLogicid; - // //闂撮殧10姣 閿欏紑鏃堕棿鎴� - // HDLUDP.TimeBetwnNext(10); - // sLogicid = sOidBeginsWith + sTimeSpan; - // //1501 鐗╂ā鍨嬩负鑷姩鍖栵紝 0001 琛ㄧず 1 鍙疯嚜鍔ㄥ寲鍔熻兘 - // sLogicid += "15"; - // sLogicid += "1501"; - // //鑷姩鍖栧彿鑷 - // int iTopSceneId = 1; - // if (myGateway.LogicResponse != null) - // { - // if (myGateway.LogicResponse.objects != null) - // { - // for (int i = 0; i < myGateway.LogicResponse.objects.Count; i++) - // { - // string ccc = myGateway.LogicResponse.objects[i].sid.Substring(myGateway.LogicResponse.objects[i].sid.Length - 8, 4); - // int iThisSceneId = Convert.ToInt16(myGateway.LogicResponse.objects[i].sid.Substring(myGateway.LogicResponse.objects[i].sid.Length - 8, 4), 16); - // if (iThisSceneId >= iTopSceneId) - // iTopSceneId = iThisSceneId + 1; - // } - // } - // } - // sLogicid += iTopSceneId.ToString("X4");//鍦烘櫙鍙� 涓や釜byte - // //澶х被灏忕被娌℃湁鐢ㄥ埌 鍥哄畾涓�0 - // sLogicid += "0000"; - // return sLogicid; - // } - // catch - // { - // return sLogicid; - // } - //} /// <summary> /// 灏佽Dictionary瀵硅薄 @@ -171,81 +155,7 @@ /// <returns></returns> public static List<HDL_ON.Entity.Function> GetGatewayDeviceList() { - List<HDL_ON.Entity.Function> list = new List<Entity.Function>(); - for (int i=0;i<10;i++) { - HDL_ON.Entity.Function function = new Entity.Function(); - switch (i) { - case 0: { - function.sid = "1234560001212121020182"; - function.name ="鐏厜"; - list.Add(function); - } - break; - case 1: { - - function.sid = "1234560001212121030182"; - function.name = "绐楀笜"; - list.Add(function); - } break; - case 2: { - function.sid = "1234560001212121040182"; - function.name = "绌鸿皟"; - list.Add(function); - } break; - case 3: - { - function.sid = "1234560001212121010282"; - function.name = "RGBW"; - list.Add(function); - } - break; - case 4: - { - - function.sid = "1234560001212121010382"; - function.name = "CCT鐏�"; - list.Add(function); - } - break; - case 5: - { - function.sid = "1234560001212121010482"; - function.name = "寮�鍚堝笜"; - list.Add(function); - } - break; - case 6: - { - function.sid = "1234560001212121010582"; - function.name = "鍗峰笜"; - list.Add(function); - } - break; - case 7: - { - function.sid = "1234560001212121040282"; - function.name = "鍦扮儹"; - list.Add(function); - } - break; - case 8: - { - function.sid = "1234560001212121020282"; - function.name = "璋冨叧"; - list.Add(function); - } - break; - case 9: - { - function.sid = "1234560001212121020482"; - function.name = "RGB"; - list.Add(function); - } - break; - } - } - return list; - //return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction(); + return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction(); } /// <summary> /// 鑾峰彇缃戝叧鍦烘櫙鍒楄〃 @@ -352,15 +262,15 @@ case FunctionType.Relay: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: case FunctionType.Dimmer: { strPath = "LogicIcon/lightloguc.png"; } break; case FunctionType.Curtain: - case FunctionType.RollerCurtain: - case FunctionType.TrietexCurtain: + case FunctionType.RollingShutter: + case FunctionType.MotorCurtain: { strPath = "LogicIcon/curtainlogic.png"; } @@ -388,13 +298,13 @@ { List<string> deviceStrTypeList = new List<string>(); deviceStrTypeList.Clear(); - var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer|| device.functionType == FunctionType.CCT || device.functionType == FunctionType.RGB|| device.functionType == FunctionType.RGBW); + var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer|| device.functionType == FunctionType.ColorTemperature || device.functionType == FunctionType.RGB|| device.functionType == FunctionType.RGBW); if (lightjosn != null) { deviceStrTypeList.Add(Language.StringByID(StringId.Lights)); } - var curtainjosn = deviceList.Find((device) => device.functionType ==FunctionType.Curtain|| device.functionType == FunctionType.TrietexCurtain|| device.functionType == FunctionType.RollerCurtain); + var curtainjosn = deviceList.Find((device) => device.functionType ==FunctionType.Curtain|| device.functionType == FunctionType.MotorCurtain|| device.functionType == FunctionType.RollingShutter); if (curtainjosn != null) { deviceStrTypeList.Add(Language.StringByID(StringId.Curtain)); @@ -406,7 +316,7 @@ deviceStrTypeList.Add(Language.StringByID(StringId.AC)); } var floorHeating = deviceList.Find((device) => device.functionType == FunctionType.FloorHeating); - if (ac != null) + if (floorHeating != null) { deviceStrTypeList.Add(Language.StringByID(StringId.FloorHeating)); } @@ -427,13 +337,13 @@ functionTypeList.Add(FunctionType.Dimmer); functionTypeList.Add(FunctionType.RGB); functionTypeList.Add(FunctionType.RGBW); - functionTypeList.Add(FunctionType.CCT); + functionTypeList.Add(FunctionType.ColorTemperature); } else if (deviceType == Language.StringByID(StringId.Curtain)) { functionTypeList.Add(FunctionType.Curtain); - functionTypeList.Add(FunctionType.RollerCurtain); - functionTypeList.Add(FunctionType.TrietexCurtain); + functionTypeList.Add(FunctionType.RollingShutter); + functionTypeList.Add(FunctionType.MotorCurtain); } else if (deviceType == Language.StringByID(StringId.AC)) { @@ -459,10 +369,10 @@ deviceTypeList.Add(FunctionType.RGB); deviceTypeList.Add(FunctionType.RGBW); deviceTypeList.Add(FunctionType.Dimmer); - deviceTypeList.Add(FunctionType.CCT); + deviceTypeList.Add(FunctionType.ColorTemperature); deviceTypeList.Add(FunctionType.Curtain); - deviceTypeList.Add(FunctionType.RollerCurtain); - deviceTypeList.Add(FunctionType.TrietexCurtain); + deviceTypeList.Add(FunctionType.RollingShutter); + deviceTypeList.Add(FunctionType.MotorCurtain); deviceTypeList.Add(FunctionType.AC); deviceTypeList.Add(FunctionType.FloorHeating); } @@ -473,10 +383,10 @@ deviceTypeList.Add(FunctionType.RGB); deviceTypeList.Add(FunctionType.RGBW); deviceTypeList.Add(FunctionType.Dimmer); - deviceTypeList.Add(FunctionType.CCT); + deviceTypeList.Add(FunctionType.ColorTemperature); deviceTypeList.Add(FunctionType.Curtain); - deviceTypeList.Add(FunctionType.RollerCurtain); - deviceTypeList.Add(FunctionType.TrietexCurtain); + deviceTypeList.Add(FunctionType.RollingShutter); + deviceTypeList.Add(FunctionType.MotorCurtain); deviceTypeList.Add(FunctionType.AC); deviceTypeList.Add(FunctionType.FloorHeating); } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs index 007edf4..9360e67 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs @@ -18,7 +18,7 @@ { TextSize = TextSize.text16, TextColor = CSS.CSS_Color.textColor, - Width = Application.GetRealWidth(32 + 32), + Width = Application.GetRealWidth(32 + 32+200), Height = Application.GetRealHeight(22), Y = Application.GetRealHeight(12), X = Application.GetRealWidth(TextSize.left16), @@ -27,7 +27,7 @@ IsBold = true, }; /// <summary> - /// 锛堝鏋�/灏辨墽琛岋級鐨勬柟娉� + /// View /// </summary> /// <returns></returns> public FrameLayout FLayoutView(int flHeight,int btnY) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs index 15586e8..96ba3a1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs @@ -68,8 +68,8 @@ /// </summary> public Button btnNextIcon = new Button { - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", //Y = Application.GetRealHeight(14), X = Application.GetRealWidth(315), diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/CheckView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/CheckView.cs index 91144ac..d2b6d3a 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/CheckView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/CheckView.cs @@ -32,8 +32,8 @@ /// </summary> public Button btnCheckIcon = new Button { - Width = Application.GetMinRealAverage(28), - Height = Application.GetMinRealAverage(28), + Width = Application.GetRealWidth(28), + Height = Application.GetRealWidth(28), UnSelectedImagePath = "LogicIcon/weekoff.png", SelectedImagePath = "LogicIcon/weekon.png", X = Application.GetRealWidth(303), diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs index 4381fa0..9f803da 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs @@ -17,8 +17,8 @@ /// </summary> public Button btnIcon1 = new Button { - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), Y = Application.GetRealHeight(19), X = Application.GetRealWidth(TextSize.left16), UnSelectedImagePath = "LogicIcon/down.png", @@ -45,8 +45,8 @@ /// </summary> public Button btnIcon2 = new Button { - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), Y = Application.GetRealHeight(19), X = Application.GetRealWidth(122), UnSelectedImagePath = "LogicIcon/down.png", diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunTypeView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunTypeView.cs index 4422b6d..7bba7b2 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunTypeView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunTypeView.cs @@ -47,8 +47,8 @@ /// </summary> public Button btnNextIcon = new Button { - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", X = Application.GetRealWidth(339), }; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs index 27619e5..1ad98aa 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs @@ -19,8 +19,8 @@ /// </summary> public Button btnAddIcon= new Button { - Width = Application.GetMinRealAverage(20), - Height = Application.GetMinRealAverage(20), + Width = Application.GetRealWidth(20), + Height = Application.GetRealWidth(20), UnSelectedImagePath = "LogicIcon/addconditiontarget.png", Y = Application.GetRealHeight(22), X = Application.GetRealWidth(162), diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs index 2e008e0..cd16499 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs @@ -34,8 +34,8 @@ /// </summary> public Button btnNextIcon = new Button { - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", //Y = Application.GetRealHeight(14), X = Application.GetRealWidth(315), diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs index 6094c45..2d3665f 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs @@ -17,7 +17,7 @@ }; /// <summary> - /// 锛堟潯浠舵垨鑰呯洰鏍囷級鏂囨湰鎻忚堪 + /// 淇濆瓨 /// </summary> public Button btnSave= new Button { @@ -30,7 +30,7 @@ TextColor = CSS.CSS_Color.textWhiteColor, TextAlignment = TextAlignment.Center, BackgroundColor= CSS.CSS_Color.btnSaveBackgroundColor, - Radius = (uint)Application.GetRealHeight(44), + Radius = (uint)Application.GetRealHeight(22), }; public Button btnClick = new Button diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs index 8e33c87..bb40d14 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs @@ -17,8 +17,8 @@ /// </summary> public Button btnIcon = new Button { - Width = Application.GetMinRealAverage(28), - Height = Application.GetMinRealAverage(28), + Width = Application.GetRealWidth(28), + Height = Application.GetRealWidth(28), //Y = Application.GetRealHeight(8), X = Application.GetRealWidth(TextSize.left12), @@ -87,8 +87,8 @@ /// </summary> public Button btnNextIcon = new Button { - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", X = Application.GetRealWidth(339), diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs index 1356c70..08e3756 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs @@ -72,8 +72,8 @@ /// </summary> public Button btnSwitchIcon = new Button { - Width = Application.GetMinRealAverage(36), - Height = Application.GetMinRealAverage(36), + Width = Application.GetRealWidth(36), + Height = Application.GetRealWidth(36), Y = Application.GetRealHeight(58), X = Application.GetRealWidth(295), UnSelectedImagePath = "LogicIcon/off.png", diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs index 54fb5ad..48a954b 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs @@ -93,8 +93,8 @@ { X = Application.GetRealWidth(194), Y = Application.GetRealHeight(8), - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), UnSelectedImagePath = "MusicIcon/clear.png", }; editBjView.AddChidren(clearIconBtn); @@ -265,8 +265,8 @@ { X = Application.GetRealWidth(194), Y = Application.GetRealHeight(8), - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), UnSelectedImagePath = "MusicIcon/clear.png", }; editBjView.AddChidren(clearIconBtn); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs index 28aac76..00a669b 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs @@ -33,7 +33,7 @@ public Button backBtn = new Button { Width = Application.GetRealWidth(12), - Height = Application.GetRealHeight(20), + Height = Application.GetRealWidth(20), X = Application.GetRealWidth(TextSize.left16), Y = Application.GetRealHeight(32), UnSelectedImagePath = "LogicIcon/back.png", @@ -46,8 +46,8 @@ { Y = Application.GetRealHeight(28), X = Application.GetRealWidth(337), - Width = Application.GetMinRealAverage(32), - Height = Application.GetMinRealAverage(32), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), UnSelectedImagePath = "LogicIcon/set.png", Visible = false, }; @@ -65,8 +65,8 @@ public Button clickSetBtn = new Button { X = Application.GetRealWidth(337 - 37), - Width = Application.GetMinRealAverage(28 + 37), - Height = Application.GetMinRealAverage(28 + 7 + 29), + Width = Application.GetRealWidth(28 + 37), + Height = Application.GetRealWidth(28 + 7 + 29), }; /// <summary> /// 鏈�涓婇潰鐨勯偅鍧楁柟娉� diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs index 69e89d1..70dcbe9 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs @@ -61,8 +61,8 @@ /// </summary> public Button btn_subtract = new Button { - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), X = Application.GetRealWidth(26), Y = Application.GetRealHeight(118), UnSelectedImagePath = "LogicIcon/-.png", @@ -99,8 +99,8 @@ /// </summary> public Button btn_add = new Button { - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), X = Application.GetRealWidth(294), Y = Application.GetRealHeight(118), UnSelectedImagePath = "LogicIcon/+.png", diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs index 5807ebf..ad9473e 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs @@ -9,23 +9,23 @@ { public class Send { - ///// <summary> - ///// 浣忓畢ID - ///// </summary> - //public static string homeId = Entity.DB_ResidenceData.residenceData.CurReginID; - ///// <summary> - ///// 缃戝叧ID - ///// </summary> - //public static string gatewayId = DriverLayer.Control.Ins.GatewayId; - /// <summary> /// 浣忓畢ID /// </summary> - public static string homeId = "1333723044544233473"; + public static string homeId = Entity.DB_ResidenceData.residenceData.CurReginID; /// <summary> /// 缃戝叧ID /// </summary> - public static string gatewayId = "1333723647223775233"; + public static string gatewayId = DriverLayer.Control.Ins.GatewayId; + + ///// <summary> + ///// 缃戝叧ID + ///// </summary> + //public static string gatewayId =Entity.DB_ResidenceData.residenceData.HomeGateway.gatewayId; + ///// <summary> + ///// 浣忓畢ID + ///// </summary> + //public static string homeId = Entity.DB_ResidenceData.residenceData.HomeGateway.homeId; /// <summary> /// 鑾峰彇閫昏緫ID鍒楄〃 diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index fe144d9..95c6385 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -49,10 +49,10 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: { //2琛ㄧず(寮�锛屽叧)鍔熻兘 - SwitchBrightnessView(fLayout, device, index, edit,2); + SwitchBrightnessView(fLayout, device, index, edit, 2); } break; case FunctionType.Relay: @@ -68,32 +68,112 @@ SwitchView(fLayout, device, index, edit, 3); } break; - case FunctionType.TrietexCurtain: - case FunctionType.RollerCurtain: + case FunctionType.MotorCurtain: + case FunctionType.RollingShutter: { //3琛ㄧず(寮�锛屽叧锛屾殏鍋�)鍔熻兘 SwitchBrightnessView(fLayout, device, index, edit, 3); } break; - case FunctionType.AC: { + case FunctionType.AC: + { #region 鐣岄潰 ///寮�鍏� - LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView(); - curtainSwitchView.btnText.TextID = StringId.switchLogic; - fLayout.AddChidren(curtainSwitchView.FLayoutView()); + LogicView.FunTypeView acSwitchVie = new LogicView.FunTypeView(); + acSwitchVie.btnText.TextID = StringId.switchLogic; + fLayout.AddChidren(acSwitchVie.FLayoutView()); + + ///娓╁害 + LogicView.FunTypeView temperatureView = new LogicView.FunTypeView(); + temperatureView.frameLayout.Y = acSwitchVie.frameLayout.Bottom; + temperatureView.btnText.TextID = StringId.temperatureLogic; + fLayout.AddChidren(temperatureView.FLayoutView()); ///妯″紡 LogicView.FunTypeView acModehView = new LogicView.FunTypeView(); - acModehView.frameLayout.Y = curtainSwitchView.frameLayout.Bottom; + acModehView.frameLayout.Y = temperatureView.frameLayout.Bottom; acModehView.btnText.TextID = StringId.modeLogic; fLayout.AddChidren(acModehView.FLayoutView()); + + ///椋庨�� + LogicView.FunTypeView acSpeedView = new LogicView.FunTypeView(); + acSpeedView.frameLayout.Y = acModehView.frameLayout.Bottom; + acSpeedView.btnText.TextID = StringId.speedLogic; + fLayout.AddChidren(acSpeedView.FLayoutView()); #endregion #region 鐐瑰嚮浜嬩欢 ///寮�鍏崇偣鍑讳簨浠� - curtainSwitchView.btnClick.MouseUpEventHandler += (sender, e) => + acSwitchVie.btnClick.MouseUpEventHandler += (sender, e) => { - SwitchViewMethod(device, curtainSwitchView.btnState, 2); + SwitchViewMethod(device, acSwitchVie.btnState, 2); }; + ///娓╁害鐐瑰嚮浜嬩欢 + temperatureView.btnClick.MouseUpEventHandler += (sender, e) => + { + FrameLayout frame = new FrameLayout + { + BackgroundColor = CSS.CSS_Color.viewTrans60lucence, + }; + this.AddChidren(frame); + LogicView.TimeView view = new LogicView.TimeView(); + view.FLayoutView(frame); + EventHandler<MouseEventArgs> removefLayout = (sender1, e1) => + { + //绉婚櫎fLayout鐣岄潰 + frame.RemoveFromParent(); + }; + //鍙栨秷鐐瑰嚮浜嬩欢 + view.btnCancel.MouseUpEventHandler += removefLayout; + + //鍒濆鍖栧垪琛� + var temperatureList = new List<string>(); + for (int i = 16; i < 32; i++) + { + //娣诲姞鏁版嵁 + temperatureList.Add(i.ToString() + "鈩�"); + temperatureList.Add((i + 0.5).ToString() + "鈩�"); + + } + + //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩) + view.mUIPickerView.setNPicker(temperatureList, null, null); + + //榛樿鍒濆閫変腑鐘舵�� + view.mUIPickerView.setCurrentItems(9, 0, 0); + //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿 + string temperature = "25鈩�"; + for (int i = 0; i < temperatureList.Count; i++) + { + if (temperatureList[i] == temperatureView.btnState.Text) + { + //鏇存柊鐘舵�� + view.mUIPickerView.setCurrentItems(i, 0, 0); + //鏇存柊鐘舵�� + temperature = temperatureList[i]; + break; + } + } + //閫変腑鏃堕棿鍥炶皟鏂规硶,鏃堕棿鍙樺寲涓�娆″洖璋冧竴娆� + view.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) => + { + temperature = temperatureList[index1]; + }; + //纭畾鐐瑰嚮浜嬩欢 + view.btnConfirm.MouseUpEventHandler += (sender2, e2) => + { + Dictionary<string, string> dic = new Dictionary<string, string>(); + LogicMethod.dictionary(dic, "key", "set_temp"); + string keyVlaue = "set_temp"; + string set_temp_value = temperature.Replace("鈩�", ""); + LogicMethod.dictionary(dic, "value", set_temp_value); + selectedState = device.functionType + "_set_temp"; + AddDictionaryData(dicSateteList, keyVlaue, dic); + RemView(frame); + temperatureView.btnState.Text = temperature; + + }; + }; + ///妯″紡鐐瑰嚮浜嬩欢 acModehView.btnClick.MouseUpEventHandler += (sender, e) => { @@ -109,14 +189,15 @@ }; this.AddChidren(frame); LogicView.DateView modeView = new LogicView.DateView(); - modeView.btnTitle.TextID = StringId.modeLogic; + modeView.btnTitle.TextID = StringId.modeLogic; modeView.FLayoutView(frame, modeStr.Count); modeView.btnCancel.MouseUpEventHandler += (sender2, e2) => { frame.RemoveFromParent(); }; ///瀹氫箟涓�涓狟tn璁板綍閫変腑鐘舵�� - Button checkBtn = new Button{ + Button checkBtn = new Button + { Tag = "unknown", }; for (int i = 0; i < modeStr.Count; i++) @@ -145,16 +226,260 @@ }; } - modeView.btnConfirm.MouseUpEventHandler += (sender1,e1) => { - if (checkBtn.Tag.ToString()== "unknown") { + modeView.btnConfirm.MouseUpEventHandler += (sender1, e1) => + { + if (checkBtn.Tag.ToString() == "unknown") + { return; } - + Dictionary<string, string> dic = new Dictionary<string, string>(); LogicMethod.dictionary(dic, "key", "mode"); string keyVlaue = "mode"; - LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString())); + LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString(), keyVlaue)); acModehView.btnState.Text = checkBtn.Tag.ToString(); + selectedState = device.functionType + "_mode"; + AddDictionaryData(dicSateteList, keyVlaue, dic); + RemView(frame); + }; + }; + ///椋庨�熺偣鍑讳簨浠� + acSpeedView.btnClick.MouseUpEventHandler += (sender, e) => + { + + List<string> speedStr = new List<string> { + Language.StringByID(StringId.LowWindSpeed), + Language.StringByID(StringId.MiddleWindSpeed), + Language.StringByID(StringId.HighWindSpeed), + Language.StringByID(StringId.Auto), + }; + FrameLayout frame = new FrameLayout + { + BackgroundColor = CSS.CSS_Color.viewTrans60lucence, + }; + this.AddChidren(frame); + LogicView.DateView speedView = new LogicView.DateView(); + speedView.btnTitle.TextID = StringId.modeLogic; + speedView.FLayoutView(frame, speedStr.Count); + speedView.btnCancel.MouseUpEventHandler += (sender2, e2) => + { + frame.RemoveFromParent(); + }; + ///瀹氫箟涓�涓狟tn璁板綍閫変腑鐘舵�� + Button checkBtn = new Button + { + Tag = "unknown", + }; + for (int i = 0; i < speedStr.Count; i++) + { + LogicView.CheckView speedTypeView = new LogicView.CheckView(); + speedTypeView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i); + speedView.frameLayout.AddChidren(speedTypeView.FLayoutView()); + speedTypeView.btnText.Text = speedStr[i]; + speedTypeView.btnClick.Tag = speedStr[i];//鏍囪 + + if (acModehView.btnState.Text == speedStr[i]) + { + //鏄剧ず涔嬪墠鐨勯�変腑鐘舵�� + checkBtn.IsSelected = false; + speedTypeView.btnCheckIcon.IsSelected = true; + checkBtn = speedTypeView.btnCheckIcon; + checkBtn.Tag = speedTypeView.btnClick.Tag.ToString(); + } + //鏄熸湡鐨勭偣鍑讳簨浠� + speedTypeView.btnClick.MouseUpEventHandler += (sender1, e1) => + { + checkBtn.IsSelected = false; + speedTypeView.btnCheckIcon.IsSelected = true; + checkBtn = speedTypeView.btnCheckIcon; + checkBtn.Tag = speedTypeView.btnClick.Tag.ToString(); + }; + + } + speedView.btnConfirm.MouseUpEventHandler += (sender1, e1) => + { + if (checkBtn.Tag.ToString() == "unknown") + { + return; + } + + Dictionary<string, string> dic = new Dictionary<string, string>(); + LogicMethod.dictionary(dic, "key", "fan"); + string keyVlaue = "fan"; + LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString(), keyVlaue)); + acSpeedView.btnState.Text = checkBtn.Tag.ToString(); + selectedState = device.functionType + "_fan"; + AddDictionaryData(dicSateteList, keyVlaue, dic); + RemView(frame); + }; + }; + if (edit) + { + GetEditState(device, index, acSwitchVie.btnState, temperatureView.btnState, acModehView.btnState, acSpeedView.btnState); + } + + #endregion + } + break; + case FunctionType.FloorHeating: + { + #region 鐣岄潰 + ///寮�鍏� + LogicView.FunTypeView floorHeatingSwitchVie = new LogicView.FunTypeView(); + floorHeatingSwitchVie.btnText.TextID = StringId.switchLogic; + fLayout.AddChidren(floorHeatingSwitchVie.FLayoutView()); + + ///娓╁害 + LogicView.FunTypeView temperatureView = new LogicView.FunTypeView(); + temperatureView.frameLayout.Y = floorHeatingSwitchVie.frameLayout.Bottom; + temperatureView.btnText.TextID = StringId.temperatureLogic; + fLayout.AddChidren(temperatureView.FLayoutView()); + + ///妯″紡 + LogicView.FunTypeView floorHeatingModehView = new LogicView.FunTypeView(); + floorHeatingModehView.frameLayout.Y = temperatureView.frameLayout.Bottom; + floorHeatingModehView.btnText.TextID = StringId.modeLogic; + fLayout.AddChidren(floorHeatingModehView.FLayoutView()); + + + #endregion + #region 鐐瑰嚮浜嬩欢 + ///寮�鍏崇偣鍑讳簨浠� + floorHeatingSwitchVie.btnClick.MouseUpEventHandler += (sender, e) => + { + SwitchViewMethod(device, floorHeatingSwitchVie.btnState, 2); + }; + ///娓╁害鐐瑰嚮浜嬩欢 + temperatureView.btnClick.MouseUpEventHandler += (sender, e) => + { + FrameLayout frame = new FrameLayout + { + BackgroundColor = CSS.CSS_Color.viewTrans60lucence, + }; + this.AddChidren(frame); + LogicView.TimeView view = new LogicView.TimeView(); + view.FLayoutView(frame); + EventHandler<MouseEventArgs> removefLayout = (sender1, e1) => + { + //绉婚櫎fLayout鐣岄潰 + frame.RemoveFromParent(); + }; + //鍙栨秷鐐瑰嚮浜嬩欢 + view.btnCancel.MouseUpEventHandler += removefLayout; + + //鍒濆鍖栧垪琛� + var temperatureList = new List<string>(); + for (int i = 16; i < 32; i++) + { + //娣诲姞鏁版嵁 + temperatureList.Add(i.ToString() + "鈩�"); + temperatureList.Add((i + 0.5).ToString() + "鈩�"); + + } + + //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩) + view.mUIPickerView.setNPicker(temperatureList, null, null); + + //榛樿鍒濆閫変腑鐘舵�� + view.mUIPickerView.setCurrentItems(9, 0, 0); + //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿 + string temperature = "25鈩�"; + for (int i = 0; i < temperatureList.Count; i++) + { + if (temperatureList[i] == temperatureView.btnState.Text) + { + //鏇存柊鐘舵�� + view.mUIPickerView.setCurrentItems(i, 0, 0); + //鏇存柊鐘舵�� + temperature = temperatureList[i]; + break; + } + } + //閫変腑鏃堕棿鍥炶皟鏂规硶,鏃堕棿鍙樺寲涓�娆″洖璋冧竴娆� + view.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) => + { + temperature = temperatureList[index1]; + }; + //纭畾鐐瑰嚮浜嬩欢 + view.btnConfirm.MouseUpEventHandler += (sender2, e2) => + { + Dictionary<string, string> dic = new Dictionary<string, string>(); + LogicMethod.dictionary(dic, "key", "set_temp"); + string keyVlaue = "set_temp"; + string set_temp_value = temperature.Replace("鈩�", ""); + LogicMethod.dictionary(dic, "value", set_temp_value); + selectedState = device.functionType + "_set_temp"; + AddDictionaryData(dicSateteList, keyVlaue, dic); + RemView(frame); + temperatureView.btnState.Text = temperature; + + }; + }; + ///妯″紡鐐瑰嚮浜嬩欢 + floorHeatingModehView.btnClick.MouseUpEventHandler += (sender, e) => + { + List<string> modeStr = new List<string> { + Language.StringByID(StringId.dayMode), + Language.StringByID(StringId.nightMode), + Language.StringByID(StringId.leaveMode), + Language.StringByID(StringId.ordinaryMode), + Language.StringByID(StringId.timeMode), + }; + FrameLayout frame = new FrameLayout + { + BackgroundColor = CSS.CSS_Color.viewTrans60lucence, + }; + this.AddChidren(frame); + LogicView.DateView modeView = new LogicView.DateView(); + modeView.btnTitle.TextID = StringId.modeLogic; + modeView.FLayoutView(frame, modeStr.Count); + modeView.btnCancel.MouseUpEventHandler += (sender2, e2) => + { + frame.RemoveFromParent(); + }; + ///瀹氫箟涓�涓狟tn璁板綍閫変腑鐘舵�� + Button checkBtn = new Button + { + Tag = "unknown", + }; + for (int i = 0; i < modeStr.Count; i++) + { + LogicView.CheckView modeTypeView = new LogicView.CheckView(); + modeTypeView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i); + modeView.frameLayout.AddChidren(modeTypeView.FLayoutView()); + modeTypeView.btnText.Text = modeStr[i]; + modeTypeView.btnClick.Tag = modeStr[i];//鏍囪 + + if (floorHeatingModehView.btnState.Text == modeStr[i]) + { + //鏄剧ず涔嬪墠鐨勯�変腑鐘舵�� + checkBtn.IsSelected = false; + modeTypeView.btnCheckIcon.IsSelected = true; + checkBtn = modeTypeView.btnCheckIcon; + checkBtn.Tag = modeTypeView.btnClick.Tag.ToString(); + } + //鏄熸湡鐨勭偣鍑讳簨浠� + modeTypeView.btnClick.MouseUpEventHandler += (sender1, e1) => + { + checkBtn.IsSelected = false; + modeTypeView.btnCheckIcon.IsSelected = true; + checkBtn = modeTypeView.btnCheckIcon; + checkBtn.Tag = modeTypeView.btnClick.Tag.ToString(); + }; + + } + modeView.btnConfirm.MouseUpEventHandler += (sender1, e1) => + { + if (checkBtn.Tag.ToString() == "unknown") + { + return; + } + + Dictionary<string, string> dic = new Dictionary<string, string>(); + LogicMethod.dictionary(dic, "key", "mode"); + string keyVlaue = "mode"; + LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString(), "FloorHeating")); + floorHeatingModehView.btnState.Text = checkBtn.Tag.ToString(); selectedState = device.functionType + "_mode"; AddDictionaryData(dicSateteList, keyVlaue, dic); RemView(frame); @@ -162,8 +487,9 @@ }; if (edit) { - GetEditState(device, index, curtainSwitchView.btnState, null, null, null); + GetEditState(device, index, floorHeatingSwitchVie.btnState, temperatureView.btnState, floorHeatingModehView.btnState, null); } + #endregion } break; @@ -213,23 +539,83 @@ #endregion } - private string GetModeValueString(string text) + /// <summary> + /// 鑾峰彇妯″紡/椋庨�熼敭鍊� + /// </summary> + /// <param name="text"></param> + /// <param name="type"></param> + /// <returns></returns> + private string GetModeValueString(string text, string type) { - string modeStr = ""; - if (text == Language.StringByID(StringId.coolLogic)) + string str = ""; + switch (type) { - modeStr = "cool"; + case "mode": + { + if (text == Language.StringByID(StringId.coolLogic)) + { + str = "cool"; + } + else if (text == Language.StringByID(StringId.heatingLogic)) + { + str = "heat"; + } + else if (text == Language.StringByID(StringId.autoLogic)) + { + str = "auto"; + } + else if (text == Language.StringByID(StringId.dehumidifyLogic)) + { + str = "dry"; + } + } + break; + case "fan": + { + if (text == Language.StringByID(StringId.HighWindSpeed)) + { + str = "high"; + } + else if (text == Language.StringByID(StringId.MiddleWindSpeed)) + { + str = "medium"; + } + else if (text == Language.StringByID(StringId.LowWindSpeed)) + { + str = "low"; + } + else if (text == Language.StringByID(StringId.Auto)) + { + str = "auto"; + } + } + break; + case "FloorHeating": + { + if (text == Language.StringByID(StringId.dayMode)) + { + str = "day"; + } + else if (text == Language.StringByID(StringId.nightMode)) + { + str = "night"; + } + else if (text == Language.StringByID(StringId.leaveMode)) + { + str = "away"; + } + else if (text == Language.StringByID(StringId.ordinaryMode)) + { + str = "normal"; + } + else if (text == Language.StringByID(StringId.timeMode)) + { + str = "timer"; + } + } + break; } - else if (text == Language.StringByID(StringId.heatingLogic)) { - modeStr = "heat"; - } - else if (text == Language.StringByID(StringId.autoLogic)) { - modeStr = "auto"; - } - else if (text == Language.StringByID(StringId.dehumidifyLogic)) { - modeStr = "dry"; - } - return modeStr; + return str; } /// <summary> ///寮�鍏�=鐣岄潰 @@ -239,7 +625,7 @@ /// <param name="index"></param> /// <param name="edit"></param> /// <param name="intView">閫変腑View鐨勬暟閲�</param> - private void SwitchView(FrameLayout fLayout, Entity.Function device, int index, bool edit,int intView) + private void SwitchView(FrameLayout fLayout, Entity.Function device, int index, bool edit, int intView) { #region 鐣岄潰 ///寮�鍏� @@ -268,7 +654,7 @@ /// <param name="index"></param> /// <param name="edit"></param> /// <param name="intView">閫変腑View鐨勬暟閲�</param> - private void SwitchBrightnessView(FrameLayout fLayout, Entity.Function device, int index, bool edit,int intView) + private void SwitchBrightnessView(FrameLayout fLayout, Entity.Function device, int index, bool edit, int intView) { #region 鐣岄潰 ///寮�鍏� @@ -278,9 +664,9 @@ ///浜害 LogicView.FunTypeView brightnessView = new LogicView.FunTypeView(); brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom; - if (device.functionType == FunctionType.TrietexCurtain || device.functionType == FunctionType.RollerCurtain) + if (device.functionType == FunctionType.MotorCurtain || device.functionType == FunctionType.RollingShutter) { - + brightnessView.btnText.TextID = StringId.percentum; } else @@ -378,7 +764,6 @@ } - /// <summary> /// 浜害/鐧惧垎姣�=鍔熻兘涓嬩竴绾х晫闈� /// </summary> @@ -502,7 +887,7 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: { foreach (var dic in dicList) { @@ -558,8 +943,9 @@ } } break; - case FunctionType.TrietexCurtain: - case FunctionType.RollerCurtain: { + case FunctionType.MotorCurtain: + case FunctionType.RollingShutter: + { foreach (var dic in dicList) { @@ -597,6 +983,175 @@ } } + } + break; + case FunctionType.AC: + { + foreach (var dic in dicList) + { + string value = dic["value"]; + switch (dic["key"]) + { + case "on_off": + { + switch (value) + { + case "on": + { + button1.Text = Language.StringByID(StringId.onLogic); + } + break; + case "off": + { + button1.Text = Language.StringByID(StringId.offLogic); + } + break; + } + } + break; + case "set_temp": + { + button2.Text = value + "鈩�"; + } + break; + case "mode": + { + switch (value) + { + case "cool": + { + button3.Text = Language.StringByID(StringId.coolLogic); + } + break; + case "heat": + { + button3.Text = Language.StringByID(StringId.heatingLogic); + } + break; + case "auto": + { + button3.Text = Language.StringByID(StringId.autoLogic); + } + break; + case "dry": + { + button3.Text = Language.StringByID(StringId.dehumidifyLogic); + } + break; + } + + + + } + break; + case "fan": + { + switch (value) + { + case "high": + { + button4.Text = Language.StringByID(StringId.HighWindSpeed); + } + break; + case "medium": + { + button4.Text = Language.StringByID(StringId.MiddleWindSpeed); + } + break; + case "low": + { + button4.Text = Language.StringByID(StringId.LowWindSpeed); + } + break; + case "auto": + { + button4.Text = Language.StringByID(StringId.Auto); + } + break; + } + + + } + break; + + + } + + } + + } + break; + case FunctionType.FloorHeating: + { + + foreach (var dic in dicList) + { + string value = dic["value"]; + switch (dic["key"]) + { + case "on_off": + { + switch (value) + { + case "on": + { + button1.Text = Language.StringByID(StringId.onLogic); + } + break; + case "off": + { + button1.Text = Language.StringByID(StringId.offLogic); + } + break; + } + } + break; + case "set_temp": + { + button2.Text = value + "鈩�"; + } + break; + case "mode": + { + switch (value) + { + case "day": + { + button3.Text = Language.StringByID(StringId.dayMode); + } + break; + case "night": + { + button3.Text = Language.StringByID(StringId.nightMode); + } + break; + + case "away": + { + button3.Text = Language.StringByID(StringId.leaveMode); + } + break; + case "normal": + { + button3.Text = Language.StringByID(StringId.ordinaryMode); + } + break; + case "timer": + { + button3.Text = Language.StringByID(StringId.timeMode); + } + break; + } + + + + } + break; + + } + + } + } break; } @@ -665,6 +1220,6 @@ } - + } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs index 634e7b0..f8a497a 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs @@ -90,13 +90,13 @@ { LogicView.TimeView timePointView = new LogicView.TimeView(); timePointView.FLayoutView(fLayout); - EventHandler<MouseEventArgs> RemovefLayout = (sender, e1) => + EventHandler<MouseEventArgs> removefLayout = (sender, e1) => { //绉婚櫎fLayout鐣岄潰 fLayout.RemoveFromParent(); }; //鍙栨秷鐐瑰嚮浜嬩欢 - timePointView.btnCancel.MouseUpEventHandler += RemovefLayout; + timePointView.btnCancel.MouseUpEventHandler += removefLayout; //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩) timePointView.mUIPickerView.setNPicker(timePointView.GethStringList(), timePointView.GetmStringList(), null); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs index e8030bf..27ec27a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs @@ -34,7 +34,7 @@ public Button backBtn = new Button { Width = Application.GetRealWidth(12), - Height = Application.GetRealHeight(20), + Height = Application.GetRealWidth(20), X = Application.GetRealWidth(16), Y = Application.GetRealHeight(32), UnSelectedImagePath = "MusicIcon/MusicBack.png", @@ -55,8 +55,8 @@ { Y = Application.GetRealHeight(29), X = Application.GetRealWidth(337), - Width = Application.GetMinRealAverage(28), - Height = Application.GetMinRealAverage(28), + Width = Application.GetRealWidth(28), + Height = Application.GetRealWidth(28), UnSelectedImagePath = "MusicIcon/set.png", Visible=false, }; @@ -74,8 +74,8 @@ public Button clickSetBtn = new Button { X = Application.GetRealWidth(337 - 37), - Width = Application.GetMinRealAverage(28 + 37), - Height = Application.GetMinRealAverage(28 + 7 + 29), + Width = Application.GetRealWidth(28 + 37), + Height = Application.GetRealWidth(28 + 7 + 29), }; /// <summary> /// 鏈�涓婇潰鐨勯偅鍧楁柟娉� -- Gitblit v1.8.0