From d4ff2cb026bfa348c62651c0547511eede9f94f3 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期三, 21 七月 2021 13:45:50 +0800
Subject: [PATCH] Merge branch 'wxr7-ez' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into wxr7-ez

---
 HDL-ON_Android/Properties/AndroidManifest.xml                                           |    2 
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs                                                    |   18 +++-
 HDL-ON_Android/Assets/Language.ini                                                      |    2 
 HDL-ON_iOS/HDL-ON_iOS.csproj                                                            |   15 ++-
 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs              |   42 +++++++---
 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs        |   55 ++++++++-----
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs                                    |    3 
 HDL-ON_Android/Assets/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png          |    0 
 HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs |    4 
 HDL-ON_Android/HDL-ON_Android.csproj                                                    |    2 
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs                                                 |   18 +++-
 HDL-ON_iOS/Resources/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png           |    0 
 HDL-ON_iOS/Info.plist                                                                   |    4 
 HDL-ON_iOS/Resources/Language.ini                                                       |    2 
 HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs                          |    1 
 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorenvironment.png                      |    0 
 HDL_ON/Common/R.cs                                                                      |    4 +
 .vs/HDL_APP_Project/xs/UserPrefs.xml                                                    |   27 +-----
 HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/sensorenvironment.png                     |    0 
 HDL_ON/UI/MainPage.cs                                                                   |    2 
 HDL_ON/UI/UI1-Login/LoginPage.cs                                                        |    4 
 21 files changed, 125 insertions(+), 80 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index cb836f4..37d52f4 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,31 +1,11 @@
-锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
+锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
   <MonoDevelop.Ide.Workbench>
-    <Files>
-      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="14" Column="1" />
-      <File FileName="HDL-ON_iOS/Info.plist" />
-      <File FileName="HDL_ON/UI/MainPage.cs" Line="28" Column="55" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs" Line="177" Column="75" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" Line="158" Column="69" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/SensorEnvironmentManagerPage.cs" Line="13" Column="18" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs" Line="116" Column="149" />
-    </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="Server" expanded="True" />
-              </Node>
-              <Node name="UI" expanded="True" />
-            </Node>
             <Node name="HDL-ON_Android" selected="True" />
-            <Node name="HDL-ON_iOS" expanded="True">
-              <Node name="References" expanded="True" />
-              <Node name="Resources" expanded="True" />
-            </Node>
           </Node>
         </State>
       </Pad>
@@ -37,13 +17,14 @@
     <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|iPhone" />
   <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
   <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" />
       <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Common/ApiUtlis.cs" relfile="HDL_ON/Common/ApiUtlis.cs" line="390" column="1" />
       <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="422" column="1" />
+      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="747" column="1" />
     </BreakpointStore>
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
   <MultiItemStartupConfigurations />
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index d565ef1..6a07828 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -466,6 +466,7 @@
 478=Pattern
 479=Speed
 480=Environmental sensor
+481=Can start using environmental sensor
 
 
  
@@ -1542,6 +1543,7 @@
 478=妯″紡
 479=椋庨��
 480=鐜浼犳劅鍣�
+481=鍙互寮�濮嬩娇鐢ㄧ幆澧冧紶鎰熷櫒浜�
  
  
 1000=瀹ゅ唴婀垮害
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/sensorenvironment.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/sensorenvironment.png
new file mode 100644
index 0000000..359a3a8
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/sensorenvironment.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png b/HDL-ON_Android/Assets/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png
new file mode 100644
index 0000000..8258f31
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png
Binary files differ
diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index 58db780..0758431 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -427,6 +427,8 @@
     <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irfan_blue.png" />
     <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irfan_white.png" />
     <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\irfan.png" />
+    <AndroidAsset Include="Assets\Phone\PersonalCenter\AddDevice\EnvironmentalSensorbg.png" />
+    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensorenvironment.png" />
   </ItemGroup>
   <ItemGroup>
     <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" />
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 8cb1dff..f7e81f7 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="202107192" android:versionName="1.2.202107192" package="com.hdl.onpro">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202107211" android:versionName="1.2.202107211" package="com.hdl.onpro">
 	<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" />
 	<!-- 涔愭鍙瀵硅闇�瑕佺殑鏉冮檺 -->
 	<!--<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 d26dc65..895273d 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -55,6 +55,7 @@
         <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs>
         <MtouchEnableSGenConc>false</MtouchEnableSGenConc>
 <CodesignProvision>On+Dev-20210616-1</CodesignProvision>
