陈嘉乐
2021-03-08 79133766997cb86b2e463671b50137588ded6588
Merge branch 'temp-wxr' into WJC
2 文件已复制
4个文件已添加
56个文件已删除
100个文件已修改
3 文件已重命名
8463 ■■■■ 已修改文件
.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/.#UserPrefs.xml 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/Blufi-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/Blufi-Release.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/EZSDK.IOS-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/EZSDK.IOS-Release.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_Android-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_Android-Release.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Debug|iPhone.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Debug|iPhoneSimulator.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Release|iPhone.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Release|iPhoneSimulator.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/Shared.IOS.ESVideoPhoneSDK-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/project-cache/Shared.IOS.ESVideoPhoneSDK-Release.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Arch.Core.Common.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Arch.Lifecycle.Common.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Arch.Lifecycle.Runtime.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Animated.Vector.Drawable.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Annotations.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Compat.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Core.UI.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Core.Utils.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Fragment.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Media.Compat.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.Vector.Drawable.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.v4.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/android/Xamarin.Android.Support.v7.AppCompat.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/ICSharpCode.SharpZipLib.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/Shared.Droid.HDLWidget.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/Shared.Droid.TouchID.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/Shared.Droid.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/Shared.IOS.TBL.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/Shared.IOS.TCL.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/Shared.IOS.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/Xamarin.Essentials.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/video.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/dll/videoBind.dll 补丁 | 查看 | 原始文档 | blame | 历史
CommonLib/libWeChatSDK.a 补丁 | 查看 | 原始文档 | blame | 历史
DLL/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
DLL/IOS/EZSDK.IOS.dll 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/.vs/HDL-ON_Android/xs/UserPrefs.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/.vs/HDL-ON_Android/xs/project-cache/HDL-ON_Android-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/LogicIcon/selected+.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/1024.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120x120.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40x40.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/80x80.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/EZ/Base.lproj/AddDevice.storyboard 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/EZ/Base.lproj/EZMain.storyboard 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/MJRefresh.bundle/arrow@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/LogicIcon/selected+.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/zh-Hans.lproj/Localizable.strings 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/HDLCommon.cs 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 573 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Packet.cs 253 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewApiRes.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/AC.cs 644 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/AirCleaner.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Curtain.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/DeviceFunction.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Fan.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/FloorHeating.cs 372 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Light.cs 301 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Scene.cs 218 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Sensor.cs 506 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/SwitchSocket.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/TV.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/WeepRobot.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 711 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Room.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/UpdataSidDataDialog.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Stan/Controls/BottomControls/BottomDialogCommon.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Stan/Controls/BottomControls/BottomTimeSelectControl.cs 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs 122 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs 625 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/ArmSensorHistroyPaging.cs 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorDoorWinwsPage.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorSmokePage.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs 116 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPage.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPage.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs 170 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerSetTimePage.cs 262 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotConsumablesMagPage.cs 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs 197 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HdlBluWi/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HdlBluWi/.vs/HdlBluWi/xs/UserPrefs.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HdlBluWi/.vs/HdlBluWi/xs/project-cache/HdlBluWi-Debug.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HdlBluWi/.vs/HdlBluWi/xs/project-cache/HdlBluWi-Release.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/1024·1024@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/120·120@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/120·120@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/180·180@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/20·20.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/29·29.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/40·40@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/512·512.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/58·58@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/60·60@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/80·80@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
asset/logo/87·87@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
file/广州河东1件证书.pdf 补丁 | 查看 | 原始文档 | blame | 历史
.DS_Store
Binary files differ
.gitignore
@@ -16,6 +16,9 @@
bld/
[Bb]in/
[Oo]bj/
.vs/
.DS_Store
.gitignore
# Roslyn cache directories
*.ide/
.vs/HDL_APP_Project/xs/.#UserPrefs.xml
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,47 +1,27 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-001674E61438002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs">
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.94B44E9C-E1BC-4BF7-812E-FC71E9B623B2" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI1-Login/LoginPage.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="276" Column="82" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="294" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="170" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" Line="12" Column="33" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="10" Column="23" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs" Line="50" Column="46" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/SaveView.cs" Line="11" Column="57" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="267" Column="70" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="435" Column="63" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs" Line="147" Column="32" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs" Line="8" Column="16" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs" Line="252" Column="18" />
      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="199" Column="17" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs" />
      <File FileName="HDL_ON/Common/ApiUtlis.cs" />
      <File FileName="HDL_ON/Entity/Room.cs" />
      <File FileName="HDL_ON/Entity/FunctionList.cs" />
      <File FileName="HDL_ON/UI/MainPage.cs" />
      <File FileName="HDL-ON_iOS/Info.plist" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="Mqtt" expanded="True" />
                <Node name="Server" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="Function" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI2" expanded="True">
                  <Node name="3-Intelligence" expanded="True">
                    <Node name="Automation" expanded="True" />
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True">
                      <Node name="View" expanded="True" />
                      <Node name="Method.cs" selected="True" />
                    </Node>
                  </Node>
                <Node name="UI1-Login" expanded="True">
                  <Node name="LoginPage.cs" selected="True" />
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True" />
          </Node>
        </State>
      </Pad>
@@ -53,11 +33,11 @@
    <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.4b65c4650918" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/hdl/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" line="274" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/DriverLayer/Control.cs" relfile="HDL_ON/DAL/DriverLayer/Control.cs" line="458" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
.vs/HDL_APP_Project/xs/project-cache/Blufi-Debug.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/Blufi-Release.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/EZSDK.IOS-Debug.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/EZSDK.IOS-Release.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_Android-Debug.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_Android-Release.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Debug|iPhone.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Debug|iPhoneSimulator.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Release|iPhone.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/HDL-ON_iOS-Release|iPhoneSimulator.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/Shared.IOS.ESVideoPhoneSDK-Debug.json
File was deleted
.vs/HDL_APP_Project/xs/project-cache/Shared.IOS.ESVideoPhoneSDK-Release.json
File was deleted
CommonLib/android/Xamarin.Android.Arch.Core.Common.dll
Binary files differ
CommonLib/android/Xamarin.Android.Arch.Lifecycle.Common.dll
Binary files differ
CommonLib/android/Xamarin.Android.Arch.Lifecycle.Runtime.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Animated.Vector.Drawable.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Annotations.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Compat.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Core.UI.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Core.Utils.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Fragment.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Media.Compat.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.Vector.Drawable.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.v4.dll
Binary files differ
CommonLib/android/Xamarin.Android.Support.v7.AppCompat.dll
Binary files differ
CommonLib/dll/ICSharpCode.SharpZipLib.dll
Binary files differ
CommonLib/dll/Shared.Droid.HDLWidget.dll
Binary files differ
CommonLib/dll/Shared.Droid.TouchID.dll
Binary files differ
CommonLib/dll/Shared.Droid.dll
Binary files differ
CommonLib/dll/Shared.IOS.TBL.dll
Binary files differ
CommonLib/dll/Shared.IOS.TCL.dll
Binary files differ
CommonLib/dll/Shared.IOS.dll
Binary files differ
CommonLib/dll/Xamarin.Essentials.dll
Binary files differ
CommonLib/dll/video.dll
Binary files differ
CommonLib/dll/videoBind.dll
Binary files differ
CommonLib/libWeChatSDK.a
Binary files differ
DLL/.DS_Store
copy from CommonLib/.DS_Store copy to DLL/.DS_Store Binary files differ
DLL/IOS/EZSDK.IOS.dll
Binary files differ
HDL-ON_Android/.DS_Store
copy from CommonLib/.DS_Store copy to HDL-ON_Android/.DS_Store Binary files differ
HDL-ON_Android/.vs/HDL-ON_Android/xs/UserPrefs.xml
File was deleted
HDL-ON_Android/.vs/HDL-ON_Android/xs/project-cache/HDL-ON_Android-Debug.json
File was deleted
HDL-ON_Android/Assets/Language.ini
@@ -399,6 +399,21 @@
414=Controller on
415=Someone
416=Log
417=Water Leakage
418=In Alarm
419=Normal
420=Hot dry
421=Air dry
422=Disinfect
423=Lighting
424=Time
425=Hot dry time
426=Air dry time
427=Disinfect time
428=Anion Time
1002=Anion
    
5000=Music
5001=Group
@@ -1061,7 +1076,20 @@
413=控制器未开启
414=控制器已开启
415=有人
516=日志
416=日志
417=漏水
418=报警
419=正常
420=烘干
421=风干
422=消毒
423=照明
424=时间
425=烘干时间
426=风干时间
427=消毒时间
428=负离子时间
1000=室内湿度
1001=童锁
@@ -1099,9 +1127,9 @@
1033=耗材管理
1034=历史记录
1035=自动清扫
1036=定点清扫
1036=随机清扫
1037=沿墙清扫
1038=区域清扫
1038=螺旋清扫
1039=总清洁面积
1040=总清洁时间
1041=边刷剩余寿命
@@ -1164,7 +1192,6 @@
5047=你手机暂未安装"QQ音乐"{\r\n}请前往手机商场安装
6000=正常
6001=设备状态
6002=个
@@ -1180,6 +1207,8 @@
6012=红外遥控
6013=设备管理
6014=添加遥控器
6015=在线
6016=离线
6017=版本号
HDL-ON_Android/Assets/Phone/LogicIcon/selected+.png

HDL-ON_Android/HDL-ON_Android.csproj
@@ -153,48 +153,70 @@
    <AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher.xml" />
    <AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher_round.xml" />
    <AndroidResource Include="Resources\drawable\Loading.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\drawable\Icon.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\mipmap-xxhdpi\Icon.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\xml\network_security_config.xml">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\xml\file_paths.xml">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\layout\zxing_layout.xml">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\mipmap-xhdpi\Icon.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\mipmap-mdpi\Icon.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\mipmap-hdpi\Icon.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\mipmap-anydpi-v26\Icon.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
    <AndroidResource Include="Resources\mipmap-xxxhdpi\Icon.png">
      <SubType></SubType>
      <Generator></Generator>
      <SubType>
      </SubType>
      <Generator>
      </Generator>
    </AndroidResource>
  </ItemGroup>
  <ItemGroup>
@@ -208,6 +230,7 @@
    <Folder Include="Assets\Phone\FunctionIcon\Electrical\ClothesHanger\" />
    <Folder Include="Assets\Phone\PirIcon\" />
  </ItemGroup>
  <ItemGroup />
  <ItemGroup>
    <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
@@ -648,7 +671,6 @@
    <AndroidAsset Include="Assets\Phone\LogicIcon\-.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\+.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\point.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\ selected+.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\selected-.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\link.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\selectTheFun.png" />
@@ -807,17 +829,18 @@
    <AndroidAsset Include="Assets\Phone\PirIcon\icon1.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\icon2.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\succeed.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\left.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\right.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\1.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\2.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\3.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\4.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\selected+.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" />
    <AndroidNativeLibrary Include="libs\armeabi-v7a\libjcore127.so" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\ys\ys.csproj">
      <Project>{DF065E3F-C3A1-4908-9582-000974B7C290}</Project>
      <Name>ys</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" />
  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
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="202102252" android:versionName="1.1.202102252" package="com.hdl.onpro">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103051" android:versionName="1.1.202103051" package="com.hdl.onpro">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" />
    <!--  å®šä½æƒé™-->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
HDL-ON_iOS/.DS_Store
Binary files differ
HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/1024.png

HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120x120.png

HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40x40.png

HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/80x80.png

HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -47,14 +47,14 @@
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <MtouchArch>ARM64</MtouchArch>
        <CodesignKey>iPhone Developer: xuebiao huang (4P32GXQWWK)</CodesignKey>
        <CodesignKey>Apple Development: xuebiao huang (4P32GXQWWK)</CodesignKey>
        <MtouchDebug>true</MtouchDebug>
        <MtouchI18n>cjk</MtouchI18n>
        <MtouchLink>SdkOnly</MtouchLink>
        <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs>
        <MtouchEnableSGenConc>false</MtouchEnableSGenConc>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignProvision>ComHdlOnProDevelopment20210225-1</CodesignProvision>
<CodesignProvision>ComHdlOnProDevelopment20210305-1</CodesignProvision>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
        <DebugType>none</DebugType>
@@ -885,7 +885,6 @@
      <BundleResource Include="Resources\Phone\LogicIcon\-.png" />
      <BundleResource Include="Resources\Phone\LogicIcon\+.png" />
      <BundleResource Include="Resources\Phone\LogicIcon\point.png" />
      <BundleResource Include="Resources\Phone\LogicIcon\ selected+.png" />
      <BundleResource Include="Resources\Phone\LogicIcon\selected-.png" />
      <BundleResource Include="Resources\Phone\oRobot.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorWheelGray.png" />
@@ -1057,6 +1056,7 @@
      <BundleResource Include="Resources\Phone\PirIcon\online.png" />
      <BundleResource Include="Resources\Phone\PirIcon\adddevice.png" />
      <BundleResource Include="Resources\Phone\PirIcon\next.png" />
      <BundleResource Include="Resources\Phone\LogicIcon\selected+.png" />
    </ItemGroup>
    <ItemGroup>
      <ITunesArtwork Include="iTunesArtwork" />
HDL-ON_iOS/Info.plist
@@ -102,9 +102,9 @@
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleShortVersionString</key>
    <string>1.1.202102242</string>
    <string>1.1.202103051</string>
    <key>CFBundleVersion</key>
    <string>202102242</string>
    <string>202103051</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL-ON_iOS/Resources/EZ/Base.lproj/AddDevice.storyboard
@@ -141,6 +141,7 @@
                                <constraints>
                                    <constraint firstAttribute="height" constant="40" id="vLh-9U-8RO"/>
                                </constraints>
                                <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <textInputTraits key="textInputTraits" keyboardType="alphabet"/>
                                <connections>
@@ -165,6 +166,7 @@
                                <constraints>
                                    <constraint firstAttribute="height" constant="40" id="DjM-dg-5en"/>
                                </constraints>
                                <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <textInputTraits key="textInputTraits" keyboardType="alphabet"/>
                                <connections>
@@ -450,6 +452,7 @@
                                <constraints>
                                    <constraint firstAttribute="height" constant="34" id="FPO-BB-N1L"/>
                                </constraints>
                                <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <textInputTraits key="textInputTraits" secureTextEntry="YES"/>
                            </textField>
@@ -912,7 +915,7 @@
    <inferredMetricsTieBreakers>
        <segue reference="9TP-S2-hhI"/>
        <segue reference="MFl-yy-ZsP"/>
        <segue reference="VYk-37-nb6"/>
        <segue reference="ikM-Zn-H8f"/>
    </inferredMetricsTieBreakers>
    <resources>
        <image name="addDevice_success" width="320" height="185"/>
HDL-ON_iOS/Resources/EZ/Base.lproj/EZMain.storyboard
@@ -2025,10 +2025,11 @@
                        <subviews>
                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入设备名称" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="r1W-d8-Rg7">
                                <rect key="frame" x="0.0" y="94" width="375" height="40"/>
                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="40" id="NLX-OK-XZ7"/>
                                </constraints>
                                <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                <textInputTraits key="textInputTraits"/>
                            </textField>
@@ -2471,7 +2472,7 @@
    <inferredMetricsTieBreakers>
        <segue reference="Qls-Y0-o2u"/>
        <segue reference="X3Q-o5-p8V"/>
        <segue reference="q2I-Q5-CUY"/>
        <segue reference="9Tu-UR-Cms"/>
        <segue reference="vdt-wN-aOY"/>
    </inferredMetricsTieBreakers>
    <color key="tintColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
HDL-ON_iOS/Resources/Language.ini
@@ -402,11 +402,20 @@
417=Water Leakage
418=In Alarm
419=Normal
420=Hot Dry
421=Air Dry
420=Hot dry
421=Air dry
422=Disinfect
423=Lighting
424=Time
425=Hot dry time
426=Air dry time
427=Disinfect time
428=Anion Time
429=h
430=m
1002=Anion
    
5000=Music
5001=Group
@@ -1077,6 +1086,13 @@
421=风干
422=消毒
423=照明
424=时间
425=烘干时间
426=风干时间
427=消毒时间
428=负离子时间
429=小时
430=分钟
1000=室内湿度
@@ -1115,9 +1131,9 @@
1033=耗材管理
1034=历史记录
1035=自动清扫
1036=定点清扫
1036=随机清扫
1037=沿墙清扫
1038=区域清扫
1038=螺旋清扫
1039=总清洁面积
1040=总清洁时间
1041=边刷剩余寿命
HDL-ON_iOS/Resources/MJRefresh.bundle/arrow@2x.png

HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/.DS_Store
Binary files differ
HDL-ON_iOS/Resources/Phone/LogicIcon/selected+.png

HDL-ON_iOS/Resources/zh-Hans.lproj/Localizable.strings
@@ -23,7 +23,7 @@
"ad_restart_tip"="长按设备上的reset键10秒后松开,并等待大约30秒直到设备启动完成";
"ad_restart_done"="我已重启好";
"ad_get_device_info_msg"="正在查询设备信息,请稍后...";
"ad_already_added"="您已添加过此设备";
"ad_already_added"="此设备已被添加";
"ad_added_by_others"="此设备已被别人添加";
"get_info_fail"="查询失败,网络不给力";
"ad_input_manual"="手动输入";
HDL_ON/Common/HDLCommon.cs
@@ -278,7 +278,7 @@
                            ShowAlarmPushMessage(jpushMessageInfo);
                            //new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show();
                        }
                    });
                    return;
                }
@@ -384,8 +384,9 @@
            {
                //Dialog
                alarmPushConfirmDialog = null;
                Action backAction = () => {
                Action backAction = () =>
                {
                };
                var skipPage = new MessageCenterPage();
                MainPage.BasePageView.AddChidren(skipPage);
@@ -480,7 +481,7 @@
            {
                MainPage.InternetStatus = 1;
                Control.Ins.SearchLoaclGateway();
            }
            else if (internetStatus == 2)//WiFi网络
            {
@@ -489,5 +490,87 @@
            }
        }
        #endregion
        #region è·³è½¬æ‰“开萤石云方法
        /// <summary>
        /// èŽ·å–å­è´¦å·token并跳转设备列表页面
        /// </summary>
        /// <param name="bodyView"></param>
        public void Go2EZvizMonitor(FrameLayout bodyView)
        {
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new Thread(() =>
            {
                try
                {
                    //先获取萤石云子账号token
                    var result = new HttpServerRequest().EZGetChildToken();
                    if (result.Code == StateCode.SUCCESS)
                    {
                        var ezChildAccessToken = Newtonsoft.Json.JsonConvert.DeserializeObject<EZChildAccessToken>(result.Data.ToString());
                        Application.RunOnMainThread(() =>
                        {
                            if (!string.IsNullOrEmpty(ezChildAccessToken.accessToken))
                            {
#if __IOS__
                                //iOS
                                //1.设置所需河东的AccessToken和RefreshToken、域名地址
                                EZSDK.IOS.EZSDK.SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken);
                                EZSDK.IOS.EZSDK.SetRequestHttpsHost(OnAppConfig.Instance.RequestHttpsHost);
                                //2.设置萤石子账号的AccessToken到SDK
                                EZSDK.IOS.EZSDK.SetEZAccessToken(ezChildAccessToken.accessToken);
                                //3.打开摄像头设备列表页面
                                EZSDK.IOS.EZSDK.Go2EZvizMonitor();
#else
                                //Android
                                //1.设置所需河东的token、域名地址
                                //2.设置萤石子账号的token
                                //3.打开摄像头设备列表页面
                                ((BaseActivity)Shared.Application.Activity).SetCamera(b =>
                                {
                                    if (b)
                                    {
                                        Android.Content.Intent intent = new Android.Content.Intent();
                                        intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity"));
                                        Shared.Application.Activity.StartActivity(intent);
                                    }
                                });
#endif
                            }
                        });
                    }
                    else
                    {
                        IMessageCommon.Current.ShowErrorInfoAlter(result.Code);
                    }
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        #endregion
    }
}
HDL_ON/Common/R.cs
@@ -4,7 +4,14 @@
{
    public static class StringId
    {
        public const int Lightint = 433;
        public const int MinuteUint = 430;
        public const int HourUint = 429;
        public const int AnionTime = 428;
        public const int DisinfectTime = 427;
        public const int WindDryTime = 426;
        public const int HotDryTime = 425;
        public const int Time = 424;
        public const int Lightint = 423;
        public const int Disinfect = 422;
        public const int WindDry = 421;
        public const int HotDry = 420;
@@ -561,17 +568,17 @@
        /// </summary>
        public const int AutoClean = 1035;
        /// <summary>
        /// å®šç‚¹æ¸…扫
        /// éšæœºæ¸…扫
        /// </summary>
        public const int FixedPointClean = 1036;
        public const int RandomClean = 1036;
        /// <summary>
        /// æ²¿å¢™æ¸…扫
        /// </summary>
        public const int WallClean = 1037;
        /// <summary>
        /// åŒºåŸŸæ¸…扫
        /// èžºæ—‹æ¸…扫
        /// </summary>
        public const int AreaClean = 1038;
        public const int SpiralClean = 1038;
        /// <summary>
        /// æ€»æ¸…洁面积
        /// </summary>
HDL_ON/DAL/DriverLayer/Control.cs
@@ -65,63 +65,6 @@
        /// </summary>
        public bool IsSearchLocalGatewaySuccessful = false;
      
        ///// <summary>
        /////
        ///// </summary>
        //bool _gatewayOnline1 = false;
        ///// <summary>
        ///// ç½‘关是否在线
        ///// </summary>
        //public bool GatewayOnline1
        //{
        //    get
        //    {
        //        return _gatewayOnline;
        //    }
        //    set
        //    {
        //        if (_gatewayOnline != value)
        //        {
        //            if(value)
        //            {
        //                if (IsRemote)//如果是远程
        //                {
        //                    if(DB_ResidenceData.Instance.HomeGateway == null)
        //                    {
        //                        return;
        //                    }
        //                    if (!DB_ResidenceData.Instance.HomeGateway.gatewayStatus)//远程情况下,网关未链接服务器不能修改主页网关状态
        //                    {
        //                        new System.Threading.Thread(() => {
        //                            System.Threading.Thread.Sleep(3000);
        //                            var pm = new DAL.Server.HttpServerRequest();
        //                            pm.GetGatewayInfo();
        //                        }) { IsBackground = true }.Start();
        //                        return;
        //                    }
        //                }
        //                _gatewayOnline = value;
        //                //修改主页连接状态
        //                HomePage.LoadEvent_CheckLinkStatus();
        //                MainPage.Log($"网关在线,刷新设备状态");
        //                new System.Threading.Thread(() =>
        //                {
        //                    System.Threading.Thread.Sleep(1000);
        //                    FunctionList.List.ReadAllFunctionStatus();
        //                })
        //                { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start();
        //            }
        //            else
        //            {
        //                _gatewayOnline = value;
        //                //修改主页连接状态
        //                HomePage.LoadEvent_CheckLinkStatus();
        //            }
        //        }
        //    }
        //}
        bool _GatewayOnline_Local = false;
        /// <summary>
        /// ç½‘关在线-局域网
@@ -511,7 +454,8 @@
            var pack = pm.GetDeviceInfoList(functionIds);
            if(pack!= null&& pack.Data!=null)
            {
                var ddd = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Function>>(pack.Data.ToString());
                //待测试2021-03-04
                var ddd = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AlinkStatusData>>(pack.Data.ToString());
                if(ddd!= null)
                {
                    foreach(var function in ddd)
@@ -519,10 +463,9 @@
                        var temp = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.deviceId == function.deviceId);
                        if(temp!= null)
                        {
                            temp = function;
                            if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(temp.spk))
                            {
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(temp.sid, temp.status);
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(temp.sid, function.status);
                            }
                        }
                    }
@@ -577,21 +520,6 @@
                var pack = pm.RefreshDeviceStatus(new List<string>() { function.deviceId });
            }
        }
        ///// <summary>
        ///// å‘送A协议读取命令
        ///// </summary>
        //public void SendReadCommand(List<Dictionary<string, string>> keyValuePairs)
        //{
        //    var readDataObj = new GatewayAlinkReadObj()
        //    {
        //        id = Ins.msg_id.ToString(),
        //        objects = keyValuePairs,
        //        time_stamp = Utlis.GetTimestamp()
        //    };
        //    var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(readDataObj);
        //    var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ReadStatus, functionControlDataJson);
        //    Ins.myUdp.SendLocalHdlLinkData(sendBytes);
        //}
        /// <summary>
        /// a协议控制场景
@@ -601,16 +529,8 @@
        {
            if (!Ins.GatewayOnline_Local)//网关本地不在线
            {
                //云端做处理发送一端口场景
                //if (DB_ResidenceData.Instance.GatewayType == 0)
                //{
                //    new Control_Udp().ControlBusScenes(scene);
                //}
                //else
                {
                    var pm = new DAL.Server.HttpServerRequest();
                    var result = pm.ExecuteScene(scene.userSceneId);
                }
                var pm = new DAL.Server.HttpServerRequest();
                var result = pm.ExecuteScene(scene.userSceneId);
            }
            else
            {
@@ -733,9 +653,17 @@
        /// A协议数据
        /// </summary>
        /// <param name="updateBytes"></param>
        public void UpdataFunctionStatus(string revString, byte[] usefulBytes)
        public void UpdataFunctionStatus(string revString, byte[] usefulBytes,bool isCloudData = false)
        {
            MainPage.Log($"A协议更新状态:{revString}");
            if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理
            {
                if (FunctionList.List.GetDeviceFunctionList(SPK.BrandType.Tuya).Count == 0)
                {
                    //MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理...");
                    return;
                }
            }
            var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString);
            if (temp != null)
            {
@@ -745,305 +673,188 @@
                {
                    try
                    {
                        //bool hadChange = false;//状态有变化再更新界面
                        var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid);
                        if (localFunction != null)
                        if (localFunction == null)
                        {
                            //更新界面状态
                            Function localObj = null;
                            switch (localFunction.spk)
                            continue;
                        }
                        if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理
                        {
                            if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk))
                            {
                                case SPK.LightSwitch:
                                    var localSwitch = FunctionList.List.lights.Find((obj) => obj.sid == updateTemp.sid);
                                    if (localSwitch != null)
                                    {
                                        localObj = localSwitch;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = localSwitch.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        //rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + rgb.brightness + "%";
                                        RelayPage.UpdataState(localSwitch);
                                    }
                                    break;
                                case SPK.LightDimming:
                                    var dimming = FunctionList.List.lights.Find((obj) => obj.sid == updateTemp.sid);
                                    if (dimming != null)
                                    {
                                        localObj = dimming;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = dimming.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        dimming.lastState = Language.StringByID(StringId.Brightness) + " : " + dimming.brightness + "%";
                                        DimmerPage.UpdataStates(dimming);
                                    }
                                    break;
                                case SPK.ElectricFan:
                                    var fan = FunctionList.List.fans.Find((obj) => obj.sid == updateTemp.sid);
                                    if (fan != null)
                                    {
                                        localObj = fan;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = fan.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        fan.lastState = Language.StringByID(StringId.Level) + " : " + fan.openLevel;
                                        FanPage.UpdataState(fan);
                                    }
                                    break;
                                case SPK.LightRGB:
                                    var rgb = FunctionList.List.lights.Find((obj) => obj.sid == updateTemp.sid);
                                    if (rgb != null)
                                    {
                                        localObj = rgb;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = rgb.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + rgb.brightness + "%";
                                        RGBPage.UpdataStates(rgb);
                                    }
                                    break;
                                case SPK.LightRGBW:
                                    break;
                                case SPK.LightCCT:
                                    var lightCCT = FunctionList.List.lights.Find((obj) => obj.sid == updateTemp.sid);
                                    if (lightCCT != null)
                                    {
                                        localObj = lightCCT;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = lightCCT.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        lightCCT.lastState = Language.StringByID(StringId.Brightness) + " : " + lightCCT.brightness + "%";
                                        ColorTureLampPage.UpdataStates(lightCCT);
                                    }
                                    break;
                                case SPK.CurtainSwitch:
                                    var curtain = FunctionList.List.curtains.Find((obj) => obj.sid == updateTemp.sid);
                                    if (curtain != null)
                                    {
                                        localObj = curtain;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = curtain.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        curtain.lastState = curtain.trait_on_off.curValue.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close);
                                        CurtainModulePage.UpdataState(curtain);
                                    }
                                    break;
                                case SPK.CurtainTrietex:
                                    var trietex = FunctionList.List.curtains.Find((obj) => obj.sid == updateTemp.sid);
                                    if (trietex != null)
                                    {
                                        localObj = trietex;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = trietex.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        trietex.lastState = Language.StringByID(StringId.Open) + trietex.percent + "%";
                                        MotorCurtainPage.UpdataState(trietex);
                                    }
                                    break;
                                case SPK.CurtainRoller:
                                    var roller = FunctionList.List.curtains.Find((obj) => obj.sid == updateTemp.sid);
                                    if (roller != null)
                                    {
                                        localObj = roller;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = roller.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        roller.lastState = Language.StringByID(StringId.Open) + roller.percent + "%";
                                        RollingShutterPage.UpdataState(roller);
                                    }
                                    break;
                                case SPK.CurtainShades:
                                    break;
                                case SPK.AcStandard:
                                    var ac = FunctionList.List.aCs.Find((obj) => obj.sid == updateTemp.sid);
                                    if (ac != null)
                                    {
                                        localObj = ac;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = ac.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        ac.lastState = "";
                                        switch (ac.trait_mode.curValue.ToString())
                                        {
                                            case "cool":
                                                ac.lastState = Language.StringByID(StringId.Cool);
                                                break;
                                            case "heat":
                                                ac.lastState = Language.StringByID(StringId.Heat);
                                                break;
                                            case "dry":
                                                ac.lastState = Language.StringByID(StringId.Dry);
                                                break;
                                            case "auto":
                                                ac.lastState = Language.StringByID(StringId.Auto);
                                                break;
                                            case "fan":
                                                ac.lastState = Language.StringByID(StringId.AirSupply);
                                                break;
                                        }
                                        switch (ac.trait_fan.curValue.ToString())
                                        {
                                            case "high":
                                                ac.lastState += " " + Language.StringByID(StringId.HighWindSpeed);
                                                break;
                                            case "medium":
                                                ac.lastState += " " + Language.StringByID(StringId.MiddleWindSpeed);
                                                break;
                                            case "low":
                                                ac.lastState += " " + Language.StringByID(StringId.LowWindSpeed);
                                                break;
                                            case "auto":
                                                ac.lastState += " " + Language.StringByID(StringId.Auto);
                                                break;
                                        }
                                        ac.lastState += " " + ac.trait_temp.curValue + ac.tempUnitString;
                                        ACPage.UpdataStates(ac);
                                    }
                                    break;
                                case SPK.FloorHeatStandard:
                                    var fh = FunctionList.List.floorHeatings.Find((obj) => obj.sid == updateTemp.sid);
                                    if (fh != null)
                                    {
                                        localObj = fh;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = fh.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        switch (fh.trait_mode.curValue)
                                        {
                                            case "normal":
                                                fh.lastState = Language.StringByID(StringId.Normal);
                                                break;
                                            case "day":
                                                fh.lastState = Language.StringByID(StringId.Day);
                                                break;
                                            case "night":
                                                fh.lastState = Language.StringByID(StringId.Night);
                                                break;
                                            case "timer":
                                                fh.lastState = Language.StringByID(StringId.Auto);
                                                break;
                                            case "away":
                                                fh.lastState = Language.StringByID(StringId.Away);
                                                break;
                                        }
                                        fh.lastState += " " + fh.trait_temp.curValue + fh.tempUnitString;
                                        FloorHeatingPage.UpdataStates(fh);
                                    }
                                    break;
                                case SPK.SensorPm25:
                                case SPK.SensorCO2:
                                case SPK.SensorTVOC:
                                case SPK.SensorTemperature:
                                case SPK.SensorHumidity:
                                    var sensor = FunctionList.List.sensorsEnvironmentalScience.Find((obj) => obj.sid == updateTemp.sid);
                                    if (sensor != null)
                                    {
                                        localObj = sensor;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = sensor.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        EnvironmentalSciencePage.LoadEvent_UpdataStatus(sensor);
                                    }
                                    break;
                                case SPK.ElectricSocket:
                                    var es = FunctionList.List.switchSockets.Find((obj) => obj.sid == updateTemp.sid);
                                    if (es != null)
                                    {
                                        localObj = es;
                                        foreach (var attr in updateTemp.status)
                                        {
                                            var localAttr = es.attributes.Find((obj) => obj.key == attr.key);
                                            if (localAttr != null)
                                            {
                                                localAttr.curValue = attr.value;
                                            }
                                        }
                                        SocketPage.UpdataState(es);
                                    }
                                    break;
                                case SPK.ElectricTV:
                                    break;
                                case SPK.ElectricTuyaAirCleaner:
                                case SPK.ElectricTuyaFan:
                                case SPK.ElectricTuyaWeepRobot:
                                case SPK.ElectricTuyaWaterValve:
                                case SPK.SensorPir:
                                case SPK.SensorDoorWindow:
                                case SPK.SensorSmoke:
                                case SPK.SensorWater:
                                case SPK.ClothesHanger:
                                    //设备状态推送
                                    var myDevice = Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid,updateTemp.status);
                                    if (myDevice != null)
                                    {
                                        localObj = myDevice;
                                    }
                                    break;
                                default:
                                    break;
                            }
                            if (localObj != null)
                            {
                                HomePage.UpdataFunctionStates(localObj);
                                RoomPage.UpdataStates(localObj);
                                FunctionPage.UpdataStates(localObj);
                                ClassificationPage.UpdataInfo(localObj);
                                //MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理........");
                                return;
                            }
                        }
                        MainPage.Log($"A协议更新状态:{revString}");
                        foreach (var attr in updateTemp.status)
                        {
                            localFunction.SetAttrState(attr.key, attr.value);
                        }
                        //更新界面状态
                        Function localObj = null;
                        switch (localFunction.spk)
                        {
                            case SPK.LightSwitch:
                                RelayPage.UpdataState(localFunction);
                                break;
                            case SPK.LightDimming:
                                localFunction.lastState = Language.StringByID(StringId.Brightness) + " : " +
                                                        localFunction.GetAttrState(FunctionAttributeKey.Brightness) + "%";
                                DimmerPage.UpdataStates(localFunction);
                                break;
                            case SPK.ElectricFan:
                                localFunction.lastState = Language.StringByID(StringId.Level) + " : " +
                                   localFunction.GetAttrState(FunctionAttributeKey.OpenLevel);
                                FanPage.UpdataState(localFunction);
                                break;
                            case SPK.LightRGB:
                                localFunction.lastState = Language.StringByID(StringId.Brightness) + " : " + localFunction.GetAttrState(FunctionAttributeKey.Brightness) + "%";
                                RGBPage.UpdataStates(localFunction);
                                break;
                            case SPK.LightRGBW:
                                break;
                            case SPK.LightCCT:
                                localFunction.lastState = Language.StringByID(StringId.Brightness) + " : " + localFunction.GetAttrState(FunctionAttributeKey.Brightness) + "%";
                                ColorTureLampPage.UpdataStatus(localFunction);
                                break;
                            case SPK.CurtainSwitch:
                                localFunction.lastState = localFunction.trait_on_off.curValue.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close);
                                CurtainModulePage.UpdataState(localFunction);
                                break;
                            case SPK.CurtainTrietex:
                                localFunction.lastState = Language.StringByID(StringId.Open) + localFunction.GetAttrState(FunctionAttributeKey.Percent) + "%";
                                MotorCurtainPage.UpdataState(localFunction);
                                break;
                            case SPK.CurtainRoller:
                                localFunction.lastState = Language.StringByID(StringId.Open) + localFunction.GetAttrState(FunctionAttributeKey.Percent) + "%";
                                RollingShutterPage.UpdataState(localFunction);
                                break;
                            case SPK.CurtainShades:
                                break;
                            case SPK.AcStandard:
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status);
                                if (localFunction != null)
                                {
                                    localFunction.lastState = "";
                                    switch (localFunction.GetAttrState(FunctionAttributeKey.Mode))
                                    {
                                        case "cool":
                                            localFunction.lastState = Language.StringByID(StringId.Cool);
                                            break;
                                        case "heat":
                                            localFunction.lastState = Language.StringByID(StringId.Heat);
                                            break;
                                        case "dry":
                                            localFunction.lastState = Language.StringByID(StringId.Dry);
                                            break;
                                        case "auto":
                                            localFunction.lastState = Language.StringByID(StringId.Auto);
                                            break;
                                        case "fan":
                                            localFunction.lastState = Language.StringByID(StringId.AirSupply);
                                            break;
                                    }
                                    switch (localFunction.GetAttrState(FunctionAttributeKey.FanSpeed))
                                    {
                                        case "high":
                                            localFunction.lastState += " " + Language.StringByID(StringId.HighWindSpeed);
                                            break;
                                        case "medium":
                                            localFunction.lastState += " " + Language.StringByID(StringId.MiddleWindSpeed);
                                            break;
                                        case "low":
                                            localFunction.lastState += " " + Language.StringByID(StringId.LowWindSpeed);
                                            break;
                                        case "auto":
                                            localFunction.lastState += " " + Language.StringByID(StringId.Auto);
                                            break;
                                    }
                                    localFunction.lastState += " " + localFunction.GetAttrState(FunctionAttributeKey.SetTemp) + new AC().GetTempUnitString(localFunction);
                                    ACPage.UpdataStates(localFunction);
                                }
                                break;
                            case SPK.FloorHeatStandard:
                                switch (localFunction.GetAttrState(FunctionAttributeKey.Mode))
                                {
                                    case "normal":
                                        localFunction.lastState = Language.StringByID(StringId.Normal);
                                        break;
                                    case "day":
                                        localFunction.lastState = Language.StringByID(StringId.Day);
                                        break;
                                    case "night":
                                        localFunction.lastState = Language.StringByID(StringId.Night);
                                        break;
                                    case "timer":
                                        localFunction.lastState = Language.StringByID(StringId.Auto);
                                        break;
                                    case "away":
                                        localFunction.lastState = Language.StringByID(StringId.Away);
                                        break;
                                }
                                localFunction.lastState += " " + localFunction.GetAttrState(FunctionAttributeKey.SetTemp) + new FloorHeating().GetTempUnitString(localFunction);
                                FloorHeatingPage.UpdataStates(localFunction);
                                break;
                            case SPK.SensorPm25:
                            case SPK.SensorCO2:
                            case SPK.SensorTVOC:
                            case SPK.SensorTemperature:
                            case SPK.SensorHumidity:
                                var sensor = FunctionList.List.GetEnvirSensorsList().Find((obj) => obj.sid == updateTemp.sid);
                                if (sensor != null)
                                {
                                    localObj = sensor;
                                    foreach (var attr in updateTemp.status)
                                    {
                                        var localAttr = sensor.attributes.Find((obj) => obj.key == attr.key);
                                        if (localAttr != null)
                                        {
                                            localAttr.curValue = attr.value;
                                        }
                                    }
                                    EnvironmentalSciencePage.LoadEvent_UpdataStatus(sensor);
                                }
                                break;
                            case SPK.ElectricSocket:
                                var es = FunctionList.List.GetElectricSocketList().Find((obj) => obj.sid == updateTemp.sid);
                                if (es != null)
                                {
                                    localObj = es;
                                    foreach (var attr in updateTemp.status)
                                    {
                                        var localAttr = es.attributes.Find((obj) => obj.key == attr.key);
                                        if (localAttr != null)
                                        {
                                            localAttr.curValue = attr.value;
                                        }
                                    }
                                    SocketPage.UpdataState(es);
                                }
                                break;
                            case SPK.ElectricTV:
                                break;
                            case SPK.ElectricTuyaAirCleaner:
                            case SPK.ElectricTuyaFan:
                            case SPK.ElectricTuyaWeepRobot:
                            case SPK.ElectricTuyaWaterValve:
                            case SPK.SensorPir:
                            case SPK.SensorDoorWindow:
                            case SPK.SensorSmoke:
                            case SPK.SensorWater:
                            case SPK.ClothesHanger:
                            case SPK.IrAC:
                                //设备状态推送
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status);
                                break;
                        }
                        HomePage.UpdataFunctionStates(localFunction);
                        RoomPage.UpdataStates(localFunction);
                        FunctionPage.UpdataStates(localFunction);
                        ClassificationPage.UpdataInfo(localFunction);
                    }
                    catch (Exception ex)
                    {
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -188,47 +188,75 @@
                            }
                            break;
                        case SPK.AcStandard:
                            AC tempAc = new AC();
                            AC acTemp = new AC();
                            byte onoff = 0;
                            byte mode = 0;
                            byte fan = 0;
                            foreach (var attr in f.status)
                            {
                                byte modeKey = 4;
                                switch (attr.key)
                                {
                                    case FunctionAttributeKey.OnOff:
                                        tempAc.trait_on_off.curValue = attr.value;
                                        if(attr.value == "on")
                                        {
                                            onoff = 1;
                                        }
                                        else
                                        {
                                            onoff = 0;
                                        }
                                        break;
                                    case FunctionAttributeKey.Mode:
                                        tempAc.trait_mode.curValue = attr.value;
                                        break;
                                    case FunctionAttributeKey.FanSpeed:
                                        tempAc.trait_fan.curValue = attr.value;
                                        break;
                                    case FunctionAttributeKey.SetTemp:
                                        tempAc.trait_temp.curValue = attr.value;
                                        switch (tempAc.curModeIndex)
                                        switch (attr.value)
                                        {
                                            case 3:
                                            case "auto":
                                                mode = 3;
                                                modeKey = 8;
                                                break;
                                            case 0:
                                            case "cool":
                                                mode = 0;
                                                modeKey = 4;
                                                break;
                                            case 1:
                                            case "heat":
                                                mode = 1;
                                                modeKey = 7;
                                                break;
                                            case 4:
                                            case "dry":
                                                mode = 4;
                                                modeKey = 19;
                                                break;
                                            case 2:
                                            case "fan":
                                                mode = 2;
                                                modeKey = 2;
                                                break;
                                        }
                                        break;
                                    case FunctionAttributeKey.FanSpeed:
                                        switch (attr.value)
                                        {
                                            case "high":
                                                fan = 1;
                                                break;
                                            case "medium":
                                                fan = 2;
                                                break;
                                            case "low":
                                                fan = 3;
                                                break;
                                            case "auto":
                                                fan = 0;
                                                break;
                                            default:
                                                fan = 0;
                                                break;
                                        }
                                        break;
                                }
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 3, tempAc.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 6, tempAc.curModeIndex, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 5, tempAc.curFanIndex, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { modeKey, Convert.ToByte(tempAc.trait_temp.curValue), f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 3, onoff, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 6, mode, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 5, fan, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { modeKey, modeKey, f.localFunction.bus.LoopId });
                            }
                            break;
                        case SPK.LightSwitch:
@@ -260,25 +288,50 @@
                        case SPK.LightRGB:
                            break;
                        case SPK.FloorHeatStandard:
                            var tempFh = new FloorHeating();
                            byte onoff_1 = 0;
                            byte setTemp_1 = 0;
                            byte mode_1 = 0;
                            foreach (var attr in f.status)
                            {
                                switch (attr.key)
                                {
                                    case FunctionAttributeKey.OnOff:
                                        tempFh.trait_on_off.curValue = attr.value;
                                        if (attr.value == "on")
                                        {
                                            onoff_1 = 1;
                                        }
                                        else
                                        {
                                            onoff_1 = 0;
                                        }
                                        break;
                                    case FunctionAttributeKey.SetTemp:
                                        tempFh.trait_temp.curValue = attr.value;
                                        setTemp_1 = Convert.ToByte(attr.value);
                                        break;
                                    case FunctionAttributeKey.Mode:
                                        tempFh.trait_mode.curValue = attr.value;
                                        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;
                                }
                            }
                            byte b1 = tempFh.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0;
                            ControlBytesSend(Command.SetFloorHeat, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] {
                                f. localFunction.bus.LoopId, b1, 0, tempFh.curModeIndex, Convert.ToByte( tempFh.trait_temp.curValue),  Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), 0, 0 });
                                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)
@@ -350,78 +403,93 @@
                switch (function.Spk_Prefix)
                {
                    case FunctionCategory.Light:
                        var light = function as Light;
                        switch (light.spk)
                        switch (function.spk)
                        {
                            case SPK.LightCCT:
                                byte b0 = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0
                                if (light.trait_on_off.curValue.ToString() == "off")
                                if (function.trait_on_off.curValue.ToString() == "off")
                                {
                                    b0 = 0;
                                }
                                else
                                {
                                    b0 = (byte)light.brightness == 0 ? (byte)100 : (byte)light.brightness;
                                    b0 = Convert.ToByte( function.GetAttrState(FunctionAttributeKey.Brightness)) == 0 ? (byte)100 : Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));
                                }
                                var bytes0 = new byte[] { function.bus.LoopId,
                                            b0,
                                            254, 0,Convert.ToByte(light.fadeTime) ,2,
                                            (byte)((int)light.Attr_CCT.curValue/256),(byte)((int)light.Attr_CCT.curValue%256),
                                            (byte)light.BlueColor,
                                            254, 0,Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) ,2,
                                            (byte)(Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.CCT))/256),
                                            (byte)(Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.CCT))%256),
                                            0,
                                            0,0};
                                ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes0, 1);
                                break;
                            case SPK.LightRGB:
                                byte b = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0
                                if (light.trait_on_off.curValue.ToString() == "off")
                                if (function.trait_on_off.curValue.ToString() == "off")
                                {
                                    b = 0;
                                }
                                else
                                {
                                    b = (byte)light.brightness == 0 ? (byte)100 : (byte)light.brightness;
                                    byte lightBri1 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));
                                    if (lightBri1 == 0)
                                    {
                                        b = 100;
                                    }
                                    else
                                    {
                                        b = lightBri1;
                                    }
                                }
                                var tempLight = new Light();
                                var bytes = new byte[] { function.bus.LoopId,
                                            b,
                                            254, 0,Convert.ToByte(light.fadeTime) ,3,
                                            (byte)light.RedColor,(byte)light.GreenColor,
                                            (byte)light.BlueColor,
                                            254, 0,Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) ,3,
                                            (byte)tempLight.GetColor(0,function),
                                            (byte)tempLight.GetColor(1,function),
                                            (byte)tempLight.GetColor(2,function),
                                            0,0};
                                ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes, 1);
                                break;
                            case SPK.LightDimming:
                                byte b1 = 100;
                                if (light.trait_on_off.curValue.ToString() == "off")
                                if (function.trait_on_off.curValue.ToString() == "off")
                                {
                                    b1 = 0;
                                }
                                else
                                {
                                    b1 = (byte)light.brightness == 0 ? (byte)100 : (byte)light.brightness;
                                    byte lightBri = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));
                                    if (lightBri == 0)
                                    {
                                        b = 100;
                                    }
                                    else
                                    {
                                        b = lightBri;
                                    }
                                }
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] {
                                            function.bus.LoopId,
                                            b1,
                                            0, Convert.ToByte(light.fadeTime) });
                                //DimmerPage.UpdataStates(light);
                                            0, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) });
                                break;
                            case SPK.LightSwitch:
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, light.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 });
                                //RelayPage.UpdataState(light);
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 });
                                break;
                        }
                        break;
                    case FunctionCategory.Curtain:
                        var curtain = function as Curtain;
                        switch (curtain.spk)
                        switch (function.spk)
                        {
                            case SPK.CurtainSwitch:
                                byte b1 = 0;
                                if (curtain.trait_on_off.curValue.ToString() == "stop")
                                if (function.trait_on_off.curValue.ToString() == "stop")
                                {
                                    b1 = 0;
                                }
                                else if (curtain.trait_on_off.curValue.ToString() == "on")
                                else if (function.trait_on_off.curValue.ToString() == "on")
                                {
                                    b1 = 1;
                                }
@@ -429,37 +497,19 @@
                                {
                                    b1 = 2;
                                }
                                ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus.LoopId, b1 });
                                ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, b1 });
                                break;
                            case SPK.CurtainTrietex:
                            case SPK.CurtainRoller:
                                //if (commandDictionary.Count > 0)
                                //{
                                if (curtain.trait_on_off.curValue.ToString() == "stop")
                                if (function.trait_on_off.curValue.ToString() == "stop")
                                {
                                    ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus.LoopId, 0 });
                                    ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 });
                                }
                                else
                                {
                                    ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, Convert.ToByte(curtain.percent) });
                                    ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Percent)) });
                                }
                                //}
                                //else
                                //{
                                //    if (curtain.trait_on_off.value.ToString() == "stop")
                                //    {
                                //        ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus_Data.loopId, 0 });
                                //    }
                                //    else if (curtain.trait_on_off.value.ToString() == "on")
                                //    {
                                //        ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, 100 });
                                //    }
                                //    else if (curtain.trait_on_off.value.ToString() == "off")
                                //    {
                                //        ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, 0 });
                                //    }
                                //}
                                break;
                        }
                        break;
@@ -467,25 +517,26 @@
                        switch (function.spk)
                        {
                            case SPK.AcStandard:
                                var aC = function as AC;
                                ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { aC.bus.LoopId, (byte)aC.curTempType, 32, 32, 32, 32, 32, 0, aC.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, aC.curModeIndex, aC.curFanIndex, Convert.ToByte(aC.trait_temp.curValue), 0 });
                                //ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 3, aC.on_off == "on" ? (byte)1 : (byte)0, aC.bus_Data.loopId });
                                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 });
                                foreach (var dic in commandDictionary)
                                {
                                    switch (dic.Key)
                                    {
                                        case "on_off":
                                            ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { 3, aC.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, aC.bus.LoopId });
                                        case FunctionAttributeKey.OnOff:
                                            ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
                                            break;
                                        case "mode":
                                            ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { 6, aC.curModeIndex, aC.bus.LoopId });
                                            ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 6, ac.GetModeIndex(function), function.bus.LoopId });
                                            break;
                                        case "fan":
                                            ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { 5, aC.curFanIndex, aC.bus.LoopId });
                                            ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 5, ac.GetFanIndex(function), function.bus.LoopId });
                                            break;
                                        case "temp":
                                            byte modeKey = 4;
                                            switch (aC.curModeIndex)
                                            switch (ac.GetModeIndex(function))
                                            {
                                                case 3:
                                                    modeKey = 8;
@@ -503,7 +554,8 @@
                                                    modeKey = 2;
                                                    break;
                                            }
                                            ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { modeKey, Convert.ToByte(aC.trait_temp.curValue), aC.bus.LoopId });
                                            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}");
@@ -515,38 +567,48 @@
                        }
                        break;
                    case FunctionCategory.FloorHeat:
                        switch (function.spk) {
                        var fhTemp = new FloorHeating();
                        switch (function.spk)
                        {
                            case SPK.FloorHeatStandard:
                                var fh = function as FloorHeating;
                                if (fh.modeTemp.Count == 4)
                                if (function.Fh_Mode_Temp.Count == 4)
                                {
                                    byte b1 = fh.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0;
                                    if (fh.workMode > 0)
                                    var onoffString = function.trait_on_off.curValue.ToString();
                                    byte b1 = 1;
                                    if(onoffString == "off")
                                    {
                                        b1 += (byte)(16 + fh.workMode);
                                        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);
                                        switch (fh.trait_mode.curValue)
                                        var mode = function.GetAttrState(FunctionAttributeKey.Mode);
                                        switch (mode)
                                        {
                                            case "day":
                                                fh.modeTemp["day"] = dicTemp;
                                                function.Fh_Mode_Temp["day"] = dicTemp;
                                                break;
                                            case "night":
                                                fh.modeTemp["night"] = dicTemp;
                                                function.Fh_Mode_Temp["night"] = dicTemp;
                                                break;
                                            case "away":
                                                fh.modeTemp["away"] = dicTemp;
                                                function.Fh_Mode_Temp["away"] = dicTemp;
                                                break;
                                            case "normal":
                                                fh.modeTemp["normal"] = dicTemp;
                                                function.Fh_Mode_Temp["normal"] = dicTemp;
                                                break;
                                        }
                                    }
                                    ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { fh.bus.LoopId, b1, (byte)fh.curTempType, fh.curModeIndex, fh.modeTemp["normal"], fh.modeTemp["day"], fh.modeTemp["night"], fh.modeTemp["away"], 0, 0 });
                                    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;
                        }
@@ -555,18 +617,16 @@
                        switch (function.spk)
                        {
                            case SPK.ElectricFan:
                                var fan = function as Fan;
                                if (fan.trait_on_off.curValue.ToString() == "on")
                                if (function.trait_on_off.curValue.ToString() == "on")
                                {
                                    ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus.LoopId, (byte)fan.openLevel });
                                    ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.OpenLevel)) });
                                }
                                {
                                    ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus.LoopId, 0 });
                                    ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 });
                                }
                                break;
                            case SPK.ElectricSocket:
                                var s = function as SwitchSocket;
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus.LoopId, s.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 });
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 });
                                break;
                        }
                        break;
@@ -642,17 +702,14 @@
                        switch (function.spk)
                        {
                            case SPK.ElectricFan:
                                var fan = function as Fan;
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus.LoopId });
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId });
                                break;
                            case SPK.ElectricSocket:
                                var s = function as SwitchSocket;
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus.LoopId });
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId });
                                break;
                        }
                        break;
                    case FunctionCategory.Sensor:
                        var sensor = function as Sensor;
                        byte sensorType = 0;
                        switch (function.spk)
                        {
@@ -672,7 +729,7 @@
                                sensorType = 7;
                                break;
                        }
                        ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, sensorType, sensor.bus.LoopId });
                        ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, sensorType, function.bus.LoopId });
                        break;
                }
            }
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -124,8 +124,8 @@
                {
                    case Command.SetSingleLightACK:
                        var queryList = new List<Function>();
                        queryList.AddRange(FunctionList.List.electricals);
                        queryList.AddRange(FunctionList.List.lights);
                        queryList.AddRange(FunctionList.List.GetElectricals());
                        queryList.AddRange(FunctionList.List.GetLightList());
                        foreach (var updataObj in queryList)
                        {
                            if (updataObj.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
@@ -138,11 +138,11 @@
                                        switch (updataObj.spk)
                                        {
                                            case SPK.ElectricFan:
                                                (updataObj as Fan).openLevel = receiveBytes[2];
                                                updataObj.SetAttrState(FunctionAttributeKey.OpenLevel, receiveBytes[2].ToString());
                                                updataObj.lastState = Language.StringByID(StringId.Level) + " : " + receiveBytes[2];
                                                break;
                                            case SPK.LightDimming:
                                                (updataObj as Light).brightness = receiveBytes[2];
                                                updataObj.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[2].ToString());
                                                updataObj.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
                                                break;
                                        }
@@ -154,13 +154,13 @@
                                    switch (updataObj.spk)
                                    {
                                        case SPK.LightSwitch:
                                            RelayPage.UpdataState(updataObj as Light);
                                            RelayPage.UpdataState(updataObj);
                                            break;
                                        case SPK.LightDimming:
                                            DimmerPage.UpdataStates(updataObj as Light);
                                            DimmerPage.UpdataStates(updataObj);
                                            break;
                                        case SPK.ElectricFan:
                                            FanPage.UpdataState(updataObj as Fan);
                                            FanPage.UpdataState(updataObj);
                                            break;
                                    }
                                    break;
@@ -171,7 +171,7 @@
                    case Command.ReadLightAllLoopBrightnessACK:
                        for (int i = 0; i < receiveBytes[0]; i++)
                        {
                            var light = FunctionList.List.lights.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == (i + 1));
                            var light = FunctionList.List.GetLightList().Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == (i + 1));
                            if (light != null)
                            {
                                if (light.spk != SPK.LightRGB)
@@ -179,7 +179,7 @@
                                    light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
                                    if (light.trait_on_off.curValue.ToString() == "on")
                                    {
                                        light.brightness = receiveBytes[2];
                                        light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[2].ToString());
                                        light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
                                    }
                                    HomePage.UpdataFunctionStates(light);
@@ -199,27 +199,26 @@
                            }
                            else
                            {
                                var e = FunctionList.List.electricals.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == i);
                                if (e != null)
                                var function = FunctionList.List.GetElectricals().Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == i);
                                if (function != null)
                                {
                                    var fan = e as Fan;
                                    fan.trait_on_off.curValue = receiveBytes[2] == 0 ? "off" : "on";
                                    if (fan.trait_on_off.curValue.ToString() == "on")
                                    function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[2] == 0 ? "off" : "on");
                                    if (function.trait_on_off.curValue.ToString() == "on")
                                    {
                                        fan.openLevel = receiveBytes[2];
                                        fan.lastState = Language.StringByID(StringId.Level) + " : " + receiveBytes[2];
                                        function.SetAttrState(FunctionAttributeKey.OpenLevel, receiveBytes[2].ToString());
                                        function.lastState = Language.StringByID(StringId.Level) + " : " + receiveBytes[2];
                                    }
                                    HomePage.UpdataFunctionStates(fan);
                                    RoomPage.UpdataStates(fan);
                                    FunctionPage.UpdataStates(fan);
                                    ClassificationPage.UpdataInfo(fan);
                                    switch (fan.spk)
                                    HomePage.UpdataFunctionStates(function);
                                    RoomPage.UpdataStates(function);
                                    FunctionPage.UpdataStates(function);
                                    ClassificationPage.UpdataInfo(function);
                                    switch (function.spk)
                                    {
                                        case SPK.ElectricFan:
                                            FanPage.UpdataState(fan);
                                            FanPage.UpdataState(function);
                                            break;
                                        case SPK.ElectricSocket:
                                            SocketPage.UpdataState(function);
                                            break;
                                    }
                                }
@@ -228,7 +227,7 @@
                        break;
                    case Command.SetLogicLoopColorACK:
                    case Command.ReadLogicLoopColorACK:
                        foreach (var rgb in FunctionList.List.lights)
                        foreach (var rgb in FunctionList.List.GetLightList())
                        {
                            if (rgb.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            {
@@ -237,10 +236,10 @@
                                    rgb.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
                                    if (receiveBytes[1] > 0)
                                    {
                                        rgb.brightness = receiveBytes[1];
                                        rgb.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
                                        rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%";
                                    }
                                    rgb.SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] });
                                    new Light().SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }, rgb);
                                    HomePage.UpdataFunctionStates(rgb);
                                    RoomPage.UpdataStates(rgb);
@@ -253,7 +252,7 @@
                        break;
                    case Command.SetCurtainModelStutasACK:
                    case Command.ReadCurtainStutasACK:
                        foreach (var curtain in FunctionList.List.curtains)
                        foreach (var curtain in FunctionList.List.GetCurtainList())
                        {
                            if (curtain.bus.SubnetID == subnetID && curtain.bus.DeviceID == deviceID)
                            {
@@ -267,8 +266,8 @@
                                    {
                                        curtain.trait_on_off.curValue = "off";
                                    }
                                    curtain.percent = receiveBytes[1];
                                    curtain.lastState = Language.StringByID(StringId.Open) + curtain.percent + "%";
                                    curtain.SetAttrState(FunctionAttributeKey.Percent, receiveBytes[1].ToString());
                                    curtain.lastState = Language.StringByID(StringId.Open) + curtain.GetAttrState(FunctionAttributeKey.Percent) + "%";
                                }
                                else
                                {
@@ -310,149 +309,157 @@
                        break;
                    case Command.SetACModeACK:
                    case Command.ReadACModeACK:
                        foreach (var ac in FunctionList.List.aCs)
                        foreach (var function in FunctionList.List.GetAcList())
                        {
                            if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            var acFunction = new AC();
                            if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            {
                                ac.curTempType = receiveBytes[1];
                                ac.trait_IndoorTemp.curValue = receiveBytes[2].ToString();
                                ac.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
                                ac.curModeIndex = receiveBytes[9];
                                ac.curFanIndex = receiveBytes[10];
                                ac.trait_temp.curValue = receiveBytes[11].ToString();
                                ac.lastState = "";
                                switch (ac.trait_mode.curValue.ToString())
                                function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString());
                                function.SetAttrState(FunctionAttributeKey.IndoorTemp, receiveBytes[2].ToString());
                                function.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
                                acFunction.SetMode(receiveBytes[9],function);
                                acFunction.SetFan(receiveBytes[10],function);
                                function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[11].ToString());
                                function.lastState = "";
                                switch (function.GetAttrState(FunctionAttributeKey.Mode))
                                {
                                    case "cool":
                                        ac.lastState = Language.StringByID(StringId.Cool);
                                        function.lastState = Language.StringByID(StringId.Cool);
                                        break;
                                    case "heat":
                                        ac.lastState = Language.StringByID(StringId.Heat);
                                        function.lastState = Language.StringByID(StringId.Heat);
                                        break;
                                    case "dry":
                                        ac.lastState = Language.StringByID(StringId.Dry);
                                        function.lastState = Language.StringByID(StringId.Dry);
                                        break;
                                    case "auto":
                                        ac.lastState = Language.StringByID(StringId.Auto);
                                        function.lastState = Language.StringByID(StringId.Auto);
                                        break;
                                    case "fan":
                                        ac.lastState = Language.StringByID(StringId.AirSupply);
                                        function.lastState = Language.StringByID(StringId.AirSupply);
                                        break;
                                }
                                switch (ac.trait_fan.curValue.ToString())
                                switch (function.GetAttrState(FunctionAttributeKey.FanSpeed))
                                {
                                    case "high":
                                        ac.lastState += " " + Language.StringByID(StringId.HighWindSpeed);
                                        function.lastState += " " + Language.StringByID(StringId.HighWindSpeed);
                                        break;
                                    case "medium":
                                        ac.lastState += " " + Language.StringByID(StringId.MiddleWindSpeed);
                                        function.lastState += " " + Language.StringByID(StringId.MiddleWindSpeed);
                                        break;
                                    case "low":
                                        ac.lastState += " " + Language.StringByID(StringId.LowWindSpeed);
                                        function.lastState += " " + Language.StringByID(StringId.LowWindSpeed);
                                        break;
                                    case "auto":
                                        ac.lastState += " " + Language.StringByID(StringId.Auto);
                                        function.lastState += " " + Language.StringByID(StringId.Auto);
                                        break;
                                }
                                ac.lastState += " " + ac.trait_temp.curValue + ac.tempUnitString;
                                RoomPage.UpdataStates(ac);
                                FunctionPage.UpdataStates(ac);
                                HomePage.UpdataFunctionStates(ac);
                                ClassificationPage.UpdataInfo(ac);
                                ACPage.UpdataStates(ac);
                                function.lastState += " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function);
                                RoomPage.UpdataStates(function);
                                FunctionPage.UpdataStates(function);
                                HomePage.UpdataFunctionStates(function);
                                ClassificationPage.UpdataInfo(function);
                                ACPage.UpdataStates(function);
                            }
                        }
                        break;
                    case Command.ReadFloorHeatACK:
                    case Command.SetFloorHeatACK:
                        foreach (var fh in FunctionList.List.floorHeatings)
                        foreach (var function in FunctionList.List.GetFloorHeatingList())
                        {
                            if (fh.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            {
                                fh.curTempType = receiveBytes[2];
                                fh.trait_on_off.curValue = receiveBytes[1] % 2 == 0 ? "off" : "on";
                                fh.curModeIndex = receiveBytes[3];
                                if (fh.modeTemp.ContainsKey("normal"))
                                function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[2]);
                                function.trait_on_off.curValue = receiveBytes[1] % 2 == 0 ? "off" : "on";
                                new FloorHeating().SetModeIndex(receiveBytes[3],function);
                                if (function.Fh_Mode_Temp.ContainsKey("normal"))
                                {
                                    fh.modeTemp["normal"] = receiveBytes[4];
                                    function.Fh_Mode_Temp["normal"] = receiveBytes[4];
                                }
                                else
                                {
                                    fh.modeTemp.Add("normal", receiveBytes[4]);
                                    function.Fh_Mode_Temp.Add("normal", receiveBytes[4]);
                                }
                                if (fh.modeTemp.ContainsKey("day"))
                                if (function.Fh_Mode_Temp.ContainsKey("day"))
                                {
                                    fh.modeTemp["day"] = receiveBytes[5];
                                    function.Fh_Mode_Temp["day"] = receiveBytes[5];
                                }
                                else
                                {
                                    fh.modeTemp.Add("day", receiveBytes[5]);
                                    function.Fh_Mode_Temp.Add("day", receiveBytes[5]);
                                }
                                if (fh.modeTemp.ContainsKey("night"))
                                if (function.Fh_Mode_Temp.ContainsKey("night"))
                                {
                                    fh.modeTemp["night"] = receiveBytes[6];
                                    function.Fh_Mode_Temp["night"] = receiveBytes[6];
                                }
                                else
                                {
                                    fh.modeTemp.Add("night", receiveBytes[6]);
                                    function.Fh_Mode_Temp.Add("night", receiveBytes[6]);
                                }
                                if (fh.modeTemp.ContainsKey("away"))
                                if (function.Fh_Mode_Temp.ContainsKey("away"))
                                {
                                    fh.modeTemp["away"] = receiveBytes[7];
                                    function.Fh_Mode_Temp["away"] = receiveBytes[7];
                                }
                                else
                                {
                                    fh.modeTemp.Add("away", receiveBytes[7]);
                                    function.Fh_Mode_Temp.Add("away", receiveBytes[7]);
                                }
                                switch (fh.trait_mode.curValue)
                                switch (function.GetAttrState(FunctionAttributeKey.Mode))
                                {
                                    case "normal":
                                        fh.lastState = Language.StringByID(StringId.Normal);
                                        fh.trait_temp.curValue = receiveBytes[4].ToString();
                                        function.lastState = Language.StringByID(StringId.Normal);
                                        function.SetAttrState(FunctionAttributeKey.SetTemp,receiveBytes[4].ToString());
                                        break;
                                    case "day":
                                        fh.lastState = Language.StringByID(StringId.Day);
                                        fh.trait_temp.curValue = receiveBytes[5].ToString();
                                        function.lastState = Language.StringByID(StringId.Day);
                                        function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[5].ToString());
                                        break;
                                    case "night":
                                        fh.lastState = Language.StringByID(StringId.Night);
                                        fh.trait_temp.curValue = receiveBytes[6].ToString();
                                        function.lastState = Language.StringByID(StringId.Night);
                                        function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[6].ToString());
                                        break;
                                    case "timer":
                                        fh.lastState = Language.StringByID(StringId.Auto);
                                        function.lastState = Language.StringByID(StringId.Auto);
                                        if (receiveBytes[8] == 0)
                                        {
                                            fh.timeFlag = 0;
                                            fh.trait_temp.curValue = receiveBytes[5].ToString();
                                            function.SetAttrState(FunctionAttributeKey.TimeFlag, 0);
                                            function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[5].ToString());
                                        }
                                        else
                                        {
                                            fh.timeFlag = 1;
                                            fh.trait_temp.curValue = receiveBytes[6].ToString();
                                            function.SetAttrState(FunctionAttributeKey.TimeFlag, 1);
                                            function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[6].ToString());
                                        }
                                        break;
                                    case "away":
                                        fh.trait_temp.curValue = receiveBytes[7].ToString();
                                        fh.lastState = Language.StringByID(StringId.Away);
                                        function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[7].ToString());
                                        function.lastState = Language.StringByID(StringId.Away);
                                        break;
                                }
                                var indoorTemp = 0;
                                if (receiveBytes[9] > 128)
                                {
                                    indoorTemp = 1 - (receiveBytes[9] - 128);
                                }else
                                {
                                    indoorTemp = receiveBytes[9];
                                }
                                function.SetAttrState(FunctionAttributeKey.IndoorTemp, indoorTemp);
                                fh.trait_IndoorTemp.curValue = receiveBytes[9] > 128 ? (1 - (receiveBytes[9] - 128)) : receiveBytes[9];
                                fh.lastState += " " + fh.trait_temp.curValue + fh.tempUnitString;
                                RoomPage.UpdataStates(fh);
                                FunctionPage.UpdataStates(fh);
                                HomePage.UpdataFunctionStates(fh);
                                ClassificationPage.UpdataInfo(fh);
                                FloorHeatingPage.UpdataStates(fh);
                                function.lastState += " " + function.GetAttrState(FunctionAttributeKey.Mode) + new FloorHeating().GetTempUnitString(function);
                                RoomPage.UpdataStates(function);
                                FunctionPage.UpdataStates(function);
                                HomePage.UpdataFunctionStates(function);
                                ClassificationPage.UpdataInfo(function);
                                FloorHeatingPage.UpdataStates(function);
                            }
                        }
                        break;
                    case Command.ReadDeviceLoopInfoACK:
                        //FunctionType dt = (FunctionType)(11 * 256 + receiveBytes[1]);
                        string tag = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2];
                        foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience)
                        foreach (var sensor in FunctionList.List.GetEnvirSensorsList())
                        {
                            byte sensorType = 0;
                            switch (sensor.spk)
@@ -482,19 +489,19 @@
                                    {
                                        case SPK.SensorTemperature:
                                            byte[] tempBytes = new byte[] { receiveBytes[24], receiveBytes[25], receiveBytes[26], receiveBytes[27] };
                                            sensor.values = Math.Round(BitConverter.ToSingle(tempBytes, 0), 1);
                                            sensor.SetAttrState(FunctionAttributeKey.Value,Math.Round(BitConverter.ToSingle(tempBytes, 0), 1).ToString());
                                            break;
                                        case SPK.SensorHumidity:
                                            sensor.values = Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 10;
                                            sensor.SetAttrState(FunctionAttributeKey.Value, (Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 10).ToString());
                                            break;
                                        case SPK.SensorTVOC:
                                            sensor.values = Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 100;
                                            sensor.SetAttrState(FunctionAttributeKey.Value, (Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 100).ToString());
                                            break;
                                        case SPK.SensorPm25:
                                            sensor.values = Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]);
                                            sensor.SetAttrState(FunctionAttributeKey.Value,Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]).ToString());
                                            break;
                                        case SPK.SensorCO2:
                                            sensor.values = Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]);
                                            sensor.SetAttrState(FunctionAttributeKey.Value, Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]).ToString());
                                            break;
                                    }
                                    EnvironmentalSciencePage.LoadEvent_UpdataStatus(sensor);
@@ -504,7 +511,7 @@
                        break;
                    case Command.New_Analog_Quantity_BROADCAST:
                        string tag1 = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2];
                        foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience)
                        foreach (var sensor in FunctionList.List.GetEnvirSensorsList())
                        {
                            byte sensorType = 0;
                            switch (sensor.spk)
@@ -534,21 +541,24 @@
                                    switch (receiveBytes[3])
                                    {
                                        case 1:
                                            sensor.values = (receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8];
                                            sensor.SetAttrState(FunctionAttributeKey.Value,( (receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8]).ToString());
                                            break;
                                        case 2:
                                            sensor.values = -1 * ((receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8]);
                                            sensor.SetAttrState(FunctionAttributeKey.Value,( -1 * ((receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8])).ToString());
                                            break;
                                        case 3:
                                            byte[] tempBytes = new byte[] { receiveBytes[5], receiveBytes[6], receiveBytes[7], receiveBytes[8] };
                                            sensor.values = Math.Round(BitConverter.ToSingle(tempBytes, 0), 1);
                                            sensor.SetAttrState(FunctionAttributeKey.Value,( Math.Round(BitConverter.ToSingle(tempBytes, 0), 1)).ToString());
                                            break;
                                    }
                                    switch (receiveBytes[4])
                                    {
                                        case 2:
                                            if (receiveBytes[1] == 5)//TVOC需求除以100000
                                                sensor.values /= 100000;
                                            {
                                                var value = Convert.ToInt32(sensor.GetAttrState(FunctionAttributeKey.Value));
                                                sensor.SetAttrState(FunctionAttributeKey.Value, (value /= 100000).ToString());
                                            }
                                            break;
                                    }
                                    EnvironmentalSciencePage.LoadEvent_UpdataStatus(sensor);
@@ -571,46 +581,47 @@
                        {
                            break;
                        }
                        foreach (var ac in FunctionList.List.aCs)
                        foreach (var function in FunctionList.List.GetAcList())
                        {
                            if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + reACPanel)
                            var acFunction = new AC();
                            if (function.GetBusId() == subnetID + "_" + deviceID + "_" + reACPanel)
                            {
                                switch (receiveBytes[0])
                                {
                                    case 3://
                                        ac.trait_on_off.curValue = receiveBytes[1] == 1 ? "on" : "off";
                                        function.trait_on_off.curValue = receiveBytes[1] == 1 ? "on" : "off";
                                        break;
                                    case 4:
                                    case 7:
                                    case 8:
                                    case 19:
                                        ac.trait_temp.curValue = receiveBytes[1].ToString();
                                        function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[1].ToString());
                                        break;
                                    case 5:
                                        ac.curFanIndex = receiveBytes[1];
                                        acFunction.SetFan ( receiveBytes[1],function);
                                        break;
                                    case 6:
                                        ac.curModeIndex = receiveBytes[1];
                                        acFunction.SetMode ( receiveBytes[1],function);
                                        break;
                                }
                                ac.lastState = "";
                                ac.lastState += " " + ac.trait_temp.curValue + ac.tempUnitString;
                                RoomPage.UpdataStates(ac);
                                FunctionPage.UpdataStates(ac);
                                HomePage.UpdataFunctionStates(ac);
                                ClassificationPage.UpdataInfo(ac);
                                ACPage.UpdataStates(ac);
                                function.lastState = "";
                                function.lastState += " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function);
                                RoomPage.UpdataStates(function);
                                FunctionPage.UpdataStates(function);
                                HomePage.UpdataFunctionStates(function);
                                ClassificationPage.UpdataInfo(function);
                                ACPage.UpdataStates(function);
                            }
                        }
                        break;
                    case Command.ReadPanleTempACK://1944
                    case Command.PanleBroadcastTemp:
                        foreach (var ac in FunctionList.List.aCs)
                        foreach (var ac in FunctionList.List.GetAcList())
                        {
                            if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            {
                                ac.trait_IndoorTemp.curValue = receiveBytes[1].ToString();
                                ac.SetAttrState(FunctionAttributeKey.IndoorTemp, receiveBytes[1].ToString());
                                FunctionPage.UpdataStates(ac);
                            }
                        }
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -300,7 +300,7 @@
                                {
                                    var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey);
                                    var revString = Encoding.UTF8.GetString(bytes);
                                    Control.Ins.UpdataFunctionStatus(revString, null);
                                    Control.Ins.UpdataFunctionStatus(revString, null,true);
                                }
                                //一端口数据解析
                                else
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -37,34 +37,48 @@
        {
        }
        #region kaede ___________传感器历史数据__________________
        /// <summary>
        /// èŽ·å–ä¼ æ„Ÿå™¨åŽ†å²æ•°æ®
        /// </summary>
        /// <param name="subnetId"></param>
        /// <param name="deviceId"></param>
        /// <param name="bigClass"></param>
        /// <param name="minClass"></param>
        /// <param name="queryType"></param>
        /// <param name="loopId"></param>
        /// <param name="nowMonth"></param>
        /// <param name="mac"></param>
        /// <param name="qType">时间查询类型:hour=近24小时、week=近一周、month = è¿‘一月 </param>
        /// <param name="deviceId">设备ID</param>
        /// <param name="deviceKey">功能查询类型:pm25</param>
        /// <returns></returns>
        public ResponsePack GetSensorHistory(int subnetId, int deviceId, int bigClass, int minClass, int queryType, int loopId, int nowMonth, string mac)
        public ResponsePackNew GetSensorHistory(string qType, string deviceId,string deviceKey)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("SubnetID", subnetId);
            d.Add("DeviceID", deviceId);
            d.Add("LargeType", bigClass);
            d.Add("SmallType", minClass);
            d.Add("QueryType", queryType);
            d.Add("loopId", loopId);
            d.Add("NowMonth", nowMonth);
            d.Add("MAC", DB_ResidenceData.Instance.residenceGatewayMAC);
            d.Add("LocalTimeZone", 8);
            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            return RequestHttps("https://developer.hdlcontrol.com/api/GetSensorPushHistory", jsonString, true);
            d.Add("type", qType);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", new List<string>() { deviceId });
            d.Add("key", new List<string>() { deviceKey });
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
        }
        /// <summary>
        /// èŽ·å–å®‰é˜²ä¼ æ„Ÿå™¨åŽ†å²æ•°æ®
        /// </summary>
        /// <param name="deviceId">设备ID</param>
        /// <param name="pageSize">页面大小</param>
        /// <param name="pageNo">页号</param>
        /// <returns></returns>
        public ResponsePackNew GetArmSensorHistory( string deviceId,string pageSize, string pageNo)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", deviceId);
            d.Add("pageSize", pageSize);
            d.Add("pageNo", pageNo);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
        }
        #endregion
        //public string GetRequestResultMsg(string resultCode)
        //{
@@ -2146,5 +2160,18 @@
        #endregion
        #region è¤çŸ³äº‘SDK相关接口
        /// <summary>
        /// æ²³ä¸œèŽ·å–è¤çŸ³äº‘å­è´¦å·token的接口
        /// </summary>
        public ResponsePackNew EZGetChildToken()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            //d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson);
        }
        #endregion
    }
}
HDL_ON/DAL/Server/NewAPI.cs
@@ -4,7 +4,7 @@
{
    public class NewAPI
    {
        #region æ–°å¾®æœåŠ¡æŽ¥å£
        //#region æ–°å¾®æœåŠ¡æŽ¥å£
        //***********************************************
        //注意:和住宅相关的接口要请求住宅所在区域的域名   regionUrl    
        //***********************************************
@@ -357,6 +357,14 @@
        /// å–消收藏设备
        /// </summary>
        public const string Api_Post_CancelCollectDevice = "/home-wisdom/app/device/cancelCollect";
        /// <summary>
        /// èŽ·å–çŽ¯å¢ƒä¼ æ„Ÿå™¨åŽ†å²æ•°æ® å°æ—¶/周/月统计数据
        /// </summary>
        public const string Api_Post_EnvironmentalSensorHistoricalData = "/home-wisdom/app/statistics/device/hourWeekMonth";
        /// <summary>
        /// èŽ·å–å®‰é˜²ä¼ æ„Ÿå™¨åŽ†å²æ•°æ®
        /// </summary>
        public const string Api_Post_ArmSensorHistoricalData = "/home-wisdom/app/device/message";
        #endregion
        #region Kaede -- åœºæ™¯æŽ¥å£____________________________
@@ -494,6 +502,17 @@
        /// é¥æŽ§å™¨è‡ªå­¦æŒ‰é”®åˆ é™¤
        /// </summary>
        public const string API_POST_Ir_CodeRemove = "/home-wisdom/app/device/ir/codeRemove";
        #endregion
        #endregion
        #region â–   -- è¤çŸ³SDK相关接口___________________________
        /// <summary>
        /// æ²³ä¸œèŽ·å–è¤çŸ³äº‘å­è´¦å·token的接口
        /// </summary>
        public const string API_POST_EZ_GetChildToken = "/home-wisdom/platform/childToken";
        /// <summary>
        /// çº¢å¤–宝/遥控器删除
        /// </summary>
HDL_ON/DAL/Server/NewApiRes.cs
@@ -1466,6 +1466,23 @@
        public string messageType;
    }
    /// <summary>
    /// è¤çŸ³äº‘子账号token
    /// </summary>
    [System.Serializable]
    public class EZChildAccessToken
    {
        /// <summary>
        /// token
        /// </summary>
        public string accessToken;
        /// <summary>
        ///  è¿‡æœŸæ—¶é—´
        /// </summary>
        public string expireTime;
    }
    //#region æ—§æŽ¥å£
    ///// <summary>
    ///// 
HDL_ON/Entity/Function/AC.cs
@@ -1,45 +1,58 @@
using System;
using System.Collections.Generic;
using Shared;
namespace HDL_ON.Entity
{
    public class AC : Function
    public class AC
    {
        /*
         * ç©ºè°ƒï¼štrait: [switch, mode, fan, set_temp, swing, lock]
         * å±žæ€§    æè¿°
         * on_off    on/off
         * mode    mode: auto, cool, heat, dry, fan
         * fan    high, medium, low, auto
         * set_temp    up,down,value
         * swing    up/down/left/right
         * lock    boolean (Lock锁定控制)
         */
        public AC()
        {
        }
        /// <summary>
        /// å½“前温度模式
        /// 0:摄氏度
        /// 1:华氏度
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int curTempType = 0;
        /// <summary>
        /// å½“前温度模式字符
        /// </summary>
        public string tempUnitString
        public string GetTempUnitString(Function function)
        {
            get
            var tt = function.GetAttrState(FunctionAttributeKey.TempType);
            if (tt == "0")
            {
                if (curTempType == 0)
                {
                    return "°C";
                }
                else
                {
                    return "°F";
                }
                return "°C";
            }
            else
            {
                return tt;
            }
        }
        /// <summary>
        /// èŽ·å–æ¸©åº¦å•ä½bus标识
        /// </summary>
        /// <param name="function"></param>
        /// <returns></returns>
        public int GetTempUintIndex(Function function)
        {
            var tt = function.GetAttrState(FunctionAttributeKey.TempType);
            if(tt == "°F")
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
        /// <summary>
        /// æ ¹æ®bus标识设置温度单位
        /// </summary>
        /// <param name="function"></param>
        /// <returns></returns>
        public void SetTempUint(Function function,int index)
        {
            if (index == 0)
            {
                function.SetAttrState(FunctionAttributeKey.TempType, "°C");
            }
            else
            {
                function.SetAttrState(FunctionAttributeKey.TempType, "°F");
            }
        }
@@ -47,379 +60,274 @@
        /// å½“前模式索引
        /// bus控制命令使用
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public byte curModeIndex
        public byte GetModeIndex(Function function)
        {
            get
            var value = function.GetAttrState(FunctionAttributeKey.Mode);
            byte index = 0;
            switch (value)
            {
                try
                {
                    byte index = 0;
                    switch (trait_mode.curValue.ToString())
                    {
                        case "auto":
                            index = 3;
                            break;
                        case "cool":
                            index = 0;
                            break;
                        case "heat":
                            index = 1;
                            break;
                        case "dry":
                            index = 4;
                            break;
                        case "fan":
                            index = 2;
                            break;
                        default:
                            index = 0;
                            break;
                    }
                    return index;
                }
                catch (Exception ex)
                {
                    MainPage.Log($"get curModeIndex error : {ex.Message}");
                    return 0;
                }
                case "auto":
                    index = 3;
                    break;
                case "cool":
                    index = 0;
                    break;
                case "heat":
                    index = 1;
                    break;
                case "dry":
                    index = 4;
                    break;
                case "fan":
                    index = 2;
                    break;
                default:
                    index = 0;
                    break;
            }
            set
            {
                switch (value)
                {
                    case 0:
                        trait_mode.curValue = "cool";
                        break;
                    case 1:
                        trait_mode.curValue = "heat";
                        break;
                    case 2:
                        trait_mode.curValue = "fan";
                        break;
                    case 3:
                        trait_mode.curValue = "auto";
                        break;
                    case 4:
                        trait_mode.curValue = "dry";
                        break;
                    default:
                        trait_mode.curValue = "cool";
                        break;
                }
            }
            return index;
        }
        /// <summary>
        /// è®¾ç½®bus协议标记设置a协议数据
        /// </summary>
        public void SetMode(int index , Function function)
        {
            string value = "auto";
            switch (index)
            {
                case 3:
                    value = "auto";
                    break;
                case 0:
                    value = "cool";
                    break;
                case 1:
                    value = "heat";
                    break;
                case 4:
                    value = "dry";
                    break;
                case 2:
                    value = "fan";
                    break;
            }
            function.SetAttrState(FunctionAttributeKey.Mode, value);
        }
        /// <summary>
        /// å½“前风速索引
        /// bus控制命令使用
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public byte curFanIndex
        public byte GetFanIndex(Function function)
        {
            get
            var value = function.GetAttrState(FunctionAttributeKey.FanSpeed);
            byte index = 0;
            switch (value)
            {
                try
                {
                    byte index = 0;
                    switch (trait_fan.curValue.ToString())
                    {
                        case "high":
                            index = 1;
                            break;
                        case "medium":
                            index = 2;
                            break;
                        case "low":
                            index = 3;
                            break;
                        case "auto":
                            index = 0;
                            break;
                        default:
                            index = 0;
                            break;
                    }
                    return index;
                }
                catch (Exception ex)
                {
                    MainPage.Log($"get curFanIndex error : {ex.Message}");
                    return 0;
                }
                case "high":
                    index = 1;
                    break;
                case "medium":
                    index = 2;
                    break;
                case "low":
                    index = 3;
                    break;
                case "auto":
                    index = 0;
                    break;
                default:
                    index = 0;
                    break;
            }
            set
            {
                switch (value)
                {
                    case 0:
                        trait_fan.curValue = "auto";
                        break;
                    case 1:
                        trait_fan.curValue = "high";
                        break;
                    case 2:
                        trait_fan.curValue = "medium";
                        break;
                    case 3:
                        trait_fan.curValue = "low";
                        break;
                    default:
                        trait_fan.curValue = "high";
                        break;
                }
            }
            return index;
        }
        FunctionAttributes _trait_mode;
        /// <summary>
        /// æ¨¡å¼å±žæ€§
        /// æ ¹æ®bus协议风速标记设置a协议标记
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_mode
        public void SetFan(int index,Function function)
        {
            get
            string value = "high";
            switch (index)
            {
                if (_trait_mode == null)
                {
                    _trait_mode = attributes.Find((obj) => obj.key == "mode");
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_mode == null)
                    {
                        _trait_mode = new FunctionAttributes()
                        {
                            key = "mode",
                            value = new List<string> { "auto", "cool", "heat", "dry", "fan" },
                            max = 4,
                            min = 0,
                        };
                    }
                }
                if (_trait_mode.curValue.ToString() == "{}")
                    _trait_mode.curValue = "cool";
                return _trait_mode;
                case 1:
                    value = "high";
                    break;
                case 2:
                    value = "medium";
                    break;
                case 3:
                    value = "low";
                    break;
                case 0:
                    value = "auto";
                    break;
            }
        }
        FunctionAttributes _trait_fan;
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_fan
        {
            get
            {
                if (_trait_fan == null)
                {
                    _trait_fan = attributes.Find((obj) => obj.key == "fan");
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_fan == null)
                    {
                        _trait_fan = new FunctionAttributes()
                        {
                            key = "fan",
                            value = new List<string> { "high", "medium", "low", "auto" },
                            max = 3,
                            min = 0,
                            curValue = "high"
                        };
                    }
                }
                if (_trait_fan.curValue.ToString() == "{}")
                    _trait_fan.curValue = "high";
                return _trait_fan;
            }
        }
        FunctionAttributes _trait_temp;
        /// <summary>
        /// å½“前空调温度
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_temp
        {
            get
            {
                if (_trait_temp == null)
                {
                    _trait_temp = attributes.Find((obj) => obj.key == "set_temp");
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_temp == null)
                    {
                        _trait_temp = new FunctionAttributes()
                        {
                            key = "set_temp",
                            value = new List<string> { },
                            max = 32,
                            min = 16,
                        };
                    }
                }
                if (_trait_temp.curValue.ToString() == "{}")
                {
                    _trait_temp.curValue = 16;
                }
                double vv = 16;
                Double.TryParse(_trait_temp.curValue.ToString(), out vv);
                _trait_temp.curValue = Convert.ToInt32(vv);
                return _trait_temp;
            }
        }
        FunctionAttributes _trait_swting;
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_swting
        {
            get
            {
                if (_trait_swting == null)
                {
                    _trait_swting = attributes.Find((obj) => obj.key == "swting");
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_swting == null)
                    {
                        _trait_swting = new FunctionAttributes()
                        {
                            key = "swting",
                            value = new List<string> { "up", "down", "left", "right" },
                            max = 3,
                            min = 0,
                        };
                    }
                }
                if (_trait_swting.curValue.ToString() == "{}")
                    _trait_swting.curValue = "up";
                return _trait_swting;
            }
        }
        /// <summary>
        /// ç©ºè°ƒæ‰«é£Žæ¨¡å¼åˆ—表
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<string> swting
        {
            get
            {
                try
                {
                    return trait_swting.value;
                }
                catch (Exception ex)
                {
                    MainPage.Log($"ac get swting error : {ex.Message}");
                    return new List<string> { "up", "down", "left", "right" };
                }
            }
        }
        FunctionAttributes _trait_IndoorTemp;
        /// <summary>
        /// å®¤å†…温度
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_IndoorTemp
        {
            get
            {
                if (_trait_IndoorTemp == null)
                {
                    _trait_IndoorTemp = attributes.Find((obj) => obj.key == FunctionAttributeKey.IndoorTemp);
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_IndoorTemp == null)
                    {
                        _trait_IndoorTemp = new FunctionAttributes()
                        {
                            key = FunctionAttributeKey.IndoorTemp,
                            value = new List<string> { },
                            max = 30,
                            min = 0,
                        };
                    }
                }
                if (_trait_IndoorTemp.curValue.ToString() == "{}")
                {
                    _trait_IndoorTemp.curValue = 0;
                }
                var vv = Convert.ToDouble(_trait_IndoorTemp.curValue);
                _trait_IndoorTemp.curValue = Convert.ToInt32(vv);
                return _trait_IndoorTemp;
            }
            function.SetAttrState(FunctionAttributeKey.FanSpeed, value);
        }
        /// <summary>
        /// å½“前模式的icon路径
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public string curModeImage
        /// <param name="lightingIcon">获取的图标类型,默认是点亮</param>
        /// <returns></returns>
        public string GetModeIconPath(string modeValue , bool lightingIcon = true)
        {
            get
            var imagePath = "FunctionIcon/AC/CoolIcon.png";
            if (lightingIcon)
            {
                try
                switch (modeValue)
                {
                    var imagePath = "FunctionIcon/AC/CoolIcon.png";
                    switch (trait_mode.curValue.ToString())
                    {
                        case "auto":
                            imagePath = "FunctionIcon/AC/AutoIcon.png";
                            break;
                        case "cool":
                            imagePath = "FunctionIcon/AC/CoolIcon.png";
                            break;
                        case "heat":
                            imagePath = "FunctionIcon/AC/HeatingIcon.png";
                            break;
                        case "dry":
                            imagePath = "FunctionIcon/AC/DehumidificationIcon.png";
                            break;
                        case "fan":
                            imagePath = "FunctionIcon/AC/AirSupplyIcon.png";
                            break;
                        default:
                            imagePath = "FunctionIcon/AC/CoolIcon.png";
                            break;
                    }
                    return imagePath;
                }
                catch (Exception ex)
                {
                    MainPage.Log($"ac ge curModeImage error : {ex.Message}");
                    return "FunctionIcon/AC/CoolIcon.png";
                    case "auto":
                        imagePath = "FunctionIcon/AC/AutoIcon.png";
                        break;
                    case "cool":
                        imagePath = "FunctionIcon/AC/CoolIcon.png";
                        break;
                    case "heat":
                        imagePath = "FunctionIcon/AC/HeatingIcon.png";
                        break;
                    case "dry":
                        imagePath = "FunctionIcon/AC/DehumidificationIcon.png";
                        break;
                    case "fan":
                        imagePath = "FunctionIcon/AC/AirSupplyIcon.png";
                        break;
                    default:
                        imagePath = "FunctionIcon/AC/CoolIcon.png";
                        break;
                }
            }
            else
            {
                imagePath = "FunctionIcon/AC/AutoIconGray.png";
                switch (modeValue)
                {
                    case "auto":
                        imagePath = "FunctionIcon/AC/AutoIconGray.png";
                        break;
                    case "cool":
                        imagePath = "FunctionIcon/AC/CoolIconGray.png";
                        break;
                    case "heat":
                        imagePath = "FunctionIcon/AC/HeatingIconGray.png";
                        break;
                    case "dry":
                        imagePath = "FunctionIcon/AC/DehumidificationIconGray.png";
                        break;
                    case "fan":
                        imagePath = "FunctionIcon/AC/AirSupplyIconGray.png";
                        break;
                }
            }
            return imagePath;
        }
        /// <summary>
        /// å½“前风速的icon路径
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public string curFanImage
        /// <param name="lightingIcon">获取的图标类型,默认是点亮</param>
        /// <returns></returns>
        public string GetFanIconPath(string modeValue, bool lightingIcon = true)
        {
            get
            var imagePath = "FunctionIcon/AC/WindHighIcon.png";
            if (lightingIcon)
            {
                try
                switch (modeValue)
                {
                    var imagePath = "FunctionIcon/AC/WindHighIcon.png";
                    switch (trait_fan.curValue.ToString())
                    {
                        case "high":
                            imagePath = "FunctionIcon/AC/WindHighIcon.png";
                            break;
                        case "medium":
                            imagePath = "FunctionIcon/AC/WindMediumIcon.png";
                            break;
                        case "low":
                            imagePath = "FunctionIcon/AC/WindLowIcon.png";
                            break;
                        case "auto":
                            imagePath = "FunctionIcon/AC/AutoIcon.png";
                            break;
                        default:
                            imagePath = "FunctionIcon/AC/WindHighIcon.png";
                            break;
                    }
                    return imagePath;
                }catch (Exception ex)
                {
                    MainPage.Log($"ac get curFanImage error : {ex.Message}");
                    return "FunctionIcon/AC/WindHighIcon.png";
                    case "high":
                        imagePath = "FunctionIcon/AC/WindHighIcon.png";
                        break;
                    case "medium":
                        imagePath = "FunctionIcon/AC/WindMediumIcon.png";
                        break;
                    case "low":
                        imagePath = "FunctionIcon/AC/WindLowIcon.png";
                        break;
                    case "auto":
                        imagePath = "FunctionIcon/AC/AutoIcon.png";
                        break;
                }
            }
            else
            {
                switch (modeValue)
                {
                    case "high":
                        imagePath = "FunctionIcon/AC/WindHighIconGray.png";
                        break;
                    case "medium":
                        imagePath = "FunctionIcon/AC/WindMediumIconGray.png";
                        break;
                    case "low":
                        imagePath = "FunctionIcon/AC/WindLowIconGray.png";
                        break;
                    case "auto":
                        imagePath = "FunctionIcon/AC/AutoIconGray.png";
                        break;
                }
            }
            return imagePath;
        }
        /// <summary>
        /// èŽ·å–æ¨¡å¼å±žæ€§æ–‡æœ¬
        /// </summary>
        /// <returns></returns>
        public string GetModeAttrText(string value)
        {
            string text = "";
            switch (value)
            {
                #region æ¨¡å¼
                case "auto":
                    text = Language.StringByID(StringId.Auto);
                    break;
                case "cool":
                    text = Language.StringByID(StringId.Cool);
                    break;
                case "heat":
                    text = Language.StringByID(StringId.Heat);
                    break;
                case "dry":
                    text = Language.StringByID(StringId.Dry);
                    break;
                case "fan":
                    text = Language.StringByID(StringId.AirSupply);
                    break;
                    #endregion
            }
            return text;
        }
        /// <summary>
        /// èŽ·å–é£Žé€Ÿå±žæ€§æ–‡æœ¬
        /// </summary>
        /// <returns></returns>
        public string GetFanAttrText(string value)
        {
            string text = "";
            switch (value)
            {
                #region é£Žé€Ÿ
                case "high":
                    text = Language.StringByID(StringId.HighWindSpeed);
                    break;
                case "medium":
                    text = Language.StringByID(StringId.MiddleWindSpeed);
                    break;
                case "low":
                    text = Language.StringByID(StringId.LowWindSpeed);
                    break;
                case "auto":
                    text = Language.StringByID(StringId.Auto);
                    break;
                    #endregion
            }
            return text;
        }
    }
HDL_ON/Entity/Function/AirCleaner.cs
@@ -1,7 +1,7 @@
using System;
namespace HDL_ON.Entity
{
    public class AirCleaner : Function
    public class AirCleaner
    {
        public AirCleaner()
        {
HDL_ON/Entity/Function/Curtain.cs
@@ -4,73 +4,12 @@
namespace HDL_ON.Entity
{
    public class Curtain : Function
    public class Curtain
    {
        /*
        çª—帘属性列表:trait: [switch,percent,lock]
        å±žæ€§    æè¿°
        on_off    on/off/stop;
        percent    0-100;
        lock    boolean (Lock锁定控制)
        */
        public Curtain()
        public int GetPercent(Function function)
        {
        }//percent
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_percent;
        /// <summary>
        /// å¼€å…³ç™¾åˆ†æ¯”
        /// 0-100
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int percent
        {
            get
            {
                try
                {
                    if(trait_percent==null)
                    {
                        trait_percent = attributes.Find((obj) => obj.key == "percent");
                        if (trait_percent == null)
                        {
                            trait_percent = new FunctionAttributes()
                            {
                                key = "percent",
                                value = new List<string> { "up", "down" },
                                max = 100,
                                min = 0,
                                curValue = 0
                            };
                        }
                        if (trait_percent.curValue.ToString() == "{}")
                            trait_percent.curValue = 0;
                    }
                    string textValue = trait_percent.curValue.ToString();
                    if (textValue == string.Empty)
                    {
                        trait_percent.curValue = 0;
                    }
                    return Convert.ToInt32( trait_percent.curValue);
                }
                catch
                {
                    MainPage.Log("percent æ•°æ®èŽ·å–å¤±è´¥.");
                    return 0;
                }
            }
            set
            {
                try
                {
                    trait_percent.curValue = value;
                }
                catch
                {
                    MainPage.Log("percent æ•°æ®åˆ·æ–°å¤±è´¥.");
                }
            }
            return Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Percent));
        }
    }
}
HDL_ON/Entity/Function/DeviceFunction.cs
File was deleted
HDL_ON/Entity/Function/Fan.cs
@@ -3,66 +3,12 @@
namespace HDL_ON.Entity
{
    public class Fan : Function
    public class Fan
    {
        public Fan()
        {
        }
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_openLevel;
        /// <summary>
        /// æ¡£ä½
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int openLevel
        {
            get
            {
                try
                {
                    if (trait_openLevel == null)
                    {
                        trait_openLevel = attributes.Find((obj) => obj.key == "openLevel");
                        if (trait_openLevel == null)
                        {
                            trait_openLevel = new FunctionAttributes()
                            {
                                key = "openLevel",
                                value = new List<string> { "up", "down" },
                                max = 7,
                                min = 0,
                                curValue = 0
                            };
                        }
                        if (trait_openLevel.curValue.ToString() == "{}")
                            trait_openLevel.curValue = 0;
                    }
                    string textValue = trait_openLevel.curValue.ToString();
                    if (textValue == string.Empty)
                    {
                        trait_openLevel.curValue = 0;
                    }
                    return Convert.ToInt32(trait_openLevel.curValue);
                }
                catch
                {
                    MainPage.Log("openLevel æ•°æ®èŽ·å–å¤±è´¥.");
                    return 0;
                }
            }
            set
            {
                try
                {
                    trait_openLevel.curValue = value;
                }
                catch
                {
                    MainPage.Log("openLevel æ•°æ®åˆ·æ–°å¤±è´¥.");
                }
            }
        }
    }
}
HDL_ON/Entity/Function/FloorHeating.cs
@@ -3,155 +3,144 @@
namespace HDL_ON.Entity
{
    public class FloorHeating : Function
    public class FloorHeating
    {
        /*
        *地热:trait: [switch, mode, set_temp, lock]
        *属性 æè¿°
        *switch    on/off
        *mode    day, night,away, vacation, timer
        *set_temp value
        *lock    boolean(Lock锁定控制)
        *set_ point    up,down,value
        */
        public FloorHeating()
        /// <summary>
        /// èŽ·å–æ¸©åº¦å•ä½bus标识
        /// </summary>
        /// <param name="function"></param>
        /// <returns></returns>
        public int GetTempUintIndex(Function function)
        {
            var tt = function.GetAttrState(FunctionAttributeKey.TempType);
            if (tt == "°F")
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
        /// <summary>
        /// å½“前温度模式
        /// 0:摄氏度
        /// 1:华氏度
        /// æ ¹æ®bus标识设置温度单位
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int curTempType = 0;
        /// <param name="function"></param>
        /// <returns></returns>
        public void SetTempUint(Function function, int index)
        {
            if (index == 0)
            {
                function.SetAttrState(FunctionAttributeKey.TempType, "°C");
            }
            else
            {
                function.SetAttrState(FunctionAttributeKey.TempType, "°F");
            }
        }
        /// <summary>
        /// å·¥ä½œæ¨¡å¼
        /// èŽ·å–bus协议工作模式index
        /// 0:地热模式;1:地冷模式;
        /// 2:地热功率模式;3:地冷功率模式;
        /// </summary>
        public int workMode = 0;
        /// <summary>
        /// å½“前温度模式字符
        /// </summary>
        public string tempUnitString
        public int GetWorkModeIndex(Function function)
        {
            get
            {
                if (curTempType == 0)
                {
                    return "°C";
                }
                else
                {
                    return "°F";
                }
            }
        }
        FunctionAttributes _trait_mode;
        /// <summary>
        /// æ¨¡å¼å±žæ€§
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_mode
        {
            get
            {
                if (_trait_mode == null)
                {
                    _trait_mode = attributes.Find((obj) => obj.key == "mode");
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_mode == null)
                    {
                        _trait_mode = new FunctionAttributes()
                        {
                            key = "mode",
                            value = new List<string> { "day", "night", "away", "normal", "timer" },
                            max = 4,
                            min = 0,
                        };
                    }
                    if(_trait_mode.curValue.ToString() == "{}")
                    {
                        _trait_mode.curValue = "day";
                    }
                }
                return _trait_mode;
            }
            var attr = function.GetAttrState(FunctionAttributeKey.WorkMode);
            if (attr == "cool")
                return 1;
            return 0;
        }
        /// <summary>
        /// å·¥ä½œæ¨¡å¼å¯¹åº”的工作温度
        /// è®¾ç½®bus协议工作模式index
        /// 0:地热模式;1:地冷模式;
        /// 2:地热功率模式;3:地冷功率模式;
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public Dictionary<string, byte> modeTemp = new Dictionary<string, byte>();
        public void SetWorkModeIndex(Function function, int index)
        {
            if (index == 1)
                function.SetAttrState(FunctionAttributeKey.WorkMode, "cool");
            else
                function.SetAttrState(FunctionAttributeKey.WorkMode, "heat");
        }
        /// <summary>
        /// å½“前模式索引
        /// bus控制命令使用
        /// èŽ·å–æ¸©åº¦æ¨¡å¼å­—ç¬¦
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public byte curModeIndex
        public string GetTempUnitString(Function function)
        {
            get
            var tt = function.GetAttrState(FunctionAttributeKey.TempType);
            if (tt == "0")
            {
                try
                {
                    byte index = 0;
                    switch (trait_mode.curValue.ToString())
                    {
                        case "day":
                            index = 2;
                            break;
                        case "night":
                            index = 3;
                            break;
                        case "away":
                            index = 4;
                            break;
                        case "normal":
                            index = 1;
                            break;
                        case "timer":
                            index = 5;
                            break;
                        default:
                            index = 0;
                            break;
                    }
                    return index;
                }
                catch (Exception ex)
                {
                    MainPage.Log($"get curModeIndex error : {ex.Message}");
                    return 0;
                }
                return "°C";
            }
            set
            else
            {
                switch (value)
                {
                    case 5:
                        trait_mode.curValue = "timer";
                        break;
                    case 1:
                        trait_mode.curValue = "normal";
                        break;
                    case 2:
                        trait_mode.curValue = "day";
                        break;
                    case 3:
                        trait_mode.curValue = "night";
                        break;
                    case 4:
                        trait_mode.curValue = "away";
                        break;
                    default:
                        trait_mode.curValue = "cool";
                        break;
                return tt;
            }
        }
                }
        /// <summary>
        /// èŽ·å–bus协议模式索引
        /// </summary>
        public byte GetModeIndex(Function function)
        {
            byte index = 0;
            var mode = function.GetAttrState(FunctionAttributeKey.Mode);
            switch (mode)
            {
                case "day":
                    index = 2;
                    break;
                case "night":
                    index = 3;
                    break;
                case "away":
                    index = 4;
                    break;
                case "normal":
                    index = 1;
                    break;
                case "timer":
                    index = 5;
                    break;
                default:
                    index = 0;
                    break;
            }
            return index;
        }
        /// <summary>
        /// è®¾ç½®bus协议模式索引
        /// </summary>
        public void SetModeIndex(int value, Function function)
        {
            string mode = "timer";
            switch (value)
            {
                case 5:
                    mode = "timer";
                    break;
                case 1:
                    mode = "normal";
                    break;
                case 2:
                    mode = "day";
                    break;
                case 3:
                    mode = "night";
                    break;
                case 4:
                    mode = "away";
                    break;
                default:
                    mode = "cool";
                    break;
            }
            function.SetAttrState(FunctionAttributeKey.Mode, mode);
        }
        /// <summary>
@@ -160,120 +149,35 @@
        /// </summary>
        public byte timeFlag = 0;
        FunctionAttributes _trait_IndoorTemp;
        /// <summary>
        /// å®¤å†…温度
        /// èŽ·å–æ¨¡å¼çš„icon路径
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_IndoorTemp
        public string GetModeImage(Function function)
        {
            get
            var imagePath = "FunctionIcon/AC/HeatingIcon.png";
            var key = function.GetAttrState(FunctionAttributeKey.Mode);
            switch (key)
            {
                if (_trait_IndoorTemp == null)
                {
                    _trait_IndoorTemp = attributes.Find((obj) => obj.key == FunctionAttributeKey.IndoorTemp);
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_IndoorTemp == null)
                    {
                        _trait_IndoorTemp = new FunctionAttributes()
                        {
                            key = FunctionAttributeKey.IndoorTemp,
                            value = new List<string> { },
                            max = 30,
                            min = 0,
                        };
                    }
                }
                if (_trait_IndoorTemp.curValue.ToString() == "{}")
                {
                    _trait_IndoorTemp.curValue = "0";
                }
                    var vv = Convert.ToDouble(_trait_IndoorTemp.curValue);
                    _trait_IndoorTemp.curValue = Convert.ToInt32(vv).ToString();
                return _trait_IndoorTemp;
                case "day":
                    imagePath = "FunctionIcon/AC/HeatingIcon.png";
                    break;
                case "night":
                    imagePath = "FunctionIcon/FloorHeating/NightIcon.png";
                    break;
                case "away":
                    imagePath = "FunctionIcon/FloorHeating/AwayIcon.png";
                    break;
                case "timer":
                    imagePath = "FunctionIcon/AC/AutoIcon.png";
                    break;
                case "normal":
                    imagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png";
                    break;
                default:
                    imagePath = "FunctionIcon/AC/HeatingIcon.png";
                    break;
            }
            return imagePath;
        }
        FunctionAttributes _trait_temp;
        /// <summary>
        /// å½“前温度
        /// </summary>/// <summary>
        /// å½“前空调温度
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_temp
        {
            get
            {
                if (_trait_temp == null)
                {
                    _trait_temp = attributes.Find((obj) => obj.key == "set_temp");
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_temp == null)
                    {
                        _trait_temp = new FunctionAttributes()
                        {
                            key = "set_temp",
                            value = new List<string> { },
                            max = 30,
                            min = 5,
                        };
                    }
                    if(_trait_temp.curValue.ToString() == "{}")
                        _trait_temp.curValue = "16";
                }
                //if (_trait_temp.curValue.ToString().Length > 3)
                {
                    double vv = 0;
                    Double.TryParse(_trait_temp.curValue.ToString(),out vv);
                    _trait_temp.curValue = Convert.ToInt32(vv).ToString();
                }
                return _trait_temp;
            }
        }
        /// <summary>
        /// å½“前模式的icon路径
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public string curModeImage
        {
            get
            {
                try
                {
                    var imagePath = "FunctionIcon/AC/HeatingIcon.png";
                    switch (trait_mode.curValue)
                    {
                        case "day":
                            imagePath = "FunctionIcon/AC/HeatingIcon.png";
                            break;
                        case "night":
                            imagePath = "FunctionIcon/FloorHeating/NightIcon.png";
                            break;
                        case "away":
                            imagePath = "FunctionIcon/FloorHeating/AwayIcon.png";
                            break;
                        case "timer":
                            imagePath = "FunctionIcon/AC/AutoIcon.png";
                            break;
                        case "normal":
                            imagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png";
                            break;
                        default:
                            imagePath = "FunctionIcon/AC/HeatingIcon.png";
                            break;
                    }
                    return imagePath;
                }
                catch (Exception ex)
                {
                    MainPage.Log($"ac ge curModeImage error : {ex.Message}");
                    return "FunctionIcon/AC/CoolIcon.png";
                }
            }
        }
    }
}
HDL_ON/Entity/Function/Function.cs
@@ -79,7 +79,7 @@
            return attrs;
        }
        /// <summary>
        /// èŽ·å–åˆ¶å®šå±žæ€§
        /// èŽ·å–æŒ‡å®šå±žæ€§
        /// </summary>
        /// <returns></returns>
        public FunctionAttributes GetAttribute(string key)
@@ -89,18 +89,18 @@
        }
        /// <summary>
        /// èŽ·å–å±žæ€§çŠ¶æ€
        /// èŽ·å–å±žæ€§å½“å‰çŠ¶æ€
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string GetAttrState(string key)
        {
            var attrState = status.Find((s) => s.key == key.ToString());
            if(attrState == null)
            var attrState = attributes.Find((s) => s.key == key.ToString());
            if (attrState == null || string.IsNullOrEmpty(attrState.state))
            {
                return "";
                return "0";
            }
            return attrState.value;
            return attrState.state;
        }
        /// <summary>
        /// è®¾ç½®å±žæ€§çŠ¶æ€
@@ -108,46 +108,42 @@
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns>修改结果</returns>
        public bool SetAttrState(string key, string value)
        public bool SetAttrState(string key, object value)
        {
            var attrState = status.Find((s) => s.key == key.ToString());
            if (attrState == null)
            //var attrState = status.Find((s) => s.key == key.ToString());
            var attr = attributes.Find((s) => s.key == key);
            if (attr == null)
            {
                return false;
            }
            else
            {
                attrState.value = value;
                attr.state = value.ToString();
                attr.curValue = value.ToString();
            }
            return true;
        }
        /// <summary>
        /// ä¸Šä¸€æ¬¡æ‰“开的亮度
        /// ç¯å…‰ç§æœ‰å±žæ€§
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int lastBrightness = 100;
        /// <summary>
        /// å·¥ä½œæ¨¡å¼å¯¹åº”的工作温度
        /// åœ°çƒ­ç§æœ‰å±žæ€§
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public Dictionary<string, byte> Fh_Mode_Temp = new Dictionary<string, byte>();
        #endregion
        #region base info
        /// <summary>
        /// HDL统一协议格式:14bytes
        /// ä¸¾ä¾‹ï¼š æ¥æº   åŽ‚å•†ä»£ç  é€šè®¯æ–¹å¼  äº§å“æ—¶é—´æˆ³   äº§å“ç±»åˆ« ç‰©æ¨¡åž‹ç±»  é€šé“号   å¤§å°ç±»åˆ«
        ///       1byte    1byte    1byte      4byte        1byte    2byte   2byte   2byte
        /// æ¥æºï¼š00    é»˜è®¤åŽŸç”Ÿæ€ç³»ç»Ÿæ•°æ® ã€01    ç½‘关或者其他A设备、02    è°ƒè¯•软件、03    APP应用程序、04    ç¬¬ä¸‰æ–¹ç½‘关或者平台
        /// åŽ‚å•†ä»£ç ï¼š01    HDL
        /// é€šè®¯æ–¹å¼ï¼š01    HDL Bus、02    Zigbee、03 KNX、04 Z-Wave
        /// äº§å“æ—¶é—´æˆ³ï¼š4bytes    ä»¥2020å¹´1月1日算出的时间戳0.1s为单位
        /// äº§å“ç±»åˆ«ï¼š01    è°ƒå…‰å™¨ã€02 ç»§ç”µå™¨ã€03    å¹²æŽ¥ç‚¹æ¨¡å—、04    ä¼ æ„Ÿå™¨ã€05 é¢æ¿
        /// ç‰©æ¨¡åž‹ç±»åž‹ï¼š
        ///     01    å¼€å…³ç±»ï¼š01 å¼€å…³ã€02 æ’座、03
        ///     02    ç…§æ˜Žï¼š 01 å¼€å…³ã€02    è°ƒå…‰ã€03    è‰²æ¸©ã€04    LED
        ///     03    é®é˜³ï¼š 01    çª—帘电机、02 ç™¾å¶çª—、03 å¼€åˆå¸˜ã€04 å·å¸˜
        ///     04    æ’温器:01 ç©ºè°ƒã€02 åœ°æš–、03 æ¯›ç»†ç©ºè°ƒ
        ///     05    æ–°é£Ž
        ///     06    å½±éŸ³
        ///     07    éŸ³ä¹
        ///     08    èƒ½æº
        ///     09    å®‰é˜²
        /// å¤§ç±»åˆ«    1bytes    ï¼ˆé¢„留)
        /// å°ç±»åˆ«    1byte    ï¼ˆé¢„留)
        /// </summary>      â€œ0001021599F98A04050300010000”
        public string sid = "0301011234567801012301230123";
        /// <summary>
        /// å¤‡æ³¨
@@ -187,23 +183,6 @@
        /// attri
        /// </summary>
        public List<FunctionAttributes> attributes = new List<FunctionAttributes>();
        /// <summary>
        /// åŠŸèƒ½çŠ¶æ€åˆ—è¡¨
        /// </summary>
        public List<AttributesStatus> status = new List<AttributesStatus>();
        /// <summary>
        /// èŽ·å–çŠ¶æ€å€¼
        /// </summary>
        /// <returns></returns>
        public string GetStatusValus(string key)
        {
            var d = status.Find((obj) => obj.key == key);
            if(d==null)
            {
                return null;
            }
            return d.value;
        }
        /// <summary>
        /// æˆ¿é—´ID列表
@@ -299,7 +278,6 @@
        public void CollectFunction()
        {
            var result = "";
            //var waitPage = new Loading();
            new System.Threading.Thread(() =>
            {
@@ -318,6 +296,12 @@
                    {
                        collect = !collect;
                        IMessageCommon.Current.ShowErrorInfoAlter(result);
                    });
                }else
                {
                    Application.RunOnMainThread(() =>
                    {
                        UI.HomePage.RefreshFunctionView();
                    });
                }
            })
@@ -531,7 +515,7 @@
            sendDataObj.time_stamp = Control.Ins.Get_TimeStamp();
            var acd = new AlinkControlData();
            var acd = new AlinkStatusData();
            acd.sid = sid;
            foreach (var dic in commandDictionary)
            {
@@ -593,7 +577,7 @@
    /// </summary>
    public class AlinkFunctionStatusObj
    {
        public List<AlinkControlData> objects = new List<AlinkControlData>();
        public List<AlinkStatusData> objects = new List<AlinkStatusData>();
        public string time_stamp = "";
        public string id = "";
@@ -609,11 +593,23 @@
        public string time_stamp = "";
    }
    /// <summary>
    /// A协议控制数据
    /// A协议状态数据
    /// </summary>
    public class AlinkControlData
    public class AlinkStatusData
    {
        /*
         mqtt接收的状态数据没有deviceId
        æŽ¥å£åé¦ˆçš„æ•°æ®æœ‰
         */
        /// <summary>
        ///
        /// </summary>
        public string sid = "";
        /// <summary>
        /// è®¾å¤‡ID
        /// äº‘端负责生成
        /// </summary>
        public string deviceId = "0";
        public List<AttributesStatus> status = new List<AttributesStatus>();
    }
    /// <summary>
@@ -661,6 +657,10 @@
        /// </summary>
        public string data_type = "";
        /// <summary>
        /// å½“前状态
        /// </summary>
        public string state = "";
        /// <summary>
        /// å½“前值
        /// </summary>
        public object curValue = new object();
@@ -692,6 +692,11 @@
        /// </summary>
        public const string Mode = "mode";
        /// <summary>
        /// å·¥ä½œæ¨¡å¼
        /// åœ°çƒ­/地冷/功率地热/功率地冷
        /// </summary>
        public const string WorkMode = "mode_work";
        /// <summary>
        /// é£Žé€Ÿ
        /// </summary>
        public const string FanSpeed = "fan";
@@ -699,6 +704,16 @@
        /// è®¾ç½®æ¸©åº¦
        /// </summary>
        public const string SetTemp = "set_temp";
        /// <summary>
        /// æ¸©åº¦æ¨¡å¼
        /// ç©ºè°ƒã€åœ°çƒ­//app自加
        /// </summary>
        public const string TempType = "temperature_type";
        /// <summary>
        /// æ—¶é—´æ ‡è®°
        /// åœ°çƒ­//app自加
        /// </summary>
        public const string TimeFlag = "time_flag";
        /// <summary>
        /// å»¶æ—¶
        /// </summary>
@@ -771,7 +786,22 @@
        /// æ¶ˆæ¯’剩余时间
        /// </summary>
        public const string DisinfectTimeLeft = "disinfect_time_surplus";
        /// <summary>
        /// è´Ÿç¦»å­
        /// </summary>
        public const string Anion = "anion";
        /// <summary>
        /// è´Ÿç¦»å­æ—¶é—´
        /// </summary>
        public const string AnionTime = "anion_time";
        /// <summary>
        /// è´Ÿç¦»å­å‰©ä½™æ—¶é—´
        /// </summary>
        public const string AnionTimeLeft = "anion_time_surplus";
        /// <summary>
        /// æ‰“开登记(风扇)
        /// </summary>
        public const string OpenLevel = "openLevel";
        #region tuya
@@ -981,6 +1011,14 @@
        /// å‡‰éœ¸
        /// </summary>
        public const string ClothesHanger = "electrical.racks";
        /// <summary>
        /// çº¢å¤–宝
        /// </summary>
        public const string IrModule = "ir.module";
        /// <summary>
        /// çº¢å¤–空调
        /// </summary>
        public const string IrAC = "ir.ac";
        /// <summary>
HDL_ON/Entity/Function/Light.cs
@@ -4,216 +4,24 @@
namespace HDL_ON.Entity
{
    public class Light : Function
    public class Light
    {
        /*
        ç¯å…‰ç±»ï¼štrait: [switch,brightness,color,cct,delay,fadeTime]
        å±žæ€§    æè¿°
        switch    on/off;
        brightness    0-100;
        color    int (red (0-255) green (0-255) blue (0-255))
        cct    int (warm light(0-255) cold light (0-255) )
        delay    0-3600s
        fadetime    0-3600s
        */
        public Light()
        {
        }
        [Newtonsoft.Json.JsonIgnore]
        FunctionAttributes trait_brightness;
        /// <summary>
        /// äº®åº¦å€¼
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int brightness
        {
            get
            {
                if (trait_brightness == null)
                {
                    trait_brightness = attributes.Find((obj) => obj.key == "brightness");
                    //找不到属性需要声明一个,防止报错闪退
                    if (trait_brightness == null)
                    {
                        trait_brightness = new FunctionAttributes()
                        {
                            key = "brightness",
                            value = new List<string> { "up", "down" },
                            max = 100,
                            min = 0,
                            curValue = 0,
                        };
                    }
                    if (trait_brightness.curValue.ToString() == "{}")
                        trait_brightness.curValue = 0;
                }
                try
                {
                    string textValue = trait_brightness.curValue.ToString();
                    if (textValue == string.Empty)
                    {
                        trait_brightness.curValue = 0;
                    }
                    return Convert.ToInt32(trait_brightness.curValue);
                }
                catch
                {
                    trait_brightness.curValue = 0;
                    return 0;
                }
            }
            set
            {
                try
                {
                    if (trait_brightness == null)
                    {
                        trait_brightness = attributes.Find((obj) => obj.key == "brightness");
                        //找不到属性需要声明一个,防止报错闪退
                        if (trait_brightness == null)
                        {
                            trait_brightness = new FunctionAttributes()
                            {
                                key = "brightness",
                                value = new List<string> { "up", "down" },
                                max = 100,
                                min = 0,
                                curValue = 0
                            };
                        }
                    }
                    trait_brightness.curValue = value;
                }
                catch
                {
                    MainPage.Log("brightness æ•°æ®åˆ·æ–°å¤±è´¥.");
                }
            }
        }
        /// <summary>
        /// ä¸Šä¸€æ¬¡æ‰“开的亮度
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int lastBrightness = 100;
        int hadFadeTime = 99;
        /// <summary>
        /// æ˜¯å¦æ‹¥æœ‰æ¸å˜æ—¶é—´
        /// </summary>
        public bool HadFadeTime
        {
            get
            {
                if (hadFadeTime == 99)
                {
                    var t = attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime);
                    if (t == null)
                    {
                        hadFadeTime = 0;
                        return false;
                    }
                    else
                    {
                        hadFadeTime = 1;
                        return true;
                    }
                }
                if (hadFadeTime == 1)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
        [Newtonsoft.Json.JsonIgnore]
        FunctionAttributes trait_fadeTime;
        /// <summary>
        /// æ¸å˜æ—¶é—´
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int fadeTime
        {
            get
            {
                if (trait_fadeTime == null)
                {
                    trait_fadeTime = attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime);
                    //找不到属性需要声明一个,防止报错闪退
                    if (trait_fadeTime == null)
                    {
                        trait_fadeTime = new FunctionAttributes()
                        {
                            key = FunctionAttributeKey.FadeTime,
                            value = new List<string> { "up", "down" },
                            max = 10,
                            min = 0,
                            curValue = 0
                        };
                    }
                }
                int result = 0;
                int.TryParse(trait_fadeTime.curValue.ToString(), out result);
                return result;
            }
            set
            {
                try
                {
                    if (trait_fadeTime == null)
                    {
                        trait_fadeTime = attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime);
                        //找不到属性需要声明一个,防止报错闪退
                        if (trait_fadeTime == null)
                        {
                            trait_fadeTime = new FunctionAttributes()
                            {
                                key = FunctionAttributeKey.FadeTime,
                                value = new List<string> { "up", "down" },
                                max = 100,
                                min = 0,
                                curValue = 0
                            };
                        }
                    }
                    trait_fadeTime.curValue = value;
                }
                catch
                {
                }
            }
        }
        #region RGB
        /// <summary>
        /// èŽ·å–rgb颜色
        /// </summary>
        /// <returns></returns>
        public int GetRGBcolor()
        public int GetRGBcolor(Function function )
        {
            if (trait_color == null)
            {
                trait_color = attributes.Find((obj) => obj.key == FunctionAttributeKey.RGB);
                //找不到属性需要声明一个,防止报错闪退
                if (trait_color == null)
                {
                    trait_color = new FunctionAttributes()
                    {
                        key = "color",
                        value = new List<string> { "255,255,255" },
                        curValue = "255,255,255"
                    };
                }
                if (trait_color.curValue.ToString() == "{}")
                    trait_color.curValue = "255,255,255";
            }
            int.TryParse(trait_color.curValue.ToString().Split(",")[0], out redColor);
            int.TryParse(trait_color.curValue.ToString().Split(",")[1], out greenColor);
            int.TryParse(trait_color.curValue.ToString().Split(",")[2], out blueColor);
            var color = function.GetAttrState(FunctionAttributeKey.RGB).Split(",");
            int redColor = 0;
            int greenColor = 0;
            int blueColor = 0;
            int.TryParse(color[0], out redColor);
            int.TryParse(color[1], out greenColor);
            int.TryParse(color[2], out blueColor);
            int recolor = redColor * 256 * 256 + greenColor * 256 + blueColor;
@@ -223,79 +31,40 @@
        /// èŽ·å–rgb æŽ§åˆ¶å­—符串
        /// </summary>
        /// <returns></returns>
        public string GetRGBcolorString()
        public string GetRGBcolorString(Function function )
        {
            return redColor + "," + greenColor + "," + blueColor;
            var color = function.GetAttrState(FunctionAttributeKey.RGB).Split(",");
            return color[0] + "," + color[1] + "," + color[2];
        }
        /// <summary>
        /// èŽ·å–rgb颜色
        /// </summary>
        /// <param name="index">0:red 1:green 2:blue</param>
        /// <returns></returns>
        public int GetColor( int index,Function function)
        {
            int color = 0;
            if (index <= 2)
            {
                try
                {
                    int.TryParse(function.GetAttrState(FunctionAttributeKey.RGB).Split(",")[index], out color);
                }
                catch { }
            }
            return color;
        }
        /// <summary>
        /// è®¾ç½®rgb颜色
        /// </summary>
        public void SetRGBcolor(byte[] color)
        public void SetRGBcolor(byte[] color,Function function)
        {
            redColor = color[0];
            greenColor = color[1];
            blueColor = color[2];
            trait_color.curValue = redColor + "," + greenColor + "," + blueColor;
            function.SetAttrState(FunctionAttributeKey.RGB, color[0] + "," + color[1] + "," + color[2]);
        }
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_color;
        int redColor = 255;
        int greenColor = 255;
        int blueColor = 255;
        public int RedColor {
            get
            {
                return redColor;
            }
        }
        public int GreenColor {
            get
            {
                return greenColor;
            }
        }
        public int BlueColor
        {
            get
            {
                return blueColor;
            }
        }
        #endregion
        #region CCT
        FunctionAttributes attr_CCT;
        /// <summary>
        /// è‰²æ¸©
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes Attr_CCT
        {
            get
            {
                if(attr_CCT == null)
                {
                    attr_CCT = attributes.Find((obj) => obj.key == FunctionAttributeKey.CCT);
                    if(attr_CCT== null)
                    {
                        attr_CCT = new FunctionAttributes()
                        {
                            key = FunctionAttributeKey.CCT,
                            value = new List<string> (),
                            max = 6500,
                            min = 2700,
                            curValue = 2700
                        };
                    }
                }
                var result = 2700;
                int.TryParse(attr_CCT.curValue.ToString(), out result);
                return attr_CCT;
            }
        }
        #endregion
    }
}
HDL_ON/Entity/Function/Scene.cs
@@ -86,11 +86,6 @@
        ///// <summary>
        ///// åœºæ™¯èƒŒæ™¯
        ///// </summary>
        //public string ImagePath = "Intelligence/Gallery/scenebg1.png";//"FunctionIcon/Scene/s1.png";
        ///// <summary>
        ///// åœºæ™¯èƒŒæ™¯
        ///// </summary>
        public string ImagePath
        {
            get
@@ -339,40 +334,32 @@
            return revPack.Code;
        }
        /// <summary>
        /// ä¸Šä¼ æ•°æ®åˆ°äº‘端
        /// å»¶æ—¶æ˜¾ç¤ºçš„æ–‡æœ¬
        /// </summary>
        void UploadScene()
        public string GetDelayText()
        {
            var pm = new HttpServerRequest();
            ResponsePackNew revPack;
            if (string.IsNullOrEmpty(createTime) && string.IsNullOrEmpty(modifyTime))
            string text = "";
            switch (delay)
            {
                revPack = pm.AddScene(this);
                if (revPack.Code == StateCode.SUCCESS)
                {
                    var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
                    Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                }
                case "0":
                    text = Language.StringByID(StringId.NoDelay);
                    break;
                case "30":
                    text = "30s";
                    break;
                case "60":
                    text = "1min";
                    break;
                case "120":
                    text = "2min";
                    break;
                case "300":
                    text = "5min";
                    break;
            }
            else if (!string.IsNullOrEmpty(createTime) && !string.IsNullOrEmpty(modifyTime))
            {
                revPack = pm.EditScene(this);
                if (revPack.Code == StateCode.SUCCESS)
                {
                    var scenes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString());
                    var tempScene = scenes.Find((obj) => obj.sid == sid);
                    if (tempScene != null)
                    {
                        var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(tempScene));
                        Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                    }
                }
            }
            return text;
        }
        /// <summary>
        /// äº‘端数据创建的时间
        /// </summary>
@@ -431,6 +418,171 @@
    {
        public string key = "";
        public string value = "";
        /// <summary>
        /// å±žæ€§åç§°æ˜¾ç¤ºæ–‡æœ¬
        /// ä¸­è‹±æ–‡æ˜¾ç¤º
        /// </summary>
        public string GetNameText()
        {
            string text = "";
            switch (key)
            {
                case FunctionAttributeKey.OnOff:
                    text = Language.StringByID(StringId.OnOff);
                    break;
                case FunctionAttributeKey.Brightness:
                    text = Language.StringByID(StringId.Brightness);
                    break;
                case FunctionAttributeKey.RGB:
                    text = Language.StringByID(StringId.ColorValue);
                    break;
                case FunctionAttributeKey.Mode:
                    text = Language.StringByID(StringId.Mode);
                    break;
                case FunctionAttributeKey.FanSpeed:
                    text = Language.StringByID(StringId.FanSpeed);
                    break;
                case FunctionAttributeKey.SetTemp:
                    text = Language.StringByID(StringId.Temp);
                    break;
                case FunctionAttributeKey.IndoorTemp:
                    text = Language.StringByID(StringId.IndoorTemp);
                    break;
                case FunctionAttributeKey.Delay:
                    text = Language.StringByID(StringId.Delay);
                    break;
                case FunctionAttributeKey.CCT:
                    text = "CCT";
                    break;
                case FunctionAttributeKey.Percent:
                    text = Language.StringByID(StringId.PercentAdjustment);
                    break;
                case FunctionAttributeKey.FadeTime:
                    text = Language.StringByID(StringId.FadeSpeed);
                    break;
            }
            return text;
        }
        /// <summary>
        /// å±žæ€§å€¼å•位
        /// </summary>
        public string GetUintString()
        {
            var us = "";
            switch (key)
            {
                case FunctionAttributeKey.SetTemp:
                case FunctionAttributeKey.IndoorTemp:
                    us = "°C";
                    break;
                case FunctionAttributeKey.Percent:
                case FunctionAttributeKey.Brightness:
                    us = "%";
                    break;
            }
            return us;
        }
        /// <summary>
        /// èŽ·å–æŒ‡å®šå±žæ€§çš„æ˜¾ç¤ºæ–‡æœ¬
        /// ä¸­è‹±æ–‡æ˜¾ç¤º
        /// </summary>
        public string GetValueText()
        {
            string text = "";
            switch (key)
            {
                case FunctionAttributeKey.OnOff:
                    text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF);
                    break;
                case FunctionAttributeKey.SetTemp:
                case FunctionAttributeKey.IndoorTemp:
                case FunctionAttributeKey.Brightness:
                case FunctionAttributeKey.Percent:
                    if (value == "")
                    {
                        value = "0";
                    }
                    text = value;
                    break;
                case FunctionAttributeKey.Mode:
                    switch (value)
                    {
                        //----空调
                        case "auto":
                            text = Language.StringByID(StringId.Auto);
                            break;
                        case "cool":
                            text = Language.StringByID(StringId.Cool);
                            break;
                        case "heat":
                            text = Language.StringByID(StringId.Heat);
                            break;
                        case "dry":
                            text = Language.StringByID(StringId.Dry);
                            break;
                        case "fan":
                            text = Language.StringByID(StringId.AirSupply);
                            break;
                        //-----地热
                        case "day":
                            text = Language.StringByID(StringId.Day);
                            break;
                        case "night":
                            text = Language.StringByID(StringId.Night);
                            break;
                        case "away":
                            text = Language.StringByID(StringId.Away);
                            break;
                        case "normal":
                            text = Language.StringByID(StringId.Normal);
                            break;
                        case "timer":
                            text = Language.StringByID(StringId.Timer);
                            break;
                    }
                    break;
                case FunctionAttributeKey.FanSpeed:
                    switch (value)
                    {
                        case "high":
                            text = Language.StringByID(StringId.HighWindSpeed);
                            break;
                        case "medium":
                            text = Language.StringByID(StringId.MiddleWindSpeed);
                            break;
                        case "low":
                            text = Language.StringByID(StringId.LowWindSpeed);
                            break;
                        case "auto":
                            text = Language.StringByID(StringId.Auto);
                            break;
                        default:
                            text = "low";
                            break;
                    }
                    break;
                case "high":
                    text = Language.StringByID(StringId.HighWindSpeed);
                    break;
                case "medium":
                    text = Language.StringByID(StringId.MiddleWindSpeed);
                    break;
                case "low":
                    text = Language.StringByID(StringId.LowWindSpeed);
                    break;
                case "auto":
                    text = Language.StringByID(StringId.Auto);
                    break;
            }
            return text;
        }
    }
    /// <summary>
    /// åœºæ™¯æŽ¨é€é…ç½®
HDL_ON/Entity/Function/Sensor.cs
@@ -3,337 +3,253 @@
namespace HDL_ON.Entity
{
    public class Sensor :Function
    public class Sensor
    {
        public Sensor()
        {
        }
        [Newtonsoft.Json.JsonIgnore]
        public int functionTypeNameId
        {
            get
            {
                int nameId = 0;
                switch (spk)
                {
                    case SPK.SensorPm25:
                        nameId = StringId.PM25;
                        break;
                    case SPK.SensorCO2:
                        nameId = StringId.CO2;
                        break;
                    case SPK.SensorTemperature:
                        nameId = StringId.Temp;
                        break;
                    case SPK.SensorTVOC:
                        nameId = StringId.TVOC;
                        break;
                    case SPK.SensorHumidity:
                        nameId = StringId.Humidity;
                        break;
                }
                return nameId;
            }
        }
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_values;
        /// <summary>
        /// å€¼
        /// èŽ·å–åç§°æ–‡æœ¬ID
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public double values
        /// <param name="spk"></param>
        /// <returns></returns>
        public int GetFunctionTypeNameId(string spk)
        {
            get
            int nameId = 0;
            switch (spk)
            {
                if (trait_values == null)
                {
                    trait_values = attributes.Find((obj) => obj.key == FunctionAttributeKey.Value);
                    //找不到属性需要声明一个,防止报错闪退
                    if (trait_values == null)
                    {
                        trait_values = new FunctionAttributes()
                        {
                            key = FunctionAttributeKey.Value,
                            value = new List<string> { "29" },
                            max = 10000,
                            min = 0,
                        };
                        trait_values.curValue = trait_values.min;
                    }
                }
                if (trait_values.curValue.ToString() == "{}")
                    trait_values.curValue = 0;
                if(spk == SPK.SensorTVOC)
                {
                    return Convert.ToDouble(trait_values.curValue.ToString()) / 100000;
                }
                return Convert.ToDouble(trait_values.curValue);
                case SPK.SensorPm25:
                    nameId = StringId.PM25;
                    break;
                case SPK.SensorCO2:
                    nameId = StringId.CO2;
                    break;
                case SPK.SensorTemperature:
                    nameId = StringId.Temp;
                    break;
                case SPK.SensorTVOC:
                    nameId = StringId.TVOC;
                    break;
                case SPK.SensorHumidity:
                    nameId = StringId.Humidity;
                    break;
            }
            set
            {
                try
                 {
                    if (trait_values == null)
                    {
                        trait_values = attributes.Find((obj) => obj.key == FunctionAttributeKey.Value);
                        //找不到属性需要声明一个,防止报错闪退
                        if (trait_values == null)
                        {
                            trait_values = new FunctionAttributes()
                            {
                                key = FunctionAttributeKey.Value,
                                value = new List<string> { "up" },
                                max = 100,
                                min = 0,
                            };
                        }
                        trait_values.curValue = trait_values.min;
                    }
                    trait_values.curValue = value;
                    MainPage.Log($"values æ•°æ®åˆ·æ–°{value}.");
                }
                catch
                {
                    MainPage.Log("values æ•°æ®åˆ·æ–°å¤±è´¥.");
                }
            }
            return nameId;
        }
        /// <summary>
        ///
        /// </summary>
        public double GetValues(Function function)
        {
            var value = function.GetAttrState(FunctionAttributeKey.Value);
            return Convert.ToDouble(value);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        /// <param name="function"></param>
        public void SetValues(int value, Function function)
        {
            function.SetAttrState(FunctionAttributeKey.Value, value);
        }
        List<string> _intervalValue;
        /// <summary>
        /// æ¯ä¸ªç­‰çº§å¯¹åŒºé—´å€¼
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<string> intervalValue
        public List<string> GetIntervalValue(string spk)
        {
            get
            var _intervalValue = new List<string>();
            switch (spk)
            {
                if (_intervalValue == null)
                {
                    _intervalValue = new List<string>();
                    switch (spk)
                    {
                        case SPK.SensorPm25:
                            _intervalValue.Add("0 ~ 35");
                            _intervalValue.Add("36 ~ 75");
                            _intervalValue.Add("76 ~ 115");
                            _intervalValue.Add("115 ~");
                            break;
                        case SPK.SensorCO2:
                            _intervalValue.Add("0 ~ 1000");
                            _intervalValue.Add("1001 ~ 2000");
                            _intervalValue.Add("2001 ~ 5000");
                            _intervalValue.Add("5001 ~");
                            break;
                        case SPK.SensorTemperature:
                            _intervalValue.Add("~ 18°C");
                            _intervalValue.Add("18 ~ 20°C");
                            _intervalValue.Add("20 ~ 25°C");
                            _intervalValue.Add("25 ~ 27°C");
                            _intervalValue.Add("27 ~ 30°C");
                            _intervalValue.Add("30 ~ 33°C");
                            _intervalValue.Add("33°C ~");
                            break;
                        case SPK.SensorTVOC:
                            _intervalValue.Add("0 ~ 0.6");
                            _intervalValue.Add("0.61 ~ 2");
                            _intervalValue.Add("2.01 ~ 5");
                            _intervalValue.Add("5 ~");
                            break;
                        case SPK.SensorHumidity:
                            _intervalValue.Add("70 ~");
                            _intervalValue.Add("71 ~ 40");
                            _intervalValue.Add("0 ~ 39");
                            break;
                    }
                }
                return _intervalValue;
                case SPK.SensorPm25:
                    _intervalValue.Add("0 ~ 35");
                    _intervalValue.Add("36 ~ 75");
                    _intervalValue.Add("76 ~ 115");
                    _intervalValue.Add("115 ~");
                    break;
                case SPK.SensorCO2:
                    _intervalValue.Add("0 ~ 1000");
                    _intervalValue.Add("1001 ~ 2000");
                    _intervalValue.Add("2001 ~ 5000");
                    _intervalValue.Add("5001 ~");
                    break;
                case SPK.SensorTemperature:
                    _intervalValue.Add("~ 18°C");
                    _intervalValue.Add("18 ~ 20°C");
                    _intervalValue.Add("20 ~ 25°C");
                    _intervalValue.Add("25 ~ 27°C");
                    _intervalValue.Add("27 ~ 30°C");
                    _intervalValue.Add("30 ~ 33°C");
                    _intervalValue.Add("33°C ~");
                    break;
                case SPK.SensorTVOC:
                    _intervalValue.Add("0 ~ 0.6");
                    _intervalValue.Add("0.61 ~ 2");
                    _intervalValue.Add("2.01 ~ 5");
                    _intervalValue.Add("5 ~");
                    break;
                case SPK.SensorHumidity:
                    _intervalValue.Add("70 ~");
                    _intervalValue.Add("71 ~ 40");
                    _intervalValue.Add("0 ~ 39");
                    break;
            }
            return _intervalValue;
        }
        List<uint> _levelColorList;
        /// <summary>
        /// æ¯ä¸ªç­‰çº§çš„颜色值
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<uint> levelColorList
        public List<uint> GetLevelColorList(string spk)
        {
            get
            var _levelColorList = new List<uint>();
            switch (spk)
            {
                try
                {
                if (_levelColorList == null)
                {
                    _levelColorList = new List<uint>();
                    switch (spk)
                    {
                        case SPK.SensorPm25:
                            _levelColorList.Add(0xFFADE764);
                            _levelColorList.Add(0xFFFFD154);
                            _levelColorList.Add(0xFFFF9D54);
                            _levelColorList.Add(0xFFFF3D3D);
                            break;
                        case SPK.SensorCO2:
                            _levelColorList.Add(0xFFADE764);
                            _levelColorList.Add(0xFFFFD154);
                            _levelColorList.Add(0xFFFF9D54);
                            _levelColorList.Add(0xFFFF3D3D);
                            break;
                        case SPK.SensorTemperature:
                            _levelColorList.Add(0xFF2172FF);
                            _levelColorList.Add(0xCC4484F4);
                            _levelColorList.Add(0x7F4484F4);
                            _levelColorList.Add(0xFFADE764);
                            _levelColorList.Add(0xFFFFD154);
                            _levelColorList.Add(0xFFFF9D54);
                            _levelColorList.Add(0xFFFF3D3D);
                            break;
                        case SPK.SensorTVOC:
                            _levelColorList.Add(0xFFADE764);
                            _levelColorList.Add(0xFFFFD154);
                            _levelColorList.Add(0xFFFF9D54);
                            _levelColorList.Add(0xFFFF3D3D);
                case SPK.SensorPm25:
                    _levelColorList.Add(0xFFADE764);
                    _levelColorList.Add(0xFFFFD154);
                    _levelColorList.Add(0xFFFF9D54);
                    _levelColorList.Add(0xFFFF3D3D);
                    break;
                case SPK.SensorCO2:
                    _levelColorList.Add(0xFFADE764);
                    _levelColorList.Add(0xFFFFD154);
                    _levelColorList.Add(0xFFFF9D54);
                    _levelColorList.Add(0xFFFF3D3D);
                    break;
                case SPK.SensorTemperature:
                    _levelColorList.Add(0xFF2172FF);
                    _levelColorList.Add(0xCC4484F4);
                    _levelColorList.Add(0x7F4484F4);
                    _levelColorList.Add(0xFFADE764);
                    _levelColorList.Add(0xFFFFD154);
                    _levelColorList.Add(0xFFFF9D54);
                    _levelColorList.Add(0xFFFF3D3D);
                    break;
                case SPK.SensorTVOC:
                    _levelColorList.Add(0xFFADE764);
                    _levelColorList.Add(0xFFFFD154);
                    _levelColorList.Add(0xFFFF9D54);
                    _levelColorList.Add(0xFFFF3D3D);
                            break;
                        case SPK.SensorHumidity:
                            _levelColorList.Add(0xFF2172FF);
                            _levelColorList.Add(0xFFADE764);
                            _levelColorList.Add(0xFFFF3D3D);
                            break;
                    }
                }
                }catch(Exception ex)
                {
                    MainPage.Log($"sensor error 1 : {ex.Message}");
                }
                return _levelColorList;
                    break;
                case SPK.SensorHumidity:
                    _levelColorList.Add(0xFF2172FF);
                    _levelColorList.Add(0xFFADE764);
                    _levelColorList.Add(0xFFFF3D3D);
                    break;
            }
            return _levelColorList;
        }
        List<int> _levelTextList;
        /// <summary>
        /// æ¯ä¸ªç­‰çº§çš„名称
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<int> levelTextList
        public List<int> GetLevelTextList(string spk)
        {
            get
            var _levelTextList = new List<int>();
            switch (spk)
            {
                if (_levelTextList == null)
                {
                    _levelTextList = new List<int>();
                    switch (spk)
                    {
                        case SPK.SensorPm25:
                            _levelTextList.Add(StringId.Great);
                            _levelTextList.Add(StringId.Good);
                            _levelTextList.Add(StringId.MildPollution);
                            _levelTextList.Add(StringId.HeavyPollution);
                            break;
                        case SPK.SensorCO2:
                            _levelTextList.Add(StringId.SensorReferenceTipCO2Level1);
                            _levelTextList.Add(StringId.SensorReferenceTipCO2Level2);
                            _levelTextList.Add(StringId.SensorReferenceTipCO2Level3);
                            _levelTextList.Add(StringId.SensorReferenceTipCO2Level4);
                            break;
                        case SPK.SensorTemperature:
                            _levelTextList.Add(StringId.ExtremelyCold);
                            _levelTextList.Add(StringId.Cold);
                            _levelTextList.Add(StringId.SlightlyCold);
                            _levelTextList.Add(StringId.Comfortable);
                            _levelTextList.Add(StringId.TepidFever);
                            _levelTextList.Add(StringId.Heat_SensorTip);
                            _levelTextList.Add(StringId.ExtremeHeat);
                            break;
                        case SPK.SensorTVOC:
                            _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel1);
                            _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel2);
                            _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel3);
                            _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel4);
                            break;
                        case SPK.SensorHumidity:
                            _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel1);
                            _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel2);
                            _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel3);
                            break;
                    }
                }
                return _levelTextList;
                case SPK.SensorPm25:
                    _levelTextList.Add(StringId.Great);
                    _levelTextList.Add(StringId.Good);
                    _levelTextList.Add(StringId.MildPollution);
                    _levelTextList.Add(StringId.HeavyPollution);
                    break;
                case SPK.SensorCO2:
                    _levelTextList.Add(StringId.SensorReferenceTipCO2Level1);
                    _levelTextList.Add(StringId.SensorReferenceTipCO2Level2);
                    _levelTextList.Add(StringId.SensorReferenceTipCO2Level3);
                    _levelTextList.Add(StringId.SensorReferenceTipCO2Level4);
                    break;
                case SPK.SensorTemperature:
                    _levelTextList.Add(StringId.ExtremelyCold);
                    _levelTextList.Add(StringId.Cold);
                    _levelTextList.Add(StringId.SlightlyCold);
                    _levelTextList.Add(StringId.Comfortable);
                    _levelTextList.Add(StringId.TepidFever);
                    _levelTextList.Add(StringId.Heat_SensorTip);
                    _levelTextList.Add(StringId.ExtremeHeat);
                    break;
                case SPK.SensorTVOC:
                    _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel1);
                    _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel2);
                    _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel3);
                    _levelTextList.Add(StringId.SensorReferenceTVOCTipLevel4);
                    break;
                case SPK.SensorHumidity:
                    _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel1);
                    _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel2);
                    _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel3);
                    break;
            }
            return _levelTextList;
        }
        /// <summary>
        /// å½“前等级
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int curLevel
        public int GetCurLevel(Function function)
        {
            get
            var spk = function.spk;
            var values = GetValues(function);
            int level = 1;
            switch (spk)
            {
                int level = 1;
                switch (spk)
                {
                    case SPK.SensorPm25:
                        if (values < 35)
                            level = 1;
                        else if (values < 75)
                            level = 2;
                        else if (values < 115)
                            level = 3;
                        else if (values > 115)
                            level = 4;
                        break;
                    case SPK.SensorCO2:
                        if (values < 1000)
                            level = 1;
                        else if (values < 2000)
                            level = 2;
                        else if (values < 5000)
                            level = 3;
                        else if (values > 5000)
                            level = 4;
                        break;
                    case SPK.SensorTemperature:
                        if (values < 18)
                            level = 1;
                        else if (values < 20)
                            level = 2;
                        else if (values < 25)
                            level = 3;
                        else if (values < 27)
                            level = 4;
                        else if (values < 30)
                            level = 5;
                        else if (values < 33)
                            level = 6;
                        else if (values > 33)
                            level = 7;
                        break;
                    case SPK.SensorTVOC:
                        if (values < 0.6)
                            level = 1;
                        else if (values < 2)
                            level = 2;
                        else if (values < 5)
                            level = 3;
                        else if (values > 5)
                            level = 4;
                        break;
                    case SPK.SensorHumidity:
                        if (values > 70)
                            level = 1;
                        else if (values > 40)
                            level = 2;
                        else if (values < 40)
                            level = 3;
                        break;
                }
                return level;
                case SPK.SensorPm25:
                    if (values < 35)
                        level = 1;
                    else if (values < 75)
                        level = 2;
                    else if (values < 115)
                        level = 3;
                    else if (values > 115)
                        level = 4;
                    break;
                case SPK.SensorCO2:
                    if (values < 1000)
                        level = 1;
                    else if (values < 2000)
                        level = 2;
                    else if (values < 5000)
                        level = 3;
                    else if (values > 5000)
                        level = 4;
                    break;
                case SPK.SensorTemperature:
                    if (values < 18)
                        level = 1;
                    else if (values < 20)
                        level = 2;
                    else if (values < 25)
                        level = 3;
                    else if (values < 27)
                        level = 4;
                    else if (values < 30)
                        level = 5;
                    else if (values < 33)
                        level = 6;
                    else if (values > 33)
                        level = 7;
                    break;
                case SPK.SensorTVOC:
                    if (values < 0.6)
                        level = 1;
                    else if (values < 2)
                        level = 2;
                    else if (values < 5)
                        level = 3;
                    else if (values > 5)
                        level = 4;
                    break;
                case SPK.SensorHumidity:
                    if (values > 70)
                        level = 1;
                    else if (values > 40)
                        level = 2;
                    else if (values < 40)
                        level = 3;
                    break;
            }
            return level;
        }
    }
}
HDL_ON/Entity/Function/SwitchSocket.cs
@@ -1,7 +1,7 @@
using System;
namespace HDL_ON.Entity
{
    public class SwitchSocket : Function
    public class SwitchSocket
    {
        public SwitchSocket()
        {
HDL_ON/Entity/Function/TV.cs
@@ -3,20 +3,19 @@
namespace HDL_ON.Entity
{
    public class TV : Function
    public class TV
    {
        public TV()
        {
            trait_on_off.curValue = "off";
        }
        public void ControlTV(InfraredCode_TV iCode)
        public void ControlTV(InfraredCode_TV iCode,Function function)
        {
            int RandKey = new Random().Next(0, 255);
            var textByte = (byte)iCode;
            new Control_Udp().ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0);
            new Control_Udp().ControlBytesSend(Command.InfraredControl, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 1, function.bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0);
        }
        public void ControlTV(int number)
        public void ControlTV(int number,Function function)
        {
            int RandKey = new Random().Next(0, 255);
            var textByte = (byte)(number + 7);
@@ -24,7 +23,7 @@
            {
                textByte = 18;
            }
            new Control_Udp().ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0);
            new Control_Udp().ControlBytesSend(Command.InfraredControl, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 1, function.bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0);
        }
    }
}
HDL_ON/Entity/Function/WeepRobot.cs
@@ -1,7 +1,7 @@
using System;
namespace HDL_ON.Entity
{
    public class WeepRobot : Function
    public class WeepRobot
    {
        public WeepRobot()
        {
HDL_ON/Entity/FunctionList.cs
@@ -16,11 +16,11 @@
        {
            get
            {
                if(_FunctionList == null)
                if (_FunctionList == null)
                {
                    _FunctionList = new FunctionList();
                    #region æ¢å¤æ•°æ®
                    var filePathList = Common.FileUtlis.Files.ReadFiles();
                    var filePathList = FileUtlis.Files.ReadFiles();
                    foreach (var filePath in filePathList)
                    {
                        _FunctionList.IniFunctionList(filePath);
@@ -30,130 +30,165 @@
                return _FunctionList;
            }
        }
        /// <summary>
        /// åŠŸèƒ½åˆ—è¡¨
        /// </summary>
        public List<Function> Functions = new List<Function>();
        /// <summary>
        /// ç©ºè°ƒåˆ—表
        /// </summary>
        public List<AC> aCs = new List<AC>();
        /// <returns></returns>
        public List<Function> GetAcList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.AcStandard);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List<Function> GetList()
        {
            List<Function> list = new List<Function>();
            return list;
        }
        /// <summary>
        /// ç¯å…‰åˆ—表
        /// </summary>
        public List<Light> lights = new List<Light>();
        public List<Function> GetLightList()
        {
            return Functions.FindAll((obj) =>
                        obj.spk == SPK.LightSwitch
                     || obj.spk == SPK.LightDimming
                     || obj.spk == SPK.LightRGB
                     || obj.spk == SPK.LightRGBW
                     || obj.spk == SPK.LightCCT);
        }
        /// <summary>
        /// çª—帘列表
        /// </summary>
        public List<Curtain> curtains = new List<Curtain>();
        public List<Function> GetCurtainList()
        {
            return Functions.FindAll((obj) =>
                       obj.spk == SPK.CurtainRoller
                    || obj.spk == SPK.CurtainShades
                    || obj.spk == SPK.CurtainSwitch
                    || obj.spk == SPK.CurtainTrietex
            );
        }
        /// <summary>
        /// åœ°çƒ­åˆ—表
        /// </summary>
        public List<FloorHeating> floorHeatings = new List<FloorHeating>();
        public List<Function> GetFloorHeatingList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.FloorHeatStandard);
        }
        #region å®¶ç”µåˆ—表 electricals
        /// <summary>
        /// å®¶ç”µåˆ—表
        /// </summary>
        public List<Function> electricals
        public List<Function> GetElectricals()
        {
            get
            {
                if(fans == null)
                {
                    fans = new List<Fan>();
                }
                if(switchSockets == null)
                {
                    switchSockets = new List<SwitchSocket>();
                }
                if(tVs == null)
                {
                    tVs = new List<TV>();
                }
                if (airCleaners == null)
                {
                    airCleaners = new List<AirCleaner>();
                }
                if (weepRobots == null)
                {
                    weepRobots = new List<WeepRobot>();
                }
                if(waterValveList == null)
                {
                    waterValveList = new List<Function>();
                }
                if(clothesHangerList == null)
                {
                    clothesHangerList = new List<Function>();
                }
                var list = new List<Function>();
                list.AddRange(fans);
                list.AddRange(switchSockets);
                list.AddRange(tVs);
                list.AddRange(airCleaners);
                list.AddRange(weepRobots);
                list.AddRange(waterValveList);
                list.AddRange(clothesHangerList);
                return list;
            }
            return Functions.FindAll((obj) => obj.spk == SPK.ElectricFan || obj.spk == SPK.ElectricTuyaFan
                || obj.spk == SPK.ElectricSocket
                || obj.spk == SPK.ElectricTV
                || obj.spk == SPK.ElectricTuyaAirCleaner
                || obj.spk == SPK.ElectricTuyaWeepRobot
                || obj.spk == SPK.ElectricTuyaWaterValve
                || obj.spk == SPK.ClothesHanger);
        }
        /// <summary>
        /// é£Žæ‰‡åˆ—表
        /// </summary>
        public List<Fan> fans = new List<Fan>();
        public List<Function> GetFanList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.ElectricFan || obj.spk == SPK.ElectricTuyaFan);
        }
        /// <summary>
        /// ç”µè§†åˆ—表
        /// </summary>
        public List<TV> tVs = new List<TV>();
        public List<Function> GetTVList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.ElectricTV);
        }
        /// <summary>
        /// å®¶ç”µåˆ—表
        /// å®¶ç”µæ’座列表
        /// </summary>
        public List<SwitchSocket> switchSockets = new List<SwitchSocket>();
        public List<Function> GetElectricSocketList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.ElectricSocket);
        }
        /// <summary>
        /// ç©ºæ°”净化器列表
        /// </summary>
        public List<AirCleaner> airCleaners = new List<AirCleaner>();
        public List<Function> GetAirCleanerList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.ElectricTuyaAirCleaner);
        }
        /// <summary>
        /// æ‰«åœ°æœºå™¨äººåˆ—表
        /// </summary>
        public List<WeepRobot> weepRobots = new List<WeepRobot>();
        public List<Function> GetWeepRobotList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.ElectricTuyaWeepRobot);
        }
        /// <summary>
        /// æ°´é˜€åˆ—表
        /// </summary>
        public List<Function> waterValveList = new List<Function>();
        public List<Function> GetWaterValveList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.ElectricTuyaWaterValve);
        }
        /// <summary>
        /// å‡‰éœ¸åˆ—表
        /// </summary>
        public List<Function> clothesHangerList = new List<Function>();
        public List<Function> GetClothesHangerList ()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.ClothesHanger);
        }
        /// <summary>
        /// çº¢å¤–宝列表
        /// </summary>
        public List<Function> GetIrModuleList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.IrModule);
        }
        #endregion
        /// <summary>
        /// çŽ¯å¢ƒä¼ æ„Ÿå™¨åˆ—è¡¨
        /// </summary>
        public List<Sensor> sensorsEnvironmentalScience = new List<Sensor>();
        public List<Function> GetEnvirSensorsList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.SensorPm25
                    || obj.spk == SPK.SensorCO2
                    || obj.spk == SPK.SensorTVOC
                    || obj.spk == SPK.SensorTemperature
                    || obj.spk == SPK.SensorHumidity
                    );
        }
        /// <summary>
        /// å®‰é˜²è®¾å¤‡åˆ—表
        /// </summary>
        public List<Sensor> sensorsArm = new List<Sensor>();
        public List<Function> GetArmSensorList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.SensorSmoke
                    || obj.spk == SPK.SensorWater
                    || obj.spk == SPK.SensorDoorWindow
                    || obj.spk == SPK.SensorPir
            );
        }
        public List<Scene> scenes = new List<Scene>();
        /// <summary>
        /// åœºæ™¯åˆ—表
        /// </summary>
        //public List<Scene> Scenes
        //{
        //    get
        //    {
        //        List.scenes = List.scenes.OrderByDescending(o => o.createTime).ToList();
        //        return List.scenes;
        //    }
        //}
        /// <summary>
        /// åŠŸèƒ½åˆ—è¡¨
        /// </summary>
        List<Function> deviceFunctionList = new List<Function>();
        /// <summary>
        /// åŠ è½½åŠŸèƒ½åˆ—è¡¨
        /// todo éœ€è¦ä¼˜åŒ–,后期不能保证能使用sid解析出是什么类型的设备
        /// </summary>
        /// <param name="filePath"></param>
        public void IniFunctionList(string filePath)
@@ -161,7 +196,7 @@
            // todo å¢žåŠ è®¾å¤‡ï¼Œå¢žåŠ åŠŸèƒ½è¿›åŠŸèƒ½åˆ—è¡¨
            if (filePath.StartsWith("FunctionData_"))
            {
                var functionDataBytes = Common.FileUtlis.Files.ReadFile(filePath);
                var functionDataBytes = FileUtlis.Files.ReadFile(filePath);
                var functionDataString = System.Text.Encoding.UTF8.GetString(functionDataBytes);
                var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
                if (tempFunction == null)
@@ -169,95 +204,10 @@
                    FileUtlis.Files.DeleteFile(filePath);
                    return;
                }
                {
                    switch (tempFunction.spk)
                    {
                        case SPK.LightSwitch:
                        case SPK.LightDimming:
                        case SPK.LightRGB:
                        case SPK.LightRGBW:
                        case SPK.LightCCT:
                            var light = Newtonsoft.Json.JsonConvert.DeserializeObject<Light>(functionDataString);
                            List.lights.Add(light);
                            deviceFunctionList.Add(light);
                            break;
                        case SPK.CurtainRoller:
                        case SPK.CurtainShades:
                        case SPK.CurtainSwitch:
                        case SPK.CurtainTrietex:
                            var curtain = Newtonsoft.Json.JsonConvert.DeserializeObject<Curtain>(functionDataString);
                            List.curtains.Add(curtain);
                            deviceFunctionList.Add(curtain);
                            break;
                        case SPK.AcStandard:
                            var ac = Newtonsoft.Json.JsonConvert.DeserializeObject<AC>(functionDataString);
                            List.aCs.Add(ac);
                            deviceFunctionList.Add(ac);
                            break;
                        case SPK.FloorHeatStandard:
                            var fh = Newtonsoft.Json.JsonConvert.DeserializeObject<FloorHeating>(functionDataString);
                            List.floorHeatings.Add(fh);
                            deviceFunctionList.Add(fh);
                            break;
                        case SPK.SensorPm25:
                        case SPK.SensorCO2:
                        case SPK.SensorTVOC:
                        case SPK.SensorTemperature:
                        case SPK.SensorHumidity:
                            var sensor = Newtonsoft.Json.JsonConvert.DeserializeObject<Sensor>(functionDataString);
                            List.sensorsEnvironmentalScience.Add(sensor);
                            deviceFunctionList.Add(sensor);
                            break;
                        case SPK.ElectricSocket:
                            var ele = Newtonsoft.Json.JsonConvert.DeserializeObject<SwitchSocket>(functionDataString);
                            List.switchSockets.Add(ele);
                            deviceFunctionList.Add(ele);
                            break;
                        case SPK.ElectricTV:
                            var tv = Newtonsoft.Json.JsonConvert.DeserializeObject<TV>(functionDataString);
                            List.tVs.Add(tv);
                            deviceFunctionList.Add(tv);
                            break;
                        case SPK.ElectricFan:
                            var fan = Newtonsoft.Json.JsonConvert.DeserializeObject<Fan>(functionDataString);
                            List.fans.Add(fan);
                            deviceFunctionList.Add(fan);
                            break;
                        case SPK.ElectricTuyaAirCleaner:
                            var airCleaner = Newtonsoft.Json.JsonConvert.DeserializeObject<AirCleaner>(functionDataString);
                            List.airCleaners.Add(airCleaner);
                            deviceFunctionList.Add(airCleaner);
                            break;
                        case SPK.ElectricTuyaFan:
                            var tuyaFan = Newtonsoft.Json.JsonConvert.DeserializeObject<Fan>(functionDataString);
                            List.fans.Add(tuyaFan);
                            deviceFunctionList.Add(tuyaFan);
                            break;
                        case SPK.ElectricTuyaWeepRobot:
                            var tuyaWeepRobot = Newtonsoft.Json.JsonConvert.DeserializeObject<WeepRobot>(functionDataString);
                            List.weepRobots.Add(tuyaWeepRobot);
                            deviceFunctionList.Add(tuyaWeepRobot);
                            break;
                        case SPK.ElectricTuyaWaterValve:
                            var tuyaWaterValve = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
                            List.waterValveList.Add(tuyaWaterValve);
                            deviceFunctionList.Add(tuyaWaterValve);
                            break;
                        case SPK.SensorSmoke:
                        case SPK.SensorWater:
                        case SPK.SensorDoorWindow:
                        case SPK.SensorPir:
                            var ser = Newtonsoft.Json.JsonConvert.DeserializeObject<Sensor>(functionDataString);
                            List.sensorsArm.Add(ser);
                            deviceFunctionList.Add(ser);
                            break;
                        case SPK.ClothesHanger:
                            var ch = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
                            List.clothesHangerList.Add(ch);
                            deviceFunctionList.Add(ch);
                            break;
                    }
                }
                Functions.Add(tempFunction);
            }
            if (filePath.StartsWith("SceneData_"))
            {
@@ -273,27 +223,6 @@
        /// </summary>
        public List<Function> GetDeviceFunctionList(SPK.BrandType brandType = SPK.BrandType.All)
        {
            if (deviceFunctionList == null || deviceFunctionList.Count == 0)
            {
                deviceFunctionList = new List<Function>();
                deviceFunctionList.AddRange(aCs);
                deviceFunctionList.AddRange(lights);
                deviceFunctionList.AddRange(curtains);
                deviceFunctionList.AddRange(floorHeatings);
                deviceFunctionList.AddRange(electricals);
                deviceFunctionList.AddRange(sensorsEnvironmentalScience);
                deviceFunctionList.AddRange(sensorsArm);
                deviceFunctionList.AddRange(UI.Music.A31MusicModel.A31MusicModelList);
                try
                {
                    deviceFunctionList = deviceFunctionList.OrderByDescending(o => o.controlCounter).ToList();
                }
                catch (Exception ex)
                {
                    MainPage.Log($"设备功能排序异常:{ex.Message}");
                }
            }
            List<Function> resultFunctions = new List<Function>();
            if (brandType == SPK.BrandType.All)
            {
@@ -303,7 +232,7 @@
                switch (brandType)
                {
                    case SPK.BrandType.Hdl:
                        foreach (var function in deviceFunctionList)
                        foreach (var function in Functions)
                        {
                            if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(function.spk))
                            {
@@ -313,7 +242,7 @@
                        break;
                    case SPK.BrandType.Tuya:
                        foreach (var function in deviceFunctionList)
                        foreach (var function in Functions)
                        {
                            if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(function.spk))
                            {
@@ -325,7 +254,7 @@
                return resultFunctions;
            }
            return deviceFunctionList;
            return Functions;
        }
        /// <summary>
@@ -333,157 +262,8 @@
        /// </summary>
        public void Clear()
        {
            List.aCs = new List<AC>();
            List.lights = new List<Light>();
            List.curtains = new List<Curtain>();
            List.floorHeatings = new List<FloorHeating>();
            List.sensorsEnvironmentalScience = new List<Sensor>();
            #region å®¶ç”µ
            List.fans = new List<Fan>();
            List.switchSockets = new List<SwitchSocket>();
            List.tVs = new List<TV>();
            List.airCleaners = new List<AirCleaner>();
            List.weepRobots = new List<WeepRobot>();
            List.waterValveList = new List<Function>();
            List.clothesHangerList = new List<Function>();
            #endregion
            List.scenes = new List<Scene>();
            List.deviceFunctionList = new List<Function>();
            Functions = new List<Function>();
            _FunctionList = null;
        }
        /// <summary>
        /// æŽ¥æ”¶bus软件上传的功能
        /// tcp方式
        /// </summary>
        /// <param name="sidObj"></param>
        public void AddDeviceFunction(Function sidObj0)
        {
            switch (sidObj0.spk)
            {
                case SPK.AcStandard:
                    var sidObj =  Newtonsoft.Json.JsonConvert.DeserializeObject<AC>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.aCs.Add(sidObj);
                    sidObj.SaveFunctionFile();
                    break;
                case SPK.FloorHeatStandard:
                    var sidObj1 =  Newtonsoft.Json.JsonConvert.DeserializeObject<FloorHeating>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.floorHeatings.Add(sidObj1);
                    sidObj1.SaveFunctionFile();
                    break;
                case SPK.LightDimming:
                case SPK.LightRGB:
                case SPK.LightSwitch:
                    var sidObj2 =  Newtonsoft.Json.JsonConvert.DeserializeObject<Light>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.lights.Add(sidObj2);
                    sidObj2.SaveFunctionFile();
                    break;
                case SPK.CurtainSwitch:
                case SPK.CurtainRoller:
                case SPK.CurtainTrietex:
                    var sidObj3 =  Newtonsoft.Json.JsonConvert.DeserializeObject<Curtain>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.curtains.Add(sidObj3 );
                    sidObj3.SaveFunctionFile();
                    break;
                case SPK.ElectricTV:
                    var sidObj4 =  Newtonsoft.Json.JsonConvert.DeserializeObject<TV>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.tVs.Add(sidObj4);
                    sidObj4.SaveFunctionFile();
                    break;
                case SPK.ElectricSocket:
                    var sidObj5 =  Newtonsoft.Json.JsonConvert.DeserializeObject<SwitchSocket>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.switchSockets.Add(sidObj5);
                    sidObj5.SaveFunctionFile();
                    break;
                case SPK.ElectricFan:
                    var sidObj6 =  Newtonsoft.Json.JsonConvert.DeserializeObject<Fan>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.fans.Add(sidObj6);
                    sidObj6.SaveFunctionFile();
                    break;
                case SPK.SensorCO2:
                case SPK.SensorTVOC:
                case SPK.SensorPm25:
                case SPK.SensorTemperature:
                case SPK.SensorHumidity:
                    var sidObj7 =  Newtonsoft.Json.JsonConvert.DeserializeObject<Sensor>(Newtonsoft.Json.JsonConvert.SerializeObject(sidObj0));
                    List.sensorsEnvironmentalScience.Add(sidObj7);
                    sidObj7.SaveFunctionFile();
                    break;
            }
        }
        /// <summary>
        /// æŽ¥æ”¶bus软件上传的功能
        /// http udp
        /// </summary>
        /// <param name="obj"></param>
        public void AddFunction(object obj)
        {
            var f = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(obj.ToString());
            if (f == null)
                return;
            switch (f.Spk_Prefix)
            {
                case FunctionCategory.AC:
                    switch (f.spk)
                    {
                        case SPK.AcStandard:
                            List.aCs.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<AC>(obj.ToString()));
                            break;
                    }
                    break;
                case FunctionCategory.FloorHeat:
                    switch (f.spk)
                    {
                        case SPK.FloorHeatStandard:
                            List.floorHeatings.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<FloorHeating>(obj.ToString()));
                            break;
                    }
                    break;
                case FunctionCategory.Light:
                    List.lights.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Light>(obj.ToString()));
                    break;
                case FunctionCategory.Curtain:
                    List.curtains.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Curtain>(obj.ToString()));
                    break;
                case FunctionCategory.Electric:
                    switch(f.spk)
                    {
                        case SPK.ElectricTV:
                            List.electricals.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<TV>(obj.ToString()));
                            break;
                        case SPK.ElectricSocket:
                            List.electricals.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<SwitchSocket>(obj.ToString()));
                            break;
                        case SPK.ElectricFan:
                            List.electricals.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Fan>(obj.ToString()));
                            break;
                    }
                    break;
                case FunctionCategory.Sensor:
                    switch (f.spk)
                    {
                        case SPK.SensorTVOC:
                        case SPK.SensorCO2:
                        case SPK.SensorPm25:
                        case SPK.SensorHumidity:
                        case SPK.SensorTemperature:
                            List.sensorsEnvironmentalScience.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Sensor>(obj.ToString()));
                            break;
                        case SPK.SensorWater:
                        case SPK.SensorSmoke:
                        case SPK.SensorGas:
                        case SPK.SensorDryContact:
                        case SPK.SensorShanLan:
                        case SPK.SensorDuiShe:
                        case SPK.SensorPir:
                        case SPK.SensorDoorWindow:
                        case SPK.SensoruUtrasonic:
                            List.sensorsArm.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Sensor>(obj.ToString()));
                            break;
                    }
                    break;
            }
        }
        /// <summary>
@@ -535,69 +315,8 @@
        /// </summary>
        public void DeleteFunction(Function delTemp)
        {
            switch (delTemp.spk)
            {
                case SPK.LightSwitch:
                case SPK.LightDimming:
                case SPK.LightRGB:
                case SPK.LightRGBW:
                case SPK.LightCCT:
                    List.lights.Remove(List.lights.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.CurtainRoller:
                case SPK.CurtainShades:
                case SPK.CurtainSwitch:
                case SPK.CurtainTrietex:
                    List.curtains.Remove(List.curtains.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.AcStandard:
                    List.aCs.Remove(List.aCs.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.FloorHeatStandard:
                    List.floorHeatings.Remove(List.floorHeatings.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.SensorPm25:
                case SPK.SensorCO2:
                case SPK.SensorTVOC:
                case SPK.SensorTemperature:
                case SPK.SensorHumidity:
                    List.sensorsEnvironmentalScience.Remove(List.sensorsEnvironmentalScience.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.ElectricSocket:
                    List.switchSockets.Remove(List.switchSockets.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.ElectricTV:
                    List.tVs.Remove(List.tVs.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.ElectricFan:
                case SPK.ElectricTuyaFan:
                    List.fans.Remove(List.fans.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.ElectricTuyaAirCleaner:
                    List.airCleaners.Remove(List.airCleaners.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.ElectricTuyaWaterValve:
                    List.waterValveList.Remove(List.waterValveList.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.ElectricTuyaWeepRobot:
                    List.weepRobots.Remove(List.weepRobots.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.ClothesHanger:
                    List.clothesHangerList.Remove(List.clothesHangerList.Find((obj) => obj.deviceId == delTemp.deviceId));
                    break;
                case SPK.SensorSmoke:
                case SPK.SensorWater:
                case SPK.SensorDoorWindow:
                case SPK.SensorPir:
                    List.sensorsArm.Remove(List.sensorsArm.Find((obj)=>obj.deviceId == delTemp.deviceId));
                    break;
            }
            var removeTemp = deviceFunctionList.Find((obj) => obj.deviceId == delTemp.deviceId);
            if(removeTemp!= null)
            {
                deviceFunctionList.Remove(removeTemp);
            }
            Common.FileUtlis.Files.DeleteFile(delTemp.savePath);
            Functions.Remove(Functions.Find((obj) => obj.deviceId == delTemp.deviceId));
            FileUtlis.Files.DeleteFile(delTemp.savePath);
        }
        bool lockReadFunctionStatus = false;
@@ -762,195 +481,9 @@
        #endregion 
        #region åŠŸèƒ½æ–‡æœ¬ç›¸å…³
        /// <summary>
        /// å±žæ€§åç§°æ˜¾ç¤ºæ–‡æœ¬
        /// ä¸­è‹±æ–‡æ˜¾ç¤º
        /// </summary>
        public string GetNameText(string key)
        {
            string text = "";
            switch (key)
            {
                case FunctionAttributeKey.OnOff:
                    text = Language.StringByID(StringId.OnOff);
                    break;
                case FunctionAttributeKey.Brightness:
                    text = Language.StringByID(StringId.Brightness);
                    break;
                case FunctionAttributeKey.RGB:
                    text = Language.StringByID(StringId.ColorValue);
                    break;
                case FunctionAttributeKey.Mode:
                    text = Language.StringByID(StringId.Mode);
                    break;
                case FunctionAttributeKey.FanSpeed:
                    text = Language.StringByID(StringId.FanSpeed);
                    break;
                case FunctionAttributeKey.SetTemp:
                    text = Language.StringByID(StringId.Temp);
                    break;
                case FunctionAttributeKey.IndoorTemp:
                    text = Language.StringByID(StringId.IndoorTemp);
                    break;
                case FunctionAttributeKey.Delay:
                    text = Language.StringByID(StringId.Delay);
                    break;
                case FunctionAttributeKey.CCT:
                    text = "CCT";
                    break;
                case FunctionAttributeKey.Percent:
                    text = Language.StringByID(StringId.PercentAdjustment);
                    break;
                case FunctionAttributeKey.FadeTime:
                    text = Language.StringByID(StringId.FadeSpeed);
                    break;
            }
            return text;
        }
        #region
        /// <summary>
        /// å±žæ€§å€¼å•位
        /// </summary>
        public string GetUintString(string key)
        {
            var us = "";
            switch (key)
            {
                case FunctionAttributeKey.SetTemp:
                case FunctionAttributeKey.IndoorTemp:
                    us = "°C";
                    break;
                case FunctionAttributeKey.Percent:
                case FunctionAttributeKey.Brightness:
                    us = "%";
                    break;
            }
            return us;
        }
        /// <summary>
        /// èŽ·å–æŒ‡å®šå±žæ€§çš„æ˜¾ç¤ºæ–‡æœ¬
        /// ä¸­è‹±æ–‡æ˜¾ç¤º
        /// </summary>
        public string GetValueText(string key, string value)
        {
            string text = "";
            switch (key)
            {
                case FunctionAttributeKey.OnOff:
                    text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF);
                    break;
                case FunctionAttributeKey.SetTemp:
                case FunctionAttributeKey.IndoorTemp:
                case FunctionAttributeKey.Brightness:
                case FunctionAttributeKey.Percent:
                    if (value == "")
                    {
                        value = "0";
                    }
                    text = value;
                    break;
                case FunctionAttributeKey.Mode:
                    switch (value)
                    {
                        //----空调
                        case "auto":
                            text = Language.StringByID(StringId.Auto);
                            break;
                        case "cool":
                            text = Language.StringByID(StringId.Cool);
                            break;
                        case "heat":
                            text = Language.StringByID(StringId.Heat);
                            break;
                        case "dry":
                            text = Language.StringByID(StringId.Dry);
                            break;
                        case "fan":
                            text = Language.StringByID(StringId.AirSupply);
                            break;
                        //-----地热
                        case "day":
                            text = Language.StringByID(StringId.Day);
                            break;
                        case "night":
                            text = Language.StringByID(StringId.Night);
                            break;
                        case "away":
                            text = Language.StringByID(StringId.Away);
                            break;
                        case "normal":
                            text = Language.StringByID(StringId.Normal);
                            break;
                        case "timer":
                            text = Language.StringByID(StringId.Timer);
                            break;
                    }
                    break;
                case FunctionAttributeKey.FanSpeed:
                    switch (value)
                    {
                        case "high":
                            text = Language.StringByID(StringId.HighWindSpeed);
                            break;
                        case "medium":
                            text = Language.StringByID(StringId.MiddleWindSpeed);
                            break;
                        case "low":
                            text = Language.StringByID(StringId.LowWindSpeed);
                            break;
                        case "auto":
                            text = Language.StringByID(StringId.Auto);
                            break;
                        default:
                            text = "low";
                            break;
                    }
                    break;
                case "high":
                    text = Language.StringByID(StringId.HighWindSpeed);
                    break;
                case "medium":
                    text = Language.StringByID(StringId.MiddleWindSpeed);
                    break;
                case "low":
                    text = Language.StringByID(StringId.LowWindSpeed);
                    break;
                case "auto":
                    text = Language.StringByID(StringId.Auto);
                    break;
            }
            return text;
        }
        /// <summary>
        /// å»¶æ—¶æ˜¾ç¤ºçš„æ–‡æœ¬
        /// </summary>
        public string GetDelayText(string delay)
        {
            string text = "";
            switch (delay)
            {
                case "0":
                    text = Language.StringByID(StringId.NoDelay);
                    break;
                case "30":
                    text = "30s";
                    break;
                case "60":
                    text = "1min";
                    break;
                case "120":
                    text = "2min";
                    break;
                case "300":
                    text = "5min";
                    break;
            }
            return text;
        }
        #endregion
    }
HDL_ON/Entity/Room.cs
@@ -74,10 +74,11 @@
        {
            var roomUpdateList = spatials.FindAll((obj) => obj.roomType == "ROOM");
            var floorUpdateList = spatials.FindAll((obj) => obj.roomType == "FLOOR");
            CurrentSpatial.DeleteAllRoom();
            FloorList.Clear();
            //处理房间列表
            if (roomUpdateList != null && roomUpdateList.Count > 0)
            {
                CurrentSpatial.DeleteAllRoom();
                foreach (var newRoom in roomUpdateList)
                {
                    newRoom.SaveRoomFile();
@@ -88,7 +89,6 @@
            //楼层房间列表
            if (floorUpdateList != null && floorUpdateList.Count > 0)
            {
                FloorList.Clear();
                foreach (var updateTemp in floorUpdateList)
                {
                    FloorList.Add(updateTemp);
@@ -325,9 +325,10 @@
        /// </summary>
        public void DeleteAllRoom()
        {
            foreach(var localRoom in RoomList)
            for(int i=0;i< RoomList.Count;)
            {
                Common.FileUtlis.Files.DeleteFile(localRoom.dataSavePath);
                Common.FileUtlis.Files.DeleteFile(RoomList[i].dataSavePath);
                RoomList.RemoveAt(i);
            }
            rooms = null;
        }
HDL_ON/HDL_ON.projitems
@@ -336,7 +336,6 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorWaterImmersionPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorDoorWinwsPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorSmokePage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\DeviceFunction.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Entity\Enumerative\ClothsHangerEnum.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\PirMain.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\TopView.cs" />
@@ -355,6 +354,9 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Method.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\FailView.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\ReplicationView.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\ClothesHangerSetTimePage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\ArmSensorHistroyPaging.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\AC\AcControlPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Matching.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\PirNameView.cs" />
  </ItemGroup>
HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
        /// <summary>
        /// ç‰ˆæœ¬å·
        /// </summary>
        public static string VersionString = "1.1.0225";
        public static string VersionString = "1.1.0305";
        ///// <summary>
        ///// å®¢æˆ·ç«¯ç±»åž‹
        ///// </summary>
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -11,7 +11,8 @@
        /// <summary>
        /// åŠŸèƒ½æŽ§åˆ¶ç•Œé¢è·³è½¬äº‹ä»¶
        /// </summary>
        public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function,Button btnCollectionIcon, Button btnName, Button btnFromFloor)
        public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function, Button btnCollectionIcon, Button btnName, Button btnFromFloor
            )
        {
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
@@ -20,77 +21,61 @@
                switch (function.spk)
                {
                    case SPK.LightSwitch:
                        if (function.spk == SPK.ElectricSocket)
                        {
                            var s1View = new SocketPage(function as SwitchSocket);
                            MainPage.BasePageView.AddChidren(s1View);
                            s1View.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        }
                        else
                        {
                            var relayView = new RelayPage(function as Light);
                            MainPage.BasePageView.AddChidren(relayView);
                            relayView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        }
                        var relayView = new RelayPage(function);
                        MainPage.BasePageView.AddChidren(relayView);
                        relayView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.LightRGB:
                        var rgbView = new RGBPage(function as Light);
                        var rgbView = new RGBPage(function);
                        MainPage.BasePageView.AddChidren(rgbView);
                        rgbView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.LightDimming:
                        var dimmerView = new DimmerPage(function as Light);
                        var dimmerView = new DimmerPage(function);
                        MainPage.BasePageView.AddChidren(dimmerView);
                        dimmerView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.CurtainTrietex:
                        var skinView = new MotorCurtainPage(function as Curtain);
                        var skinView = new MotorCurtainPage(function);
                        MainPage.BasePageView.AddChidren(skinView);
                        skinView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.CurtainSwitch:
                        var curtainView = new CurtainModulePage(function as Curtain);
                        var curtainView = new CurtainModulePage(function);
                        MainPage.BasePageView.AddChidren(curtainView);
                        curtainView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.CurtainRoller:
                        var rollingShutterView = new RollingShutterPage(function as Curtain);
                        var rollingShutterView = new RollingShutterPage(function);
                        MainPage.BasePageView.AddChidren(rollingShutterView);
                        rollingShutterView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.AcStandard:
                        var acView = new ACPage(function as AC);
                        MainPage.BasePageView.AddChidren(acView);
                        acView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.FloorHeatStandard:
                        var fhView = new FloorHeatingPage(function as FloorHeating);
                        var fhView = new FloorHeatingPage(function);
                        MainPage.BasePageView.AddChidren(fhView);
                        fhView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.ElectricFan:
                        var fanView = new FanPage(function as Fan);
                        var fanView = new FanPage(function);
                        MainPage.BasePageView.AddChidren(fanView);
                        fanView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.ElectricSocket:
                        var sView = new SocketPage(function as SwitchSocket);
                        var sView = new SocketPage(function);
                        MainPage.BasePageView.AddChidren(sView);
                        sView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.ElectricTV:
                        var tvView = new TVPage(function as TV);
                        var tvView = new TVPage(function);
                        MainPage.BasePageView.AddChidren(tvView);
                        tvView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -114,12 +99,12 @@
                    case SPK.MusicStandard:
                        Music.A31MusicModel.Current = (function as Music.A31MusicModel);//当前播放器
                        var a31PlayMusicPage = new Music.A31PlayMusicPage();
                            MainPage.BasePageView.AddChidren(a31PlayMusicPage);
                            a31PlayMusicPage.Show();
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        MainPage.BasePageView.AddChidren(a31PlayMusicPage);
                        a31PlayMusicPage.Show();
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.LightCCT:
                        var TureView = new ColorTureLampPage(function as Light);
                        var TureView = new ColorTureLampPage(function);
                        MainPage.BasePageView.AddChidren(TureView);
                        TureView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -148,9 +133,14 @@
                        var clothesHangerpage = new ClothesHangerPage();
                        clothesHangerpage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
                        break;
                    case SPK.IrAC:
                    case SPK.AcStandard:
                        var acPage = new AcControlPage();
                        acPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
                        break;
                }
            };
            return eventHandler;
        }
    }
}
}
HDL_ON/UI/UI0-Public/UpdataSidDataDialog.cs
@@ -44,9 +44,8 @@
                    //sidObj.bus.LoopId = Convert.ToByte(sidObj.sid.Substring(20, 4),16);
                    sidObj.bus.loopId = sidObj.sid.Substring(20, 4);
                }
                FunctionList.List.AddDeviceFunction(sidObj);
                //FunctionList.List.AddDeviceFunction(sidObj);
            }
            //MainPage.GoUserPage();
        }
    }
HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
old mode 100755 new mode 100644
HDL_ON/UI/UI0-Stan/Controls/BottomControls/BottomDialogCommon.cs
@@ -57,7 +57,6 @@
            var dialogBody = new NormalFrameLayout();
            FrameDialog.AddChidren(dialogBody);
            FrameDialog.Show();
            dialogBody.ButtonClickEvent += (sender, e) =>
            {
                if (ClickBackClose == true && this.btnCancel != null)
@@ -69,7 +68,7 @@
            //白色背景
            var frameWhiteBack = new NormalFrameLayout();
            frameWhiteBack.Width = Application.GetRealWidth(343);
            frameWhiteBack.Height = RowHeight * (RowCount + 1);
            frameWhiteBack.Height =  RowHeight * (RowCount + 1);
            frameWhiteBack.Radius = (uint)Application.GetRealWidth(12);
            frameWhiteBack.Gravity = Gravity.CenterHorizontal;
            frameWhiteBack.Y = dialogBody.Height - RowHeight * (RowCount + 1) - Application.GetRealHeight(20);
@@ -106,6 +105,8 @@
            btnConfirm.TextSize = CSS_FontSize.TextFontSize;
            frameWhiteBack.AddChidren(btnConfirm);
            FrameDialog.Show();
            return frameWhiteBack;
        }
HDL_ON/UI/UI0-Stan/Controls/BottomControls/BottomTimeSelectControl.cs
@@ -17,6 +17,26 @@
        /// ç»“束事件(0:点击了取消  1:点击了确定,第二,三参数为时和分)
        /// </summary>
        public Action<int, int, int> FinishEvent = null;
        /// <summary>
        /// å°æ—¶å–值范围
        /// </summary>
        List<int> hRange = new List<int>();
        /// <summary>
        /// åˆ†é’Ÿå–值范围
        /// </summary>
        List<int> mRange = new List<int>();
        /// <summary>
        /// æ—¶é—´æŽ§ä»¶
        /// </summary>
        UIPickerView pickerView;
        //选择的时与分
        int selectHour = 0;
        int selectMinute = 0;
        //XX时
        List<string> listHour ;
        //XX分
        List<string> listMinute;
        #endregion
@@ -30,7 +50,35 @@
        public BottomTimeSelectControl(string i_title = "", bool clickBackClose = true)
        {
            base.ClickBackClose = clickBackClose;
            base.StrTitle = i_title;
            for (int i = 0; i <= 23; i++)
            {
                hRange.Add(i);
            }
            for (int i = 0; i <= 59; i++)
            {
                mRange.Add(i);
            }
        }
        /// <summary>
        /// åº•部时间选择控件
        /// </summary>
        /// <param name="i_title">标题</param>
        /// <param name="clickBackClose">点击背景时,是否关闭弹窗</param>
        public BottomTimeSelectControl(List<int> hoursRange,List<int> minuteRange ,int rowCount, string i_title = "", bool clickBackClose = true)
        {
            base.ClickBackClose = clickBackClose;
            base.StrTitle = i_title;
            hRange = hoursRange;
            mRange = minuteRange;
            base.RowCount = rowCount;
        }
        /// <summary>
@@ -38,19 +86,16 @@
        /// </summary>
        /// <param name="i_hour">默认选择时</param>
        /// <param name="i_minute">默认选择分</param>
        public void InitControl(int i_hour, int i_minute)
        /// <param name="contentView">选择区域高度</param>
        public void InitControl(int i_hour, int i_minute,int contentView = 297)
        {
            //已经初始化
            if (base.btnCancel != null) { return; }
            //初始化底层控件
            var frameWhiteBack = base.InitBaseControl();
            frameWhiteBack.Height = Application.GetRealHeight(297);
            frameWhiteBack.Y = frameWhiteBack.Parent.Height - Application.GetRealHeight(297 + 20);
            //选择的时与分
            int selectHour = 0;
            int selectMinute = 0;
            frameWhiteBack.Height = Application.GetRealHeight(contentView);
            //frameWhiteBack.Y = frameWhiteBack.Parent.Height - Application.GetRealHeight(297 + 20);
            //取消
            base.btnCancel.ButtonClickEvent += (sender, e) =>
@@ -78,22 +123,24 @@
            frameWhiteBack.AddChidren(btnLine);
            //时间控件
            var pickerView = new UIPickerView();
            pickerView = new UIPickerView();
            //时
            var strhour = Language.StringByID(StringId.h);
            //分
            var strMinute = Language.StringByID(StringId.m);
            //XX时
            var listHour = new List<string> { "00" + strhour };
            listHour = new List<string>();// { "00" + strhour };
            //XX分
            var listMinute = new List<string> { "00" + strMinute };
            for (int i = 1; i <= 23; i++)
            listMinute = new List<string>();// { "00" + strMinute };
            //for (int i = 1; i <= 23; i++)
            foreach(var hItem in hRange)
            {
                listHour.Add(i.ToString().PadLeft(2, '0') + strhour);
            }
            for (int i = 1; i <= 59; i++)
                listHour.Add(hItem.ToString().PadLeft(2, '0') + strhour);
            }
            //for (int i = 1; i <= 59; i++)
            foreach (var mItem in mRange)
            {
                listMinute.Add(i.ToString().PadLeft(2, '0') + strMinute);
                listMinute.Add(mItem.ToString().PadLeft(2, '0') + strMinute);
            }
            pickerView.Height = frameWhiteBack.Height - btnLine.Bottom;
            pickerView.Width = frameWhiteBack.Width - Application.GetRealWidth(8) * 2;
@@ -117,6 +164,32 @@
            };
        }
        /// <summary>
        /// ç‰¹æ®Šçš„集合选择事件,凉霸时间设置使用
        /// </summary>
        public void ChangePickerEvent()
        {
            pickerView.OnSelectChangeEvent = (value1, value2, value3) =>
            {
                if (value1 == 0 && value2 == 0)
                {
                    value2 = 1;
                    pickerView.setCurrentItems(value1, value2, 0);
                }
                else if (value1 == 4 && value2 == 1)
                {
                    value2 = 0;
                    pickerView.setCurrentItems(value1, value2, 0);
                }
                else
                {
                    //更改索引
                    selectHour = Convert.ToInt32(listHour[value1].Substring(0, 2));
                    selectMinute = Convert.ToInt32(listMinute[value2].Substring(0, 2));
                }
            };
        }
        #endregion
        #region â–  ä¸€èˆ¬æ–¹æ³•___________________________
HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs
old mode 100755 new mode 100644
HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs
@@ -45,24 +45,27 @@
            {
                foreach (var attr in updateData)
                {
                    var localAttr2 = localDevice.attributes.Find((obj) => obj.key == attr.key);
                    if (localAttr2 == null)
                    {
                        //本身它就没有这个属性,则不处理
                        continue;
                    }
                    //更改属性值
                    localAttr2.curValue = attr.value;
                    //var localAttr2 = localDevice.attributes.Find((obj) => obj.key == attr.key);
                    //if (localAttr2 == null)
                    //{
                    //    //本身它就没有这个属性,则不处理
                    //    continue;
                    //}
                    ////更改属性值
                    //localAttr2.curValue = attr.value;
                    var localAttr = localDevice.status.Find((obj) => obj.key == attr.key);
                    if (localAttr == null)
                    {
                        //status是当前设备上报过的属性才会存在,也就是它的个数有可能和attributes不一致
                        localAttr = new AttributesStatus() { key = attr.key, value = attr.value };
                        localDevice.status.Add(localAttr);
                    }
                    //更改属性值
                    localAttr.value = attr.value;
                    //var localAttr = localDevice.status.Find((obj) => obj.key == attr.key);
                    //if (localAttr == null)
                    //{
                    //    //status是当前设备上报过的属性才会存在,也就是它的个数有可能和attributes不一致
                    //    localAttr = new AttributesStatus() { key = attr.key, value = attr.value };
                    //    localDevice.status.Add(localAttr);
                    //}
                    ////更改属性值
                    //localAttr.value = attr.value;
                    localDevice.SetAttrState(attr.key, attr.value);
                }
                //全部界面推送
                HdlFormLogic.Current.DeviceStatuPush(localDevice);
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -192,11 +192,13 @@
                //return;
                if (b)
                {
                    etAccount.Text = "13415629083";// "13415629083"//cf;//tujie"18316120654";// "15622703419";// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568
                    etAccount.Text = "18316672920";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
                    // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568
                }
                else
                {
                    etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374
                    etAccount.Text = "15971583093";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374
                    //15971583093 gs
                }
                b = !b;
                etPassword.Text = "123456";
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -459,7 +459,6 @@
        /// </summary>
        void LoadDeviceFunctionControlZone()
        {
            #region ContextView
            deviceFunctionView.RemoveAll();
            functionViews.Clear();
@@ -769,7 +768,7 @@
                    };
                    view.AddChidren(btnCurtainOpen);
                    LoadEvent_ControlCurtain(function as Curtain, btnCurtainClose, btnCurtainOpen);
                    LoadEvent_ControlCurtain(function, btnCurtainClose, btnCurtainOpen);
                }
                else if (function.spk == SPK.ElectricTV)
@@ -785,7 +784,7 @@
                        UnSelectedImagePath = "Public/PowerClose.png",
                    };
                    view.AddChidren(btnPower);
                    LoadEvent_ControlTV(function as TV, btnPower);
                    LoadEvent_ControlTV(function, btnPower);
                }
                else if (function.spk == SPK.MusicStandard)
@@ -885,7 +884,7 @@
                            #region ç¯å…‰ Light
                            btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightIcon.png";
                            btnIcon.SelectedImagePath = "FunctionIcon/Light/LightOnIcon.png";
                            UpdataFunctionStates(function as Light);
                            UpdataFunctionStates(function);
                            #endregion
                            break;
                        case FunctionCategory.AC:
@@ -948,6 +947,7 @@
                    function.CollectFunction();
                };
                var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone);
                view.MouseUpEventHandler = skipControlPageEvent;
                btnName.MouseUpEventHandler = skipControlPageEvent;
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -21,6 +21,16 @@
                bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25;
            }
        }
        /// <summary>
        /// æ›´æ–°åŠŸèƒ½åˆ—è¡¨ä¸»é¡µ
        /// </summary>
        public static void RefreshFunctionView()
        {
            if (bodyView != null)
            {
                bodyView.LoadDeviceFunctionControlZone();
            }
        }
        /// <summary>
        /// æ›´æ–°è¿žæŽ¥çŠ¶æ€å›¾æ ‡
@@ -163,7 +173,7 @@
        /// </summary>
        public static void UpdataFunctionStates(Function function)
        {
            Application.RunOnMainThread((Action)(() =>
            Application.RunOnMainThread(() =>
            {
                try
                {
@@ -173,7 +183,16 @@
                        {
                            if (view.Tag.ToString() == function.sid)
                            {
                                var state = function.trait_on_off.curValue.ToString() == "on";
                                var state = false;
                                if (function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || function.spk == SPK.CurtainTrietex ||
                                function.spk == SPK.CurtainSwitch)//窗帘设备根据百分比判断开关状态
                                {
                                    state = function.GetAttrState(FunctionAttributeKey.Percent) != "0";
                                }
                                else
                                {
                                    state = function.trait_on_off.curValue.ToString() == "on";
                                }
                                for (int i = 0; i < view.ChildrenCount; i++)
                                {
                                    if (view.GetChildren(i).GetType() == typeof(Button))
@@ -204,7 +223,7 @@
                {
                    MainPage.Log($"HomePage updata funciton states error {ex.Message}");
                }
            }));
            });
        }
        /// <summary>
@@ -284,18 +303,17 @@
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB)
                    {
                        var light = function as Light;
                        d.Add(FunctionAttributeKey.OnOff, light.trait_on_off.curValue.ToString());
                        d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                        if (btnSwitch.IsSelected)
                        {
                            d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString());
                            d.Add(FunctionAttributeKey.Brightness, function.lastBrightness.ToString());
                        }
                        else
                        {
                            light.lastBrightness = light.brightness;
                            function.lastBrightness = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness));
                        }
                        d.Add(FunctionAttributeKey.FadeTime, light.fadeTime.ToString());
                        Control.Ins.SendWriteCommand(light, d);
                        d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                        Control.Ins.SendWriteCommand(function, d);
                    }
                    else
                    {
@@ -312,44 +330,36 @@
        /// </summary>
        /// <param name="tV"></param>
        /// <param name="button"></param>
        void LoadEvent_ControlTV(TV tV, Button button)
        void LoadEvent_ControlTV(Function tV, Button button)
        {
            button.MouseUpEventHandler = (sender, e) =>
            {
                tV.ControlTV(InfraredCode_TV.Power);
                new TV().ControlTV(InfraredCode_TV.Power, tV);
            };
        }
        /// <summary>
        /// åŠ è½½çª—å¸˜æŽ§åˆ¶äº‹ä»¶
        /// </summary>
        void LoadEvent_ControlCurtain(Curtain curtain, Button btnClose, Button btnOpen)
        void LoadEvent_ControlCurtain(Function curtain, Button btnClose, Button btnOpen)
        {
            btnClose.MouseDownEventHandler = (sender, e) =>
            {
                btnClose.IsSelected = true;
            };
            btnClose.MouseUpEventHandler = (sender, e) =>
            {
                btnClose.IsSelected = false;
                btnClose.IsSelected = true;
                curtain.trait_on_off.curValue = "off";
                curtain.percent = 0;
                curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
            btnOpen.MouseDownEventHandler = (sender, e) =>
            {
                btnOpen.IsSelected = true;
            };
            btnOpen.MouseUpEventHandler = (sender, e) =>
            {
                btnOpen.IsSelected = false;
                btnOpen.IsSelected = true;
                curtain.trait_on_off.curValue = "on";
                curtain.percent = 100;
                curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
        }
@@ -365,7 +375,15 @@
            };
            btnUp.MouseUpEventHandler = (sender, e) =>
            {
                btnUp.IsSelected = false;
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnUp.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.SetAttrState(FunctionAttributeKey.Position, "up");
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Position, "up");
@@ -378,7 +396,15 @@
            };
            btnDown.MouseUpEventHandler = (sender, e) =>
            {
                btnDown.IsSelected = false;
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnDown.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.SetAttrState(FunctionAttributeKey.Position, "down");
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Position, "down");
HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
@@ -58,6 +58,7 @@
                                        case FunctionCategory.Light:
                                        case FunctionCategory.AC:
                                        case FunctionCategory.FloorHeat:
                                        case FunctionCategory.Electric:
                                            #region æŒ‰é’®çŠ¶æ€æ›´æ–°
                                            if (cTag == updataFunction.sid + "_Switch")
                                            {
@@ -76,14 +77,13 @@
                                            {
                                                try
                                                {
                                                    (fcView.GetChildren(j) as DiyImageSeekBar).Progress = Convert.ToInt32(updataFunction.GetAttrState(FunctionAttributeKey.Brightness));
                                                    if (updataFunction.trait_on_off.curValue.ToString() == "on")
                                                    {
                                                        (fcView.GetChildren(j) as DiyImageSeekBar).Progress = (updataFunction as Light).brightness;
                                                        (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
                                                    }
                                                    else
                                                    {
                                                        (fcView.GetChildren(j) as DiyImageSeekBar).Progress = (updataFunction as Light).brightness;
                                                        (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.PromptingColor2;
                                                    }
                                                }
@@ -110,10 +110,14 @@
                                        #endregion
                                        case FunctionCategory.Curtain:
                                            #region çª—帘更新
                                            var uCurtain = updataFunction as Curtain;
                                            switch (uCurtain.trait_on_off.curValue.ToString())
                                            //var uCurtain = updataFunction as Curtain;
                                            var percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent);
                                            if (percentString != null)
                                            {
                                                case "off":
                                                int percent = 0;
                                                int.TryParse(percentString, out percent);
                                                if (percent == 0)
                                                {
                                                    if (cTag == updataFunction.sid + "_off")
                                                    {
                                                        try
@@ -126,8 +130,9 @@
                                                    {
                                                        (fcView.GetChildren(j) as Button).IsSelected = false;
                                                    }
                                                    break;
                                                case "on":
                                                }
                                                else
                                                {
                                                    if (cTag == updataFunction.sid + "_on")
                                                    {
                                                        try
@@ -140,21 +145,7 @@
                                                    {
                                                        (fcView.GetChildren(j) as Button).IsSelected = false;
                                                    }
                                                    break;
                                                case "stop":
                                                    if (cTag == updataFunction.sid + "_stop")
                                                    {
                                                        try
                                                        {
                                                            (fcView.GetChildren(j) as Button).IsSelected = true;
                                                        }
                                                        catch { }
                                                    }
                                                    else
                                                    {
                                                        (fcView.GetChildren(j) as Button).IsSelected = false;
                                                    }
                                                    break;
                                                }
                                            }
                                            #endregion
                                            break;
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -442,41 +442,41 @@
                {
                    case ShowFunction.Light:
                        #region Light
                        functionCount = FunctionList.List.lights.Count;
                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetLightList().Count;
                        functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.AC:
                        #region AC
                        functionCount = FunctionList.List.aCs.Count;
                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetAcList().Count;
                        functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.Curtain:
                        #region Curtain
                        functionCount = FunctionList.List.curtains.Count;
                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetCurtainList().Count;
                        functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.FloorHeating:
                        #region åœ°çƒ­
                        functionCount = FunctionList.List.floorHeatings.Count;
                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetFloorHeatingList().Count;
                        functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.DoorLock:
                        break;
                    case ShowFunction.Electric:
                        #region ç”µå™¨
                        functionCount = FunctionList.List.electricals.Count;
                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetElectricals().Count;
                        functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.EnergyMonitoring:
                        break;
                    case ShowFunction.Environmental:
                        #region çŽ¯å¢ƒæ•°æ®
                        functionCount = FunctionList.List.sensorsEnvironmentalScience.Count;
                        functionCount = FunctionList.List.GetEnvirSensorsList().Count;
                        #endregion
                        break;
                    case ShowFunction.FreshAir:
@@ -491,7 +491,7 @@
                        functionCount = 1;
                        break;
                    case ShowFunction.Sensor:
                        functionCount = FunctionList.List.sensorsArm.Count;
                        functionCount = FunctionList.List.GetArmSensorList().Count;
                        break;
                    case ShowFunction.VideoIntercom:
                        break;
@@ -597,8 +597,6 @@
                    case ShowFunction.Light:
                        #region Light
                        btnName.TextID = StringId.Lights;
                        functionCount = FunctionList.List.lights.Count;
                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnLightPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -623,8 +621,6 @@
                    case ShowFunction.AC:
                        #region AC
                        btnName.TextID = StringId.AC;
                        functionCount = FunctionList.List.aCs.Count;
                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnAcPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -647,8 +643,6 @@
                    case ShowFunction.Curtain:
                        #region Curtain
                        btnName.TextID = StringId.Curtain;
                        functionCount = FunctionList.List.curtains.Count;
                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnClose;
                        btnClose = new Button()
                        {
@@ -682,8 +676,6 @@
                    case ShowFunction.FloorHeating:
                        #region åœ°çƒ­
                        btnName.TextID = StringId.FloorHeating;
                        functionCount = FunctionList.List.floorHeatings.Count;
                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnFhPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -709,8 +701,6 @@
                    case ShowFunction.Electric:
                        #region ç”µå™¨
                        btnName.TextID = StringId.Electric;
                        functionCount = FunctionList.List.electricals.Count;
                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnElectricPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -750,8 +740,6 @@
                        break;
                    case ShowFunction.Music:
                        btnName.TextID = StringId.Music;
                        functionCount = Music.A31MusicModel.A31MusicModelList.Count;
                        functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                        {
                            var musicMain = new Music.MusicMain();
@@ -767,10 +755,11 @@
                        btnName.TextID = StringId.SecurityMonitoring;
                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                        {
#if __IOS__
                            EZSDK.IOS.EZSDK.Go2EZvizMonitor();
#else  //安卓摄像头
                            HDLCommon.Current.Go2EZvizMonitor(bodyView);
#endif
                        };
                        break;
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -17,7 +17,7 @@
        /// <param name="function"></param>
        public static void UpdataInfo(Function function)
        {
            Application.RunOnMainThread((Action)(() => {
            Application.RunOnMainThread(() => {
                if (bodyView == null)
                    return;
                try
@@ -48,6 +48,7 @@
                        case SPK.ElectricTuyaFan:
                        case SPK.ElectricTuyaWaterValve:
                        case SPK.ElectricTuyaWeepRobot:
                        case SPK.ClothesHanger:
                            vv = ShowFunction.Electric;
                            break;
                    }
@@ -57,7 +58,7 @@
                catch
                {
                }
            }));
            });
        }
        /// <summary>
@@ -99,51 +100,32 @@
                                                var btn = view3.GetChildren(o) as Button;
                                                if (btn.Tag != null)
                                                {
                                                    string btnText = "0";
                                                    switch (functionCategory)
                                                    {
                                                        case ShowFunction.FloorHeating:
                                                            btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.AC:
                                                            btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Curtain:
                                                            btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Light:
                                                            btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Electric:
                                                            btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            break;
                                                    }
                                                    if (btn.Tag.ToString() == functionCategory + "_onCount")
                                                    {
                                                        string btnText = "0";
                                                        switch (functionCategory)
                                                        {
                                                            case ShowFunction.FloorHeating:
                                                                btnText = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                                break;
                                                            case ShowFunction.AC:
                                                                btnText = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                                break;
                                                            case ShowFunction.Curtain:
                                                                btnText = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                                break;
                                                            case ShowFunction.Light:
                                                                btnText = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                                break;
                                                            case ShowFunction.Electric:
                                                                btnText = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                                break;
                                                        }
                                                        btn.Text = btnText;
                                                    }
                                                    else if (btn.Tag.ToString() == functionCategory + "_AllControl")
                                                    {
                                                        var openCount = 0;
                                                        switch (functionCategory)
                                                        {
                                                            case ShowFunction.FloorHeating:
                                                                openCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                                                                break;
                                                            case ShowFunction.AC:
                                                                openCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                                                                break;
                                                            case ShowFunction.Curtain:
                                                                openCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                                                                break;
                                                            case ShowFunction.Light:
                                                                openCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                                                                break;
                                                            case ShowFunction.Electric:
                                                                openCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                                                                break;
                                                        }
                                                        btn.IsSelected = openCount != 0;
                                                        btn.IsSelected = btnText != "0";
                                                    }
                                                }
                                            }
@@ -349,7 +331,7 @@
                            switch (functionCategory)
                            {
                                case ShowFunction.AC:
                                    foreach (var f in FunctionList.List.aCs)
                                    foreach (var f in FunctionList.List.GetAcList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
@@ -359,7 +341,7 @@
                                    }
                                    break;
                                case ShowFunction.FloorHeating:
                                    foreach (var f in FunctionList.List.floorHeatings)
                                    foreach (var f in FunctionList.List.GetFloorHeatingList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
@@ -369,7 +351,7 @@
                                    }
                                    break;
                                case ShowFunction.Light:
                                    foreach (var f in FunctionList.List.lights)
                                    foreach (var f in FunctionList.List.GetLightList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
@@ -379,7 +361,7 @@
                                    }
                                    break;
                                case ShowFunction.Electric:
                                    foreach (var f in FunctionList.List.electricals)
                                    foreach (var f in FunctionList.List.GetElectricals())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
@@ -396,7 +378,7 @@
                            {
                                case ShowFunction.AC:
                                    List<Function> acList = new List<Function>();
                                    foreach(var f in FunctionList.List.aCs)
                                    foreach(var f in FunctionList.List.GetAcList())
                                    {
                                        acList.Add(f);
                                    }
@@ -404,7 +386,7 @@
                                    break;
                                case ShowFunction.FloorHeating:
                                    List<Function> fhList = new List<Function>();
                                    foreach (var f in FunctionList.List.floorHeatings)
                                    foreach (var f in FunctionList.List.GetFloorHeatingList())
                                    {
                                        fhList.Add(f);
                                    }
@@ -412,7 +394,7 @@
                                    break;
                                case ShowFunction.Light:
                                    List<Function> lightList = new List<Function>();
                                    foreach (var f in FunctionList.List.lights)
                                    foreach (var f in FunctionList.List.GetLightList())
                                    {
                                        lightList.Add(f);
                                    }
@@ -420,7 +402,7 @@
                                    break;
                                case ShowFunction.Electric:
                                    List<Function> eleList = new List<Function>();
                                    foreach (var f in FunctionList.List.electricals)
                                    foreach (var f in FunctionList.List.GetElectricals())
                                    {
                                        eleList.Add(f);
                                    }
@@ -467,10 +449,10 @@
                {
                    try
                    {
                        foreach (var f in FunctionList.List.curtains)
                        foreach (var f in FunctionList.List.GetCurtainList())
                        {
                            f.trait_on_off.curValue = "on";
                            f.percent = 100;
                            f.SetAttrState(FunctionAttributeKey.Percent, "100");
                            Dictionary<string, string> d = new Dictionary<string, string>();
                            d.Add("on_off", f.trait_on_off.curValue.ToString());
                            Control.Ins.SendWriteCommand(f, d);
@@ -498,10 +480,10 @@
                DB_ResidenceData.Instance.GlobalCurtainStatus = false;
                btnClose.IsSelected = true;
                btnOpen.IsSelected = false;
                foreach (var f in FunctionList.List.curtains)
                foreach (var f in FunctionList.List.GetCurtainList())
                {
                    f.trait_on_off.curValue = "off";
                    f.percent = 0;
                    f.SetAttrState(FunctionAttributeKey.Percent, "0");
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add("on_off", f.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(f, d);
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -102,10 +102,10 @@
                                break;
                        }
                        var powerLowTipAttr = function.status.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
                        var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
                        if (powerLowTipAttr != null)
                        {
                            if (powerLowTipAttr.value.ToLower() == "low")
                            if (powerLowTipAttr.state.ToLower() == "low")
                            {
                                Button btnTipPowerLow = new Button()
                                {
@@ -331,7 +331,7 @@
                        ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                        ProgressTextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                        MaxValue = 100,
                        Progress = (function as Light).brightness,
                        Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.BatteryState)),
                        Tag = function.sid + "_DimmerBar",
                        SeekBarPadding = Application.GetRealWidth(20),
                    };
@@ -370,7 +370,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "off",
                IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0",
                Tag = function.sid + "_off"
            };
            bodyDiv.AddChidren(btnCurtainClose);
@@ -384,7 +384,6 @@
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png",
                Tag = function.sid + "_stop",
                IsSelected = function.trait_on_off.curValue.ToString() == "stop"
            };
            bodyDiv.AddChidren(btnCurtainStop);
@@ -397,10 +396,10 @@
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
                Tag = function.sid + "_on",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0"
            };
            bodyDiv.AddChidren(btnCurtainOpen);
            LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function as Curtain);
            LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function);
            #endregion
        }
        /// <summary>
@@ -430,7 +429,7 @@
                SelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDownIcon1On.png",
            };
            bodyDiv.AddChidren(btnClothesHangerDown);
            LoadEvent_ControlClothesHanger(function, btnClothesHangerDown, btnClothesHangerUp);
            LoadEvent_ControlClothesHanger(function,  btnClothesHangerUp, btnClothesHangerDown);
            #endregion
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -40,7 +40,7 @@
                                {
                                    if (btn.Tag.ToString() == upfunc.sid + "_DimmerBar")
                                    {
                                        //btn.Progress = (upfunc as Light).trait_brightness.value.value.ToString() == "on";
                                        btn.Progress = Convert.ToInt32(upfunc.GetAttrState(FunctionAttributeKey.Brightness));
                                    }
                                }
                            }
@@ -109,10 +109,8 @@
                {
                    if (function.Spk_Prefix == FunctionCategory.Light)
                    {
                        var light = function as Light;
                        light.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                        //Control.Send(CommandType_A.write, function);
                        System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                        function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                        Dictionary<string, string> d = new Dictionary<string, string>();
                        d.Add("on_off", function.trait_on_off.curValue.ToString());
                        Control.Ins.SendWriteCommand(function, d);
                    }
@@ -128,7 +126,6 @@
        {
            if(function.spk == SPK.LightDimming || function.spk == SPK.LightRGB)
            {
                var light = function as Light;
                dimmerControlBar.OnStartTrackingTouchEvent = (sender, e) => {
                    onDimmerBar = true;
                    (bodyDiv.Parent as VerticalScrolViewLayout).ScrollEnabled = false;
@@ -136,10 +133,10 @@
                dimmerControlBar.OnStopTrackingTouchEvent = (sender, e) => {
                    onDimmerBar = false;
                    (bodyDiv.Parent as VerticalScrolViewLayout).ScrollEnabled = true;
                    light.brightness = dimmerControlBar.Progress;
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("brightness", light.brightness.ToString());
                    Control.Ins.SendWriteCommand(light, d);
                    function.SetAttrState(FunctionAttributeKey.Brightness, dimmerControlBar.Progress.ToString());
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, dimmerControlBar.Progress.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                };
                dimmerControlBar.OnProgressChangedEvent = (sender, e) => {
                    dimmerControlBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
@@ -183,7 +180,7 @@
        /// <param name="btnStop"></param>
        /// <param name="btnOpen"></param>
        /// <param name="btnClose"></param>
        void LoadEvent_ControlCurtain(Button btnStop, Button btnOpen, Button btnClose, Curtain curtain)
        void LoadEvent_ControlCurtain(Button btnStop, Button btnOpen, Button btnClose, Function curtain)
        {
            btnClose.MouseUpEventHandler = (sender, e) =>
            {
@@ -191,9 +188,9 @@
                btnStop.IsSelected = false;
                btnOpen.IsSelected = false;
                curtain.trait_on_off.curValue = "off";
                curtain.percent = 0;
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
@@ -203,8 +200,8 @@
                btnClose.IsSelected = false;
                btnOpen.IsSelected = false;
                curtain.trait_on_off.curValue = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
@@ -214,9 +211,9 @@
                btnClose.IsSelected = false;
                btnStop.IsSelected = false;
                curtain.trait_on_off.curValue = "on";
                curtain.percent = 100;
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
        }
@@ -234,7 +231,15 @@
            };
            btnUp.MouseUpEventHandler = (sender, e) =>
            {
                btnUp.IsSelected = false;
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnUp.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.SetAttrState(FunctionAttributeKey.Position, "up");
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Position, "up");
@@ -247,7 +252,15 @@
            };
            btnDown.MouseUpEventHandler = (sender, e) =>
            {
                btnDown.IsSelected = false;
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnDown.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.SetAttrState(FunctionAttributeKey.Position, "down");
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Position, "down");
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -83,31 +83,31 @@
            if (titleId == StringId.Lights)
            {
                functionList.AddRange(FunctionList.List.lights);
                functionList.AddRange(FunctionList.List.GetLightList());
            }
            else if (titleId == StringId.AC)
            {
                functionList.AddRange(FunctionList.List.aCs);
                functionList.AddRange(FunctionList.List.GetAcList());
            }
            else if (titleId == StringId.Curtain)
            {
                functionList.AddRange(FunctionList.List.curtains);
                functionList.AddRange(FunctionList.List.GetCurtainList());
            }
            else if (titleId == StringId.FloorHeating)
            {
                functionList.AddRange(FunctionList.List.floorHeatings);
                functionList.AddRange(FunctionList.List.GetFloorHeatingList());
            }
            else if (titleId == StringId.Electric)
            {
                functionList.AddRange(FunctionList.List.electricals);
                functionList.AddRange(FunctionList.List.GetElectricals());
            }
            else if (titleId == StringId.EnvironmentalScience)
            {
                functionList.AddRange(FunctionList.List.sensorsEnvironmentalScience);
                functionList.AddRange(FunctionList.List.GetEnvirSensorsList());
            }
            else if (titleId == StringId.Sensor)
            {
                functionList.AddRange(FunctionList.List.sensorsArm);
                functionList.AddRange(FunctionList.List.GetArmSensorList());
            }
            functionList.OrderByDescending(o => o.controlCounter).ToList();
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -255,7 +255,7 @@
                    TextAlignment = TextAlignment.CenterRight,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    Text = FunctionList.List.GetDelayText(scene.delay.ToString())
                    Text = scene.GetDelayText()
                };
                sceneDelayRow.AddChidren(btnSceneDelayInfo);
@@ -274,7 +274,7 @@
                {
                    Action<string> action = (obj) => {
                        scene.delay = obj;
                        btnSceneDelayInfo.Text = FunctionList.List.GetDelayText(obj);
                        btnSceneDelayInfo.Text = scene.GetDelayText();
                    };
                    Dictionary<string, string> items = new Dictionary<string, string>();
                    items.Add("30", "30s");
@@ -427,7 +427,7 @@
                if (Convert.ToInt32(scenefunction.delay) > 0)
                {
                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + FunctionList.List.GetDelayText(scenefunction.delay);
                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
                }
                else
                {
@@ -510,16 +510,16 @@
            var fanState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
            if (modeState != null)
            {
                sceneFunctionInfo += FunctionList.List.GetValueText(modeState.key, modeState.value);
                sceneFunctionInfo += modeState.GetValueText();
            }
            if (tempState != null)
            {
                sceneFunctionInfo += FunctionList.List.GetValueText(tempState.key, tempState.value);
                sceneFunctionInfo += FunctionList.List.GetUintString(tempState.key);
                sceneFunctionInfo += tempState.GetValueText();
                sceneFunctionInfo += tempState.GetUintString();
            }
            if (fanState != null)
            {
                sceneFunctionInfo += FunctionList.List.GetValueText(fanState.key, fanState.value);
                sceneFunctionInfo += tempState.GetValueText();
            }
            var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
            if (briState != null)
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -261,7 +261,7 @@
                    TextAlignment = TextAlignment.CenterRight,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    Text = FunctionList.List.GetDelayText( scene.delay)
                    Text = scene.GetDelayText()
                };
                sceneDelayRow.AddChidren(btnSceneDelayInfo);
@@ -281,7 +281,7 @@
                {
                    Action<string> action = (obj) => {
                        scene.delay = obj;
                        btnSceneDelayInfo.Text = FunctionList.List.GetDelayText(obj);
                        btnSceneDelayInfo.Text = scene.GetDelayText();
                        scene.EditScene();
                    };
                    Dictionary<string, string> items = new Dictionary<string, string>();
@@ -483,7 +483,7 @@
                if (Convert.ToInt32( scenefunction.delay) > 0)
                {
                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + FunctionList.List.GetDelayText(scenefunction.delay);
                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
                }
                else
                {
@@ -567,16 +567,16 @@
            var fanState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
            if (modeState != null)
            {
                sceneFunctionInfo += FunctionList.List.GetValueText(modeState.key, modeState.value) + " ";
                sceneFunctionInfo += modeState.GetValueText() + " ";
            }
            if (tempState != null)
            {
                sceneFunctionInfo += FunctionList.List.GetValueText(tempState.key, tempState.value) + " ";
                sceneFunctionInfo += FunctionList.List.GetUintString(tempState.key);
                sceneFunctionInfo += tempState.GetValueText() + " ";
                sceneFunctionInfo += tempState.GetUintString();
            }
            if (fanState != null)
            {
                sceneFunctionInfo += FunctionList.List.GetValueText(fanState.key, fanState.value) + " ";
                sceneFunctionInfo += fanState.GetValueText() + " ";
            }
            var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
            if (briState != null)
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -202,7 +202,7 @@
                TextAlignment = TextAlignment.CenterRight,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = FunctionList.List.GetValueText(sceneStatus.key,sceneStatus.value) + FunctionList.List.GetUintString(sceneStatus.key)
                Text = sceneStatus.GetValueText() + sceneStatus.GetUintString()
            };
            row.AddChidren(btnFunctionText);
            if (sceneStatus.key == FunctionAttributeKey.OnOff)
@@ -220,7 +220,7 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                Text = FunctionList.List.GetNameText(sceneStatus.key)
                Text = sceneStatus.GetNameText()
            };
            row.AddChidren(btnFunctionName);
            btnFunctionName.MouseUpEventHandler = (sender, e) =>
@@ -300,7 +300,7 @@
                TextAlignment = TextAlignment.CenterRight,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = FunctionList.List.GetDelayText( sceneFunction.delay)
                Text = new Scene() { delay = sceneFunction.delay }.GetDelayText()
            };
            delayRow.AddChidren(btnDelayInfo);
@@ -318,7 +318,7 @@
            btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => {
                Action<string> action = (obj) => {
                    sceneFunction.delay = obj;
                    btnDelayInfo.Text = FunctionList.List.GetDelayText(obj);
                    btnDelayInfo.Text = new Scene() { delay = sceneFunction.delay }.GetDelayText();
                };
                Dictionary<string, string> items = new Dictionary<string, string>();
                items.Add("30", "30s");
@@ -423,7 +423,7 @@
                dialog.Close();
                trait.value = "on";
                sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on";
                btn.Text = FunctionList.List.GetValueText(trait.key, trait.value) + FunctionList.List.GetUintString(trait.key);
                btn.Text = trait.GetValueText() + trait.GetUintString();
                var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
                if (temp == null)
@@ -436,14 +436,14 @@
                    {
                        temp.value = "100";
                    }
                    btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%";
                    btnBrightnessText.Text = temp.GetValueText() + "%";
                }
            };
            btnOff.MouseUpEventHandler = (sender,e) =>{
                dialog.Close();
                trait.value = "off";
                sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off";
                btn.Text= FunctionList.List.GetValueText(trait.key,trait.value) + FunctionList.List.GetUintString(trait.key);
                btn.Text= trait.GetValueText() + trait.GetUintString();
                var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
                if(temp == null)
@@ -456,7 +456,7 @@
                    {
                        temp.value = "0";
                    }
                    btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%";
                    btnBrightnessText.Text = temp.GetValueText() + "%";
                }
            };
@@ -540,16 +540,16 @@
            };
            for (int i = 16; i <= 32; i += 1)
            {
                pickerItems.Add(i.ToString() + FunctionList.List.GetUintString(trait.key));
                pickerItems.Add(i.ToString() + trait.GetUintString());
            }
            uIPickerView.setNPicker(pickerItems, null, null);
            optionBaseView.AddChidren(uIPickerView);
            uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5);
            string selectItem = pickerItems[0];
            if (pickerItems.Contains(trait.value + FunctionList.List.GetUintString(trait.key)))
            if (pickerItems.Contains(trait.value + trait.GetUintString()))
            {
                selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key);
                selectItem = trait.value.ToString() + trait.GetUintString();
            }
            dialog.Show();
@@ -568,7 +568,7 @@
                dialog.Close();
                btn.Text = selectItem;
                //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ;
                trait.value = selectItem.Replace(FunctionList.List.GetUintString(trait.key),"");
                trait.value = selectItem.Replace(trait.GetUintString(),"");
            };
        }
@@ -622,7 +622,7 @@
                Gravity = Gravity.CenterHorizontal,
                TextAlignment = TextAlignment.Center,
                Width = Application.GetRealWidth(100),
                Text = FunctionList.List.GetNameText(trait.key),
                Text = trait.GetNameText(),
                IsBold = true,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
@@ -711,7 +711,7 @@
            {
                dialog.Close();
                trait.value = controlBar.Progress.ToString();
                btn.Text = trait.value + FunctionList.List.GetUintString(trait.key);
                btn.Text = trait.value + trait.GetUintString();
                var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff);
                if (temp != null)
@@ -724,7 +724,7 @@
                    {
                        temp.value = "off";
                    }
                    btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value);
                    btnOnText.Text = temp.GetValueText();
                }
            };
        }
@@ -779,7 +779,7 @@
                Gravity = Gravity.CenterHorizontal,
                TextAlignment = TextAlignment.Center,
                Width = Application.GetRealWidth(100),
                Text = FunctionList.List.GetNameText(trait.key),
                Text = trait.GetNameText(),
                IsBold = true,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
@@ -872,7 +872,7 @@
            {
                dialog.Close();
                trait.value = controlBar.Progress.ToString();
                btn.Text = trait.value + FunctionList.List.GetUintString(trait.key);
                btn.Text = trait.value + trait.GetUintString();
            };
        }
@@ -921,7 +921,7 @@
                Gravity = Gravity.CenterHorizontal,
                TextAlignment = TextAlignment.Center,
                Width = Application.GetRealWidth(100),
                Text = FunctionList.List.GetNameText(trait.key),
                Text = trait.GetNameText(),
                IsBold = true,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
@@ -993,7 +993,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                    Tag = m,
                    Text = FunctionList.List.GetValueText(trait.key, m)
                    Text = trait.GetValueText()
                };
                row.AddChidren(btnPropertyTitle);
HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
@@ -66,7 +66,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        AC aC;
        AC acTemp = new AC();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -75,10 +76,10 @@
        /// </summary>
        Action actionRefresh;
        #endregion
        public ACPage(AC func)
        public ACPage(Function func)
        {
            bodyView = this;
            aC = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -107,7 +108,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = aC.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -120,7 +121,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = aC.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -132,7 +133,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = aC.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -145,16 +146,16 @@
            {
                Gravity = Gravity.CenterHorizontal,
                OpenAngle = 160,
                ThumbImagePath = aC.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImageHeight = Application.GetRealWidth(50),
                ProgressBarColor = CSS_Color.MainColor,
                OfflineProgressBarColor = CSS_Color.PromptingColor2,
                IsOffline = aC.trait_on_off.curValue.ToString() == "off",
                MinValue = aC.trait_temp.min,
                MaxValue = aC.trait_temp.max,
                //IsClickable = aC.trait_on_off.curValue.ToString() == "on",
                IsOffline = function.trait_on_off.curValue.ToString() == "off",
                MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min,
                MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max,
                //IsClickable = function.trait_on_off.curValue.ToString() == "on",
                ArcColor = CSS_Color.BackgroundColor,
                Progress = Convert.ToInt32(aC.trait_temp.curValue),
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)),
#if __IOS__
                Y = Application.GetRealHeight(120 + 25),
                Width = Application.GetRealWidth(260 - 40),
@@ -179,7 +180,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 50,
                IsBold = true,
                Text = aC.trait_temp.curValue.ToString(),
                Text = function.GetAttrState(FunctionAttributeKey.SetTemp),
                TextAlignment = TextAlignment.Center,
            };
            controlView.AddChidren(btnTemp);
@@ -236,7 +237,7 @@
                Y = Application.GetRealHeight(334),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = aC.curModeImage,
                UnSelectedImagePath = acTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode)),
            };
            controlView.AddChidren(btnMode);
@@ -246,7 +247,7 @@
                Y = Application.GetRealHeight(337),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = aC.curFanImage,
                UnSelectedImagePath = acTemp.GetFanIconPath(function.GetAttrState(FunctionAttributeKey.FanSpeed)),
            };
            controlView.AddChidren(btnWindSpeed);
@@ -258,15 +259,15 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = aC.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView,Language.StringByID(StringId.AC)).LoadTopView_FunctionTop(aC, actionRefresh);
            new TopViewDiv(bodyView,Language.StringByID(StringId.AC)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(aC);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
@@ -318,28 +319,29 @@
            };
            modeChangeView.AddChidren(btnLine);
            foreach(var m in aC.trait_mode.value)
            var modeList = function.GetAttribute(FunctionAttributeKey.Mode).value;
            foreach (var m in modeList)
            {
                Button btnModeIcon = new Button()
                {
                    X = btnTitle.X,
                    Y = Application.GetRealHeight(44 * (aC.trait_mode.value.IndexOf(m) + 1) + 10 + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                    Width = Application.GetRealWidth(24),
                    Height = Application.GetRealWidth(24),
                    IsSelected = aC.trait_mode.curValue.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                };
                modeChangeView.AddChidren(btnModeIcon);
                Button btnModeText = new Button()
                {
                    X = Application.GetRealWidth(12) + btnModeIcon.Right,
                    Y = Application.GetRealHeight(44 * (aC.trait_mode.value.IndexOf(m) + 1) + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
                    Height = Application.GetRealHeight(44),
                    Width = Application.GetRealWidth(90),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    SelectedTextColor = CSS_Color.MainColor,
                    IsSelected = aC.trait_mode.curValue.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                modeChangeView.AddChidren(btnModeText);
@@ -373,12 +375,12 @@
                        break;
                }
                if(aC.trait_mode.value.IndexOf(m) < aC.trait_mode.value.Count-1)
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
                    modeChangeView.AddChidren(new Button()
                    {
                        X = btnTitle.X,
                        Y = btnModeText.Bottom ,
                        Y = btnModeText.Bottom,
                        Width = Application.GetRealWidth(112),
                        Height = Application.GetRealHeight(1),
                        BackgroundColor = CSS_Color.BackgroundColor,
@@ -440,28 +442,29 @@
            };
            modeChangeView.AddChidren(btnLine);
            foreach (var m in aC.trait_fan.value)
            var modeList = function.GetAttribute(FunctionAttributeKey.FanSpeed).value;
            foreach (var m in modeList)
            {
                Button btnFanIcon = new Button()
                {
                    X = btnTitle.X,
                    Y = Application.GetRealHeight(44 * (aC.trait_fan.value.IndexOf(m) + 1) + 10 + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                    Width = Application.GetRealWidth(24),
                    Height = Application.GetRealWidth(24),
                    IsSelected = aC.trait_fan.curValue.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
                };
                modeChangeView.AddChidren(btnFanIcon);
                Button btnFanText = new Button()
                {
                    X = Application.GetRealWidth(12) + btnFanIcon.Right,
                    Y = Application.GetRealHeight(44 * (aC.trait_fan.value.IndexOf(m) + 1) + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
                    Height = Application.GetRealHeight(44),
                    Width = Application.GetRealWidth(70),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    SelectedTextColor = CSS_Color.MainColor,
                    IsSelected = aC.trait_fan.curValue.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                modeChangeView.AddChidren(btnFanText);
@@ -490,7 +493,7 @@
                        break;
                }
                if (aC.trait_fan.value.IndexOf(m) < aC.trait_fan.value.Count - 1)
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
                    modeChangeView.AddChidren(new Button()
                    {
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -9,11 +9,11 @@
    public partial class ACPage
    {
        static DateTime updataTime = DateTime.MinValue;
        public static void UpdataStates(AC uAc)
        public static void UpdataStates(Function updateTemp)
        {
            try
            {
                Application.RunOnMainThread(() =>
                Application.RunOnMainThread((() =>
                {
                    if (bodyView == null)
                    {
@@ -23,26 +23,19 @@
                    {
                        return;
                    }
                    AC temp = new AC();
                    updataTime = DateTime.Now;
                    //bodyView.arcBar.IsOffline = bodyView.aC.trait_on_off.curValue.ToString() != "on";
                    //bodyView.btnSwitch.IsSelected = uAc.trait_on_off.curValue.ToString() == "on";
                    //if (uAc.refreshTime.AddMilliseconds(500) < DateTime.Now)
                    //{
                    //    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue));
                    //}
                    //bodyView.arcBar.ThumbImagePath = uAc.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png";
                    //bodyView.arcBar.IsClickable = uAc.trait_on_off.curValue.ToString() == "on";
                    bodyView.btnTemp.Text = uAc.trait_temp.curValue.ToString();
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(uAc.trait_IndoorTemp.curValue)) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = uAc.curModeImage;
                    bodyView.btnWindSpeed.UnSelectedImagePath = uAc.curFanImage;
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uAc.trait_temp.curValue));
                    if (uAc.trait_on_off.curValue.ToString() == "on")
                    bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp);
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState((string)FunctionAttributeKey.IndoorTemp))) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = temp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
                    bodyView.btnWindSpeed.UnSelectedImagePath = temp.GetFanIconPath(updateTemp.GetAttrState(FunctionAttributeKey.FanSpeed));
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    {
                        bodyView.arcBar.IsOffline = false;
                        bodyView.btnSwitch.IsSelected = true;
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                        if (uAc.trait_mode.curValue.ToString() == "fan")
                        if (updateTemp.GetAttrState((string)FunctionAttributeKey.Mode) == "fan")
                        {
                            bodyView.arcBar.IsClickable = false;
                        }
@@ -59,7 +52,7 @@
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                    }
                   
                });
                }));
            }
            catch (Exception ex)
            {
@@ -75,8 +68,8 @@
            //回退刷新信息事件
            actionRefresh = () =>
            {
                btnFunctionName.Text = btnFunctionName_Out.Text = aC.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = aC.GetRoomListName();
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
            };
        }
@@ -87,8 +80,8 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = aC.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                aC.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -99,57 +92,57 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (aC.trait_on_off.curValue.ToString() == "off" || aC.trait_mode.curValue.ToString() == "fan")
                if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
                var temp = Convert.ToInt32(aC.trait_temp.curValue);
                if (temp <= aC.trait_temp.min)
                var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp <= function.GetAttribute(FunctionAttributeKey.Mode).min)
                {
                    return;
                }
                temp--;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                aC.trait_temp.curValue = temp.ToString();
                //Control.Send(CommandType_A.write, aC);
                function.SetAttrState(FunctionAttributeKey.SetTemp,temp.ToString());
                //Control.Send(CommandType_A.write, function);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                Control.Ins.SendWriteCommand(aC, d);
                Control.Ins.SendWriteCommand(function, d);
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (aC.trait_on_off.curValue.ToString() == "off" || aC.trait_mode.curValue.ToString() == "fan")
                if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
                var temp = Convert.ToInt32(aC.trait_temp.curValue);
                if (temp >= aC.trait_temp.max)
                var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp >= function.GetAttribute(FunctionAttributeKey.SetTemp).max)
                {
                    return;
                }
                temp++;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                aC.trait_temp.curValue = temp.ToString();
                function.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, aC.trait_temp.curValue.ToString());
                Control.Ins.SendWriteCommand(aC, d);
                //aC.GetSendJObject
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                Control.Ins.SendWriteCommand(function, d);
                //function.GetSendJObject
            };
            arcBar.OnStopTrackingTouchEvent = (sender, e) =>
           {
               aC.trait_temp.curValue = arcBar.Progress.ToString();
               btnTemp.Text = aC.trait_temp.curValue.ToString();
               function.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
               btnTemp.Text = arcBar.Progress.ToString();
               System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
               d.Add(FunctionAttributeKey.SetTemp, aC.trait_temp.curValue.ToString());
               Control.Ins.SendWriteCommand(aC, d);
               d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
               Control.Ins.SendWriteCommand(function, d);
           };
            arcBar.OnProgressChangedEvent = (sender, e) =>
            {
                aC.trait_temp.curValue = e.ToString();
                btnTemp.Text = aC.trait_temp.curValue.ToString();
                function.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
                btnTemp.Text = e.ToString();
            };
        }
        /// <summary>
@@ -159,7 +152,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (aC.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
@@ -167,7 +160,7 @@
            };
            btnWindSpeed.MouseUpEventHandler = (sender, e) =>
            {
                if (aC.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
@@ -177,8 +170,8 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                aC.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (aC.trait_on_off.curValue.ToString() == "on")
                function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.curValue.ToString() == "on")
                {
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                    btnSwitch.IsSelected = true;
@@ -191,15 +184,15 @@
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, aC.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(aC, d);
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
        }
        /// <summary>
        /// åŠ è½½æ¨¡å¼æ”¹å˜äº‹ä»¶
        /// </summary>
        void LoadEvent_ChangeMode(Dialog dialog, FrameLayout dialogView, Button btn1, Button btn2, string curMode)
        void LoadEvent_ChangeMode(Dialog dialog, FrameLayout dialogView, Button btnModeIcon, Button btnModeText, string curMode)
        {
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
@@ -207,16 +200,15 @@
            };
            EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
            {
                btn1.IsSelected = btn2.IsSelected = true;
                aC.trait_mode.curValue = curMode;
                btnMode.UnSelectedImagePath = aC.curModeImage;
                //Control.Send(CommandType_A.write, aC);
                btnModeIcon.IsSelected = btnModeText.IsSelected = true;
                function.SetAttrState(FunctionAttributeKey.Mode, curMode);
                btnMode.UnSelectedImagePath = acTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode));
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                btnMode.UnSelectedImagePath = btn1.UnSelectedImagePath;
                btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath;
                d.Add(FunctionAttributeKey.Mode, curMode);
                Control.Ins.SendWriteCommand(aC, d);
                Control.Ins.SendWriteCommand(function, d);
                dialog.Close();
                if (aC.trait_mode.curValue.ToString() == "fan")
                if (function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    bodyView.arcBar.IsClickable = false;
                }
@@ -225,14 +217,14 @@
                    bodyView.arcBar.IsClickable = true;
                }
            };
            btn1.MouseUpEventHandler = eventHandler1;
            btn2.MouseUpEventHandler = eventHandler1;
            btnModeIcon.MouseUpEventHandler = eventHandler1;
            btnModeText.MouseUpEventHandler = eventHandler1;
            dialogView.MouseUpEventHandler = eventHandler;
        }
        /// <summary>
        /// åŠ è½½é£Žé€Ÿæ”¹å˜äº‹ä»¶
        /// </summary>
        void LoadEvent_ChangeFan(Dialog dialog, FrameLayout dialogView, Button btn1, Button btn2, string curFan)
        void LoadEvent_ChangeFan(Dialog dialog, FrameLayout dialogView, Button btnFanIcon, Button btnFanText, string curFan)
        {
            EventHandler<MouseEventArgs> closeDialogEvent = (sender, e) =>
            {
@@ -240,17 +232,17 @@
            };
            EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
            {
                btn1.IsSelected = btn2.IsSelected = true;
                aC.trait_fan.curValue = curFan;
                btnWindSpeed.UnSelectedImagePath = aC.curFanImage;
                btnFanIcon.IsSelected = btnFanText.IsSelected = true;
                function.SetAttrState(FunctionAttributeKey.FanSpeed, curFan);
                btnWindSpeed.UnSelectedImagePath = acTemp.GetFanIconPath(function.GetAttrState(FunctionAttributeKey.FanSpeed));
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.FanSpeed, curFan);
                Control.Ins.SendWriteCommand(aC, d);
                btnWindSpeed.UnSelectedImagePath = btn1.UnSelectedImagePath;
                Control.Ins.SendWriteCommand(function, d);
                btnWindSpeed.UnSelectedImagePath = btnFanIcon.UnSelectedImagePath;
                dialog.Close();
            };
            btn1.MouseUpEventHandler = eventHandler1;
            btn2.MouseUpEventHandler = eventHandler1;
            btnFanIcon.MouseUpEventHandler = eventHandler1;
            btnFanText.MouseUpEventHandler = eventHandler1;
            dialogView.MouseUpEventHandler = closeDialogEvent;
        }
    }
HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs
New file
@@ -0,0 +1,625 @@
using System;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.Stan;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public class AcControlPage : DeviceFunctionCardCommonForm
    {
        #region â–  å˜é‡å£°æ˜Ž___________________________
        /// <summary>
        /// ç©ºè°ƒæ¸©åº¦æŽ§åˆ¶æŽ§ä»¶
        /// </summary>
        DiyArcSeekBar arcBar;
        /// <summary>
        /// å‡å·æŒ‰é’®
        /// </summary>
        Button btnMinus;
        /// <summary>
        /// åŠ å·æŒ‰é’®
        /// </summary>
        Button btnPlus;
        /// <summary>
        /// æ¸©åº¦æŒ‰é’®
        /// </summary>
        Button btnTemp;
        Button btnTempUint;
        /// <summary>
        /// å®¤å†…温度按钮
        /// </summary>
        Button btnIndoorTemp;
        /// <summary>
        /// æ¨¡å¼æŒ‰é’®
        /// </summary>
        Button btnMode;
        /// <summary>
        /// é£Žé€ŸæŒ‰é’®
        /// </summary>
        Button btnWindSpeed;
        /// <summary>
        /// å¼€å…³æŒ‰é’®
        /// </summary>
        Button btnSwitch;
        AC acFunction = new AC();
        #endregion
        #region â–  åˆå§‹åŒ–_____________________________
        /// <summary>
        /// åˆå§‹åŒ–白色区域的内容
        /// </summary>
        public override void InitFrameWhiteContent()
        {
            base.ShowColltionButton = false;
            base.SetTitleText(Language.StringByID(StringId.Electric));
            //初始化第一个索引页的内容
            this.InitFrameWhiteContent1();
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(this.device);
            //刷新界面状态
            this.RefreshFormStatu();
            //读取状态
            new System.Threading.Thread(() =>
            {
                Control.Ins.SendReadCommand(device);
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// åˆå§‹åŒ–第一个索引页的内容
        /// </summary>
        private void InitFrameWhiteContent1()
        {
            arcBar = new DiyArcSeekBar()
            {
                Gravity = Gravity.CenterHorizontal,
                OpenAngle = 160,
                ThumbImageHeight = Application.GetRealWidth(50),
                ProgressBarColor = CSS_Color.MainColor,
                OfflineProgressBarColor = CSS_Color.PromptingColor2,
                ArcColor = CSS_Color.BackgroundColor,
#if __IOS__
                Y = Application.GetRealHeight(120 + 25),
                Width = Application.GetRealWidth(260 - 40),
                Height = Application.GetRealWidth(260 - 40),
                SeekBarPadding = Application.GetRealWidth(8),
#else
                            Y = Application.GetRealHeight(120 + 40),
                            Width = Application.GetRealWidth(260 - 40),
                            Height = Application.GetRealWidth(260 - 40),
                            SeekBarPadding = Application.GetRealWidth(7),
#endif
            };
            FrameWhiteCentet1.AddChidren(arcBar);
            arcBar.ThumbImagePath = device.GetAttrState(FunctionAttributeKey.OnOff) == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png";
            arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off";
            arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min;
            arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max;
            arcBar.Progress = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp));
            btnTemp = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(206),
                Width = Application.GetRealWidth(71),
                Height = Application.GetRealWidth(60),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 50,
                IsBold = true,
                Text = device.GetAttrState(FunctionAttributeKey.SetTemp),
                TextAlignment = TextAlignment.Center,
            };
            FrameWhiteCentet1.AddChidren(btnTemp);
            btnTempUint = new Button()
            {
                X = btnTemp.Right,
                Y = btnTemp.Y,
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealHeight(30),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
                IsBold = true,
                TextAlignment = TextAlignment.CenterLeft,
                Text = "°C",
            };
            FrameWhiteCentet1.AddChidren(btnTempUint);
            btnIndoorTemp = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = btnTemp.Bottom,
                Width = Application.GetRealWidth(120),
                Height = Application.GetRealHeight(20),
                Text = Language.StringByID(StringId.IndoorTemp) + "20°C",
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            FrameWhiteCentet1.AddChidren(btnIndoorTemp);
            btnMinus = new Button()
            {
                X = Application.GetRealWidth(21),
                Y = Application.GetRealHeight(263),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/MinusSignIcon.png",
            };
            FrameWhiteCentet1.AddChidren(btnMinus);
            btnPlus = new Button()
            {
                X = Application.GetRealWidth(275),
                Y = Application.GetRealHeight(263),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PlusSignIcon.png",
            };
            FrameWhiteCentet1.AddChidren(btnPlus);
            btnMode = new Button()
            {
                X = Application.GetRealWidth(60),
                Y = Application.GetRealHeight(334),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)),
            };
            FrameWhiteCentet1.AddChidren(btnMode);
            btnWindSpeed = new Button()
            {
                X = Application.GetRealWidth(235),
                Y = Application.GetRealHeight(337),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)),
            };
            FrameWhiteCentet1.AddChidren(btnWindSpeed);
            btnSwitch = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(466),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = device.GetAttrState(FunctionAttributeKey.OnOff) == "on"
            };
            FrameWhiteCentet1.AddChidren(btnSwitch);
            LoadEvent_TempChange();
            LoadEvent_AcStatesChange();
        }
        /// <summary>
        /// åŠ è½½ä¿®æ”¹æ¨¡å¼åŒºåŸŸ
        /// </summary>
        void LoadDiv_ChangeModeView()
        {
            Dialog dialog = new Dialog();
            FrameLayout dialogView = new FrameLayout()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            dialog.AddChidren(dialogView);
            FrameLayout modeChangeView;
            modeChangeView = new FrameLayout()
            {
                X = Application.GetRealWidth(30),
                Y = Application.GetRealHeight(128),
                Width = Application.GetRealWidth(160),
                Height = Application.GetRealHeight(287),
                BackgroundImagePath = "FunctionIcon/AC/DivBg1.png",
            };
            dialogView.AddChidren(modeChangeView);
            Button btnTitle;
            btnTitle = new Button()
            {
                X = Application.GetRealWidth(8 + 16),
                Y = Application.GetRealHeight(8),
                Width = Application.GetRealWidth(112),
                Height = Application.GetRealHeight(44),
                TextID = StringId.ChooseMode,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
            };
            modeChangeView.AddChidren(btnTitle);
            Button btnLine = new Button()
            {
                X = btnTitle.X,
                Y = btnTitle.Bottom,
                Width = Application.GetRealWidth(112),
                Height = Application.GetRealHeight(1),
                BackgroundColor = CSS_Color.BackgroundColor,
            };
            modeChangeView.AddChidren(btnLine);
            var modeList = device.GetAttribute(FunctionAttributeKey.Mode).value;
            foreach (var m in modeList)
            {
                Button btnModeIcon = new Button()
                {
                    X = btnTitle.X,
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                    Width = Application.GetRealWidth(24),
                    Height = Application.GetRealWidth(24),
                    IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m,
                };
                modeChangeView.AddChidren(btnModeIcon);
                Button btnModeText = new Button()
                {
                    X = Application.GetRealWidth(12) + btnModeIcon.Right,
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
                    Height = Application.GetRealHeight(44),
                    Width = Application.GetRealWidth(90),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    SelectedTextColor = CSS_Color.MainColor,
                    IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                modeChangeView.AddChidren(btnModeText);
                btnModeIcon.UnSelectedImagePath = acFunction.GetModeIconPath(m, false);
                btnModeIcon.SelectedImagePath = acFunction.GetModeIconPath(m);
                btnModeText.Text = acFunction.GetModeAttrText( m);
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
                    modeChangeView.AddChidren(new Button()
                    {
                        X = btnTitle.X,
                        Y = btnModeText.Bottom,
                        Width = Application.GetRealWidth(112),
                        Height = Application.GetRealHeight(1),
                        BackgroundColor = CSS_Color.BackgroundColor,
                    });
                }
                EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                {
                    dialog.Close();
                };
                EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                {
                    btnModeIcon.IsSelected = btnModeText.IsSelected = true;
                    device.SetAttrState(FunctionAttributeKey.Mode, m);
                    btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(m);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath;
                    d.Add(FunctionAttributeKey.Mode, m);
                    Control.Ins.SendWriteCommand(device, d);
                    dialog.Close();
                    if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                    {
                        arcBar.IsClickable = false;
                    }
                    else
                    {
                        arcBar.IsClickable = true;
                    }
                };
                btnModeIcon.MouseUpEventHandler = eventHandler1;
                btnModeText.MouseUpEventHandler = eventHandler1;
                dialogView.MouseUpEventHandler = eventHandler;
            }
            dialogView.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
            };
            dialog.Show();
        }
        /// <summary>
        /// åŠ è½½ä¿®æ”¹æ¨¡å¼åŒºåŸŸ
        /// </summary>
        void LoadDiv_ChangeFanView()
        {
            Dialog dialog = new Dialog();
            FrameLayout dialogView = new FrameLayout()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            dialog.AddChidren(dialogView);
            FrameLayout modeChangeView;
            modeChangeView = new FrameLayout()
            {
                X = Application.GetRealWidth(185),
                Y = Application.GetRealHeight(172),
                Width = Application.GetRealWidth(160),
                Height = Application.GetRealHeight(243),
                BackgroundImagePath = "FunctionIcon/AC/DivBg2.png",
            };
            dialogView.AddChidren(modeChangeView);
            Button btnTitle;
            btnTitle = new Button()
            {
                X = Application.GetRealWidth(8 + 16),
                Y = Application.GetRealHeight(8),
                Width = Application.GetRealWidth(112),
                Height = Application.GetRealHeight(44),
                TextID = StringId.ChooseFan,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
            };
            modeChangeView.AddChidren(btnTitle);
            Button btnLine = new Button()
            {
                X = btnTitle.X,
                Y = btnTitle.Bottom,
                Width = Application.GetRealWidth(112),
                Height = Application.GetRealHeight(1),
                BackgroundColor = CSS_Color.BackgroundColor,
            };
            modeChangeView.AddChidren(btnLine);
            var modeList = device.GetAttribute(FunctionAttributeKey.FanSpeed).value;
            foreach (var m in modeList)
            {
                Button btnFanIcon = new Button()
                {
                    X = btnTitle.X,
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                    Width = Application.GetRealWidth(24),
                    Height = Application.GetRealWidth(24),
                    IsSelected = device.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
                };
                modeChangeView.AddChidren(btnFanIcon);
                Button btnFanText = new Button()
                {
                    X = Application.GetRealWidth(12) + btnFanIcon.Right,
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
                    Height = Application.GetRealHeight(44),
                    Width = Application.GetRealWidth(70),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    SelectedTextColor = CSS_Color.MainColor,
                    IsSelected = device.GetAttrState(FunctionAttributeKey.FanSpeed) == m,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                modeChangeView.AddChidren(btnFanText);
                btnFanIcon.UnSelectedImagePath = acFunction.GetModeIconPath(m,false);
                btnFanIcon.SelectedImagePath = acFunction.GetModeIconPath(m);
                btnFanText.Text = acFunction.GetModeAttrText(m);
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
                    modeChangeView.AddChidren(new Button()
                    {
                        X = btnTitle.X,
                        Y = btnFanText.Bottom,
                        Width = Application.GetRealWidth(112),
                        Height = Application.GetRealHeight(1),
                        BackgroundColor = CSS_Color.BackgroundColor,
                    });
                }
                EventHandler<MouseEventArgs> closeDialogEvent = (sender, e) =>
                {
                    dialog.Close();
                };
                EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                {
                    btnFanIcon.IsSelected = btnFanText.IsSelected = true;
                    device.SetAttrState(FunctionAttributeKey.FanSpeed, m);
                    btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(m);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.FanSpeed, m);
                    Control.Ins.SendWriteCommand(device, d);
                    btnWindSpeed.UnSelectedImagePath = btnFanIcon.UnSelectedImagePath;
                    dialog.Close();
                };
                btnFanIcon.MouseUpEventHandler = eventHandler1;
                btnFanText.MouseUpEventHandler = eventHandler1;
                dialogView.MouseUpEventHandler = closeDialogEvent;
            }
            dialog.Show();
        }
        #endregion
        #region â–  è®¾å¤‡çŠ¶æ€åé¦ˆ_______________________
        /// <summary>
        /// è®¾å¤‡çŠ¶æ€åé¦ˆ
        /// </summary>
        /// <param name="i_LocalDevice"></param>
        public override void DeviceStatuPush(Function i_LocalDevice)
        {
            //不是同一个东西
            if (this.device.sid != i_LocalDevice.sid) { return; }
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(i_LocalDevice);
            //刷新界面状态
            this.RefreshFormStatu();
        }
        #endregion
        #region â–  å‘送各种命令_______________________
        /// <summary>
        /// æ¸©åº¦æ”¹å˜æ¨¡å¼
        /// </summary>
        void LoadEvent_TempChange()
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
                var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp <= device.GetAttribute(FunctionAttributeKey.Mode).min)
                {
                    return;
                }
                temp--;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                Control.Ins.SendWriteCommand(device, d);
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
                var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max)
                {
                    return;
                }
                temp++;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                Control.Ins.SendWriteCommand(device, d);
            };
            arcBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
                btnTemp.Text = arcBar.Progress.ToString();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
                Control.Ins.SendWriteCommand(device, d);
            };
            arcBar.OnProgressChangedEvent = (sender, e) =>
            {
                device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
                btnTemp.Text = e.ToString();
            };
        }
        /// <summary>
        /// æŽ§åˆ¶æ¨¡å¼äº‹ä»¶
        /// </summary>
        void LoadEvent_AcStatesChange()
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
                LoadDiv_ChangeModeView();
            };
            btnWindSpeed.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
                LoadDiv_ChangeFanView();
            };
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (device.trait_on_off.curValue.ToString() == "on")
                {
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                    btnSwitch.IsSelected = true;
                    arcBar.IsOffline = false;
                }
                else
                {
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                    btnSwitch.IsBold = false;
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(device, d);
            };
        }
        #endregion
        #region â–  åˆ·æ–°ç•Œé¢çŠ¶æ€_______________________
        /// <summary>
        /// åˆ·æ–°ç•Œé¢çŠ¶æ€
        /// </summary>
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(() =>
            {
                btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp);
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C";
                btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
                btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed));
                arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
                if (device.trait_on_off.curValue.ToString() == "on")
                {
                    arcBar.IsOffline = false;
                    btnSwitch.IsSelected = true;
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                    if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                    {
                        arcBar.IsClickable = false;
                    }
                    else
                    {
                        arcBar.IsClickable = true;
                    }
                }
                else
                {
                    arcBar.IsOffline = true;
                    btnSwitch.IsSelected = false;
                    arcBar.IsClickable = false;
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                }
            });
        }
        #endregion
        #region â–  ä¸€èˆ¬æ–¹æ³•___________________________
        /// <summary>
        /// åˆ·æ–°å½“前设备的状态缓存
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
        }
        #endregion
    }
}
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/ArmSensorHistroyPaging.cs
New file
@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public class ArmSensorHistroyPaging
    {
        Function device;
        public ArmSensorHistroyPaging(Function function)
        {
            device = function;
        }
        public void InitFrame(FrameLayout FrameWhiteCentet2)
        {
            Button btnTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealHeight(65),
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                TextColor = CSS_Color.FirstLevelTitleColor,
                IsBold = true,
                TextID = StringId.Log,
            };
            FrameWhiteCentet2.AddChidren(btnTitle);
            VerticalScrolViewLayout histroyView = new VerticalScrolViewLayout()
            {
                Y = btnTitle.Bottom,
                Height = Application.GetRealHeight(450),
            };
            FrameWhiteCentet2.AddChidren(histroyView);
            var waitPage = new Loading();
            FrameWhiteCentet2.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new System.Threading.Thread(() =>
            {
                try
                {
                    int pageCount = 1;
                    var pm = new DAL.Server.HttpServerRequest();
                    var pack = pm.GetArmSensorHistory(device.deviceId, "20", "1");
                    var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<Cloud_ArmSensorHistory>(pack.Data.ToString());
                    List<string> years = new List<string>();
                    Application.RunOnMainThread(() =>
                    {
                        var startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); // å½“地时区
                        foreach (var data in revData.list)
                        {
                            var yearString = startTime.AddMilliseconds(Convert.ToDouble(data.createTime)).ToString("yyyy") + Language.StringByID(StringId.Years);
                            var monthString = startTime.AddMilliseconds(Convert.ToDouble(data.createTime)).ToString("m");
                            var timeString = startTime.AddMilliseconds(Convert.ToDouble(data.createTime)).ToString("HH:mm:ss");
                            var dateString = monthString + " " + timeString;
                            if (!years.Contains(yearString))
                            {
                                years.Add(yearString);
                                Button btnYear = new Button()
                                {
                                    X = Application.GetRealWidth(16),
                                    Height = Application.GetRealHeight(46),
                                    Width = Application.GetRealWidth(220),
                                    TextAlignment = TextAlignment.CenterLeft,
                                    TextSize = CSS_FontSize.SubheadingFontSize,
                                    TextColor = CSS_Color.FirstLevelTitleColor,
                                    IsBold = true,
                                    Text = yearString,
                                };
                                histroyView.AddChidren(btnYear);
                            }
                            var cell = new ArmSensorHistoryMsgCell()
                            {
                                Height = Application.GetRealHeight(50),
                            };
                            histroyView.AddChidren(cell);
                            cell.InitControl(data.content, dateString);
                        }
                    });
                }
                catch
                {
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                    });
                }
            })
            { IsBackground = true }.Start();
        }
    }
    public class ArmSensorHistoryMsgCell : FrameLayout
    {
        Button btnMsg;
        Button btnTime;
        public void InitControl(string msg, string time)
        {
            btnMsg = new Button()
            {
                X = Application.GetRealWidth(16),
                Height = Application.GetRealHeight(40),
                Width = Application.GetRealWidth(300),
                //Width = Application.GetRealWidth(220),
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = msg,
            };
            this.AddChidren(btnMsg);
            btnTime = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(35),
                Width = Application.GetRealWidth(295),
                //Width = Application.GetRealWidth(80),
                Height = Application.GetRealHeight(15),
                TextAlignment = TextAlignment.CenterRight,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextColor = CSS_Color.PromptingColor1,
                Text = time,
                IsMoreLines = true
            };
            this.AddChidren(btnTime);
            AddChidren(new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(49),
                Width = Application.GetRealWidth(295),
                Height = 1,
                BackgroundColor = CSS_Color.DividingLineColor,
            });
        }
    }
    /// <summary>
    /// äº‘端api接口返回的安防传感器历史数据对象
    /// </summary>
    public class Cloud_ArmSensorHistory
    {
        public string totalCount = "";
        public string totalPage = "";
        public string pageNo = "";
        public string pageSize = "";
        public List<ArmSensorHistory> list = new List<ArmSensorHistory>();
    }
    public class ArmSensorHistory
    {
        public string title = "";
        public string content = "";
        public string level = "";
        public string createTime = "";
    }
}
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorDoorWinwsPage.cs
@@ -2,6 +2,8 @@
using HDL_ON.Stan;
using HDL_ON.UI.CSS;
using HDL_ON.Entity;
using System.Collections.Generic;
using System;
namespace HDL_ON.UI
{
@@ -79,6 +81,8 @@
        /// </summary>
        private void InitFrameWhiteContent2()
        {
            var paging = new ArmSensorHistroyPaging(device);
            paging.InitFrame(FrameWhiteCentet2);
        }
        #endregion
@@ -114,10 +118,10 @@
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(() => {
                var temp = device.status.Find((sta) => sta.key == FunctionAttributeKey.Status);
                var temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.Status);
                if (temp != null)
                {
                    if (temp.value == "open")
                    if (temp.state == "open")
                    {
                        btnIcon.IsSelected = true;
                        btnSuctionView.TextID = StringId.Open;
@@ -167,4 +171,5 @@
        #endregion
    }
}
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs
@@ -36,9 +36,6 @@
            this.InitFrameWhiteContent1();
            //初始化第二个索引页的内容
            this.InitFrameWhiteContent2();
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(this.device);
            //刷新界面状态
            this.RefreshFormStatu();
            //读取状态
@@ -81,17 +78,8 @@
        /// </summary>
        private void InitFrameWhiteContent2()
        {
            Button btnLog = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(16),
                Width = Application.GetRealWidth(250),
                Height = Application.GetRealHeight(33),
                TextAlignment = TextAlignment.CenterLeft,
                IsBold = true,
                TextID = StringId.Log,
            };
            FrameWhiteCentet2.AddChidren(btnLog);
            var paging = new ArmSensorHistroyPaging(device);
            paging.InitFrame(FrameWhiteCentet2);
        }
        #endregion
@@ -107,8 +95,6 @@
            //不是同一个东西
            if (this.device.sid != i_LocalDevice.sid) { return; }
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(i_LocalDevice);
            //刷新界面状态
            this.RefreshFormStatu();
        }
@@ -127,10 +113,10 @@
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(()=>{
                var temp = device.status.Find((sta) => sta.key == FunctionAttributeKey.Status);
                var temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.Status);
                if (temp != null)
                {
                    if (temp.value == "true")
                    if (temp.state == "true")
                    {
                        btnIcon.IsSelected = true;
                        btnSuctionView.TextID = StringId.Someone;
@@ -149,18 +135,6 @@
        #endregion
        #region â–  ä¸€èˆ¬æ–¹æ³•___________________________
        /// <summary>
        /// åˆ·æ–°å½“前设备的状态缓存
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
            foreach (var data in i_LocalDevice.status)
            {
                //开关
                //if (data.key == "on_off") { this.weepRobotData.Cleaning = data.value.ToLower() == "on"; }
            }
        }
        #endregion
    }
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorSmokePage.cs
@@ -79,6 +79,8 @@
        /// </summary>
        private void InitFrameWhiteContent2()
        {
            var paging = new ArmSensorHistroyPaging(device);
            paging.InitFrame(FrameWhiteCentet2);
        }
        #endregion
@@ -114,10 +116,10 @@
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(() => {
                var temp = device.status.Find((sta) => sta.key == FunctionAttributeKey.Status);
                var temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.Status);
                if (temp != null)
                {
                    if (temp.value == "alarm")
                    if (temp.state == "alarm")
                    {
                        btnIcon.IsSelected = true;
                        btnSuctionView.TextID = StringId.InAlarm;
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs
@@ -79,6 +79,8 @@
        /// </summary>
        private void InitFrameWhiteContent2()
        {
            var paging = new ArmSensorHistroyPaging(device);
            paging.InitFrame(FrameWhiteCentet2);
        }
        #endregion
@@ -114,10 +116,10 @@
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(() => {
                var temp = device.status.Find((sta) => sta.key == FunctionAttributeKey.Status);
                var temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.Status);
                if (temp != null)
                {
                    if (temp.value == "alarm")
                    if (temp.state == "alarm")
                    {
                        btnIcon.IsSelected = true;
                        btnSuctionView.TextID = StringId.WaterLeakage;
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs
@@ -40,7 +40,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Curtain curtain;
        Curtain curtainTemp = new Curtain();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -49,10 +50,10 @@
        /// </summary>
        Action actionRefresh;
        #endregion
        public CurtainModulePage(Curtain func)
        public CurtainModulePage(Function func)
        {
            bodyView = this;
            curtain = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -81,7 +82,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = curtain.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -94,7 +95,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = curtain.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -106,7 +107,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = curtain.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -134,7 +135,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
                IsSelected = curtain.trait_on_off.curValue.ToString() == "off",
                IsSelected = function.trait_on_off.curValue.ToString() == "off",
            };
            controlView.AddChidren(btnCurtainClose);
@@ -146,7 +147,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png",
                IsSelected = curtain.trait_on_off.curValue.ToString() == "stop",
                IsSelected = function.trait_on_off.curValue.ToString() == "stop",
            };
            controlView.AddChidren(btnCurtainStop);
@@ -158,15 +159,15 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
                IsSelected = curtain.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
            };
            controlView.AddChidren(btnCurtainOpen);
            LoadEventList();
            new TopViewDiv(bodyView,Language.StringByID(StringId.Curtain)).LoadTopView_FunctionTop(curtain, actionRefresh);
            new TopViewDiv(bodyView,Language.StringByID(StringId.Curtain)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(curtain);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
@@ -10,37 +10,37 @@
        /// <summary>
        /// æ›´æ–°çª—帘状态
        /// </summary>
        public static void UpdataState(Curtain uCurtain)
        public static void UpdataState(Function updataTemp)
        {
            Application.RunOnMainThread((Action)(() => {
            Application.RunOnMainThread(() => {
                if(bodyView == null)
                {
                    return;
                }
                if (uCurtain.spk == bodyView.curtain.spk && uCurtain.sid == bodyView.curtain.sid)
                if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
                {
                    if (uCurtain.trait_on_off.curValue.ToString() == "stop")
                    if (updataTemp.trait_on_off.curValue.ToString() == "stop")
                    {
                        bodyView.btnCurtainOpen.IsSelected = false;
                        bodyView.btnCurtainClose.IsSelected = false;
                        bodyView.btnCurtainStop.IsSelected = true;
                        //bodyView.btnCurtainOpen.IsSelected = false;
                        //bodyView.btnCurtainClose.IsSelected = false;
                        //bodyView.btnCurtainStop.IsSelected = true;
                    }
                    else if (uCurtain.trait_on_off.curValue.ToString() == "on")
                    else if (updataTemp.trait_on_off.curValue.ToString() == "on")
                    {
                        bodyView.btnCurtainOpen.IsSelected = true;
                        bodyView.btnCurtainClose.IsSelected = false;
                        bodyView.btnCurtainStop.IsSelected = false;
                        //bodyView.btnCurtainOpen.IsSelected = true;
                        //bodyView.btnCurtainClose.IsSelected = false;
                        //bodyView.btnCurtainStop.IsSelected = false;
                        bodyView.btnCurtainBgIcon.IsSelected = true;
                    }
                    else if (uCurtain.trait_on_off.curValue.ToString() == "off")
                    else if (updataTemp.trait_on_off.curValue.ToString() == "off")
                    {
                        bodyView.btnCurtainOpen.IsSelected = false;
                        bodyView.btnCurtainClose.IsSelected = true;
                        bodyView.btnCurtainStop.IsSelected = false;
                        //bodyView.btnCurtainOpen.IsSelected = false;
                        //bodyView.btnCurtainClose.IsSelected = true;
                        //bodyView.btnCurtainStop.IsSelected = false;
                        bodyView.btnCurtainBgIcon.IsSelected = false;
                    }
                }
            }));
            });
        }
        void LoadEventList()
@@ -49,11 +49,11 @@
            LoadEvent_ControlEvent();
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = curtain.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = curtain.GetRoomListName();
                //curtain.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
            UpdataState(curtain);
            UpdataState(function);
        }
        /// <summary>
        /// æ”¶è—åŠŸèƒ½æŒ‰é’®äº‹ä»¶
@@ -61,8 +61,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                curtain.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -72,49 +72,59 @@
        void LoadEvent_ControlEvent()
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) => {
                btnCurtainClose.IsSelected = true;
                btnCurtainStop.IsSelected = false;
                btnCurtainOpen.IsSelected = false;
                new System.Threading.Thread(() => {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() => {
                        btnCurtainClose.IsSelected = false;
                    });
                }) { IsBackground = true }.Start();
                btnCurtainBgIcon.IsSelected = false;
                curtain.trait_on_off.curValue = "off";
                //Control.Send(CommandType_A.write,curtain);
                function.trait_on_off.curValue = "off";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
                d.Add("on_off", function.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
            //btnCurtainStop.MouseDownEventHandler = (sender, e) =>
            //{
            //    btnCurtainStop.IsSelected = true;
            //    //btnCurtainClose.IsSelected = false;
            //    //btnCurtainOpen.IsSelected = false;
            //};
            //btnCurtainOpen.MouseDownEventHandler = (sender, e) => {
            //    btnCurtainOpen.IsSelected = true;
            //};
            //btnCurtainClose.MouseDownEventHandler = (sender, e) => {
            //    btnCurtainClose.IsSelected = true;
            //};
            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
            };
            btnCurtainOpen.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = true;
            };
            btnCurtainClose.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = true;
            };
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = false;
                btnCurtainClose.IsSelected = false;
                btnCurtainStop.IsSelected = true;
                curtain.trait_on_off.curValue = "stop";
                new System.Threading.Thread(() => {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() => {
                        btnCurtainStop.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
                d.Add("on_off", function.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainStop.IsSelected = false;
                new System.Threading.Thread(() => {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() => {
                        btnCurtainOpen.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                btnCurtainBgIcon.IsSelected = true;
                curtain.trait_on_off.curValue = "on";
                function.trait_on_off.curValue = "on";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
                d.Add("on_off", function.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPage.cs
@@ -52,7 +52,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Curtain curtain;
        Curtain curtainTemp = new Curtain();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -66,10 +67,10 @@
        /// </summary>
        bool onControl = false;
        public MotorCurtainPage(Curtain func)
        public MotorCurtainPage(Function func)
        {
            bodyView = this;
            curtain = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -99,7 +100,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = curtain.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -112,7 +113,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = curtain.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -124,7 +125,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = curtain.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -139,9 +140,9 @@
                Y = Application.GetRealHeight(130),
                Width = Application.GetRealWidth(250),
                Height = Application.GetRealWidth(177),
                Progress = curtain.percent,
                Progress = curtainTemp.GetPercent(function),
                ProgressTextColor =0x00000000,
                IsInvertedProgress = true,
                //IsInvertedProgress = true,
            };
            controlView.AddChidren(curtainSeekBar);
@@ -202,6 +203,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
                IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0"
            };
            controlView.AddChidren(btnCurtainClose);
@@ -224,14 +226,15 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
                IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0"
            };
            controlView.AddChidren(btnCurtainOpen);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Curtain)).LoadTopView_FunctionTop(curtain,actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Curtain)).LoadTopView_FunctionTop(function,actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(curtain);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -9,39 +9,29 @@
        /// <summary>
        /// æ›´æ–°çª—帘
        /// </summary>
        /// <param name="uCurtain"></param>
        public static void UpdataState(Curtain uCurtain)
        /// <param name="updateTemp"></param>
        public static void UpdataState(Function updateTemp)
        {
            Application.RunOnMainThread((Action)(() => {
                if (bodyView == null)
                    return;
                if (bodyView.onControl)
                    return;
                if (uCurtain.spk == bodyView.curtain.spk && uCurtain.sid == bodyView.curtain.sid)
                if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
                {
                    if (uCurtain.trait_on_off.curValue.ToString() == "stop")
                    var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent);
                    if (percentString != null)
                    {
                        bodyView.btnCurtainOpen.IsSelected = false;
                        bodyView.btnCurtainClose.IsSelected = false;
                        bodyView.btnCurtainStop.IsSelected = true;
                    }
                    else if (uCurtain.trait_on_off.curValue.ToString() == "on")
                    {
                        bodyView.btnCurtainOpen.IsSelected = true;
                        bodyView.btnCurtainClose.IsSelected = false;
                        bodyView.btnCurtainStop.IsSelected = false;
                    }
                    else if (uCurtain.trait_on_off.curValue.ToString() == "off")
                    {
                        bodyView.btnCurtainOpen.IsSelected = false;
                        bodyView.btnCurtainClose.IsSelected = true;
                        bodyView.btnCurtainStop.IsSelected = false;
                        int percent = 0;
                        int.TryParse(percentString, out percent);
                        bodyView.btnCurtainOpen.IsSelected = percent > 0;
                        bodyView.btnCurtainClose.IsSelected = percent == 0;
                    }
                    try
                    {
                        if (!bodyView.onCurtainAnimation)
                        {
                            bodyView.CurtainAnimation(Convert.ToInt32(uCurtain.trait_percent.curValue.ToString()));
                            bodyView.CurtainAnimation(Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent)));
                        }
                    }
                    catch { }
@@ -122,9 +112,9 @@
            //回退刷新信息事件
            actionRefresh = () =>
            {
                btnFunctionName.Text = btnFunctionName_Out.Text = curtain.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = curtain.GetRoomListName();
                //curtain.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
        /// <summary>
@@ -134,8 +124,8 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                curtain.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -146,60 +136,88 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = true;
                btnCurtainOpen.IsSelected = false;
                btnCurtainStop.IsSelected = false;
                curtain.trait_on_off.curValue = "off";
                curtain.percent = 100;
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainClose.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "off";
                function.SetAttrState(FunctionAttributeKey.Percent, 0);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                CurtainAnimation(curtain.percent);
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(0);
            };
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainOpen.IsSelected = false;
                curtain.trait_on_off.curValue = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                onCurtainAnimation = false;
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnCurtainStop.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
            };
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = false;
                btnCurtainStop.IsSelected = false;
                btnCurtainOpen.IsSelected = true;
                curtain.trait_on_off.curValue = "on";
                curtain.percent = 0;
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainOpen.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "on";
                function.SetAttrState(FunctionAttributeKey.Percent, 100);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                CurtainAnimation(curtain.percent);
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(100);
            };
            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
            };
            btnCurtainOpen.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = true;
                btnCurtainClose.IsSelected = false;
            };
            btnCurtainClose.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = true;
                btnCurtainOpen.IsSelected = false;
            };
            //btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
            //{
            //    curtain.percent--;
            //    controlBar.Progress = curtain.percent;
            //    function.percent--;
            //    controlBar.Progress = function.percent;
            //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //    d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString());
            //    DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
            //    d.Add(FunctionAttributeKey.Percent, function.percent.ToString());
            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //};
            //btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
            //{
            //    curtain.percent++;
            //    controlBar.Progress = curtain.percent;
            //    function.percent++;
            //    controlBar.Progress = function.percent;
            //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //    d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString());
            //    DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
            //    d.Add(FunctionAttributeKey.Percent, function.percent.ToString());
            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //};
            //curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
@@ -207,13 +225,13 @@
            //    controlBar.Progress = curtainSeekBar.Progress;
            //    new System.Threading.Thread(() =>
            //    {
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300)
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300)
            //        {
            //            curtain.percent = e;
            //            curtain.refreshTime = DateTime.Now;
            //            function.percent = e;
            //            function.refreshTime = DateTime.Now;
            //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //            d.Add("percent", curtain.percent.ToString());
            //            Control.SendWriteCommand(curtain, d);
            //            d.Add("percent", function.percent.ToString());
            //            Control.SendWriteCommand(function, d);
            //        }
            //    })
            //    { IsBackground = true }.Start();
@@ -223,11 +241,11 @@
                //controlBar.Progress = curtainSeekBar.Progress;
                new System.Threading.Thread(() =>
                {
                    curtain.percent = e;
                    curtain.refreshTime = DateTime.Now;
                    function.SetAttrState(FunctionAttributeKey.Percent, e);
                    function.refreshTime = DateTime.Now;
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                    d.Add(FunctionAttributeKey.Percent, e.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
@@ -237,13 +255,13 @@
            //    curtainSeekBar.Progress = controlBar.Progress;
            //    new System.Threading.Thread(() =>
            //    {
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300)
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300)
            //        {
            //            curtain.percent = e;
            //            curtain.refreshTime = DateTime.Now;
            //            function.percent = e;
            //            function.refreshTime = DateTime.Now;
            //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //            d.Add("percent", curtain.percent.ToString());
            //            Control.SendWriteCommand(curtain, d);
            //            d.Add("percent", function.percent.ToString());
            //            Control.SendWriteCommand(function, d);
            //        }
            //    })
            //    { IsBackground = true }.Start();
@@ -254,11 +272,11 @@
            //    curtainSeekBar.Progress = controlBar.Progress;
            //    new System.Threading.Thread(() =>
            //    {
            //        curtain.percent = e;
            //        curtain.refreshTime = DateTime.Now;
            //        function.percent = e;
            //        function.refreshTime = DateTime.Now;
            //        System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //        d.Add("percent", curtain.percent.ToString());
            //        DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
            //        d.Add("percent", function.percent.ToString());
            //        DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //    })
            //    { IsBackground = true }.Start();
            //};
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPage.cs
@@ -53,7 +53,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Curtain curtain;
        Curtain curtainTemp = new Curtain();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -66,10 +67,10 @@
        /// æ­£åœ¨æŽ§åˆ¶
        /// </summary>
        bool onControl = false;
        public RollingShutterPage(Curtain func)
        public RollingShutterPage(Function func)
        {
            bodyView = this;
            curtain = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -99,7 +100,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = curtain.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -112,7 +113,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = curtain.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -124,7 +125,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = curtain.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -139,7 +140,7 @@
                Y = Application.GetRealHeight(130),
                Width = Application.GetRealWidth(170),
                Height = Application.GetRealWidth(210),
                Progress = curtain.percent,
                Progress = curtainTemp.GetPercent(function),
                //IsInvertedProgress = true,
                ProgressTextColor = 0x00000000,
            };
@@ -173,7 +174,7 @@
                ProgressTextSize = 0x00000000,
                MaxValue = 100,
                SeekBarPadding = Application.GetRealWidth(20),
                Progress = curtain.percent,
                Progress = curtainTemp.GetPercent(function),
                Visible = false,
                Enable = false,
            };
@@ -202,6 +203,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
                IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0",
            };
            controlView.AddChidren(btnCurtainClose);
@@ -224,14 +226,15 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
                IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0",
            };
            controlView.AddChidren(btnCurtainOpen);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Curtain)).LoadTopView_FunctionTop(curtain, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Curtain)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(curtain);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -9,44 +9,31 @@
        /// <summary>
        /// æ›´æ–°çª—帘
        /// </summary>
        /// <param name="uCurtain"></param>
        public static void UpdataState(Curtain uCurtain)
        /// <param name="updateTemp"></param>
        public static void UpdataState(Function updateTemp)
        {
            Application.RunOnMainThread((Action)(() => {
            Application.RunOnMainThread(() => {
                if (bodyView == null)
                    return;
                if (bodyView.onControl)
                    return;
                if (uCurtain.spk == bodyView.curtain.spk && uCurtain.sid == bodyView.curtain.sid)
                if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
                {
                    if (uCurtain.trait_on_off.curValue.ToString() == "stop")
                    {
                        bodyView.btnCurtainOpen.IsSelected = false;
                        bodyView.btnCurtainClose.IsSelected = false;
                        bodyView.btnCurtainStop.IsSelected = true;
                    }
                    else if (uCurtain.trait_on_off.curValue.ToString() == "on")
                    {
                        bodyView.btnCurtainOpen.IsSelected = true;
                        bodyView.btnCurtainClose.IsSelected = false;
                        bodyView.btnCurtainStop.IsSelected = false;
                    }
                    else if (uCurtain.trait_on_off.curValue.ToString() == "off")
                    {
                        bodyView.btnCurtainOpen.IsSelected = false;
                        bodyView.btnCurtainClose.IsSelected = true;
                        bodyView.btnCurtainStop.IsSelected = false;
                    }
                    var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent);
                    int percent = 0;
                    int.TryParse(percentString, out percent);
                    bodyView.btnCurtainOpen.IsSelected = percent > 0;
                    bodyView.btnCurtainClose.IsSelected = percent == 0;
                    try
                    {
                        if (!bodyView.onCurtainAnimation)
                        {
                            bodyView.CurtainAnimation(Convert.ToInt32(uCurtain.trait_percent.curValue.ToString()));
                            bodyView.CurtainAnimation(Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent)));
                        }
                    }
                    catch { }
                }
            }));
            });
        }
        /// <summary>
@@ -122,9 +109,9 @@
            //回退刷新信息事件
            actionRefresh = () =>
            {
                btnFunctionName.Text = btnFunctionName_Out.Text = curtain.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = curtain.GetRoomListName();
                //curtain.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
        /// <summary>
@@ -134,8 +121,8 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = curtain.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                curtain.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -146,72 +133,101 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = false;
                btnCurtainClose.IsSelected = true;
                btnCurtainStop.IsSelected = false;
                curtain.trait_on_off.curValue = "off";
                curtain.percent = 100;
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainClose.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "off";
                function.SetAttrState(FunctionAttributeKey.Percent, 0);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                CurtainAnimation(curtain.percent);
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(0);
            };
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainOpen.IsSelected = false;
                curtain.trait_on_off.curValue = "stop";
                new System.Threading.Thread(() => {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() => {
                        btnCurtainStop.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                onCurtainAnimation = false;
            };
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = false;
                btnCurtainStop.IsSelected = false;
                btnCurtainOpen.IsSelected = true;
                curtain.trait_on_off.curValue = "on";
                curtain.percent = 0;
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainOpen.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "on";
                function.SetAttrState(FunctionAttributeKey.Percent, 100);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                CurtainAnimation(curtain.percent);
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(100);
            };
            btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
            {
                curtain.percent--;
                controlBar.Progress = curtain.percent;
                controlBar.Progress -= 1;
                function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
            };
            btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
            {
                curtain.percent++;
                controlBar.Progress = curtain.percent;
                controlBar.Progress += 1;
                function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
            };
            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
            };
            btnCurtainOpen.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = true;
                btnCurtainClose.IsSelected = false;
            };
            btnCurtainClose.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = true;
                btnCurtainOpen.IsSelected = false;
            };
            //curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
            //{
            //    controlBar.Progress = curtainSeekBar.Progress;
            //    new System.Threading.Thread(() =>
            //    {
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300)
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300)
            //        {
            //            curtain.percent = e;
            //            curtain.refreshTime = DateTime.Now;
            //            function.percent = e;
            //            function.refreshTime = DateTime.Now;
            //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //            d.Add("percent", curtain.percent.ToString());
            //            Control.SendWriteCommand(curtain, d);
            //            d.Add("percent", function.percent.ToString());
            //            Control.SendWriteCommand(function, d);
            //        }
            //    })
            //    { IsBackground = true }.Start();
@@ -221,11 +237,11 @@
                controlBar.Progress = curtainSeekBar.Progress;
                new System.Threading.Thread(() =>
                {
                    curtain.percent = e;
                    curtain.refreshTime = DateTime.Now;
                    function.SetAttrState(FunctionAttributeKey.Percent, e);
                    function.refreshTime = DateTime.Now;
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Percent, curtain.percent.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                    d.Add(FunctionAttributeKey.Percent, e.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
@@ -235,13 +251,13 @@
            //    curtainSeekBar.Progress = controlBar.Progress;
            //    new System.Threading.Thread(() =>
            //    {
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300)
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300)
            //        {
            //            curtain.percent = e;
            //            curtain.refreshTime = DateTime.Now;
            //            function.percent = e;
            //            function.refreshTime = DateTime.Now;
            //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //            d.Add("percent", curtain.percent.ToString());
            //            Control.SendWriteCommand(curtain, d);
            //            d.Add("percent", function.percent.ToString());
            //            Control.SendWriteCommand(function, d);
            //        }
            //    })
            //    { IsBackground = true }.Start();
@@ -252,11 +268,11 @@
                curtainSeekBar.Progress = controlBar.Progress;
                new System.Threading.Thread(() =>
                {
                    curtain.percent = e;
                    curtain.refreshTime = DateTime.Now;
                    function.SetAttrState(FunctionAttributeKey.Percent, e);
                    function.refreshTime = DateTime.Now;
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("percent", curtain.percent.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(curtain, d);
                    d.Add("percent", e.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs
@@ -64,8 +64,6 @@
            //初始化第一个索引页的内容
            this.InitFrameWhiteContent1();
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(this.device);
            //刷新界面状态
            this.RefreshFormStatu();
            //读取状态
@@ -126,6 +124,62 @@
            };
            FrameWhiteCentet1.AddChidren(btnDown);
            #region æŽ§åˆ¶
            btnUp.MouseDownEventHandler = (sender, e) => {
                btnUp.IsSelected = true;
            };
            btnUp.MouseUpEventHandler = (sender, e) => {
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnUp.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Position, "up");
                Control.Ins.SendWriteCommand(device, d);
            };
            //----
            btnStop.MouseDownEventHandler = (sender, e) => {
                btnStop.IsSelected = true;
            };
            btnStop.MouseUpEventHandler = (sender, e) => {
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnStop.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Position, "stop");
                Control.Ins.SendWriteCommand(device, d);
            };
            //-----
            btnDown.MouseDownEventHandler = (sender, e) => {
                btnDown.IsSelected = true;
            };
            btnDown.MouseUpEventHandler = (sender, e) => {
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnDown.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Position, "down");
                Control.Ins.SendWriteCommand(device, d);
            };
            #endregion
            #endregion
            #region èœå•
@@ -152,10 +206,12 @@
            {
                FrameWhiteCentet1.AddChidren(hotDryView);
                EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                    device.SetAttrState(FunctionAttributeKey.HotDry, "true");
                EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                {
                    string onoff = hotDryView.Lighting ? "false" : "true";
                    device.SetAttrState(FunctionAttributeKey.HotDry, onoff);
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.HotDry, "true");
                    d.Add(FunctionAttributeKey.HotDry, onoff);
                    Control.Ins.SendWriteCommand(device, d);
                };
                hotDryView.SetThouchEvent(eventHandler);
@@ -173,16 +229,18 @@
            windDryView.Height = Application.GetRealHeight(74);
            if (attrs.Contains(menu[1]))
            {
                if(index == 1)
                if (index == 1)
                {
                    windDryView.Gravity = Gravity.CenterHorizontal;
                }
                FrameWhiteCentet1.AddChidren(windDryView);
                EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                    device.SetAttrState(FunctionAttributeKey.WindDry, "true");
                EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                {
                    string onoff = windDryView.Lighting ? "false" : "true";
                    device.SetAttrState(FunctionAttributeKey.WindDry, onoff);
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.WindDry, "true");
                    d.Add(FunctionAttributeKey.WindDry, onoff);
                    Control.Ins.SendWriteCommand(device, d);
                };
                windDryView.SetThouchEvent(eventHandler);
@@ -190,7 +248,7 @@
                index++;
            }
            disinfectView = new ClothesHangerControl(
                                "FunctionIcon/Electrical/ClothesHanger/ClothesHangerDisinfectIcon.png",
@@ -202,7 +260,7 @@
            disinfectView.Height = Application.GetRealHeight(74);
            if (attrs.Contains(menu[2]))
            {
                if(index == 1)
                if (index == 1)
                {
                    disinfectView.Gravity = Gravity.CenterHorizontal;
                }
@@ -212,10 +270,12 @@
                }
                FrameWhiteCentet1.AddChidren(disinfectView);
                EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                    device.SetAttrState(FunctionAttributeKey.Disinfect, "true");
                EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                {
                    string onoff = disinfectView.Lighting ? "false" : "true";
                    device.SetAttrState(FunctionAttributeKey.Disinfect, onoff);
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Disinfect, "true");
                    d.Add(FunctionAttributeKey.Disinfect, onoff);
                    Control.Ins.SendWriteCommand(device, d);
                };
                disinfectView.SetThouchEvent(eventHandler);
@@ -232,10 +292,11 @@
            lightingView.Height = Application.GetRealHeight(74);
            if (attrs.Contains(menu[3]))
            {
                if(index >2)
                if (index > 2)
                {
                    lightingView.Y = Application.GetRealHeight(409);
                }else
                }
                else
                {
                    lightingView.Y = Application.GetRealHeight(304);
                    if (index == 1)
@@ -249,7 +310,8 @@
                }
                FrameWhiteCentet1.AddChidren(lightingView);
                EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                {
                    string onoff = lightingView.Lighting ? "off" : "on";
                    device.SetAttrState(FunctionAttributeKey.OnOff, onoff);
                    Dictionary<string, string> d = new Dictionary<string, string>();
@@ -260,6 +322,32 @@
                index++;
            }
            #endregion
            #region æ—¶é—´è®¾ç½®
            var timeSetView = new ClothesHangerControl(
                                "FunctionIcon/Electrical/ClothesHanger/ClothesHangerTimeIcon.png",
                                "FunctionIcon/Electrical/ClothesHanger/ClothesHangerTimeIconOn.png",
                                Language.StringByID(StringId.Time),
                                "");
            timeSetView.Width = Application.GetRealWidth(96);
            timeSetView.Height = Application.GetRealHeight(74);
            timeSetView.Y = Application.GetRealHeight(409);
            timeSetView.X = Application.GetRealWidth(266 - 33);
            EventHandler<MouseEventArgs> eventHandler_timeSetView = (sender, e) =>
            {
                var setTimePage = new ClothesHangerSetTimePage(device);
                MainPage.BasePageView.AddChidren(setTimePage);
                setTimePage.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            timeSetView.SetThouchEvent(eventHandler_timeSetView);
            FrameWhiteCentet1.AddChidren(timeSetView);
            #endregion
        }
@@ -276,8 +364,6 @@
            //不是同一个东西
            if (this.device.sid != i_LocalDevice.sid) { return; }
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(i_LocalDevice);
            //刷新界面状态
            this.RefreshFormStatu();
        }
@@ -295,46 +381,47 @@
        /// </summary>
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(() => {
            Application.RunOnMainThread(() =>
            {
                btnIcon.IsSelected = true;
                #region ç‚¹äº®æ–‡æœ¬
                var hotDryTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.HotDry);
                var hotDryTemp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.HotDry);
                if (hotDryTemp != null)
                {
                    hotDryView.SetViewStatus(hotDryTemp.value == "true");
                    hotDryView.SetViewStatus(hotDryTemp.state == "true");
                }
                var windDryTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.WindDry);
                var windDryTemp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.WindDry);
                if (windDryTemp != null)
                {
                    windDryView.SetViewStatus(windDryTemp.value == "true");
                    windDryView.SetViewStatus(windDryTemp.state == "true");
                }
                var disinfectTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.Disinfect);
                var disinfectTemp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.Disinfect);
                if (disinfectTemp != null)
                {
                    disinfectView.SetViewStatus(disinfectTemp.value == "true");
                    disinfectView.SetViewStatus(disinfectTemp.state == "true");
                }
                var lightTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.OnOff);
                var lightTemp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.OnOff);
                if (lightTemp != null)
                {
                    lightingView.SetViewStatus(lightTemp.value == "on");
                    lightingView.SetViewStatus(lightTemp.state == "on");
                }
                #endregion
                #region ä¿®æ”¹æ—¶é—´
                var hotDryTimeLeftTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.HotDryTimeLeft);
                var hotDryTimeLeftTemp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.HotDryTimeLeft);
                if (hotDryTimeLeftTemp != null)
                {
                    hotDryView.ChangeTime(hotDryTimeLeftTemp.value);
                    hotDryView.ChangeTime(hotDryTimeLeftTemp.state);
                }
                var windDryTimeLeftTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.WindDryTimeLeft);
                var windDryTimeLeftTemp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.WindDryTimeLeft);
                if (windDryTimeLeftTemp != null)
                {
                    windDryView.ChangeTime(windDryTimeLeftTemp.value);
                    windDryView.ChangeTime(windDryTimeLeftTemp.state);
                }
                var disinfectTimeLeftTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.DisinfectTimeLeft);
                var disinfectTimeLeftTemp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.DisinfectTimeLeft);
                if (disinfectTimeLeftTemp != null)
                {
                    disinfectView.ChangeTime(disinfectTimeLeftTemp.value);
                    disinfectView.ChangeTime(disinfectTimeLeftTemp.state);
                }
                #endregion
@@ -346,18 +433,6 @@
        #region â–  ä¸€èˆ¬æ–¹æ³•___________________________
        /// <summary>
        /// åˆ·æ–°å½“前设备的状态缓存
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
            foreach (var data in i_LocalDevice.status)
            {
                //开关
                //if (data.key == "on_off") { this.weepRobotData.Cleaning = data.value.ToLower() == "on"; }
            }
        }
        #endregion
    }
@@ -367,11 +442,15 @@
        private Button btnTitle;
        private Button btnTime;
        /// <summary>
        /// å€’计时时间
        /// </summary>
        private int leftTime = 0;
        /// <summary>
        /// æŽ§ä»¶æ˜¯å¦ç‚¹äº®
        /// </summary>
        public bool Lighting = false;
        public ClothesHangerControl(string iconPath1, string iconPath2,string title,string time)
        public ClothesHangerControl(string iconPath1, string iconPath2, string title, string time)
        {
            btnIcon = new Button()
            {
@@ -397,7 +476,7 @@
            btnTime = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = btnTitle.Bottom,
                Y = Application.GetRealHeight(74-32),
                Height = Application.GetRealHeight(32),
                Text = time,
                TextColor = 0x00000000,
@@ -410,39 +489,34 @@
        /// ä¿®æ”¹æ˜¾ç¤ºæ—¶é—´
        /// </summary>
        /// <param name="newTime"></param>
        public void ChangeTime (string newTime)
        public void ChangeTime(string newTime)
        {
            if(newTime == "0")
            {
                newTime = "";
            }
            int time = 0;
            int.TryParse(newTime, out time);
            time = time * 60;
            int.TryParse(newTime, out leftTime);
            if (countdownThread == null)
            {
                countdownThread = new System.Threading.Thread(() => {
                    while(true)
                countdownThread = new System.Threading.Thread(() =>
                {
                    while (true)
                    {
                        if(time>1)
                        if (leftTime > 0)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                btnTime.Text = new TimeSpan(0, 0, time).ToString();
                                btnTime.Text = new TimeSpan(0, leftTime, 0).ToString().Remove(5,3) ;
                            });
                            System.Threading.Thread.Sleep(1000);
                            time--;
                        }else
                            leftTime--;
                        }
                        else if(leftTime == 0)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                btnTime.Text = "";
                            });
                        }
                        System.Threading.Thread.Sleep(60000);
                    }
                }) { IsBackground = true };
                })
                { IsBackground = true };
                countdownThread.Start();
            }
        }
@@ -450,11 +524,6 @@
        public void SetViewStatus(bool state)
        {
            btnIcon.IsSelected = btnTitle.IsSelected = btnTime.IsSelected = Lighting = state;
        }
        public bool GetViewState()
        {
            return Lighting;
        }
        /// <summary>
@@ -472,4 +541,4 @@
        /// </summary>
        System.Threading.Thread countdownThread;
    }
}
}
HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerSetTimePage.cs
New file
@@ -0,0 +1,262 @@
using System;
using System.Collections.Generic;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.Stan;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public partial class ClothesHangerSetTimePage : FrameLayout
    {
        FrameLayout bodyView;
        Function device;
        public ClothesHangerSetTimePage(Function function)
        {
            device = function;
            bodyView = this;
        }
        /// <summary>
        /// åŠ è½½ç•Œé¢
        /// </summary>
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(StringId.Time)).LoadTopView();
            VerticalScrolViewLayout functionListView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(530),
                BackgroundColor = CSS_Color.BackgroundColor,
                ScrollEnabled = false,
            };
            bodyView.AddChidren(functionListView);
            /// <summary>
            /// å°æ—¶å–值范围
            /// </summary>
            List<int> hRange = new List<int> { 0, 1, 2, 3, 4 };
            /// <summary>
            /// åˆ†é’Ÿå–值范围
            /// </summary>
            List<int> mRange = new List<int> { 0, 30 };
            var menu = new List<string>() {
                FunctionAttributeKey.HotDryTime,
                FunctionAttributeKey.WindDryTime,
                FunctionAttributeKey.DisinfectTime,
                FunctionAttributeKey.AnionTime
            };
            List<string> attrs = device.GetAttributes();
            #region çƒ˜å¹²æ—¶é—´
            ListCellView hotDryTimeCell;
            hotDryTimeCell = new ListCellView()
            {
                Height = Application.GetRealHeight(50),
            };
            hotDryTimeCell.BtnTilte.TextID = StringId.HotDryTime;
            if (attrs.Contains(menu[0]))
            {
                var hotDryTime = 0;
                int.TryParse(device.GetAttrState(FunctionAttributeKey.HotDryTime), out hotDryTime);
                hotDryTimeCell.BtnSubtitle.Text = hotDryTime / 60 + Language.StringByID(StringId.HourUint) + hotDryTime % 60 + Language.StringByID(StringId.MinuteUint);
                functionListView.AddChidren(hotDryTimeCell);
                hotDryTimeCell.GoAction = () =>
                {
                    BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3, Language.StringByID(StringId.HotDryTime));
                    timeControl.RowHeight = Application.GetRealHeight(50);
                    timeControl.InitControl(0, 1, 162);
                    timeControl.ChangePickerEvent();
                    timeControl.FinishEvent = (type, hours, min) =>
                    {
                        if (type == 1)//0:取消;1:确定
                        {
                            HdlThreadLogic.Current.RunThread(() =>
                            {
                                var time = hours * 60 + min;
                                var dic = new Dictionary<string, string>();
                                dic.Add(FunctionAttributeKey.HotDryTime, time.ToString());
                                Control.Ins.SendWriteCommand(this.device, dic);
                                HdlThreadLogic.Current.RunMain(() =>
                                {
                                    hotDryTimeCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint);
                                });
                            });
                        }
                    };
                };
            }
            #endregion
            #region é£Žå¹²æ—¶é—´
            ListCellView windDryCell;
            windDryCell = new ListCellView()
            {
                Height = Application.GetRealHeight(50),
            };
            windDryCell.BtnTilte.TextID = StringId.WindDryTime;
            windDryCell.BtnSubtitle.Text = device.GetAttrState(FunctionAttributeKey.WindDryTime);
            if (attrs.Contains(menu[1]))
            {
                var windDryTime = 0;
                int.TryParse(device.GetAttrState(FunctionAttributeKey.WindDryTime), out windDryTime);
                windDryCell.BtnSubtitle.Text = windDryTime / 60 + Language.StringByID(StringId.HourUint) + windDryTime % 60 + Language.StringByID(StringId.MinuteUint);
                functionListView.AddChidren(windDryCell);
                windDryCell.GoAction = () =>
                {
                    BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3,Language.StringByID(StringId.WindDryTime));
                    timeControl.RowHeight = Application.GetRealHeight(50);
                    timeControl.InitControl(0, 1, 162);
                    timeControl.ChangePickerEvent();
                    timeControl.FinishEvent = (type, hours, min) =>
                    {
                        if (type == 1)//0:取消;1:确定
                        {
                            HdlThreadLogic.Current.RunThread(() =>
                            {
                                var time = hours * 60 + min;
                                var dic = new Dictionary<string, string>();
                                dic.Add(FunctionAttributeKey.WindDryTime, time.ToString());
                                Control.Ins.SendWriteCommand(this.device, dic);
                                HdlThreadLogic.Current.RunMain(() =>
                                {
                                    windDryCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint);
                                });
                            });
                        }
                    };
                };
            }
            else
            {
                hotDryTimeCell.LineView.RemoveFromParent();
            }
            #endregion
            #region æ¶ˆæ¯’æ—¶é—´
            ListCellView disinfectTimeCell;
            disinfectTimeCell = new ListCellView()
            {
                Height = Application.GetRealHeight(50),
            };
            disinfectTimeCell.BtnTilte.TextID = StringId.DisinfectTime;
            disinfectTimeCell.BtnSubtitle.Text = device.GetAttrState(FunctionAttributeKey.DisinfectTime);
            if (attrs.Contains(menu[2]))
            {
                var disinfectTime = 0;
                int.TryParse(device.GetAttrState(FunctionAttributeKey.DisinfectTime), out disinfectTime);
                disinfectTimeCell.BtnSubtitle.Text = disinfectTime / 60 + Language.StringByID(StringId.HourUint) + disinfectTime % 60 + Language.StringByID(StringId.MinuteUint);
                functionListView.AddChidren(disinfectTimeCell);
                disinfectTimeCell.GoAction = () => {
                    BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3, Language.StringByID(StringId.DisinfectTime));
                    timeControl.RowHeight = Application.GetRealHeight(50);
                    timeControl.InitControl(0, 1, 162);
                    timeControl.ChangePickerEvent();
                    timeControl.FinishEvent = (type, hours, min) => {
                        if (type == 1)//0:取消;1:确定
                        {
                            HdlThreadLogic.Current.RunThread(() =>
                            {
                                var time = hours * 60 + min;
                                var dic = new Dictionary<string, string>();
                                dic.Add(FunctionAttributeKey.DisinfectTime, time.ToString());
                                Control.Ins.SendWriteCommand(this.device, dic);
                                HdlThreadLogic.Current.RunMain(() =>
                                {
                                    disinfectTimeCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint);
                                });
                            });
                        }
                    };
                };
            }
            else
            {
                windDryCell.LineView.RemoveFromParent();
            }
            #endregion
            #region è´Ÿç¦»å­æ—¶é—´
            ListCellView anionTimeCell;
            anionTimeCell = new ListCellView()
            {
                Height = Application.GetRealHeight(50),
            };
            anionTimeCell.BtnTilte.TextID = StringId.AnionTime;
            anionTimeCell.BtnSubtitle.Text = device.GetAttrState(FunctionAttributeKey.AnionTime);
            if (attrs.Contains(menu[3]))
            {
                var anionTime = 0;
                int.TryParse(device.GetAttrState(FunctionAttributeKey.HotDryTime), out anionTime);
                anionTimeCell.BtnSubtitle.Text = anionTime / 60 + Language.StringByID(StringId.HourUint) + anionTime % 60 + Language.StringByID(StringId.MinuteUint);
                functionListView.AddChidren(anionTimeCell);
                anionTimeCell.LineView.RemoveFromParent();
                anionTimeCell.GoAction = () => {
                    BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3,Language.StringByID(StringId.AnionTime));
                    timeControl.RowHeight = Application.GetRealHeight(50);
                    timeControl.InitControl(0, 1, 162);
                    timeControl.ChangePickerEvent();
                    timeControl.FinishEvent = (type, hours, min) => {
                        if (type == 1)//0:取消;1:确定
                        {
                            HdlThreadLogic.Current.RunThread(() =>
                            {
                                var time = hours * 60 + min;
                                var dic = new Dictionary<string, string>();
                                dic.Add(FunctionAttributeKey.AnionTime, time.ToString());
                                Control.Ins.SendWriteCommand(this.device, dic);
                                HdlThreadLogic.Current.RunMain(() =>
                                {
                                    anionTimeCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint);
                                });
                            });
                        }
                    };
                };
            }
            else
            {
                disinfectTimeCell.LineView.RemoveFromParent();
            }
            #endregion
        }
    }
    //---------------------------------------
    public partial class ClothesHangerSetTimePage
    {
    }
    //========================================
}
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs
@@ -31,7 +31,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Fan fan;
        Fan fanTemp = new Fan();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -44,7 +45,7 @@
        public FanPage(Function func)
        {
            bodyView = this;
            fan = func as Fan;
            function = func;
        }
@@ -74,7 +75,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = fan.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -87,7 +88,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = fan.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -99,7 +100,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = fan.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -114,7 +115,7 @@
                Y = Application.GetRealHeight(100),
                Width = Application.GetRealWidth(198),
                Height = Application.GetRealWidth(198),
                IsSelected = fan.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
                SelectedImagePath = "FunctionIcon/Electrical/FanIconBg.png",
                UnSelectedImagePath = "FunctionIcon/Electrical/FanIconBgGray.png",
            };
@@ -166,17 +167,17 @@
                Height = Application.GetMinRealAverage(40),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = fan.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Fan)).LoadTopView_FunctionTop(fan, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Fan)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(fan);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
@@ -10,7 +10,7 @@
        /// <summary>
        /// æ›´æ–°ç¯å…‰çŠ¶æ€
        /// </summary>
        public static void UpdataState(Fan uFan)
        public static void UpdataState(Function updateTemp)
        {
            Application.RunOnMainThread(() =>
            {
@@ -18,9 +18,9 @@
                {
                    if (bodyView == null)
                        return;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uFan.trait_on_off.curValue.ToString() == "on";
                    bodyView.barGradualChange.ProgressBarColor = uFan.trait_on_off.curValue.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
                    bodyView.barGradualChange.Progress = uFan.openLevel;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.curValue.ToString() == "on";
                    bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.curValue.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
                    bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.OpenLevel));
                }
                catch (Exception ex)
                {
@@ -38,9 +38,9 @@
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = fan.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = fan.GetRoomListName();
                //fan.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
@@ -50,8 +50,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = fan.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                fan.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -66,11 +66,11 @@
                new System.Threading.Thread(() =>
                {
                    fan.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.fan);
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.function);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", fan.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(fan, d);
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
@@ -80,24 +80,22 @@
                new System.Threading.Thread(() =>
                {
                    fan.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.fan);
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", fan.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(fan, d);
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
            barGradualChange.OnProgressChangedEvent = (sender, e) => {
                fan.openLevel = e;
                function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString());
                new System.Threading.Thread(() =>
                {
                    fan.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.fan);
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", fan.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(fan, d);
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
@@ -30,7 +30,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        SwitchSocket socketFunction;
        SwitchSocket socketTemp;
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -43,7 +44,7 @@
        public SocketPage(Function func)
        {
            bodyView = this;
            socketFunction = func as SwitchSocket;
            function = func ;
        }
@@ -73,7 +74,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = socketFunction.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -86,7 +87,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = socketFunction.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -98,7 +99,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = socketFunction.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -113,7 +114,7 @@
                Y = Application.GetRealHeight(100),
                Width = Application.GetRealWidth(198),
                Height = Application.GetRealWidth(198),
                IsSelected = socketFunction.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
                UnSelectedImagePath = "FunctionIcon/Socket/SocketIconBg.png",
                SelectedImagePath = "FunctionIcon/Socket/SocketIconOnBg.png",  
            };
@@ -127,16 +128,16 @@
                Height = Application.GetMinRealAverage(40),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = socketFunction.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Socket)).LoadTopView_FunctionTop(socketFunction, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Socket)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(socketFunction);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs
@@ -10,7 +10,7 @@
        /// <summary>
        /// æ›´æ–°ç¯å…‰çŠ¶æ€
        /// </summary>
        public static void UpdataState(SwitchSocket uFan)
        public static void UpdataState(Function uFan)
        {
            Application.RunOnMainThread(() =>
            {
@@ -36,9 +36,9 @@
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = socketFunction.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = socketFunction.GetRoomListName();
                socketFunction.UpdataFuncitonInfo();
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                function.UpdataFuncitonInfo();
            };
        }
@@ -48,8 +48,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = socketFunction.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                socketFunction.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -64,11 +64,11 @@
                new System.Threading.Thread(() =>
                {
                    socketFunction.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.socketFunction);
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.function);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", socketFunction.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(socketFunction, d);
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
@@ -78,11 +78,11 @@
                new System.Threading.Thread(() =>
                {
                    socketFunction.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.socketFunction);
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.function);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", socketFunction.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(socketFunction, d);
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs
@@ -43,7 +43,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        TV tv;
        TV tvTemp = new TV();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -56,7 +57,7 @@
        public TVPage(Function func)
        {
            bodyView = this;
            tv = func as TV;
            function = func;
        }
@@ -86,7 +87,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = tv.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -99,7 +100,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = tv.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -111,7 +112,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = tv.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -335,8 +336,8 @@
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.TV)).LoadTopView_FunctionTop(tv, actionRefresh);
            DriverLayer.Control.Ins.SendReadCommand(tv);
            new TopViewDiv(bodyView, Language.StringByID(StringId.TV)).LoadTopView_FunctionTop(function, actionRefresh);
            DriverLayer.Control.Ins.SendReadCommand(function);
        }
@@ -420,7 +421,7 @@
                numberView.AddChidren(btn);
                btn.MouseUpEventHandler = (sender, e) => {
                    btn.IsSelected = false;
                    tv.ControlTV(i);
                    tvTemp.ControlTV(i,function);
                };
                btn.MouseDownEventHandler = (sender, e) => {
                    btn.IsSelected = true;
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
@@ -16,9 +16,9 @@
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = tv.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = tv.GetRoomListName();
                tv.UpdataFuncitonInfo();
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                function.UpdataFuncitonInfo();
            };
        }
@@ -28,8 +28,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = tv.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                tv.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -40,32 +40,32 @@
        {
            btnChangeTVAV.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.AV_TV);
                tvTemp.ControlTV(InfraredCode_TV.AV_TV,function);
            };
            btnChlPlus.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.ChannelUp);
                tvTemp.ControlTV(InfraredCode_TV.ChannelUp, function);
            };
            btnChlReduce.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.ChannelDown);
                tvTemp.ControlTV(InfraredCode_TV.ChannelDown, function);
            };
            btnVolPlus.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.VolUp);
                tvTemp.ControlTV(InfraredCode_TV.VolUp, function);
            };
            btnVolReduce.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.VolDown);
                tvTemp.ControlTV(InfraredCode_TV.VolDown, function);
            };
            btnBack.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.Back);
                tvTemp.ControlTV(InfraredCode_TV.Back, function);
            };
            btnMenu.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.Menu);
                tvTemp.ControlTV(InfraredCode_TV.Menu, function);
            };
            btn123.MouseUpEventHandler = (sender, e) =>
            {
@@ -73,27 +73,27 @@
            };
            btnMute.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.Mute);
                tvTemp.ControlTV(InfraredCode_TV.Mute, function);
            };
            btnPower.MouseUpEventHandler = (sender, e) =>
            {
                tv.ControlTV(InfraredCode_TV.Power);
                tvTemp.ControlTV(InfraredCode_TV.Power, function);
            };
            btnTopMenuUp.MouseUpEventHandler = (sender, e) => {
                tv.ControlTV(InfraredCode_TV.Up);
                tvTemp.ControlTV(InfraredCode_TV.Up, function);
            };
            btnTopMenuLeft.MouseUpEventHandler = (sender, e) => {
                tv.ControlTV(InfraredCode_TV.Left);
                tvTemp.ControlTV(InfraredCode_TV.Left, function);
            };
            btnTopMenuRight.MouseUpEventHandler = (sender, e) => {
                tv.ControlTV(InfraredCode_TV.Right);
                tvTemp.ControlTV(InfraredCode_TV.Right, function);
            };
            btnTopMenuDown.MouseUpEventHandler = (sender, e) => {
                tv.ControlTV(InfraredCode_TV.Down);
                tvTemp.ControlTV(InfraredCode_TV.Down, function);
            };
            btnOk.MouseUpEventHandler = (sender, e) => {
                tv.ControlTV(InfraredCode_TV.Confrim);
                tvTemp.ControlTV(InfraredCode_TV.Confrim, function);
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs
@@ -784,24 +784,25 @@
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
            foreach (var data in i_LocalDevice.status)
            for (int i = 0; i < i_LocalDevice.attributes.Count; i++)
            {
                var data = i_LocalDevice.attributes[i];
                //模式
                if (data.key == "mode") { this.airCleanerData.Mode = data.value; }
                if (data.key == "mode") { this.airCleanerData.Mode = data.state; }
                //风速档位
                else if (data.key == "speed") { this.airCleanerData.Gear = data.value; }
                else if (data.key == "speed") { this.airCleanerData.Gear = data.state; }
                //开关
                else if (data.key == "on_off") { this.airCleanerData.Open = data.value.ToLower() == "on"; }
                else if (data.key == "on_off") { this.airCleanerData.Open = data.state.ToLower() == "on"; }
                //童锁
                else if (data.key == "lock") { this.airCleanerData.Lock = data.value.ToLower() == "true"; }
                else if (data.key == "lock") { this.airCleanerData.Lock = data.state.ToLower() == "true"; }
                //滤芯复位
                else if (data.key == "filter_reset") { this.airCleanerData.FilterReset = data.value.ToLower() == "true"; }
                else if (data.key == "filter_reset") { this.airCleanerData.FilterReset = data.state.ToLower() == "true"; }
                //负离子
                else if (data.key == "anion") { this.airCleanerData.Anion = data.value.ToLower() == "true"; }
                else if (data.key == "anion") { this.airCleanerData.Anion = data.state.ToLower() == "true"; }
                //定时
                else if (data.key == "countdown")
                {
                    this.airCleanerData.Timing = data.value;
                    this.airCleanerData.Timing = data.state;
                    if (this.airCleanerData.Timing == "cancel")
                    {
                        this.airCleanerData.Timing = "0";
@@ -810,7 +811,7 @@
                //空气质量
                else if (data.key == "pm25")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.airCleanerData.PM25Value = Convert.ToInt32(value);
@@ -819,7 +820,7 @@
                //滤芯使用率
                else if (data.key == "filter")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.airCleanerData.FilterPersent = Convert.ToInt32(value);
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs
@@ -209,14 +209,15 @@
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
            foreach (var data in i_LocalDevice.status)
            for (int i = 0; i < i_LocalDevice.attributes.Count; i++)
            {
                var data = i_LocalDevice.attributes[i];
                //开关
                if (data.key == "on_off") { this.fanData.Open = data.value == "on"; }
                if (data.key == "on_off") { this.fanData.Open = data.state == "on"; }
                //风速档位
                else if (data.key == "fan_speed_percent")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.fanData.SpeedLevel = Convert.ToInt32(value);
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs
@@ -174,12 +174,12 @@
        {
            Application.RunOnMainThread(() =>
            {
                var onoffStatu = device.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff);
                var timeStatu = device.status.Find((obj) => obj.key == FunctionAttributeKey.TuyaWaterTime);
                var onoffStatu = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.OnOff);
                var timeStatu = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.TuyaWaterTime);
                if (onoffStatu != null)
                {
                    if (onoffStatu.value.ToString() == "on")
                    if (onoffStatu.state == "on")
                    {
                        btnControlTip.TextID = StringId.ControllerOn;
                    }
@@ -191,7 +191,7 @@
                }
                if (timeStatu != null)
                {
                    int.TryParse(timeStatu.value, out waterRunningTime);
                    int.TryParse(timeStatu.state, out waterRunningTime);
                }
                RefreshTimeButton();
            });
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotConsumablesMagPage.cs
old mode 100755 new mode 100644
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs
@@ -336,26 +336,26 @@
            dialogBody.AddChidren(menuContr);
            //自动清扫
            var iconPath = this.weepRobotData.Mode == "random" ? "FunctionIcon/Electrical/WeepRobot/AutoModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/AutoMode.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.AutoClean), iconPath, this.weepRobotData.Mode == "random", () =>
            {
                frameBack.Close();
                //发送模式命令
                this.SendComand("mode", "random");
            });
            //定点清扫
            iconPath = this.weepRobotData.Mode == "smart" ? "FunctionIcon/Electrical/WeepRobot/FixedPointModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/FixedPointMode.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.FixedPointClean), iconPath, this.weepRobotData.Mode == "smart", () =>
            var iconPath = this.weepRobotData.Mode == "smart" ? "FunctionIcon/Electrical/WeepRobot/AutoModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/AutoMode.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.AutoClean), iconPath, this.weepRobotData.Mode == "smart", () =>
            {
                frameBack.Close();
                //发送模式命令
                this.SendComand("mode", "smart");
            });
            //区域清扫
            //随机清扫
            iconPath = this.weepRobotData.Mode == "random" ? "FunctionIcon/Electrical/WeepRobot/FixedPointModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/FixedPointMode.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.RandomClean), iconPath, this.weepRobotData.Mode == "random", () =>
            {
                frameBack.Close();
                //发送模式命令
                this.SendComand("mode", "random");
            });
            //螺旋清扫
            iconPath = this.weepRobotData.Mode == "spiral" ? "FunctionIcon/Electrical/WeepRobot/AreaModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/AreaMode.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.AreaClean), iconPath, this.weepRobotData.Mode == "spiral", () =>
            menuContr.AddRowMenu(Language.StringByID(StringId.SpiralClean), iconPath, this.weepRobotData.Mode == "spiral", () =>
            {
                frameBack.Close();
                //发送模式命令
@@ -522,10 +522,10 @@
            }
            else if (this.weepRobotData.Mode == "smart")
            {
                //定点清扫
                //随机清扫
                this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/FixedPointMode.png";
                this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/FixedPointModeSelect.png";
                this.btnModeView.TextID = StringId.FixedPointClean;
                this.btnModeView.TextID = StringId.RandomClean;
            }
            else if (this.weepRobotData.Mode == "wall_follow")
            {
@@ -536,10 +536,10 @@
            }
            else if (this.weepRobotData.Mode == "spiral")
            {
                //区域清扫
                //螺旋清扫
                this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/AreaMode.png";
                this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/AreaModeSelect.png";
                this.btnModeView.TextID = StringId.AreaClean;
                this.btnModeView.TextID = StringId.SpiralClean;
            }
            else
            {
@@ -561,42 +561,42 @@
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
            for (int i = 0; i < i_LocalDevice.status.Count; i++)
            for (int i = 0; i < i_LocalDevice.attributes.Count; i++)
            {
                var data = i_LocalDevice.status[i];
                var data = i_LocalDevice.attributes[i];
                //开关
                if (data.key == "on_off") { this.weepRobotData.Cleaning = data.value.ToLower() == "on"; }
                if (data.key == "on_off") { this.weepRobotData.Cleaning = data.state.ToLower() == "on"; }
                //寻找机器
                else if (data.key == "seek") { this.weepRobotData.SearchRobot = data.value.ToLower() == "true"; }
                else if (data.key == "seek") { this.weepRobotData.SearchRobot = data.state.ToLower() == "true"; }
                //边刷重置
                else if (data.key == "reset_edge_brush") { this.weepRobotData.ResetEdgeBrush = data.value.ToLower() == "true"; }
                else if (data.key == "reset_edge_brush") { this.weepRobotData.ResetEdgeBrush = data.state.ToLower() == "true"; }
                //滚刷重置
                else if (data.key == "reset_roll_brush") { this.weepRobotData.ResetRollBrush = data.value.ToLower() == "true"; }
                else if (data.key == "reset_roll_brush") { this.weepRobotData.ResetRollBrush = data.state.ToLower() == "true"; }
                //滤网重置
                else if (data.key == "reset_filter") { this.weepRobotData.ResetFilter = data.value.ToLower() == "true"; }
                else if (data.key == "reset_filter") { this.weepRobotData.ResetFilter = data.state.ToLower() == "true"; }
                //吸力选择
                else if (data.key == "suction") { this.weepRobotData.Suction = data.value; }
                else if (data.key == "suction") { this.weepRobotData.Suction = data.state; }
                //工作模式
                else if (data.key == "mode") { this.weepRobotData.Mode = data.value; }
                else if (data.key == "mode") { this.weepRobotData.Mode = data.state; }
                //清扫方向    
                else if (data.key == "direction_control") { this.weepRobotData.DirectionControl = data.value; }
                else if (data.key == "direction_control") { this.weepRobotData.DirectionControl = data.state; }
                //声音开关
                else if (data.key == "voice_switch") { this.weepRobotData.VoiceSwitch = data.value.ToLower() == "true"; }
                else if (data.key == "voice_switch") { this.weepRobotData.VoiceSwitch = data.state.ToLower() == "true"; }
                //清扫面积
                else if (data.key == "clean_area")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.weepRobotData.CleanArea = Convert.ToInt32(value);
                    }
                }
                //清扫记录    
                else if (data.key == "clean_record") { this.weepRobotData.CleanRecord = data.value; }
                else if (data.key == "clean_record") { this.weepRobotData.CleanRecord = data.state; }
                //边刷寿命
                else if (data.key == "edge_brush")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.weepRobotData.EdgeBrush = Convert.ToInt32(value);
@@ -605,7 +605,7 @@
                //滚刷寿命
                else if (data.key == "roll_brush")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.weepRobotData.RollBrush = Convert.ToInt32(value);
@@ -614,7 +614,7 @@
                //滤网寿命
                else if (data.key == "filter")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.weepRobotData.Filter = Convert.ToInt32(value);
@@ -623,7 +623,7 @@
                //清扫时间
                else if (data.key == "clean_time")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.weepRobotData.CleanTime = Convert.ToInt32(value);
@@ -632,7 +632,7 @@
                //剩余电量    
                else if (data.key == "electricity_left")
                {
                    var value = data.value;
                    var value = data.state;
                    if (value != string.Empty)
                    {
                        this.weepRobotData.ElectricityLeft = Convert.ToInt32(value);
@@ -675,7 +675,7 @@
            /// </summary>
            public string Suction = string.Empty;
            /// <summary>
            /// å·¥ä½œæ¨¡å¼(random:自动清扫 smart:定点清扫 wall_follow:沿墙清扫 spiral:区域清扫 chargego:充电)
            /// å·¥ä½œæ¨¡å¼(smart:自动清扫 random:随机清扫 wall_follow:沿墙清扫 spiral:螺旋清扫 chargego:充电)
            /// </summary>
            public string Mode = string.Empty;
            /// <summary>
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs
@@ -50,6 +50,7 @@
        #region åŒºåŸŸå˜é‡
        Room room;
        Sensor sensorTemp = new Sensor();
        #endregion
@@ -285,10 +286,6 @@
            #region æˆ¿é—´é¡¶éƒ¨åˆ‡æ¢æ˜¾ç¤ºåŒºåŸŸ
            room = new Room() { roomName = Language.StringByID(StringId.All)};
            //if (DB_ResidenceData.rooms.Count > 0)
            //{
            //    room = DB_ResidenceData.rooms[0];
            //}
            btnFoorDownIcon = new Button()
            {
                Width = Application.GetMinRealAverage(16),
@@ -353,7 +350,7 @@
        {
            sensorListView.RemoveAll();
            int index = 0;
            foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience)
            foreach (var sensor in FunctionList.List.GetEnvirSensorsList())
            {
                LoadSensorDiv(sensor, index);
                index++;
@@ -363,8 +360,11 @@
        /// <summary>
        /// åŠ è½½ä¼ æ„Ÿå™¨åˆ—è¡¨
        /// </summary>
        void LoadSensorDiv(Sensor 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.sid;
@@ -392,10 +392,10 @@
                    Width = Application.GetRealWidth(48),
                    Height = Application.GetRealWidth(48),
                    OpenAngle = 10,
                    ProgressBarColor = sensor.levelColorList[sensor.curLevel - 1],
                    ProgressBarColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1],
                    MinValue = 0,
                    MaxValue = 96,
                    Progress = (96 / sensor.levelColorList.Count) * sensor.curLevel,
                    Progress = (96 / sensorTemp.GetLevelColorList(sensor.spk).Count * sensorTemp.GetCurLevel(sensor)),
                    IsClickable = false,
                    ArcColor = CSS_Color.BackgroundColor,
                    ArcWidth = Application.GetRealWidth(4),
@@ -413,17 +413,16 @@
                    TextAlignment = TextAlignment.Center,
                    TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextID = sensor.functionTypeNameId,
                    TextID = sensorTemp.GetFunctionTypeNameId(sensor.spk),
                    Tag = "SensorTitle"
                };
                sensorView.AddChidren(btnSensorTitle);
                btnSensorTitle.MouseUpEventHandler = (sender, e) => {
                    return;
                    #region F3阶段
                    //var esp = new EnvironmentalSensorPage(sensor);
                    //MainPage.BasePageView.AddChidren(esp);
                    //esp.LoadPage();
                    //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    #region
                    var esp = new EnvironmentalSensorPage(sensor);
                    MainPage.BasePageView.AddChidren(esp);
                    esp.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    #endregion
                };
@@ -450,7 +449,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
                    IsBold = true,
                    Text = sensor.values.ToString(),
                    Text = sensor.GetAttrState(FunctionAttributeKey.Value),
                    Tag = "SensorValues"
                };
                sensorView.AddChidren(btnSensorValues);
@@ -462,9 +461,9 @@
                    Width = Application.GetRealWidth(50),
                    Height = Application.GetRealWidth(18),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = sensor.levelColorList[sensor.curLevel - 1],
                    TextColor = levelColorList[sensorTemp.GetCurLevel( sensor) - 1],
                    TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                    TextID = sensor.levelTextList[sensor.curLevel - 1],
                    TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1],
                    Tag = "SensorLevel"
                };
                sensorView.AddChidren(btnLevel);
@@ -476,8 +475,10 @@
        /// <summary>
        /// åŠ è½½ä¼ æ„Ÿå™¨ç­‰çº§ç›¸å…³ä¿¡æ¯
        /// </summary>
        void LoadInfo(Sensor sensor)
        void LoadInfo(Function sensor)
        {
            var levelColorList = sensorTemp.GetLevelColorList(sensor.spk);
            var levelTextList = sensorTemp.GetLevelTextList(sensor.spk);
            Dialog dialog = new Dialog();
            FrameLayout dialogBodyView = new FrameLayout();
@@ -486,13 +487,12 @@
            {
                dialog.Close();
            };
            VerticalScrolViewLayout infoView = new VerticalScrolViewLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(667 - 94 - (sensor.levelColorList.Count * 44) - 20),
                Y = Application.GetRealHeight(667 - 94 - (levelColorList.Count * 44) - 20),
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(94 + (sensor.levelColorList.Count * 44) + sensor.levelColorList.Count),
                Height = Application.GetRealHeight(94 + (levelColorList.Count * 44) + levelColorList.Count),
                Radius = (uint)Application.GetRealWidth(12),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Animate = Animate.DownToUp,
@@ -568,7 +568,7 @@
                IsBold = true,
                TextID = StringId.ColorValue,
            });
            for (int index = 0; index < sensor.levelTextList.Count; index++)
            for (int index = 0; index < levelTextList.Count; index++)
            {
                infoView.AddChidren(new Button()
                {
@@ -592,7 +592,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                    IsBold = true,
                    Text = sensor.intervalValue[index]
                    Text = sensorTemp.GetIntervalValue(sensor.spk)[index]
                });
                subInfoView.AddChidren(new Button()
@@ -603,7 +603,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                    IsBold = true,
                    TextID = sensor.levelTextList[index]
                    TextID = levelTextList[index]
                });
                subInfoView.AddChidren(new Button()
@@ -613,7 +613,7 @@
                    Width = Application.GetRealWidth(38),
                    Height = Application.GetRealHeight(18),
                    Radius = (uint)Application.GetRealWidth(4),
                    BackgroundColor = sensor.levelColorList[index]
                    BackgroundColor = levelColorList[index]
                });
            }
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs
@@ -11,14 +11,14 @@
        }
       public static void LoadEvent_UpdataStatus(Sensor sensor)
       public static void LoadEvent_UpdataStatus(Function updateTemp)
        {
            Application.RunOnMainThread(() =>{
                if (bodyView != null)
                {
                    for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++)
                    {
                        var sensorTag = sensor.sid;
                        var sensorTag = updateTemp.sid;
                        var view = bodyView.sensorListView.GetChildren(i);
                        if (view.GetType() == typeof(FrameLayout))
                        {
@@ -36,20 +36,20 @@
                                        var tag = btn.Tag.ToString();
                                        if (tag == "SensorValues")
                                        {
                                            (btn as Button).Text = sensor.values.ToString();
                                            (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value);
                                        }
                                        else if (tag == "SensorLevel")
                                        {
                                            (btn as Button).TextID = sensor.levelTextList[sensor.curLevel - 1];
                                            (btn as Button).TextColor = sensor.levelColorList[sensor.curLevel - 1];
                                            (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
                                            (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
                                        }
                                    }
                                }
                                else if (btn.GetType() == typeof(ArcSeekBar))
                                {
                                    (btn as ArcSeekBar).ProgressBarColor = sensor.levelColorList[sensor.curLevel - 1];
                                    (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
                                    (btn as ArcSeekBar).Progress = (96 / sensor.levelColorList.Count) * sensor.curLevel;
                                    (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp);
                                }
                            }
                        }
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
@@ -21,13 +21,14 @@
        MyEchartsViewOn myEchartsView;
        Sensor sensor;
        Sensor sensorTemp = new Sensor();
        List<Sensor> showSensors;
        Function function;
        List<Function> showFunctions;
        /// <summary>
        /// å½“前查询类型
        /// </summary>
        QueryType curQueryType = QueryType.NowDay;
        string curQueryType = "hour";
        List<uint> tipColorList = new List<uint>()
        {
@@ -39,12 +40,12 @@
            "#80AEFF","#FFD154","#FF9D54","#FE6A6A","#B183C3","#ADE764",
        };
        public EnvironmentalSensorPage(Sensor ss)
        public EnvironmentalSensorPage(Function ss)
        {
            bodyView = this;
            sensor = ss;
            showSensors = new List<Sensor>();
            showSensors.Add(ss);
            function = ss;
            showFunctions = new List<Function>();
            showFunctions.Add(ss);
        }
        public void LoadPage()
@@ -163,7 +164,7 @@
            };
            diagramView.AddChidren(tipTextView);
            switch (sensor.spk)
            switch (function.spk)
            {
                case SPK.SensorPm25:
                    tipValuesView.AddChidren(new Button()
@@ -552,7 +553,7 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                Text = sensor.name,
                Text = function.name,
                IsBold = true,
            };
            selfInfoView.AddChidren(btnSeltSensorName);
@@ -566,7 +567,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = sensor.GetRoomListName()
                Text = function.GetRoomListName()
            };
            selfInfoView.AddChidren(btnFromFoorAndRoom);
@@ -628,9 +629,9 @@
            {
                Action backAction = () =>
                {
                    btnSeltSensorName.Text = sensor.name;
                    btnSeltSensorName.Text = function.name;
                };
                var infoView = new FunctionBaseInfoSetPage(sensor, backAction);
                var infoView = new FunctionBaseInfoSetPage(function, backAction);
                MainPage.BasePageView.AddChidren(infoView);
                infoView.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -642,13 +643,13 @@
            bool initTitleButton = true;
            foreach (var tempSensor in FunctionList.List.sensorsEnvironmentalScience)
            foreach (var tempSensor in FunctionList.List.GetEnvirSensorsList())
            {
                if (tempSensor.sid == sensor.sid)
                if (tempSensor.sid == function.sid)
                {
                    continue;
                }
                if (tempSensor.spk != sensor.spk)
                if (tempSensor.spk != function.spk)
                {
                    continue;
                }
@@ -705,7 +706,7 @@
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                    Text = sensor.name,
                    Text = function.name,
                    IsBold = true,
                };
                otherInfoView.AddChidren(btnSensorName);
@@ -772,16 +773,16 @@
                    btnShowData1.IsSelected = !btnShowData1.IsSelected;
                    if (btnShowData1.IsSelected)
                    {
                        if (!showSensors.Contains(sensor))
                        if (!showFunctions.Contains(function))
                        {
                            showSensors.Add(sensor);
                            showFunctions.Add(function);
                        }
                    }
                    else
                    {
                        if (showSensors.Contains(sensor))
                        if (showFunctions.Contains(function))
                        {
                            showSensors.Remove(sensor);
                            showFunctions.Remove(function);
                        }
                    }
                    LoadMothed_GetSensorHistoryData();
@@ -790,7 +791,7 @@
            }
            #endregion
            new TopViewDiv(bodyView, Language.StringByID(sensor.functionTypeNameId)).LoadTopView();
            new TopViewDiv(bodyView, Language.StringByID(sensorTemp.GetFunctionTypeNameId(function.spk))).LoadTopView();
            LoadMothed_GetSensorHistoryData();
            LoadEvent_ChangeSensorHistoryShowType();
@@ -801,14 +802,6 @@
    //------------
    public partial class EnvironmentalSensorPage
    {
       public  enum QueryType
        {
            NowDay = 0,//当天
            NowMonth = 1,//指定月
            NowYear = 2,//今年
            LatelySevenDay = 3//最近七天
        }
        /// <summary>
        /// è¯»å–传感器历史数据
        /// </summary>
@@ -830,109 +823,28 @@
                    Application.RunOnMainThread(() => {
                        loadPage.Start(Language.StringByID(StringId.PleaseWait));
                    });
                    var curMonth = 0;
                    if(curQueryType == QueryType.NowMonth)
                    {
                        curMonth = DateTime.Now.Month;
                    }
                    int i = 0;
//#if DEBUG
//                    var sItem = new EchartSeriesItem
//                    {
//                        name = sensor.GetRoomListName(),
//                        data = new List<int>(),
//                        lineStyle = new EchartLineStyle()
//                        {
//                            color = tipColorStringList[i],
//#if __IOS__
//                            width = 5,
//#elif __ANDROID__
//                                        width = 2,
//#endif
//                        },
//                    };
//                    Random random = new Random();
//                    double level = 0.0;
//                    int countddd = 24;
//                    for (int j = 0; j < countddd; j++)
//                    {
//                        switch (sensor.functionType)
//                        {
//                            case SPK.SensorPm25:
//                                level = Math.Round(random.NextDouble() * 130, 0);
//                                break;
//                            case SPK.SensorCO2:
//                                level = Math.Round(random.NextDouble() * 6000, 0);
//                                break;
//                            case SPK.SensorTemperature:
//                                level = Math.Round(random.NextDouble() * 40, 0);
//                                break;
//                            case SPK.SensorTVOC:
//                                level = Math.Round(random.NextDouble() * 10, 1);
//                                break;
//                            case SPK.SensorHumidity:
//                                level = Math.Round(random.NextDouble() * 100, 0);
//                                break;
//                        }
//                        sItem.data.Add((int)level);
//                    }
//                        seriesList.Add(sItem);
//                    echartRootJson.series = seriesList;
//#if __IOS__
//                    echartRootJson.xAxis.axisLabel.fontSize = 22;
//                    echartRootJson.yAxis.axisLabel.fontSize = 22;
//#else
//                    echartRootJson.xAxis.axisLabel.fontSize = 8;
//                    echartRootJson.yAxis.axisLabel.fontSize = 8;
//#endif
//                    echartRootJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(echartRootJson);
//                    Application.RunOnMainThread(() =>
//                    {
//                        myEchartsView.ShowWithOptionJsonString(echartRootJsonString);
//                    });
//#endif
                    foreach (var sr in FunctionList.List.sensorsEnvironmentalScience)
                    foreach (var sr in FunctionList.List.GetEnvirSensorsList())
                    {
                        if (sr.spk != sensor.spk)
                        if (sr.spk != function.spk)
                        {
                            continue;
                        }
                        if (showSensors.Find((obj) => obj.sid == sr.sid) == null)
                        if (showFunctions.Find((obj) => obj.sid == sr.sid) == null)
                        {
                            i++;
                            continue;
                        }
                        byte sensorType = 0;
                        switch (sr.spk)
                        {
                            case SPK.SensorTemperature:
                                sensorType = 2;
                                break;
                            case SPK.SensorHumidity:
                                sensorType = 3;
                                break;
                            case SPK.SensorTVOC:
                                sensorType = 5;
                                break;
                            case SPK.SensorPm25:
                                sensorType = 6;
                                break;
                            case SPK.SensorCO2:
                                sensorType = 7;
                                break;
                        }
                        var revertObj = new HttpServerRequest().GetSensorHistory(sr.bus.SubnetID, sr.bus.DeviceID,
                               5, sensorType, (int)curQueryType, sr.bus.LoopId, curMonth,
                               DB_ResidenceData.Instance.residenceGatewayMAC);
                        var sensorType = sr.spk.Split(".")[0];
                        var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId,sensorType);
                        if (revertObj != null)
                        {
                            if (revertObj.StateCode == StateCode.SUCCESS)
                            if (revertObj.Code == StateCode.SUCCESS)
                            {
                                var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>>(revertObj.ResponseData.ToString());
                                var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString());
                                var sItem = new EchartSeriesItem
                                {
@@ -949,34 +861,10 @@
                                    },
                                };
                                int ass = 0;
                                for (int j = 0; j < revertData.Count; j++)
                                foreach (var d in revertData)
                                {
                                    if (curQueryType == QueryType.NowMonth && revertData[j].CreatedOnUtc.Day > DateTime.Now.Day)
                                    {
                                        continue;
                                    }
                                    if (revertData[j].TargetValue.ToString() != "NaN")
                                    {
                                        ass = Convert.ToInt32(revertData[j].TargetValue);
                                    }
                                    else
                                    {
                                        ass = 0;
                                    }
                                    sItem.data.Add(ass);
                                    switch (curQueryType)
                                    {
                                        case QueryType.NowDay:
                                            echartRootJson.xAxis.data.Add(revertData[j].CreatedOnUtc.Hour.ToString());
                                            break;
                                        case QueryType.LatelySevenDay:
                                            echartRootJson.xAxis.data.Add(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(revertData[j].CreatedOnUtc.DayOfWeek));
                                            break;
                                        case QueryType.NowMonth:
                                            echartRootJson.xAxis.data.Add(revertData[j].CreatedOnUtc.Day.ToString());
                                            break;
                                    }
                                    echartRootJson.xAxis.data.Add(d.fieldName);
                                    echartRootJson.yAxis.data.Add(d.fieldValue);
                                }
                                seriesList.Add(sItem);
                            }
@@ -1030,7 +918,7 @@
                btnShowHistroyData_Day.IsSelected = true;
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = false;
                curQueryType = QueryType.NowDay;
                curQueryType = "hour";
                LoadMothed_GetSensorHistoryData();
            };
@@ -1040,7 +928,7 @@
                btnShowHistroyData_Day.IsSelected = false;
                btnShowHistroyData_Month.IsSelected = true;
                btnShowHistroyData_Week.IsSelected = false;
                curQueryType = QueryType.NowMonth;
                curQueryType = "week";
                LoadMothed_GetSensorHistoryData();
            };
            btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) =>
@@ -1049,7 +937,7 @@
                btnShowHistroyData_Day.IsSelected = false;
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = true;
                curQueryType = QueryType.LatelySevenDay;
                curQueryType = "month";
                LoadMothed_GetSensorHistoryData();
            };
@@ -1061,17 +949,14 @@
        }
    }
    public class SensorPushHistoryRes
    public class EnvironmentalSensorHistor
    {
        /// <summary>
        /// </summary>
        public string fieldName { get; set; }
        /// <summary>
        /// å®žé™…目标值
        /// </summary>
        public float TargetValue { get; set; }
        /// <summary>
        /// æŸ¥è¯¢çš„æ—¶é—´é›†ç¾¤
        /// </summary>
        public DateTime CreatedOnUtc { get; set; }
        public string fieldValue { get; set; }
    }
}
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
@@ -23,7 +23,7 @@
        /// </summary>
        Button btnCollection;
        /// <summary>
        /// ç©ºè°ƒæ¸©åº¦æŽ§åˆ¶æŽ§ä»¶
        /// æ¸©åº¦æŽ§åˆ¶æŽ§ä»¶
        /// </summary>
        DiyArcSeekBar arcBar;
        /// <summary>
@@ -62,7 +62,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        FloorHeating fh;
        FloorHeating fhTemp = new FloorHeating();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -71,10 +72,10 @@
        /// </summary>
        Action actionRefresh;
        #endregion
        public FloorHeatingPage(FloorHeating func)
        public FloorHeatingPage(Function func)
        {
            bodyView = this;
            fh = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -103,7 +104,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = fh.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -116,7 +117,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = fh.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -128,7 +129,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = fh.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -141,16 +142,15 @@
            {
                Gravity = Gravity.CenterHorizontal,
                OpenAngle = 160,
                ThumbImagePath = fh.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImageHeight = Application.GetRealWidth(50),
                ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04,
                OfflineProgressBarColor = CSS_Color.PromptingColor2,
                IsOffline = fh.trait_on_off.curValue.ToString() == "off",
                MinValue = fh.trait_temp.min,
                MaxValue = fh.trait_temp.max,
                //IsClickable = fh.trait_on_off.curValue.ToString() == "on",
                IsOffline = function.trait_on_off.curValue.ToString() == "off",
                MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min,
                MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max,
                ArcColor = CSS_Color.BackgroundColor,
                Progress = Convert.ToInt32(fh.trait_temp.curValue),
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)),
#if __IOS__
                Y = Application.GetRealHeight(120+25),
                Width = Application.GetRealWidth(260-40),
@@ -175,7 +175,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 56,
                IsBold = true,
                Text = fh.trait_temp.curValue.ToString(),
                Text = function.GetAttrState(FunctionAttributeKey.SetTemp),
                TextAlignment = TextAlignment.Center,
            };
            controlView.AddChidren(btnTemp);
@@ -190,7 +190,7 @@
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
                IsBold = true,
                TextAlignment = TextAlignment.CenterLeft,
                Text = fh.tempUnitString
                Text = fhTemp.GetTempUnitString(function)
            };
            controlView.AddChidren(btnTempUint);
@@ -232,7 +232,7 @@
                Y = Application.GetRealHeight(337),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = fh.curModeImage,
                UnSelectedImagePath = fhTemp.GetModeImage(function)
            };
            controlView.AddChidren(btnMode);
@@ -244,15 +244,15 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = fh.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.FloorHeating)).LoadTopView_FunctionTop(fh, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.FloorHeating)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(fh);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
@@ -304,28 +304,29 @@
            };
            modeChangeView.AddChidren(btnLine);
            foreach (var m in fh.trait_mode.value)
            var modeList = function.GetAttribute(FunctionAttributeKey.Mode).value;
            foreach (var m in modeList)
            {
                Button btnModeIcon = new Button()
                {
                    X = btnTitle.X,
                    Y = Application.GetRealHeight(44 * (fh.trait_mode.value.IndexOf(m) + 1) + 10 + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                    Width = Application.GetRealWidth(24),
                    Height = Application.GetRealWidth(24),
                    IsSelected = fh.trait_mode.curValue.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                };
                modeChangeView.AddChidren(btnModeIcon);
                Button btnModeText = new Button()
                {
                    X = Application.GetRealWidth(12) + btnModeIcon.Right,
                    Y = Application.GetRealHeight(44 * (fh.trait_mode.value.IndexOf(m) + 1) + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
                    Height = Application.GetRealHeight(44),
                    Width = Application.GetRealWidth(70),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    SelectedTextColor = CSS_Color.MainColor,
                    IsSelected = fh.trait_mode.curValue.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                };
                modeChangeView.AddChidren(btnModeText);
@@ -358,7 +359,7 @@
                        break;
                }
                if (fh.trait_mode.value.IndexOf(m) < fh.trait_mode.value.Count - 1)
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
                    modeChangeView.AddChidren(new Button()
                    {
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -9,7 +9,7 @@
    public partial class FloorHeatingPage
    {
        public static void UpdataStates(FloorHeating uFh)
        public static void UpdataStates(Function updateTemp)
        {
            try
            {
@@ -19,11 +19,11 @@
                    {
                        return;
                    }
                    bodyView.btnTemp.Text = uFh.trait_temp.curValue.ToString();
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(uFh.trait_IndoorTemp.curValue)) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = uFh.curModeImage;
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(uFh.trait_temp.curValue));
                    if (uFh.trait_on_off.curValue.ToString() == "on")
                    bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp);
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeImage(updateTemp);
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    {
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png";
                        bodyView.btnSwitch.IsSelected = true;
@@ -51,9 +51,9 @@
            //回退刷新信息事件
            actionRefresh = () =>
            {
                btnFunctionName.Text = btnFunctionName_Out.Text = fh.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = fh.GetRoomListName();
                //fh.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
@@ -64,8 +64,8 @@
        {
            btnCollection.MouseUpEventHandler += (sender, e) =>
            {
                btnCollection.IsSelected = fh.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                fh.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -76,57 +76,55 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if(fh.trait_on_off.curValue.ToString() == "off")
                if(function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
                var temp = Convert.ToInt32(fh.trait_temp.curValue);
                if (temp < Convert.ToInt32(fh.trait_temp.min))
                var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp < Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).min))
                {
                    return;
                }
                temp--;
                arcBar.Progress = temp;
                fh.trait_temp.curValue = temp.ToString();
                function.SetAttrState(FunctionAttributeKey.SetTemp, temp);
                btnTemp.Text = temp.ToString();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                Control.Ins.SendWriteCommand(fh, d);
                Control.Ins.SendWriteCommand(function, d);
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (fh.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
                var temp = Convert.ToInt32(fh.trait_temp.curValue);
                if (temp > Convert.ToInt32(fh.trait_temp.max))
                var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp > Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).max))
                {
                    return;
                }
                temp++;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                fh.trait_temp.curValue = temp.ToString();
                //Control.Send(CommandType_A.write, fh);
                function.SetAttrState(FunctionAttributeKey.SetTemp, temp);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                Control.Ins.SendWriteCommand(fh, d);
                Control.Ins.SendWriteCommand(function, d);
            };
            arcBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                fh.trait_temp.curValue = arcBar.Progress.ToString();
                btnTemp.Text = fh.trait_temp.curValue.ToString();
                //Control.Send(CommandType_A.write, fh);
                function.SetAttrState(FunctionAttributeKey.SetTemp,arcBar.Progress);
                btnTemp.Text = arcBar.Progress.ToString();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, fh.trait_temp.curValue.ToString());
                Control.Ins.SendWriteCommand(fh, d);
                d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
            arcBar.OnProgressChangedEvent = (sender, e) =>
            {
                fh.trait_temp.curValue = e.ToString();
                btnTemp.Text = fh.trait_temp.curValue.ToString();
                function.SetAttrState(FunctionAttributeKey.SetTemp, e);
                btnTemp.Text = function.GetAttrState(FunctionAttributeKey.SetTemp);
            };
        }
        /// <summary>
@@ -136,7 +134,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (fh.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
@@ -146,8 +144,8 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                fh.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (fh.trait_on_off.curValue.ToString() == "on")
                function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.curValue.ToString() == "on")
                {
                    //arcBar.ProgressBarColor = CSS_Color.MainColor;
                    arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png";
@@ -162,8 +160,8 @@
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, fh.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(fh, d);
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(function, d);
               
            };
        }
@@ -181,14 +179,14 @@
            EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
            {
                btn1.IsSelected = btn2.IsSelected = true;
                fh.trait_mode.curValue = curMode;
                function.SetAttrState(FunctionAttributeKey.Mode,curMode);
                btnMode.UnSelectedImagePath = btn1.SelectedImagePath;
                byte pro = 6;
                fh.modeTemp.TryGetValue(curMode, out pro);
                arcBar.Progress = pro;
                //byte pro = 6;//不处理温度显示,等待回复数据再处理
                //function.Fh_Mode_Temp.TryGetValue(curMode, out pro);
                //arcBar.Progress = pro;
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Mode, fh.trait_mode.curValue.ToString());
                Control.Ins.SendWriteCommand(fh, d);
                d.Add(FunctionAttributeKey.Mode, function.GetAttrState(FunctionAttributeKey.Mode));
                Control.Ins.SendWriteCommand(function, d);
                dialog.Close();
            };
            btn1.MouseUpEventHandler = eventHandler1;
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -53,7 +53,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Light light;
        Light lightTemp = new Light();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -70,10 +71,10 @@
            bodyView = null;
        }
        public ColorTureLampPage(Light func)
        public ColorTureLampPage(Function func)
        {
            bodyView = this;
            light = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -82,8 +83,6 @@
            btnFunctionName_Out = btnFunctionNameOut;
            btnFromFloor_Out = btnFromFloorOut;
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(light,null);
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), light);
            controlView = new FrameLayout()
            {
@@ -104,7 +103,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = light.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -117,7 +116,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = light.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -129,7 +128,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = light.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -142,16 +141,16 @@
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(108),
                Width = Application.GetRealWidth(142 - 16 -16),
                Width = Application.GetRealWidth(142 - 16 - 16),
                Height = Application.GetRealHeight(222),
                BorderColor = 0x00000000,
                CornerRadius = Application.GetRealWidth(20),
                BorderWidth = 0,
                Progress = light.brightness,
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
                IsProgressTextShow = false,
            };
            controlView.AddChidren(dimmerBar);
            if (light.trait_on_off.curValue.ToString() == "on")
            if (function.trait_on_off.curValue.ToString() == "on")
            {
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
            }
@@ -159,17 +158,17 @@
            {
                dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
            }
            dimmerBar.Progress = light.brightness;
            dimmerBar.Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness));
            btnBrightnessText = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = ((100 - light.brightness) * Application.GetRealHeight(222  - 16) / 100) + Application.GetRealWidth(80),
                Y = ((100 - Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222  - 16) / 100) + Application.GetRealWidth(80),
                Width = Application.GetRealWidth(56),
                Height = Application.GetRealWidth(46),
                UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                Text = light.brightness + "%",
                Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
            };
            controlView.AddChidren(btnBrightnessText);
@@ -219,7 +218,7 @@
            //显示上方的Txt
            barColorTemplatrue.ShowCustomTextView(Application.GetRealWidth(50), CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.FirstLevelTitleColor);
            var cct = 27;
            int.TryParse(light.Attr_CCT.curValue.ToString(), out cct);
            int.TryParse(function.GetAttrState(FunctionAttributeKey.CCT), out cct);
            barColorTemplatrue.Progress = cct;
            //设置初始值
            barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
@@ -282,7 +281,7 @@
            //    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    ProgressBarUnitSring = "s",
            //    MaxValue = 10,
            //    Progress = light.fadeTime,
            //    Progress = function.fadeTime,
            //    SeekBarPadding = Application.GetRealWidth(20),
            //};
            //controlView.AddChidren(barFadeTime);
@@ -309,7 +308,7 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = light.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
            };
            controlView.AddChidren(btnSwitch);
@@ -329,10 +328,10 @@
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(light);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
@@ -347,7 +346,8 @@
            var dialogBody = new FrameLayout();
            frameBack.AddChidren(dialogBody);
            dialogBody.MouseUpEventHandler = (sender, e) => {
            dialogBody.MouseUpEventHandler = (sender, e) =>
            {
                frameBack.Close();
            };
@@ -393,12 +393,12 @@
            btnCozyIcon.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 27;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
            };
            //温馨 2700k
@@ -416,12 +416,12 @@
            btnCozy.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 27;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d); barColorTemplatrue.Progress = 27;
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d); barColorTemplatrue.Progress = 27;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
@@ -439,12 +439,12 @@
            btnMeetIcon.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 30;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIconOn.png";
            };
@@ -463,12 +463,12 @@
            btnMeet.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 30;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIconOn.png";
            };
@@ -484,12 +484,12 @@
            btnReadIcon.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 65;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ReadIconOn.png";
            };
            //阅读 6500k
@@ -507,12 +507,12 @@
            btnRead.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 65;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ReadIconOn.png";
            };
            btnCozy.IsSelected = false;
@@ -521,17 +521,17 @@
            btnMeetIcon.IsSelected = false;
            btnRead.IsSelected = false;
            btnReadIcon.IsSelected = false;
            if (light.Attr_CCT.curValue.ToString() == "2700")
            if (function.GetAttrState(FunctionAttributeKey.CCT) == "2700")
            {
                btnCozy.IsSelected = true;
                btnCozyIcon.IsSelected = true;
            }
            if (light.Attr_CCT.curValue.ToString() == "3000")
            if (function.GetAttrState(FunctionAttributeKey.CCT) == "3000")
            {
                btnMeet.IsSelected = true;
                btnMeetIcon.IsSelected = true;
            }
            if (light.Attr_CCT.curValue.ToString() == "6500")
            if (function.GetAttrState(FunctionAttributeKey.CCT) == "6500")
            {
                btnRead.IsSelected = true;
                btnReadIcon.IsSelected = true;
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -10,34 +10,34 @@
        /// <summary>
        /// æ›´æ–°åŠŸèƒ½çŠ¶æ€
        /// </summary>
        public static void UpdataStates(Light uFunction)
        public static void UpdataStatus(Function updataTemp)
        {
            Application.RunOnMainThread((Action)(() =>
            Application.RunOnMainThread(() =>
            {
                try
                {
                    if (bodyView == null)
                        return;
                    if (uFunction.spk == bodyView.light.spk && uFunction.sid == bodyView.light.sid)
                    if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
                    {
                        if (uFunction.trait_on_off.curValue.ToString() == "on")
                        if (updataTemp.trait_on_off.curValue.ToString() == "on")
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                            if (!bodyView.onDimmerBar)
                            {
                                bodyView.dimmerBar.Progress = uFunction.brightness;
                                bodyView.dimmerBar.Progress = Convert.ToInt32( updataTemp.GetAttrState(FunctionAttributeKey.Brightness));
                            }
                            bodyView.btnBrightnessText.Text = uFunction.brightness + "%";
                            bodyView.btnBrightnessText.Y = ((100 - uFunction.brightness) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80);
                            bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%";
                            bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80);
                        }
                        else
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
                        }
                        bodyView.btnSwitch.IsSelected = uFunction.trait_on_off.curValue.ToString() == "on";
                        bodyView.barColorTemplatrue.Enable = uFunction.trait_on_off.curValue.ToString() == "on";
                        bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                        bodyView.barColorTemplatrue.Enable = updataTemp.trait_on_off.curValue.ToString() == "on";
                        var cct = 27;
                        int.TryParse(uFunction.Attr_CCT.curValue.ToString(), out cct);
                        int.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.CCT), out cct);
                        bodyView.barColorTemplatrue.Progress = cct / 100;
                        //设置初始值
                        bodyView.barColorTemplatrue.SetCustomText(bodyView.barColorTemplatrue.Progress * 100 + "K");
@@ -48,7 +48,7 @@
                {
                    MainPage.Log($"{bodyView.GetType().Name } UpdataStates error : {ex.Message}");
                }
            }));
            });
        }
        void LoadEventList()
@@ -60,9 +60,9 @@
            LoadEvet_ChangeColorTemplatrue();
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = light.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = light.GetRoomListName();
                //light.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
        /// <summary>
@@ -72,8 +72,8 @@
        {
            //barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
            //{
            //    light.fadeTime = e;
            //    light.SaveFunctionData(true);
            //    function.fadeTime = e;
            //    function.SaveFunctionData(true);
            //};
        }
@@ -90,10 +90,10 @@
                    {
                        //设置自定义的文本
                        barColorTemplatrue.SetCustomText(value * 100 + "K");
                        light.Attr_CCT.curValue = value * 100;
                        function.SetAttrState(FunctionAttributeKey.CCT, value * 100);
                        //System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                        //d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                        //Control.Ins.SendWriteCommand(light, d);
                        //d.Add(FunctionAttributeKey.CCT, function.Attr_CCT.curValue.ToString());
                        //Control.Ins.SendWriteCommand(function, d);
                    });
                    //System.Threading.Thread.Sleep(200);
                }).Start();
@@ -101,10 +101,10 @@
            barColorTemplatrue.OnStopTrackingTouchEvent = (sender, value) =>
            {
                light.Attr_CCT.curValue = value * 100;
                function.SetAttrState(FunctionAttributeKey.CCT, value * 100);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (value * 100 ).ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
        }
@@ -115,8 +115,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -131,11 +131,11 @@
            dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                onDimmerBar = false;
                light.brightness = dimmerBar.Progress;
                function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                Control.Ins.SendWriteCommand(light, d);
                //light.fadeTime = barFadeTime.Progress;
                d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
                Control.Ins.SendWriteCommand(function, d);
                //function.fadeTime = barFadeTime.Progress;
                btnBrightnessText.Text = dimmerBar.Progress + "%";
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
@@ -143,38 +143,38 @@
            dimmerBar.OnProgressChangedEvent = (sender, e) =>
            {
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                //light.fadeTime = 0;
                //function.fadeTime = 0;
                //if (!btnSwitch.IsSelected)
                //{
                //    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                //}
                //btnSwitch.IsSelected = e > 0 ? true : false;
                //light.brightness = e;
                //light.trait_on_off.curValue = e > 0 ? "on" : "off";
                //function.brightness = e;
                //function.trait_on_off.curValue = e > 0 ? "on" : "off";
                //if (e == 0 || e == 100)
                //{
                //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //    Control.Ins.SendWriteCommand(light, d);
                //    d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
                //    Control.Ins.SendWriteCommand(function, d);
                //}
                //else
                //{
                //    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                //    if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds)
                //    {
                //        light.refreshTime = DateTime.Now;
                //        function.refreshTime = DateTime.Now;
                //        new System.Threading.Thread(() =>
                //        {
                //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //            Control.Ins.SendWriteCommand(light, d);
                //            d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
                //            Control.Ins.SendWriteCommand(function, d);
                //        })
                //        { IsBackground = true }.Start();
                //    }
                //}
                //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16 - 16) / 100) + Application.GetRealWidth(40);
                //btnBrightnessText.Text = light.brightness + "%";
                //btnBrightnessText.Text = function.brightness + "%";
                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80);
                btnBrightnessText.Text = dimmerBar.Progress + "%";
@@ -190,7 +190,7 @@
        {
            btnSwitch.MouseUpEventHandler += (sender, e) =>
            {
                //light.fadeTime = barFadeTime.Progress;
                //function.fadeTime = barFadeTime.Progress;
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                if (btnSwitch.IsSelected)
                {
@@ -202,19 +202,19 @@
                }
                new System.Threading.Thread(() =>
                {
                    light.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, light.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, light.fadeTime.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                    if (btnSwitch.IsSelected)
                    {
                        d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString());
                        d.Add(FunctionAttributeKey.Brightness, function.lastBrightness.ToString());
                    }
                    else
                    {
                        light.lastBrightness = light.brightness;
                        function.lastBrightness = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness));
                    }
                    Control.Ins.SendWriteCommand(light, d);
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
@@ -45,7 +45,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Light light;
        Light lightTemp = new Light();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -62,10 +63,10 @@
            bodyView = null;
        }
        public DimmerPage(Light func)
        public DimmerPage(Function func)
        {
            bodyView = this;
            light = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -74,8 +75,8 @@
            btnFunctionName_Out = btnFunctionNameOut;
            btnFromFloor_Out = btnFromFloorOut;
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(light,null);
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), light);
            //new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(function,null);
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function);
            controlView = new FrameLayout()
            {
@@ -96,7 +97,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = light.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -109,7 +110,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = light.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -121,7 +122,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = light.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -139,11 +140,11 @@
                BorderColor = 0x00000000,
                CornerRadius = Application.GetRealWidth(30),
                BorderWidth = 0,
                Progress = light.brightness,
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
                IsProgressTextShow = false,
            };
            controlView.AddChidren(dimmerBar);
            if(light.trait_on_off.curValue.ToString() == "on")
            if(function.trait_on_off.curValue.ToString() == "on")
            {
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
            }
@@ -151,7 +152,7 @@
            {
                dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
            }
            dimmerBar.Progress = light.brightness;
            dimmerBar.Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness));
            btnBrightnessText = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
@@ -161,7 +162,7 @@
                UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                Text = light.brightness + "%",
                Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
            };
            controlView.AddChidren(btnBrightnessText);
@@ -176,8 +177,8 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.SpeedOfChange,
                Visible = light.HadFadeTime,
                Enable = light.HadFadeTime,
                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime)!= null,
                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime)!= null,
            };
            controlView.AddChidren(btnGradualChangeText);
@@ -191,8 +192,8 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Visible = light.HadFadeTime,
                Enable = light.HadFadeTime,
                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
            };
            controlView.AddChidren(btnGradualChangeMinValuesText);
@@ -210,10 +211,10 @@
                ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                ProgressBarUnitSring = "s",
                MaxValue = 10,
                Progress = light.fadeTime,
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
                SeekBarPadding = Application.GetRealWidth(20),
                Visible = light.HadFadeTime,
                Enable = light.HadFadeTime,
                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
            };
            controlView.AddChidren(barFadeTime);
@@ -227,8 +228,8 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Visible = light.HadFadeTime,
                Enable = light.HadFadeTime,
                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
            };
            controlView.AddChidren(btnGradualChangeMaxValuesText);
            #endregion
@@ -241,16 +242,16 @@
                Height = Application.GetMinRealAverage(40),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = light.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(light);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -10,31 +10,31 @@
        /// <summary>
        /// æ›´æ–°åŠŸèƒ½çŠ¶æ€
        /// </summary>
        public static void UpdataStates(Light uFunction)
        public static void UpdataStates(Function updataTemp)
        {
            Application.RunOnMainThread((Action)(() =>
            Application.RunOnMainThread((() =>
            {
                try
                {
                    if (bodyView == null)
                        return;
                    if (uFunction.spk == bodyView.light.spk && uFunction.sid == bodyView.light.sid)
                    if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
                    {
                        bodyView.btnBrightnessText.Text = uFunction.brightness + "%";
                        bodyView.btnBrightnessText.Y = ((100 - uFunction.brightness) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40);
                        if (uFunction.trait_on_off.curValue.ToString() == "on")
                        bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%";
                        bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32( updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40);
                        if (updataTemp.trait_on_off.curValue.ToString() == "on")
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                            if (!bodyView.onDimmerBar)
                            {
                                bodyView.dimmerBar.Progress = uFunction.brightness;
                                bodyView.dimmerBar.Progress = Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness));
                            }
                        }
                        else
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
                        }
                        bodyView.btnSwitch.IsSelected = uFunction.trait_on_off.curValue.ToString() == "on";
                        bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                    }
                }
                catch (Exception ex)
@@ -52,9 +52,9 @@
            LoadEvet_ChangeFadeTime();
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = light.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = light.GetRoomListName();
                //light.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
        /// <summary>
@@ -64,8 +64,8 @@
        {
            barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
            {
                light.fadeTime = e;
                light.UpdataFuncitonInfo();
                function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString());
                function.UpdataFuncitonInfo();
            };
        }
@@ -75,8 +75,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -90,43 +90,42 @@
            };
            dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
                onDimmerBar = false;
                light.brightness = dimmerBar.Progress;
                //Control.Send(CommandType_A.write, light);
                function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                Control.Ins.SendWriteCommand(light, d);
                light.fadeTime = barFadeTime.Progress;
                d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
                Control.Ins.SendWriteCommand(function, d);
                function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress);
                btnBrightnessText.Text = dimmerBar.Progress + "%";
            };
            //20201223 åˆ é™¤æ»‘动发送命令,防止控件跳动
            dimmerBar.OnProgressChangedEvent = (sender, e) =>
            {
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                //light.fadeTime = 0;
                //function.fadeTime = 0;
                //if (!btnSwitch.IsSelected)
                //{
                //    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                //}
                //btnSwitch.IsSelected = e > 0 ? true : false;
                //light.brightness = e;
                //light.trait_on_off.curValue = e > 0 ? "on" : "off";
                //function.brightness = e;
                //function.trait_on_off.curValue = e > 0 ? "on" : "off";
                //if (e == 0 || e == 100)
                //{
                //    //Control.Send(CommandType_A.write, this.light);
                //    //Control.Send(CommandType_A.write, this.function);
                //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //    Control.Ins.SendWriteCommand(light, d);
                //    d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
                //    Control.Ins.SendWriteCommand(function, d);
                //}
                //else
                //{
                //    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                //    if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds)
                //    {
                //        light.refreshTime = DateTime.Now;
                //        function.refreshTime = DateTime.Now;
                //        new System.Threading.Thread(() =>
                //        {
                //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //            Control.Ins.SendWriteCommand(light, d);
                //            d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
                //            Control.Ins.SendWriteCommand(function, d);
                //        })
                //        { IsBackground = true }.Start();
                //    }
@@ -143,7 +142,7 @@
        {
            btnSwitch.MouseUpEventHandler += (sender, e) =>
            {
                light.fadeTime = barFadeTime.Progress;
                function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress);
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                if (btnSwitch.IsSelected)
                {
@@ -155,23 +154,23 @@
                }
                new System.Threading.Thread(() =>
                {
                    light.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, light.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, light.fadeTime.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                    if (btnSwitch.IsSelected)
                    {
                        if(light.lastBrightness == 0)
                        if(function.lastBrightness == 0)
                        {
                            light.lastBrightness = 100;
                            function.lastBrightness = 100;
                        }
                        d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString());
                        d.Add(FunctionAttributeKey.Brightness, function.lastBrightness.ToString());
                    }
                    else
                    {
                        light.lastBrightness = light.brightness;
                        function.lastBrightness = Convert.ToInt32( function.GetAttrState(FunctionAttributeKey.Brightness));
                    }
                    Control.Ins.SendWriteCommand(light, d);
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
@@ -52,11 +52,12 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Light light;
        Light lightTemp;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
        bool onDimmerBar = false;
        Function function;
        /// <summary>
        /// åˆ·æ–°æ˜¾ç¤ºä¿¡æ¯
        /// </summary>
@@ -66,7 +67,7 @@
        public RGBPage(Function func)
        {
            bodyView = this;
            light = func as Light;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -97,7 +98,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = light.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -110,7 +111,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = light.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -123,7 +124,7 @@
                Radius = (uint)Application.GetMinRealAverage(8),
                BorderColor = CSS_Color.PromptingColor2,
                BorderWidth = 1,
                BackgroundColor = (uint)(0xFF000000 + light.GetRGBcolor())
                BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function))
            };
            controlView.AddChidren(btnCurColor);
@@ -135,7 +136,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = light.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -157,7 +158,7 @@
                ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
            };
            framePickerBack.AddChidren(colorPicker);
            if(light.trait_on_off.curValue.ToString() == "off")
            if(function.trait_on_off.curValue.ToString() == "off")
            {
                colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
            }
@@ -199,7 +200,7 @@
            dimmerBar = new DiyImageSeekBar()
            {
                X = Application.GetRealWidth(35 +22),
                X = Application.GetRealWidth(35 + 22),
                Y = Application.GetRealHeight(312),
                Width = Application.GetRealWidth(210),
                Height = Application.GetRealHeight(54),
@@ -208,9 +209,9 @@
                ThumbImageHeight = Application.GetRealHeight(54),
                ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                ProgressBarColor = light.trait_on_off.curValue.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.DividingLineColor,
                ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.DividingLineColor,
                MaxValue = 100,
                Progress = light.brightness,
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
                SeekBarPadding = Application.GetRealWidth(20),
            };
            controlView.AddChidren(dimmerBar);
@@ -253,8 +254,8 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Visible = light.HadFadeTime,
                Enable = light.HadFadeTime,
                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
            };
            controlView.AddChidren(btnGradualChangeMinValuesText);
@@ -273,10 +274,10 @@
                ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                ProgressBarUnitSring = "s",
                MaxValue = 10,
                Progress = light.fadeTime,
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
                SeekBarPadding = Application.GetRealWidth(20),
                Visible = light.HadFadeTime,
                Enable = light.HadFadeTime,
                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
            };
            controlView.AddChidren(barFadeTime);
@@ -290,8 +291,8 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Visible = light.HadFadeTime,
                Enable = light.HadFadeTime,
                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
            };
            controlView.AddChidren(btnGradualChangeMaxValuesText);
            #endregion
@@ -315,15 +316,15 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = light.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(light);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
@@ -9,18 +9,18 @@
        /// <summary>
        /// æ›´æ–°åŠŸèƒ½çŠ¶æ€
        /// </summary>
        public static void UpdataStates(Light uFunction)
        public static void UpdataStates(Function updateTemp)
        {
            Application.RunOnMainThread((Action)(() =>
            Application.RunOnMainThread((() =>
            {
                try
                {
                    if (bodyView == null)
                        return;
                    if (uFunction.spk == bodyView.light.spk && uFunction.sid == bodyView.light.sid)
                    if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
                    {
                        if (uFunction.trait_on_off.curValue.ToString() == "on")
                        if (updateTemp.trait_on_off.curValue.ToString() == "on")
                        {
                            //解决部分安卓手机,刷新图片时会变小问题
                            if (bodyView.colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheel.png")
@@ -31,11 +31,11 @@
                            bodyView.btnSwitch.IsSelected = true;
                            if (!bodyView.onDimmerBar)
                            {
                                bodyView.dimmerBar.Progress = uFunction.brightness;
                                bodyView.dimmerBar.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Brightness));
                            }
                        }
                        //状态一样时,不再刷新视图
                        else if (uFunction.trait_on_off.curValue.ToString() == "off" && bodyView.btnSwitch.IsSelected == true)
                        else if (updateTemp.trait_on_off.curValue.ToString() == "off" && bodyView.btnSwitch.IsSelected == true)
                        {
                            //解决部分安卓手机,刷新图片时会变小问题
                            if (bodyView.colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheelGray.png")
@@ -48,8 +48,8 @@
                            //色盘的圆点隐藏
                            bodyView.btnWhiteRound.Visible = false;
                        }
                        bodyView.btnCurColor.BackgroundColor = (uint)(0xFF000000 + bodyView.light.GetRGBcolor());
                        if (bodyView.light.GetRGBcolor() == 16777215 && bodyView.btnCurColor.BorderColor != 0x00000000)
                        bodyView.btnCurColor.BackgroundColor = (uint)(0xFF000000 + bodyView.lightTemp.GetRGBcolor(updateTemp));
                        if (bodyView.lightTemp.GetRGBcolor(updateTemp) == 16777215 && bodyView.btnCurColor.BorderColor != 0x00000000)
                        {
                            bodyView.btnCurColor.BorderColor = CSS.CSS_Color.PromptingColor2;
                        }
@@ -77,8 +77,8 @@
            LoadEvet_ChangeFadeTime();
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = light.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = light.GetRoomListName();
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
            };
        }
@@ -95,7 +95,7 @@
            int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12);
            colorPicker.ColorChaged += (sender2, e2) => {
                if (light.trait_on_off.curValue.ToString() == "off"
                if (function.trait_on_off.curValue.ToString() == "off"
                  || pointIsRight == false)
                {
                    //pointIsRight:点的区域不是圆盘内
@@ -103,17 +103,17 @@
                }
                if ((DateTime.Now - colorChangeTime).TotalMilliseconds > 200)
                {
                    light.SetRGBcolor(e2);
                    lightTemp.SetRGBcolor(e2,function);
                    colorChangeTime = DateTime.Now;
                    btnCurColor.BackgroundColor = (uint)(0xFF000000 + light.GetRGBcolor());
                    btnCurColor.BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function));
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.RGB, light.GetRGBcolorString());
                    Control.Ins.SendWriteCommand(light, d);
                    d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function));
                    Control.Ins.SendWriteCommand(function, d);
                }
            };
            colorPicker.MouseDownEventHandler += (sender, e) =>
            {
                if (light.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
@@ -144,8 +144,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -163,39 +163,39 @@
                    onDimmerBar = false;
                })
                { IsBackground = true }.Start();
                light.brightness = dimmerBar.Progress;
                function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                Control.Ins.SendWriteCommand(light, d);
                light.fadeTime = barFadeTime.Progress;
                d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
                Control.Ins.SendWriteCommand(function, d);
                function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress);
            };
            dimmerBar.OnProgressChangedEvent = (sender, e) => {
                //light.fadeTime = 0;
                //function.fadeTime = 0;
                //if (!btnSwitch.IsSelected)
                //{
                //    dimmerBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
                //}
                //btnSwitch.IsSelected = e > 0 ? true : false;
                //light.brightness = e;
                //light.trait_on_off.curValue = e > 0 ? "on" : "off";
                //function.brightness = e;
                //function.trait_on_off.curValue = e > 0 ? "on" : "off";
                //if (e == 0 || e == 100)
                //{
                //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //    d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //    Control.Ins.SendWriteCommand(light, d);
                //    d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
                //    Control.Ins.SendWriteCommand(function, d);
                //}
                //else
                //{
                //    if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
                //    if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds)
                //    {
                //        light.refreshTime = DateTime.Now;
                //        function.refreshTime = DateTime.Now;
                //        new System.Threading.Thread(() =>
                //        {
                //            //Control.Send(CommandType_A.write, light);
                //            //Control.Send(CommandType_A.write, function);
                //            System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                //            d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
                //            Control.Ins.SendWriteCommand(light, d);
                //            d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString());
                //            Control.Ins.SendWriteCommand(function, d);
                //        })
                //        { IsBackground = true }.Start();
                //    }
@@ -214,8 +214,8 @@
        {
            barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
            {
                light.fadeTime = barFadeTime.Progress;
                light.UpdataFuncitonInfo();
                function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress);
                function.UpdataFuncitonInfo();
            };
        }
        /// <summary>
@@ -230,24 +230,24 @@
                bodyView.colorPicker.ColorImagePath = btnSwitch.IsSelected ? "FunctionIcon/Light/ColorWheel.png" : "FunctionIcon/Light/ColorWheelGray.png";
                new System.Threading.Thread(() =>
                {
                    light.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, light.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, light.fadeTime.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                    if (btnSwitch.IsSelected)
                    {
                        if(light.lastBrightness == 0)
                        if(function.lastBrightness == 0)
                        {
                            light.lastBrightness = 100;
                            function.lastBrightness = 100;
                            dimmerBar.Progress = 100;
                        }
                        d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString());
                        d.Add(FunctionAttributeKey.Brightness, function.lastBrightness.ToString());
                    }
                    else
                    {
                        light.lastBrightness = light.brightness;
                        function.lastBrightness = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness));
                    }
                    Control.Ins.SendWriteCommand(light, d);
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
@@ -259,19 +259,19 @@
        {
            btnRestoredPoint.MouseUpEventHandler = (sender, e) =>
            {
                if(light.trait_on_off.curValue.ToString() == "off")
                if(function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
                btnWhiteRound.Visible = true;
                btnWhiteRound.Gravity = Gravity.Center;
                light.SetRGBcolor(new byte[] { 255, 255, 255 });
                lightTemp.SetRGBcolor(new byte[] { 255, 255, 255 },function);
                btnCurColor.BackgroundColor = 0xFFFFFFFF;
                btnCurColor.BorderColor = CSS.CSS_Color.PromptingColor2;
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.RGB, light.GetRGBcolorString());
                Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function));
                Control.Ins.SendWriteCommand(function, d);
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
@@ -37,7 +37,8 @@
        #endregion
        #region åŒºåŸŸå˜é‡
        Light light;
        Light lightTemp = new Light();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -47,10 +48,10 @@
        Action actionRefresh;
        #endregion
        public RelayPage(Light func)
        public RelayPage(Function func)
        {
            bodyView = this;
            light = func;
            function = func;
        }
        /// <summary>
@@ -74,7 +75,7 @@
                btnFromFloor_Out = btnFromFloorOut;
            }
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), light);
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function);
            controlView = new FrameLayout()
            {
@@ -95,7 +96,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = light.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -108,7 +109,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = light.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -120,7 +121,7 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = light.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            //2020-12-16 å¦‚果是成员隐藏收藏功能
@@ -137,7 +138,7 @@
                Height = Application.GetRealWidth(288),
                UnSelectedImagePath = "FunctionIcon/Light/RelayBg.png",
                SelectedImagePath = "FunctionIcon/Light/RelayOnBg.png",
                IsSelected = light.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitchIcon);
@@ -149,16 +150,16 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = light.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(light);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
@@ -9,7 +9,7 @@
        /// <summary>
        /// æ›´æ–°ç¯å…‰çŠ¶æ€
        /// </summary>
        public static void UpdataState(Light uLight)
        public static void UpdataState(Function updataTemp)
        {
            Application.RunOnMainThread(() =>
            {
@@ -17,7 +17,7 @@
                {
                    if (bodyView == null)
                        return;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uLight.trait_on_off.curValue.ToString() == "on";
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                }
                catch (Exception ex)
                {
@@ -35,9 +35,9 @@
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = light.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = light.GetRoomListName();
                //light.SaveFunctionData(true);
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
@@ -47,8 +47,8 @@
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                light.CollectFunction();
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
@@ -62,10 +62,10 @@
                btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected;
                new System.Threading.Thread(() =>
                {
                    light.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off";
                    function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", light.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(light, d);
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
@@ -74,11 +74,11 @@
                btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected;
                new System.Threading.Thread(() =>
                {
                    light.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", light.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(light, d);
                    //Control.Send(CommandType_A.write, light);
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                    //Control.Send(CommandType_A.write, function);
                })
                { IsBackground = true }.Start();
            };
HdlBluWi/.DS_Store
Binary files differ
HdlBluWi/.vs/HdlBluWi/xs/UserPrefs.xml
File was deleted
HdlBluWi/.vs/HdlBluWi/xs/project-cache/HdlBluWi-Debug.json
File was deleted
HdlBluWi/.vs/HdlBluWi/xs/project-cache/HdlBluWi-Release.json
File was deleted
asset/logo/1024¡¤1024@2x.png
Binary files differ
asset/logo/120¡¤120@2x.png
Binary files differ
asset/logo/120¡¤120@3x.png
Binary files differ
asset/logo/180¡¤180@3x.png
Binary files differ
asset/logo/20¡¤20.png
Binary files differ
asset/logo/29¡¤29.png
Binary files differ
asset/logo/40¡¤40@2x.png
Binary files differ
asset/logo/512¡¤512.png
Binary files differ
asset/logo/58¡¤58@2x.png
Binary files differ
asset/logo/60¡¤60@3x.png
Binary files differ
asset/logo/80¡¤80@2x.png
Binary files differ
asset/logo/87¡¤87@3x.png
Binary files differ
file/¹ãÖݺӶ«1¼þÖ¤Êé.pdf
Binary files differ