From 0c1e29166e6b188939c092d16f87ce2a27662c5f Mon Sep 17 00:00:00 2001
From: tzy <hxb@hdlchina.com.cn>
Date: 星期五, 26 三月 2021 10:11:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/temp-wxr' into dev-tzy

---
 HDL-ON_Android/Properties/AndroidManifest.xml                    |    2 
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs                             |    1 
 HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs                 |    1 
 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs   |    4 
 HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs |    5 
 HDL-ON_iOS/HDL-ON_iOS.csproj                                     |    3 
 HDL_ON/UI/UI1-Login/LoginPageBLL.cs                              |   15 +
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs             |    4 
 HDL_ON/DAL/DriverLayer/Control_Udp.cs                            |  211 +++++++++++++++++++----------
 HDL-ON_iOS/Info.plist                                            |    4 
 HDL_ON/DAL/Server/HttpServerRequest.cs                           |    4 
 HDL_ON/DAL/DriverLayer/Packet.cs                                 |   73 ++++++----
 .vs/HDL_APP_Project/xs/UserPrefs.xml                             |   44 ++---
 HDL_ON/UI/MainPage.cs                                            |    2 
 HDL_ON/UI/UI1-Login/LoginPage.cs                                 |    4 
 15 files changed, 233 insertions(+), 144 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 02ec9ba..c45b4dc 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,38 +1,34 @@
 锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs">
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.94B44E9C-E1BC-4BF7-812E-FC71E9B623B2" />
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/DriverLayer/Control_Udp.cs">
     <Files>
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="133" Column="34" />
-      <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" Line="427" Column="1" />
       <File FileName="HDL-ON_iOS/Info.plist" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/BrandListView.cs" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" />
-      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" />
-      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" />
-      <File FileName="HDL_ON/Entity/Function/Scene.cs" />
-      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" />
-      <File FileName="HDL_ON/UI/MainPage.cs" />
-      <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs" Line="136" Column="83" />
+      <File FileName="HDL_ON/UI/MainPage.cs" Line="19" Column="44" />
+      <File FileName="HDL_ON/Entity/Enumerative/Command.cs" Line="1864" Column="28" />
+      <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="303" Column="15" />
+      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="195" Column="50" />
+      <File FileName="HDL_ON/Entity/DB_ResidenceData.cs" Line="95" Column="58" />
+      <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="556" Column="96" />
+      <File FileName="../../../../Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets" Line="1912" Column="3" />
+      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="1" Column="1" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
           <Node name="HDL_APP_Project" expanded="True">
             <Node name="HDL_ON" expanded="True">
-              <Node name="UI" expanded="True">
-                <Node name="UI2" expanded="True">
-                  <Node name="4-PersonalCenter" expanded="True">
-                    <Node name="PirDevice" expanded="True" />
-                  </Node>
-                  <Node name="FuntionControlView" expanded="True">
-                    <Node name="1ContorlPage" expanded="True">
-                      <Node name="AcControlPage_AddIrButton.cs" selected="True" />
-                    </Node>
-                  </Node>
+              <Node name="DAL" expanded="True">
+                <Node name="DriverLayer" expanded="True">
+                  <Node name="Control_Udp.cs" selected="True" />
                 </Node>
+                <Node name="Server" expanded="True" />
               </Node>
+              <Node name="Entity" expanded="True" />
             </Node>
-            <Node name="ys" expanded="True" />
+            <Node name="HDL-ON_Android" expanded="True">
+              <Node name="Properties" expanded="True" />
+            </Node>
+            <Node name="HDL-ON_iOS" expanded="True" />
           </Node>
         </State>
       </Pad>
@@ -44,7 +40,7 @@
     <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
     <String>Shared.IOS/Shared.IOS.csproj</String>
   </DisabledProjects>
-  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
+  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" />
   <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     <BreakpointStore />
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index d1cd886..a17439a 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103241" android:versionName="1.1.202103241" package="com.hdl.onpro">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103251" android:versionName="1.1.202103251" package="com.hdl.onpro">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" />
 	<!--  瀹氫綅鏉冮檺-->
 	<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index 29bd8f2..c9fb05f 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -64,8 +64,7 @@
         <WarningLevel>4</WarningLevel>
         <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
         <MtouchArch>ARM64</MtouchArch>