+<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
     </PropertyGroup>
     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
         <DebugType>none</DebugType>
@@ -103,28 +104,28 @@
     </ItemGroup>
     <ItemGroup>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>12.0.3</Version>
+        <Version>13.0.1</Version>
       </PackageReference>
       <PackageReference Include="MQTTnet">
-        <Version>3.0.13</Version>
+        <Version>3.0.16</Version>
       </PackageReference>
       <PackageReference Include="Microsoft.AppCenter.Analytics">
-        <Version>4.1.0</Version>
+        <Version>4.3.0</Version>
       </PackageReference>
       <PackageReference Include="Microsoft.AppCenter.Crashes">
-        <Version>4.1.0</Version>
+        <Version>4.3.0</Version>
       </PackageReference>
       <PackageReference Include="ZXing.Net.Mobile">
         <Version>2.4.1</Version>
       </PackageReference>
       <PackageReference Include="RestSharp">
-        <Version>106.11.7</Version>
+        <Version>106.12.0</Version>
       </PackageReference>
       <PackageReference Include="Xamarin.iOS.Bugly">
         <Version>1.0.4</Version>
       </PackageReference>
       <PackageReference Include="Xamarin.Essentials">
-        <Version>1.6.0</Version>
+        <Version>1.7.0</Version>
       </PackageReference>
     </ItemGroup>
     <ItemGroup>
@@ -1309,6 +1310,8 @@
       <BundleResource Include="Resources\Phone\FunctionIcon\Icon\irfan.png" />
       <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irfan_blue.png" />
       <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irfan_white.png" />
+      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensorenvironment.png" />
+      <BundleResource Include="Resources\Phone\PersonalCenter\AddDevice\EnvironmentalSensorbg.png" />
     </ItemGroup>
     <ItemGroup>
       <ITunesArtwork Include="iTunesArtwork" />
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index 6278204..2a75a3c 100644
--- a/HDL-ON_iOS/Info.plist
+++ b/HDL-ON_iOS/Info.plist
@@ -100,9 +100,9 @@
 	<key>UIStatusBarStyle</key>
 	<string>UIStatusBarStyleLightContent</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.2.202107192</string>
+	<string>1.2.202107211</string>
 	<key>CFBundleVersion</key>
-	<string>1.2.07192</string>
+	<string>1.2.07211</string>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<string>Use geographic location to provide services such as weather</string>
 	<key>NSAppleMusicUsageDescription</key>
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index d565ef1..6a07828 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -466,6 +466,7 @@
 478=Pattern
 479=Speed
 480=Environmental sensor
+481=Can start using environmental sensor
 
 
  
@@ -1542,6 +1543,7 @@
 478=妯″紡
 479=椋庨��
 480=鐜浼犳劅鍣�
+481=鍙互寮�濮嬩娇鐢ㄧ幆澧冧紶鎰熷櫒浜�
  
  
 1000=瀹ゅ唴婀垮害
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorenvironment.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorenvironment.png
new file mode 100644
index 0000000..359a3a8
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorenvironment.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png b/HDL-ON_iOS/Resources/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png
new file mode 100644
index 0000000..8258f31
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/PersonalCenter/AddDevice/EnvironmentalSensorbg.png
Binary files differ
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 7e133bb..24c3126 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -5,6 +5,10 @@
     public static class StringId
     {
         /// <summary>
+        /// 鍙互寮�濮嬩娇鐢ㄧ幆澧冧紶鎰熷櫒浜�
+        /// </summary>
+        public const int CanStartUsingEnvironmentalSensor = 481;
+        /// <summary>
         /// 鐜浼犳劅鍣�
         /// </summary>
         public const int SensorEnvironment = 480;
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 7a77379..bbe83c6 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -25,7 +25,7 @@
         /// <summary>
         /// 鐗堟湰鍙�
         /// </summary>
-        public static string VersionString = "1.2.0719";
+        public static string VersionString = "1.2.0721";
         ///// <summary>
         ///// 瀹㈡埛绔被鍨�
         ///// </summary>
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index 8899c7d..6c5d2dc 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -227,10 +227,10 @@
                     //etAccount.Text = "13168123446";
                     //etAccount.Text = "13676202754";//宸存灄鏈嶅姟鍣�
                     //etAccount.Text = "13602944661";//kx
-                    //etAccount.Text = "551775569@qq.com";//wcf
+                    etAccount.Text = "551775569@qq.com";//wcf
                     //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374
                     //etAccount.Text = "15971583093";//楂樿儨
-                    etAccount.Text = "15217626103";//鏄嗘槑閲戣寕椤圭洰
+                    //etAccount.Text = "15217626103";//鏄嗘槑閲戣寕椤圭洰
                 }
                 b = !b;
                 etPassword.Text = "123456";
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index 1959c82..189c239 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -273,15 +273,20 @@
                 {
                     btnIndoorTempValues.Text = "/--掳";
                     double tempTotalValues = 0;
+                    double tempTotalCount = 0;
                     foreach (var temp in tempSensorList)
                     {
                         double tempValue = 0;
                         double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out tempValue);
-                        tempTotalValues += tempValue;
+                        if (tempValue > 0)
+                        {
+                            tempTotalValues += tempValue;
+                            tempTotalCount++;
+                        }
                     }
                     if (tempTotalValues > 0)
                     {
-                        btnIndoorTempValues.Text = "/" + tempTotalValues + "掳";
+                        btnIndoorTempValues.Text = "/" + (tempTotalValues/ tempTotalCount).ToString("0.0") + "掳";
                     }
                 }
                 btnIndoorTempValues.Width = btnIndoorTempValues.GetTextWidth();
