From 9ab5bd54fadd8fc9c542b48c99a117a4e182669b Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 14 十月 2021 16:37:56 +0800
Subject: [PATCH] 智能空开能源界面数据更新

---
 HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs         |    2 
 HDL-ON_Android/Properties/AndroidManifest.xml                        |    2 
 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs |    5 ++
 HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiOnIcon.png     |    0 
 HDL-ON_iOS/HDL-ON_iOS.csproj                                         |    1 
 HDL_ON/DAL/Mqtt/MqttClient.cs                                        |    1 
 HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs            |   19 ++++++---
 HDL-ON_Android/HDL-ON_Android.csproj                                 |    1 
 HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiIcon.png       |    0 
 HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiOnIcon.png      |    0 
 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs                |    4 -
 .vs/HDL_APP_Project/xs/UserPrefs.xml                                 |   42 +++++---------------
 HDL_ON/DAL/DriverLayer/Control.cs                                    |    4 ++
 HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiIcon.png        |    0 
 14 files changed, 38 insertions(+), 43 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 92a1800..d971019 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,45 +1,25 @@
 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.220222E9-B9CA-4834-9318-2BC22465F050" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Mqtt/MqttClient.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs">
     <Files>
-      <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs" Line="211" Column="33" />
+      <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs" Line="351" Column="10" />
       <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" />
       <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" />
       <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" />
       <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" />
-      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="446" Column="41" />
+      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" />
+      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="237" Column="52" />
+      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" Line="186" Column="54" />
+      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" Line="400" Column="14" />
+      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="208" Column="51" />
+      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="67" Column="30" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
           <Node name="HDL_APP_Project" expanded="True">
-            <Node name="HDL_ON" expanded="True">
-              <Node name="DAL" expanded="True">
-                <Node name="Mqtt" expanded="True">
-                  <Node name="MqttClient.cs" selected="True" />
-                </Node>
-                <Node name="Server" expanded="True" />
-              </Node>
-              <Node name="Entity" expanded="True">
-                <Node name="Function" expanded="True" />
-              </Node>
-              <Node name="UI" expanded="True">
-                <Node name="UI1-Login" expanded="True" />
-                <Node name="UI2" expanded="True">
-                  <Node name="2-Classification" expanded="True" />
-                  <Node name="3-Intelligence" expanded="True">
-                    <Node name="Automation" expanded="True" />
-                  </Node>
-                </Node>
-              </Node>
-            </Node>
-            <Node name="HDL-ON_iOS" expanded="True" />
+            <Node name="HDL-ON_Android" selected="True" />
           </Node>
-        </State>
-      </Pad>
-      <Pad Id="MonoDevelop.Debugger.WatchPad">
-        <State>
-          <Value>function.spk</Value>
         </State>
       </Pad>
     </Pads>
@@ -50,8 +30,8 @@
     <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
     <String>Shared.IOS/Shared.IOS.csproj</String>
   </DisabledProjects>
-  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
+  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     <BreakpointStore>
       <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" />
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiIcon.png
index 59b2f44..1e5521a 100644
--- a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiIcon.png
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiIcon.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiOnIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiOnIcon.png
new file mode 100644
index 0000000..59b2f44
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumiOnIcon.png
Binary files differ
diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index 8fe9c65..57f2aa5 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -211,6 +211,7 @@
     <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\HumiIcon.png" />
     <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\btnCloseIcon.png" />
     <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\btnInfoIcon.png" />
+    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\HumiOnIcon.png" />
   </ItemGroup>
   <ItemGroup>
     <AndroidResource Include="Resources\values\colors.xml" />
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 09f99dc..06c336b 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="202110142" android:versionName="1.2.202110142" package="com.hdl.onpro">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202110143" android:versionName="1.2.202110143" package="com.hdl.onpro">
 	<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />
 	<!-- 涔愭鍙瀵硅闇�瑕佺殑鏉冮檺 -->
 	<!--<uses-permission android:name="android.permission.INTERNET" />-->
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index c4e15fc..9f839ae 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1356,6 +1356,7 @@
       <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\HumiIcon.png" />
       <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\btnCloseIcon.png" />
       <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\btnInfoIcon.png" />
+      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\HumiOnIcon.png" />
     </ItemGroup>
     <ItemGroup>
       <ITunesArtwork Include="iTunesArtwork" />
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiIcon.png
index 59b2f44..1e5521a 100644
--- a/HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiIcon.png
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiIcon.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiOnIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiOnIcon.png
new file mode 100644
index 0000000..59b2f44
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumiOnIcon.png
Binary files differ
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 4b93d06..f0d20ac 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -965,6 +965,10 @@
                         {
                             case SPK.AirSwitch:
                                 AirSwitchPage.UpdataState(localFunction);
+                                if(localFunction.GetAttribute(FunctionAttributeKey.Power)!=null)//濡傛灉鏄甫鐢甸噺鐨勭┖寮�涔熻鏇存柊鑳芥簮鐣岄潰
+                                {
+                                    EnergyMainPage.UpdataStatus(localFunction);
+                                }
                                 break;
                             case SPK.ElectricEnergy:
                                 EnergyMainPage.UpdataStatus(localFunction);
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 94a7cae..1974da4 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -482,6 +482,7 @@
                                 {
                                     var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey);
                                     var revString = Encoding.UTF8.GetString(bytes);
+                                    MainPage.Log($"mqtt 鐘舵�佹洿鏂�:{revString}");
                                     Control.Ins.UpdataFunctionStatus(revString, null, true);
                                 }
                                 //涓�绔彛鏁版嵁瑙f瀽
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
index 1786290..9a7fe8d 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -212,9 +212,7 @@
                 UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                 IsSelected = function.collect
             };