-        <CodesignKey>iPhone Distribution: HDL Automation Co., Ltd (BVTA78PRYA)</CodesignKey>
-        <CodesignProvision>Automatic:AdHoc</CodesignProvision>
+        <CodesignKey>Apple Distribution: HDL Automation Co., Ltd (BVTA78PRYA)</CodesignKey>
         <MtouchLink>SdkOnly</MtouchLink>
     </PropertyGroup>
     <ItemGroup>
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index 8eb6e8f..e1c0cf0 100644
--- a/HDL-ON_iOS/Info.plist
+++ b/HDL-ON_iOS/Info.plist
@@ -104,9 +104,9 @@
 	<key>UIStatusBarStyle</key>
 	<string>UIStatusBarStyleLightContent</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.1.202103241</string>
+	<string>1.1.202103252</string>
 	<key>CFBundleVersion</key>
-	<string>202103241</string>
+	<string>202103252</string>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<string>Use geographic location to provide services such as weather</string>
 	<key>NSAppleMusicUsageDescription</key>
diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
index 73d66fe..0646116 100644
--- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -288,50 +288,72 @@
                         case SPK.LightRGB:
                             break;
                         case SPK.FloorHeatStandard:
-                            byte onoff_1 = 0;
-                            byte setTemp_1 = 0;
-                            byte mode_1 = 0;
-                            foreach (var attr in f.status)
+                            if (f.status.Find((obj)=>obj.key ==FunctionAttributeKey.Mode) == null)
                             {
-                                switch (attr.key)
+                                foreach (var dic in f.status)
                                 {
-                                    case FunctionAttributeKey.OnOff:
-                                        if (attr.value == "on")
-                                        {
-                                            onoff_1 = 1;
-                                        }
-                                        else
-                                        {
-                                            onoff_1 = 0;
-                                        }
-                                        break;
-                                    case FunctionAttributeKey.SetTemp:
-                                        setTemp_1 = Convert.ToByte(attr.value);
-                                        break;
-                                    case FunctionAttributeKey.Mode:
-                                        switch (attr.value)
-                                        {
-                                            case "day":
-                                                mode_1 = 2;
-                                                break;
-                                            case "night":
-                                                mode_1 = 3;
-                                                break;
-                                            case "away":
-                                                mode_1 = 4;
-                                                break;
-                                            case "normal":
-                                                mode_1 = 1;
-                                                break;
-                                            case "timer":
-                                                mode_1 = 5;
-                                                break;
-                                        }
-                                        break;
+                                    switch (dic.key)
+                                    {
+                                        case FunctionAttributeKey.OnOff:
+                                            ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 20, dic.value.ToString() == "on" ? (byte)1 : (byte)0, f.localFunction.bus.LoopId });
+                                            break;
+                                        case "mode":
+                                            ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 21, Convert.ToByte(dic.value), f.localFunction.bus.LoopId });
+                                            break;
+                                        case FunctionAttributeKey.SetTemp:
+                                            ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] {
+                                                25, Convert.ToByte(dic.value), f.localFunction.bus.LoopId });
+                                            break;
+                                    }
                                 }
                             }
-                            ControlBytesSend(Command.SetFloorHeat, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] {
+                            else
+                            {
+                                byte onoff_1 = 0;
+                                byte setTemp_1 = 0;
+                                byte mode_1 = 0;
+                                foreach (var attr in f.status)
+                                {
+                                    switch (attr.key)
+                                    {
+                                        case FunctionAttributeKey.OnOff:
+                                            if (attr.value == "on")
+                                            {
+                                                onoff_1 = 1;
+                                            }
+                                            else
+                                            {
+                                                onoff_1 = 0;
+                                            }
+                                            break;
+                                        case FunctionAttributeKey.SetTemp:
+                                            setTemp_1 = Convert.ToByte(attr.value);
+                                            break;
+                                        case FunctionAttributeKey.Mode:
+                                            switch (attr.value)
+                                            {
+                                                case "day":
+                                                    mode_1 = 2;
+                                                    break;
+                                                case "night":
+                                                    mode_1 = 3;
+                                                    break;
+                                                case "away":
+                                                    mode_1 = 4;
+                                                    break;
+                                                case "normal":
+                                                    mode_1 = 1;
+                                                    break;
+                                                case "timer":
+                                                    mode_1 = 5;
+                                                    break;
+                                            }
+                                            break;
+                                    }
+                                }
+                                ControlBytesSend(Command.SetFloorHeat, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] {
                                 f. localFunction.bus.LoopId, onoff_1, 0, setTemp_1, mode_1,  setTemp_1, setTemp_1, setTemp_1, 0, 0 });
+                            }
                             break;
                         case SPK.ElectricSocket:
                             foreach (var attr in f.status)