@@ -322,15 +327,20 @@
                 {
                     btnIndoorHumiValues.Text = "/--%";
                     double humiTotalValues = 0;
+                    double humiTotalCount = 0;
                     foreach (var humi in humiSensorList)
                     {
                         double humiValue = 0;
                         double.TryParse(humi.GetAttrState(FunctionAttributeKey.Value), out humiValue);
-                        humiTotalValues += humiValue;
+                        if (humiValue > 0)
+                        {
+                            humiTotalValues += humiValue;
+                            humiTotalCount++;
+                        }
                     }
                     if (humiTotalValues > 0)
                     {
-                        btnIndoorHumiValues.Text = "/" + humiTotalValues + "%";
+                        btnIndoorHumiValues.Text = "/" + (humiTotalValues / humiTotalCount).ToString("0") + "%";
                     }
                 }
                 btnIndoorHumiValues.Width = btnIndoorHumiValues.GetTextWidth();
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 82c5530..51aeb25 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -49,15 +49,20 @@
                         }
                     }
                     double humiTotalValues = 0;
+                    int humiTotalCount = 0;
                     foreach (var temp in humiSensorList)
                     {
                         double humiValue = 0;
                         double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out humiValue);
-                        humiTotalValues += humiValue;
+                        if(humiValue > 0)
+                        {
+                            humiTotalValues += humiValue;
+                            humiTotalCount++;
+                        }
                     }
                     if (humiTotalValues > 0)
                     {
-                        bodyView.btnIndoorHumiValues.Text = "/" + humiTotalValues + "%";
+                        bodyView.btnIndoorHumiValues.Text = "/" + (humiTotalValues /humiTotalCount).ToString("0")+ "%";
                     }
                     bodyView.btnIndoorHumiValues.Width = bodyView.btnIndoorHumiValues.GetTextWidth();
                 }
@@ -91,15 +96,20 @@
                         }
                     }
                     double tempTotalValues = 0;
+                    int tempTotalCount = 0;
                     foreach (var temp in tempSensorList)
                     {
                         double tempValue = 0;
                         double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out tempValue);
-                        tempTotalValues += tempValue;
+                        if (tempValue > 0)
+                        {
+                            tempTotalValues += tempValue;
+                            tempTotalCount++;
+                        }
                     }
                     if (tempTotalValues > 0)
                     {
-                        bodyView.btnIndoorTempValues.Text = "/" + tempTotalValues + "掳";
+                        bodyView.btnIndoorTempValues.Text = "/" + (tempTotalValues /tempTotalCount).ToString("0.0")+ "掳";
                     }
                     bodyView.btnIndoorTempValues.Width = bodyView.btnIndoorTempValues.GetTextWidth();
                 }
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index ba8453a..3accadc 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -702,6 +702,9 @@
                         break;
                     case ShowFunction.Music:
                         functionCount = FunctionList.List.GetMusicList().Count;
+#if DEBUG
+                        functionCount = 1;
+#endif
                         break;
                     case ShowFunction.Panel:
                         break;
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs
index d590b9b..2baa570 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs
@@ -51,7 +51,7 @@
             var btnPic = new PicViewControl(132, 132);
             btnPic.Y = Application.GetRealHeight(69);
             btnPic.Gravity = Gravity.CenterHorizontal;
