From 5eec2e8c16bdcb163b388de486ee375e891df445 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 25 二月 2021 17:54:15 +0800
Subject: [PATCH] 2021-2-25-1
---
HDL_ON/Entity/Function/Function.cs | 179 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 146 insertions(+), 33 deletions(-)
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 58b7d98..bf517fe 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -1,4 +1,4 @@
-using System;
+锘縰sing System;
using System.Collections.Generic;
using HDL_ON.Common;
using HDL_ON.DAL.Server;
@@ -70,39 +70,82 @@
/// 璁惧spk
/// </summary>
public string spk = "";
- /// <summary>
- /// 鍔熻兘绫诲埆
- /// 濡傦細绌鸿皟绫汇�佺伅鍏夌被銆佺獥甯樼被
- /// </summary>
- public FunctionCategory functionCategory
- {
- get
- {
- try
- {
- var _functionCategoryString = sid.Substring(16, 2);
- var _functionCategory = Convert.ToInt32(_functionCategoryString, 16);
- return (FunctionCategory)Enum.ToObject(typeof(FunctionCategory), _functionCategory);
- }
- catch (Exception ex)
- {
- MainPage.Log($"get FunctionCategory error : {ex.Message}");
- return FunctionCategory.UnKown;
- }
- }
- }
+ ///// <summary>
+ ///// 鍔熻兘绫诲埆
+ ///// 濡傦細绌鸿皟绫汇�佺伅鍏夌被銆佺獥甯樼被
+ ///// </summary>
+ //public FunctionCategory Spk_Prefix
+ //{
+ // get
+ // {
+ // try
+ // {
+ // var _functionCategoryString = sid.Substring(16, 2);
+ // var _functionCategory = Convert.ToInt32(_functionCategoryString, 16);
+ // return (FunctionCategory)Enum.ToObject(typeof(FunctionCategory), _functionCategory);
+ // }
+ // catch (Exception ex)
+ // {
+ // MainPage.Log($"get FunctionCategory error : {ex.Message}");
+ // return FunctionCategory.UnKown;
+ // }
+ // }
+ //}
+
///// <summary>
///// 鍔熻兘绫诲瀷
///// </summary>
- public FunctionType functionType
+ //public FunctionType spk
+ //{
+ // get
+ // {
+ // var _functionTypeString = sid.Substring(16, 4);
+ // return (FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(_functionTypeString, 16));
+ // }
+ //}
+
+ string spk_Prefix;
+ /// <summary>
+ /// spk鍓嶇紑
+ /// 澶х被
+ /// 鍔熻兘绫诲埆
+ /// 濡傦細绌鸿皟绫汇�佺伅鍏夌被銆佺獥甯樼被
+ /// </summary>
+ public string Spk_Prefix
{
get
{
- var _functionTypeString = sid.Substring(16, 4);
- return (FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(_functionTypeString, 16));
-
+ if (string.IsNullOrEmpty(spk_Prefix))
+ {
+ spk_Prefix = spk.Split(".")[0];
+ }
+ return spk_Prefix;
}
}
+ string spk_Suffix;
+ ///// <summary>
+ ///// spk鍚庣紑
+ ///// 灏忕被
+ ///// 鍔熻兘绫诲瀷
+ ///// </summary>
+ //public string spk
+ //{
+ // get
+ // {
+ // if (string.IsNullOrEmpty(spk_Suffix))
+ // {
+ // try
+ // {
+ // spk_Suffix = spk.Split(".")[1];
+ // }
+ // catch
+ // {
+ // spk_Suffix = "";
+ // }
+ // }
+ // return spk_Suffix;
+ // }
+ //}
/// <summary>
/// A鍗忚鍔熻兘鐨勭壒鎬�
@@ -178,16 +221,12 @@
_trait_on_off.curValue = "off";
}
}
- if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off")
+ if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop")
{
_trait_on_off.curValue = "off";
}
return _trait_on_off;
}
- //set
- //{
- // _trait_on_off = value;
- //}
}
/// <summary>
@@ -299,7 +338,7 @@
}
roomNameList += findRoom.floorName +"-"+ findRoom.roomName;
}
- if (roomNameList == "" && functionType == FunctionType.Scene)
+ if (roomNameList == "" )
{
roomNameList = Language.StringByID(StringId.WholeZone);
}
@@ -798,10 +837,36 @@
/// 婀垮害浼犳劅鍣�
/// </summary>
public const string SensorHumidity = "sensor.humidity";
+
+ /// <summary>
+ /// 鐑熼浘浼犳劅鍣�
+ /// </summary>
+ public const string SensorSmoke = "sensor.smoke";
+ /// <summary>
+ /// 姘存蹈浼犳劅鍣�
+ /// </summary>
+ public const string SensorWater = "sensor.water";
+ /// <summary>
+ /// 鐕冩皵浼犳劅鍣�
+ /// </summary>
+ public const string SensorGas= "sensor.gas";
+ /// <summary>
+ /// 绾㈠鐝婃爮浼犳劅鍣�
+ /// </summary>
+ public const string SensorShanLan = "sensor.shanlan";
+ /// <summary>
+ /// 绾㈠瀵瑰皠浼犳劅鍣�
+ /// </summary>
+ public const string SensorDuiShe = "sensor.duishe";
+ /// <summary>
+ /// 瓒呭0娉紶鎰熷櫒
+ /// </summary>
+ public const string SensoruUtrasonic = "sensor.ultrasonic";
+
/// <summary>
/// 锛堝共鎺ョ偣锛�
/// </summary>
- public const string DryContact = "dryContact.standard";
+ public const string SensorDryContact = "sensor.dryContact";
/// <summary>
/// 瀹剁數銆佹彃搴�
/// </summary>
@@ -814,6 +879,54 @@
/// 瀹剁數銆侀鎵�
/// </summary>
public const string ElectricFan = "electrical.fan";
+
}
+
+ /// <summary>
+ /// 鍔熻兘绫诲埆
+ /// </summary>
+ public static class FunctionCategory
+ {
+ /// <summary>
+ ///锛堢伅锛�
+ /// </summary>
+ public const string Light = "light";
+ /// <summary>
+ /// 锛堢獥甯橈級
+ /// </summary>
+ public const string Curtain = "curtain";
+ /// <summary>
+ /// 锛堢┖璋冿級
+ /// </summary>
+ public const string AC = "ac";
+ /// <summary>
+ /// 锛堝湴鐑級
+ /// </summary>
+ public const string FloorHeat = "floorHeat";
+ /// <summary>
+ /// 锛堟柊椋庯級
+ /// </summary>
+ public const string AirFresh = "airFresh";
+ /// <summary>
+ /// 锛堥煶涔愶級
+ /// </summary>
+ public const string Music = "music";
+ /// <summary>
+ /// 锛堜紶鎰熷櫒锛�
+ /// </summary>
+ public const string Sensor = "sensor";
+ /// <summary>
+ /// 锛堝共鎺ョ偣锛�
+ /// </summary>
+ public const string DryContact = "dryContact";
+ /// <summary>
+ /// 瀹剁數
+ /// </summary>
+ public const string Electric = "electrical";
+
+ //Music = 0x09,
+ }
+
+
}
--
Gitblit v1.8.0