@@ -518,9 +540,9 @@
                         {
                             case SPK.AcStandard:
                                 var ac = new AC();
-                                ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { function.bus.LoopId, 0, 32, 32, 32, 32, 32, 0, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0,
-                                    ac.GetModeIndex(function),
-                                    ac.GetFanIndex(function), Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), 0 });
+                                //ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { function.bus.LoopId, 0, 32, 32, 32, 32, 32, 0, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0,
+                                //    ac.GetModeIndex(function),
+                                //    ac.GetFanIndex(function), Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), 0 });
                                 foreach (var dic in commandDictionary)
                                 {
                                     switch (dic.Key)
@@ -534,7 +556,7 @@
                                         case "fan":
                                             ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 5, ac.GetFanIndex(function), function.bus.LoopId });
                                             break;
-                                        case "temp":
+                                        case FunctionAttributeKey.SetTemp:
                                             byte modeKey = 4;
                                             switch (ac.GetModeIndex(function))
                                             {
@@ -573,42 +595,83 @@
                             case SPK.FloorHeatStandard:
                                 if (function.Fh_Mode_Temp.Count == 4)
                                 {
-                                    var onoffString = function.trait_on_off.curValue.ToString();
-                                    byte b1 = 1;
-                                    if(onoffString == "off")
+                                    if (function.GetAttribute(FunctionAttributeKey.Mode) == null)
                                     {
-                                        b1 = 0;
-                                    }
-                                    var wm = fhTemp.GetWorkModeIndex(function);
-                                    if (wm > 0)
-                                    {
-                                        b1 += (byte)(16 + wm);
-                                    }
-                                    if (commandDictionary.ContainsKey("temp"))
-                                    {
-                                        var dicTempString = "";
-                                        commandDictionary.TryGetValue("temp", out dicTempString);
-                                        var dicTemp = Convert.ToByte(dicTempString);
-                                        var mode = function.GetAttrState(FunctionAttributeKey.Mode);
-                                        switch (mode)
+                                        foreach (var dic in commandDictionary)
                                         {
-                                            case "day":
-                                                function.Fh_Mode_Temp["day"] = dicTemp;
-                                                break;
-                                            case "night":
-                                                function.Fh_Mode_Temp["night"] = dicTemp;
-                                                break;
-                                            case "away":
-                                                function.Fh_Mode_Temp["away"] = dicTemp;
-                                                break;
-                                            case "normal":
-                                                function.Fh_Mode_Temp["normal"] = dicTemp;
-                                                break;
+                                            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 });
+                                                    break;
+                                                case "mode":
+                                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 21, fhTemp.GetModeIndex(function), function.bus.LoopId });
+                                                    break;
+                                                case FunctionAttributeKey.SetTemp:
+                                                    byte modeKey = 25;
+                                                    switch (fhTemp.GetModeIndex(function))
+                                                    {
+                                                        case 1:
+                                                            modeKey = 25;
+                                                            break;
+                                                        case 2:
+                                                            modeKey = 26;
+                                                            break;
+                                                        case 3:
+                                                            modeKey = 27;
+                                                            break;
+                                                        case 4:
+                                                            modeKey = 28;
+                                                            break;
+                                                    }
+                                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] {
+                                                modeKey, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), function.bus.LoopId });
+                                                    break;
+                                                default:
+                                                    MainPage.Log($"鍔熻兘鏈敮鎸� : {dic.Key}");
+                                                    break;
+                                            }
                                         }
                                     }
-                                    var tt = fhTemp.GetTempUintIndex(function);
-                                    ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId, b1,
+                                    else
+                                    {
+                                        var onoffString = function.trait_on_off.curValue.ToString();
+                                        byte b1 = 1;
+                                        if (onoffString == "off")
+                                        {
+                                            b1 = 0;
+                                        }
+                                        var wm = fhTemp.GetWorkModeIndex(function);
+                                        if (wm > 0)
+                                        {
+                                            b1 += (byte)(16 + wm);
+                                        }
+                                        if (commandDictionary.ContainsKey("temp"))
+                                        {
+                                            var dicTempString = "";
+                                            commandDictionary.TryGetValue("temp", out dicTempString);
+                                            var dicTemp = Convert.ToByte(dicTempString);
+                                            var mode = function.GetAttrState(FunctionAttributeKey.Mode);
+                                            switch (mode)
+                                            {
+                                                case "day":
+                                                    function.Fh_Mode_Temp["day"] = dicTemp;
+                                                    break;
+                                                case "night":
+                                                    function.Fh_Mode_Temp["night"] = dicTemp;
+                                                    break;
+                                                case "away":
+                                                    function.Fh_Mode_Temp["away"] = dicTemp;
+                                                    break;
+                                                case "normal":
+                                                    function.Fh_Mode_Temp["normal"] = dicTemp;
+                                                    break;
+                                            }
+                                        }
+                                        var tt = fhTemp.GetTempUintIndex(function);
+                                        ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId, b1,
                                         (byte)tt,fhTemp.GetModeIndex(function), function.Fh_Mode_Temp["normal"], function.Fh_Mode_Temp["day"], function.Fh_Mode_Temp["night"], function.Fh_Mode_Temp["away"], 0, 0 });
