From 068c68295cad1967f7aafb4e5e951260ef03d4ce Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 09 七月 2021 09:16:43 +0800
Subject: [PATCH] 状态属性更改,不要轻易合并
---
HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 4
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs | 4
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs | 8
HDL_ON/Common/ApiUtlis.cs | 1
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs | 6
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs | 10
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs | 4
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs | 6
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 34 +-
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs | 14
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs | 4
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs | 12
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs | 50 ++--
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs | 20
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs | 4
HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs | 6
HDL_ON/DAL/DriverLayer/Packet.cs | 30 +-
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs | 18
.vs/HDL_APP_Project/xs/UserPrefs.xml | 25 +
HDL_ON/DAL/DriverLayer/Control.cs | 2
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs | 28 +-
HDL_ON/UI/UI1-Login/LoginPage.cs | 88 ++++----
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs | 22 +-
HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs | 6
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs | 4
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 24 +-
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs | 18
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs | 6
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 14
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs | 12
HDL_ON/DAL/DriverLayer/Control_Udp.cs | 24 +-
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs | 14
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs | 6
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs | 20
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs | 14
HDL_ON/Entity/Function/Function.cs | 54 +++-
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 12
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs | 18
38 files changed, 341 insertions(+), 305 deletions(-)
diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 9ec7481..60ee04e 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,9 +1,12 @@
锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
- <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
+ <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.220222E9-B9CA-4834-9318-2BC22465F050" />
<MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/Function/Function.cs">
<Files>
- <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="190" Column="57" />
- <File FileName="HDL_ON/Entity/Function/Function.cs" Line="420" Column="21" />
+ <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" Line="760" Column="141" />
+ <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" />
+ <File FileName="HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs" />
+ <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="190" Column="55" />
+ <File FileName="HDL_ON/Entity/Function/Function.cs" Line="430" Column="1" />
</Files>
<Pads>
<Pad Id="ProjectPad">
@@ -12,11 +15,21 @@
<Node name="HDL_ON" expanded="True">
<Node name="Common" expanded="True" />
<Node name="DAL" expanded="True">
- <Node name="Server" expanded="True" />
+ <Node name="DriverLayer" expanded="True" />
</Node>
<Node name="Entity" expanded="True">
<Node name="Function" expanded="True">
<Node name="Function.cs" selected="True" />
+ </Node>
+ </Node>
+ <Node name="UI" expanded="True">
+ <Node name="UI1-Login" expanded="True" />
+ <Node name="UI2" expanded="True">
+ <Node name="1-HomePage" expanded="True" />
+ <Node name="FuntionControlView" expanded="True">
+ <Node name="AC" expanded="True" />
+ <Node name="ArmSensor" expanded="True" />
+ </Node>
</Node>
</Node>
</Node>
@@ -32,8 +45,8 @@
<String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
<String>Shared.IOS/Shared.IOS.csproj</String>
</DisabledProjects>
- <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
- <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.7374d754" />
+ <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
+ <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
<Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" />
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 51ea108..26204e8 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -187,6 +187,7 @@
//澶勭悊鍓╀笅鐨勬柊澧炲姛鑳�
foreach (var newFunction in deviceList.list)
{
+ newFunction.AssembleStatus();
newFunction.SaveFunctionFile();
FunctionList.List.IniFunctionList(newFunction.savePath);
}
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 0724f2b..21580f5 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -819,7 +819,7 @@
ColorTureLampPage.UpdataStatus(localFunction);
break;
case SPK.CurtainSwitch:
- localFunction.lastState = localFunction.trait_on_off.curValue.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close);
+ localFunction.lastState = localFunction.trait_on_off.state.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close);
CurtainModulePage.UpdataState(localFunction);
break;
case SPK.CurtainTrietex:
diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
index 789428d..054b17c 100644
--- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -440,7 +440,7 @@
byte b0 = 100;//寮�鍏虫搷浣滀緷鎹畂n_off瀛楁锛屽疄闄呭紑鍏冲�间緷鎹産rightness锛屽綋on_off涓烘墦寮�锛宐rightness涓嶈兘涓�0
if(commandDictionary.ContainsKey(FunctionAttributeKey.OnOff))
{
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
b0 = 0;
}
@@ -460,7 +460,7 @@
break;
case SPK.LightRGB:
byte b = 100;//寮�鍏虫搷浣滀緷鎹畂n_off瀛楁锛屽疄闄呭紑鍏冲�间緷鎹産rightness锛屽綋on_off涓烘墦寮�锛宐rightness涓嶈兘涓�0
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
b = 0;
}
@@ -488,7 +488,7 @@
break;
case SPK.LightDimming:
byte b1 = 100;
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
b1 = 0;
}
@@ -510,7 +510,7 @@
0, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) });
break;
case SPK.LightSwitch:
- ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 });
+ ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.state.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 });
break;
}
break;
@@ -519,11 +519,11 @@
{
case SPK.CurtainSwitch:
byte b1 = 0;
- if (function.trait_on_off.curValue.ToString() == "stop")
+ if (function.trait_on_off.state.ToString() == "stop")
{
b1 = 0;
}
- else if (function.trait_on_off.curValue.ToString() == "on")
+ else if (function.trait_on_off.state.ToString() == "on")
{
b1 = 1;
}
@@ -535,7 +535,7 @@
break;
case SPK.CurtainTrietex:
case SPK.CurtainRoller:
- if (function.trait_on_off.curValue.ToString() == "stop")
+ if (function.trait_on_off.state.ToString() == "stop")
{
ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 });
}
@@ -560,7 +560,7 @@
switch (dic.Key)
{
case FunctionAttributeKey.OnOff:
- ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
+ ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.state.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
break;
case "mode":
ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 6, ac.GetModeIndex(function), function.bus.LoopId });
@@ -614,7 +614,7 @@
switch (dic.Key)
{
case FunctionAttributeKey.OnOff:
- ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 20, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
+ ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 20, function.trait_on_off.state.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
break;
case "mode":
ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 21, fhTemp.GetModeIndex(function), function.bus.LoopId });
@@ -647,7 +647,7 @@
}
else
{
- var onoffString = function.trait_on_off.curValue.ToString();
+ var onoffString = function.trait_on_off.state.ToString();
byte b1 = 1;
if (onoffString == "off")
{
@@ -692,7 +692,7 @@
switch (function.spk)
{
case SPK.ElectricFan:
- if (function.trait_on_off.curValue.ToString() == "on")
+ if (function.trait_on_off.state.ToString() == "on")
{
ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.OpenLevel)) });
}
@@ -701,7 +701,7 @@
}
break;
case SPK.ElectricSocket:
- ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 });
+ ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.state.ToString() == "on" ? (byte)100 : (byte)0 });
break;
}
break;
diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index 2d28447..0ccf533 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -133,8 +133,8 @@
{
if (updataObj.spk != SPK.LightRGB)
{
- updataObj.trait_on_off.curValue = receiveBytes[2] > 0 ? "on" : "off";
- if (updataObj.trait_on_off.curValue.ToString() == "on")
+ updataObj.trait_on_off.state = receiveBytes[2] > 0 ? "on" : "off";
+ if (updataObj.trait_on_off.state.ToString() == "on")
{
switch (updataObj.spk)
{
@@ -177,8 +177,8 @@
{
if (light.spk != SPK.LightRGB)
{
- light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
- if (light.trait_on_off.curValue.ToString() == "on")
+ light.trait_on_off.state = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
+ if (light.trait_on_off.state.ToString() == "on")
{
light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[2].ToString());
light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
@@ -204,7 +204,7 @@
if (function != null)
{
function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[2] == 0 ? "off" : "on");
- if (function.trait_on_off.curValue.ToString() == "on")
+ if (function.trait_on_off.state.ToString() == "on")
{
function.SetAttrState(FunctionAttributeKey.OpenLevel, receiveBytes[2].ToString());
function.lastState = Language.StringByID(StringId.Level) + " : " + receiveBytes[2];
@@ -234,7 +234,7 @@
{
if (lightTeme.spk == SPK.LightRGB)
{
- lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
+ lightTeme.trait_on_off.state = receiveBytes[1] > 0 ? "on" : "off";
if (receiveBytes[1] > 0)
{
lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
@@ -249,7 +249,7 @@
RGBPage.UpdataStates(lightTeme);
}else if(lightTeme.spk == SPK.LightCCT)
{
- lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
+ lightTeme.trait_on_off.state = receiveBytes[1] > 0 ? "on" : "off";
if (receiveBytes[1] > 0)
{
lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
@@ -276,11 +276,11 @@
{
if (receiveBytes[1] > 1)
{
- curtain.trait_on_off.curValue = "on";
+ curtain.trait_on_off.state = "on";
}
else
{
- curtain.trait_on_off.curValue = "off";
+ curtain.trait_on_off.state = "off";
}
curtain.SetAttrState(FunctionAttributeKey.Percent, receiveBytes[1].ToString());
curtain.lastState = Language.StringByID(StringId.Open) + curtain.GetAttrState(FunctionAttributeKey.Percent) + "%";
@@ -292,14 +292,14 @@
switch (receiveBytes[1])
{
case 0:
- curtain.trait_on_off.curValue = "stop";
+ curtain.trait_on_off.state = "stop";
break;
case 1:
- curtain.trait_on_off.curValue = "on";
+ curtain.trait_on_off.state = "on";
curtain.lastState = Language.StringByID(StringId.Open);
break;
case 2:
- curtain.trait_on_off.curValue = "off";
+ curtain.trait_on_off.state = "off";
curtain.lastState = Language.StringByID(StringId.Close);
break;
}
@@ -332,7 +332,7 @@
{
function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString());
function.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[2].ToString());
- function.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
+ function.trait_on_off.state = receiveBytes[8] == 1 ? "on" : "off";
acFunction.SetMode(receiveBytes[9],function);
acFunction.SetFan(receiveBytes[10],function);
function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[11].ToString());
@@ -386,7 +386,7 @@
if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
{
function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[2]);
- function.trait_on_off.curValue = receiveBytes[1] % 2 == 0 ? "off" : "on";
+ function.trait_on_off.state = receiveBytes[1] % 2 == 0 ? "off" : "on";
new FloorHeating().SetModeIndex(receiveBytes[3],function);
if (function.Fh_Mode_Temp.ContainsKey("normal"))
@@ -618,7 +618,7 @@
switch (receiveBytes[0])
{
case 3://
- function.trait_on_off.curValue = receiveBytes[1] == 1 ? "on" : "off";
+ function.trait_on_off.state = receiveBytes[1] == 1 ? "on" : "off";
break;
case 4:
case 7:
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 38ecf24..d918442 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -134,7 +134,6 @@
else
{
attr.state = value.ToString();
- attr.curValue = value.ToString();
}
return true;
}
@@ -271,12 +270,12 @@
max = 1,
min = 0,
};
- _trait_on_off.curValue = "off";
+ _trait_on_off.state = "off";
}
}
- if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop")
+ if(_trait_on_off.state.ToString() != "on"&& _trait_on_off.state.ToString() != "off" && _trait_on_off.state.ToString() != "stop")
{
- _trait_on_off.curValue = "off";
+ _trait_on_off.state = "off";
}
return _trait_on_off;
}
@@ -427,6 +426,19 @@
var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
FileUtlis.Files.WriteFileByBytes(savePath, ssd);
}
+
+ /// <summary>
+ /// 閫氳繃鐘舵�佸垪琛ㄧ粍瑁呭睘鎬ч噷闈㈢殑鐘舵��
+ /// </summary>
+ public void AssembleStatus()
+ {
+ foreach(var sta in status)
+ {
+ SetAttrState(sta.key, sta.value);
+ }
+ }
+
+
/// <summary>
/// 淇濆瓨鎴块棿缁戝畾淇℃伅
/// </summary>
@@ -506,39 +518,39 @@
case FunctionAttributeKey.FanSpeed:
case FunctionAttributeKey.Percent:
//case FunctionAttributeKey.FadeTime:
- if (attr.curValue.ToString() == "{}")
+ if (attr.state.ToString() == "{}")
{
if (attr.key == FunctionAttributeKey.OnOff)
{
- attr.curValue = "off";
+ attr.state = "off";
}
else if (attr.key == FunctionAttributeKey.Mode )
{
if (DB_ResidenceData.Instance.GatewayType == 0)
{
- attr.curValue = "0";
+ attr.state = "0";
}
else
{
if (SPK.AcSpkList().Contains(spk))
{
- attr.curValue = "cool";
+ attr.state = "cool";
}
else if (SPK.FhSpkList().Contains(spk))
{
- attr.curValue = "day";
+ attr.state = "day";
}
}
}
else
{
- attr.curValue = "0";
+ attr.state = "0";
}
}
if (attr.key == FunctionAttributeKey.SetTemp)
{
double vv = 16;
- Double.TryParse(attr.curValue.ToString(), out vv);
+ Double.TryParse(attr.state.ToString(), out vv);
if (vv == 0)
{
vv = 26;
@@ -547,7 +559,7 @@
}
else
{
- sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() });
+ sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.state.ToString() });
}
break;
}
@@ -681,6 +693,20 @@
public string value = "";
}
+ public class attttttt
+ {
+ /// <summary>
+ /// 褰撳墠鐘舵��
+ /// </summary>
+ public string state = "";
+ /// <summary>
+ /// 褰撳墠鍊�
+ /// </summary>
+ public object curValue = new object();
+
+ }
+
+
/// <summary>
/// 鍔熻兘灞炴��
/// 灞炴�у瓧娈佃В鏋愶細attri :灞炴�у唴瀹癸紝value 灞炴�х殑鍊硷紝max 鏈�澶у�� min 鏈�灏忓��
@@ -712,10 +738,6 @@
/// 褰撳墠鐘舵��
/// </summary>
public string state = "";
- /// <summary>
- /// 褰撳墠鍊�
- /// </summary>
- public object curValue = new object();
}
/// <summary>
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index 8d3d3da..0157bb3 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -618,11 +618,11 @@
collect = true,
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="100",state = "100" },
- new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, curValue="0,0,0",state = "0,0,0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state="on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "100" },
+ new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, state = "0,0,0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightRgb1.SaveFunctionFile();
@@ -635,11 +635,11 @@
roomIds = new List<string>() { "1405771024583090178"},
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, curValue="0,0,0",state = "0,0,0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, state = "0,0,0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightRgb2.SaveFunctionFile();
@@ -652,11 +652,11 @@
roomIds = new List<string>() { "1405771024583090178"},
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "cct",value =new List<string>(){ "0","65535" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "cct",value =new List<string>(){ "0","65535" }, state = "0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightCct.SaveFunctionFile();
@@ -669,9 +669,9 @@
roomIds = new List<string>() { "1405771024583090178"},
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightSwitch1.SaveFunctionFile();
@@ -684,9 +684,9 @@
roomIds = new List<string>() { "1405771024583090178"},
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightSwitch2.SaveFunctionFile();
@@ -699,8 +699,8 @@
roomIds = new List<string>() { "1405771024583090178"},
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, state = "0" },
},
};
curtain1.SaveFunctionFile();
@@ -713,8 +713,8 @@
roomIds = new List<string>() { "1405771024583090178"},
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, state = "0" },
},
};
curtain2.SaveFunctionFile();
@@ -727,10 +727,10 @@
roomIds = new List<string>() { "1405771024583090178"},
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "mode",value =new List<string>(){ "day", "night", "away", "normal", "timer" }, curValue="day",state = "day" },
- new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, curValue="26",state = "26" },
- new FunctionAttributes() { key = "room_temp",value =new List<string>(){ "" }, curValue="26",state = "26" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "mode",value =new List<string>(){ "day", "night", "away", "normal", "timer" }, state = "day" },
+ new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, state = "26" ,max = 30,min =16 },
+ new FunctionAttributes() { key = "room_temp",value =new List<string>(){ "" }, state = "26" },
},
};
fh.SaveFunctionFile();
@@ -899,9 +899,9 @@
roomIds = new List<string>() { room3.roomId },
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightSwitch3.SaveFunctionFile();
@@ -914,9 +914,9 @@
roomIds = new List<string>() { room3.roomId },
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightSwitch4.SaveFunctionFile();
@@ -1005,12 +1005,12 @@
roomIds = new List<string>() { room3.roomId },
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off", value = new List<string>() { "on", "off" }, curValue = "on", state = "on" },
- new FunctionAttributes() { key = "mode", value = new List<string>() { "cool", "heat", "fan", "auto", "dry" }, curValue = "cool", state = "cool" },
- new FunctionAttributes() { key = "fan", value = new List<string>() { "high", "medium", "low", "auto" }, curValue = "auto", state = "auto" },
- new FunctionAttributes() { key = "set_temp", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 },
- new FunctionAttributes() { key = "room_temp", value = new List<string>() { }, curValue = "20", state = "20" },
- new FunctionAttributes() { key = "swing", value = new List<string>() {"up_down", "left_right", "stop" }, curValue = "20", state = "20" },
+ new FunctionAttributes() { key = "on_off", value = new List<string>() { "on", "off" }, state = "on" },
+ new FunctionAttributes() { key = "mode", value = new List<string>() { "cool", "heat", "fan", "auto", "dry" }, state = "cool" },
+ new FunctionAttributes() { key = "fan", value = new List<string>() { "high", "medium", "low", "auto" }, state = "auto" },
+ new FunctionAttributes() { key = "set_temp", value = new List<string>() { "16", "30"}, state = "16",max = 30,min = 16 },
+ new FunctionAttributes() { key = "room_temp", value = new List<string>() { }, state = "20" },
+ new FunctionAttributes() { key = "swing", value = new List<string>() {"up_down", "left_right", "stop" }, state = "20" },
}
};
ac.SaveFunctionFile();
@@ -1046,9 +1046,9 @@
roomIds = new List<string>() { room1.roomId },
attributes = new List<FunctionAttributes>()
{
- new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" },
- new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
- new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" },
+ new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on" },
+ new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "0" },
+ new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0" },
},
};
lightSwitch6.SaveFunctionFile();
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index f057023..6acb0da 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -994,14 +994,14 @@
btnPower.IsSelected = false;
Music.SendMethod.Pause(a31player);
a31player.A31PlayStatus.status = "pause";
- a31player.trait_on_off.curValue = "off";
+ a31player.trait_on_off.state = "off";
}
else
{
btnPower.IsSelected = true;
Music.SendMethod.Play(a31player);
a31player.A31PlayStatus.status = "play";
- a31player.trait_on_off.curValue = "on";
+ a31player.trait_on_off.state = "on";
}
UpdataFunctionStates(a31player);
};
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index f704df6..ed924af 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -27,7 +27,7 @@
/// </summary>
public static void LoadEvent_RefreshEnvirIndoorHumi()
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
if (bodyView != null)
{
@@ -43,7 +43,7 @@
name = enviTemp.name,
sid = enviTemp.sid,
deviceId = enviTemp.deviceId,
- attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } },
+ attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state } },
};
humiSensorList.Add(newTemp);
}
@@ -61,15 +61,15 @@
}
bodyView.btnIndoorHumiValues.Width = bodyView.btnIndoorHumiValues.GetTextWidth();
}
- });
+ }));
}
/// <summary>
/// 鏇存柊瀹ゅ唴浼犳劅鍣ㄦ暟鎹�-鏅氱偣
/// </summary>
public static void LoadEvent_RefreshEnvirIndoorTemp()
- {
- Application.RunOnMainThread(() =>
+ {
+ Application.RunOnMainThread((Action)(() =>
{
if (bodyView != null)
{
@@ -85,7 +85,7 @@
name = enviTemp.name,
sid = enviTemp.sid,
deviceId = enviTemp.deviceId,
- attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } },
+ attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state } },
};
tempSensorList.Add(newTemp);
}
@@ -103,7 +103,7 @@
}
bodyView.btnIndoorTempValues.Width = bodyView.btnIndoorTempValues.GetTextWidth();
}
- });
+ }));
}
/// <summary>
@@ -265,7 +265,7 @@
/// </summary>
public static void UpdataFunctionStates(Function function)
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
@@ -283,7 +283,7 @@
}
else
{
- state = function.trait_on_off.curValue.ToString() == "on";
+ state = function.trait_on_off.state.ToString() == "on";
}
for (int i = 0; i < view.ChildrenCount; i++)
{
@@ -315,7 +315,7 @@
{
MainPage.Log($"HomePage updata funciton states error {ex.Message}");
}
- });
+ }));
}
/// <summary>
@@ -398,11 +398,11 @@
btnSwitch.IsSelected = !btnSwitch.IsSelected;
});
}
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
Dictionary<string, string> d = new Dictionary<string, string>();
if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB)
{
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
if (btnSwitch.IsSelected)
{
d.Add(FunctionAttributeKey.Brightness, function.lastBrightness.ToString());
@@ -416,7 +416,7 @@
}
else
{
- d.Add("on_off", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
}
})
@@ -468,20 +468,20 @@
btnClose.MouseUpEventHandler = (sender, e) =>
{
btnClose.IsSelected = true;
- curtain.trait_on_off.curValue = "off";
+ curtain.trait_on_off.state = "off";
curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(curtain, d);
};
btnOpen.MouseUpEventHandler = (sender, e) =>
{
btnOpen.IsSelected = true;
- curtain.trait_on_off.curValue = "on";
+ curtain.trait_on_off.state = "on";
curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(curtain, d);
};
}
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
index 32ef478..e1a39e7 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
@@ -64,7 +64,7 @@
{
try
{
- (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on";
+ (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.state.ToString() == "on";
}
catch (Exception ex)
{
@@ -78,7 +78,7 @@
try
{
(fcView.GetChildren(j) as DiyImageSeekBar).Progress = Convert.ToInt32(updataFunction.GetAttrState(FunctionAttributeKey.Brightness));
- if (updataFunction.trait_on_off.curValue.ToString() == "on")
+ if (updataFunction.trait_on_off.state.ToString() == "on")
{
(fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
}
@@ -98,7 +98,7 @@
{
try
{
- (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on";
+ (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.state.ToString() == "on";
(fcView.GetChildren(j) as Button).Text = updataFunction.lastState;
}
catch (Exception ex)
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 606a378..62561d8 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -654,25 +654,25 @@
case ShowFunction.Light:
#region Light
functionCount = FunctionList.List.GetLightList().Count;
- functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
#endregion
break;
case ShowFunction.AC:
#region AC
functionCount = FunctionList.List.GetAcList().Count;
- functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
#endregion
break;
case ShowFunction.Curtain:
#region Curtain
functionCount = FunctionList.List.GetCurtainList().Count;
- functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
#endregion
break;
case ShowFunction.FloorHeating:
#region 鍦扮儹
functionCount = FunctionList.List.GetFloorHeatingList().Count;
- functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
#endregion
break;
case ShowFunction.DoorLock:
@@ -680,13 +680,13 @@
case ShowFunction.Electric:
#region 鐢靛櫒
functionCount = FunctionList.List.GetElectricals().Count;
- functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
#endregion
break;
case ShowFunction.EnergyMonitoring:
#region 鑳芥簮
functionCount = FunctionList.List.GetEnergyList().Count;
- functionOnCount = FunctionList.List.GetEnergyList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetEnergyList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
#endregion
break;
case ShowFunction.Environmental:
@@ -696,7 +696,7 @@
break;
case ShowFunction.FreshAir:
functionCount = FunctionList.List.GetAirFreshList().Count;
- functionOnCount = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
break;
case ShowFunction.Music:
//functionCount = Music.A31MusicModel.A31MusicModelList.Count;
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
index 7012fba..46b6233 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -108,22 +108,22 @@
switch (functionCategory)
{
case ShowFunction.FloorHeating:
- btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
+ btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
break;
case ShowFunction.AC:
- btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
+ btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
break;
case ShowFunction.Curtain:
- btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
+ btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
break;
case ShowFunction.Light:
- btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
+ btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
break;
case ShowFunction.Electric:
- btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
+ btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
break;
case ShowFunction.FreshAir:
- btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
+ btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
break;
}
if (btn.Tag.ToString() == functionCategory + "_onCount")
@@ -168,7 +168,7 @@
var btn = view1.GetChildren(j) as Button;
if (btn.Tag != null && btn.Tag.ToString() == "AllClose")
{
- if (function.trait_on_off.curValue.ToString() == "on")
+ if (function.trait_on_off.state.ToString() == "on")
{
btn.Visible = true;
}
@@ -185,7 +185,7 @@
{
continue;
}
- var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on");
+ var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.state.ToString() == "on");
var sss = ssd.Count;
if (sss == 0)
{
@@ -215,9 +215,9 @@
{
foreach (var f in room.GetRoomFunctions(false))
{
- f.trait_on_off.curValue = "off";
+ f.trait_on_off.state = "off";
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add("on_off", f.trait_on_off.curValue.ToString());
+ d.Add("on_off", f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
}
@@ -237,7 +237,7 @@
};
foreach (var f in room.GetRoomFunctions(false))
{
- if (f.trait_on_off.curValue.ToString() == "on")
+ if (f.trait_on_off.state.ToString() == "on")
{
btn.Visible = true;
break;
@@ -344,9 +344,9 @@
case ShowFunction.AC:
foreach (var f in FunctionList.List.GetAcList())
{
- f.trait_on_off.curValue = onoff;
+ f.trait_on_off.state = onoff;
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
System.Threading.Thread.Sleep(sleepTime);
}
@@ -354,9 +354,9 @@
case ShowFunction.FloorHeating:
foreach (var f in FunctionList.List.GetFloorHeatingList())
{
- f.trait_on_off.curValue = onoff;
+ f.trait_on_off.state = onoff;
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
System.Threading.Thread.Sleep(sleepTime);
}
@@ -364,9 +364,9 @@
case ShowFunction.Light:
foreach (var f in FunctionList.List.GetLightList())
{
- f.trait_on_off.curValue = onoff;
+ f.trait_on_off.state = onoff;
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
System.Threading.Thread.Sleep(sleepTime);
}
@@ -374,9 +374,9 @@
case ShowFunction.Electric:
foreach (var f in FunctionList.List.GetElectricals())
{
- f.trait_on_off.curValue = onoff;
+ f.trait_on_off.state = onoff;
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
System.Threading.Thread.Sleep(sleepTime);
}
@@ -384,9 +384,9 @@
case ShowFunction.FreshAir:
foreach (var f in FunctionList.List.GetAirFreshList())
{
- f.trait_on_off.curValue = onoff;
+ f.trait_on_off.state = onoff;
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
System.Threading.Thread.Sleep(sleepTime);
}
@@ -472,10 +472,10 @@
{
foreach (var f in FunctionList.List.GetCurtainList())
{
- f.trait_on_off.curValue = "on";
+ f.trait_on_off.state = "on";
f.SetAttrState(FunctionAttributeKey.Percent, "100");
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add("on_off", f.trait_on_off.curValue.ToString());
+ d.Add("on_off", f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
System.Threading.Thread.Sleep(100);
}
@@ -503,10 +503,10 @@
btnOpen.IsSelected = false;
foreach (var f in FunctionList.List.GetCurtainList())
{
- f.trait_on_off.curValue = "off";
+ f.trait_on_off.state = "off";
f.SetAttrState(FunctionAttributeKey.Percent, "0");
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add("on_off", f.trait_on_off.curValue.ToString());
+ d.Add("on_off", f.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(f, d);
}
};
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
index 27ce249..f23e2f3 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -123,7 +123,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.state.ToString() == "on",
Tag = function.sid + "_Switch",
};
bodyDiv.AddChidren(btnSwitch);
@@ -140,7 +140,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.state.ToString() == "on",
Tag = function.sid + "_Switch",
};
bodyDiv.AddChidren(btnSwitch);
@@ -160,11 +160,11 @@
LoadLastStatesButton();
break;
case FunctionCategory.Light:
- btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
+ btnSwitch.IsSelected = function.trait_on_off.state.ToString() == "on";
LoadLightControl();
break;
case FunctionCategory.Electric:
- btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
+ btnSwitch.IsSelected = function.trait_on_off.state.ToString() == "on";
break;
}
#endregion
@@ -265,7 +265,7 @@
SeekBarViewHeight = Application.GetRealHeight(8),
ThumbImagePath = "Public/ThumbImage.png",
ThumbImageHeight = Application.GetRealHeight(54),
- ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.PromptingColor2,
+ ProgressBarColor = function.trait_on_off.state.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.PromptingColor2,
ProgressTextColor = CSS_Color.FirstLevelTitleColor,
ProgressTextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
MaxValue = 100,
@@ -448,7 +448,7 @@
TextColor = 0x00000000,
TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
Tag = function.spk + "_laststates_" + function.sid,
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
bodyDiv.AddChidren(btnLastStates);
}
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
index 66a2ff8..0542613 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -17,7 +17,7 @@
{
if(bodyDiv!= null)
{
- Application.RunOnMainThread(() => {
+ Application.RunOnMainThread((Action)(() => {
if(bodyDiv.Tag.ToString() == upfunc.sid)
{
for (var o = 0; o < bodyDiv.ChildrenCount; o++)
@@ -29,7 +29,7 @@
{
if (btn.Tag.ToString() == upfunc.sid + "_Switch")// + "_DimmerBar")
{
- btn.IsSelected = upfunc.trait_on_off.curValue.ToString() == "on";
+ btn.IsSelected = upfunc.trait_on_off.state.ToString() == "on";
}
}
}
@@ -47,7 +47,7 @@
}
}
- });
+ }));
}
}
/// <summary>
@@ -93,13 +93,13 @@
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
if(fadeTime!= null)
{
int result = 0;
- int.TryParse(fadeTime.curValue.ToString(), out result);
+ int.TryParse(fadeTime.state.ToString(), out result);
d.Add(FunctionAttributeKey.FadeTime, result.ToString());
}
Control.Ins.SendWriteCommand(function, d);
@@ -121,9 +121,9 @@
{
if (function.Spk_Prefix == FunctionCategory.Light)
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add("on_off", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
}
})
@@ -199,10 +199,10 @@
btnClose.IsSelected = true;
btnStop.IsSelected = false;
btnOpen.IsSelected = false;
- curtain.trait_on_off.curValue = "off";
+ curtain.trait_on_off.state = "off";
curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(curtain, d);
};
@@ -211,9 +211,9 @@
btnStop.IsSelected = true;
btnClose.IsSelected = false;
btnOpen.IsSelected = false;
- curtain.trait_on_off.curValue = "stop";
+ curtain.trait_on_off.state = "stop";
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(curtain, d);
};
@@ -222,10 +222,10 @@
btnOpen.IsSelected = true;
btnClose.IsSelected = false;
btnStop.IsSelected = false;
- curtain.trait_on_off.curValue = "on";
+ curtain.trait_on_off.state = "on";
curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
Dictionary<string, string> d = new Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(curtain, d);
};
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index a097bcd..8b57d0e 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -808,7 +808,7 @@
{
btnMinus.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
+ if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
}
@@ -827,7 +827,7 @@
};
btnPlus.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
+ if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
}
@@ -875,7 +875,7 @@
{
btnMode.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off")
+ if (device.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -884,7 +884,7 @@
//鎵鏀瑰彉妯″紡
btnSwing.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off")
+ if (device.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -892,7 +892,7 @@
};
btnWindSpeed.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off")
+ if (device.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -902,8 +902,8 @@
btnSwitch.MouseUpEventHandler = (sender, e) =>
{
btnSwitch.IsSelected = !btnSwitch.IsSelected;
- device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
- if (device.trait_on_off.curValue.ToString() == "on")
+ device.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
+ if (device.trait_on_off.state.ToString() == "on")
{
arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
btnSwitch.IsSelected = true;
@@ -916,7 +916,7 @@
arcBar.IsOffline = true;
}
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(device, d);
};
}
@@ -930,15 +930,15 @@
/// </summary>
private void RefreshFormStatu()
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
- btnTemp.Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString();
+ btnTemp.Text = Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString();
btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "掳C";
btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing));
btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed));
arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
- if (device.trait_on_off.curValue.ToString() == "on")
+ if (device.trait_on_off.state.ToString() == "on")
{
arcBar.IsOffline = false;
btnSwitch.IsSelected = true;
@@ -959,7 +959,7 @@
arcBar.IsClickable = false;
arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
}
- });
+ }));
}
#endregion
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
index bfa25c1..6dc85c6 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -198,7 +198,7 @@
Height = Application.GetRealWidth(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = device.trait_on_off.curValue.ToString() == "on"
+ IsSelected = device.trait_on_off.state.ToString() == "on"
};
FrameWhiteCentet1.AddChidren(btnSwitch);
@@ -360,7 +360,7 @@
{
btnMinus.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
+ if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
}
@@ -379,7 +379,7 @@
};
btnPlus.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
+ if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
}
@@ -417,7 +417,7 @@
{
btnMode.MouseUpEventHandler = (sender, e) =>
{
- if (device.trait_on_off.curValue.ToString() == "off")
+ if (device.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -427,8 +427,8 @@
btnSwitch.MouseUpEventHandler = (sender, e) =>
{
btnSwitch.IsSelected = !btnSwitch.IsSelected;
- device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
- if (device.trait_on_off.curValue.ToString() == "on")
+ device.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
+ if (device.trait_on_off.state.ToString() == "on")
{
arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
btnSwitch.IsSelected = true;
@@ -441,7 +441,7 @@
arcBar.IsOffline = true;
}
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(device, d);
};
}
@@ -455,13 +455,13 @@
/// </summary>
private void RefreshFormStatu()
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp);
btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "掳C";
btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
- if (device.trait_on_off.curValue.ToString() == "on")
+ if (device.trait_on_off.state.ToString() == "on")
{
arcBar.IsOffline = false;
btnSwitch.IsSelected = true;
@@ -482,7 +482,7 @@
arcBar.IsClickable = false;
arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
}
- });
+ }));
}
#endregion
diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
index 345f80f..e82895a 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
@@ -146,11 +146,11 @@
{
Gravity = Gravity.CenterHorizontal,
OpenAngle = 160,
- ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
+ ThumbImagePath = function.trait_on_off.state.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
ThumbImageHeight = Application.GetRealWidth(50),
ProgressBarColor = CSS_Color.MainColor,
OfflineProgressBarColor = CSS_Color.PromptingColor2,
- IsOffline = function.trait_on_off.curValue.ToString() == "off",
+ IsOffline = function.trait_on_off.state.ToString() == "off",
MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min,
MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max,
//IsClickable = function.trait_on_off.curValue.ToString() == "on",
@@ -259,7 +259,7 @@
Height = Application.GetRealWidth(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
index 805a2ac..0ffb555 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -13,7 +13,7 @@
{
try
{
- Application.RunOnMainThread((() =>
+ Application.RunOnMainThread((Action)(() =>
{
if (bodyView == null)
{
@@ -30,7 +30,7 @@
bodyView.btnMode.UnSelectedImagePath = temp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
bodyView.btnWindSpeed.UnSelectedImagePath = temp.GetFanIconPath(updateTemp.GetAttrState(FunctionAttributeKey.FanSpeed));
bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
- if (updateTemp.trait_on_off.curValue.ToString() == "on")
+ if (updateTemp.trait_on_off.state.ToString() == "on")
{
bodyView.arcBar.IsOffline = false;
bodyView.btnSwitch.IsSelected = true;
@@ -92,7 +92,7 @@
{
btnMinus.MouseUpEventHandler = (sender, e) =>
{
- if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
+ if (function.trait_on_off.state.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
}
@@ -112,7 +112,7 @@
};
btnPlus.MouseUpEventHandler = (sender, e) =>
{
- if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
+ if (function.trait_on_off.state.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
{
return;
}
@@ -152,7 +152,7 @@
{
btnMode.MouseUpEventHandler = (sender, e) =>
{
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -160,7 +160,7 @@
};
btnWindSpeed.MouseUpEventHandler = (sender, e) =>
{
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -170,8 +170,8 @@
btnSwitch.MouseUpEventHandler = (sender, e) =>
{
btnSwitch.IsSelected = !btnSwitch.IsSelected;
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
- if (function.trait_on_off.curValue.ToString() == "on")
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
+ if (function.trait_on_off.state.ToString() == "on")
{
arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
btnSwitch.IsSelected = true;
@@ -184,7 +184,7 @@
arcBar.IsOffline = true;
}
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
};
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs
index 192d0ae..7e51ce8 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs
@@ -135,7 +135,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "off",
+ IsSelected = function.trait_on_off.state.ToString() == "off",
};
controlView.AddChidren(btnCurtainClose);
@@ -147,7 +147,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "stop",
+ IsSelected = function.trait_on_off.state.ToString() == "stop",
};
controlView.AddChidren(btnCurtainStop);
@@ -159,7 +159,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.state.ToString() == "on",
};
controlView.AddChidren(btnCurtainOpen);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
index 0087ce3..d37b3a4 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
@@ -12,27 +12,27 @@
/// </summary>
public static void UpdataState(Function updataTemp)
{
- Application.RunOnMainThread(() => {
+ Application.RunOnMainThread((Action)(() => {
if(bodyView == null)
{
return;
}
if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
{
- if (updataTemp.trait_on_off.curValue.ToString() == "stop")
+ if (updataTemp.trait_on_off.state.ToString() == "stop")
{
//bodyView.btnCurtainOpen.IsSelected = false;
//bodyView.btnCurtainClose.IsSelected = false;
//bodyView.btnCurtainStop.IsSelected = true;
}
- else if (updataTemp.trait_on_off.curValue.ToString() == "on")
+ else if (updataTemp.trait_on_off.state.ToString() == "on")
{
//bodyView.btnCurtainOpen.IsSelected = true;
//bodyView.btnCurtainClose.IsSelected = false;
//bodyView.btnCurtainStop.IsSelected = false;
bodyView.btnCurtainBgIcon.IsSelected = true;
}
- else if (updataTemp.trait_on_off.curValue.ToString() == "off")
+ else if (updataTemp.trait_on_off.state.ToString() == "off")
{
//bodyView.btnCurtainOpen.IsSelected = false;
//bodyView.btnCurtainClose.IsSelected = true;
@@ -40,7 +40,7 @@
bodyView.btnCurtainBgIcon.IsSelected = false;
}
}
- });
+ }));
}
void LoadEventList()
@@ -79,9 +79,9 @@
});
}) { IsBackground = true }.Start();
btnCurtainBgIcon.IsSelected = false;
- function.trait_on_off.curValue = "off";
+ function.trait_on_off.state = "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
};
@@ -106,9 +106,9 @@
});
})
{ IsBackground = true }.Start();
- function.trait_on_off.curValue = "stop";
+ function.trait_on_off.state = "stop";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
};
btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
@@ -121,9 +121,9 @@
})
{ IsBackground = true }.Start();
btnCurtainBgIcon.IsSelected = true;
- function.trait_on_off.curValue = "on";
+ function.trait_on_off.state = "on";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
};
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
index c94975f..74d7754 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -143,10 +143,10 @@
// });
//})
//{ IsBackground = true }.Start();
- function.trait_on_off.curValue = "off";
+ function.trait_on_off.state = "off";
function.SetAttrState(FunctionAttributeKey.Percent, 0);
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
CurtainAnimation(0);
};
@@ -163,9 +163,9 @@
});
})
{ IsBackground = true }.Start();
- function.trait_on_off.curValue = "stop";
+ function.trait_on_off.state = "stop";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
};
@@ -178,10 +178,10 @@
// });
//})
//{ IsBackground = true }.Start();
- function.trait_on_off.curValue = "on";
+ function.trait_on_off.state = "on";
function.SetAttrState(FunctionAttributeKey.Percent, 100);
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
CurtainAnimation(100);
};
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
index 511c748..cd9157f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -140,10 +140,10 @@
// });
//})
//{ IsBackground = true }.Start();
- function.trait_on_off.curValue = "off";
+ function.trait_on_off.state = "off";
function.SetAttrState(FunctionAttributeKey.Percent, 0);
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
CurtainAnimation(0);
};
@@ -157,9 +157,9 @@
});
})
{ IsBackground = true }.Start();
- function.trait_on_off.curValue = "stop";
+ function.trait_on_off.state = "stop";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
onCurtainAnimation = false;
};
@@ -173,10 +173,10 @@
// });
//})
//{ IsBackground = true }.Start();
- function.trait_on_off.curValue = "on";
+ function.trait_on_off.state = "on";
function.SetAttrState(FunctionAttributeKey.Percent, 100);
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
CurtainAnimation(100);
};
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs
index 1c96354..2942bae 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs
@@ -115,7 +115,7 @@
Y = Application.GetRealHeight(100),
Width = Application.GetRealWidth(198),
Height = Application.GetRealWidth(198),
- IsSelected = function.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.state.ToString() == "on",
SelectedImagePath = "FunctionIcon/Electrical/FanIconBg.png",
UnSelectedImagePath = "FunctionIcon/Electrical/FanIconBgGray.png",
};
@@ -167,7 +167,7 @@
Height = Application.GetMinRealAverage(40),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
index 86a0e73..338bbff 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
@@ -12,21 +12,21 @@
/// </summary>
public static void UpdataState(Function updateTemp)
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
if (bodyView == null)
return;
- 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.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.state.ToString() == "on";
+ bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.state.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.OpenLevel));
}
catch (Exception ex)
{
MainPage.Log($"RelayPage error {ex.Message}");
}
- });
+ }));
}
/// <summary>
/// 鍔犺浇浜嬩欢鍒楄〃
@@ -66,10 +66,10 @@
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = 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(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
@@ -80,9 +80,9 @@
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
@@ -92,9 +92,9 @@
function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString());
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
index 24734bf..ffe7427 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
@@ -114,7 +114,7 @@
Y = Application.GetRealHeight(100),
Width = Application.GetRealWidth(198),
Height = Application.GetRealWidth(198),
- IsSelected = function.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.state.ToString() == "on",
UnSelectedImagePath = "FunctionIcon/Socket/SocketIconBg.png",
SelectedImagePath = "FunctionIcon/Socket/SocketIconOnBg.png",
};
@@ -128,7 +128,7 @@
Height = Application.GetMinRealAverage(40),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs
index 300b194..347d9af 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs
@@ -12,19 +12,19 @@
/// </summary>
public static void UpdataState(Function uFan)
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
if (bodyView == null)
return;
- bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uFan.trait_on_off.curValue.ToString() == "on";
+ bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uFan.trait_on_off.state.ToString() == "on";
}
catch (Exception ex)
{
MainPage.Log($"RelayPage error {ex.Message}");
}
- });
+ }));
}
/// <summary>
/// 鍔犺浇浜嬩欢鍒楄〃
@@ -64,10 +64,10 @@
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = 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", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
@@ -78,10 +78,10 @@
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = 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", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
index cd99561..6d76c08 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -280,7 +280,7 @@
name = sensor.name,
sid = sensor.sid,
deviceId = sensor.deviceId,
- attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue } },
+ attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state } },
};
switch (seTemp.key)
{
@@ -742,7 +742,7 @@
public static void LoadEvent_UpdataStatus(Function updateTemp)
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
@@ -757,7 +757,7 @@
name = updateTemp.name,
sid = updateTemp.sid,
deviceId = updateTemp.deviceId,
- attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state ,curValue = seTemp.curValue} },
+ attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state} },
};
switch (seTemp.key)
{
@@ -827,7 +827,7 @@
{
MainPage.Log($"鏇存柊鐜浼犳劅鍣ㄧ晫闈㈠紓甯�:{ex.Message}");
}
- });
+ }));
}
void LoadEvent_ChangeWeatherIcon(FrameLayout view)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
index b90cd61..2c0d4b9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
@@ -147,11 +147,11 @@
{
Gravity = Gravity.CenterHorizontal,
OpenAngle = 160,
- ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
+ ThumbImagePath = function.trait_on_off.state.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
ThumbImageHeight = Application.GetRealWidth(50),
ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04,
OfflineProgressBarColor = CSS_Color.PromptingColor2,
- IsOffline = function.trait_on_off.curValue.ToString() == "off",
+ IsOffline = function.trait_on_off.state.ToString() == "off",
MinValue = minValue,//function.GetAttribute(FunctionAttributeKey.SetTemp).min,
MaxValue = maxValue,// function.GetAttribute(FunctionAttributeKey.SetTemp).max,
ArcColor = CSS_Color.BackgroundColor,
@@ -252,7 +252,7 @@
Height = Application.GetRealWidth(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
index 950bbd0..e144964 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -13,7 +13,7 @@
{
try
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
if (bodyView == null)
{
@@ -37,7 +37,7 @@
// bodyView.arcBar.IsOffline = true;
//}
- if (updateTemp.trait_on_off.curValue.ToString() == "on")
+ if (updateTemp.trait_on_off.state.ToString() == "on")
{
bodyView.arcBar.IsOffline = false;
bodyView.btnSwitch.IsSelected = true;
@@ -60,7 +60,7 @@
}
- });
+ }));
}
catch (Exception ex)
{
@@ -101,7 +101,7 @@
{
btnMinus.MouseUpEventHandler = (sender, e) =>
{
- if(function.trait_on_off.curValue.ToString() == "off")
+ if(function.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -121,7 +121,7 @@
};
btnPlus.MouseUpEventHandler = (sender, e) =>
{
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -159,7 +159,7 @@
{
btnMode.MouseUpEventHandler = (sender, e) =>
{
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -169,8 +169,8 @@
btnSwitch.MouseUpEventHandler = (sender, e) =>
{
btnSwitch.IsSelected = !btnSwitch.IsSelected;
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
- if (function.trait_on_off.curValue.ToString() == "on")
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
+ if (function.trait_on_off.state.ToString() == "on")
{
//arcBar.ProgressBarColor = CSS_Color.MainColor;
arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png";
@@ -185,7 +185,7 @@
arcBar.IsOffline = true;
}
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
Control.Ins.SendWriteCommand(function, d);
};
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
index c0e7a94..623b0d0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -150,7 +150,7 @@
IsProgressTextShow = false,
};
controlView.AddChidren(dimmerBar);
- if (function.trait_on_off.curValue.ToString() == "on")
+ if (function.trait_on_off.state.ToString() == "on")
{
dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
}
@@ -308,7 +308,7 @@
Height = Application.GetRealWidth(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.state.ToString() == "on",
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
index 2bb7c7b..3fcc959 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -12,7 +12,7 @@
/// </summary>
public static void UpdataStatus(Function updataTemp)
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
@@ -20,7 +20,7 @@
return;
if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
{
- if (updataTemp.trait_on_off.curValue.ToString() == "on")
+ if (updataTemp.trait_on_off.state.ToString() == "on")
{
bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
if (!bodyView.onDimmerBar)
@@ -34,8 +34,8 @@
{
bodyView.dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
}
- bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
- bodyView.barColorTemplatrue.Enable = updataTemp.trait_on_off.curValue.ToString() == "on";
+ bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.state.ToString() == "on";
+ bodyView.barColorTemplatrue.Enable = updataTemp.trait_on_off.state.ToString() == "on";
var cct = 27;
int.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.CCT), out cct);
bodyView.barColorTemplatrue.Progress = cct / 100;
@@ -48,7 +48,7 @@
{
MainPage.Log($"{bodyView.GetType().Name } UpdataStates error : {ex.Message}");
}
- });
+ }));
}
void LoadEventList()
@@ -202,9 +202,9 @@
}
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
if (btnSwitch.IsSelected)
{
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
index 2da3103..709c72c 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
@@ -144,7 +144,7 @@
IsProgressTextShow = false,
};
controlView.AddChidren(dimmerBar);
- if(function.trait_on_off.curValue.ToString() == "on")
+ if(function.trait_on_off.state.ToString() == "on")
{
dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
}
@@ -242,7 +242,7 @@
Height = Application.GetMinRealAverage(40),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.state.ToString() == "on",
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
index a0daf23..e55e880 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -12,7 +12,7 @@
/// </summary>
public static void UpdataStates(Function updataTemp)
{
- Application.RunOnMainThread((() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
@@ -22,7 +22,7 @@
{
bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%";
bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32( updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40);
- if (updataTemp.trait_on_off.curValue.ToString() == "on")
+ if (updataTemp.trait_on_off.state.ToString() == "on")
{
bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
if (!bodyView.onDimmerBar)
@@ -34,7 +34,7 @@
{
bodyView.dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
}
- bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
+ bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.state.ToString() == "on";
}
}
catch (Exception ex)
@@ -154,9 +154,9 @@
}
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
if (btnSwitch.IsSelected)
{
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
index bcbc5c1..667d40b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
@@ -164,7 +164,7 @@
ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
};
framePickerBack.AddChidren(colorPicker);
- if(function.trait_on_off.curValue.ToString() == "off")
+ if(function.trait_on_off.state.ToString() == "off")
{
colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
}
@@ -221,7 +221,7 @@
ThumbImageHeight = Application.GetRealHeight(54),
ProgressTextColor = CSS_Color.FirstLevelTitleColor,
ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.DividingLineColor,
+ ProgressBarColor = function.trait_on_off.state.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.DividingLineColor,
MaxValue = 100,
Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
SeekBarPadding = Application.GetRealWidth(20),
@@ -328,7 +328,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
index b0c2522..e040d64 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
@@ -11,7 +11,7 @@
/// </summary>
public static void UpdataStates(Function updateTemp)
{
- Application.RunOnMainThread((() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
@@ -20,7 +20,7 @@
if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
{
- if (updateTemp.trait_on_off.curValue.ToString() == "on")
+ if (updateTemp.trait_on_off.state.ToString() == "on")
{
//瑙e喅閮ㄥ垎瀹夊崜鎵嬫満锛屽埛鏂板浘鐗囨椂浼氬彉灏忛棶棰�
if (bodyView.colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheel.png")
@@ -35,7 +35,7 @@
}
}
//鐘舵�佷竴鏍锋椂,涓嶅啀鍒锋柊瑙嗗浘
- else if (updateTemp.trait_on_off.curValue.ToString() == "off" && bodyView.btnSwitch.IsSelected == true)
+ else if (updateTemp.trait_on_off.state.ToString() == "off" && bodyView.btnSwitch.IsSelected == true)
{
//瑙e喅閮ㄥ垎瀹夊崜鎵嬫満锛屽埛鏂板浘鐗囨椂浼氬彉灏忛棶棰�
if (bodyView.colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheelGray.png")
@@ -95,7 +95,7 @@
int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12);
colorPicker.ColorChaged += (sender2, e2) => {
- if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false)
+ if (function.trait_on_off.state.ToString() == "off" || pointIsRight == false)
{
//pointIsRight:鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
return;
@@ -104,7 +104,7 @@
};
colorPicker.MouseDownEventHandler += (sender, e) =>
{
- if (function.trait_on_off.curValue.ToString() == "off")
+ if (function.trait_on_off.state.ToString() == "off")
{
return;
}
@@ -150,7 +150,7 @@
var colorChangeEvent = new System.Threading.Thread(() => {
while (this.Parent != null)
{
- if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false)
+ if (function.trait_on_off.state.ToString() == "off" || pointIsRight == false)
{
//pointIsRight:鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
continue;
@@ -267,9 +267,9 @@
bodyView.colorPicker.ColorImagePath = btnSwitch.IsSelected ? "FunctionIcon/Light/ColorWheel.png" : "FunctionIcon/Light/ColorWheelGray.png";
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+ d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
if (btnSwitch.IsSelected)
{
@@ -296,7 +296,7 @@
{
btnRestoredPoint.MouseUpEventHandler = (sender, e) =>
{
- if(function.trait_on_off.curValue.ToString() == "off")
+ if(function.trait_on_off.state.ToString() == "off")
{
return;
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
index 1bb8d06..c4bafe9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
@@ -138,7 +138,7 @@
Height = Application.GetRealWidth(288),
UnSelectedImagePath = "FunctionIcon/Light/RelayBg.png",
SelectedImagePath = "FunctionIcon/Light/RelayOnBg.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
controlView.AddChidren(btnSwitchIcon);
@@ -150,7 +150,7 @@
Height = Application.GetMinRealAverage(32),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = function.trait_on_off.curValue.ToString() == "on"
+ IsSelected = function.trait_on_off.state.ToString() == "on"
};
controlView.AddChidren(btnSwitch);
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
index 6fc5a4a..2a22bab 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
@@ -11,7 +11,7 @@
/// </summary>
public static void UpdataState(Function updataTemp)
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
try
{
@@ -19,14 +19,14 @@
return;
if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
{
- bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
+ bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.state.ToString() == "on";
}
}
catch (Exception ex)
{
MainPage.Log($"RelayPage error {ex.Message}");
}
- });
+ }));
}
/// <summary>
/// 鍔犺浇浜嬩欢鍒楄〃
@@ -65,9 +65,9 @@
btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected;
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitchIcon.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
@@ -77,9 +77,9 @@
btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected;
new System.Threading.Thread(() =>
{
- function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
- d.Add("on_off", function.trait_on_off.curValue.ToString());
+ d.Add("on_off", function.trait_on_off.state.ToString());
DriverLayer.Control.Ins.SendWriteCommand(function, d);
})
{ IsBackground = true }.Start();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
index dd36144..f734dd1 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -219,16 +219,16 @@
finally
{
#region 鏇存柊鍏朵粬鐣岄潰闊充箰鐘舵��
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread((Action)(() =>
{
- a31MusicModel.trait_on_off.curValue = a31MusicModel.A31PlayStatus.status == "play" ? "on" : "off";
+ a31MusicModel.trait_on_off.state = a31MusicModel.A31PlayStatus.status == "play" ? "on" : "off";
//Console.WriteLine($"music : {a31MusicModel.sid} : {a31MusicModel.on_off}");
HomePage.UpdataFunctionStates(a31MusicModel);
foreach (var e in A31MusicModel.A31MusicModelList)
{
RoomPage.UpdataStates(a31MusicModel);
}
- });
+ }));
#endregion
}
}
--
Gitblit v1.8.0