From 6c8946b21635246355ec41f216426783685a14b2 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 14 十月 2020 09:14:09 +0800
Subject: [PATCH] 20201013

---
 HDL_ON/DriverLayer/CommonPage.cs |   36 +++++++++++++++++-------------------
 1 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/HDL_ON/DriverLayer/CommonPage.cs b/HDL_ON/DriverLayer/CommonPage.cs
index 92167dd..825b601 100644
--- a/HDL_ON/DriverLayer/CommonPage.cs
+++ b/HDL_ON/DriverLayer/CommonPage.cs
@@ -27,6 +27,7 @@
             }
         }
 
+
         ///淇濆瓨璁惧澶囨敞鎵嶇敤gb2312锛屽叾浠栨儏鍐电敤utf8
         public static Encoding MyEncodingUTF8 = Encoding.UTF8;//Get
         public static Encoding MyEncodingGB2312
@@ -65,15 +66,10 @@
             return BitConverter.ToSingle(byteTemp, 0);
         }
 
-
         static void Packet_ReceiveEvent(byte subnetID, byte deviceID, Command command, byte[] receiveBytes, string revGatewayIP)
         {
             try
             {
-                if(revGatewayIP == "172.16.2.237")
-                {
-
-                }
                 Control.controlLostCount = 0;
 
                 switch (command)
@@ -88,12 +84,6 @@
                             {
                                 if (updataObj.functionType != FunctionType.RGB)
                                 {
-                                    var newState = receiveBytes[2] == 0 ? "off" : "on";
-                                    if (updataObj.trait_on_off.value.ToString() == newState)
-                                    {
-                                        //鐘舵�佷竴鏍凤紝涓嶇敤鍐嶅埛鏂伴〉闈�
-                                        break;
-                                    }
                                     if (updataObj.trait_on_off.value.ToString() == "on")
                                     {
                                         if (updataObj.functionType == FunctionType.Fan)
@@ -255,11 +245,16 @@
                                 FunctionPage.UpdataStates(curtain);
                                 HomePage.UpdataFunctionStates(curtain);
                                 ClassificationPage.UpdataInfo(curtain);
-                                RollingShutterPage.UpdataState(curtain);
                                 switch (curtain.functionType)
                                 {
                                     case FunctionType.Curtain:
                                         CurtainModulePage.UpdataState(curtain);
+                                        break;
+                                    case FunctionType.MotorCurtain:
+                                        MotorCurtainPage.UpdataState(curtain);
+                                        break;
+                                    case FunctionType.RollingShutter:
+                                        RollingShutterPage.UpdataState(curtain);
                                         break;
                                 }
                             }
@@ -366,35 +361,35 @@
                                 {
                                     case "normal":
                                         fh.lastState = Language.StringByID(StringId.Normal);
-                                        fh.curTemp = receiveBytes[4];
+                                        fh.trait_temp.value = receiveBytes[4];
                                         break;
                                     case "day":
                                         fh.lastState = Language.StringByID(StringId.Day);
-                                        fh.curTemp = receiveBytes[5];
+                                        fh.trait_temp.value = receiveBytes[5];
                                         break;
                                     case "night":
                                         fh.lastState = Language.StringByID(StringId.Night);
-                                        fh.curTemp = receiveBytes[6];
+                                        fh.trait_temp.value = receiveBytes[6];
                                         break;
                                     case "timer":
                                         fh.lastState = Language.StringByID(StringId.Auto);
                                         if (receiveBytes[8] == 0)
                                         {
                                             fh.timeFlag = 0;
-                                            fh.curTemp = receiveBytes[5];
+                                            fh.trait_temp.value = receiveBytes[5];
                                         }
                                         else
                                         {
                                             fh.timeFlag = 1;
-                                            fh.curTemp = receiveBytes[6];
+                                            fh.trait_temp.value = receiveBytes[6];
                                         }
                                         break;
                                     case "away":
-                                        fh.curTemp = receiveBytes[7];
+                                        fh.trait_temp.value = receiveBytes[7];
                                         fh.lastState = Language.StringByID(StringId.Away);
                                         break;
                                 }
-                                fh.lastState += " " + fh.curTemp + fh.tempUnitString;
+                                fh.lastState += " " + fh.trait_temp.value + fh.tempUnitString;
                                 RoomPage.UpdataStates(fh);
                                 FunctionPage.UpdataStates(fh);
                                 HomePage.UpdataFunctionStates(fh);
@@ -531,6 +526,9 @@
                             }
                         }
                         break;
+                    case Command.ReadGatewayACK:
+                        Control.VerGateway(receiveBytes);
+                        break;
                 }
             }
             catch (Exception ex)

--
Gitblit v1.8.0