+                                    }
                                 }
                                 break;
                         }
diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index 5f0b9f5..ad530d3 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -405,38 +405,44 @@
                                 {
                                     function.Fh_Mode_Temp.Add("away", receiveBytes[7]);
                                 }
-
-                                switch (function.GetAttrState(FunctionAttributeKey.Mode))
+                                if (function.GetAttribute(FunctionAttributeKey.Mode) == null)
                                 {
-                                    case "normal":
-                                        function.lastState = Language.StringByID(StringId.Normal);
-                                        function.SetAttrState(FunctionAttributeKey.SetTemp,receiveBytes[4].ToString());
-                                        break;
-                                    case "day":
-                                        function.lastState = Language.StringByID(StringId.Day);
-                                        function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[5].ToString());
-                                        break;
-                                    case "night":
-                                        function.lastState = Language.StringByID(StringId.Night);
-                                        function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[6].ToString());
-                                        break;
-                                    case "timer":
-                                        function.lastState = Language.StringByID(StringId.Auto);
-                                        if (receiveBytes[8] == 0)
-                                        {
-                                            function.SetAttrState(FunctionAttributeKey.TimeFlag, 0);
+                                    function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[4].ToString());
+                                }
+                                else
+                                {
+                                    switch (function.GetAttrState(FunctionAttributeKey.Mode))
+                                    {
+                                        case "normal":
+                                            function.lastState = Language.StringByID(StringId.Normal);
+                                            function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[4].ToString());
+                                            break;
+                                        case "day":
+                                            function.lastState = Language.StringByID(StringId.Day);
                                             function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[5].ToString());
-                                        }
-                                        else
-                                        {
-                                            function.SetAttrState(FunctionAttributeKey.TimeFlag, 1);
+                                            break;
+                                        case "night":
+                                            function.lastState = Language.StringByID(StringId.Night);
                                             function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[6].ToString());
-                                        }
-                                        break;
-                                    case "away":
-                                        function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[7].ToString());
-                                        function.lastState = Language.StringByID(StringId.Away);
-                                        break;
+                                            break;
+                                        case "timer":
+                                            function.lastState = Language.StringByID(StringId.Auto);
+                                            if (receiveBytes[8] == 0)
+                                            {
+                                                function.SetAttrState(FunctionAttributeKey.TimeFlag, 0);
+                                                function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[5].ToString());
+                                            }
+                                            else
+                                            {
+                                                function.SetAttrState(FunctionAttributeKey.TimeFlag, 1);
+                                                function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[6].ToString());
+                                            }
+                                            break;
+                                        case "away":
+                                            function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[7].ToString());
+                                            function.lastState = Language.StringByID(StringId.Away);
+                                            break;
+                                    }
                                 }
                                 var indoorTemp = 0;
                                 if (receiveBytes[9] > 128)
@@ -448,7 +454,14 @@
                                 }
                                 function.SetAttrState(FunctionAttributeKey.RoomTemp, indoorTemp);
 
-                                function.lastState += " " + function.GetAttrState(FunctionAttributeKey.Mode) + new FloorHeating().GetTempUnitString(function);
+                                if (function.GetAttribute(FunctionAttributeKey.Mode) == null)
+                                {
+                                    function.lastState = "";
+                                }
+                                else
+                                {
+                                    function.lastState += " " + function.GetAttrState(FunctionAttributeKey.Mode) + new FloorHeating().GetTempUnitString(function);
+                                }
                                 RoomPage.UpdataStates(function);
                                 FunctionPage.UpdataStates(function);
                                 HomePage.UpdataFunctionStates(function);
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 6d7fd6a..5499083 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -497,6 +497,10 @@
                             UserInfo.Current.regionList.Add(home);
                         }
                     }
