From 1498a62d1d44d715e310b42e3133aa8cdc6eec92 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期三, 14 四月 2021 16:40:20 +0800 Subject: [PATCH] 2021-04-13 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/Entity/Function/Light.cs | 4 HDL-ON_Android/Assets/Language.ini | 14 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs | 18 HDL-ON_iOS/HDL-ON_iOS.csproj | 8 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs | 7 HDL_ON/HDL_ON.projitems | 3 HDL-ON_Android/HDL-ON_Android.csproj | 1 HDL-ON_iOS/Info.plist | 4 HDL-ON_iOS/Resources/Language.ini | 5 HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs | 33 + HDL_ON/Entity/Enumerative/MyEnum.cs | 33 + HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs | 6 .vs/HDL_APP_Project/xs/UserPrefs.xml | 63 + HDL_ON/DAL/DriverLayer/Control.cs | 2 HDL_ON/UI/MainPage.cs | 94 +++ HDL_ON/UI/UI1-Login/LoginPage.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs | 241 ++++++++++ HDL-ON_Android/Application.cs | 3 HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs | 437 +++++++++++++++++++ DLL/Shared.Droid.dll | 0 HDL_ON/Entity/Function/Scene.cs | 51 ++ HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs | 49 -- HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs | 4 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 32 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs | 60 -- HDL_ON/Entity/DB_ResidenceData.cs | 3 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 9 HDL-ON_iOS/Resources/Phone/Public/RightSlideBackIcon.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs | 58 -- HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs | 27 + HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs | 2 DLL/Shared.IOS.dll | 0 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 61 -- ThirdPartyIntegration/HdlBluWi/Blufi.xcodeproj/project.xcworkspace/xcuserdata/kaede.xcuserdatad/UserInterfaceState.xcuserstate | 0 HDL-ON_Android/Assets/Phone/Public/RightSlideBackIcon.png | 0 HDL_ON/Common/R.cs | 3 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 2 HDL_ON/DAL/Server/HttpServerRequest.cs | 1 HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs | 38 + 40 files changed, 1,058 insertions(+), 322 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index 9a7e9cb..f7957ac 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,31 +1,54 @@ 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> - <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" /> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotHistoryPage.cs"> + <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.26569F89-0BA9-4C06-81F2-764A3AF2E1B7" /> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/DriverLayer/Control_Udp.cs"> <Files> - <File FileName="HDL_ON/Common/HDLCommon.cs" Line="545" Column="14" /> - <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="482" Column="31" /> - <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="9" Column="1" /> - <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="195" Column="41" /> - <File FileName="HDL_ON/UI/MainPage.cs" Line="23" Column="46" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs" Line="273" Column="38" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotHistoryPage.cs" Line="14" Column="9" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs" Line="36" Column="20" /> + <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" /> + <File FileName="HDL-ON_Android/Application.cs" /> + <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" /> + <File FileName="HDL_ON/UI/MainPage.cs" /> + <File FileName="HDL_ON/Common/R.cs" /> + <File FileName="HDL-ON_Android/Assets/Language.ini" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs" Line="300" Column="56" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs" Line="104" Column="56" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs" Line="634" Column="40" /> + <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="300" Column="1" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" Line="147" Column="36" /> + <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="159" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="HDL_APP_Project" expanded="True"> <Node name="HDL_ON" expanded="True"> - <Node name="UI" expanded="True"> - <Node name="UI2" expanded="True"> - <Node name="FuntionControlView" expanded="True"> - <Node name="Electrical" expanded="True"> - <Node name="TuyaWeepRobotHistoryPage.cs" selected="True" /> - </Node> - </Node> + <Node name="Common" expanded="True" /> + <Node name="DAL" expanded="True"> + <Node name="DriverLayer" expanded="True"> + <Node name="Control_Udp.cs" selected="True" /> </Node> </Node> + <Node name="Entity" expanded="True"> + <Node name="Function" expanded="True" /> + </Node> + <Node name="UI" expanded="True"> + <Node name="UI0-Public" expanded="True" /> + <Node name="UI2" expanded="True"> + <Node name="1-HomePage" expanded="True" /> + <Node name="2-Classification" expanded="True" /> + <Node name="3-Intelligence" expanded="True"> + <Node name="Scene" expanded="True" /> + </Node> + <Node name="4-PersonalCenter" expanded="True"> + <Node name="MemberManagement" expanded="True" /> + </Node> + <Node name="FuntionControlView" expanded="True" /> + </Node> + </Node> + </Node> + <Node name="HDL-ON_Android" expanded="True"> + <Node name="Assets" expanded="True" /> </Node> <Node name="HDL-ON_iOS" expanded="True" /> </Node> @@ -39,11 +62,13 @@ <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> <String>Shared.IOS/Shared.IOS.csproj</String> </DisabledProjects> - <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> + <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" /> <MonoDevelop.Ide.DebuggingService.Breakpoints> <BreakpointStore> <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" line="34" column="1" /> + <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" line="313" column="1" /> + <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs" line="210" column="1" /> </BreakpointStore> </MonoDevelop.Ide.DebuggingService.Breakpoints> <MultiItemStartupConfigurations /> diff --git a/DLL/Shared.Droid.dll b/DLL/Shared.Droid.dll index 8ac3b4a..999dac3 100644 --- a/DLL/Shared.Droid.dll +++ b/DLL/Shared.Droid.dll Binary files differ diff --git a/DLL/Shared.IOS.dll b/DLL/Shared.IOS.dll index 76fa234..afd5bd6 100644 --- a/DLL/Shared.IOS.dll +++ b/DLL/Shared.IOS.dll Binary files differ diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs index a8d7ef5..f1dd0ad 100644 --- a/HDL-ON_Android/Application.cs +++ b/HDL-ON_Android/Application.cs @@ -85,7 +85,8 @@ } catch (Exception ex) { - Console.WriteLine(ex.Message); + MainPage.Log(ex.Message); + BaseActivity.VerifyDateTime = DateTime.MaxValue; } }; diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index d2b9e87..e5c9d89 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -328,7 +328,7 @@ 324=Scene delay 325=Delay setting 326=Delay -327=Capture the scene +327=Catch Scene 328=Film scene 329=General 330=Automatic mode @@ -423,10 +423,13 @@ 436=Added Devices 437=Device List 438=humidity:{0}% air:{1} wind:{2} +439=Real time power consumption: {0} kw +440=Next step +441=Please select all areas of capture status +442=Generate scene - -1000=Indoor Humidity +1000=Room Humidity 1001=V-chip 1002=Anion 1003=Sterilization @@ -1200,6 +1203,9 @@ 437=璁惧鍒楄〃 438=婀垮害:{0}% 绌烘皵:{1} 椋庨��:{2}绾� 439=瀹炴椂鍔熻��: {0}kW +440=涓嬩竴姝� +441=璇烽�夋嫨鎹曡幏鐘舵�佺殑鍖哄煙 +442=鐢熸垚鍦烘櫙 1000=瀹ゅ唴婀垮害 1001=绔ラ攣 @@ -1290,7 +1296,6 @@ 1086=椋庨��3妗� - 4000=鍙瀵硅 4001=閫氳瘽璁板綍 4002=*浜戠鐓х墖鍙繚鐣�30澶� @@ -1306,7 +1311,6 @@ 4012=閰嶇疆鍙傛暟鏈夊紓甯�! 4013=闂ㄧ浜岀淮鐮� 4014=涓存椂瀵嗙爜 - 5000=闊充箰 5001=缁勫悎 diff --git a/HDL-ON_Android/Assets/Phone/Public/RightSlideBackIcon.png b/HDL-ON_Android/Assets/Phone/Public/RightSlideBackIcon.png new file mode 100644 index 0000000..f508ad1 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Public/RightSlideBackIcon.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 156c832..0975676 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -1112,6 +1112,7 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\airFreshjinmao.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_blue.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_white.png" /> + <AndroidAsset Include="Assets\Phone\Public\RightSlideBackIcon.png" /> </ItemGroup> <ItemGroup> <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index cb0a90f..9733c4c 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202104011" android:versionName="1.2.202104011" package="com.hdl.onpro"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202104131" android:versionName="1.2.202104131" package="com.hdl.onpro"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" /> <!-- 鍙瀵硅鏉冮檺--> <uses-permission android:name="android.permission.CAMERA" /> diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index 733557b..e767896 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -78,10 +78,6 @@ <Reference Include="System.Numerics" /> <Reference Include="System.Numerics.Vectors" /> <Reference Include="System.Web.Services" /> - <Reference Include="Shared.IOS"> - <HintPath>..\DLL\Shared.IOS.dll</HintPath> - <Private>False</Private> - </Reference> <Reference Include="Shared.IOS.TBL"> <HintPath>..\DLL\Shared.IOS.TBL.dll</HintPath> <Private>False</Private> @@ -97,6 +93,9 @@ </Reference> <Reference Include="Shared.IOS.ESVideoOnSDK"> <HintPath>..\DLL\FL\iOS\Shared.IOS.ESVideoOnSDK.dll</HintPath> + </Reference> + <Reference Include="Shared.IOS"> + <HintPath>..\DLL\Shared.IOS.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> @@ -1219,6 +1218,7 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Icon\airFreshjinmao.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_blue.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_white.png" /> + <BundleResource Include="Resources\Phone\Public\RightSlideBackIcon.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index 14403c6..60f105d 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -104,9 +104,9 @@ <key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string> <key>CFBundleShortVersionString</key> - <string>1.2.202104011</string> + <string>1.2.202104131</string> <key>CFBundleVersion</key> - <string>202104011</string> + <string>202104131</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Use geographic location to provide services such as weather</string> <key>NSAppleMusicUsageDescription</key> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 4cdd0dd..3923d05 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -423,6 +423,9 @@ 436=Added Devices 437=Device List 438=humidity:{0}% air:{1} wind:{2} +439=Real time power consumption: {0} kw +440=Next step +441=Please select all areas of capture status 1000=Room Humidity 1001=V-chip @@ -1198,6 +1201,8 @@ 437=璁惧鍒楄〃 438=婀垮害:{0}% 绌烘皵:{1} 椋庨��:{2}绾� 439=瀹炴椂鍔熻��: {0}kW +440=涓嬩竴姝� +441=璇烽�夋嫨鎹曡幏鐘舵�佺殑鍖哄煙 1000=瀹ゅ唴婀垮害 1001=绔ラ攣 diff --git a/HDL-ON_iOS/Resources/Phone/Public/RightSlideBackIcon.png b/HDL-ON_iOS/Resources/Phone/Public/RightSlideBackIcon.png new file mode 100644 index 0000000..f508ad1 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/RightSlideBackIcon.png Binary files differ diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 8595a72..a06d9be 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -4,6 +4,9 @@ { public static class StringId { + public const int GenerateScene = 442; + public const int ChooseCatchZone = 441; + public const int NextStep = 440; public const int RealTimePowerConsumption = 439; public const int EnvirSensorValueTip = 438; public const int DeviceList = 437; diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index ae081bc..df2a183 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -336,7 +336,7 @@ } } - MainPage.Log($"鍙戦�佹暟鎹�:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}"); + //MainPage.Log($"鍙戦�佹暟鎹�:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}"); ///绗笁鏂规秱楦﹁澶囩粺涓�浣跨敤杩滅▼鎺у埗 switch(function.spk) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index d693f04..0ba5b75 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -1878,6 +1878,7 @@ d.Add("actions", actionObjs); var requestJson = HttpUtil.GetSignRequestJson(d); + MainPage.Log($"{requestJson}"); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson); } /// <summary> diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index 8cbd2a2..f1fd99e 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -94,7 +94,8 @@ ShowFunction.EnergyMonitoring, ShowFunction.FreshAir,ShowFunction.DoorLock, ShowFunction.Panel,ShowFunction.SecurityMonitoring, - ShowFunction.Sensor,ShowFunction.VideoIntercom + ShowFunction.Sensor,ShowFunction.VideoIntercom, + ShowFunction.SecurityCenter }); instance.SaveResidenceData(); } diff --git a/HDL_ON/Entity/Enumerative/MyEnum.cs b/HDL_ON/Entity/Enumerative/MyEnum.cs index 5930ba8..d365658 100644 --- a/HDL_ON/Entity/Enumerative/MyEnum.cs +++ b/HDL_ON/Entity/Enumerative/MyEnum.cs @@ -137,20 +137,39 @@ /// </summary> Weather = 0x14, - + /// <summary> + /// 闂ㄩ攣 + /// </summary> DoorLock = 0x15, - + /// <summary> + /// 鐢靛櫒 + /// </summary> Electric = 0x16, - + /// <summary> + /// 鑳芥簮鐩戞帶 + /// </summary> EnergyMonitoring = 0x17, - + /// <summary> + /// 鐜鏁版嵁 + /// </summary> Environmental = 0x18, - + /// <summary> + /// 闈㈡澘 + /// </summary> Panel = 0x19, - + /// <summary> + /// 瀹夐槻鐩戞帶 + /// </summary> SecurityMonitoring = 0x20, - + /// <summary> + /// 鍙瀵硅 + /// </summary> VideoIntercom = 0x21, + /// <summary> + /// 瀹夐槻涓績 + /// </summary> + SecurityCenter = 0x22, + } diff --git a/HDL_ON/Entity/Function/Light.cs b/HDL_ON/Entity/Function/Light.cs index 63d3f63..65d6f5a 100644 --- a/HDL_ON/Entity/Function/Light.cs +++ b/HDL_ON/Entity/Function/Light.cs @@ -15,6 +15,10 @@ { var color = function.GetAttrState(FunctionAttributeKey.RGB).Split(","); + if(color.Length!= 3) + { + color = new string[] {"100", "100", "100" }; + } int redColor = 0; int greenColor = 0; int blueColor = 0; diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index 6f15f57..3970bc1 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using HDL_ON.Common; using HDL_ON.DAL.Server; +using HDL_ON.UI; using Shared; namespace HDL_ON.Entity @@ -368,6 +369,8 @@ /// 浜戠鏁版嵁淇敼鐨勬渶鍚庢椂闂� /// </summary> public string modifyTime = ""; + + } /// <summary> /// 鍦烘櫙鍔熻兘瀵硅薄 @@ -409,6 +412,54 @@ return localFunction; } + + /// <summary> + /// 瑙f瀽鍦烘櫙鍔熻兘鏁版嵁 + /// </summary> + /// <param name="sceneFunction"></param> + public string GetFunctionScnenInfo() + { + var sceneFunctionInfo = ""; + foreach (var sfs in status) + { + if (sfs.key == FunctionAttributeKey.OnOff) + { + if (sfs.value == "off") + return Language.StringByID(StringId.Close); + } + } + sceneFunctionInfo += Language.StringByID(StringId.Open) + " "; + + var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode); + var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp); + var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); + if (modeState != null) + { + sceneFunctionInfo += modeState.GetValueText() + " "; + } + if (tempState != null) + { + sceneFunctionInfo += tempState.GetValueText() + " "; + sceneFunctionInfo += tempState.GetUintString(); + } + if (fanState != null) + { + sceneFunctionInfo += fanState.GetValueText() + " "; + } + var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); + if (briState != null) + { + sceneFunctionInfo += briState.value + "%"; + } + var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent); + if (perState != null) + { + sceneFunctionInfo += perState.value + "%"; + } + return sceneFunctionInfo; + } + + } /// <summary> diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 560e165..198f53a 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -395,6 +395,8 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoSend.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoMainView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\ObjectClass.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\CatchSceneAddPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\CatchSceneCatchFunctionListPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)DAL\" /> @@ -438,5 +440,6 @@ <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\" /> <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\" /> <Folder Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Arm\" /> </ItemGroup> </Project> \ No newline at end of file diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index c5a62b3..c10c1b8 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -20,7 +20,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "1.2.0401"; + public static string VersionString = "1.2.0413"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> @@ -67,6 +67,14 @@ ///// </summary> //public static int Company = 0; + /// <summary> + /// 鍙虫粦鍚庨��鎻愮ず鎸夐挳 + /// </summary> + public static Button BtnBackIcon; + /// <summary> + /// 鍚庨��鍙虫粦浜嗗灏戣窛绂伙紝瓒呰繃涓�瀹氳窛绂绘墠瑙﹀彂鍚庨��浜嬩欢 + /// </summary> + public static int StartX = 0; /// <summary> /// 鏄惁鍏ㄩ潰灞忔墜鏈� /// </summary> @@ -190,7 +198,7 @@ waitPage.RemoveFromParent(); BaseView.RemoveAll(); BasePageView = new PageLayout(); - BasePageView.ScrollEnabled = true; + BasePageView.ScrollEnabled = false; BasePageView.IsShowPoint = false; BasePageView.PageChange = (sender, e) => { @@ -212,17 +220,81 @@ // BasePageView.GetChildren(BasePageView.ChildrenCount - 1).RemoveFromParent(); //} }; - BasePageView.MouseDownEventHandler += (sender, e) => - { - BasePageView.ScrollEnabled = true; - }; - BasePageView.MouseUpEventHandler += (sender, e) => - { - BasePageView.ScrollEnabled = false; - }; BaseView.AddChidren(BasePageView); - + var backView = new FrameLayout() + { + Y = Application.GetRealHeight(100), + Width = Application.GetRealWidth(10), + Height = Application.GetRealHeight(440), + }; + BaseView.AddChidren(backView); + + BtnBackIcon = new Button() + { + X = -Application.GetRealWidth(100), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(88/2), + Height = Application.GetRealHeight(56/2), + UnSelectedImagePath = "Public/RightSlideBackIcon.png" + }; + BaseView.AddChidren(BtnBackIcon); + backView.MouseMoveEventHandler = (sender, e) => + { + if (BasePageView.ChildrenCount <= 1) + { + return; + } + MainPage.Log($"move:{e.X}"); + if (StartX == 0 && e.X < 30) { + StartX = (int)e.X; + } + if (StartX < 30 ) + { + if (e.X < Application.GetRealWidth(100)) + { + BtnBackIcon.X = (int)e.X - Application.GetRealWidth(100); + } + } + }; + backView.MouseDownEventHandler = (sender, e) => + { + if (BasePageView.ChildrenCount <= 1) + { + return; + } + MainPage.Log($"down:{e.X}"); + StartX = (int)e.X; + BtnBackIcon.Y = (int)e.Y + Application.GetRealHeight(50); + }; + backView.MouseUpEventHandler = (sender, e) => { + MainPage.Log($"up{e.X}"); + StartX = 0; + BtnBackIcon.X = -Application.GetRealWidth(100); + + if (e.X > 70) + { + if (BasePageView.ChildrenCount > 1) + { + BasePageView.PageIndex = BasePageView.ChildrenCount - 2; + } + } + }; + backView.MouseUpOutsideEventHandler=(sender, e) => { + MainPage.Log($"up{e.X}"); + StartX = 0; + BtnBackIcon.X = -Application.GetRealWidth(100); + + if (e.X > 70) + { + if (BasePageView.ChildrenCount > 1) + { + BasePageView.PageIndex = BasePageView.ChildrenCount - 2; + } + } + }; + + //璺宠浆椤甸潰---- var UserBasePage = new UserPage(); BasePageView.AddChidren(UserBasePage); diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index c28bcfa..a60af1c 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -208,7 +208,7 @@ //etAccount.Text = "13168123446"; //etAccount.Text = "13602944661";//kx etAccount.Text = "18316120654";//鍑夐湼"18666455392";//13375012446//13602944661//tzy 18778381374 - //15971583093 gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 鍥藉鏈嶅姟鍣ㄦ祴璇� + //etAccount.Text = "15971583093";// gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 鍥藉鏈嶅姟鍣ㄦ祴璇� } b = !b; etPassword.Text = "123456"; diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index 8e33a2b..75aaa60 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -506,6 +506,11 @@ functionCount = 1; } break; + case ShowFunction.SecurityCenter: +#if DEBUG + functionCount = 1; +#endif + break; } @@ -563,7 +568,7 @@ if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir - && item != ShowFunction.EnergyMonitoring + && item != ShowFunction.EnergyMonitoring && item != ShowFunction.SecurityCenter && functionCount != 0) { Button btnFunctionCount = new Button() @@ -815,7 +820,7 @@ } //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈� if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring - && ShowFunction.EnergyMonitoring!= item && ShowFunction.VideoIntercom != item) + && ShowFunction.EnergyMonitoring!= item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item) { btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs index 96c0b3b..c88c448 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs @@ -61,67 +61,6 @@ } LoadDiv(); - //switch (function.spk) - //{ - // case SPK.CurtainSwitch: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png"; - // break; - // case SPK.CurtainTrietex: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/MotorCurtainIcon.png"; - // break; - // case SPK.CurtainRoller: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/RollingShutterIcon.png"; - // break; - // case SPK.SensorPir: - // btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorPirIcon.png"; - // break; - // case SPK.SensorWater: - // btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorWaterImmersionIcon.png"; - // break; - // case SPK.SensorSmoke: - // btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorSmokeIcon.png"; - // break; - // case SPK.SensorDoorWindow: - // btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorDoorIcon.png"; - // break; - // case SPK.MusicStandard: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png"; - // break; - // case SPK.ClothesHanger: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/ClothesHanger/ClothesHangerGrayIcon.png"; - // break; - // case SPK.ElectricSocket: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png"; - // break; - // case SPK.ElectricFan: - // case SPK.ElectricTuyaFan: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png"; - // break; - // case SPK.ElectricTV: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png"; - // break; - // case SPK.ElectricTuyaAirCleaner: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/AirCleanerThiinIcon.png"; - // break; - // case SPK.ElectricTuyaWeepRobot: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobotThinIcon.png"; - // break; - // case SPK.ElectricTuyaWaterValve: - // btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WaterValve/WaterValveIcon.png"; - // break; - // case SPK.AcStandard: - // btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png"; - // break; - // case SPK.AcIr: - // btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png"; - // break; - // case SPK.FloorHeatStandard: - // btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png"; - // break; - // default: - // btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; - // break; - //} btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; if (function.Spk_Prefix == FunctionCategory.Curtain//绐楀笜娌℃湁寮�鍏虫寜閽� diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs new file mode 100644 index 0000000..352dc86 --- /dev/null +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs @@ -0,0 +1,437 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI +{ + public class CatchSceneAddPage : FrameLayout + { + FrameLayout bodyView; + private ImageView addSceneImageView; + private FrameLayout sceneNameView; + private Button btnEditSceneNameIcon; + private Button btnSceneName; + private FrameLayout belongToZoneRow; + private Button btnBelongToZoneRight; + private Button btnZoneName; + private Scene scene; + private Button btnChooseZoneViewTitle; + private VerticalScrolViewLayout functionListView; + private Button btnComplete; + /// <summary> + /// 鎹曟崏鐨勫尯鍩熷垪琛� + /// </summary> + private List<Room> catchRooms = new List<Room>(); + + /// <summary> + /// 鍥炶皟鏇存柊 + /// </summary> + Action backAction; + public CatchSceneAddPage(Scene s,Action a) + { + bodyView = this; + scene = s; + backAction =()=>{ + a(); + RemoveFromParent(); + }; + } + + + public void LoadPage() + { + new TopViewDiv(bodyView, Language.StringByID(StringId.CatchScene)).LoadTopView(); + + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + + var contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(603 - 50), + }; + bodyView.AddChidren(contentView); + contentView.AddChidren(new Button() { + Height = Application.GetRealWidth(12), + BackgroundColor = CSS_Color.MainBackgroundColor, + }); + + var sceneBgView = new FrameLayout() + { + Height = Application.GetRealWidth(188 + 24), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(sceneBgView); + + addSceneImageView = new ImageView() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(252), + Height = Application.GetRealWidth(184), + Radius = (uint)Application.GetRealWidth(12), + }; + sceneBgView.AddChidren(addSceneImageView); + + //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶 + ImageUtlis.Current.LoadLocalOrNetworkImages(scene.ImagePath, addSceneImageView); + + #region 鍦烘櫙鍚嶇Оrow + sceneNameView = new FrameLayout() + { + Height = Application.GetRealWidth(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(sceneNameView); + + Button btnSceneTitle = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(90), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.SceneName, + }; + sceneNameView.AddChidren(btnSceneTitle); + + btnEditSceneNameIcon = new Button() + { + X = Application.GetRealWidth(333), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), + UnSelectedImagePath = "Public/EditIcon.png", + }; + sceneNameView.AddChidren(btnEditSceneNameIcon); + + btnSceneName = new Button() + { + X = Application.GetRealWidth(100), + Width = Application.GetRealWidth(230), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = scene.name + }; + sceneNameView.AddChidren(btnSceneName); + + Button btnSceneNameLine = new Button() + { + Y = Application.GetRealWidth(49), + Gravity = Gravity.CenterHorizontal, + Height = Application.GetRealHeight(1), + Width = Application.GetRealWidth(343), + BackgroundColor = CSS_Color.BackgroundColor, + }; + sceneNameView.AddChidren(btnSceneNameLine); + #endregion + + #region 鎵�灞炲尯鍩焤ow + belongToZoneRow = new FrameLayout() + { + Y = sceneNameView.Bottom, + Height = Application.GetRealWidth(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(belongToZoneRow); + + Button btnBelongToTitle = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(90), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.LocationManagement, + }; + belongToZoneRow.AddChidren(btnBelongToTitle); + + btnBelongToZoneRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + belongToZoneRow.AddChidren(btnBelongToZoneRight); + + btnZoneName = new Button() + { + X = Application.GetRealWidth(100), + Width = Application.GetRealWidth(230), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = scene.GetRoomListName() == "" ? Language.StringByID(StringId.WholeZone) : scene.GetRoomListName() + }; + belongToZoneRow.AddChidren(btnZoneName); + + contentView.AddChidren(new Button() + { + Y = belongToZoneRow.Bottom, + Height = Application.GetRealHeight(8), + BackgroundColor = CSS_Color.BackgroundColor, + }); + #endregion + #region 鍦烘櫙寤舵椂row + /* + if (DB_ResidenceData.Instance.GatewayType == 1) + { + FrameLayout sceneDelayRow = new FrameLayout() + { + Y = sceneNameView.Bottom, + Height = Application.GetRealWidth(50), + }; + contentView.AddChidren(sceneDelayRow); + + Button btnSceneDelayRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + sceneDelayRow.AddChidren(btnSceneDelayRight); + + var btnSceneDelayInfo = new Button() + { + Width = Application.GetRealWidth(327), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = scene.GetDelayText() + }; + sceneDelayRow.AddChidren(btnSceneDelayInfo); + + Button btnSceneDelayTitle = new Button() + { + X = Application.GetRealWidth(16), + //Width = Application.GetRealWidth(90), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.SceneDelay, + }; + sceneDelayRow.AddChidren(btnSceneDelayTitle); + + btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => + { + Action<string> action = (obj) => { + scene.delay = obj; + btnSceneDelayInfo.Text = scene.GetDelayText(); + }; + Dictionary<string, string> items = new Dictionary<string, string>(); + items.Add("30", "30s"); + items.Add("60", "1min"); + items.Add("120", "2min"); + items.Add("300", "5min"); + new PublicAssmebly().SetSceneDelayDialog(items, action, scene.delay); + }; + + contentView.AddChidren(new Button() + { + Y = sceneDelayRow.Bottom, + Height = Application.GetRealHeight(8), + BackgroundColor = CSS_Color.BackgroundColor, + }); + } + */ + #endregion + + #region 閫夋嫨鍖哄煙 + FrameLayout chooseZoneView = new FrameLayout() + { + Height = Application.GetRealWidth(44), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(chooseZoneView); + + btnChooseZoneViewTitle = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.ChooseCatchZone, + IsBold = true, + }; + chooseZoneView.AddChidren(btnChooseZoneViewTitle); + + functionListView = new VerticalScrolViewLayout() + { + Height = 0, + }; + contentView.AddChidren(functionListView); + + LoadRoomRow(functionListView); + + Button btnLine1 = new Button() + { + Height = Application.GetRealHeight(8), + BackgroundColor = CSS_Color.BackgroundColor, + }; + contentView.AddChidren(btnLine1); + + + + #endregion + + Button btnBottomLine = new Button() + { + Y = Application.GetRealHeight(667 - 50) - 1, + Height = 1, + BackgroundColor = CSS_Color.BackgroundColor, + }; + bodyView.AddChidren(btnBottomLine); + + btnComplete = new Button() + { + Y = Application.GetRealHeight(667 - 50), + Height = Application.GetRealHeight(50), + TextAlignment = TextAlignment.Center, + SelectedTextColor = CSS_Color.MainColor, + TextColor = CSS_Color.BackgroundColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.NextStep, + BackgroundColor = CSS_Color.MainBackgroundColor, + SelectedBackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(btnComplete); + + btnComplete.MouseUpEventHandler = (sender, e) => { + if(btnComplete.IsSelected) + { + if (string.IsNullOrEmpty(scene.name)) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.SceneNameCannotBeEmpty), + Direction = AMPopTipDirection.None, + }.Show(bodyView); + return; + } + + foreach (var tempRoom in FunctionList.List.scenes) + { + if (scene.name == tempRoom.name) + { + new PublicAssmebly().TipMsg(StringId.Tip, StringId.SceneNameAlreadyExists); + return; + } + } + + var catchFunctionList = new List<Function>(); + foreach(var temp in FunctionList.List.Functions) + { + foreach(var catchRoom in catchRooms) + { + if(temp.roomIds.Contains(catchRoom.roomId)) + { + catchFunctionList.Add(temp); + } + } + } + + var view = new CatchSceneCatchFunctionListPage(scene, catchFunctionList, backAction); + MainPage.BasePageView.AddChidren(view); + view.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + }; + } + + + + /// <summary> + /// 鍔犺浇鍔熻兘鍒楄〃 + /// </summary> + void LoadRoomRow(VerticalScrolViewLayout functionListView) + { + functionListView.RemoveAll(); + var roomCount = SpatialInfo.CurrentSpatial.RoomList.Count; + functionListView.Height = Application.GetRealWidth(51 * roomCount); + int i = 0; + foreach(var room in SpatialInfo.CurrentSpatial.RoomList) + { + if (i < roomCount ) + { + functionListView.AddChidren(new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealWidth(1), + BackgroundColor = CSS_Color.BackgroundColor, + }); + } + i++; + var row = new FrameLayout() + { + Height = Application.GetRealWidth(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + functionListView.AddChidren(row); + + Button btnChoose = new Button() + { + X = Application.GetRealWidth(331), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), + UnSelectedImagePath = "Public/ChooseIcon.png", + SelectedImagePath = "Public/ChooseOnIcon.png", + }; + row.AddChidren(btnChoose); + + var btnRoomName = new TextButton() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + Text = room.roomName, + }; + row.AddChidren(btnRoomName); + btnRoomName.Width = Utlis.GetRealWidthByTextButton(btnRoomName)+Application.GetRealWidth(12); + + var btnRoomFloor = new TextButton() + { + X = btnRoomName.Right, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = room.floorName, + }; + row.AddChidren(btnRoomFloor); + btnRoomFloor.Width = Utlis.GetRealWidthByTextButton(btnRoomFloor) + Application.GetRealWidth(12); + + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + btnChoose.IsSelected = !btnChoose.IsSelected; + if (btnChoose.IsSelected) + { + catchRooms.Add(room); + }else + { + catchRooms.Remove(room); + } + if (catchRooms.Count == 1) + { + btnComplete.IsSelected = true; + } + else if (catchRooms.Count == 0) + { + btnComplete.IsSelected = false; + } + }; + btnRoomFloor.MouseUpEventHandler = eventHandler; + btnRoomName.MouseUpEventHandler = eventHandler; + btnChoose.MouseUpEventHandler = eventHandler; + row.MouseUpEventHandler = eventHandler; + } + } + + + } +} diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs new file mode 100644 index 0000000..2ae3509 --- /dev/null +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs @@ -0,0 +1,241 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Threading; +using HDL_ON.DAL.Server; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI +{ + public class CatchSceneCatchFunctionListPage :FrameLayout + { + /// <summary> + /// 涓绘帶浠� + /// </summary> + FrameLayout bodyView; + /// <summary> + /// 鍐呭鍖哄煙 + /// </summary> + VerticalScrolViewLayout contentView; + /// <summary> + /// 鐢熸垚鍦烘櫙鎸夐挳 + /// </summary> + Button btnGenerateScene; + + + Scene scene; + /// <summary> + /// 鎹曟崏鍒板埌鍔熻兘鏁版嵁 + /// </summary> + List<Function> catchFunctionList; + /// <summary> + /// 鍥炴帀鏇存柊浜嬩欢 + /// </summary> + Action backAction; + + public CatchSceneCatchFunctionListPage(Scene s, List<Function> list,Action action) + { + bodyView = this; + scene = s; + catchFunctionList = list; + backAction = action; + } + + public void LoadPage() + { + new TopViewDiv(bodyView, Language.StringByID(StringId.CatchScene)).LoadTopView(); + + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + + contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(667 - 64 - 60), + }; + bodyView.AddChidren(contentView); + + + LoadFunctionRow(); + + btnGenerateScene = new Button() + { + Y = Application.GetRealHeight(667 - 50), + Height = Application.GetRealHeight(50), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.GenerateScene, + BackgroundColor = CSS_Color.MainBackgroundColor, + SelectedBackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(btnGenerateScene); + LoadEvent_CompleteEvent(); + } + + /// <summary> + /// 鍔犺浇鍔熻兘淇℃伅琛� + /// </summary> + private void LoadFunctionRow() + { + contentView.RemoveAll(); + scene.functions.Clear(); + bool isFrist = true; + + foreach (var function in catchFunctionList) + { + var scenefunction = function.ConvertSceneFunction(); + + scene.functions.Add(scenefunction); + + RowLayout functionRow = new RowLayout() + { + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + LineColor = 0x00000000, + }; + contentView.AddChidren(functionRow); + + if (isFrist) + { + isFrist = false; + } + else + { + functionRow.AddChidren(new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealWidth(1), + BackgroundColor = CSS_Color.DividingLineColor, + }); + } + + var btnFunctionIcon = new Button() + { + X = Application.GetRealWidth(12), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), + }; + functionRow.AddChidren(btnFunctionIcon); + + btnFunctionIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; + + var btnName = new Button() + { + X = Application.GetRealWidth(8 + 10 + 32), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(32), + Text = function.name, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + }; + functionRow.AddChidren(btnName); + + var btnFromFloor = new Button() + { + X = Application.GetRealWidth(8 + 10 + 32), + Y = Application.GetRealHeight(24), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(26), + Text = function.GetRoomListName(), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + functionRow.AddChidren(btnFromFloor); + + Button btnRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + functionRow.AddChidren(btnRight); + + var btnFunctionInfo = new Button() + { + Width = Application.GetRealWidth(327), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = scenefunction.GetFunctionScnenInfo(), + }; + functionRow.AddChidren(btnFunctionInfo); + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + Action refreshFunctionRowAction = () => { + btnFunctionInfo.Text = scenefunction.GetFunctionScnenInfo(); + }; + var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction); + MainPage.BasePageView.AddChidren(ssf); + ssf.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + btnFunctionInfo.MouseUpEventHandler = eventHandler; + btnRight.MouseUpEventHandler = eventHandler; + + Button btnDelSceneFunction = new Button() + { + BackgroundColor = CSS_Color.WarningColor, + TextColor = CSS_Color.MainBackgroundColor, + TextID = StringId.Del, + }; + functionRow.AddRightView(btnDelSceneFunction); + btnDelSceneFunction.MouseUpEventHandler = (sender, e) => { + catchFunctionList.Remove(function); + LoadFunctionRow(); + }; + } + + } + + /// <summary> + /// 瀹屾垚鎸夐挳鐐瑰嚮浜嬩欢 + /// </summary> + void LoadEvent_CompleteEvent() + { + btnGenerateScene.MouseUpEventHandler += (sender, e) => + { + var waitPage = new Loading(); + MainPage.BaseView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + new Thread(() => + { + try + { + var serverScene = new Scene(); + var result = FunctionList.List.AddScene(scene, out serverScene); + Application.RunOnMainThread(() => + { + if (result == StateCode.SUCCESS) + { + scene = serverScene; + FunctionList.List.scenes.Add(scene); + backAction(); + RemoveFromParent(); + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(result); + } + }); + } + catch { } + finally + { + Application.RunOnMainThread(() => { + waitPage.Hide(); + waitPage.RemoveFromParent(); + }); + } + }) + { IsBackground = true, Priority = ThreadPriority.AboveNormal }.Start(); + }; + } + + + } +} diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs index 56b569f..8e94a49 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs @@ -63,8 +63,6 @@ addSceneView.AddChidren(btnAddSceneText); #endregion - #region F3闃舵 - /* #region 鎹曡幏鍦烘櫙 FrameLayout catchSceneView = new FrameLayout() { @@ -103,6 +101,7 @@ #endregion + /* #region 鐢靛奖鍦烘櫙 FrameLayout movieSceneView = new FrameLayout() { @@ -140,7 +139,6 @@ movieSceneView.AddChidren(btnMovieSceneText); #endregion */ - #endregion LoadEventList(); } @@ -152,17 +150,16 @@ void LoadEventList() { LoadEvent_SkipAddScenePage(); + LoadEvent_SkipCatchScenePage(); } + /// <summary> + /// 璺宠浆鍒涘缓鍦烘櫙鐣岄潰 + /// </summary> void LoadEvent_SkipAddScenePage() { btnAddSceneBg.MouseUpEventHandler = (sender, e) => { - //if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) - //{ - // new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.UnableToCreateScenarioPleaseBindGateway), true); - // return; - //} Action backAction = () => { this.RemoveFromParent(); action(); @@ -176,5 +173,25 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } + + /// <summary> + /// 璺宠浆鎹曡幏鍦烘櫙鐣岄潰 + /// </summary> + void LoadEvent_SkipCatchScenePage() + { + btnCatchSceneBg.MouseUpEventHandler = (sener, e) => { + Action backAction = () => { + this.RemoveFromParent(); + action(); + }; + var scene = new Scene() { roomIds = new System.Collections.Generic.List<string>() { "" } }; + scene.NewSid(); + scene.name = Language.StringByID(StringId.Scene) + " " + (1 + FunctionList.List.scenes.Count).ToString(); + var aep = new CatchSceneAddPage(scene, backAction); + MainPage.BasePageView.AddChidren(aep); + aep.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + } } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs index 4f9c820..184482a 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs @@ -81,7 +81,7 @@ /// </summary> Action refreshFunctionRowAction; /// <summary> - /// 鍥炴帀鏇存柊 + /// 鍥炶皟鏇存柊 /// </summary> Action backAction; public SceneAddPage(Scene s, Action act) @@ -369,6 +369,8 @@ LoadEventList(); } + + /// <summary> /// 鍔犺浇鍔熻兘鍒楄〃 /// </summary> @@ -457,20 +459,16 @@ }; row.AddChidren(btnFunctionFloorAndRoom); - btnFunctionName.MouseUpEventHandler = (sender, e) => + EventHandler<MouseEventArgs> skipEvent= (sender, e) => { var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction); MainPage.BasePageView.AddChidren(ssf); ssf.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; - btnFunctionFloorAndRoom.MouseUpEventHandler = (sender, e) => - { - var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction); - MainPage.BasePageView.AddChidren(ssf); - ssf.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; + + btnFunctionName.MouseUpEventHandler = skipEvent; + btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent; Button btnDelSceneFunction = new Button() { @@ -831,7 +829,7 @@ var waitPage = new Loading(); MainPage.BaseView.AddChidren(waitPage); waitPage.Start(Language.StringByID(StringId.PleaseWait)); - new System.Threading.Thread(() => + new Thread(() => { try { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs index 406ef9f..59f0947 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs @@ -466,7 +466,7 @@ TextAlignment = TextAlignment.BottomRight, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = GetFunctionScnenInfo(scenefunction), + Text = scenefunction.GetFunctionScnenInfo(), }; row.AddChidren(btnFunctionInfo); @@ -513,20 +513,15 @@ }; row.AddChidren(btnFunctionFloorAndRoom); - btnFunctionName.MouseUpEventHandler = (sender, e) => + EventHandler<MouseEventArgs> skipEvent = (sender, e) => { var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction); MainPage.BasePageView.AddChidren(ssf); ssf.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; - btnFunctionFloorAndRoom.MouseUpEventHandler = (sender, e) => - { - var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction); - MainPage.BasePageView.AddChidren(ssf); - ssf.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; + btnFunctionName.MouseUpEventHandler = skipEvent; + btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent; Button btnDelSceneFunction = new Button() { @@ -540,55 +535,8 @@ scene.EditScene(); row.RemoveFromParent(); functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count); - //LoadFunctionRow(functionListView); }; } - } - - /// <summary> - /// 瑙f瀽鍦烘櫙鍔熻兘鏁版嵁 - /// </summary> - /// <param name="sceneFunction"></param> - string GetFunctionScnenInfo(SceneFunction sceneFunction) - { - var sceneFunctionInfo = ""; - foreach (var sfs in sceneFunction.status) - { - if (sfs.key == FunctionAttributeKey.OnOff) - { - if (sfs.value == "off") - return Language.StringByID(StringId.Close); - } - } - sceneFunctionInfo += Language.StringByID(StringId.Open) + " "; - - var modeState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode); - var tempState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp); - var fanState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); - if (modeState != null) - { - sceneFunctionInfo += modeState.GetValueText() + " "; - } - if (tempState != null) - { - sceneFunctionInfo += tempState.GetValueText() + " "; - sceneFunctionInfo += tempState.GetUintString(); - } - if (fanState != null) - { - sceneFunctionInfo += fanState.GetValueText() + " "; - } - var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); - if (briState != null) - { - sceneFunctionInfo += briState.value + "%"; - } - var perState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); - if (perState != null) - { - sceneFunctionInfo += perState.value + "%"; - } - return sceneFunctionInfo; } /// <summary> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs index 6a062db..ede07c9 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs @@ -128,7 +128,7 @@ }; bodyView.AddChidren(functionListView); - foreach (var function in FunctionList.List.GetDeviceFunctionList()) + foreach (var function in FunctionList.List.Functions) { if (function == null) { @@ -210,51 +210,8 @@ Height = Application.GetMinRealAverage(28), }; functionRow.AddChidren(btnFunctionIcon); - switch (function.Spk_Prefix) - { - case FunctionCategory.AC: - switch (function.spk) - { - case SPK.AcStandard: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png"; - break; - } - break; - case FunctionCategory.FloorHeat: - switch (function.spk) - { - case SPK.FloorHeatStandard: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png"; - break; - } - break; - case FunctionCategory.Curtain: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png"; - break; - case FunctionCategory.Light: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png"; - break; - case FunctionCategory.Electric: - switch (function.spk) - { - case SPK.ElectricSocket: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png"; - break; - case SPK.ElectricFan: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png"; - break; - case SPK.ElectricTV: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png"; - break; - } - break; - //case FunctionCategory.Scene: - // btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; - //break; - case FunctionCategory.Music: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png"; - break; - } + + btnFunctionIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; var btnFunctionName = new Button() { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 9da0de8..558b9df 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -182,6 +182,8 @@ BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(row); + + if (sceneStatus.key != FunctionAttributeKey.OnOff) { row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs index b9401d5..e659d9c 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs @@ -94,8 +94,6 @@ } //璁剧疆鐢ㄦ埛澶村儚璺緞 CheckIfDownloadHeadImage(mInfo); - - } catch (Exception ex) { diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs index fe73c68..0200f20 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs @@ -248,61 +248,9 @@ Height = Application.GetMinRealAverage(28), }; functionRow.AddChidren(btnFunctionIcon); - switch (function.Spk_Prefix) - { - case FunctionCategory.AC: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png"; - break; - case FunctionCategory.FloorHeat: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png"; - break; - case FunctionCategory.Curtain: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png"; - break; - case FunctionCategory.Light: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png"; - break; - case FunctionCategory.Electric: - switch (function.spk) - { - case SPK.ElectricSocket: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png"; - break; - case SPK.ElectricFan: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png"; - break; - case SPK.ElectricTV: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png"; - break; - } - break; - //case FunctionCategory.Scene: - // btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; - //break; - case FunctionCategory.Music: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png"; - break; - case FunctionCategory.Sensor: - switch(function.spk) - { - case SPK.SensorPm25: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconPm25.png"; - break; - case SPK.SensorCO2: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconCO2.png"; - break; - case SPK.SensorTVOC: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconTVOC.png"; - break; - case SPK.SensorHumidity: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconHumidity.png"; - break; - case SPK.SensorTemperature: - btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconTemp.png"; - break; - } - break; - } + + btnFunctionIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; + if (!btnAllocated.IsSelected) { diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs index 7cdf979..4416835 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs @@ -111,7 +111,7 @@ 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)); + arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); btnTemp = new Button() { @@ -122,7 +122,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 50, IsBold = true, - Text = device.GetAttrState(FunctionAttributeKey.SetTemp), + Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(), TextAlignment = TextAlignment.Center, }; FrameWhiteCentet1.AddChidren(btnTemp); @@ -311,16 +311,18 @@ 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; + //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; + arcBar.IsOffline = true; } else { + arcBar.IsOffline = false; arcBar.IsClickable = true; } }; @@ -437,7 +439,7 @@ 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; + //btnWindSpeed.UnSelectedImagePath = btnFanIcon.UnSelectedImagePath; dialog.Close(); }; btnFanIcon.MouseUpEventHandler = eventHandler1; @@ -675,7 +677,7 @@ { return; } - var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); + var temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); if (temp <= device.GetAttribute(FunctionAttributeKey.Mode).min) { return; @@ -694,7 +696,7 @@ { return; } - var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); + var temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max) { return; @@ -720,14 +722,14 @@ device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); btnTemp.Text = e.ToString(); }; - arcBar.MouseDownEventHandler = (sender, e) => { - Console.WriteLine("ddd"); - MainPage.BasePageView.ScrollEnabled =false; - }; - arcBar.MouseUpEventHandler = (sender, e) => { - Console.WriteLine("ddd2"); - MainPage.BasePageView.ScrollEnabled = true; - }; + //arcBar.MouseDownEventHandler = (sender, e) => { + // Console.WriteLine("ddd"); + // MainPage.BasePageView.ScrollEnabled =false; + //}; + //arcBar.MouseUpEventHandler = (sender, e) => { + // Console.WriteLine("ddd2"); + // MainPage.BasePageView.ScrollEnabled = true; + //}; } /// <summary> /// 鎺у埗妯″紡浜嬩欢 @@ -784,7 +786,7 @@ { Application.RunOnMainThread(() => { - btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp); + btnTemp.Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(); btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "掳C"; btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)); diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs index 89120fe..fcdb7b0 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs @@ -155,7 +155,7 @@ MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max, //IsClickable = function.trait_on_off.curValue.ToString() == "on", ArcColor = CSS_Color.BackgroundColor, - Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)), + Progress = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)), #if __IOS__ Y = Application.GetRealHeight(120 + 25), Width = Application.GetRealWidth(260 - 40), @@ -180,7 +180,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 50, IsBold = true, - Text = function.GetAttrState(FunctionAttributeKey.SetTemp), + Text = Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(), TextAlignment = TextAlignment.Center, }; controlView.AddChidren(btnTemp); diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs index 9ec2bdf..805a2ac 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs @@ -25,7 +25,7 @@ } AC temp = new AC(); updataTime = DateTime.Now; - bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp); + bodyView.btnTemp.Text = Convert.ToDouble( updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(); bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState((string)FunctionAttributeKey.RoomTemp))) + "掳C"; bodyView.btnMode.UnSelectedImagePath = temp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); bodyView.btnWindSpeed.UnSelectedImagePath = temp.GetFanIconPath(updateTemp.GetAttrState(FunctionAttributeKey.FanSpeed)); @@ -96,7 +96,7 @@ { return; } - var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)); + var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); if (temp <= function.GetAttribute(FunctionAttributeKey.Mode).min) { return; @@ -116,7 +116,7 @@ { return; } - var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)); + var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); if (temp >= function.GetAttribute(FunctionAttributeKey.SetTemp).max) { return; diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs index 7340af2..87be294 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs @@ -23,18 +23,42 @@ bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp))) + "掳C"; bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); 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; + // bodyView.arcBar.IsOffline = false; + //} + //else + //{ + // bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; + // bodyView.btnSwitch.IsSelected = false; + // bodyView.arcBar.IsOffline = true; + //} + if (updateTemp.trait_on_off.curValue.ToString() == "on") { - bodyView.arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png"; - bodyView.btnSwitch.IsSelected = true; bodyView.arcBar.IsOffline = false; + bodyView.btnSwitch.IsSelected = true; + bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; + if (updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + bodyView.arcBar.IsClickable = false; + } + else + { + bodyView.arcBar.IsClickable = true; + } } else { - bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; - bodyView.btnSwitch.IsBold = false; bodyView.arcBar.IsOffline = true; + bodyView.btnSwitch.IsSelected = false; + bodyView.arcBar.IsClickable = false; + bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; } + + }); } catch (Exception ex) @@ -100,8 +124,8 @@ { return; } - var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)); - if (temp > Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).max)) + var temp =(int) Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); + if (temp > Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max)) { return; } @@ -124,7 +148,7 @@ arcBar.OnProgressChangedEvent = (sender, e) => { function.SetAttrState(FunctionAttributeKey.SetTemp, e); - btnTemp.Text = function.GetAttrState(FunctionAttributeKey.SetTemp); + btnTemp.Text = Convert.ToDouble( function.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(); }; } /// <summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs index c9291ea..372e38b 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs @@ -68,6 +68,7 @@ { bodyView = this; function = func; + lightTemp = new Light(); } public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) @@ -162,6 +163,12 @@ { colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png"; } + colorPicker.MouseDownEventHandler = (sender, e) => { + MainPage.BasePageView.ScrollEnabled = false; + }; + colorPicker.MouseUpEventHandler = (sender, e) => { + MainPage.BasePageView.ScrollEnabled = true; + }; //鐧界偣鎺т欢 this.btnWhiteRound = new Button(); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs index 089c4e8..79a4845 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs @@ -17,7 +17,10 @@ { if (bodyView == null) return; - bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on"; + if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid) + { + bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on"; + } } catch (Exception ex) { @@ -78,9 +81,29 @@ System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); 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(); + + //new System.Threading.Thread(() => + //{ + // bool fff = false; + // while (true) + // { + // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + // if (fff) + // { + // d.Add("on_off", "off"); + // } + // else + // { + // d.Add("on_off", "on"); + // } + // fff = !fff; + // DriverLayer.Control.Ins.SendWriteCommand(function, d); + // //System.Threading.Thread.Sleep(100); + // } + //}) + //{ IsBackground = true }.Start(); }; } diff --git a/ThirdPartyIntegration/HdlBluWi/Blufi.xcodeproj/project.xcworkspace/xcuserdata/kaede.xcuserdatad/UserInterfaceState.xcuserstate b/ThirdPartyIntegration/HdlBluWi/Blufi.xcodeproj/project.xcworkspace/xcuserdata/kaede.xcuserdatad/UserInterfaceState.xcuserstate index d030dd3..c717400 100644 --- a/ThirdPartyIntegration/HdlBluWi/Blufi.xcodeproj/project.xcworkspace/xcuserdata/kaede.xcuserdatad/UserInterfaceState.xcuserstate +++ b/ThirdPartyIntegration/HdlBluWi/Blufi.xcodeproj/project.xcworkspace/xcuserdata/kaede.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ -- Gitblit v1.8.0