From 4ad6d53e2a8dc59d99405a053ddc46f49ae7a1b3 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 14 十月 2021 11:55:51 +0800
Subject: [PATCH] 干接点新spk 兼容问题
---
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
index 38805f8..9a624ea 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -285,7 +285,9 @@
deviceId = sensor.deviceId,
roomIds = sensor.roomIds,
attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue }
- ,new FunctionAttributes { key = "spk"} }
+ , new FunctionAttributes {key = "spk",state = seTemp.key,curValue = seTemp.key }
+ //,new FunctionAttributes { key = "spk"}
+ }
};
switch (seTemp.key)
{
@@ -801,6 +803,9 @@
case "tvoc":
newTemp.spk = SPK.SensorTVOC;
break;
+ case "hcho":
+ newTemp.spk = SPK.SensorHcho;
+ break;
}
if(!string.IsNullOrEmpty(newTemp.spk))
{
@@ -826,10 +831,36 @@
{
if (btn.Tag != null)
{
+ FunctionAttributes attr = updateTemp.GetAttribute(FunctionAttributeKey.Value);
+ if(attr == null)
+ {
+ switch(updateTemp.spk)
+ {
+ case SPK.SensorCO2:
+ attr = updateTemp.GetAttribute(FunctionAttributeKey.Co2);
+ break;
+ case SPK.SensorTemperature:
+ attr = updateTemp.GetAttribute(FunctionAttributeKey.Temperature);
+ break;
+ case SPK.SensorTVOC:
+ attr = updateTemp.GetAttribute(FunctionAttributeKey.Tvoc);
+ break;
+ case SPK.SensorPm25:
+ attr = updateTemp.GetAttribute(FunctionAttributeKey.Pm25);
+ break;
+ case SPK.SensorHcho:
+ attr = updateTemp.GetAttribute(FunctionAttributeKey.Hcho);
+ break;
+ case SPK.SensorHumidity:
+ attr = updateTemp.GetAttribute(FunctionAttributeKey.Humidity);
+ break;
+ }
+ }
+
var tag = btn.Tag.ToString();
if (tag == "SensorValues")
{
- (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value);
+ (btn as Button).Text = attr.state;// updateTemp.GetAttrState(FunctionAttributeKey.Value);
}
else if (tag == "SensorLevel")
{
--
Gitblit v1.8.0