+                    if(UserInfo.Current.regionList.Count== 0)
+                    {
+                        return "null";
+                    }
                     //-------濡傛灉璐﹀彿鏄娆$櫥褰�
                     if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID))
                     {
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 65444e3..db9a801 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -20,7 +20,7 @@
         /// <summary>
         /// 鐗堟湰鍙�
         /// </summary>
-        public static string VersionString = "1.1.0324";
+        public static string VersionString = "1.1.0325";
         ///// <summary>
         ///// 瀹㈡埛绔被鍨�
         ///// </summary>
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index ef956d9..5de3a2d 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -192,12 +192,12 @@
                 //return;
                 if (b)
                 {
-                    etAccount.Text = "15622703419";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
+                    etAccount.Text = "18316672920";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
                     // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 
                 }
                 else
                 {
-                    etAccount.Text = "18316672920";//鍑夐湼"18666455392";//13375012446//13602944661//tzy 18778381374
+                    etAccount.Text = "18316120654";//鍑夐湼"18666455392";//13375012446//13602944661//tzy 18778381374
                     //15971583093 gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 鍥藉鏈嶅姟鍣ㄦ祴璇�
                 }
                 b = !b;
diff --git a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
index 3d05e6d..201b868 100644
--- a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -651,7 +651,7 @@
                             UserInfo.Current.LastTime = DateTime.MinValue;
                             UserInfo.Current.SaveUserInfo();
                             //鐧诲綍澶辫触锛岃鍏堟坊鍔犱綇瀹咃紒
-                            Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList));
+                            //Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList));
                         }
                     }
                 }
@@ -814,8 +814,8 @@
         bool LoadMethod_GetResidences()
         {
             var result = false;
-            var responsePack = pm.GetHomePager();
-            if (responsePack == StateCode.SUCCESS)
+            var code = pm.GetHomePager();
+            if (code == StateCode.SUCCESS)
             {
                 ////2020-11-13 寰呯‘璁わ紝娌℃湁浣忓畢锛屼笉绠楃櫥褰曟垚鍔�
                 //if (UserInfo.Current.regionList != null && UserInfo.Current.regionList.Count > 0)
@@ -825,10 +825,17 @@
                 //2020-12-10 娌℃湁浣忓畢鐧诲綍鎴愬姛锛屼絾鏄笉鑳借繘鍏ヤ富鐣岄潰
                 result = true;
             }
+            else if( code == "null")
+            {
+                Application.RunOnMainThread(() =>
+                {
+                    MainPage.GoUserPage(false);
+                });
+            }
             else
             {
                 // 鎻愮ず閿欒
-                IMessageCommon.Current.ShowErrorInfoAlter(responsePack);
+                IMessageCommon.Current.ShowErrorInfoAlter(code);
             }
             return result;
         }
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index f2f00ae..3740382 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -113,6 +113,7 @@
 
         public void LoadPage()
         {
+            MainPage.CurPageIndex = 0;
             try
             {
                 this.BeginHeaderRefreshingAction = () =>
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 7f20439..e38f393 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -76,6 +76,7 @@
 
         public void LoadPage()
         {
+            MainPage.CurPageIndex = 1;
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
             #region top
             FrameLayout topView = new FrameLayout()
@@ -480,6 +481,7 @@
                         #endregion
                         break;
                     case ShowFunction.FreshAir:
+                        functionCount = FunctionList.List.GetAirFreshList().Count;
                         break;
                     case ShowFunction.Music:
                         functionCount = Music.A31MusicModel.A31MusicModelList.Count;
@@ -551,7 +553,7 @@
                 functionView.AddChidren(btnName);
 
                 if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom
-                    && item != ShowFunction.SecurityMonitoring
+                    && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir
                     && functionCount != 0)
                 {
                     Button btnFunctionCount = new Button()
diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
index 9f2bcf7..73b8da7 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -61,6 +61,7 @@
 
         public void LoadPage()
         {
+            MainPage.CurPageIndex = 2;
             bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
             #region top
             topView = new FrameLayout()
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index 2fee51d..61b56a6 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -611,8 +611,8 @@
 
                 btn.MouseUpEventHandler = (sender, e) =>
                 {
-                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
-                    d.Add(FunctionAttributeKey.Key, attr.key);
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add(attr.key, "");
                     Control.Ins.SendWriteCommand(device, d);
 
                     new System.Threading.Thread(() =>
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
index 44e7821..f11bb02 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
@@ -234,7 +234,10 @@
                 Height = Application.GetRealWidth(30),
                 UnSelectedImagePath = fhTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode))
             };
-            controlView.AddChidren(btnMode);
+            if (function.GetAttribute(FunctionAttributeKey.Mode)!=null)
+            {
+                controlView.AddChidren(btnMode);
+            }
 
             btnSwitch = new Button()
             {

--
Gitblit v1.8.0