From 7d005a7618e3d7a80d8ede3baf6ecc4bf8019cd5 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 01 九月 2020 15:22:09 +0800
Subject: [PATCH] 2020-09-01
---
HDL_ON/DriverLayer/Control.cs | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/HDL_ON/DriverLayer/Control.cs b/HDL_ON/DriverLayer/Control.cs
index a93f3a5..09e777c 100644
--- a/HDL_ON/DriverLayer/Control.cs
+++ b/HDL_ON/DriverLayer/Control.cs
@@ -81,7 +81,7 @@
{
foreach(var busSceneData in scene.bus_SceneData)
{
- foreach(var function in DB_ResidenceData.residenceData.functionList.GetAllDeviceFunctionList())
+ foreach(var function in DB_ResidenceData.functionList.GetAllDeviceFunctionList())
{
if(busSceneData.Key == function.sid)
{
@@ -104,17 +104,17 @@
var fh = function as FloorHeating;
if (fh.modeTemp.Count == 4)
{
- byte b1 = fh.on_off == "on" ? (byte)1 : (byte)0;
+ byte b1 = fh.trait_on_off.value.ToString() == "on" ? (byte)1 : (byte)0;
if (fh.workMode > 0)
{
b1 += (byte)(16 + fh.workMode);
}
- ControlBytesSend(Command.SetFloorHeat, function.bus_Data.SubnetID, function.bus_Data.DeviceID, new byte[] { fh.bus_Data.LoopID, b1, (byte)fh.curTempType, fh.curModeIndex, fh.modeTemp["ordinary"], fh.modeTemp["day"], fh.modeTemp["night"], fh.modeTemp["away"], 0, 0 });
+ ControlBytesSend(Command.SetFloorHeat, function.bus_Data.SubnetID, function.bus_Data.DeviceID, new byte[] { fh.bus_Data.LoopID, b1, (byte)fh.curTempType, fh.curModeIndex, fh.modeTemp["normal"], fh.modeTemp["day"], fh.modeTemp["night"], fh.modeTemp["away"], 0, 0 });
}
break;
case FunctionType.Socket:
var s = function as SwitchSocket;
- ControlBytesSend(Command.SetSingleLight, function.bus_Data.SubnetID, function.bus_Data.DeviceID, new byte[] { s.bus_Data.LoopID, s.on_off == "on" ? (byte)100 : (byte)0 });
+ ControlBytesSend(Command.SetSingleLight, function.bus_Data.SubnetID, function.bus_Data.DeviceID, new byte[] { s.bus_Data.LoopID, s.trait_on_off.value.ToString() == "on" ? (byte)100 : (byte)0 });
break;
}
}
@@ -145,7 +145,7 @@
case FunctionType.RGB:
MainPage.Log($"rgb level : {light.brightness}");
byte b = 100;//寮�鍏虫搷浣滀緷鎹畂n_off瀛楁锛屽疄闄呭紑鍏冲�间緷鎹産rightness锛屽綋on_off涓烘墦寮�锛宐rightness涓嶈兘涓�0
- if (light.on_off == "off")
+ if (light.trait_on_off.value.ToString() == "off")
{
b = 0;
}
@@ -163,7 +163,7 @@
break;
case FunctionType.Dimmer:
byte b1 = 100;
- if (light.on_off == "off")
+ if (light.trait_on_off.value.ToString() == "off")
{
b1 = 0;
}
@@ -177,7 +177,7 @@
0, 0 });
break;
case FunctionType.Relay:
- ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus_Data.LoopID, light.on_off == "on" ? (byte)100 : (byte)0, 0, 0 });
+ ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus_Data.LoopID, light.trait_on_off.value.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 });
break;
}
break;
@@ -187,11 +187,11 @@
{
case FunctionType.Curtain:
byte b1 = 0;
- if (curtain.on_off == "stop")
+ if (curtain.trait_on_off.value.ToString() == "stop")
{
b1 = 0;
}
- else if (curtain.on_off == "on")
+ else if (curtain.trait_on_off.value.ToString() == "on")
{
b1 = 1;
}
@@ -203,15 +203,15 @@
break;
case FunctionType.MotorCurtain:
case FunctionType.RollingShutter:
- if (curtain.on_off == "stop")
+ if (curtain.trait_on_off.value.ToString() == "stop")
{
ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus_Data.LoopID, 0 });
}
- else if (curtain.on_off == "on")
+ else if (curtain.trait_on_off.value.ToString() == "on")
{
ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, 100 });
}
- else if (curtain.on_off == "off")
+ else if (curtain.trait_on_off.value.ToString() == "off")
{
ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, 0 });
}
@@ -223,14 +223,14 @@
{
case FunctionType.AC:
var aC = function as AC;
- ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { aC.bus_Data.LoopID, (byte)aC.curTempType, 32, 32, 32, 32, 32, 0, aC.on_off == "on" ? (byte)1 : (byte)0, aC.curModeIndex, aC.curFanIndex, (byte)aC.curTemp, 0 });
+ ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { aC.bus_Data.LoopID, (byte)aC.curTempType, 32, 32, 32, 32, 32, 0, aC.trait_on_off.value.ToString() == "on" ? (byte)1 : (byte)0, aC.curModeIndex, aC.curFanIndex, (byte)aC.trait_temp.value, 0 });
//ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 3, aC.on_off == "on" ? (byte)1 : (byte)0, aC.bus_Data.LoopID });
foreach (var dic in commandDictionary)
{
switch (dic.Key)
{
case "on_off":
- Control.ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 3, aC.on_off == "on" ? (byte)1 : (byte)0, aC.bus_Data.LoopID });
+ Control.ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 3, aC.trait_on_off.value.ToString() == "on" ? (byte)1 : (byte)0, aC.bus_Data.LoopID });
break;
case "mode":
Control.ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 6, aC.curModeIndex, aC.bus_Data.LoopID });
@@ -258,7 +258,7 @@
modeKey = 2;
break;
}
- Control.ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { modeKey, Convert.ToByte(aC.curTemp), aC.bus_Data.LoopID });
+ Control.ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { modeKey, Convert.ToByte(aC.trait_temp.value), aC.bus_Data.LoopID });
break;
default:
MainPage.Log($"鍔熻兘鏈敮鎸� : {dic.Key}");
@@ -271,12 +271,12 @@
var fh = function as FloorHeating;
if (fh.modeTemp.Count == 4)
{
- byte b1 = fh.on_off == "on" ? (byte)1 : (byte)0;
+ byte b1 = fh.trait_on_off.value.ToString() == "on" ? (byte)1 : (byte)0;
if (fh.workMode > 0)
{
b1 += (byte)(16 + fh.workMode);
}
- ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { fh.bus_Data.LoopID, b1, (byte)fh.curTempType, fh.curModeIndex, fh.modeTemp["ordinary"], fh.modeTemp["day"], fh.modeTemp["night"], fh.modeTemp["away"], 0, 0 });
+ ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { fh.bus_Data.LoopID, b1, (byte)fh.curTempType, fh.curModeIndex, fh.modeTemp["normal"], fh.modeTemp["day"], fh.modeTemp["night"], fh.modeTemp["away"], 0, 0 });
}
//else
//{
@@ -290,7 +290,7 @@
{
case FunctionType.Fan:
var fan = function as Fan;
- if (fan.on_off == "on")
+ if (fan.trait_on_off.value.ToString() == "on")
{
ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus_Data.LoopID, (byte)fan.openLevel });
}
@@ -305,7 +305,7 @@
{
case FunctionType.Socket:
var s = function as SwitchSocket;
- ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus_Data.LoopID, s.on_off == "on" ? (byte)100 : (byte)0 });
+ ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus_Data.LoopID, s.trait_on_off.value.ToString() == "on" ? (byte)100 : (byte)0 });
break;
}
break;
--
Gitblit v1.8.0