From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs | 41 ++++++++++++++++++++---------------------
1 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
index d2ac449..86a0e73 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
@@ -10,7 +10,7 @@
/// <summary>
/// 鏇存柊鐏厜鐘舵��
/// </summary>
- public static void UpdataState(Fan uFan)
+ public static void UpdataState(Function updateTemp)
{
Application.RunOnMainThread(() =>
{
@@ -18,9 +18,9 @@
{
if (bodyView == null)
return;
- bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uFan.trait_on_off.value.ToString() == "on";
- bodyView.barGradualChange.ProgressBarColor = uFan.trait_on_off.value.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
- bodyView.barGradualChange.Progress = uFan.openLevel;
+ bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.curValue.ToString() == "on";
+ bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.curValue.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
+ bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.OpenLevel));
}
catch (Exception ex)
{
@@ -38,8 +38,9 @@
//鍥為��鍒锋柊淇℃伅浜嬩欢
actionRefresh = () => {
- btnFunctionName.Text = btnFunctionName_Out.Text = fan.name;
- btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = fan.GetRoomListName();
+ btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
+ btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
+ //function.SaveFunctionData(true);
};
}
@@ -49,8 +50,8 @@
void LoadCollectionEvent()
{
btnCollection.MouseUpEventHandler += (sender, e) => {
- btnCollection.IsSelected = fan.collection = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
- fan.SaveFunctionData();
+ btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
+ function.CollectFunction();
};
}
@@ -65,11 +66,11 @@
new System.Threading.Thread(() =>
{
- fan.trait_on_off.value = btnSwitch.IsSelected ? "on" : "off";
- //Control.Send(CommandType_A.write, this.fan);
+ function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ //Control.Send(CommandType_A.write, this.function);
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", fan.trait_on_off.value.ToString());
- Control.Ins.SendWriteCommand(fan, d);
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
};
@@ -79,24 +80,22 @@
new System.Threading.Thread(() =>
{
- fan.trait_on_off.value = btnSwitch.IsSelected ? "on" : "off";
- //Control.Send(CommandType_A.write, this.fan);
+ function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", fan.trait_on_off.value.ToString());
- Control.Ins.SendWriteCommand(fan, d);
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
};
barGradualChange.OnProgressChangedEvent = (sender, e) => {
- fan.openLevel = e;
+ function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString());
new System.Threading.Thread(() =>
{
- fan.trait_on_off.value = btnSwitch.IsSelected ? "on" : "off";
- //Control.Send(CommandType_A.write, this.fan);
+ function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", fan.trait_on_off.value.ToString());
- Control.Ins.SendWriteCommand(fan, d);
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
};
--
Gitblit v1.8.0