-            btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/SenesorMegahealthBg.png";
+            btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvironmentalSensorbg.png";
             bodyFrameLayout.AddChidren(btnPic);
 
             //璇疯緭鍏ヨ澶囨満涓婄殑sn鐮�
@@ -121,7 +121,7 @@
                                 {
                                     waitPage.Hide();
                                     var tipDialog = new OperationResultDisPalyPage();
-                                    tipDialog.LoadPage(true, Language.StringByID(StringId.AddSuccess), "", Language.StringByID(StringId.CanStartUsingZhaoguanMillimeterWave), Language.StringByID(StringId.Next));
+                                    tipDialog.LoadPage(true, Language.StringByID(StringId.AddSuccess), "", Language.StringByID(StringId.CanStartUsingEnvironmentalSensor), Language.StringByID(StringId.Next));
                                     tipDialog.Show();
                                     AddDeviceEvent?.Invoke(new Function());
                                     this.CloseForm();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
index cd99561..e10d48d 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -29,6 +29,8 @@
         /// </summary>
         FrameLayout sensorListView;
 
+        VerticalScrolViewLayout sensorListContentView;
+
         /// <summary>
         /// 澶╂皵鍚嶇О鏂囨湰
         /// </summary>
@@ -237,17 +239,18 @@
             contentView.AddChidren(btnRoomClickRow);
 
             #endregion
-
-            sensorListView = new FrameLayout()
+            sensorListContentView = new VerticalScrolViewLayout()
             {
                 Gravity = Gravity.CenterHorizontal,
                 Y = Application.GetRealHeight(50),
-                Height = Application.GetRealHeight(456),
+                Height = Application.GetRealHeight(400),
                 Radius = (uint)Application.GetRealWidth(12),
                 BorderColor = 0x00000000,
                 BorderWidth = 0,
             };
-            contentView.AddChidren(sensorListView);
+            contentView.AddChidren(sensorListContentView);
+            sensorListView = new FrameLayout();
+            sensorListContentView.AddChidren(sensorListView);
 
             LoadSenesorList();
 
@@ -280,37 +283,48 @@
                             name = sensor.name,
                             sid = sensor.sid,
                             deviceId = sensor.deviceId,
-                            attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue } },
+                            roomIds = sensor.roomIds,
+                            attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue }
+                            ,new FunctionAttributes { key = "spk"} }
                         };
                         switch (seTemp.key)
                         {
                             case "co2":
                                 newTemp.spk = SPK.SensorCO2;
+                                newTemp.SetAttrState("spk", "co2");
                                 break;
                             case "pm25":
                                 newTemp.spk = SPK.SensorPm25;
+                                newTemp.SetAttrState("spk", "pm25");
                                 break;
                             case "humidity":
                                 newTemp.spk = SPK.SensorHumidity;
+                                newTemp.SetAttrState("spk", "humidity");
                                 break;
                             case "temperature":
                                 newTemp.spk = SPK.SensorTemperature;
+                                newTemp.SetAttrState("spk", "temperature");
                                 break;
                             case "tvoc":
                                 newTemp.spk = SPK.SensorTVOC;
+                                newTemp.SetAttrState("spk", "tvoc");
                                 break;
                         }
-                        LoadSensorDiv(newTemp, index);
-                        index++;
+
+                        if (room.roomId == "" || sensor.roomIds.Contains(room.roomId))
+                        {
+                            LoadSensorDiv(newTemp, index);
+                            index++;
+                        }
                     }
                 }
                 else
                 {
-#if DEBUG
-                    continue;
-#endif
-                    LoadSensorDiv(sensor, index);
-                    index++;
+                    if (room.roomId == "" || sensor.roomIds.Contains(room.roomId))
+                    {
+                        LoadSensorDiv(sensor, index);
+                        index++;
+                    }
                 }
 
                 new System.Threading.Thread(() =>
@@ -319,16 +333,16 @@
                 })
                 { IsBackground = true }.Start();
             }
+            sensorListView.Height = Application.GetRealWidth(124 * (index + 1) / 2);
         }
 
         /// <summary>
         /// 鍔犺浇浼犳劅鍣ㄥ垪琛�
         /// </summary>
