From 30ebeb780347d7cfd076edac9a0ccf90c7edc7b9 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 30 八月 2021 10:39:23 +0800
Subject: [PATCH] 新风单控
---
HDL_ON/DAL/DriverLayer/Packet.cs | 44 ++++++++++++++++++++++++++++++--------------
1 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index e67231e..5994565 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -97,7 +97,8 @@
{
ddd += bb + ",";
}
- MainPage.Log(((int)command) + " : " + ddd);
+ MainPage.Log($"bus鍛戒护:" + ((int)command).ToString("X").PadLeft(4, '0') + " : 鏁版嵁:" + ddd);
+ //MainPage.Log($"bus鍛戒护:"+ ((int)command) + " : 鏁版嵁:" + ddd);
#endif
//澶勭悊鏄惁瑕侀噸鍙戞暟鎹�
ManagerReceive(subnetID, deviceID, command, usefulBytes);
@@ -179,7 +180,7 @@
light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
if (light.trait_on_off.curValue.ToString() == "on")
{
- light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[2].ToString());
+ light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[i+1].ToString());
light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
}
HomePage.UpdataFunctionStates(light);
@@ -227,25 +228,40 @@
break;
case Command.SetLogicLoopColorACK:
case Command.ReadLogicLoopColorACK:
- foreach (var rgb in FunctionList.List.GetLightList())
+ foreach (var lightTeme in FunctionList.List.GetLightList())
{
- if (rgb.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
+ if (lightTeme.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
{
- if (rgb.spk == SPK.LightRGB)
+ if (lightTeme.spk == SPK.LightRGB)
{
- rgb.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
+ lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
if (receiveBytes[1] > 0)
{
- rgb.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
- rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%";
+ lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
+ lightTeme.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%";
}
- new Light().SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }, rgb);
+ new Light().SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }, lightTeme);
- HomePage.UpdataFunctionStates(rgb);
- RoomPage.UpdataStates(rgb);
- FunctionPage.UpdataStates(rgb);
- ClassificationPage.UpdataInfo(rgb);
- RGBPage.UpdataStates(rgb);
+ HomePage.UpdataFunctionStates(lightTeme);
+ RoomPage.UpdataStates(lightTeme);
+ FunctionPage.UpdataStates(lightTeme);
+ ClassificationPage.UpdataInfo(lightTeme);
+ RGBPage.UpdataStates(lightTeme);
+ }else if(lightTeme.spk == SPK.LightCCT)
+ {
+ lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
+ if (receiveBytes[1] > 0)
+ {
+ lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
+ lightTeme.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%";
+ }
+ new Light().SetCCT(new byte[] { receiveBytes[6], receiveBytes[7] }, lightTeme);
+
+ HomePage.UpdataFunctionStates(lightTeme);
+ RoomPage.UpdataStates(lightTeme);
+ FunctionPage.UpdataStates(lightTeme);
+ ClassificationPage.UpdataInfo(lightTeme);
+ ColorTureLampPage.UpdataStatus(lightTeme);
}
}
}
--
Gitblit v1.8.0