From ea0b1e8e5f43c5fd0a7d479e25ede3b8cbea464a Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期一, 02 十二月 2024 17:17:19 +0800 Subject: [PATCH] tcp;可视对讲; --- HDL_ON/Entity/Function/Function.cs | 128 +++++++++++++++++++++++++++++++++++------- 1 files changed, 105 insertions(+), 23 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index e641e19..edcda72 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -146,20 +146,34 @@ /// <summary> /// 璁剧疆灞炴�х姸鎬� /// </summary> - /// <param name="key"></param> - /// <param name="value"></param> + /// <param name="setKey"></param> + /// <param name="setValues"></param> /// <returns>淇敼缁撴灉</returns> - public bool SetAttrState(string key, object value) + public bool SetAttrState(string setKey, object setValues) { - var attr = attributes.Find((s) => s.key == key); + var attr = attributes.Find((s) => s.key == setKey); if (attr == null) { + switch (setKey) + { + case FunctionAttributeKey.CoolTemperatrue: + case FunctionAttributeKey.HeatTemperatrue: + case FunctionAttributeKey.AutoTemperatrue: + case FunctionAttributeKey.DehumiTemperatrue: + attributes.Add(new FunctionAttributes() + { + key = setKey, + state = setValues.ToString(), + curValue = setValues.ToString(), + }); + return true; + } return false; } else { - attr.state = value.ToString(); - attr.curValue = value.ToString(); + attr.state = setValues.ToString(); + attr.curValue = setValues.ToString(); } return true; } @@ -200,12 +214,14 @@ iconPath = "airFreshjinmao"; break; case SPK.HvacAC: + case SPK.HvacAcPanel: iconPath = "acstandard"; break; case SPK.HvacFan: iconPath = "electricalfan"; break; case SPK.HvacFloorHeat: + case SPK.HvacFloorHeatPanel: iconPath = "floorHeatstandard"; break; case SPK.ElectricTuyaFan2: @@ -249,7 +265,6 @@ [Newtonsoft.Json.JsonIgnore] public Dictionary<string, byte> Fh_Mode_Temp = new Dictionary<string, byte>(); #endregion - #region base info public string sid = "0301011234567801012301230123"; @@ -297,6 +312,11 @@ /// 璁惧spk /// </summary> public string spk = ""; + /// <summary> + /// 鎵╁睍淇℃伅 + /// 瀛楃涓� + /// </summary> + public string extend = ""; private string _SpkCategory = string.Empty; /// <summary> @@ -524,10 +544,6 @@ #endregion - - //public void - - /// <summary> /// 寤舵椂 /// </summary> @@ -667,22 +683,18 @@ result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code; } } - //鎻愮ず閿欒 if (result != StateCode.SUCCESS) { Application.RunOnMainThread(() => { - collect = !collect; IMessageCommon.Current.ShowErrorInfoAlter(result); }); } - else + Application.RunOnMainThread(() => { - Application.RunOnMainThread(() => - { - UI.HomePage.RefreshFunctionView(); - }); - } + this.SaveFunctionFile(); + UI.HomePage.RefreshFunctionView(); + }); }) { IsBackground = true }.Start(); } @@ -1295,7 +1307,45 @@ /// </summary> public static class FunctionAttributeKey { + #region 绌鸿皟bus灞炴�� + /// <summary> + /// 鍒跺喎妯″紡娓╁害 + /// </summary> + public const string CoolTemperatrue = "CoolTemperatrue"; + /// <summary> + /// 鍒剁儹妯″紡娓╁害 + /// </summary> + public const string HeatTemperatrue = "HeatTemperatrue"; + /// <summary> + /// 鑷姩妯″紡娓╁害 + /// </summary> + public const string AutoTemperatrue = "AutoTemperatrue"; + /// <summary> + /// 闄ゆ箍妯″紡娓╁害 + /// </summary> + public const string DehumiTemperatrue = "DehumiTemperatrue"; + #endregion + + #region 绌鸿皟bus灞炴�� + /// <summary> + /// [4]鏅�氾細璁剧疆娓╁害(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// </summary> + public const string NormalTemperatrue = "NormalTemperatrue"; + /// <summary> + /// [5]鐧藉ぉ锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// </summary> + public const string DayTemperatrue = "DayTemperatrue"; + /// <summary> + /// [6]澶滄櫄锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// </summary> + public const string NightTemperatrue = "NightTemperatrue"; + /// <summary> + /// [7]绂诲紑锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// </summary> + public const string AwayTemperatrue = "AwayTemperatrue"; #region 涓夌浉绌哄紑灞炴�� + + /// <summary> /// A鐩稿姛鐜� /// </summary> @@ -1365,6 +1415,7 @@ /// </summary> public const string ElectricityC = "electricity_c"; + #endregion #endregion @@ -1738,6 +1789,20 @@ public static class SPK { /// <summary> + /// 鏈煡SPK + /// (鑷畾涔�) + /// </summary> + public const string NULL = "NULL"; + /// <summary> + /// 鐢垫 + /// </summary> + public const string Elevator = "Elevator"; + /// <summary> + /// 瑗垮ⅷ鍙瀵硅闂ㄥ彛鏈� + /// (鑷畾涔�) + /// </summary> + public const string LinphoneXiMo = "door.gate"; + /// <summary> /// 缇ゆ帶锛堣嚜瀹氫箟锛� /// </summary> public const string GroupControl = "groupControl"; @@ -1767,6 +1832,16 @@ /// 瀛愭帶 /// </summary> public const string AcstSub = "acst.sub"; + /// <summary> + /// 鐑按鍣� + /// 閲戣寕 + /// </summary> + public const string WaterHeaterJinmao = "electrical.water_heater.jinmao"; + /// <summary> + /// 閫嗗彉鍣�/鏂拌兘婧� + /// 閲戣寕 + /// </summary> + public const string InverterJinmao = "energy.inverter.jinmao"; /// <summary> /// 闂ㄩ攣 @@ -1793,7 +1868,7 @@ /// <summary> /// 鐚溂(鏂皊pk 鏆傛椂娌$敤) /// </summary> - public const string PeepholeEz = "security.peephole.ez"; + //public const string PeepholeEz = "security.peephole.ez"; /// <summary> /// 钀ょ煶瑙嗛闂ㄩ攣 /// </summary> @@ -1840,8 +1915,6 @@ { var list = new List<string>(); list.Add(Ev_Ipcam); - list.Add(Peephole); - list.Add(PeepholeEz); return list; } @@ -1935,6 +2008,10 @@ /// </summary> public const string HvacAC = "hvac.ac"; /// <summary> + /// 闈㈡澘绌鸿皟 + /// </summary> + public const string HvacAcPanel = "hvac.ac_panel"; + /// <summary> /// 姣涚粏绠$┖璋� /// </summaryc public const string HvacCac = "hvac.cac"; @@ -1948,6 +2025,7 @@ var spkList = new List<string>(); spkList.Add(AcStandard); spkList.Add(HvacAC); + spkList.Add(HvacAcPanel); spkList.Add(AcIr); spkList.Add(HvacCac); return spkList; @@ -1963,6 +2041,10 @@ /// 鍦版殩 /// </summary> public const string HvacFloorHeat = "hvac.floorHeat"; + /// <summary> + /// 闈㈡澘鍦版殩 + /// </summary> + public const string HvacFloorHeatPanel = "hvac.floorHeat_panel"; /// <summary> /// 鍦扮儹spk鍒楄〃 @@ -1972,7 +2054,7 @@ { var spkList = new List<string>(); spkList.Add(FloorHeatStandard); - spkList.Add(HvacFloorHeat); + spkList.Add(HvacFloorHeat); spkList.Add(HvacFloorHeatPanel); return spkList; } #endregion -- Gitblit v1.8.0