From 2029e64ec0491f7e511dc15bffaf821bfbabe2de Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 20 七月 2020 14:10:22 +0800
Subject: [PATCH] 上传一个很特别的新版本
---
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 103 +++++++++++++++++++++++----------------------------
1 files changed, 46 insertions(+), 57 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
index 28c511f..920a4ab 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -306,16 +306,16 @@
if (changedFloor == false)
{
//鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎸囧畾鎴块棿鐨勪俊鎭�
- MainPage.ListRoomViewFrom.Instance.RefreshRoomInfo(this.editorRoom);
+ MainPage.LeftListRoomViewFrom.Instance.RefreshRoomInfo(this.editorRoom);
}
else
{
//鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎴块棿鍒楄〃淇℃伅
- MainPage.ListRoomViewFrom.Instance.RefreshListRoom();
+ MainPage.LeftListRoomViewFrom.Instance.RefreshListRoom();
}
//绠椾簡,杩欓噷濡傛灉鎸変笅淇濆瓨,鍒欎富椤甸渶瑕侀噸鏂板埛鏂�
- UserView.UserPage.Instance.RefreshForm = true;
+ UserView.UserPage.Instance.RefreshAllForm = true;
this.CloseForm();
};
@@ -375,6 +375,11 @@
{
listDevice.Add(device);
}
+ //PM2.5鏄俯搴﹀拰婀垮害鍚堝湪鍚屼竴涓鐐�
+ else if (device.Type == ZigBee.Device.DeviceType.PMSensor)
+ {
+ listDevice.Add(device);
+ }
}
var listSelect = new List<string>() { cloneRoom.TemperatrueDevice };
var form = new SelectDeviceForm();
@@ -424,41 +429,22 @@
{
return;
}
-
- foreach (var data in report.DeviceStatusReport.AttriBute)
+ var localDevice = Common.LocalDevice.Current.GetDevice(mainKeys);
+ HdlThreadLogic.Current.RunMain(() =>
{
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
+ if (((ZigBee.Device.TemperatureSensor)localDevice).Temperatrue == 0)
{
- HdlThreadLogic.Current.RunMain(() =>
- {
- if (data.AttriButeData == 0)
- {
- //0鈩�
- btnTemper.Text = "0.0鈩�";
- this.cloneRoom.Temperatrue = 0;
- }
- else if (data.AttriButeData > 32767)
- {
- //璐熸暟(鐗规畩澶勭悊)
- string strValue = (data.AttriButeData - 65536).ToString();
- //灏忔暟鐐归渶瑕佷竴浣�
- strValue = strValue.Substring(0, strValue.Length - 1);
- //璁板綍娓╁害
- this.cloneRoom.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�";
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- //璁板綍娓╁害
- this.cloneRoom.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�";
- }
- });
+ //0鈩�
+ btnTemper.Text = "0.0鈩�";
+ this.cloneRoom.Temperatrue = 0;
}
- }
+ else
+ {
+ //璁板綍娓╁害
+ this.cloneRoom.Temperatrue = ((ZigBee.Device.TemperatureSensor)localDevice).Temperatrue;
+ btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�";
+ }
+ }, ShowErrorMode.NO);
}));
//鍙戦�佽幏鍙栨俯搴︾殑鍛戒护
((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity();
@@ -479,6 +465,16 @@
{
//鑾峰彇婀垮害浼犳劅鍣�
if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 2)
+ {
+ listDevice.Add(device);
+ }
+ //鏂伴
+ else if (device.Type == ZigBee.Device.DeviceType.FreshAirHumiditySensor)
+ {
+ listDevice.Add(device);
+ }
+ //PM2.5鏄俯搴﹀拰婀垮害鍚堝湪鍚屼竴涓鐐�
+ else if (device.Type == ZigBee.Device.DeviceType.PMSensor)
{
listDevice.Add(device);
}
@@ -531,33 +527,26 @@
{
return;
}
- foreach (var data in report.DeviceStatusReport.AttriBute)
+ var localDevice = Common.LocalDevice.Current.GetDevice(mainKeys);
+ HdlThreadLogic.Current.RunMain(() =>
{
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
+ decimal humidity = (decimal)localDevice.GetType().InvokeMember("Humidity", System.Reflection.BindingFlags.GetField, null, localDevice, null);
+ if (humidity == 0)
{
- HdlThreadLogic.Current.RunMain(() =>
- {
- if (data.AttriButeData == 0)
- {
- //0
- btnHumi.Text = "0.0%";
- this.cloneRoom.Humidity = 0;
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- //璁板綍婀垮害
- this.cloneRoom.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- btnHumi.Text = this.cloneRoom.Humidity.ToString() + "%";
- }
- });
+ //0
+ btnHumi.Text = "0.0%";
+ this.cloneRoom.Humidity = 0;
}
- }
+ else
+ {
+ //璁板綍婀垮害
+ this.cloneRoom.Humidity = humidity;
+ btnHumi.Text = this.cloneRoom.Humidity.ToString() + "%";
+ }
+ }, ShowErrorMode.NO);
});
//鍙戦�佽幏鍙栨箍搴︾殑鍛戒护
- ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity();
+ device.GetType().InvokeMember("ReadTemperatureOrHumidity", System.Reflection.BindingFlags.InvokeMethod, null, device, null);
}
#endregion
--
Gitblit v1.8.0