From f25c6122eb7e26be5e7f036cf29b9019c4953be2 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 21 十二月 2020 19:44:02 +0800
Subject: [PATCH] Merge branch 'WJC' into NewFilePath
---
HDL_ON/DAL/DriverLayer/Packet.cs | 42 +++++++++++++++++++++---------------------
1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index 53c41fb..6164b0e 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -163,12 +163,12 @@
case Command.ReadLightAllLoopBrightnessACK:
for (int i = 0; i < receiveBytes[0]; i++)
{
- var light = FunctionList.List.lights.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == (i + 1));
+ var light = FunctionList.List.lights.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == (i + 1));
if (light != null)
{
if (light.functionType != FunctionType.RGB)
{
- light.trait_on_off.curValue = receiveBytes[light.bus.loopId] == 0 ? "off" : "on";
+ light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
if (light.trait_on_off.curValue.ToString() == "on")
{
light.brightness = receiveBytes[2];
@@ -191,7 +191,7 @@
}
else
{
- var e = FunctionList.List.electricals.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == i);
+ var e = FunctionList.List.electricals.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == i);
if (e != null)
{
var fan = e as Fan;
@@ -232,9 +232,7 @@
rgb.brightness = receiveBytes[1];
rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%";
}
- rgb.redColor = receiveBytes[6];
- rgb.greenColor = receiveBytes[7];
- rgb.blueColor = receiveBytes[8];
+ rgb.SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] });
HomePage.UpdataFunctionStates(rgb);
RoomPage.UpdataStates(rgb);
@@ -266,7 +264,7 @@
}
else
{
- if (curtain.bus.loopId != receiveBytes[0])
+ if (curtain.bus.LoopId != receiveBytes[0])
continue;
switch (receiveBytes[1])
{
@@ -309,11 +307,11 @@
if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
{
ac.curTempType = receiveBytes[1];
- ac.trait_IndoorTemp.curValue = receiveBytes[2];
+ ac.trait_IndoorTemp.curValue = receiveBytes[2].ToString();
ac.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
ac.curModeIndex = receiveBytes[9];
ac.curFanIndex = receiveBytes[10];
- ac.trait_temp.curValue = receiveBytes[11];
+ ac.trait_temp.curValue = receiveBytes[11].ToString();
ac.lastState = "";
switch (ac.trait_mode.curValue.ToString())
{
@@ -403,31 +401,31 @@
{
case "normal":
fh.lastState = Language.StringByID(StringId.Normal);
- fh.trait_temp.curValue = receiveBytes[4];
+ fh.trait_temp.curValue = receiveBytes[4].ToString();
break;
case "day":
fh.lastState = Language.StringByID(StringId.Day);
- fh.trait_temp.curValue = receiveBytes[5];
+ fh.trait_temp.curValue = receiveBytes[5].ToString();
break;
case "night":
fh.lastState = Language.StringByID(StringId.Night);
- fh.trait_temp.curValue = receiveBytes[6];
+ fh.trait_temp.curValue = receiveBytes[6].ToString();
break;
case "timer":
fh.lastState = Language.StringByID(StringId.Auto);
if (receiveBytes[8] == 0)
{
fh.timeFlag = 0;
- fh.trait_temp.curValue = receiveBytes[5];
+ fh.trait_temp.curValue = receiveBytes[5].ToString();
}
else
{
fh.timeFlag = 1;
- fh.trait_temp.curValue = receiveBytes[6];
+ fh.trait_temp.curValue = receiveBytes[6].ToString();
}
break;
case "away":
- fh.trait_temp.curValue = receiveBytes[7];
+ fh.trait_temp.curValue = receiveBytes[7].ToString();
fh.lastState = Language.StringByID(StringId.Away);
break;
}
@@ -448,7 +446,7 @@
if (sensor.bus != null)
{
if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID &&
- sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2])
+ sensor.bus.DeviceID == deviceID && sensor.bus.LoopId == receiveBytes[2])
{
switch (dt)
{
@@ -481,7 +479,7 @@
if (sensor.bus != null)
{
if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID &&
- sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2])
+ sensor.bus.DeviceID == deviceID && sensor.bus.LoopId == receiveBytes[2])
{
//0淇濈暀 1鏃犵鍙�4Byte鏁村舰 2鏈夌鍙�4Byte鏁村舰 3Float褰紙浠B憋級
switch (receiveBytes[3])
@@ -537,7 +535,7 @@
case 7:
case 8:
case 19:
- ac.trait_temp.curValue = receiveBytes[1];
+ ac.trait_temp.curValue = receiveBytes[1].ToString();
break;
case 5:
ac.curFanIndex = receiveBytes[1];
@@ -563,7 +561,7 @@
{
if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
{
- ac.trait_IndoorTemp.curValue = receiveBytes[1];
+ ac.trait_IndoorTemp.curValue = receiveBytes[1].ToString();
FunctionPage.UpdataStates(ac);
}
}
@@ -574,6 +572,8 @@
MainPage.Log($"name : {Name} ; mac : {mac}");
if (DB_ResidenceData.Instance.residenceGatewayMAC == mac)
{
+ //鏈湴鎼滅储缃戝叧鎴愬姛
+ Control.Ins.IsSearchLocalGatewaySuccessful = true;
Control.Ins.GatewayOnline = true;
Control.Ins.IsRemote = false;
DAL.Mqtt.MqttClient.DisConnectRemote();//鏂紑mqtt
@@ -644,12 +644,12 @@
receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]);
break;
case Command.ReadRemark:
- DriverLayer.Control.Ins.myUdp.ReceiveReadRemark(usefulBytes);
+ new Control_Udp().ReceiveReadRemark(usefulBytes);
break;
default:
break;
}
- DriverLayer.Control.Ins.myUdp.ReceiveRepeatManager(receiveFlag);
+ Control_Udp.ReceiveRepeatManager(receiveFlag,usefulBytes);
}
catch (Exception ex)
{
--
Gitblit v1.8.0