From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/MutilfunctionPanelMethod.cs | 90 +++++++++++++++++++++++++++++++++++++-------- 1 files changed, 74 insertions(+), 16 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/MutilfunctionPanelMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/MutilfunctionPanelMethod.cs index 7e5db3d..288b3c3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/MutilfunctionPanelMethod.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/MutilfunctionPanelMethod.cs @@ -11,7 +11,9 @@ namespace Shared.Phone.UserCenter.Device.Bind { /// <summary> - /// /鍙娇鐢ㄤ簬绠�绾﹀鍔熻兘闈㈡澘鐨勬柟娉� + /// 鍙娇鐢ㄤ簬绠�绾﹀鍔熻兘闈㈡澘鐨勬柟娉� + /// 銆愪竴涓寜閿彧鑳戒竴涓洰鏍囷紝涓�瀵逛竴缁戝畾銆備絾鏄鍔熻兘闈㈡澘60鎸夐敭锛屾渶澶氱粦瀹�60涓洰鏍囥�� + /// 缁戝畾涓暟 鏈�澶�20涓満鏅紙鎸夐敭31锝�52锛� 鏈�澶�10涓紑鍏筹紙鎸夐敭52锝�61锛� 鏈�澶�10涓彃搴э紙鎸夐敭52锝�61锛� 鏈�澶�17涓伅鍏夛紙鎸夐敭52锝�61鎴栬��22锝�28锛� 鏈�澶�8涓伄闃筹紙鎸夐敭14锝�21锛� 鏈�澶�3涓┖璋冿紙鎸夐敭2锝�4锛� 鏈�澶�1涓柊椋庯紙鎸夐敭13锛�</param> /// </summary> public class MutilfunctionPanelMethod { @@ -21,29 +23,25 @@ /// </summary> public static int curSwitchCount = 0; /// <summary> - /// 鎻掑骇鐨勪釜鏁奥� + /// 鎻掑骇鐨勪釜鏁奥燵姣忔杩涘叆鍒板鍔熻兘缁戝畾鐣岄潰锛岄兘瑕佽閲嶆柊鍙栧�糫 /// </summary> public static int curSocketCount = 0; /// <summary> - /// 鐏厜涓暟聽[浠庣户鐢靛櫒涓垎閰嶇殑鍔熻兘绫诲瀷鏄伅鍏塢 + /// 鐏厜涓暟聽[浠庣户鐢靛櫒涓垎閰嶇殑鍔熻兘绫诲瀷鏄伅鍏塢[姣忔杩涘叆鍒板鍔熻兘缁戝畾鐣岄潰锛岄兘瑕佽閲嶆柊鍙栧�糫 /// </summary> public static int curLightFromRelayCount = 0; /// <summary> - /// 璋冨厜涓暟聽 + /// 璋冨厜涓暟聽[姣忔杩涘叆鍒板鍔熻兘缁戝畾鐣岄潰锛岄兘瑕佽閲嶆柊鍙栧�糫 /// </summary> public static int curLightCount = 0; - /// <summary> - /// 澶氬姛鑳介潰鏉夸腑琚粦瀹氱殑鐩爣 - /// </summary> - public static System.Collections.Generic.Dictionary<string, List<BindListAllInfo>> bindTargetsFromMutilfunctionPanelList = new System.Collections.Generic.Dictionary<string, List<BindListAllInfo>>(); #endregion /// <summary> /// 鑾峰彇闈㈡澘宸茬粡缁戝畾鐨勫尮閰嶇被鍨嬬殑鍒楄〃 - /// <param name="curBindType">褰撳墠绫诲瀷 0:鍦烘櫙 1:寮�鍏� 2:鎻掑骇 3:鐏厜 4:閬槼 5:绌鸿皟 6:鏂伴</param> + /// <param name="curBindType">褰撳墠绫诲瀷 0:鍦烘櫙 1:寮�鍏� 2:鎻掑骇 3:鐏厜 4:閬槼 5:绌鸿皟 6:鏂伴 </param> /// </summary> /// <returns></returns> - public static List<BindListAllInfo> GetMatchBindList(int curBindType) + public static List<BindListAllInfo> GetMatchBindList(Panel curControlDev, int curBindType) { var tempList = new List<BindListAllInfo>(); int count1 = 0; @@ -63,9 +61,9 @@ break; } - foreach (var key in bindTargetsFromMutilfunctionPanelList.Keys) + foreach (var key in curControlDev.bindTargetsFromMutilfunctionPanelList.Keys) { - var bList = bindTargetsFromMutilfunctionPanelList[key]; + var bList = curControlDev.bindTargetsFromMutilfunctionPanelList[key]; foreach (var bDev in bList) { if (curBindType == 0) @@ -173,6 +171,66 @@ } /// <summary> + /// 璋冨厜鐏拰缁х數鍣ㄧ壒娈婂鐞嗘柟娉� + /// <param name="curBindType">褰撳墠绫诲瀷 0:鍦烘櫙 1:寮�鍏� 2:鎻掑骇 3:鐏厜 4:閬槼 5:绌鸿皟 6:鏂伴</param> + /// </summary> + /// <returns></returns> + public static void UpdateLightCount(Panel curControlDev, int curBindType) + { + + if (curBindType == 1 || curBindType == 2 || curBindType == 3) + { + curSwitchCount = 0; + curSocketCount = 0; + curLightFromRelayCount = 0; + curLightCount = 0; + + foreach (var key in curControlDev.bindTargetsFromMutilfunctionPanelList.Keys) + { + var bList = curControlDev.bindTargetsFromMutilfunctionPanelList[key]; + foreach (var bDev in bList) + { + var device = LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint); + if (device == null) + { + continue; + } + if (bDev.KeyEpoint >= 52 && bDev.KeyEpoint <= 61) + { + if (device != null) + { + if (device.DfunctionType == DeviceFunctionType.A寮�鍏�) + { + curSwitchCount++; + } + else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇) + { + curSocketCount++; + } + else if (device.DfunctionType == DeviceFunctionType.A鐏厜) + { + curLightFromRelayCount++; + } + } + } + + if (bDev.KeyEpoint >= 22 && bDev.KeyEpoint <= 28) + { + if (device != null) + { + if (device.Type == DeviceType.DimmableLight && bDev.BindCluster == 8) + { + curLightCount++; + } + } + } + } + } + } + } + + + /// <summary> /// 鏀寔鍖归厤鐨勭鐐逛釜鏁� /// <param name="curBindType">褰撳墠绫诲瀷 0:鍦烘櫙 1:寮�鍏� 2:鎻掑骇 3:鐏厜 4:閬槼 5:绌鸿皟 6:鏂伴</param> /// </summary> @@ -234,12 +292,12 @@ /// <param name="curBindType">褰撳墠绫诲瀷 0:鍦烘櫙 1:寮�鍏� 2:鎻掑骇 3:鐏厜 4:閬槼 5:绌鸿皟 6:鏂伴</param> /// </summary> /// <returns></returns> - public static List<int> GetMatchEpointList(int curBindType) + public static List<int> GetMatchEpointList(Panel curControlDev, int curBindType) { var tempList = MatchEpointList(curBindType); - foreach (var key in bindTargetsFromMutilfunctionPanelList.Keys) + foreach (var key in curControlDev.bindTargetsFromMutilfunctionPanelList.Keys) { - var bList = bindTargetsFromMutilfunctionPanelList[key]; + var bList = curControlDev.bindTargetsFromMutilfunctionPanelList[key]; foreach (var bDev in bList) { if (curBindType == 0) @@ -505,7 +563,7 @@ /// <returns></returns> public static string MatchTypeBindTextTip(int curBindType, int countDynamic = 0) { - string[] msgArry = Language.StringByID(R.MyInternationalizationString.AddMoreTip).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); + string[] msgArry = Language.StringByID(R.MyInternationalizationString.AddMoreTip).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); var tipText = msgArry[0]; switch (curBindType) -- Gitblit v1.8.0