-        void LoadSensorDiv(Function sensor, int index)
+        void LoadSensorDiv(Function sensor,int index)
         {
             var levelColorList = sensorTemp.GetLevelColorList(sensor.spk);
             var levelTextList = sensorTemp.GetLevelTextList(sensor.spk);
-            if (room.roomId == "" || sensor.roomIds.Contains(room.roomId))
             {
                 var sensorTag = sensor.spk + sensor.sid + sensor.deviceId;
                 FrameLayout sensorView = new FrameLayout()
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
index f2c2ae5..5adc74f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
@@ -595,18 +595,18 @@
             };
             selfInfoView.AddChidren(btnSeltSensorValue);
 
-            Button btnShowData;
-            btnShowData = new Button()
-            {
-                X = Application.GetRealWidth(291),
-                Y = Application.GetRealWidth(62),
-                Width = Application.GetMinRealAverage(32),
-                Height = Application.GetMinRealAverage(32),
-                UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png",
-                SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png",
-                IsSelected = true,
-            };
-            selfInfoView.AddChidren(btnShowData);
+            //Button btnShowData;
+            //btnShowData = new Button()
+            //{
+            //    X = Application.GetRealWidth(291),
+            //    Y = Application.GetRealWidth(62),
+            //    Width = Application.GetMinRealAverage(32),
+            //    Height = Application.GetMinRealAverage(32),
+            //    UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png",
+            //    SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png",
+            //    IsSelected = true,
+            //};
+            //selfInfoView.AddChidren(btnShowData);
             //btnShowData.MouseUpEventHandler = (sender, e) => {
             //    btnShowData.IsSelected = !btnShowData.IsSelected;
             //    if(btnShowData.IsSelected)
@@ -644,7 +644,9 @@
 
             bool initTitleButton = true;
 
-            foreach (var tempSensor in FunctionList.List.GetEnvirSensorsList())
+            var tempList = FunctionList.List.GetEnvirSensorsList();
+
+            foreach (var tempSensor in tempList)
             {
                 if (tempSensor.sid == function.sid)
                 {
@@ -675,7 +677,7 @@
                 #region 鍏跺畠浼犳劅鍣ㄤ俊鎭爮
                 FrameLayout otherInfoView = new FrameLayout()
                 {
-                    Gravity = Gravity.CenterVertical,
+                    Gravity = Gravity.CenterHorizontal,
                     Width = Application.GetRealWidth(343),
                     Height = Application.GetRealWidth(100),
                     BackgroundColor = CSS_Color.MainBackgroundColor,
@@ -739,7 +741,11 @@
                 {
                     Action backAction = () =>
                     {
-                        btnSeltSensorName.Text = tempSensor.name;
+                        MainPage.Log("45678i");
+                        Application.RunOnMainThread(() =>
+                        {
+                            btnSeltSensorName.Text = tempSensor.name;
+                        });
                     };
                     var infoView = new FunctionBaseInfoSetPage(tempSensor, backAction);
                     MainPage.BasePageView.AddChidren(infoView);
@@ -774,21 +780,26 @@
                     btnShowData1.IsSelected = !btnShowData1.IsSelected;
                     if (btnShowData1.IsSelected)
                     {
-                        if (!showFunctions.Contains(function))
+                        if (!showFunctions.Contains(tempSensor))
                         {
-                            showFunctions.Add(function);
+                            showFunctions.Add(tempSensor);
                         }
                     }
                     else
                     {
-                        if (showFunctions.Contains(function))
+                        if (showFunctions.Contains(tempSensor))
                         {
-                            showFunctions.Remove(function);
+                            showFunctions.Remove(tempSensor);
                         }
                     }
                     LoadMothed_GetSensorHistoryData();
                 };
                 #endregion
+
+                contentView.AddChidren(new Button()
+                {
+                    Height = Application.GetRealHeight(12),
+                });
 
             }
             #endregion
@@ -826,7 +837,7 @@
 
                     string yDataString = "";
 
-                    foreach (var sr in FunctionList.List.GetEnvirSensorsList())
+                    foreach (var sr in showFunctions)
                     {
                         if (sr.spk != function.spk)
                         {
@@ -839,7 +850,9 @@
                         }
 
                         var sensorType = sr.spk.Split(".")[1];
-                        var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId,"value");
+                        var queryType = sr.GetAttrState("spk")==null? "value": sr.GetAttrState("spk");
+
+                        var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, queryType);
                         if (revertObj != null)
                         {
                             if (revertObj.Code == StateCode.SUCCESS)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
index 2742514..d8c32aa 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
@@ -38,6 +38,7 @@
                         function.name = name;
                         btnFunctionName.Text = name;
                         function.UpdataFuncitonInfo();
+                        actionRefresh?.Invoke();
                     }
                 };
                 new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, function.name, callBackAction,StringId.DeviceNameCannotBeEmpty,0,new System.Collections.Generic.List<string>());

--
Gitblit v1.8.0