From 99da2604f81af29afc6b3c6f4f128b4e5a8a5649 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期三, 13 五月 2020 12:00:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into dev-2020xm --- ZigbeeApp/Shared/Common/Device.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 46 insertions(+), 12 deletions(-) diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs index 53787a6..85962cc 100644 --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -271,7 +271,7 @@ //娣诲姞缂撳瓨 this.AddDeviceToMemory(ref device); - //绉婚櫎瀛樺湪鐨勮澶囧唴瀛� + //绉婚櫎瀛樺湪鐨勮澶囧唴瀛� string maikey = this.GetDeviceMainKeys(device); if (dicExist.ContainsKey(maikey) == true) { @@ -441,6 +441,8 @@ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { + //淇敼璁惧鍚嶅瓧鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + Phone.UserView.UserPage.Instance.RefreshForm = true; return true; } @@ -465,6 +467,8 @@ //澶囦唤鏁版嵁 await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.A绔偣鍚嶇О, newName); } + //淇敼璁惧鍚嶅瓧鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + Phone.UserView.UserPage.Instance.RefreshForm = true; return true; } @@ -1327,7 +1331,7 @@ } /// <summary> - /// 璁剧疆銆愯澶囩被鍨嬨�戠殑鍥炬爣鍒版寚瀹氱殑鎺т欢 + /// 璁剧疆銆愯澶囩被鍨嬨�戠殑鍥炬爣鍒版寚瀹氱殑鎺т欢(姝ゆ柟娉曚笉鑳界敤鍦ㄨ澶囧姛鑳界被鍨嬭彍鍗曠殑鍥炬爣) /// </summary> /// <param name="btnIcon">鎺т欢瀵硅薄</param> /// <param name="listdevice">璁惧瀵硅薄</param> @@ -1349,7 +1353,7 @@ } /// <summary> - /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 + /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣(姝ゆ柟娉曚笉鑳界敤鍦ㄨ澶囧姛鑳界被鍨嬭彍鍗曠殑鍥炬爣) /// </summary> /// <param name="listdevice">璁惧瀵硅薄</param> /// <param name="unSelectPath">鍥剧墖鍦板潃</param> @@ -1365,13 +1369,42 @@ } /// <summary> - /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 + /// 鑾峰彇銆愯澶囧姛鑳界被鍨嬨�戠殑鑿滃崟鍥炬爣 /// </summary> /// <param name="specificType">鑷畾涔夎澶囩被鍨�</param> /// <param name="unSelectPath">鍥剧墖鍦板潃</param> /// <param name="selectPath">鍥剧墖鍦板潃</param> /// <returns></returns> - public void GetDeviceObjectIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath) + public void GetDeviceFunctionTypeMenuIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath) + { + //鏂伴灏忔ā鍧� + if (specificType == DeviceConcreteType.Relay_FangyueFreshAirModul) + { + unSelectPath = "Device/FreshAirEpoint.png"; + selectPath = "Device/FreshAirEpointSelected.png"; + return; + } + //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + else if (specificType == DeviceConcreteType.Sensor_PMTwoPointFive) + { + unSelectPath = "Device/AirQualitySensorEpoint.png"; + selectPath = "Device/AirQualitySensorEpointSelected.png"; + return; + } + //涓婇潰闇�瑕佺壒娈婂鐞� + + //鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 + this.GetDeviceObjectIcon(specificType, ref unSelectPath, ref selectPath); + } + + /// <summary> + /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 2020.05.13:娆″嚱鏁颁笉鍐嶅叕寮� + /// </summary> + /// <param name="specificType">鑷畾涔夎澶囩被鍨�</param> + /// <param name="unSelectPath">鍥剧墖鍦板潃</param> + /// <param name="selectPath">鍥剧墖鍦板潃</param> + /// <returns></returns> + private void GetDeviceObjectIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath) { //灏嗗叿浣撶被鍨嬭浆瀛楃涓� string strSpecific = Enum.GetName(typeof(DeviceConcreteType), specificType); @@ -1408,6 +1441,7 @@ unSelectPath = imageFilePath; selectPath = imageSelectFilePath; } + #endregion @@ -1818,7 +1852,7 @@ else if (dicType.ContainsKey(DeviceType.PMSensor) == true) { info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId1307; - info.BeloneType = DeviceBeloneType.A浼犳劅鍣�; + info.BeloneType = DeviceBeloneType.APM2鐐�5绌烘皵璐ㄩ噺浼犳劅鍣�; info.ConcreteType = DeviceConcreteType.Sensor_PMTwoPointFive; info.ObjectTypeNameId = 60000;//浼犳劅鍣� } @@ -2150,7 +2184,7 @@ /// <returns></returns> public bool CheckDeviceIsOnline(CommonDevice i_device) { - //0:绂荤嚎 1:鍦ㄧ嚎 2:姝e湪鍒锋柊鐘舵�� + //0:绂荤嚎 1:鍦ㄧ嚎 2:姝e湪鍒锋柊鐘舵�� return i_device.IsOnline == 1 || i_device.IsOnline == 2; } @@ -2533,8 +2567,6 @@ mainDevice.InClusterList.AddRange(device.DeviceInfo.InClusterList); mainDevice.OutClusterList.Clear(); mainDevice.OutClusterList.AddRange(device.DeviceInfo.OutClusterList); - mainDevice.AttributeStatus.Clear(); - mainDevice.AttributeStatus.AddRange(device.DeviceInfo.AttributeStatus); //濡傛灉鏄俯搴︿紶鎰熷櫒 if (mainDevice.Type == DeviceType.TemperatureSensor) @@ -2642,11 +2674,9 @@ public void SetNewDeviceMainKeys(CommonDevice device, Newtonsoft.Json.Linq.JObject jobject) { //璁剧疆璁惧涓婚敭绫� - device.Time = jobject.Value<int>("Time"); device.DeviceID = jobject.Value<int>("Device_ID"); device.DeviceAddr = jobject.Value<string>("DeviceAddr"); device.DeviceEpoint = jobject.Value<int>("Epoint"); - device.DataID = jobject.Value<int>("Data_ID"); } #endregion @@ -2731,7 +2761,7 @@ this.dicDeviceModelIdEnum["MGCD01/ZB.10"] = "1306-1200-60000";//鍚搁《鐕冩皵浼犳劅鍣� //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� 銆愯璁惧灞炰簬绗笁鏂硅澶囷紝娌℃湁闀滃儚ID銆� - this.dicDeviceModelIdEnum["SZ_PM100"] = "1307-1200-60000";//PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + this.dicDeviceModelIdEnum["SZ_PM100"] = "1307-1200-60000";//PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� //=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄========= this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3璺户鐢靛櫒灏忔ā鍧� @@ -3079,6 +3109,10 @@ /// </summary> A浼犳劅鍣� = 1200, /// <summary> + /// PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + /// </summary> + APM2鐐�5绌烘皵璐ㄩ噺浼犳劅鍣� = 1307, + /// <summary> /// 缁х數鍣�(2300-2499) /// </summary> A缁х數鍣� = 2300, -- Gitblit v1.8.0