From f4c86f68b900bd506ef7214b2ae9bd23a9d2ffa8 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期六, 19 十二月 2020 17:48:11 +0800
Subject: [PATCH] 完成筛选房间的功能
---
HDL_ON/Entity/Function/Function.cs | 92 ++++++++++++++++++++++------------------------
1 files changed, 44 insertions(+), 48 deletions(-)
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 0fb021f..73b521e 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -119,7 +119,7 @@
/// bus鍗忚鏁版嵁鏍煎紡
/// 浣跨敤A鍗忚鎺у埗鏃讹紝鏀瑰睘鎬т负绌�
/// </summary>
- public BusData bus_Data;
+ public BusData bus;
/// <summary>
/// 鏄惁鏀惰棌
/// </summary>
@@ -149,37 +149,6 @@
/// </summary>
public int delay = 0;
/// <summary>
- /// 寤舵椂鏄剧ず鐨勬枃鏈�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public string delayText
- {
- get
- {
- string text = "";
- switch (delay)
- {
- case 0:
- text = Language.StringByID(StringId.NoDelay);
- break;
- case 30:
- text = "30s";
- break;
- case 60:
- text = "1min";
- break;
- case 120:
- text = "2min";
- break;
- case 300:
- text = "5min";
- break;
- }
- return text;
- }
- }
-
- /// <summary>
/// 鏈�鍚庢帶鍒剁殑涓�娆$姸鎬�
/// </summary>
[Newtonsoft.Json.JsonIgnore]
@@ -204,8 +173,8 @@
max = 1,
min = 0,
};
+ _trait_on_off.curValue = "on";
}
- _trait_on_off.curValue = "on";
}
return _trait_on_off;
}
@@ -222,7 +191,8 @@
/// <summary>
/// 浣跨敤棰戠巼
/// </summary>
- public double usageFrequency {
+ public double usageFrequency
+ {
get
{
return usageCount / 7;
@@ -236,9 +206,9 @@
public string GetBusId()
{
string busId = "";
- if (bus_Data != null)
+ if (bus != null)
{
- busId = bus_Data.SubnetID + "_" + bus_Data.DeviceID + "_" + bus_Data.loopId;
+ busId = bus.SubnetID + "_" + bus.DeviceID + "_" + bus.LoopId;
}
return busId;
}
@@ -305,7 +275,7 @@
Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
}
}
-
+
/// <summary>
/// 杞崲鎴愬満鏅姛鑳藉璞�
@@ -316,9 +286,22 @@
var sFunc = new SceneFunction();
foreach (var attr in attributes)
{
- sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() });
- sFunc.sid = this.sid;
+ if (attr.curValue.ToString() == "{}")
+ {
+ attr.curValue = "0";
+ }
+ if (attr.key == FunctionAttributeKey.SetTemp)
+ {
+ double vv = 16;
+ Double.TryParse(attr.curValue.ToString(),out vv);
+ sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = Convert.ToInt32(vv).ToString() });
+ }
+ else
+ {
+ sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() });
+ }
}
+ sFunc.sid = this.sid;
return sFunc;
}
@@ -339,9 +322,9 @@
var acd = new AlinkControlData();
acd.sid = sid;
- var aca = new AlinkControlAttributes();
foreach (var dic in commandDictionary)
{
+ var aca = new AlinkControlAttributes();
aca.key = dic.Key;
aca.value = dic.Value;
acd.status.Add(aca);
@@ -442,6 +425,7 @@
/// 鍔熻兘灞炴��
/// 灞炴�у瓧娈佃В鏋愶細attri :灞炴�у唴瀹癸紝value 灞炴�х殑鍊硷紝max 鏈�澶у�� min 鏈�灏忓��
/// </summary>
+ [System.Serializable]
public class FunctionAttributes
{
/// <summary>
@@ -455,11 +439,11 @@
/// <summary>
/// 鏈�澶у��
/// </summary>
- public int max=100;
+ public int max = 100;
/// <summary>
/// 鏈�灏忓��
/// </summary>
- public int min=0;
+ public int min = 0;
/// <summary>
/// 鏁版嵁绫诲瀷
/// </summary>
@@ -486,7 +470,11 @@
/// <summary>
/// 棰滆壊
/// </summary>
- public const string Color = "color";
+ public const string RGB = "rgb";
+ /// <summary>
+ /// 娓愬彉鏃堕棿
+ /// </summary>
+ public const string FadeTime = "fade_time";
/// <summary>
/// 妯″紡
/// </summary>
@@ -551,7 +539,15 @@
return Convert.ToByte(addresses.Substring(2, 2), 16);
}
}
- public byte loopId;
+ public byte LoopId
+ {
+ get
+ {
+ return Convert.ToByte(loopId, 16);
+ }
+ }
+
+ public string loopId;
}
public static class SPK
@@ -647,15 +643,15 @@
/// <summary>
/// 瀹剁數銆佹彃搴�
/// </summary>
- public const string ElectricSocket = "electric.socket ";
+ public const string ElectricSocket = "electrical.socket";
/// <summary>
/// 瀹剁數銆佺數瑙�
/// </summary>
- public const string ElectricTV = "electric.tv";
+ public const string ElectricTV = "electrical.tv";
/// <summary>
/// 瀹剁數銆侀鎵�
/// </summary>
- public const string ElectricFan = "electric.fan";
+ public const string ElectricFan = "electrical.fan";
}
-}
+}
\ No newline at end of file
--
Gitblit v1.8.0