From 7b96ea115d51fb721130fef8622500740dea7b08 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 25 八月 2022 18:06:29 +0800 Subject: [PATCH] 2022年08月25日18:06:27 --- HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 420 +++++++++++++++++----------------------------- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 6 HDL_ON/UI/UI2/FuntionControlView/Music/A31SongPlay.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs | 10 HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs | 3 HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs | 8 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 13 + HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs | 14 HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs | 6 HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs | 2 HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs | 6 HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs | 30 +- 15 files changed, 212 insertions(+), 314 deletions(-) diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index d4c6a4c..e9ed019 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -1324,7 +1324,7 @@ function.SetAttrState("on_off", status); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("on_off", status); - Music.SendMethod.mMethod.SendControlCommand(function, dic); + Music.SendMethod.Current.SendControlCommand(function, dic); }; } diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs index ede9b51..88447f3 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs @@ -219,7 +219,7 @@ m.functionMusic.SetAttrState("on_off", "off"); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("on_off", "off"); - Music.SendMethod.mMethod.SendControlCommand(m.functionMusic, dic); + Music.SendMethod.Current.SendControlCommand(m.functionMusic, dic); } } }) diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs index 422e4b2..71079b9 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs @@ -359,7 +359,7 @@ a31player.SetAttrState("song_step", "up"); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("song_step", "up"); - SendMethod.mMethod.SendControlCommand(a31player, dic); + SendMethod.Current.SendControlCommand(a31player, dic); }; btnPrev.MouseUpEventHandler = (sender, e) => { @@ -382,7 +382,7 @@ a31player.SetAttrState("on_off", status); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("on_off", status); - SendMethod.mMethod.SendControlCommand(a31player, dic); + SendMethod.Current.SendControlCommand(a31player, dic); }; ///涓嬩竴鏇茬偣鍑讳簨浠� btnNext.MouseDownEventHandler = (sender, e) => @@ -391,7 +391,7 @@ a31player.SetAttrState("song_step", "down"); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("song_step", "down"); - SendMethod.mMethod.SendControlCommand(a31player, dic); + SendMethod.Current.SendControlCommand(a31player, dic); }; btnNext.MouseUpEventHandler = (sender, e) => { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index ec9fca3..b8b6222 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -585,13 +585,13 @@ } if (intValue == 1) { - //璺屽�掓姤璀� + view2.frameLayout.Visible = false; } else if (intValue == 2) { - //鏈変汉鎶ヨ + view2.frameLayout.Y = Application.GetRealHeight(0); } if (edit) @@ -995,7 +995,7 @@ }); } /// <summary> - /// + /// 鍙瀵硅涓撶敤 /// </summary> /// <param name="frame">褰撳墠鐣岄潰</param> /// <param name="device">褰撳墠璁惧</param> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index d9f0de4..286dbbe 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -48,6 +48,7 @@ { case "1": { + inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; foreach (var dic in dicList) { @@ -129,12 +130,8 @@ case "2": { inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; - foreach (var dic in dicList) - { - string value = dic["value"]; - inputView.btnText.Text = Language.StringByID(StringId.timeHorizon) + ": " + value; - } - + string value= this.GetKeyValue("timesection", dicList); + inputView.btnText.Text = Language.StringByID(StringId.timeHorizon) + ": " + value; } break; case "3": @@ -175,91 +172,56 @@ case SPK.PanelSocket: case SPK.ElectricSocket: {//寮�鍏崇伅 - foreach (var dic in dicList) + string value = this.GetKeyValue("on_off", dicList); + inputView.btnState.Text = Language.StringByID(StringId.offLogic); + if (value == "on") { - - string value = dic["value"]; - if (value == "on") - { - inputView.btnState.Text = Language.StringByID(StringId.onLogic); - - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.offLogic); - } + inputView.btnState.Text = Language.StringByID(StringId.onLogic); } } break; //浼犳劅鍣� case SPK.SensorHelp: { - foreach (var dic in dicList) + string value = this.GetKeyValue("alarm_status", dicList); + inputView.btnState.Text = Language.StringByID(StringId.zhengchang); + if (value == "alarm") { - string value = dic["value"]; - if (value == "alarm") - { - inputView.btnState.Text = Language.StringByID(StringId.qiujiu); - - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.zhengchang); - } + inputView.btnState.Text = Language.StringByID(StringId.qiujiu); } } break; case SPK.SensorSmoke: case SPK.SensorGas: { - foreach (var dic in dicList) + string value = this.GetKeyValue("alarm_status", dicList); + inputView.btnState.Text = Language.StringByID(StringId.wuxieluo); + if (value == "alarm") { - string value = dic["value"]; - if (value == "alarm") - { - inputView.btnState.Text = Language.StringByID(StringId.xieluo); + inputView.btnState.Text = Language.StringByID(StringId.xieluo); - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.wuxieluo); - } } } break; case SPK.SensorWater: { - foreach (var dic in dicList) + string value = this.GetKeyValue("alarm_status", dicList); + inputView.btnState.Text = Language.StringByID(StringId.wuluoshui); + if (value == "alarm") { - string value = dic["value"]; - if (value == "alarm") - { - inputView.btnState.Text = Language.StringByID(StringId.luoshui); - - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.wuluoshui); - } + inputView.btnState.Text = Language.StringByID(StringId.luoshui); } } break; case SPK.SensorDryContact: case SPK.SensorDryContact2: { - foreach (var dic in dicList) + + string value = this.GetKeyValue("on_off", dicList); + inputView.btnState.Text = Language.StringByID(StringId.offLogic); + if (value == "on") { - - string value = dic["value"]; - if (value == "on") - { - inputView.btnState.Text = Language.StringByID(StringId.onLogic); - - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.offLogic); - } + inputView.btnState.Text = Language.StringByID(StringId.onLogic); } } break; @@ -267,77 +229,52 @@ case SPK.SensorDuiShe: case SPK.SensorPir: { - foreach (var dic in dicList) + string value = this.GetKeyValue("people_status", dicList); + inputView.btnState.Text = Language.StringByID(StringId.wuren); + if (value == "true") { + inputView.btnState.Text = Language.StringByID(StringId.youren); - string value = dic["value"]; - if (value == "true") - { - inputView.btnState.Text = Language.StringByID(StringId.youren); - - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.wuren); - } } } break; case SPK.SensorDoorWindow: { - foreach (var dic in dicList) + string value = this.GetKeyValue("contact_status", dicList); + inputView.btnState.Text = Language.StringByID(StringId.bihe); + if (value == "open") { - - string value = dic["value"]; - if (value == "open") - { - inputView.btnState.Text = Language.StringByID(StringId.kaiqi); - - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.bihe); - } + inputView.btnState.Text = Language.StringByID(StringId.kaiqi); } + } break; case SPK.SensorUtrasonic: { + string key = this.GetKey(dicList); + string value = this.GetValue(dicList); string str = ""; - foreach (var dic in dicList) + switch (key) { - string value = dic["value"]; - switch (dic["key"]) - { - case "status": - case "people_status": + case "status": + case "people_status": + { + str = Language.StringByID(StringId.wuren); + if (value == "true") { - if (value == "true") - { - str = Language.StringByID(StringId.youren); - } - else - { - str = Language.StringByID(StringId.wuren); - } - - + str = Language.StringByID(StringId.youren); } - break; - case "dismantle": + } + break; + case "dismantle": + { + str = Language.StringByID(StringId.buzaixian); + if (value == "true") { - if (value == "true") - { - str = Language.StringByID(StringId.zaixian); - } - else - { - str = Language.StringByID(StringId.buzaixian); - } + str = Language.StringByID(StringId.zaixian); } - break; - - } + } + break; } inputView.btnState.Text = str; @@ -345,50 +282,31 @@ break; case SPK.SenesorMegahealth: { - foreach (var dic in dicList) + string key = this.GetKey(dicList); + string value = this.GetValue(dicList); + if (key == "people_status") { - string value = dic["value"]; - switch (dic["key"]) + inputView.btnState.Text = Language.StringByID(StringId.wuren); + if (value == "true") { - case "people_status": - { - if (value == "true") - { - inputView.btnState.Text = Language.StringByID(StringId.youren); - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.wuren); - } - - } - break; - case "target_status": - { - if (value == "4") - { - inputView.btnState.Text = Language.StringByID(StringId.shi); - } - } - break; + inputView.btnState.Text = Language.StringByID(StringId.youren); } - + } + else if (key == "target_status") + { + if (value == "4") + { + inputView.btnState.Text = Language.StringByID(StringId.shi); + } } } break; case SPK.SenesorMegahealth2: { - foreach (var dic in dicList) - { - string value = dic["value"]; - if (value == "fall") - { - inputView.btnState.Text = Language.StringByID(StringId.diedao); - } - else - { - inputView.btnState.Text = Language.StringByID(StringId.wuren); - } + string value = this.GetValue(dicList); + inputView.btnState.Text = Language.StringByID(StringId.wuren); + if (value == "fall") { + inputView.btnState.Text = Language.StringByID(StringId.diedao); } } break; @@ -456,7 +374,7 @@ case SPK.SensorTemperature: { - string str = new InpOrOutLogicMethod { }.GetText(dicList, "temperature"); + string str =this.GetText(dicList, "temperature"); inputView.btnState.Text = str; } break; @@ -472,26 +390,17 @@ case SPK.SensorTVOC: case SPK.SensorHcho: { - string strvalue = ""; - foreach (var dic in dicList) - { - strvalue = dic["value"]; - break; - } - string str = new PublicInterface().GetSensorLevelText(device, strvalue, true); + string value = this.GetValue(dicList); + string str = new PublicInterface().GetSensorLevelText(device, value, true); inputView.btnState.Text = str; } break; case SPK.DoorLock: { - foreach (var dic in dicList) + string value = this.GetValue(dicList); + if (value == "open") { - string value = dic["value"]; - if (value == "open") - { - inputView.btnState.Text = Language.StringByID(StringId.kaiqi); - } - + inputView.btnState.Text = Language.StringByID(StringId.kaiqi); } } break; @@ -503,19 +412,9 @@ } else { - - foreach (var dic in dicList) - { - string key = dic["key"]; - if (key == "user_id") - { - string userId = dic["value"]; - var FaceItem = this.FaceItem(userId, device.deviceId); - inputView.btnState.Text = FaceItem.userName; - // Language.StringByID(StringId.kaiqi); - } - - } + string userId = this.GetKeyValue("user_id",dicList); + var FaceItem = this.GetFaceItem(userId, device.deviceId); + inputView.btnState.Text = FaceItem.userName; } } break; @@ -639,26 +538,18 @@ case "8": { inputView.btnIcon.UnSelectedImagePath = "LogicIcon/location.png"; - foreach (var dic in dicList) + string value = this.GetValue(dicList); + if (value == "arrive") { - string strtext = ""; - string value = dic["value"]; - switch (value) - { - case "arrive": - { - strtext = Language.StringByID(StringId.daoda); - } - break; - case "leave": - { - strtext = Language.StringByID(StringId.likai); - } - break; - } - inputView.btnText.TextID = StringId.likiadaoda; - inputView.btnState.Text = strtext; + value = Language.StringByID(StringId.daoda); } + else if (value == "leave") + { + value = Language.StringByID(StringId.likai); + } + + inputView.btnText.TextID = StringId.likiadaoda; + inputView.btnState.Text = value; } break; case "10": @@ -775,8 +666,6 @@ || device.spk == SPK.SensorEnvironment3 ) { - //杩欎釜璁惧姣旇緝鐗规畩 - ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList(); ///褰撳墠鐨勭储寮曞�兼暟鎹璞� Input inputedit = Logic.currlogic.input[indexVulae]; ///鐘舵�佸�� @@ -800,7 +689,7 @@ { titleInt = StringId.wendudiyu; } - conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.InputBoxAction(device, titleInt, indexVulae, true, stateValue); } break; case "humidity": @@ -814,27 +703,27 @@ { titleInt = StringId.shidudiyu; } - conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.InputBoxAction(device, titleInt, indexVulae, true, stateValue); } break; case "co2": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue); } break; case "pm25": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); } break; case "tvoc": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); } break; case "hcho": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue); } break; } @@ -844,37 +733,37 @@ else if (device.spk == SPK.SensorTemperature) { - new InpOrOutLogicMethod().SensorView(thisView, device, "temperature", indexVulae); + this.SensorView(thisView, device, "temperature", indexVulae); } else if (device.spk == SPK.SensorHumidity) { - new InpOrOutLogicMethod().SensorView(thisView, device, "humidity", indexVulae); + this.SensorView(thisView, device, "humidity", indexVulae); } else if (device.spk == SPK.SensorCO2) { - new InpOrOutLogicMethod().SensorView(thisView, device, "co2", indexVulae); + this.SensorView(thisView, device, "co2", indexVulae); } else if (device.spk == SPK.SensorPm25) { - new InpOrOutLogicMethod().SensorView(thisView, device, "pm25", indexVulae); + this.SensorView(thisView, device, "pm25", indexVulae); } else if (device.spk == SPK.SensorTVOC) { - new InpOrOutLogicMethod().SensorView(thisView, device, "tvoc", indexVulae); + this.SensorView(thisView, device, "tvoc", indexVulae); } else if (device.spk == SPK.SensorHcho) { - new InpOrOutLogicMethod().SensorView(thisView, device, "hcho", indexVulae); + this.SensorView(thisView, device, "hcho", indexVulae); } else @@ -1442,11 +1331,11 @@ if (outputTarget.target_type == "1" || outputTarget.target_type == "3") { - targetView.btnState.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; + targetView.btnState.Text = this.GetTimeText(outputTarget.delay) + stateStr; } else { - targetView.btnText.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; + targetView.btnText.Text = this.GetTimeText(outputTarget.delay) + stateStr; } //鍐嶆缂栬緫鏉′欢鐘舵�佺偣鍑讳簨浠� targetView.btnClick.MouseUpEventHandler += (sen, e) => @@ -1503,20 +1392,18 @@ //寤舵椂鐐瑰嚮浜嬩欢 targetView.btnDelay.MouseUpEventHandler += (sen, e) => { - - InpOrOutLogicMethod inpOrOutLogicMethod = new InpOrOutLogicMethod(); - inpOrOutLogicMethod.Delayed(thisView, outputTarget.delay, (value) => - { - outputTarget.delay = value.ToString(); - if (outputTarget.target_type == "1") - { - targetView.btnState.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; - } - else - { - targetView.btnText.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; - } - }); + this.Delayed(thisView, outputTarget.delay, (value) => + { + outputTarget.delay = value.ToString(); + if (outputTarget.target_type == "1") + { + targetView.btnState.Text = this.GetTimeText(outputTarget.delay) + stateStr; + } + else + { + targetView.btnText.Text = this.GetTimeText(outputTarget.delay) + stateStr; + } + }); }; ///鍒犻櫎鎺т欢 @@ -2183,13 +2070,8 @@ break; case SPK.doorgate: { - foreach (var dic in dicList) - { - if (dic["key"] == "user_id") - { - button2.Text = dic["value"]?.ToString(); - } - } + string value = this.GetKeyValue("user_id", dicList); + button2.Text = this.GetFaceItem(value, device.deviceId).userName; } break; } @@ -2214,6 +2096,32 @@ } return valueStr; + } + /// <summary> + /// 鑾峰彇Key鍊� + /// </summary> + /// <param name="dicList">娉ㄦ剰:姘歌繙榛樿绗竴涓厓绱�</param> + /// <returns></returns> + public string GetKey(List<Dictionary<string, string>> dicList) + { + if (dicList.Count == 0) + { + return ""; + } + return dicList[0]["key"].ToString(); + } + /// <summary> + /// 鑾峰彇value鍊� + /// </summary> + /// <param name="dicList">娉ㄦ剰:姘歌繙榛樿绗竴涓厓绱�</param> + /// <returns></returns> + public string GetValue(List<Dictionary<string, string>> dicList) + { + if (dicList.Count == 0) + { + return ""; + } + return dicList[0]["value"].ToString(); } /// <summary> ///鑾峰彇鑷姩鍖栧悕绉� @@ -2277,19 +2185,12 @@ case SPK.AirSwitch: case SPK.LightSwitch: {//寮�鍏崇伅 - - foreach (var dic in dicList) + string value = this.GetValue(dicList); + stateStr = Language.StringByID(StringId.offLogic); + if (value == "on") { - string value = dic["value"]; - if (value == "on") - { - stateStr = Language.StringByID(StringId.onLogic); + stateStr = Language.StringByID(StringId.onLogic); - } - else - { - stateStr = Language.StringByID(StringId.offLogic); - } } } break; @@ -2351,18 +2252,12 @@ case SPK.FloorHeatStandard: case SPK.HvacFloorHeat: { - foreach (var dic in dicList) + string value = this.GetValue(dicList); + stateStr = Language.StringByID(StringId.offLogic); + if (value == "on") { - string value = dic["value"]; - if (value == "on") - { - stateStr = Language.StringByID(StringId.onLogic); + stateStr = Language.StringByID(StringId.onLogic); - } - else if (value == "off") - { - stateStr = Language.StringByID(StringId.offLogic); - } } } @@ -2567,7 +2462,6 @@ private void SensorView(FrameLayout thisView, Function device, string key, int indexVulae) { //杩欎釜璁惧姣旇緝鐗规畩 - ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList(); ///褰撳墠鐨勭储寮曞�兼暟鎹璞� Input inputedit = Logic.currlogic.input[indexVulae]; ///鐘舵�佸�� @@ -2590,7 +2484,7 @@ { titleInt = StringId.wendudiyu; } - conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.InputBoxAction(device, titleInt, indexVulae, true, stateValue); } break; case "humidity": @@ -2604,27 +2498,27 @@ { titleInt = StringId.shidudiyu; } - conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.InputBoxAction(device, titleInt, indexVulae, true, stateValue); } break; case "co2": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue); } break; case "pm25": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); } break; case "tvoc": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); } break; case "hcho": { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue); + ConditionDeviceFunList.Current.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue); } break; } @@ -2634,8 +2528,8 @@ /// 鏌ユ壘鎸囧畾userId /// </summary> /// <param name="userId"></param> - /// <returns></returns> - public Face FaceItem(string userId, string deviceId) + /// <returns></returns> + public Face GetFaceItem(string userId, string deviceId) { if (Send.Current.faceList.Count == 0) { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index e1a5520..ab8885b 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -187,7 +187,7 @@ var list2 = this.GetVideoDeviceList(); list.AddRange(list1); list.AddRange(list2); - //GetTestDevice(ref list, true); + GetTestDevice(ref list, true); return list; } /// <summary> @@ -1095,9 +1095,14 @@ { //妯℃嫙璁惧 var functions = new List<Function> { - new Entity.Function { sid = "1234567890", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic }, - new Entity.Function { sid = "1234567891", name = "娓╁害浼犳劅鍣�", spk = Entity.SPK.SensorTemperature }, - new Entity.Function { sid = "1234567892", name = "婀垮害浼犳劅鍣�", spk = Entity.SPK.SensorHumidity }, + //new Entity.Function { sid = "1234567890", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic }, + // new Entity.Function { sid = "1234567891", name = "娓╁害浼犳劅鍣�", spk = Entity.SPK.SensorTemperature }, + // new Entity.Function { sid = "1234567892", name = "婀垮害浼犳劅鍣�", spk = Entity.SPK.SensorHumidity }, + // new Entity.Function { sid = "1234567893", name = "绾㈠瀵瑰皠浼犳劅鍣�", spk = Entity.SPK.SensorDuiShe }, + // new Entity.Function { sid = "1234567895", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic }, + new Entity.Function { sid = "1234567896", name = "姣背娉紶鎰熷櫒", spk = Entity.SPK.SenesorMegahealth }, + new Entity.Function { sid = "1234567897", name = "姣背娉紶鎰熷櫒1", spk = Entity.SPK.SenesorMegahealth2 }, + new Entity.Function { sid = "1234567899", name = "闂ㄧ浼犳劅鍣�", spk = Entity.SPK.SensorDoorWindow }, }; foreach (var function in functions) { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs index 1a14583..57848d1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs @@ -67,13 +67,12 @@ logicView.btnSwitchIcon.IsSelected = false; currLogic.enable = "false"; } - //Send.switchLogic(currLogic); new System.Threading.Thread(() => { try { //閫昏緫浣胯兘鐨勫懡浠� - Send.Current.SwitchLogic(currLogic); + Send.Current.EnableLogic(currLogic); } catch { } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs index 0e4c022..0c1a78e 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs @@ -378,7 +378,7 @@ /// <param name="logic">褰撳墠瀵硅薄</param> /// <param name="isTip">鏄惁瑕佹彁绀�</param> /// <returns></returns> - public ResponsePackNew SwitchLogic(Logic logic,bool isTip=false) + public ResponsePackNew EnableLogic(Logic logic,bool isTip=false) { var jArray = new JArray { }; var job = new JObject { { "userLogicId", logic.userLogicId }, { "enable", logic.enable } }; @@ -389,14 +389,14 @@ if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) { RefreshToken(); - SwitchLogic(logic, isTip); + EnableLogic(logic, isTip); } if (Check(responsePackNew, isTip) == false) { return null; } return responsePackNew; - } + } /// <summary> /// 鑷姩鍖栧湴鐞嗗洿鏍忕姸鎬佷笂鎶� /// </summary> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index 8ca2a76..064e64e 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -522,7 +522,7 @@ { //HDL_ON.DriverLayer.Control.Ins.GetMusicDirectory(device); //var palyListName = Music.SendMethod.mMethod.GetListName(device); - var palyList= Music.SendMethod.mMethod.GetListMusic(device, "hdl_special"); + var palyList= Music.SendMethod.Current.GetListMusic(device, "hdl_special"); List<string> musicNameList = new List<string>(); for (int i = 0; i < palyList.songs.Count; i++) { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs index 2982d04..075ace3 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs @@ -37,7 +37,7 @@ { try { - SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic); + SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic); } catch { } finally diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs index a3aa12c..0ecebe6 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs @@ -158,7 +158,7 @@ { if (A31MusicModel.Current.palyLists.Count == 0) { - SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic); + SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic); } } @@ -189,7 +189,7 @@ { try { - SendMethod.mMethod.EditDeviceName(A31MusicModel.Current.functionMusic.deviceId,playerName); + SendMethod.Current.EditDeviceName(A31MusicModel.Current.functionMusic.deviceId,playerName); } catch { } @@ -242,8 +242,8 @@ { //HDL_ON.DriverLayer.Control.Ins.GetMusicDirectory(device); - var palyListName = Music.SendMethod.mMethod.GetListName(A31MusicModel.Current.functionMusic); - var palyList = Music.SendMethod.mMethod.GetListMusic(A31MusicModel.Current.functionMusic, "hdl_special"); + var palyListName = Music.SendMethod.Current.GetListName(A31MusicModel.Current.functionMusic); + var palyList = Music.SendMethod.Current.GetListMusic(A31MusicModel.Current.functionMusic, "hdl_special"); List<string> musicNameList = new List<string>(); for (int i = 0; i < palyList.songs.Count; i++) { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs index 71d6531..a74585d 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs @@ -145,7 +145,7 @@ Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.mode, modeValueString); //鍙戦�佹帶鍒舵寚浠� - SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); + SendMethod.Current.SendControlCommand(A31MusicModel.Current.functionMusic, dic); }; ///娣诲姞鍠滅埍鐐瑰嚮浜嬩欢; playView.loveBtn.MouseUpEventHandler += (sender, e) => @@ -192,7 +192,7 @@ A31MusicModel.Current.palyLists.Clear(); if (A31MusicModel.Current.palyLists.Count == 0) { - SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic); + SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic); } } @@ -249,7 +249,7 @@ A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.volume, startVolume); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.volume, startVolume.ToString()); - SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); + SendMethod.Current.SendControlCommand(A31MusicModel.Current.functionMusic, dic); } }; @@ -263,7 +263,7 @@ A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.down); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.song_step, ValueProperty.up); - SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); + SendMethod.Current.SendControlCommand(A31MusicModel.Current.functionMusic, dic); }; playView.prevBtn.MouseUpEventHandler += (sender, e) => @@ -288,7 +288,7 @@ A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.on_off, status); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.on_off, status); - SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); + SendMethod.Current.SendControlCommand(A31MusicModel.Current.functionMusic, dic); }; ///涓嬩竴鏇茬偣鍑讳簨浠� playView.nextBtn.MouseDownEventHandler += (sender, e) => @@ -297,7 +297,7 @@ A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.down); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.song_step, ValueProperty.down); - SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); + SendMethod.Current.SendControlCommand(A31MusicModel.Current.functionMusic, dic); }; playView.nextBtn.MouseUpEventHandler += (sender, e) => { @@ -614,7 +614,7 @@ if (A31MusicModel.Current.palyLists.Count == 0) { //鑾峰彇姝屾洸鍒楄〃 - SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic); + SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic); } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31SongPlay.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31SongPlay.cs index 1ec1ba3..f036a0b 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31SongPlay.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31SongPlay.cs @@ -78,7 +78,7 @@ Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("song_name", songView.songBtn.Text); dic.Add("playlist_name", listName); - SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); + SendMethod.Current.SendControlCommand(A31MusicModel.Current.functionMusic, dic); }); }); }; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs index cd2c148..44bf12c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs @@ -10,16 +10,16 @@ { public class MusicMain : FrameLayout { - private static MusicMain m_MusicMain = null; - public static MusicMain mMusicMain + private static MusicMain s_Current = null; + public static MusicMain Current { get { - if (m_MusicMain == null) + if (s_Current == null) { - m_MusicMain = new MusicMain(); + s_Current = new MusicMain(); } - return m_MusicMain; + return s_Current; } } @@ -36,7 +36,7 @@ public override void RemoveFromParent() { base.RemoveFromParent(); - clearA31Threads(); + ClearA31Threads(); //杩涙潵娌℃湁闊充箰琚敹钘忚繃锛岄��鍑烘湁闊充箰琚敹钘忚繃 //A31MusicModel.ReadMusicStates(); } @@ -47,7 +47,7 @@ /// <summary> /// 绉婚櫎绾跨▼ /// </summary> - static void clearA31Threads() + static void ClearA31Threads() { var threads = threadLists.FindAll((obj) => { return obj.Name == "A31"; }); @@ -119,10 +119,10 @@ { verticalRefresh.RemoveAll(); A31MusicModel.A31MusicModelList.Clear(); - var musicListFunction = FunctionList.List.GetMusicList(); - for (int i = 0; i < musicListFunction.Count; i++) + var musicDeviceList= FunctionList.List.GetMusicList(); + for (int i = 0; i < musicDeviceList.Count; i++) { - var function = musicListFunction[i]; + var function = musicDeviceList[i]; var music = A31MusicModel.A31MusicModelList.Find((obj) => (obj.functionMusic.deviceId == function.deviceId && function.spk == SPK.MusicStandard) || ( obj.functionMusic.deviceId == function.deviceId && function.spk == SPK.AvMusic) @@ -168,7 +168,7 @@ try { - SendMethod.mMethod.RefreshDeviceStatus(new List<string> { a31player.functionMusic.deviceId }); + SendMethod.Current.RefreshDeviceStatus(new List<string> { a31player.functionMusic.deviceId }); System.Threading.Thread.Sleep(500); } catch { } @@ -233,7 +233,7 @@ player.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.up); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.song_step, ValueProperty.up); - SendMethod.mMethod.SendControlCommand(player.functionMusic, dic); + SendMethod.Current.SendControlCommand(player.functionMusic, dic); }; musicView.prevBtn.MouseUpEventHandler += (sender, e) => { @@ -256,7 +256,7 @@ player.functionMusic.SetAttrState(KeyProperty.on_off, status); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.on_off, status); - SendMethod.mMethod.SendControlCommand(player.functionMusic, dic); + SendMethod.Current.SendControlCommand(player.functionMusic, dic); }; ///涓嬩竴鏇茬偣鍑讳簨浠� musicView.nextBtn.MouseDownEventHandler += (sender, e) => @@ -265,7 +265,7 @@ player.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.down); Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add(KeyProperty.song_step, ValueProperty.down); - SendMethod.mMethod.SendControlCommand(player.functionMusic, dic); + SendMethod.Current.SendControlCommand(player.functionMusic, dic); }; musicView.nextBtn.MouseUpEventHandler += (sender, e) => { @@ -282,7 +282,7 @@ continue; } //SendMethod.ReadStatus(player); - SendMethod.mMethod.GetDeviceStatus(ref player, new List<string> { player.functionMusic.deviceId }, player.functionMusic.sid); + SendMethod.Current.GetDeviceStatus(ref player, new List<string> { player.functionMusic.deviceId }, player.functionMusic.sid); System.Threading.Thread.Sleep(1000); Application.RunOnMainThread(() => { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs index 0372c54..d37b603 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs @@ -12,16 +12,16 @@ { public class SendMethod { - private static SendMethod sMethod = null; - public static SendMethod mMethod + private static SendMethod s_Current= null; + public static SendMethod Current { get { - if (sMethod == null) + if (s_Current == null) { - sMethod = new SendMethod(); + s_Current = new SendMethod(); } - return sMethod; + return s_Current; } } -- Gitblit v1.8.0