From 4d14154c36ac5692aadc036eed97fb9f1c410e2a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期日, 23 五月 2021 14:46:03 +0800
Subject: [PATCH] Merge branch 'WJC' into temp-wxr
---
HDL_ON/Entity/Function/FloorHeating.cs | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 229 insertions(+), 2 deletions(-)
diff --git a/HDL_ON/Entity/Function/FloorHeating.cs b/HDL_ON/Entity/Function/FloorHeating.cs
index cf57095..30ef6c0 100644
--- a/HDL_ON/Entity/Function/FloorHeating.cs
+++ b/HDL_ON/Entity/Function/FloorHeating.cs
@@ -1,11 +1,238 @@
锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+
namespace HDL_ON.Entity
{
- public class FloorHeating : Function
+ public class FloorHeating
{
- public FloorHeating()
+ /// <summary>
+ /// 鑾峰彇娓╁害鍗曚綅bus鏍囪瘑
+ /// </summary>
+ /// <param name="function"></param>
+ /// <returns></returns>
+ public int GetTempUintIndex(Function function)
{
+ var tt = function.GetAttrState(FunctionAttributeKey.TempType);
+ if (tt == "掳F")
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ /// <summary>
+ /// 鏍规嵁bus鏍囪瘑璁剧疆娓╁害鍗曚綅
+ /// </summary>
+ /// <param name="function"></param>
+ /// <returns></returns>
+ public void SetTempUint(Function function, int index)
+ {
+ if (index == 0)
+ {
+ function.SetAttrState(FunctionAttributeKey.TempType, "掳C");
+ }
+ else
+ {
+ function.SetAttrState(FunctionAttributeKey.TempType, "掳F");
+ }
}
+ /// <summary>
+ /// 鑾峰彇bus鍗忚宸ヤ綔妯″紡index
+ /// 0:鍦扮儹妯″紡锛�1:鍦板喎妯″紡锛�
+ /// 2:鍦扮儹鍔熺巼妯″紡锛�3:鍦板喎鍔熺巼妯″紡锛�
+ /// </summary>
+ public int GetWorkModeIndex(Function function)
+ {
+ var attr = function.GetAttrState(FunctionAttributeKey.WorkMode);
+ if (attr == "cool")
+ return 1;
+ return 0;
+ }
+
+ /// <summary>
+ /// 璁剧疆bus鍗忚宸ヤ綔妯″紡index
+ /// 0:鍦扮儹妯″紡锛�1:鍦板喎妯″紡锛�
+ /// 2:鍦扮儹鍔熺巼妯″紡锛�3:鍦板喎鍔熺巼妯″紡锛�
+ /// </summary>
+ public void SetWorkModeIndex(Function function, int index)
+ {
+ if (index == 1)
+ function.SetAttrState(FunctionAttributeKey.WorkMode, "cool");
+ else
+ function.SetAttrState(FunctionAttributeKey.WorkMode, "heat");
+ }
+
+ /// <summary>
+ /// 鑾峰彇娓╁害妯″紡瀛楃
+ /// </summary>
+ public string GetTempUnitString(Function function)
+ {
+ var tt = function.GetAttrState(FunctionAttributeKey.TempType);
+ if (tt == "0")
+ {
+ return "掳C";
+ }
+ else
+ {
+ return tt;
+ }
+ }
+
+
+
+ /// <summary>
+ /// 鑾峰彇bus鍗忚妯″紡绱㈠紩
+ /// </summary>
+ public byte GetModeIndex(Function function)
+ {
+ byte index = 0;
+ var mode = function.GetAttrState(FunctionAttributeKey.Mode);
+ switch (mode)
+ {
+ case "day":
+ index = 2;
+ break;
+ case "night":
+ index = 3;
+ break;
+ case "away":
+ index = 4;
+ break;
+ case "normal":
+ index = 1;
+ break;
+ case "timer":
+ index = 5;
+ break;
+ default:
+ index = 0;
+ break;
+ }
+ return index;
+ }
+ /// <summary>
+ /// 璁剧疆bus鍗忚妯″紡绱㈠紩
+ /// </summary>
+ public void SetModeIndex(int value, Function function)
+ {
+ string mode = "timer";
+ switch (value)
+ {
+ case 5:
+ mode = "timer";
+ break;
+ case 1:
+ mode = "normal";
+ break;
+ case 2:
+ mode = "day";
+ break;
+ case 3:
+ mode = "night";
+ break;
+ case 4:
+ mode = "away";
+ break;
+ default:
+ mode = "cool";
+ break;
+ }
+ function.SetAttrState(FunctionAttributeKey.Mode, mode);
+ }
+
+ /// <summary>
+ /// 鏃堕棿鏍囪
+ /// 0:鐧藉ぉ锛�1:澶滄櫄
+ /// </summary>
+ public byte timeFlag = 0;
+
+ /// <summary>
+ /// 鑾峰彇妯″紡鐨刬con璺緞
+ /// <param name="lightingIcon">鑾峰彇鐨勫浘鏍囩被鍨嬶紝榛樿鏄偣浜�</param>
+ /// </summary>
+ public string GetModeIconPath(string modeValue, bool lighting = true)
+ {
+ var imagePath = "FunctionIcon/AC/HeatingIcon.png";
+ //var key = function.GetAttrState(FunctionAttributeKey.Mode);
+ if (lighting)
+ {
+ switch (modeValue)
+ {
+ case "day":
+ imagePath = "FunctionIcon/AC/HeatingIcon.png";
+ break;
+ case "night":
+ imagePath = "FunctionIcon/FloorHeating/NightIcon.png";
+ break;
+ case "away":
+ imagePath = "FunctionIcon/FloorHeating/AwayIcon.png";
+ break;
+ case "timer":
+ imagePath = "FunctionIcon/AC/AutoIcon.png";
+ break;
+ case "normal":
+ imagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png";
+ break;
+ default:
+ imagePath = "FunctionIcon/AC/HeatingIcon.png";
+ break;
+ }
+ }
+ else
+ {
+ switch (modeValue)
+ {
+ case "day":
+ imagePath = "FunctionIcon/AC/HeatingIconGray.png";
+ break;
+ case "night":
+ imagePath = "FunctionIcon/FloorHeating/NightIconGray.png";
+ break;
+ case "away":
+ imagePath = "FunctionIcon/FloorHeating/AwayIconGray.png";
+ break;
+ case "timer":
+ imagePath = "FunctionIcon/AC/AutoIconGray.png";
+ break;
+ case "normal":
+ imagePath = "FunctionIcon/FloorHeating/OrdinaryIconGray.png";
+ break;
+ }
+ }
+ return imagePath;
+ }
+
+
+ /// <summary>
+ /// 鑾峰彇妯″紡灞炴�ф枃鏈�
+ /// </summary>
+ /// <returns></returns>
+ public string GetModeAttrText(string value)
+ {
+ string text = "";
+ switch (value)
+ {
+ case "day":
+ text = Language.StringByID(StringId.Day);
+ break;
+ case "night":
+ text = Language.StringByID(StringId.Night);
+ break;
+ case "away":
+ text = Language.StringByID(StringId.Away);
+ break;
+ case "timer":
+ text = Language.StringByID(StringId.Auto);
+ break;
+ case "normal":
+ text = Language.StringByID(StringId.Normal);
+ break;
+ }
+ return text;
+ }
}
}
--
Gitblit v1.8.0