From 34b65350abbb8b740b9c3bc0b43254cbbe23fcb5 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期二, 19 五月 2020 09:31:44 +0800 Subject: [PATCH] 合并代码,更改面板目标信息 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 77 ++++++++++++++++++++++++++++++++------ 1 files changed, 64 insertions(+), 13 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs index 89e7821..9ac7b9a 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs @@ -154,21 +154,21 @@ } return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%"; } - else if (device.Type == DeviceType.FreshAir) - { - //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 + else if (device.Type == DeviceType.FreshAir) + { + //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 if (device.HadReadDeviceStatu == false) { return Language.StringByID(R.MyInternationalizationString.uOffLine); - } - - //妯″紡 - string wind = string.Empty; - var freshAir = device as FreshAir; - if (freshAir.currentFanStatus == 0) - { - return Language.StringByID(R.MyInternationalizationString.Close); - } + } + + //妯″紡 + string wind = string.Empty; + var freshAir = device as FreshAir; + if (freshAir.currentFanStatus == 0) + { + return Language.StringByID(R.MyInternationalizationString.Close); + } if (freshAir.currentFanSpeed == 1) { wind = Language.StringByID(R.MyInternationalizationString.Fan_Low); @@ -180,8 +180,59 @@ else if (freshAir.currentFanSpeed == 3) { wind = Language.StringByID(R.MyInternationalizationString.Fan_Height); + } + return $"{wind}"; + } + else if (device.Type == DeviceType.PMSensor) + { + //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 + if (device.HadReadDeviceStatu == false) + { + return Language.StringByID(R.MyInternationalizationString.uOffLine); } - return $"{wind}"; + //绌烘皵璐ㄩ噺 + string curQuality = ""; + //娓╁害 + string temperature = string.Empty; + //婀垮害 + string humidity = string.Empty; + //PM2.5 + string pm = string.Empty; + var pMSensor = device as PMSensor; + if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else if (pMSensor.currentPmData > 250) + { + curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + } + else + { + curQuality = "--"; + } + + humidity = $"{pMSensor.currentHumidity}%"; + temperature = $"{pMSensor.currentTemperature}鈩�"; + pm = $"{pMSensor.currentPmData}渭g/m鲁"; + return $"{curQuality},{pm},{temperature},{humidity}"; + } else if (device.Type == DeviceType.Thermostat) { -- Gitblit v1.8.0