-            //bodyDiv.AddChidren(btnCollectionIcon);
-            //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
-            if ( !SPK.ArmSensorSpkList().Contains(function.spk) || !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare &&
+            if ( !SPK.ArmSensorSpkList().Contains(function.spk) && !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare &&
             {
                 bodyDiv.AddChidren(btnCollectionIcon);
             }
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
index 283d38c..8f9ab01 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
@@ -315,6 +315,7 @@
             btnSetHumidity.X = this.FrameWhiteCentet1.Width - btnMode1.X - btnSetHumidity.IconSize;
             btnSetHumidity.Y = btnMode1.Y;
             btnSetHumidity.UnSelectedImagePath = "FunctionIcon/AirFresh/HumiIcon.png";
+            btnSetHumidity.SelectedImagePath = "FunctionIcon/AirFresh/HumiOnIcon.png";
             this.FrameWhiteCentet1.AddChidren(btnSetHumidity);
 
             btnSetHumidity.ButtonClickEvent += (sender, e) =>
@@ -737,10 +738,12 @@
                 this.btnFanView.Text = this.dicText["1妗�"];
             }
             this.btnFan.IsSelected = this.airFreshData.Open;
-            this.btnFan.CanClick = this.airFreshData.Open;
 
             this.btnSetHumidityView.Text = this.airFreshData.Humidity.ToString() + "%";
+            this.btnSetHumidity.Enable = this.airFreshData.Open;
+            this.btnSetHumidity.CanClick = this.airFreshData.Open;
         }
+        
 
         #endregion
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
index ba2b6df..76d2fb3 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
@@ -153,7 +153,7 @@
                     TextAlignment = TextAlignment.Center,
                     TextSize = CSS_FontSize.TextFontSize,
                 };
-                controlView.AddChidren(btnRunStatus);
+                //controlView.AddChidren(btnRunStatus); //鐘舵�佹棤娉曟祴璇曪紝鏆傛椂闅愯棌--2021-10-14 13:58:48 钁f辰鏂�
                 UpdataRunStatus();
             }
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
index aca8e0a..1757757 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
@@ -179,6 +179,7 @@
                 double tt = 0;
                 double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out tt);
                 tt *= 100;//涔樹互100锛屽皬浜�1鏃犳硶鍔犺浇echart
+                tt = Math.Round(tt, 2);
                 list.Add(ene.name, tt.ToString());
             }
             myEchartsView_Pie.ShowWithOption(new EchartsOption_Pie().InitDateJson(list));
@@ -506,10 +507,13 @@
 
             row.Y = btnLine.Bottom;
             view.AddChidren(row);
+            //璁板綍闇�瑕佹洿鏂扮殑鏇存柊鎸夐挳
             listButton_value.Add(row.btnValue);
         }
 
-
+        /// <summary>
+        /// 璁板綍闇�瑕佹洿鏂扮殑鏇存柊鎸夐挳
+        /// </summary>
         public List<Button> listButton_value = new List<Button>();
 
         /// <summary>
@@ -530,7 +534,7 @@
                             var newValue = updataTemp.GetAttrState(FunctionAttributeKey.Power);
                             //if (newValue != btn.Text)
                             {
-                                btn.Text = newValue;
+                                btn.Text = Math.Round(double.Parse(newValue), 2).ToString();
                                 UpdataValue();
                             }
                         }
@@ -553,17 +557,20 @@
             Dictionary<string, string> list = new Dictionary<string, string>();//楗煎浘鏁版嵁
             foreach (var ene in bodyView.energyList)
             {
-                double power = 0;
+                double power = 0.00;
                 double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out power);
+                power = Math.Round(power, 2);
                 totalValue += power;
 
-                int realTimePower = 0;
-                int.TryParse(ene.GetAttrState(FunctionAttributeKey.Power), out realTimePower);
+                double realTimePower = 0;
+                double.TryParse(ene.GetAttrState(FunctionAttributeKey.Power), out realTimePower);
                 realtimeValue += realTimePower;
+                realtimeValue = Math.Round(realtimeValue, 2);
 
                 #region 楗煎浘鏁版嵁
-                double tt = 0;
+                double tt = 0.00;
                 double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out tt);
+                tt = Math.Round(tt, 2);
                 tt *= 100;//涔樹互100锛屽皬浜�1鏃犳硶鍔犺浇echart
                 list.Add(ene.name, tt.ToString());
                 #endregion

--
Gitblit v1.8.0