From 4dce704aaf8587cf3f91cf88f2208315a03c4cbb Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 08 四月 2020 13:54:58 +0800 Subject: [PATCH] 先上传一个版本 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs | 297 +++ ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectCurtainForm.cs | 2 ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs | 24 ZigbeeApp/GateWay.Droid/Assets/Language.ini | 44 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 24 ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs | 375 ++++ ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 106 + ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFreshAir.png | 0 ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 15 ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelFangyueFreshAir.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 12 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAir.png | 0 ZigbeeApp/Shared/Common/CommonPage.cs | 2 ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 9 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs | 2 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 34 ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs | 28 ZigbeeApp/GateWay.Droid/Resources/mipmap-xxhdpi/Icon.png | 0 ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll | 0 ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 70 ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs | 20 ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOn.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs | 74 ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs | 2 ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFreshAir.png | 0 ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 4 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs | 27 ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs | 2 ZigbeeApp/Shared/Common/SceneUI.cs | 2 ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2 ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAir.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs | 225 + ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs | 8 ZigbeeApp/Shared/Phone/Login/AccountLogin.cs | 14 ZigbeeApp/Shared/Phone/Category/AdjustTargetAddSceneForm.cs | 304 +++ ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png | 0 ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll | 0 ZigbeeApp/GateWay.Droid/Resources/mipmap-xxxhdpi/Icon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs | 61 ZigbeeApp/GateWay.Droid/Resources/mipmap-xhdpi/Icon.png | 0 ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAirSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs | 2 ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs | 5 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 31 ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs | 110 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs | 11 ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs | 59 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOffline.png | 0 ZigbeeApp/Home.Ios/Resources/Language.ini | 44 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs | 6 ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs | 6 ZigbeeApp/Home.Ios/Home.IOS.csproj | 5 ZigbeeApp/Shared/Phone/Device/CommonForm/SceneMainView.cs | 6 ZigbeeApp/Shared/R.cs | 84 ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs | 17 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs | 19 ZigbeeApp/GateWay.Droid/Resources/mipmap-hdpi/Icon.png | 0 ZigbeeApp/GateWay.Droid/Resources/drawable/Icon.png | 0 ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll | 0 ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs | 13 ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs | 597 ++++++ ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs | 2 ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/IntelligentLocksH06C.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs | 19 ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs | 94 ZigbeeApp/GateWay.Droid/Resources/mipmap-mdpi/Icon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 7 ZigbeeApp/Shared/Common/Device.cs | 37 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs | 22 ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOffline.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 196 ++ ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs | 152 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 9 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs | 5 ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/IntelligentLocksH06C.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs | 204 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs | 8 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOn.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 107 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs | 399 +++- ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs | 78 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAirSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs | 9 ZigbeeApp/Shared/Shared.projitems | 5 ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelFangyueFreshAir.png | 0 ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs | 908 +++++++++ ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs | 1 ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 55 ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectSwitchForm.cs | 2 ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs | 112 - ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs | 40 96 files changed, 4,436 insertions(+), 847 deletions(-) diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini index d6137cf..ab34f65 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini +++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini @@ -273,6 +273,41 @@ 266=褰撳墠璁惧涓嶅湪绾� 267=鑾峰彇闊抽噺澶辫触 268=纭畾鍙栨秷璇ユ垚鍛樼殑杩滅▼寮�閿佹潈闄� +269=甯稿紑妯″紡灏嗕簬{0}鍙栨秷 +269=闆舵椂鍖� +270=涓滀竴鍖� +271=涓滀簩鍖� +272=涓滀笁鍖� +273=涓滃洓鍖� +274=涓滀簲鍖� +275=涓滃叚鍖� +276=涓滀竷鍖� +277=涓滃叓鍖� +278=涓滀節鍖� +279=涓滃崄鍖� +280=涓滃崄涓�鍖� +281=涓滃崄浜屽尯 +282=瑗夸竴鍖� +283=瑗夸簩鍖� +284=瑗夸笁鍖� +285=瑗垮洓鍖� +286=瑗夸簲鍖� +287=瑗垮叚鍖� +288=瑗夸竷鍖� +289=瑗垮叓鍖� +290=瑗夸節鍖� +291=瑗垮崄鍖� +292=瑗垮崄涓�鍖� +293=瑗垮崄浜屽尯 +294= 鐢熸晥鏃ユ湡涓嶈兘灏忎簬褰撳墠鏃ユ湡 +295= 鐢熸晥鏃堕棿涓嶈兘澶т簬澶辨晥鏃堕棿 +296= 澶辨晥鏃堕棿涓嶈兘灏忎簬鐢熸晥鏃堕棿 +297= 澶辨晥鏃堕棿涓嶈兘鐪佺暐 +298= 澶辨晥鏃堕棿涓嶈兘澶т簬36灏忔椂 +299= 澶辨晥鏃堕棿涓嶈兘灏忎簬1灏忔椂 + + + 5097=鍙栨秷 5098=纭畾 @@ -529,6 +564,8 @@ 5379=鏆傛棤鑱斿姩浜嬩欢{\r\n} 璇风偣鍑诲彸涓婅娣诲姞 5380=甯稿紑妯″紡 5381=娣诲姞鏉′欢鎴栬�呮坊鍔犲姛鑳戒负绌� +5382=鏌ョ湅 + @@ -1745,6 +1782,13 @@ 16078=瀹ゅ唴鏈� 16079=鎸夐敭 16080=鍒嗕韩浣忓畢宸叉洿鏀癸紝璇疯仈绯荤鐞嗗憳锛� +16081=鑾峰彇鎵ц鐩爣澶辫触 +16082=娌℃湁鍙互娣诲姞鐨勫満鏅� +16083=璇锋坊鍔犳墽琛岀洰鏍� +16084=娣诲姞鎵ц鐩爣澶辫触 +16085=涓埆鎵ц鐩爣娣诲姞澶辫触 +16086=鍒濆鍖栨墽琛岀洰鏍囧け璐� +16087=淇敼鍦烘櫙鍚嶇О澶辫触 ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAir.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAir.png new file mode 100755 index 0000000..a7fd08e --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAir.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAirSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAirSelected.png new file mode 100755 index 0000000..a1fc975 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFreshAirSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png index c2c9532..4fe9f4d 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOffline.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOffline.png index 209bbc6..b0eb314 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOffline.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOffline.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOn.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOn.png index 8fb7203..d05eb64 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOn.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOn.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFreshAir.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFreshAir.png new file mode 100755 index 0000000..8323a7c --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFreshAir.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelFangyueFreshAir.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelFangyueFreshAir.png new file mode 100755 index 0000000..abc8931 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelFangyueFreshAir.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/IntelligentLocksH06C.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/IntelligentLocksH06C.png new file mode 100755 index 0000000..89c1228 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/IntelligentLocksH06C.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj index b2b460f..08606e7 100644 --- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj +++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj @@ -2030,6 +2030,21 @@ <ItemGroup> <AndroidAsset Include="Assets\Phone\RoomIcon\6.jpg" /> </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\RealDevice\IntelligentLocksH06C.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueFreshAir.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueFreshAirSelected.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Instruct\PanelFreshAir.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\RealDevice\ButtonPanelFangyueFreshAir.png" /> + </ItemGroup> <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> <Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" /> diff --git a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml index 551a67c..d97db01 100644 --- a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml +++ b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020032301" android:installLocation="auto" android:versionName="1.0.20032301"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020040801" android:installLocation="auto" android:versionName="1.0.20040801"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> <permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> diff --git a/ZigbeeApp/GateWay.Droid/Resources/drawable/Icon.png b/ZigbeeApp/GateWay.Droid/Resources/drawable/Icon.png index 9adb1f4..e5486ed 100755 --- a/ZigbeeApp/GateWay.Droid/Resources/drawable/Icon.png +++ b/ZigbeeApp/GateWay.Droid/Resources/drawable/Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Resources/mipmap-hdpi/Icon.png b/ZigbeeApp/GateWay.Droid/Resources/mipmap-hdpi/Icon.png index 1555c53..19c6ac4 100755 --- a/ZigbeeApp/GateWay.Droid/Resources/mipmap-hdpi/Icon.png +++ b/ZigbeeApp/GateWay.Droid/Resources/mipmap-hdpi/Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Resources/mipmap-mdpi/Icon.png b/ZigbeeApp/GateWay.Droid/Resources/mipmap-mdpi/Icon.png index 6d9078a..83858fd 100755 --- a/ZigbeeApp/GateWay.Droid/Resources/mipmap-mdpi/Icon.png +++ b/ZigbeeApp/GateWay.Droid/Resources/mipmap-mdpi/Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Resources/mipmap-xhdpi/Icon.png b/ZigbeeApp/GateWay.Droid/Resources/mipmap-xhdpi/Icon.png index 782a91f..191772c 100755 --- a/ZigbeeApp/GateWay.Droid/Resources/mipmap-xhdpi/Icon.png +++ b/ZigbeeApp/GateWay.Droid/Resources/mipmap-xhdpi/Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxhdpi/Icon.png b/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxhdpi/Icon.png index d091864..51d110f 100755 --- a/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxhdpi/Icon.png +++ b/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxhdpi/Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxxhdpi/Icon.png b/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxxhdpi/Icon.png index 881dcad..2c8d4de 100755 --- a/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxxhdpi/Icon.png +++ b/ZigbeeApp/GateWay.Droid/Resources/mipmap-xxxhdpi/Icon.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj index c220b43..38c90a9 100644 --- a/ZigbeeApp/Home.Ios/Home.IOS.csproj +++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj @@ -219,6 +219,7 @@ <BundleResource Include="Resources\Phone\Room\RoomShadow.png" /> <BundleResource Include="Resources\Phone\Room\AddBackground.png" /> <BundleResource Include="Resources\Phone\Instruct\CurtainSiphonate.png" /> + <BundleResource Include="Resources\Phone\Instruct\PanelFreshAir.png" /> <BundleResource Include="Resources\Phone\Instruct\SensorPir.png" /> <BundleResource Include="Resources\Phone\Instruct\RelayThreeLoad.png" /> <BundleResource Include="Resources\Phone\Instruct\CurtainAutoOpen.png" /> @@ -681,6 +682,7 @@ <BundleResource Include="Resources\Phone\Device\Relay.png" /> <BundleResource Include="Resources\Phone\Device\SensorWaterSelected.png" /> <BundleResource Include="Resources\Phone\Device\SensorInfrared.png" /> + <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueFreshAir.png" /> <BundleResource Include="Resources\Phone\Device\Curtain.png" /> <BundleResource Include="Resources\Phone\Device\SwitchSelected2.png" /> <BundleResource Include="Resources\Phone\Device\AirSwitchCloudContr.png" /> @@ -701,6 +703,7 @@ <BundleResource Include="Resources\Phone\Device\ButtonPanelCurtain.png" /> <BundleResource Include="Resources\Phone\Device\SensorCarbonMonoxideSelected2.png" /> <BundleResource Include="Resources\Phone\Device\ConverterZb485.png" /> + <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueFreshAirSelected.png" /> <BundleResource Include="Resources\Phone\Device\Repeater.png" /> <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueFour.png" /> <BundleResource Include="Resources\Phone\Device\SensorInfraredSelected2.png" /> @@ -956,6 +959,7 @@ <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFourNotPower.png" /> <BundleResource Include="Resources\Phone\RealDevice\CurtainAutoOpen.png" /> <BundleResource Include="Resources\Phone\RealDevice\SensorInfrared.png" /> + <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueFreshAir.png" /> <BundleResource Include="Resources\Phone\RealDevice\AirSwitchCloudContr.png" /> <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFour.png" /> <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelCurtain.png" /> @@ -965,6 +969,7 @@ <BundleResource Include="Resources\Phone\RealDevice\CommonDevice.png" /> <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueEnvironment.png" /> <BundleResource Include="Resources\Phone\RealDevice\AirConditionerZbGateway.png" /> + <BundleResource Include="Resources\Phone\RealDevice\IntelligentLocksH06C.png" /> <BundleResource Include="Resources\Phone\RealDevice\SensorDoorWindow.png" /> <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueEight.png" /> <BundleResource Include="Resources\Phone\RealDevice\SensorFire.png" /> diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini index d6137cf..ab34f65 100755 --- a/ZigbeeApp/Home.Ios/Resources/Language.ini +++ b/ZigbeeApp/Home.Ios/Resources/Language.ini @@ -273,6 +273,41 @@ 266=褰撳墠璁惧涓嶅湪绾� 267=鑾峰彇闊抽噺澶辫触 268=纭畾鍙栨秷璇ユ垚鍛樼殑杩滅▼寮�閿佹潈闄� +269=甯稿紑妯″紡灏嗕簬{0}鍙栨秷 +269=闆舵椂鍖� +270=涓滀竴鍖� +271=涓滀簩鍖� +272=涓滀笁鍖� +273=涓滃洓鍖� +274=涓滀簲鍖� +275=涓滃叚鍖� +276=涓滀竷鍖� +277=涓滃叓鍖� +278=涓滀節鍖� +279=涓滃崄鍖� +280=涓滃崄涓�鍖� +281=涓滃崄浜屽尯 +282=瑗夸竴鍖� +283=瑗夸簩鍖� +284=瑗夸笁鍖� +285=瑗垮洓鍖� +286=瑗夸簲鍖� +287=瑗垮叚鍖� +288=瑗夸竷鍖� +289=瑗垮叓鍖� +290=瑗夸節鍖� +291=瑗垮崄鍖� +292=瑗垮崄涓�鍖� +293=瑗垮崄浜屽尯 +294= 鐢熸晥鏃ユ湡涓嶈兘灏忎簬褰撳墠鏃ユ湡 +295= 鐢熸晥鏃堕棿涓嶈兘澶т簬澶辨晥鏃堕棿 +296= 澶辨晥鏃堕棿涓嶈兘灏忎簬鐢熸晥鏃堕棿 +297= 澶辨晥鏃堕棿涓嶈兘鐪佺暐 +298= 澶辨晥鏃堕棿涓嶈兘澶т簬36灏忔椂 +299= 澶辨晥鏃堕棿涓嶈兘灏忎簬1灏忔椂 + + + 5097=鍙栨秷 5098=纭畾 @@ -529,6 +564,8 @@ 5379=鏆傛棤鑱斿姩浜嬩欢{\r\n} 璇风偣鍑诲彸涓婅娣诲姞 5380=甯稿紑妯″紡 5381=娣诲姞鏉′欢鎴栬�呮坊鍔犲姛鑳戒负绌� +5382=鏌ョ湅 + @@ -1745,6 +1782,13 @@ 16078=瀹ゅ唴鏈� 16079=鎸夐敭 16080=鍒嗕韩浣忓畢宸叉洿鏀癸紝璇疯仈绯荤鐞嗗憳锛� +16081=鑾峰彇鎵ц鐩爣澶辫触 +16082=娌℃湁鍙互娣诲姞鐨勫満鏅� +16083=璇锋坊鍔犳墽琛岀洰鏍� +16084=娣诲姞鎵ц鐩爣澶辫触 +16085=涓埆鎵ц鐩爣娣诲姞澶辫触 +16086=鍒濆鍖栨墽琛岀洰鏍囧け璐� +16087=淇敼鍦烘櫙鍚嶇О澶辫触 ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAir.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAir.png new file mode 100755 index 0000000..a7fd08e --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAir.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAirSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAirSelected.png new file mode 100755 index 0000000..a1fc975 --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFreshAirSelected.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png index c2c9532..4fe9f4d 100755 --- a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png +++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOffline.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOffline.png index 209bbc6..b0eb314 100755 --- a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOffline.png +++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOffline.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOn.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOn.png index 8fb7203..d05eb64 100755 --- a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOn.png +++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOn.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFreshAir.png b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFreshAir.png new file mode 100755 index 0000000..8323a7c --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFreshAir.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelFangyueFreshAir.png b/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelFangyueFreshAir.png new file mode 100755 index 0000000..abc8931 --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelFangyueFreshAir.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/IntelligentLocksH06C.png b/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/IntelligentLocksH06C.png new file mode 100755 index 0000000..89c1228 --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/IntelligentLocksH06C.png Binary files differ diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs index db37ad4..ba3efd9 100755 --- a/ZigbeeApp/Shared/Common/CommonPage.cs +++ b/ZigbeeApp/Shared/Common/CommonPage.cs @@ -57,7 +57,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string CodeIDString = "1.0.20040201"; + public static string CodeIDString = "1.0.20040801"; /// <summary> /// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee) /// </summary> diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs index aeef774..85f3d03 100755 --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -689,6 +689,22 @@ /// <returns></returns> public bool DeviceIsCanFixedPosition(CommonDevice device) { + if (device.Type == DeviceType.DoorLock) + { + //闂ㄩ攣娌℃湁瀹氫綅鍔熻兘 + return false; + } + if (device.Type == DeviceType.IASZone) + { + var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); + if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_Pir) + { + //浼犳劅鍣ㄩ櫎浜哖ir閮芥病鏈夊畾浣嶅姛鑳� + return true; + } + return false; + } + foreach (var data in device.InClusterList) { //鎷ユ湁on/off鍔熻兘鐨勶紝鎵嶆敮鎸佹祴璇� @@ -2372,6 +2388,22 @@ mainDevice.IconPath = "Device/Light.png"; } } + //濡傛灉鏄笁璺户鐢靛櫒鐨勫洖璺殑璇�,榛樿涓虹伅鍏� + else if (mainDevice.Type == DeviceType.OnOffOutput) + { + var myType = this.GetHdlMyDeviceEnumInfo(mainDevice); + if (myType != null && myType.ConcreteType == DeviceConcreteType.Relay_ThreeLoad) + { + if (mainDevice.DfunctionType == DeviceFunctionType.A鏈畾涔�) + { + mainDevice.DfunctionType = DeviceFunctionType.A鐏厜; + } + if (mainDevice.IsCustomizeImage == false) + { + mainDevice.IconPath = "Device/Light.png"; + } + } + } //濡傛灉鏄┖姘斿紑鍏崇殑璇� else if (mainDevice.Type == DeviceType.AirSwitch) { @@ -2379,6 +2411,10 @@ if (mainDevice.DfunctionType == DeviceFunctionType.A鏈畾涔�) { mainDevice.DfunctionType = DeviceFunctionType.A寮�鍏�; + } + if (mainDevice.IsCustomizeImage == false) + { + mainDevice.IconPath = "Device/Switch.png"; } } //濡傛灉鏄僵鐏殑璇� @@ -2555,6 +2591,7 @@ this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//绠�绾�3鎸夐敭闈㈡澘 娌跨敤 3鎸夐敭鐨勫浘鏍� this.dicPictrueShard["ButtonPanel_SimpleTwo"] = "ButtonPanel_Two";//绠�绾�2鎸夐敭闈㈡澘 娌跨敤 2鎸夐敭鐨勫浘鏍� this.dicPictrueShard["IntelligentLocks_Sone"] = "IntelligentLocks_H06C";//S-one鐨勯棬閿佸浘鐗囨部鐢℉06C鐨勫浘鏍� + this.dicPictrueShard["Relay_FangyueFreshAirModul"] = "Relay_ThreeLoad";//鏂规偊鏂伴灏忔ā鍧楀浘鐗囨部鐢�3璺户鐢靛櫒鐨勫浘鏍� } diff --git a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs b/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs index 12d007b..666855b 100755 --- a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs +++ b/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs @@ -20,7 +20,7 @@ /// 浠诲姟鍒楄〃涓殑鏁版嵁鍒楄〃 /// Type=0 瀛樺湪 /// </summary> - public List<TaskListInfo> TaskList = new List<TaskListInfo>(); + public List<Safeguard.TaskListInfo> TaskList = new List<Safeguard.TaskListInfo>(); /// <summary> /// 閫夋嫨鐨勮澶� /// Type=0 瀛樺湪 diff --git a/ZigbeeApp/Shared/Common/SceneUI.cs b/ZigbeeApp/Shared/Common/SceneUI.cs index 6a671f9..9bd6282 100755 --- a/ZigbeeApp/Shared/Common/SceneUI.cs +++ b/ZigbeeApp/Shared/Common/SceneUI.cs @@ -67,7 +67,7 @@ /// <summary> /// 鍦烘櫙鎵ц鐩爣 /// </summary> - public List<ZigBee.Device.Scene.AddSceneMemberData> AddSceneMemberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData> { }; + public List<ZigBee.Device.Scene.DeviceListData> AdjustTargetList = new List<ZigBee.Device.Scene.DeviceListData>(); #endregion diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll index 2340d99..4844cd9 100755 --- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll +++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll Binary files differ diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll index 0af2312..6c93098 100755 --- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll +++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll Binary files differ diff --git a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll index 4c3e379..9a322f6 100755 --- a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll +++ b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll Binary files differ diff --git a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll index bef7c33..bdcee20 100755 --- a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll +++ b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll Binary files differ diff --git a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs index a21fac5..220a7d5 100755 --- a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using ZigBee.Device; namespace Shared.Phone.Category { @@ -13,6 +14,10 @@ { #region 鈻� 鍙橀噺澹版槑___________________________ + /// <summary> + /// 鍦烘櫙鍙樻洿浜嬩欢(鍦烘櫙,鎴块棿ID) + /// </summary> + public Action<SceneUI, string> SceneChangedEvent = null; /// <summary> /// 淇敼鐨勫満鏅� /// </summary> @@ -26,9 +31,33 @@ /// </summary> private string nowRoomId = string.Empty; /// <summary> + /// 褰撳墠鐣岄潰涓婃樉绀虹殑鎵ц鐩爣 + /// </summary> + private List<Scene.DeviceListData> listAdjustTarget = null; + /// <summary> /// 鏁翠釜鐣岄潰鐨勪笂涓嬫粦鍔ㄦ帶浠� /// </summary> private VerticalFrameControl listBodyControl = null; + /// <summary> + /// 娣诲姞鐩爣鐨勭殑瀹瑰櫒鎺т欢 + /// </summary> + private FrameListControl frameTargetTableControl = null; + /// <summary> + /// 杩欎釜鏄姞鍒般�愭暣涓晫闈㈢殑涓婁笅婊戝姩鎺т欢銆戜腑,淇冧娇鐣岄潰鑳藉婊戝姩鍒氬ソ瓒呰繃銆愬畬鎴愭寜閽�� + /// </summary> + private FrameLayout frameBottomTemp = null; + /// <summary> + /// 鍦烘櫙鍥剧墖鏄剧ず鎺т欢(鐢熸垚鍥剧墖鏂囦欢浣跨敤) + /// </summary> + private ImageView btnScenePic = null; + /// <summary> + /// 鍦烘櫙鍥剧墖鏄惁鍙樻洿(閽堝缂栬緫妯″紡) + /// </summary> + private bool isScenePictrueChanged = false; + /// <summary> + /// 鎵ц鐩爣鏄惁鏀瑰彉(閽堝缂栬緫妯″紡) + /// </summary> + private bool isAdjustTargetChanged = false; #endregion @@ -47,6 +76,7 @@ this.cloneScene = new SceneUI(); if (i_editorScene != null) { + cloneScene.Id = i_editorScene.Id; cloneScene.Name = i_editorScene.Name; cloneScene.IconPath = i_editorScene.IconPath; cloneScene.IconPathType = i_editorScene.IconPathType; @@ -61,6 +91,8 @@ } else { + cloneScene.IconPath = "SceneIcon/0.png"; + listAdjustTarget = new List<Scene.DeviceListData>(); //璁剧疆澶撮儴淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddScence)); } @@ -74,10 +106,44 @@ /// </summary> private void InitMiddleFrame() { + //鏁翠釜鐣岄潰鐨勪笂涓嬫粦鍔ㄦ帶浠� this.listBodyControl = new VerticalFrameControl(); listBodyControl.Height = bodyFrameLayout.Height; bodyFrameLayout.AddChidren(listBodyControl); + //鍒濆鍖栧満鏅浘鐗� + this.InitScenePictureControl(); + + //鍒濆鍖栦俊鎭紪杈戞帶浠� + this.InitInfoEditorControl(); + + //鍒濆鍖栨坊鍔犵洰鏍� + this.InitAddTargetControl(); + + //鍒嗕韩鐨勫満鏅笉鑳戒繚瀛� + if (this.editorScene == null || this.editorScene.IsSharedScene == false) + { + //瀹屾垚 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uFinish; + bodyFrameLayout.AddChidren(btnSave); + btnSave.ButtonClickEvent += (sender, e) => + { + //淇濆瓨鍦烘櫙鏁版嵁 + this.SaveSceneData(); + }; + } + } + + #endregion + + #region 鈻� 鍒濆鍖栧満鏅浘鐗嘷____________________ + + /// <summary> + /// 鍒濆鍖栧満鏅浘鐗� + /// </summary> + private void InitScenePictureControl() + { //鍦烘櫙鍥剧墖杩欓儴鍒嗙殑鐧借壊鑳屾櫙 var framePicBack = new FrameLayout(); framePicBack.Height = Application.GetRealHeight(559); @@ -91,41 +157,43 @@ btnShadow.UnSelectedImagePath = "Room/Room_Rectangle.png"; framePicBack.AddChidren(btnShadow); //鍦烘櫙鍥剧墖 - var btnPic = new ImageView(); - btnPic.Y = Application.GetRealHeight(46); - btnPic.Width = Application.GetMinRealAverage(887); - btnPic.Height = Application.GetMinRealAverage(444); - btnPic.Radius = (uint)Application.GetRealHeight(17); - btnPic.Gravity = Gravity.CenterHorizontal; + this.btnScenePic = new ImageView(); + btnScenePic.Y = Application.GetRealHeight(46); + btnScenePic.Width = Application.GetMinRealAverage(887); + btnScenePic.Height = Application.GetMinRealAverage(444); + btnScenePic.Radius = (uint)Application.GetRealHeight(17); + btnScenePic.Gravity = Gravity.CenterHorizontal; if (this.editorScene == null) { - btnPic.ImagePath = "SceneIcon/0.png"; + btnScenePic.ImagePath = "SceneIcon/0.png"; } else if (this.editorScene.IconPathType == 0) { - btnPic.ImagePath = this.editorScene.IconPath; + btnScenePic.ImagePath = this.editorScene.IconPath; } else { - btnPic.ImageBytes = Global.ReadFileByHomeId(this.editorScene.IconPath); + btnScenePic.ImageBytes = Global.ReadFileByHomeId(this.editorScene.IconPath); } - framePicBack.AddChidren(btnPic); + framePicBack.AddChidren(btnScenePic); //鍥剧墖閬僵 var btnZhezhao = new FrameLayout(); - btnZhezhao.Width = btnPic.Width; - btnZhezhao.Height = btnPic.Height; - btnZhezhao.Y = btnPic.Y; + btnZhezhao.Width = btnScenePic.Width; + btnZhezhao.Height = btnScenePic.Height; + btnZhezhao.Y = btnScenePic.Y; btnZhezhao.Gravity = Gravity.CenterHorizontal; - btnZhezhao.Radius = btnPic.Radius; + btnZhezhao.Radius = btnScenePic.Radius; framePicBack.AddChidren(btnZhezhao); - btnZhezhao.MouseUpEventHandler += (sender, e) => - { - //鎴块棿鍥剧墖閫夋嫨 - this.ScenePictrueSelect(btnPic); - }; - //鍒濆鍖栦俊鎭紪杈戞帶浠� - this.InitInfoEditorControl(); + //鍒嗕韩鐨勫満鏅笉鑳界紪杈� + if (this.editorScene == null || this.editorScene.IsSharedScene == false) + { + btnZhezhao.MouseUpEventHandler += (sender, e) => + { + //鎴块棿鍥剧墖閫夋嫨 + this.ScenePictrueSelect(btnScenePic); + }; + } } #endregion @@ -158,12 +226,705 @@ rowScene.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputSceneName); rowScene.Y = btnTitle.Bottom + Application.GetRealHeight(23); frameBack.AddChidren(rowScene); + rowScene.InitControl(); //搴曠嚎 rowScene.AddBottomLine(); + rowScene.txtInput.TextChangeEventHandler += (sender, value) => + { + this.cloneScene.Name = value; + }; //鎵�灞炲尯鍩� var rowBelong = new BelongAreaControl(); - //rowBelong.Y= rowScene.Bottom+ + rowBelong.Y = rowScene.Bottom + Application.GetRealHeight(14); + frameBack.AddChidren(rowBelong); + rowBelong.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), this.nowRoomId); + //鍒嗕韩鐨勫満鏅笉鑳界紪杈� + if (this.editorScene == null || this.editorScene.IsSharedScene == false) + { + rowBelong.SelectRoomEvent += (selectId) => + { + this.nowRoomId = selectId; + }; + } + } + + #endregion + + #region 鈻� 鍒濆鍖栨坊鍔犵洰鏍嘷____________________ + + /// <summary> + /// 鍒濆鍖栨坊鍔犵洰鏍� + /// </summary> + private void InitAddTargetControl() + { + if (this.frameTargetTableControl == null) + { + //娣诲姞鐩爣鐨勭殑瀹瑰櫒鎺т欢 + this.frameTargetTableControl = new FrameListControl(); + frameTargetTableControl.Y = Application.GetRealHeight(1034); + frameTargetTableControl.BackgroundColor = UserCenterColor.Current.White; + frameTargetTableControl.Height = Application.GetRealHeight(346); + this.listBodyControl.frameTable.AddChidren(frameTargetTableControl); + } + else + { + this.frameTargetTableControl?.RemoveAll(); + frameTargetTableControl.Height = Application.GetRealHeight(346); + } + + //娣诲姞鐩爣 + var rowAddTarget = new FrameRowControl(frameTargetTableControl.rowSpace / 2); + rowAddTarget.UseClickStatu = false; + rowAddTarget.Y = Application.GetRealHeight(46 - 12); + frameTargetTableControl.AddChidren(rowAddTarget); + rowAddTarget.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.AddScentTargetAction), 600); + //+鍙� + var btnAddIcon = rowAddTarget.AddMostRightEmptyIcon(61, 58); + btnAddIcon.UnSelectedImagePath = "Item/Add.png"; + //搴曠嚎 + rowAddTarget.AddBottomLine(); + rowAddTarget.ButtonClickEvent += (sender, e) => + { + //鏄剧ず娣诲姞鐩爣鑿滃崟 + this.ShowAddTargetMenu(); + }; + + HdlThreadLogic.Current.RunThread(async () => + { + //浠庣綉鍏宠幏鍙栧満鏅殑鎵ц鐩爣 + var result = await this.GetSceneTargetList(); + //娣诲姞銆愭墽琛岀洰鏍囪銆� + this.AddTargetRow(); + }); + } + + #endregion + + #region 鈻� 鑾峰彇鍙婃坊鍔犮�愮洰鏍囪銆慱______________ + + /// <summary> + /// 娣诲姞銆愭墽琛岀洰鏍囪銆� + /// </summary> + private void AddTargetRow() + { + //妫�娴嬬綉鍏充笂鐨勬暟鎹槸鍚﹀拰鏈湴涓�鑷� + for (int i = 0; i < this.listAdjustTarget.Count; i++) + { + if (listAdjustTarget[i].Type == 0) + { + //璁惧 + var device = Common.LocalDevice.Current.GetDevice(listAdjustTarget[i].DeviceAddr, listAdjustTarget[i].Epoint); + if (device == null) + { + //涓嶆樉绀鸿繖涓笉瀛樺湪鏈湴鐨勮澶� + listAdjustTarget.RemoveAt(i); + i--; + } + continue; + } + else if (listAdjustTarget[i].Type == 1) + { + //鍦烘櫙 + var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(listAdjustTarget[i].ElseScenesId); + if (scene == null) + { + //涓嶆樉绀鸿繖涓笉瀛樺湪鏈湴鐨勮澶� + listAdjustTarget.RemoveAt(i); + i--; + } + continue; + } + } + + HdlThreadLogic.Current.RunMain(() => + { + for (int i = 0; i < listAdjustTarget.Count; i++) + { + if (listAdjustTarget[i].Type == 0) + { + //璁惧 + this.AddDeviceTargetRow(listAdjustTarget[i], i, i != listAdjustTarget.Count - 1); + } + else if (listAdjustTarget[i].Type == 1) + { + //鍦烘櫙 + this.AddSceneTargetRow(listAdjustTarget[i], i, i != listAdjustTarget.Count - 1); + } + else if (listAdjustTarget[i].Type == 2) + { + //寤舵椂 + this.AddDelayTimeTargetRow(listAdjustTarget[i], i, i != listAdjustTarget.Count - 1); + } + } + //鍒濆鍖栦績浣跨晫闈㈣兘澶熷垰濂芥粦鍔ㄨ秴杩囦繚瀛樻寜閽殑鎺т欢 + this.InitFrameBottomTempControl(); + + //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴� + this.AdjustTargetTableHeight(); + }); + } + + #endregion + + #region 鈻� 娣诲姞璁惧鎵ц鐩爣琛宊________________ + + /// <summary> + /// 娣诲姞璁惧鎵ц鐩爣琛� + /// </summary> + private void AddDeviceTargetRow(Scene.DeviceListData data, int index, bool addLine) + { + //璁惧 + var device = Common.LocalDevice.Current.GetDevice(data.DeviceAddr, data.Epoint); + var rowDevice = new DeviceRoomControl(device, frameTargetTableControl.rowSpace / 2); + rowDevice.MainKeys = index.ToString(); + this.frameTargetTableControl.AddChidren(rowDevice); + //鎺т欢鍚戝彸鍋忕Щ + rowDevice.frameTable.LeftOffset = Application.GetRealWidth(104) - ControlCommonResourse.XXLeft; + rowDevice.InitControl(); + rowDevice.frameTable.UseClickStatu = false; + + //鐘舵�佹枃鏈� + string statuText2 = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(data.TaskList); + var btnStatu = rowDevice.frameTable.AddMostRightView(statuText2, 400); + if (addLine == true) + { + //搴曠嚎 + rowDevice.frameTable.AddBottomLine(); + } + //鍒嗕韩鐨勫満鏅笉鑳界紪杈� + if (this.editorScene == null || this.editorScene.IsSharedScene == false) + { + //缂栬緫 + var btnEditor = rowDevice.AddEditorControl(); + btnEditor.ButtonClickEvent += (sender, e) => + { + //闅愯棌鍙虫粦鑿滃崟 + rowDevice.HideMenu(); + if (device.Type == DeviceType.DimmableLight//璋冨厜鍣� + || device.Type == DeviceType.ColorDimmableLight)//褰╃伅 + { + var form = new UserCenter.Safety.AlarmTargetStatuSelectLightForm(); + form.AddForm(device, data.TaskList); + form.FinishSelectEvent += (statuText, listInfo) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + data.TaskList.Clear(); + data.TaskList.AddRange(listInfo); + }; + } + else if (device.Type == DeviceType.Thermostat)//绌鸿皟 + { + var form = new UserCenter.Safety.AlarmTargetStatuSelectAcForm(); + form.AddForm(device, data.TaskList); + form.FinishSelectEvent += (statuText, listInfo) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + data.TaskList.Clear(); + data.TaskList.AddRange(listInfo); + }; + } + else if (device.Type == DeviceType.WindowCoveringDevice)//绐楀笜 + { + var form = new UserCenter.Safety.AlarmTargetStatuSelectCurtainForm(); + form.AddForm(device, data.TaskList); + form.FinishSelectEvent += (statuText, listInfo) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + data.TaskList.Clear(); + data.TaskList.AddRange(listInfo); + }; + } + else + { + //鍏朵粬鐩存帴褰掍负寮�鍏崇被 + var form = new UserCenter.Safety.AlarmTargetStatuSelectSwitchForm(); + form.AddForm(device, data.TaskList); + form.FinishSelectEvent += (statuText, listInfo) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + data.TaskList.Clear(); + data.TaskList.AddRange(listInfo); + }; + } + }; + + //鍒犻櫎 + var btnDelete = rowDevice.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => + { + //闅愯棌鍙虫粦鑿滃崟 + rowDevice.HideMenu(); + //纭鏄惁瑕佸垹闄わ紵 + string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + //璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�) + this.AdjustTargetLocation(rowDevice.MainKeys); + //绉婚櫎 + rowDevice.RemoveFromParent(); + this.listAdjustTarget.Remove(data); + //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴� + this.AdjustTargetTableHeight(); + }); + }; + } + } + + #endregion + + #region 鈻� 娣诲姞鍦烘櫙鎵ц鐩爣琛宊________________ + + /// <summary> + /// 娣诲姞鍦烘櫙鎵ц鐩爣琛� + /// </summary> + private void AddSceneTargetRow(Scene.DeviceListData data, int index, bool addLine) + { + //鍦烘櫙 + var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(data.ElseScenesId); + var rowScene = new SceneRoomControl(scene.Id, scene.Name, frameTargetTableControl.rowSpace / 2); + rowScene.MainKeys = index.ToString(); + frameTargetTableControl.AddChidren(rowScene); + //鎺т欢鍚戝彸鍋忕Щ + rowScene.frameTable.LeftOffset = Application.GetRealWidth(104) - ControlCommonResourse.XXLeft; + rowScene.InitControl(); + if (addLine == true) + { + //搴曠嚎 + rowScene.frameTable.AddBottomLine(); + } + rowScene.frameTable.UseClickStatu = false; + + //鍒嗕韩鐨勫満鏅笉鑳界紪杈� + if (this.editorScene == null || this.editorScene.IsSharedScene == false) + { + //鍒犻櫎 + var btnDelete = rowScene.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => + { + //闅愯棌鍙虫粦鑿滃崟 + rowScene.HideMenu(); + + //纭鏄惁瑕佸垹闄わ紵 + string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + //璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�) + this.AdjustTargetLocation(rowScene.MainKeys); + //绉婚櫎 + rowScene.RemoveFromParent(); + this.listAdjustTarget.Remove(data); + //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴� + this.AdjustTargetTableHeight(); + }); + }; + } + } + + #endregion + + #region 鈻� 娣诲姞寤舵椂琛宊________________________ + + /// <summary> + /// 娣诲姞寤舵椂琛� + /// </summary> + private void AddDelayTimeTargetRow(Scene.DeviceListData data, int index, bool addLine) + { + string hourText = Language.StringByID(R.MyInternationalizationString.Hour); + string minuText = Language.StringByID(R.MyInternationalizationString.Minute); + string secondText = Language.StringByID(R.MyInternationalizationString.Second); + + //琛屾帶浠� + var rowDelay = new RowLayoutControl(frameTargetTableControl.rowSpace / 2); + rowDelay.MainKeys = index.ToString(); + frameTargetTableControl.AddChidren(rowDelay); + //鎺т欢鍚戝彸鍋忕Щ + rowDelay.frameTable.LeftOffset = Application.GetRealWidth(104) - ControlCommonResourse.XXLeft; + rowDelay.frameTable.UseClickStatu = false; + //鍥炬爣 + var btnIcon = rowDelay.frameTable.AddLeftIcon(); + btnIcon.UnSelectedImagePath = "Item/Timer.png"; + //寤舵椂 + var btnDelay = rowDelay.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.Delay), 400); + btnDelay.TextColor = UserCenterColor.Current.TextGrayColor3; + + //x灏忔椂x鍒嗛挓x绉掑悗 + string timeStr = this.GetTimeString(data.DelayTime, hourText, minuText, secondText); + timeStr += Language.StringByID(R.MyInternationalizationString.Later); + var btnStatu = rowDelay.frameTable.AddMostRightView(timeStr, 300); + + if (addLine == true) + { + //搴曠嚎 + rowDelay.frameTable.AddBottomLine(); + } + + //鍒嗕韩鐨勫満鏅笉鑳界紪杈� + if (this.editorScene == null || this.editorScene.IsSharedScene == false) + { + //缂栬緫 + var btnEditor = rowDelay.AddEditorControl(); + btnEditor.ButtonClickEvent += (sender, e) => + { + //闅愯棌鍙虫粦鑿滃崟 + rowDelay.HideMenu(); + //寤舵椂鏃堕棿閫夋嫨 + var form = new AdjustTargetAddDelayTimeForm(); + form.AddForm(data.DelayTime); + form.FinishSelectEvent += (delayTime) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + data.DelayTime = delayTime; + //x灏忔椂x鍒嗛挓x绉掑悗 + timeStr = this.GetTimeString(data.DelayTime, hourText, minuText, secondText); + btnStatu.Text = timeStr; + }; + }; + //鍒犻櫎 + var btnDelete = rowDelay.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => + { + //闅愯棌鍙虫粦鑿滃崟 + rowDelay.HideMenu(); + //纭鏄惁瑕佸垹闄わ紵 + string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + //璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�) + this.AdjustTargetLocation(rowDelay.MainKeys); + //绉婚櫎 + rowDelay.RemoveFromParent(); + this.listAdjustTarget.Remove(data); + //璋冩暣鎵ц鐩爣鐨勬甯冮珮搴� + this.AdjustTargetTableHeight(); + }); + }; + } + } + + /// <summary> + /// 浠庣綉鍏宠幏鍙栧満鏅殑鎵ц鐩爣 + /// </summary> + /// <returns></returns> + private async System.Threading.Tasks.Task<bool> GetSceneTargetList() + { + if (this.editorScene == null || this.listAdjustTarget != null) + { + return true; + } + //鎵撳紑杩涘害鏉� + this.ShowProgressBar(); + //鑾峰彇鎵ц鐩爣鍒楄〃 + var listData = await HdlSceneLogic.Current.GetAdjustTargetList(this.editorScene); + if (listData == null) + { + this.CloseProgressBar(ShowReLoadMode.YES); + return false; + } + this.listAdjustTarget = new List<Scene.DeviceListData>(); + listAdjustTarget.AddRange(listData); + + this.CloseProgressBar(); + return true; + } + + + #endregion + + #region 鈻� 鍒濆鍖栦績浣跨晫闈㈡粦鍔ㄦ帶浠禵____________ + + /// <summary> + /// 鍒濆鍖栦績浣跨晫闈㈣兘澶熷垰濂芥粦鍔ㄨ秴杩囦繚瀛樻寜閽殑鎺т欢 + /// </summary> + private void InitFrameBottomTempControl() + { + if (this.frameBottomTemp != null) + { + return; + } + //鍊熺敤涓�涓嬫帶浠剁殑Y杞� + var btnTemp = new BottomClickButton(); + + //閭d釜鐗规畩鐨勬帶浠� + this.frameBottomTemp = new FrameLayout(); + frameBottomTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(23); + this.listBodyControl.AddChidrenFrame(frameBottomTemp); + } + + #endregion + + #region 鈻� 鏄剧ず娣诲姞鐩爣鑿滃崟___________________ + + /// <summary> + /// 鏄剧ず娣诲姞鐩爣鑿滃崟 + /// </summary> + private void ShowAddTargetMenu() + { + var menuContr = new BottomMenuSelectForm(); + menuContr.AddForm(3); + //鍔熻兘 + menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uFunction), () => + { + var form = new AdjustTargetAddDeviceForm(); + form.AddForm(listAdjustTarget); + form.FinishSelectEvent += (dicData) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + foreach (var mainKey in dicData.Keys) + { + var device = LocalDevice.Current.GetDevice(mainKey); + var data = new Scene.DeviceListData(); + data.Type = 0; + data.DeviceAddr = device.DeviceAddr; + data.Epoint = device.DeviceEpoint; + data.TaskList = dicData[mainKey]; + this.listAdjustTarget.Add(data); + } + //鍒锋柊鍒楄〃鎺т欢 + this.InitAddTargetControl(); + }; + }); + //鍦烘櫙 + menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uScence), () => + { + var form = new AdjustTargetAddSceneForm(); + form.AddForm(listAdjustTarget); + form.FinishSelectEvent += (listSceneId) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + foreach (int sceneId in listSceneId) + { + var data = new Scene.DeviceListData(); + data.Type = 1; + data.ElseScenesId = sceneId; + this.listAdjustTarget.Add(data); + } + //鍒锋柊鍒楄〃鎺т欢 + this.InitAddTargetControl(); + }; + }); + //寤舵椂 + menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.Delay), () => + { + //寤舵椂鏃堕棿閫夋嫨 + var form = new AdjustTargetAddDelayTimeForm(); + form.AddForm(0); + form.FinishSelectEvent += (delayTime) => + { + //鎵ц鐩爣宸茬粡鏀瑰彉 + this.isAdjustTargetChanged = true; + var data = new Scene.DeviceListData(); + data.Type = 2; + data.DelayTime = delayTime; + this.listAdjustTarget.Add(data); + //鍒锋柊鍒楄〃鎺т欢 + this.InitAddTargetControl(); + }; + }); + } + + #endregion + + #region 鈻� 淇濆瓨鍦烘櫙鏁版嵁_______________________ + + /// <summary> + /// 淇濆瓨鍦烘櫙鏁版嵁 + /// </summary> + private void SaveSceneData() + { + //妫�娴嬭兘鍚︿繚瀛樺満鏅� + if (this.CheckCanSaveScene() == false) + { + return; + } + HdlThreadLogic.Current.RunThread(() => + { + //鎵撳紑杩涘害鏉� + this.ShowProgressBar(); + //鏂板缓鍦烘櫙 + if (this.editorScene == null) + { + //淇濆瓨鏂板缓鐨勫満鏅� + this.SaveSceneDataByNewMode(); + } + //缂栬緫鍦烘櫙 + else + { + //淇濆瓨缂栬緫鐨勫満鏅� + this.SaveSceneDataByEditorMode(); + } + }); + } + + /// <summary> + /// 淇濆瓨鏂板缓鐨勫満鏅� + /// </summary> + private async void SaveSceneDataByNewMode() + { + //娣诲姞鍦烘櫙 + this.editorScene = await HdlSceneLogic.Current.AddNewSceneToGateway(this.cloneScene.Name, this.listAdjustTarget); + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + + if (editorScene == null) + { + return; + } + if (this.nowRoomId != string.Empty) + { + //娣诲姞鎴块棿 + var newRoom = HdlRoomLogic.Current.GetRoomById(this.nowRoomId); + HdlSceneLogic.Current.AddSceneToRoom(newRoom, this.editorScene); + } + if (this.cloneScene.IconPathType != 0) + { + //鑷畾涔夊浘鐗� + var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss"); + var fileName = $"SceneIcon_{tradeTime}.png"; + //鐢熸垚鏂囦欢鍥剧墖 + IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), this.btnScenePic.ImageBytes); + HdlAutoBackupLogic.AddOrEditorFile(fileName); + this.cloneScene.IconPath = fileName; + } + //杞Щ灞炴�� + this.editorScene.Name = this.cloneScene.Name; + this.editorScene.IconPathType = this.cloneScene.IconPathType; + this.editorScene.IconPath = this.cloneScene.IconPath; + this.editorScene.Save(); + + HdlThreadLogic.Current.RunMain(() => + { + //璋冪敤鍥炶皟鍑芥暟 + this.SceneChangedEvent?.Invoke(this.editorScene, this.nowRoomId); + this.CloseForm(); + }); + } + + /// <summary> + /// 淇濆瓨缂栬緫鐨勫満鏅� + /// </summary> + private async void SaveSceneDataByEditorMode() + { + if (this.editorScene.Name != this.cloneScene.Name) + { + //淇敼鍚嶇О + var result = await HdlSceneLogic.Current.EditorSceneNameFromGateway(this.editorScene, this.cloneScene.Name); + if (result == false) + { + return; + } + } + if (isAdjustTargetChanged == true) + { + //淇敼鍦烘櫙 + var result = await HdlSceneLogic.Current.EditorSceneFromGateway(this.editorScene, this.listAdjustTarget); + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + if (result == false) + { + return; + } + } + + if (this.nowRoomId != string.Empty) + { + //鍙樻洿鎴块棿 + HdlSceneLogic.Current.ChangedSceneRoom(this.editorScene, this.nowRoomId); + } + + //鍥剧墖鏀瑰彉浜� + if (isScenePictrueChanged == true) + { + if (this.editorScene.IconPathType != 0) + { + //鍒犻櫎鑷畾涔夊浘鐗� + Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, this.editorScene.IconPath)); + HdlAutoBackupLogic.DeleteFile(this.editorScene.IconPath); + } + if (this.cloneScene.IconPathType != 0) + { + //鑷畾涔夊浘鐗� + var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss"); + var fileName = $"SceneIcon_{tradeTime}.png"; + //鐢熸垚鏂囦欢鍥剧墖 + IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), this.btnScenePic.ImageBytes); + HdlAutoBackupLogic.AddOrEditorFile(fileName); + this.cloneScene.IconPath = fileName; + } + } + + //杞Щ灞炴�� + this.editorScene.Name = this.cloneScene.Name; + this.editorScene.IconPathType = this.cloneScene.IconPathType; + this.editorScene.IconPath = this.cloneScene.IconPath; + this.editorScene.Save(); + + HdlThreadLogic.Current.RunMain(() => + { + //璋冪敤鍥炶皟鍑芥暟 + this.SceneChangedEvent?.Invoke(this.editorScene, this.nowRoomId); + this.CloseForm(); + }); + } + + /// <summary> + /// 妫�娴嬭兘鍚︿繚瀛樺満鏅� + /// </summary> + /// <returns></returns> + private bool CheckCanSaveScene() + { + if (this.cloneScene.Name == string.Empty) + { + //鍦烘櫙鍚嶄笉鑳戒负绌� + this.ShowMassage(ShowMsgType.Remind, Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull)); + return false; + } + bool hadTarget = false; + foreach (var data in this.listAdjustTarget) + { + if (data.Type == 0 || data.Type == 1) + { + //鎷ユ湁鎵ц鐩爣 + hadTarget = true; + break; + } + } + if (hadTarget == false) + { + //璇锋坊鍔犳墽琛岀洰鏍� + this.ShowMassage(ShowMsgType.Remind, Language.StringByID(R.MyInternationalizationString.uPleaseAddAdjustTarget)); + return false; + } + return true; } #endregion @@ -195,6 +956,8 @@ this.cloneScene.IconPath = imgPath; imgPath = IO.FileUtils.GetImageFilePath(imgPath); imageContr.ImageBytes = IO.FileUtils.ReadFile(imgPath); + //鍦烘櫙鍥剧墖宸茬粡鏀瑰彉 + this.isScenePictrueChanged = true; }; }); //鎷嶇収 @@ -210,6 +973,9 @@ this.cloneScene.IconPathType = 1; imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath); System.IO.File.Delete(imagePath); + //鍦烘櫙鍥剧墖宸茬粡鏀瑰彉 + this.isScenePictrueChanged = true; + }, "HdlPic", 2, 1); }); //鎴戠殑鐩稿唽 @@ -225,6 +991,8 @@ this.cloneScene.IconPathType = 2; imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath); System.IO.File.Delete(imagePath); + //鍦烘櫙鍥剧墖宸茬粡鏀瑰彉 + this.isScenePictrueChanged = true; }, "HdlPic", 2, 1); }); @@ -232,8 +1000,104 @@ #endregion + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + this.SceneChangedEvent = null; + + base.CloseFormBefore(); + } + + #endregion + #region 鈻� 涓�鑸柟娉昣__________________________ + /// <summary> + /// 鑾峰彇鏃堕棿鐨勭炕璇戞枃鏈� + /// </summary> + /// <param name="second"></param> + /// <param name="hourText">灏忔椂鐨勬枃鏈�</param> + /// <param name="minuText">鍒嗙殑鏂囨湰</param> + /// <param name="secondText">绉掔殑鏂囨湰</param> + /// <returns></returns> + private string GetTimeString(int second, string hourText, string minuText, string secondText) + { + string timeStr = string.Empty; + int hour = second / 3600; + int minu = second % 3600 / 60; + int sec = second % 60; + if (hour > 0) + { + timeStr += hour + hourText; + } + if (minu > 0) + { + timeStr += minu + minuText; + } + if (sec > 0) + { + timeStr += sec + secondText; + } + return timeStr; + } + + /// <summary> + /// 璋冩暣鎵ц鐩爣鐨勬甯冮珮搴� + /// </summary> + private void AdjustTargetTableHeight() + { + //璋冩暣妗屽竷楂樺害 + int minHeight = Application.GetRealHeight(346); + int realHeight = frameTargetTableControl.GetChildren(frameTargetTableControl.ChildrenCount - 1).Bottom; + realHeight += Application.GetRealHeight(23); + if (realHeight > minHeight) + { + frameTargetTableControl.Height = realHeight; + } + else if (frameTargetTableControl.Height != minHeight) + { + frameTargetTableControl.Height = minHeight; + } + //杩欎釜鐗规畩鐨勪笢瑗垮繀椤绘斁鍦ㄦ墽琛岀洰鏍囧鍣ㄧ殑搴曢儴 + this.frameBottomTemp.Y = frameTargetTableControl.Bottom; + //璋冩暣鍏ㄥ眬涓婁笅婊戝姩鎺т欢鐨勬甯冮珮搴� + this.listBodyControl.AdjustTableHeight(); + } + + /// <summary> + /// 璋冩暣鎵ц鐩爣閲岄潰鐨勫叏閮ㄥ潗鏍�(鍒犻櫎鐨勬椂鍊欎娇鐢�) + /// </summary> + /// <param name="mainKey">鍒犻櫎鐨勪富閿�</param> + private void AdjustTargetLocation(string mainKey) + { + bool canChanged = false; + int YY = 0; + for (int i = 0; i < frameTargetTableControl.ChildrenCount; i++) + { + var myRow = frameTargetTableControl.GetChildren(i); + if (canChanged == false && (myRow is RowLayoutControl)) + { + if (((RowLayoutControl)myRow).MainKeys == mainKey) + { + //宸茬粡鍒拌揪瑕佸垹闄ょ殑绱㈠紩 + canChanged = true; + YY = frameTargetTableControl.GetChildren(i).Y; + } + continue; + } + if (canChanged == true) + { + //瀹冧笅闈㈢殑琛屽叏閮ㄥ線涓婄Щ + myRow.Y = YY; + YY = myRow.Bottom; + } + } + } + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs new file mode 100755 index 0000000..5f1d3e6 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs @@ -0,0 +1,152 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared.Phone.UserCenter; + +namespace Shared.Phone.Category +{ + /// <summary> + /// 鍦烘櫙鎵ц鐩爣娣诲姞寤舵椂鐨勭晫闈� + /// </summary> + public class AdjustTargetAddDelayTimeForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 纭畾閫夋嫨鐨勪簨浠� + /// </summary> + public Action<int> FinishSelectEvent = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_delayTime">寤舵椂鏃堕棿</param> + public void ShowForm(int i_delayTime) + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddDelayTime)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(i_delayTime); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame(int i_delayTime) + { + int selectTime = i_delayTime; + + //鍥炬爣绗竴灞傚簳鑹� + var frameFirstBack = new FrameLayout(); + frameFirstBack.Y = Application.GetRealHeight(118); + frameFirstBack.Height = Application.GetMinRealAverage(207); + frameFirstBack.Width = Application.GetMinRealAverage(207); + frameFirstBack.BackgroundColor = UserCenterColor.Current.White; + frameFirstBack.Radius = (uint)Application.GetMinRealAverage(207) / 2; + frameFirstBack.Gravity = Gravity.CenterHorizontal; + bodyFrameLayout.AddChidren(frameFirstBack); + //闃叉鍑虹幇璇樊 + int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); + //鍥炬爣绗簩灞傚簳鑹� + var btnSecondBack = new NormalViewControl(iconWidth, iconWidth, false); + btnSecondBack.BackgroundColor = 0xfffef1ed; + btnSecondBack.Radius = (uint)iconWidth / 2; + btnSecondBack.Gravity = Gravity.Center; + frameFirstBack.AddChidren(btnSecondBack); + //鍥炬爣 + var btnIcon = new IconViewControl(124); + btnIcon.UnSelectedImagePath = "Item/Timer.png"; + btnIcon.Gravity = Gravity.Center; + frameFirstBack.AddChidren(btnIcon); + + //涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅� + var btnMsg = new NormalViewControl(700, 62, true); + btnMsg.Y = frameFirstBack.Bottom + Application.GetRealHeight(34); + btnMsg.TextSize = 15; + btnMsg.TextID = R.MyInternationalizationString.SelectTimeForAction; + btnMsg.TextAlignment = TextAlignment.Center; + btnMsg.Gravity = Gravity.CenterHorizontal; + bodyFrameLayout.AddChidren(btnMsg); + + //鐧借壊鑳屾櫙鎺т欢 + var frameWhiteBack = new FrameLayout(); + frameWhiteBack.BackgroundColor = UserCenterColor.Current.White; + frameWhiteBack.Y = Application.GetRealHeight(611); + frameWhiteBack.Height = Application.GetRealHeight(1500);//瓒呰繃搴曢儴鍗冲彲 + frameWhiteBack.Radius = (uint)Application.GetRealHeight(58); + bodyFrameLayout.AddChidren(frameWhiteBack); + //婊戝姩鎺т欢 + var pickView = new UIPickerView(); + pickView.Y = Application.GetRealHeight(127); + pickView.Height = Application.GetRealHeight(153 * 3); + frameWhiteBack.AddChidren(pickView); + + //鍒� + string strMinute = Language.StringByID(R.MyInternationalizationString.uMinute); + //绉� + string strSecond = Language.StringByID(R.MyInternationalizationString.uSecond); + var listfirst = new List<string>(); + var listSecond = new List<List<string>>(); + for (int i = 0; i <= 59; i++) + { + listfirst.Add(i.ToString().PadLeft(2, '0') + strMinute); + var listTemp = new List<string>(); + for (int j = 0; j <= 59; j++) + { + if (i == 0 && j == 0) + { + continue; + } + listTemp.Add(j.ToString().PadLeft(2, '0') + strSecond); + } + listSecond.Add(listTemp); + } + //鍔犱竴涓�60鍒嗛挓鍚� + listfirst.Add("60" + strMinute); + var listTemp2 = new List<string>() { "00" + strSecond }; + listSecond.Add(listTemp2); + + pickView.setPicker(listfirst, listSecond); + pickView.setCurrentItems(selectTime / 60, selectTime % 60, 0); + pickView.OnSelectChangeEvent += (value1, value2, value3) => + { + int minute = Convert.ToInt32(listfirst[value1].Substring(0, 2)); + int second = Convert.ToInt32(listSecond[value1][value2].Substring(0, 2)); + selectTime = minute * 60 + second; + }; + + //瀹屾垚鎸夐挳 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uSave; + bodyFrameLayout.AddChidren(btnSave); + btnSave.ButtonClickEvent += (sender, e) => + { + //閫夋嫨鐨勬槸鍚屼竴涓椂闂�,鍒欎笉瑙﹀彂鍥炶皟鍑芥暟 + if (i_delayTime == selectTime) { this.CloseForm(); } + //璋冪敤鍥炶皟鍑芥暟 + this.FinishSelectEvent?.Invoke(selectTime); + this.CloseForm(); + }; + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + this.FinishSelectEvent = null; + + base.CloseFormBefore(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs new file mode 100755 index 0000000..a0a3125 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs @@ -0,0 +1,597 @@ +锘縰sing Shared.Common; +using Shared.Phone.UserCenter; +using System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.Category +{ + /// <summary> + /// 鍦烘櫙鎵ц鐩爣娣诲姞璁惧鐨勭晫闈� + /// </summary> + public class AdjustTargetAddDeviceForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 瀹屾垚閫夋嫨鐨勪簨浠�(Key:璁惧涓婚敭) + /// </summary> + public Action<Dictionary<string, List<Safeguard.TaskListInfo>>> FinishSelectEvent = null; + /// <summary> + /// 褰撳墠宸茬粡娣诲姞鐨勬墽琛岀洰鏍� + /// </summary> + private List<Scene.DeviceListData> listAdjustTarget = null; + /// <summary> + /// 褰撳墠宸茬粡娣诲姞鐨勬墽琛岀洰鏍囷紙瀛樺湪妫�娴嬬敤锛� + /// </summary> + private Dictionary<string, List<Safeguard.TaskListInfo>> dicOldListTask = null; + /// <summary> + /// 褰撳墠鐣岄潰涓婃樉绀虹殑鎵ц鐩爣锛堝瓨鍦ㄦ娴嬬敤锛� + /// </summary> + private Dictionary<string, List<Safeguard.TaskListInfo>> dicNewListTask = null; + /// <summary> + /// 瀹屾垚鎸夐挳 + /// </summary> + private BottomClickButton btnFinishControl = null; + /// <summary> + /// 璁惧鍔熻兘鐨勮彍鍗曟帶浠� + /// </summary> + private HorizontalScrolViewLayout deviceFunctionMenuContr = null; + /// <summary> + /// 璁惧鍒楄〃鎺т欢 + /// </summary> + private VerticalListControl listDeviceView = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_listAdjustTarget">褰撳墠鎵ц鐩爣鍒楄〃</param> + public void ShowForm(List<Scene.DeviceListData> i_listAdjustTarget) + { + this.listAdjustTarget = i_listAdjustTarget; + + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddFunction)); + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鍒濆鍖栨埧闂磋彍鍗曟帶浠� + this.InitRoomMenuControl(); + } + + #endregion + + #region 鈻� 鎴块棿鑿滃崟鎺т欢_______________________ + + /// <summary> + /// 鍒濆鍖栨埧闂磋彍鍗曟帶浠� + /// </summary> + private void InitRoomMenuControl() + { + //鑾峰彇鑳藉鏄剧ず鐨勬埧闂村垪琛� + var listRoom = this.GetCanShowRoomList(); + if (listRoom.Count == 0) + { + //娌℃湁鍙互娣诲姞鐨勭洰鏍� + this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uNotHadAddTarget)); + return; + } + + //杩欎釜鎺т欢鐨勯珮搴︿负:鎴块棿鑿滃崟鐨勫簳閮ㄥ埌灞忓箷搴曢儴 + var functionBodyView = new FrameLayout(); + + //鎴块棿鑿滃崟鎺т欢 + var roomSwitchContr = new RoomDeviceGroupMenuControl(listRoom); + this.bodyFrameLayout.AddChidren(roomSwitchContr); + //閫夋嫨浜嬩欢 + roomSwitchContr.SelectRoomEvent += (selectRoom) => + { + //鍦ㄥ闈㈡竻绌�(鐗规晥鐨勯棶棰�) + this.deviceFunctionMenuContr?.RemoveAll(); + this.listDeviceView?.RemoveAll(); + + HdlThreadLogic.Current.RunMainInThread(() => + { + //鍒锋柊璁惧鍒嗘敮鎺т欢 + this.RefreshFunctionView(selectRoom, functionBodyView); + }); + }; + + functionBodyView.Y = roomSwitchContr.Bottom; + functionBodyView.Height = bodyFrameLayout.Height - roomSwitchContr.Bottom; + bodyFrameLayout.AddChidren(functionBodyView); + + //瀹屾垚鎸夐挳 + this.btnFinishControl = new BottomClickButton(); + btnFinishControl.TextID = R.MyInternationalizationString.uFinish; + bodyFrameLayout.AddChidren(btnFinishControl); + btnFinishControl.Visible = false; + btnFinishControl.ButtonClickEvent += (sender, e) => + { + //鍥炶皟鍑芥暟 + this.FinishSelectEvent?.Invoke(this.dicNewListTask); + + this.CloseForm(); + }; + + //鎵ц鍒濆鍖�(浼氳嚜鍔ㄨЕ鍙慡electRoomEvent浜嬩欢) + roomSwitchContr.InitControl(); + } + + /// <summary> + /// 鑾峰彇鑳藉鏄剧ず鐨勬埧闂村垪琛� + /// </summary> + /// <param name="listRomm"></param> + /// <returns></returns> + private List<Room> GetCanShowRoomList() + { + //鍏堝皢鍒楄〃Dictionary鍖� + this.dicNewListTask = new Dictionary<string, List<Safeguard.TaskListInfo>>(); + this.dicOldListTask = new Dictionary<string, List<Safeguard.TaskListInfo>>(); + foreach (var data in this.listAdjustTarget) + { + if (data.Type == 0) + { + //鍙璁惧 + string mainkey = LocalDevice.Current.GetDeviceMainKeys(data.DeviceAddr, data.Epoint); + dicOldListTask[mainkey] = data.TaskList; + } + } + //褰撳墠妤煎眰鐨勫叏閮ㄦ埧闂� + var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom(); + var listShowRoom = new List<Room>(); + foreach (var room in lisrRoom) + { + foreach (var mainkey in room.ListDevice) + { + var device = LocalDevice.Current.GetDevice(mainkey); + if (this.CheckDeviceCanShow(device) == true) + { + //杩欎釜璁惧鏈湴瀛樺湪,骞朵笖瀹冭繕娌℃湁鍔犲叆鍒版墽琛岀洰鏍囧垪琛�,鍒欒繖涓埧闂村彲浠ユ樉绀� + listShowRoom.Add(room); + break; + } + } + } + return listShowRoom; + } + + #endregion + + #region 鈻� 鍔熻兘鍒嗘敮___________________________ + + /// <summary> + /// 鍒锋柊鍔熻兘鍒嗘敮鎺т欢 + /// </summary> + /// <param name="room"></param> + private void RefreshFunctionView(Common.Room room, FrameLayout functionBodyView) + { + //鑾峰彇鍒嗙粍鍚庣殑璁惧 + var dicGroupDevice = this.GetAllGroupDevice(room); + + //鍙垵濮嬪寲涓�娆� + if (this.deviceFunctionMenuContr == null) + { + //璁惧鑿滃崟鐨勭櫧鑹茶儗鏅� + var functionBack1 = new FrameLayout(); + functionBack1.X = ControlCommonResourse.XXLeft; + functionBack1.Height = Application.GetRealHeight(160); + functionBack1.Width = Application.GetRealWidth(1028); + functionBack1.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; + functionBodyView.AddChidren(functionBack1); + functionBack1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft); + var functionBack2 = new FrameLayout(); + functionBack2.X = ControlCommonResourse.XXLeft; + functionBack2.Y = functionBack1.Bottom - Application.GetRealHeight(50); + functionBack2.Height = Application.GetRealHeight(279 - 160 + 50); + functionBack2.Width = Application.GetRealWidth(1028); + functionBack2.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; + functionBodyView.AddChidren(functionBack2); + functionBack2.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); + + //璁惧鑿滃崟鐨勫乏鍙虫粦鍔ㄧ殑鎺т欢 + this.deviceFunctionMenuContr = new HorizontalScrolViewLayout(); + deviceFunctionMenuContr.X = ControlCommonResourse.XXLeft; + deviceFunctionMenuContr.Height = Application.GetRealHeight(279); + deviceFunctionMenuContr.Width = Application.GetRealWidth(1028); + functionBodyView.AddChidren(deviceFunctionMenuContr); + + //璁惧鐨勮儗鏅鍣� + var frameDeviceBack = new FrameLayout(); + frameDeviceBack.X = ControlCommonResourse.XXLeft; + frameDeviceBack.Y = deviceFunctionMenuContr.Bottom + Application.GetRealHeight(35); + frameDeviceBack.BackgroundColor = UserCenterColor.Current.White; + frameDeviceBack.Width = bodyFrameLayout.Width; + frameDeviceBack.Height = functionBodyView.Height - deviceFunctionMenuContr.Bottom - Application.GetRealHeight(35); + frameDeviceBack.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); + functionBodyView.AddChidren(frameDeviceBack); + + //璁惧鍒楄〃鎺т欢 + this.listDeviceView = new VerticalListControl(35); + listDeviceView.Y = Application.GetRealHeight(11); + listDeviceView.Width = Application.GetRealWidth(1022); + listDeviceView.Height = frameDeviceBack.Height - Application.GetRealHeight(11); + listDeviceView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); + frameDeviceBack.AddChidren(listDeviceView); + } + + //涓婁竴娆¢�夋嫨鐨勮彍鍗曞拰鏁版嵁 + DeviceRowInfo nowSelectDeviceInfo = null; + MainPage.Controls.DeviceFunctionUnallocatedControl oldSelectContr = null; + foreach (int Textid in dicGroupDevice.Keys) + { + var rowInfo = dicGroupDevice[Textid]; + + //璁惧绫诲瀷鐨勫鍣� + var devieFrame = new FrameLayout(); + devieFrame.Width = Application.GetRealWidth(220); + deviceFunctionMenuContr.AddChidren(devieFrame); + + //鑿滃崟鍥剧墖鎺т欢 + var deviceObjContr = new MainPage.Controls.DeviceFunctionUnallocatedControl(); + devieFrame.AddChidren(deviceObjContr); + deviceObjContr.InitControl(Language.StringByID(Textid), rowInfo.IconPath, rowInfo.IconPathSelected, rowInfo.listDeviceKeys); + deviceObjContr.ButtonClickEvent += (sender, e) => + { + //閫夋嫨鐨勬槸鍚屼竴涓笢瑗跨殑璇�,涓嶅鐞� + if (nowSelectDeviceInfo.TextId != rowInfo.TextId) + { + //涓婁竴娆$殑鑿滃崟鍙栨秷,鏈鑿滃崟閫夋嫨 + oldSelectContr.SetSelectStatu(false); + deviceObjContr.SetSelectStatu(true); + oldSelectContr = deviceObjContr; + + nowSelectDeviceInfo = rowInfo; + HdlThreadLogic.Current.RunMainInThread(() => + { + //鍒濆鍖栬澶囧垪琛ㄦ帶浠� + this.InitListDeviceControls(listDeviceView, rowInfo, room); + }); + } + }; + + if (nowSelectDeviceInfo == null) + { + //璁剧疆鍒濆閫夋嫨 + nowSelectDeviceInfo = rowInfo; + //璁板綍鍒濆閫夋嫨鐨勮彍鍗曟帶浠� + oldSelectContr = deviceObjContr; + deviceObjContr.SetSelectStatu(true); + } + } + if (nowSelectDeviceInfo != null) + { + //鍒濆鍖栭粯璁ょ殑璁惧鍒楄〃鎺т欢 + this.InitListDeviceControls(listDeviceView, nowSelectDeviceInfo, room); + } + } + + #endregion + + #region 鈻� 鍒濆鍖栬澶囧垪琛ㄦ帶浠禵________________ + + /// <summary> + /// 鍒濆鍖栬澶囧垪琛ㄦ帶浠� + /// </summary> + /// <param name="listView"></param> + /// <param name="rowInfo"></param> + private void InitListDeviceControls(VerticalListControl listView, DeviceRowInfo rowInfo, Room i_room) + { + //鍏堟竻绌� + listView.RemoveAll(); + + var listDevice = new List<CommonDevice>(); + for (int i = 0; i < rowInfo.listDeviceKeys.Count; i++) + { + var device = LocalDevice.Current.GetDevice(rowInfo.listDeviceKeys[i]); + if (device != null) + { + listDevice.Add(device); + } + else + { + rowInfo.listDeviceKeys.RemoveAt(i); + i--; + } + } + + HdlThreadLogic.Current.RunMain(() => + { + foreach (var device in listDevice) + { + //娣诲姞璁惧琛� + this.AddDeviceRow(listView, device); + } + //璋冩暣妗屽竷,淇冧娇瀹冭兘澶熸粦鍔ㄨ秴杩囧畬鎴愭寜閽� + listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23), Application.GetRealHeight(529)); + }); + } + + /// <summary> + /// 娣诲姞璁惧琛� + /// </summary> + /// <param name="listView"></param> + /// <param name="device"></param> + private void AddDeviceRow(VerticalListControl listView, CommonDevice device) + { + string mainkey = LocalDevice.Current.GetDeviceMainKeys(device); + //璁惧鎺т欢 + var rowDevice = new FrameRowControl(listView.rowSpace / 2); + rowDevice.RightOffset = ControlCommonResourse.XXLeft - Application.GetRealWidth(109); + listView.AddChidren(rowDevice); + + //璁惧鍥炬爣鑳屾櫙鎺т欢 + var frameIconBackGroud = new FrameLayout(); + frameIconBackGroud.Height = Application.GetMinRealAverage(112); + frameIconBackGroud.Width = Application.GetMinRealAverage(112); + frameIconBackGroud.Gravity = Gravity.CenterVertical; + frameIconBackGroud.X = Application.GetRealWidth(46); + frameIconBackGroud.Radius = (uint)Application.GetMinRealAverage(112 / 2); + frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor; + rowDevice.AddChidren(frameIconBackGroud, ChidrenBindMode.NotBind); + frameIconBackGroud.Y += rowDevice.chidrenYaxis; + + //璁惧鍥炬爣鎺т欢 + var btnDeviceIcon = new IconViewControl(78); + btnDeviceIcon.Gravity = Gravity.Center; + Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, device); + frameIconBackGroud.AddChidren(btnDeviceIcon); + //閲嶆柊缁戝畾浜嬩欢 + rowDevice.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEventOnly); + + //璁惧鍚嶅瓧 + var btnDeviceName = new NormalViewControl(600, 60, true); + btnDeviceName.X = Application.GetRealWidth(181); + btnDeviceName.Gravity = Gravity.CenterVertical; + btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device); + rowDevice.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly); + btnDeviceName.Y += rowDevice.chidrenYaxis; + //搴曠嚎 + var btnBottomLine = new NormalViewControl(Application.GetRealWidth(841), ControlCommonResourse.BottomLineHeight, false); + btnBottomLine.X = Application.GetRealWidth(181); + btnBottomLine.Y = rowDevice.Height - ControlCommonResourse.BottomLineHeight; + btnBottomLine.BackgroundColor = UserCenterColor.Current.ButtomLine; + rowDevice.AddChidren(btnBottomLine, ChidrenBindMode.NotBind); + //鍙崇澶� + rowDevice.AddRightArrow(); + //鐘舵�� + var btnStatu = rowDevice.AddMostRightView("", 400); + if (this.dicNewListTask.ContainsKey(mainkey) == true) + { + //鏄剧ず閰嶇疆鐘舵�� + btnStatu.Text = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(dicNewListTask[mainkey]); + } + rowDevice.ButtonClickEvent += (sender, e) => + { + //鍔熻兘鐨勮缁嗛厤缃� + this.ShowDeviceDetailSettion(device, btnStatu); + }; + } + + #endregion + + #region 鈻� 鍔熻兘鐨勮缁嗛厤缃甠____________________ + + /// <summary> + /// 鍔熻兘鐨勮缁嗛厤缃� + /// </summary> + /// <param name="device"></param> + /// <param name="btnStatu"></param> + private void ShowDeviceDetailSettion(CommonDevice device, NormalViewControl btnStatu) + { + string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device); + + List<Safeguard.TaskListInfo> listTaskinfo = null; + if (dicNewListTask.ContainsKey(mainKeys) == true) + { + //鍙栫紦瀛樹腑杩樻湭淇濆瓨鐨勬暟鎹� + listTaskinfo = dicNewListTask[mainKeys]; + } + + if (device.Type == DeviceType.DimmableLight//璋冨厜鍣� + || device.Type == DeviceType.ColorDimmableLight)//褰╃伅 + { + var form = new UserCenter.Safety.AlarmTargetStatuSelectLightForm(); + form.AddForm(device, listTaskinfo); + form.FinishSelectEvent += (statuText, listInfo) => + { + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + this.AddSettionDataToMemory(device, listInfo); + }; + } + else if (device.Type == DeviceType.Thermostat)//绌鸿皟 + { + var form = new UserCenter.Safety.AlarmTargetStatuSelectAcForm(); + form.AddForm(device, listTaskinfo); + form.FinishSelectEvent += (statuText, listInfo) => + { + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + this.AddSettionDataToMemory(device, listInfo); + }; + } + else if (device.Type == DeviceType.WindowCoveringDevice)//绐楀笜 + { + var form = new UserCenter.Safety.AlarmTargetStatuSelectCurtainForm(); + form.AddForm(device, listTaskinfo); + form.FinishSelectEvent += (statuText, listInfo) => + { + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + this.AddSettionDataToMemory(device, listInfo); + }; + } + else + { + //鍏朵粬鐩存帴褰掍负寮�鍏崇被 + var form = new UserCenter.Safety.AlarmTargetStatuSelectSwitchForm(); + form.AddForm(device, listTaskinfo); + form.FinishSelectEvent += (statuText, listInfo) => + { + if (listInfo.Count == 0) { statuText = string.Empty; } + btnStatu.Text = statuText; + //灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + this.AddSettionDataToMemory(device, listInfo); + }; + } + } + + /// <summary> + /// 灏嗘柊鐨勬墽琛岀洰鏍囨坊鍔犲叆缂撳瓨 + /// </summary> + /// <param name="deviceInfo"></param> + /// <param name="listInfo"></param> + private void AddSettionDataToMemory(CommonDevice device, List<Safeguard.TaskListInfo> listInfo) + { + string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device); + if (listInfo == null || listInfo.Count == 0) + { + //鎸囧畾涓烘棤鍔ㄤ綔妯″紡 + if (this.dicNewListTask.ContainsKey(mainKeys) == true) + { + this.dicNewListTask.Remove(mainKeys); + if (dicNewListTask.Count == 0) + { + this.btnFinishControl.Visible = false; + } + } + } + else + { + //纭娣诲姞鍔ㄤ綔 + this.dicNewListTask[mainKeys] = listInfo; + if (this.btnFinishControl.Visible == false) + { + this.btnFinishControl.Visible = true; + } + } + } + + #endregion + + #region 鈻� 鏁村悎璁惧___________________________ + + /// <summary> + /// 鑾峰彇鍒嗙粍鍚庣殑璁惧 + /// </summary> + /// <returns></returns> + private Dictionary<int, DeviceRowInfo> GetAllGroupDevice(Common.Room room) + { + //鍏ㄩ儴鐨勮澶� + var listDeviceTemp = HdlRoomLogic.Current.GetRoomListDevice(room); + var listDevice = new List<CommonDevice>(); + foreach (var device in listDeviceTemp) + { + //鍒ゆ柇璇ヨ澶囪兘鍚︽樉绀� + if (this.CheckDeviceCanShow(device) == true) + { + listDevice.Add(device); + } + } + + //鏍规嵁璁惧鎵�灞炵被鍨嬫帓搴� + listDevice = LocalDevice.Current.SortDeviceByBelongType(listDevice); + var dic = new Dictionary<int, DeviceRowInfo>(); + foreach (var device in listDevice) + { + var typeInfo = LocalDevice.Current.GetDeviceBelongEnumInfo(device); + //鎸夋墍灞濱D鍒嗙粍 + if (dic.ContainsKey(typeInfo.BeloneTextId) == false) + { + dic[typeInfo.BeloneTextId] = new DeviceRowInfo(); + string path1 = string.Empty; + string path2 = string.Empty; + //鑾峰彇鍥剧墖 + LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2); + dic[typeInfo.BeloneTextId].IconPath = path1; + dic[typeInfo.BeloneTextId].IconPathSelected = path2; + dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId; + } + dic[typeInfo.BeloneTextId].listDeviceKeys.Add(LocalDevice.Current.GetDeviceMainKeys(device)); + } + return dic; + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + this.FinishSelectEvent = null; + + base.CloseFormBefore(); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 妫�娴嬭澶囪兘鍚︽樉绀� + /// </summary> + /// <param name="device"></param> + private bool CheckDeviceCanShow(CommonDevice device) + { + if (device == null) { return false; } + if (device.Type == DeviceType.AirSwitch ||//绌烘皵寮�鍏� + device.Type == DeviceType.ColorDimmableLight ||//璋冨厜鐏� + device.Type == DeviceType.DimmableLight ||//褰╃伅 + device.Type == DeviceType.OnOffOutput ||//缁х數鍣� + device.Type == DeviceType.Thermostat ||//绌鸿皟 + device.Type == DeviceType.WindowCoveringDevice)//绐楀笜 + { + string mainkey = LocalDevice.Current.GetDeviceMainKeys(device); + return this.dicOldListTask.ContainsKey(mainkey) == false; + } + return false; + } + + #endregion + + #region 鈻� 缁撴瀯浣揰____________________________ + + /// <summary> + /// 璁惧琛屼俊鎭� + /// </summary> + private class DeviceRowInfo + { + /// <summary> + /// 鏂囨湰ID,鐩墠鐢ㄦ潵鍋氫富閿� + /// </summary> + public int TextId = 0; + /// <summary> + /// 鍥炬爣 + /// </summary> + public string IconPath = string.Empty; + /// <summary> + /// 鍥炬爣 + /// </summary> + public string IconPathSelected = string.Empty; + /// <summary> + /// 璁惧鍥炶矾涓婚敭 + /// </summary> + public List<string> listDeviceKeys = new List<string>(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddSceneForm.cs new file mode 100755 index 0000000..3aef76a --- /dev/null +++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddSceneForm.cs @@ -0,0 +1,304 @@ +锘縰sing Shared.Common; +using Shared.Phone.UserCenter; +using System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.Category +{ + /// <summary> + /// 鍦烘櫙鎵ц鐩爣娣诲姞璁惧鐨勭晫闈� + /// </summary> + public class AdjustTargetAddSceneForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 瀹屾垚閫夋嫨鐨勪簨浠�(鍦烘櫙ID) + /// </summary> + public Action<List<int>> FinishSelectEvent = null; + /// <summary> + /// 褰撳墠宸茬粡娣诲姞鐨勬墽琛岀洰鏍� + /// </summary> + private List<Scene.DeviceListData> listAdjustTarget = null; + /// <summary> + /// 褰撳墠宸茬粡娣诲姞鐨勫満鏅疘D锛堝瓨鍦ㄦ娴嬬敤锛� + /// </summary> + private List<int> listOldSceneId = null; + /// <summary> + /// 褰撳墠鐣岄潰涓婇�夋嫨鐨勫満鏅紙瀛樺湪妫�娴嬬敤锛� + /// </summary> + private List<int> listNewScene = null; + /// <summary> + /// 瀹屾垚鎸夐挳 + /// </summary> + private BottomClickButton btnFinishControl = null; + /// <summary> + /// 鍦烘櫙鍒楄〃鎺т欢 + /// </summary> + private VerticalListControl listSceneView = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_listAdjustTarget">褰撳墠鎵ц鐩爣鍒楄〃</param> + public void ShowForm(List<Scene.DeviceListData> i_listAdjustTarget) + { + this.listAdjustTarget = i_listAdjustTarget; + + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddScence)); + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鑾峰彇鑳藉鏄剧ず鐨勬埧闂村垪琛� + var listRoom = this.GetCanShowRoomList(); + if (listRoom.Count == 0) + { + //娌℃湁鍙互娣诲姞鐨勫満鏅� + this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uNotHadAddScene)); + return; + } + + //鎴块棿鑿滃崟鎺т欢 + var roomSwitchContr = new RoomDeviceGroupMenuControl(listRoom); + this.bodyFrameLayout.AddChidren(roomSwitchContr); + //閫夋嫨浜嬩欢 + roomSwitchContr.SelectRoomEvent += (selectRoom) => + { + //鍦ㄥ闈㈡竻绌�(鐗规晥鐨勯棶棰�) + this.listSceneView?.RemoveAll(); + HdlThreadLogic.Current.RunMainInThread(() => + { + //鍒锋柊璁惧鍒嗘敮鎺т欢 + this.RefreshFunctionView(selectRoom); + }); + }; + + this.listSceneView = new VerticalListControl(35); + listSceneView.BackgroundColor = UserCenterColor.Current.White; + listSceneView.Y = roomSwitchContr.Bottom; + listSceneView.Height = bodyFrameLayout.Height - roomSwitchContr.Bottom; + bodyFrameLayout.AddChidren(listSceneView); + + //瀹屾垚鎸夐挳 + this.btnFinishControl = new BottomClickButton(); + btnFinishControl.TextID = R.MyInternationalizationString.uFinish; + bodyFrameLayout.AddChidren(btnFinishControl); + btnFinishControl.Visible = false; + btnFinishControl.ButtonClickEvent += (sender, e) => + { + //鍥炶皟鍑芥暟 + this.FinishSelectEvent?.Invoke(listNewScene); + this.CloseForm(); + }; + + //鎵ц鍒濆鍖�(浼氳嚜鍔ㄨЕ鍙慡electRoomEvent浜嬩欢) + roomSwitchContr.InitControl(); + } + + #endregion + + #region 鈻� 鍒锋柊鍦烘櫙鍒楄〃_______________________ + + /// <summary> + /// 鍒锋柊鍔熻兘鍒嗘敮鎺т欢 + /// </summary> + /// <param name="room"></param> + private void RefreshFunctionView(Room room) + { + //鑾峰彇鎴块棿鍦烘櫙鍒楄〃 + var listScene = this.GetListSceneFromRoom(room); + for (int i = 0; i < listScene.Count; i++) + { + var scene = listScene[i]; + //鍦烘櫙琛屾帶浠� + var rowContr = new FrameRowControl(listSceneView.rowSpace / 2); + listSceneView.AddChidren(rowContr); + //鍥炬爣 + var btnIcon = rowContr.AddLeftIcon(81); + btnIcon.UnSelectedImagePath = "Scene/SceneIcon.png"; + //鍦烘櫙鍚� + var btnName = rowContr.AddLeftCaption(scene.Name, 700); + btnName.TextSize = 15; + //閫夋嫨 + var btnSelect = rowContr.AddMostRightEmptyIcon(58, 58); + btnSelect.Visible = false; + btnSelect.UnSelectedImagePath = "Item/ItemSelected.png"; + if (i != listScene.Count - 1) + { + //搴曠嚎 + rowContr.AddBottomLine(); + } + if (listNewScene.Contains(scene.Id) == true) + { + btnSelect.Visible = true; + } + + //鐐瑰嚮浜嬩欢 + rowContr.ButtonClickEvent += (sender, e) => + { + btnSelect.Visible = !btnSelect.Visible; + if (btnSelect.Visible == true) + { + //娣诲姞缂撳瓨 + listNewScene.Add(scene.Id); + if (btnFinishControl.Visible == false) + { + btnFinishControl.Visible = true; + } + } + else + { + //绉婚櫎缂撳瓨 + listNewScene.Remove(scene.Id); + if (listNewScene.Count == 0) + { + btnFinishControl.Visible = false; + } + } + }; + } + //璋冩暣鎺т欢妗屽竷楂樺害 + this.listSceneView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23)); + } + + #endregion + + #region 鈻� 鑾峰彇鎴块棿鍦烘櫙鍒楄〃___________________ + + /// <summary> + /// 鑾峰彇鎴块棿鍦烘櫙鍒楄〃 + /// </summary> + /// <returns></returns> + private List<SceneUI> GetListSceneFromRoom(Common.Room room) + { + //鑾峰彇鍏ㄩ儴鐨勫満鏅� + var listAllScene = HdlSceneLogic.Current.GetRoomSceneList(room); + var listShowScene = new List<SceneUI>(); + foreach (var scene in listAllScene) + { + //鍒ゆ柇璇ュ満鏅兘鍚︽樉绀� + if (this.CheckSceneCanShow(scene) == true) + { + listShowScene.Add(scene); + } + } + return listShowScene; + } + + #endregion + + #region 鈻� 鑾峰彇鎴块棿鍒楄〃_______________________ + + /// <summary> + /// 鑾峰彇鑳藉鏄剧ず鐨勬埧闂村垪琛� + /// </summary> + /// <param name="listRomm"></param> + /// <returns></returns> + private List<Room> GetCanShowRoomList() + { + //鍏堝垪琛ㄥ寲 + this.listOldSceneId = new List<int>(); + this.listNewScene = new List<int>(); + foreach (var data in this.listAdjustTarget) + { + if (data.Type == 1) + { + //鍙鍦烘櫙 + listOldSceneId.Add(data.ElseScenesId); + } + } + //褰撳墠妤煎眰鐨勫叏閮ㄦ埧闂� + var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom(); + var listShowRoom = new List<Room>(); + foreach (var room in lisrRoom) + { + foreach (var sceneId in room.ListSceneId) + { + var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId); + if (this.CheckSceneCanShow(scene) == true) + { + //杩欎釜鍦烘櫙鏈湴瀛樺湪,骞朵笖瀹冭繕娌℃湁鍔犲叆鍒版墽琛岀洰鏍囧垪琛�,鍒欒繖涓埧闂村彲浠ユ樉绀� + listShowRoom.Add(room); + break; + } + } + } + return listShowRoom; + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + this.FinishSelectEvent = null; + + base.CloseFormBefore(); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 妫�娴嬪満鏅兘鍚︽樉绀� + /// </summary> + /// <param name="i_scene"></param> + private bool CheckSceneCanShow(SceneUI i_scene) + { + //鏈湴涓嶅瓨鍦� + if (i_scene == null) { return false; } + if (this.listOldSceneId.Contains(i_scene.Id) == true) + { + return false; + } + return true; + } + + #endregion + + #region 鈻� 缁撴瀯浣揰____________________________ + + /// <summary> + /// 璁惧琛屼俊鎭� + /// </summary> + private class DeviceRowInfo + { + /// <summary> + /// 鏂囨湰ID,鐩墠鐢ㄦ潵鍋氫富閿� + /// </summary> + public int TextId = 0; + /// <summary> + /// 鍥炬爣 + /// </summary> + public string IconPath = string.Empty; + /// <summary> + /// 鍥炬爣 + /// </summary> + public string IconPathSelected = string.Empty; + /// <summary> + /// 璁惧鍥炶矾涓婚敭 + /// </summary> + public List<string> listDeviceKeys = new List<string>(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs index 67d8217..6af7fad 100755 --- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs @@ -107,12 +107,18 @@ if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 0) { //娣诲姞鍦烘櫙 - Add_Scene(); + var form = new AddOrEditorSceneForm(); + form.AddForm(new object[] { null }); + form.SceneChangedEvent += (scene, roomId) => + { + //鍒锋柊bodyView + this.RefreshBodyView(); + }; } else if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 2) { //娣诲姞鑷姩鍖� - Add_Automation(); + Device.Logic.SkipView.SkipAddLogic(0); } }; } @@ -897,30 +903,6 @@ timeStr += sec + secondText; } return timeStr; - } - - /// <summary> - /// 娣诲姞鍦烘櫙(閮洩鍩庣殑浠g爜) - /// </summary> - private void Add_Scene() - { - var scene = new Device.Category.CategoryAddScene(); - UserView.HomePage.Instance.AddChidren(scene); - UserView.HomePage.Instance.PageIndex += 1; - scene.Show(); - scene.AddAction = () => - { - //鍒锋柊bodyView - this.RefreshBodyView(); - }; - } - - /// <summary> - /// 娣诲姞鑷姩鍖�(閮洩鍩庣殑浠g爜) - /// </summary> - private void Add_Automation() - { - Shared.Phone.Device.Logic.SkipView.SkipAddLogic(0); } #endregion diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs index 0e65470..4da2ebb 100755 --- a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs @@ -1005,27 +1005,27 @@ } sceneRemoveMemberData.DeviceList = removeSceneDeviceListInfoList; sceneRemoveMemberData.ScenesId = modifySceneUI.Id; - var result = await HdlSceneLogic.Current.ModifyScene(modifySceneUI, sceneRemoveMemberData, memberDataList); - if (result == 1) - { - if (modifyRoom != curRoom) - { - modifyRoom.ListSceneId.Remove(modifySceneUI.Id); - curRoom.ListSceneId.Add(modifySceneUI.Id); - modifyRoom.Save(); - curRoom.Save(); - } - EditorAction?.Invoke(modifySceneUI, curRoom); - RemoveFromParent(); - } - else if (result == 0) - { - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain)); - } - else if (result == -1) - { - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); - } + //var result = await HdlSceneLogic.Current.ModifyScene(modifySceneUI, sceneRemoveMemberData, memberDataList); + //if (result == 1) + //{ + // if (modifyRoom != curRoom) + // { + // modifyRoom.ListSceneId.Remove(modifySceneUI.Id); + // curRoom.ListSceneId.Add(modifySceneUI.Id); + // modifyRoom.Save(); + // curRoom.Save(); + // } + // EditorAction?.Invoke(modifySceneUI, curRoom); + // RemoveFromParent(); + //} + //else if (result == 0) + //{ + // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain)); + //} + //else if (result == -1) + //{ + // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); + //} } catch (Exception ex) { @@ -1116,20 +1116,20 @@ } } - var result = await HdlSceneLogic.Current.AddScene(curRoom, nameRow.NameText.Text, imgPath, memberDataList, IconPathType); - if (result == 1) - { - AddAction?.Invoke(); - RemoveFromParent(); - } - else if (result == 0) - { - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.AddSceneFail)); - } - else if (result == -1) - { - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); - } + //var result = await HdlSceneLogic.Current.AddScene(curRoom, nameRow.NameText.Text, imgPath, memberDataList, IconPathType); + //if (result == 1) + //{ + // AddAction?.Invoke(); + // RemoveFromParent(); + //} + //else if (result == 0) + //{ + // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.AddSceneFail)); + //} + //else if (result == -1) + //{ + // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); + //} } catch (Exception ex) { @@ -1314,7 +1314,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 1; int data1 = 0; int data2 = 0; @@ -1331,7 +1331,7 @@ data1 = 0; data2 = 0; } - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -1477,7 +1477,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 6; int data1 = 0; @@ -1496,7 +1496,7 @@ data2 = open.SeekBar.Progress; } - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -1643,7 +1643,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 3; int data1 = 0; @@ -1662,7 +1662,7 @@ data2 = 0; } - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -1834,7 +1834,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 5; int data1 = 0; @@ -1845,7 +1845,7 @@ //鍏� data1 = 3; data2 = 0; - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -1856,7 +1856,7 @@ else { //fan - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 6, @@ -1865,7 +1865,7 @@ taskList.Add(taskInfo); //mode - var taskInfo2 = new ZigBee.Device.Scene.TaskListInfo + var taskInfo2 = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 3, @@ -1877,7 +1877,7 @@ if (open.modeList[modelId] == 4) { //heat - var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo + var taskInfo3 = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 4, @@ -1889,7 +1889,7 @@ else { //heat - var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo + var taskInfo3 = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 5, diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs index 485d479..266fff7 100755 --- a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs @@ -658,7 +658,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 1; int data1 = 0; int data2 = 0; @@ -675,7 +675,7 @@ data1 = 0; data2 = 0; } - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -821,7 +821,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 6; int data1 = 0; @@ -840,7 +840,7 @@ data2 = open.SeekBar.Progress; } - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -987,7 +987,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 3; int data1 = 0; @@ -1006,7 +1006,7 @@ data2 = 0; } - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -1170,7 +1170,7 @@ comfrimBtn.MouseUpEventHandler = (sender, e) => { - var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { }; + var taskList = new List<Safeguard.TaskListInfo> { }; int taskType = 5; int data1 = 0; @@ -1181,7 +1181,7 @@ //鍏� data1 = 3; data2 = 0; - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = data1, @@ -1192,7 +1192,7 @@ else { //fan - var taskInfo = new ZigBee.Device.Scene.TaskListInfo + var taskInfo = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 6, @@ -1201,7 +1201,7 @@ taskList.Add(taskInfo); //mode - var taskInfo2 = new ZigBee.Device.Scene.TaskListInfo + var taskInfo2 = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 3, @@ -1213,7 +1213,7 @@ if (open.modeList[modelId] == 4) { //heat - var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo + var taskInfo3 = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 4, @@ -1225,7 +1225,7 @@ else { //heat - var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo + var taskInfo3 = new Safeguard.TaskListInfo { TaskType = taskType, Data1 = 5, diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs index fbe901a..130617e 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs @@ -62,14 +62,16 @@ { Width = Application.GetRealWidth(717), Height = Application.GetRealHeight(478), - Radius = (uint)Application.GetRealHeight(17) + Radius = (uint)Application.GetRealHeight(17), + Tag = "R" }; AddChidren(roomBackView); var roomImg = new ImageView() { ImagePath = room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage), - Radius = (uint)Application.GetRealHeight(17) + Radius = (uint)Application.GetRealHeight(17), + Tag = "R" }; roomBackView.AddChidren(roomImg); diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs index 15640bb..c12c3c5 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs @@ -181,7 +181,6 @@ if (removeSceneAllData.removeSceneData.Result == 1) { HdlSceneLogic.Current.RemoveScene(scene); - //RefreshBodyView(); RemoveFromParent(); } //0 绉婚櫎澶辫触 @@ -194,119 +193,32 @@ else if (removeSceneAllData.removeSceneData.Result == 2) { HdlSceneLogic.Current.RemoveScene(scene); - //RefreshBodyView(); RemoveFromParent(); - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneIsNull)); return; } }; }; //缂栬緫鍦烘櫙 - btnEditor.ButtonClickEvent += async (sender, e) => + btnEditor.ButtonClickEvent += (sender, e) => { - try + //鍏抽棴宸︽粦鑿滃崟 + this.HideMenu(); + //缂栬緫鍦烘櫙 + var form = new Phone.Category.AddOrEditorSceneForm(); + form.AddForm(i_scene); + form.SceneChangedEvent = (myScene, roomId) => { - //鍏抽棴宸︽粦鑿滃崟 - this.HideMenu(); - var targetList = new List<SceneTargetDeviceUI> { }; - CommonPage.Loading.Start(); - //浠庣綉鍏充腑鍙嶅簭鍒楀寲鍑哄搴旂殑鎴块棿璁惧 - var sceneDeviceList = await ZigBee.Device.Scene.GetSceneDeviceListAsync(scene.Id); - if (sceneDeviceList == null) + if (roomId != room.Id) { - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheMainGatewayIsNotOnLine)); - return; - } - - if (sceneDeviceList.getSceneDeviceListInfo != null) - { - var deviceList = sceneDeviceList.getSceneDeviceListInfo.DeviceList; - var allDevice = HdlRoomLogic.Current.GetAllRoomListDevice(); - var allScene = HdlSceneLogic.Current.GetAllRoomSceneList(); - - if (deviceList != null && allDevice.Count != 0) - { - foreach (var sceneDev in deviceList) - { - if (sceneDev.Type == 0) - { - var dev = allDevice.Find((obj) => obj.DeviceEpoint == sceneDev.Epoint && obj.DeviceAddr == sceneDev.DeviceAddr); - if (dev != null) - { - var sceneTargetDevice = new SceneTargetDeviceUI - { - Type = 0, - DeviceUI = dev, - TaskList = sceneDev.TaskList, - DelayTimeSerialNumber = deviceList.IndexOf(sceneDev) + 1 - }; - - targetList.Add(sceneTargetDevice); - } - } - else if (sceneDev.Type == 1) - { - var localScene = allScene.Find((obj) => obj.Id == sceneDev.ElseScenesId); - if (localScene != null) - { - var sceneTargetDeviceScene = new SceneTargetDeviceUI - { - Type = 1, - ElseScenesId = sceneDev.ElseScenesId, - SceneName = localScene.Name, - SceneUI = localScene, - DelayTimeSerialNumber = deviceList.IndexOf(sceneDev) + 1 - }; - targetList.Add(sceneTargetDeviceScene); - } - } - else - { - var sceneTargetDeviceScene = new SceneTargetDeviceUI - { - Type = 2, - DelayTime = sceneDev.DelayTime, - DelayTimeSerialNumber = deviceList.IndexOf(sceneDev) + 1 - }; - targetList.Add(sceneTargetDeviceScene); - } - } - } + //瀹冨彉鏇翠簡鎴块棿 + this.RemoveFromParent(); } else { - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain)); + this.InitControl(myScene, room); } - - var sceneView = new CategoryAddScene(); - Phone.UserView.HomePage.Instance.AddChidren(sceneView); - Phone.UserView.HomePage.Instance.PageIndex += 1; - sceneView.isModify = true; - sceneView.modifyRoom = room; - sceneView.modifySceneUI = scene; - sceneView.modifySceneTargetDevicesList = targetList; - sceneView.Show(); - sceneView.EditorAction = (s, r) => - { - if (r.Id != room.Id) - { - RemoveFromParent(); - } - else - { - this.InitControl(s, r); - } - }; - } - catch (Exception ex) - { - System.Console.WriteLine($"缂栬緫鍦烘櫙鍑洪敊---{ex.Message}"); - } - finally - { - CommonPage.Loading.Hide(); - } + }; }; //缂栬緫寤舵椂 btnDelay.ButtonClickEvent += (sender, e) => diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneMainView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneMainView.cs index f70df74..7f08de1 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneMainView.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneMainView.cs @@ -317,7 +317,7 @@ var roomLove = UserCenter.HdlRoomLogic.Current.GetLoveRoom(); if (UserCenter.HdlRoomLogic.Current.CurrentRoom.IsLove) { - UserCenter.HdlSceneLogic.Current.DeleteScene(roomLove, scene); + UserCenter.HdlSceneLogic.Current.DeleteSceneFromRoom(roomLove, scene); CollectionAction?.Invoke(); } else @@ -325,11 +325,11 @@ (sender as Button).IsSelected = !(sender as Button).IsSelected; if ((sender as Button).IsSelected) { - UserCenter.HdlSceneLogic.Current.AddScene(roomLove, scene); + UserCenter.HdlSceneLogic.Current.AddSceneToRoom(roomLove, scene); } else { - UserCenter.HdlSceneLogic.Current.DeleteScene(roomLove, scene); + UserCenter.HdlSceneLogic.Current.DeleteSceneFromRoom(roomLove, scene); } } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs b/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs index 3d58db9..8ef4c90 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs @@ -28,14 +28,23 @@ #region View甯冨眬浠g爜 TopView view = new TopView(); this.AddChidren(view.TopRowView()); - if (Common.Logic.CurrentLogic.LogicId != 0) + + if (Yes) { - view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.editautomation); + view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.look); } else { - view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.newautomation); + if (Common.Logic.CurrentLogic.LogicId != 0) + { + view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.editautomation); + } + else + { + view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.newautomation); + } } + view.clickBtn.MouseDownEventHandler += (sender, e) => { // UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦 @@ -151,7 +160,7 @@ UserView.HomePage.Instance.PageIndex += 1; timePage.str1 = conditions["StartHour"] + ":" + conditions["StartMin"] + "-" + conditions["StopHour"] + ":" + conditions["StopMin"]; timePage.IsEditor = true; - timePage.Show(); + timePage.Show(true); } }; diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs index 81ca490..e20c360 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs @@ -482,6 +482,9 @@ TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, }; logicRowlayout.AddRightView(edit); + if (logic.LogicType==2) { + edit.TextID=MyInternationalizationString.look; + } edit.MouseUpEventHandler += (sender, e) => { Common.Logic.CurrentLogic = logic; @@ -733,7 +736,7 @@ } ///<summary> - /// 鏄惁瀛樺湪S-one閫昏緫鏂规硶(true涓哄瓨鍦�) + /// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶(true涓哄瓨鍦�) /// </summary> public static async System.Threading.Tasks.Task<bool> Exist(int valueInt=2) { @@ -754,7 +757,7 @@ } ///<summary> - /// s-one闂ㄩ攣纭鍙栨秷鍙戦�佺殑鏂规硶 + /// s-one闂ㄩ攣纭鍙栨秷(浣挎弧瓒虫潯浠舵墍鏈夐�昏緫澶辫兘涓�娆�)鍙戦�佺殑鏂规硶 /// </summary> public static async void LockCloseLogic(CommonDevice common) { @@ -763,7 +766,7 @@ int m= int.Parse(DateTime.Now.ToString("mm")); //杞寲涓哄灏戝垎閽�; int s = h * 60 + m; - List<Common.Logic> logicList = new List<Common.Logic>(); + var logicList = new List<Common.Logic>(); logicList.Clear(); var Idlist = await Send.GetLogicId(2); if (Idlist.Count != 0) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs index ae014e0..a679593 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs @@ -19,7 +19,7 @@ public string str1; Dictionary<string, string> timeBucketConditionsInfo = new Dictionary<string, string>(); - public void Show() + public void Show(bool _if=false) { #region 涓婇潰鐨勫竷灞�浠g爜 @@ -335,11 +335,21 @@ } //LogicIfon.logicIfon.Addconditions(timeBucketConditionsInfo,timeBucketConditionsInfo.Type); + if (_if) { + //璺冲埌S-one闂ㄩ攣 + var oneLogic = new OneLogic { }; + UserView.HomePage.Instance.AddChidren(oneLogic); + UserView.HomePage.Instance.PageIndex += 1; + oneLogic.Show(false); - var logicCommunalPage = new LogicCommunalPage { }; - UserView.HomePage.Instance.AddChidren(logicCommunalPage); - UserView.HomePage.Instance.PageIndex += 1; - logicCommunalPage.Show(() => { }); + } + else + { + var logicCommunalPage = new LogicCommunalPage { }; + UserView.HomePage.Instance.AddChidren(logicCommunalPage); + UserView.HomePage.Instance.PageIndex += 1; + logicCommunalPage.Show(() => { }); + } }; } diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs b/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs index 1d723ca..616eb2f 100755 --- a/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs +++ b/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs @@ -71,7 +71,11 @@ /// <summary> /// 杈撳叆鐨勭櫥闄嗚处鍙�(閲嶆柊鐧婚檰鏃朵娇鐢�) /// </summary> - private string oldInputAccount = string.Empty; + private string oldInputPhone = string.Empty; + /// <summary> + /// 杈撳叆鐨勭櫥闄嗚处鍙�(閲嶆柊鐧婚檰鏃朵娇鐢�) + /// </summary> + private string oldInputEmail = string.Empty; #endregion @@ -120,8 +124,8 @@ public void LoginViewShow(string account = "") { //璁剧疆涓�涓嬪垵濮嬪�� - if (account.Contains("@") == true) { this.oldInputAccount = account; } - else { this.oldInputAccount = account; } + if (account.Contains("@") == true) { this.oldInputEmail = account; } + else { this.oldInputPhone = account; } #region midFrameLayout midFrameLayout = new FrameLayout() @@ -751,7 +755,7 @@ return; } phoneRow = new PhoneLoginRowForm(); - phoneRow.Init(accountPwdFrameLayout, this, this.oldInputAccount, 29, 29); + phoneRow.Init(accountPwdFrameLayout, this, this.oldInputPhone, 29, 29); phoneRow.AccountET.TextChangeEventHandler += Account_TextChange; phonePwdRow = new PwdLoginRowForm(); @@ -776,7 +780,7 @@ return; } emailRow = new EmailLoginRowForm(); - emailRow.Init(accountPwdFrameLayout, this.oldInputAccount, 29, 29); + emailRow.Init(accountPwdFrameLayout, this.oldInputEmail, 29, 29); emailRow.AccountET.TextChangeEventHandler += Account_TextChange; emailPwdRow = new PwdLoginRowForm(); diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs index 9d850cb..7710abe 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs @@ -364,9 +364,22 @@ //宸﹀彸婊戝姩鎺т欢鐨勮儗鏅鍣� var frameBack = new FrameLayout(); frameBack.Y = Application.GetRealHeight(302); - frameBack.Width = Application.GetRealWidth(CommonPage.AppRealWidth); + frameBack.Width = this.Width; frameBack.Height = Application.GetRealHeight(478); this.listBodyContr.frameTable.AddChidren(frameBack); + + //鎴块棿婊戝姩鎺т欢宸﹁竟鐨勮櫄鎷熷浘鐗� + var mLeftImageView = new ImageView(); + mLeftImageView.ImagePath = "RoomIcon/1.jpg"; + mLeftImageView.Radius = (uint)Application.GetRealHeight(17); + mLeftImageView.Width = Application.GetRealWidth(717); + mLeftImageView.Height = Application.GetRealHeight(478); + //鎴块棿婊戝姩鎺т欢鍙宠竟鐨勮櫄鎷熷浘鐗� + var mRightImageView = new ImageView(); + mRightImageView.ImagePath = "RoomIcon/2.jpg"; + mRightImageView.Radius = (uint)Application.GetRealHeight(17); + mRightImageView.Width = mLeftImageView.Width; + mRightImageView.Height = mLeftImageView.Height; this.roomPageView = new HorizontalPages(); roomPageView.Width = frameBack.Width; @@ -382,6 +395,9 @@ btnRoomBottomShadow.Gravity = Gravity.CenterHorizontal; btnRoomBottomShadow.UnSelectedImagePath = "Room/RoomCardShadow.png"; this.listBodyContr.frameTable.AddChidren(btnRoomBottomShadow); + + //璁剧疆鎺у埗鏈�宸﹀拰鏈�鍙�2杈瑰~鍏呯殑鍋囪儗鏅疺iew锛屼笉璁剧疆涓嶆樉绀猴紝闇�瑕佸湪AddChidren 鍓嶈皟鐢ㄨ鏂规硶 + roomPageView.SetLeftAndRightImageView(mLeftImageView, mRightImageView); //褰撳墠鎴块棿 var listRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom(); @@ -404,40 +420,34 @@ roomView.HideName(true); } } - //鎴块棿鑳藉婊戝姩鐨勬椂鍊欐墠鏄剧ず - FrameLayout btnRoomLeftShadow = null; - FrameLayout btnRoomRightShadow = null; - if (listRoom.Count > 1) - { - //鍦ㄦ埧闂村崱鐗囧乏杈规坊鍔犻伄缃� - btnRoomLeftShadow = new FrameLayout(); - btnRoomLeftShadow.Width = Application.GetRealWidth(124); - btnRoomLeftShadow.Height = roomPageView.Height - roomPageView.JMBJ * 2; - btnRoomLeftShadow.Gravity = Gravity.CenterVertical; - btnRoomLeftShadow.BackgroundColor = 0x1c000000; - btnRoomLeftShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight); - btnRoomLeftShadow.Visible = curIndex >= 1; - frameBack.AddChidren(btnRoomLeftShadow); - //鍦ㄦ埧闂村崱鐗囧彸杈规坊鍔犻伄缃� - btnRoomRightShadow = new FrameLayout(); - btnRoomRightShadow.Width = btnRoomLeftShadow.Width; - btnRoomRightShadow.Height = btnRoomLeftShadow.Height; - btnRoomRightShadow.X = Application.GetRealWidth(956); - btnRoomRightShadow.Gravity = Gravity.CenterVertical; - btnRoomRightShadow.BackgroundColor = btnRoomLeftShadow.BackgroundColor; - btnRoomRightShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); - btnRoomRightShadow.Visible = curIndex < listRoom.Count - 1; - frameBack.AddChidren(btnRoomRightShadow); - } + //鍦ㄦ埧闂村崱鐗囧乏杈规坊鍔犻伄缃� + var btnRoomLeftShadow = new FrameLayout(); + btnRoomLeftShadow.Width = Application.GetRealWidth(124); + btnRoomLeftShadow.Height = roomPageView.Height - roomPageView.JMBJ * 2; + btnRoomLeftShadow.Gravity = Gravity.CenterVertical; + btnRoomLeftShadow.BackgroundColor = 0x1c000000; + btnRoomLeftShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight); + frameBack.AddChidren(btnRoomLeftShadow); + + //鍦ㄦ埧闂村崱鐗囧彸杈规坊鍔犻伄缃� + var btnRoomRightShadow = new FrameLayout(); + btnRoomRightShadow.Width = btnRoomLeftShadow.Width; + btnRoomRightShadow.Height = btnRoomLeftShadow.Height; + btnRoomRightShadow.X = Application.GetRealWidth(956); + btnRoomRightShadow.Gravity = Gravity.CenterVertical; + btnRoomRightShadow.BackgroundColor = btnRoomLeftShadow.BackgroundColor; + btnRoomRightShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); + frameBack.AddChidren(btnRoomRightShadow); + //鎺т欢寮�濮嬫粦鍔ㄧ殑浜嬩欢 roomPageView.StartScrollAction += () => { this.isRoomChanging = true; //寮�濮嬫粦鍔ㄦ椂,闅愯棌褰撳墠鐨勬暟鎹樉绀� (roomPageView.GetChildren(roomPageView.PageIndex) as RoomView).HideName(true); - if (btnRoomLeftShadow != null) { btnRoomLeftShadow.Visible = false; } - if (btnRoomRightShadow != null) { btnRoomRightShadow.Visible = false; } + btnRoomLeftShadow.Visible = false; + btnRoomRightShadow.Visible = false; btnRoomBottomShadow.Visible = false; }; roomPageView.EndScrollAction += () => @@ -459,8 +469,8 @@ (roomPageView.GetChildren(curIndex + 1) as RoomView).HideName(true); } - if (btnRoomLeftShadow != null) { btnRoomLeftShadow.Visible = curIndex >= 1; } - if (btnRoomRightShadow != null) { btnRoomRightShadow.Visible = curIndex < listRoom.Count - 1; } + btnRoomLeftShadow.Visible = true; + btnRoomRightShadow.Visible = true; btnRoomBottomShadow.Visible = true; //鍒囨崲褰撳墠鎴块棿 HdlRoomLogic.Current.CurrentRoom = listRoom[curIndex]; diff --git a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs index 451e58f..74c5755 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs @@ -569,7 +569,7 @@ foreach (var scene in this.dicSelectScene.Values) { //娣诲姞鍦烘櫙 - HdlSceneLogic.Current.AddScene(room, scene); + HdlSceneLogic.Current.AddSceneToRoom(room, scene); } //娓呯┖缂撳瓨 this.dicSelectScene.Clear(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs index a22a1b6..198b5b1 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs @@ -34,6 +34,11 @@ /// </summary> public string UserName = string.Empty; /// <summary> + /// 璁板綍涓婁竴娆$殑鐢ㄦ埛鏄电О(缁欎釜浜轰腑蹇冧慨鏀规樀绉版椂鐢ㄧ殑) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public string OldUserName = string.Empty; + /// <summary> /// DistributedMark /// </summary> [Newtonsoft.Json.JsonIgnore] @@ -57,6 +62,7 @@ /// <summary> /// 鐧婚檰鏉冮檺缂栧彿鐨勭炕璇戝悕锛�1:涓昏处鍙疯嚜宸�(鏈汉) 2:璧嬩簣绠$悊鍛樻潈闄愮殑鎴愬憳 3:鎴愬憳 /// </summary> + [Newtonsoft.Json.JsonIgnore] public string AuthorityText = string.Empty; /// <summary> /// 鐢ㄦ埛澶村儚鏁版嵁(涓存椂鐢�,浼氱疆绌�) @@ -940,13 +946,12 @@ get { int value = ConcreteTextId + 20000; - if (value >= 60000) + //榛樿澶囨敞鍚嶇О鏄湪50000~59999 + if (50000 <= value && value <= 59999) { - //澶т簬60000锛屽垯琛ㄧず杩欎釜涓滆タ涓嶆槸浠庢渤涓滅殑鍚嶇О鍒楄〃涓潵鐨�,瀹冩槸浠庣涓夋柟鍒楄〃鏉ョ殑 - //鐩存帴杩斿洖瀹冪殑瀹樻柟鍚嶅瓧鍗冲彲 - return ConcreteTextId; + return value; } - return value; + return ConcreteTextId; } } /// <summary> @@ -1272,9 +1277,32 @@ /// </summary> public int DeviceHistory = 0; /// <summary> - /// 妫�娴嬭兘鍚﹀箍鎾緱鍒扮綉鍏� + /// 妫�娴嬭兘鍚﹀箍鎾緱鍒扮綉鍏� 1->寮�鍚� /// </summary> public int CheckCanReceiveGateway = 0; + /// <summary> + /// 寮哄埗璺宠浆鐪熷疄璁惧鐣岄潰 1->璁惧鍒楄〃寮哄埗璺宠浆 + /// </summary> + public int GotoRealDeviceForm = 0; } #endregion + + #region 鈻� 闂ㄩ攣鐨勬姤璀︾粨鏋淿_____________________ + + /// <summary> + /// 闂ㄩ攣鐨勬姤璀︾粨鏋� + /// </summary> + public class DoorLockAlarmsResult + { + /// <summary> + /// 鎶ヨ绫诲瀷 + /// </summary> + public int AlarmCode = -1; + /// <summary> + /// Clusterid + /// </summary> + public int Clusterid = -1; + } + + #endregion } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs index cf71a30..267b219 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs @@ -55,6 +55,17 @@ } /// <summary> + /// 鍒濆鍖栨帶浠�(閽堝鐨勬槸鍦烘櫙) + /// </summary> + /// <param name="i_caption">鏍囬鏂囨湰</param> + /// <param name="i_roomId">鎴块棿ID</param> + public void InitControl(string i_caption, string i_roomId) + { + var room = HdlRoomLogic.Current.GetRoomById(i_roomId); + this.DoInitControl(i_caption, room); + } + + /// <summary> /// 鍒濆鍖栨帶浠�(閽堝鐨勬槸缃戝叧) /// </summary> /// <param name="i_caption">鏍囬鏂囨湰</param> @@ -62,7 +73,7 @@ public void InitControl(string i_caption, ZigBee.Device.ZbGateway i_gateway) { var room = HdlGatewayLogic.Current.GetRoomByGateway(i_gateway); - this.InitControl(i_caption, room); + this.DoInitControl(i_caption, room); } /// <summary> @@ -73,7 +84,7 @@ public void InitControl(string i_caption, ZigBee.Device.CommonDevice i_device) { var room = HdlRoomLogic.Current.GetRoomByDevice(i_device); - this.InitControl(i_caption, room); + this.DoInitControl(i_caption, room); } /// <summary> @@ -84,7 +95,7 @@ public void InitControl(string i_caption, List<ZigBee.Device.CommonDevice> i_listDevice) { var room = Common.LocalDevice.Current.GeteRealDeviceRoom(i_listDevice[0]); - this.InitControl(i_caption, room); + this.DoInitControl(i_caption, room); } /// <summary> @@ -92,7 +103,7 @@ /// </summary> /// <param name="i_caption"></param> /// <param name="i_Room"></param> - private void InitControl(string i_caption, Common.Room i_Room) + private void DoInitControl(string i_caption, Common.Room i_Room) { if (i_Room == null) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs index ac4866c..7da740e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs @@ -53,10 +53,12 @@ public void InitControl(CommonDevice i_device) { this.deviceMac = i_device.DeviceAddr; + //闃叉鍑虹幇璇樊 + int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); //绗簩灞傚簳鑹� - var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false); + var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false); btnIcon2.BackgroundColor = 0xfffef1ed; - btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2; + btnIcon2.Radius = (uint)iconWidth / 2; btnIcon2.Gravity = Gravity.Center; this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly); @@ -81,11 +83,12 @@ { this.deviceMac = deviceMacAddr; this.deviceEpoint = epoint; - + //闃叉鍑虹幇璇樊 + int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); //绗簩灞傚簳鑹� - var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false); + var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false); btnIcon2.BackgroundColor = 0xfffef1ed; - btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2; + btnIcon2.Radius = (uint)iconWidth / 2; btnIcon2.Gravity = Gravity.Center; this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly); @@ -103,10 +106,12 @@ public void InitControl(ZbGateway i_gateway) { this.zbGateway = i_gateway; + //闃叉鍑虹幇璇樊 + int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); //绗簩灞傚簳鑹� - var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false); + var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false); btnIcon2.BackgroundColor = 0xfffef1ed; - btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2; + btnIcon2.Radius = (uint)iconWidth / 2; btnIcon2.Gravity = Gravity.Center; this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs index 4f68e92..c44566f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs @@ -5,7 +5,7 @@ namespace Shared.Phone.UserCenter { /// <summary> - /// 鍋氭垚涓�涓畝鍗曞満鏅�夋嫨鐨勮鎺т欢 + /// 鍋氭垚涓�涓畝鍗曞満鏅�夋嫨鐨勮鎺т欢(瀹冧細鑷姩璁剧疆閫夋嫨鐘舵��) /// </summary> public class SceneSimpleSelectControl : FrameRowControl { @@ -62,7 +62,7 @@ #region 鈻� 鍒濆鍖朹____________________________ /// <summary> - /// 鍋氭垚涓�涓畝鍗曞満鏅�夋嫨鐨勮鎺т欢 + /// 鍋氭垚涓�涓畝鍗曞満鏅�夋嫨鐨勮鎺т欢(瀹冧細鑷姩璁剧疆閫夋嫨鐘舵��) /// </summary> /// <param name="i_Scene">鍦烘櫙瀵硅薄</param> /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs index 27d7bf4..5246663 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs @@ -539,7 +539,7 @@ /// <returns></returns> public DeviceAlarmInfo GetDoorLockAlarmInfo(Newtonsoft.Json.Linq.JObject jobject) { - var info = (DoorLockAlarmsResult)JsonConvert.DeserializeObject<DoorLockAlarmsResult>(jobject["Data"].ToString()); + var info = JsonConvert.DeserializeObject<DoorLockAlarmsResult>(jobject["Data"].ToString()); var alarmInfo = new DeviceAlarmInfo(); if (info.Clusterid == 1) @@ -577,17 +577,17 @@ //鏆村姏寮�闂� alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg5); } - else if (info.AlarmCode == 116) + else if (info.AlarmCode == 216) { //甯稿紑妯″紡寮�鍚� alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg6); } - else if (info.AlarmCode == 117) + else if (info.AlarmCode == 217) { //甯稿紑妯″紡缁撴潫 alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg7); } - else if (info.AlarmCode == 132) + else if (info.AlarmCode == 232) { //闂ㄩ搩瑙﹀彂 alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg8); @@ -614,25 +614,6 @@ } oldDeviceAlarmFile = fileName; return fileName; - } - - #endregion - - #region 鈻� 缁撴瀯浣揰____________________________ - - /// <summary> - /// 闂ㄩ攣鐨勬姤璀︾粨鏋� - /// </summary> - private class DoorLockAlarmsResult - { - /// <summary> - /// 鎶ヨ绫诲瀷 - /// </summary> - public int AlarmCode = -1; - /// <summary> - /// Clusterid - /// </summary> - public int Clusterid = -1; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs index fd81325..9b7d7bf 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs @@ -145,7 +145,7 @@ //闂ㄩ攣涓婃姤 else if (topic == gatewayId + "/Alarms/SendAlarmInform") { - this.DoorLockDeviceReportPush(null); + this.DoorLockDeviceReportPush(JObject.Parse(msgData)); } //閫氳繃澶栭儴鏂瑰紡甯冮槻鎾ら槻鎴愬姛鏃舵姤鍛� else if (topic == gatewayId + "/Security/EnOrWithdrawSucceedReport") @@ -484,9 +484,25 @@ /// <param name="receiveData"></param> private void DoorLockDeviceReportPush(JObject receiveData) { - //淇濆瓨闂ㄩ攣淇℃伅鍒版湰鍦� - //HdlAlarmsLogic.Current.SaveDoorLockAlarmInfo(receiveData); - + //鍙湁寰愭鐨勯棬閿佺晫闈㈡病鏈夋墦寮�鐨勬儏鍐典笅,鎵嶄細澶勭悊杩欎釜涓滆タ + if (ControlCommonResourse.IsDoorLockPageOpen == false) + { + var device = Common.LocalDevice.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint")); + if ((device is ZigBee.Device.DoorLock) == false) + { + //瀹冧笉鏄棬閿� + return; + } + var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLockAlarmsResult>(receiveData["Data"].ToString()); + if (info.Clusterid == 257) + { + //甯稿紑妯″紡寮�鍚� + if (info.AlarmCode == 216) + { + DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush, null); + } + } + } //鏄剧ず鏈夋柊娑堟伅鐨勭壒鏁� this.ShowHadNewMessageAppeal(); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs index 1ec286d..4a49fa5 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs @@ -1963,14 +1963,14 @@ #endregion - #region 鈻� 鎶ヨ鐩爣鐘舵�佺殑缈昏瘧鏂囨湰_____________ + #region 鈻� 鎵ц鐩爣鐘舵�佺殑缈昏瘧鏂囨湰_____________ /// <summary> - /// 鑾峰彇鐏厜绫诲瀷鐨勬姤璀︾洰鏍囩殑鐘舵�佹枃鏈� + /// 鑾峰彇鎵ц鐩爣鐨勭姸鎬佹枃鏈� /// </summary> /// <param name="listTaskInfo">鍔ㄤ綔瀵硅薄,鍙互涓虹┖</param> /// <returns></returns> - public string GetLightAlarmStatuText(List<Safeguard.TaskListInfo> listTaskInfo) + public string GetAdjustTargetStatuText(List<Safeguard.TaskListInfo> listTaskInfo) { if (listTaskInfo == null || listTaskInfo.Count == 0) { @@ -1979,13 +1979,22 @@ } //瑕佽�冭檻瀹冪殑鎺掑垪椤哄簭(鍙互鎸夐渶姹傚彉鏇寸紪鍙�) Dictionary<int, string> dicSort = new Dictionary<int, string>(); + //鏈�澶х紪鍙� + int MaxNo = 4; //寮�鍏崇殑浣嶇疆缂栧彿 int ControlNo = 0; //鐧惧垎姣旂殑浣嶇疆缂栧彿 int persentNo = 1; + //绌鸿皟娓╁害鐨勪綅缃紪鍙� + int temparetureNo = 2; + //绌鸿皟妯″紡鐨勪綅缃紪鍙� + int modelNo = 3; + //绌鸿皟椋庨�熺殑浣嶇疆缂栧彿 + int windNo = 4; foreach (var info in listTaskInfo) { + #region 鈻� 寮�鍏虫帶鍒禵___ //寮�鍏虫帶鍒� if (info.TaskType == 1) { @@ -2000,11 +2009,25 @@ dicSort[ControlNo] = Language.StringByID(R.MyInternationalizationString.uSimpleClose); } } + #endregion + + #region 鈻� 浜害璋冭妭____ //浜害璋冭妭 else if (info.TaskType == 3) { - dicSort[persentNo] = info.Data1 + "%"; + if (info.Data1 == 0) + { + //鍏� + dicSort[persentNo] = Language.StringByID(R.MyInternationalizationString.uSimpleClose); + } + else + { + dicSort[persentNo] = $"{(int)(info.Data1 * 1.0 / 254 * 100)}%"; + } } + #endregion + + #region 鈻� 绐楀笜璁惧____ //绐楀笜璁惧(瀹冪殑寮�鍏冲拰寮�鍏虫帶鍒舵槸鍙嶈繃鏉ョ殑) else if (info.TaskType == 6) { @@ -2024,13 +2047,84 @@ dicSort[persentNo] = info.Data2 + "%"; } } + #endregion + + #region 鈻� 绌鸿皟璁惧____ + //绌鸿皟璁惧 + else if (info.TaskType == 5) + { + if (info.Data1 == 3) + { + if (info.Data2 == 0) + { + return Language.StringByID(R.MyInternationalizationString.uSimpleClose); + } + else if (info.Data2 == 1) + { + //鑷姩 + dicSort[modelNo] = Language.StringByID(R.MyInternationalizationString.Mode_Auto); + } + else if (info.Data2 == 3) + { + //鍒跺喎 + dicSort[modelNo] = Language.StringByID(R.MyInternationalizationString.Mode_Cool); + } + else if (info.Data2 == 4) + { + //鍒剁儹 + dicSort[modelNo] = Language.StringByID(R.MyInternationalizationString.Mode_Heat); + } + else if (info.Data2 == 7) + { + //閫侀 + dicSort[modelNo] = Language.StringByID(R.MyInternationalizationString.Mode_FanOnly); + } + else if (info.Data2 == 8) + { + //闄ゆ箍 + dicSort[modelNo] = Language.StringByID(R.MyInternationalizationString.Mode_Dry); + } + } + else if (info.Data1 == 4 || info.Data1 == 5) + { + //娓╁害 + dicSort[temparetureNo] = $"{ info.Data2 / 100}鈩�"; + } + else if (info.Data1 == 6) + { + if (info.Data2 == 1) + { + //浣庨 + dicSort[windNo] = Language.StringByID(R.MyInternationalizationString.Fan_Low); + } + else if (info.Data2 == 2) + { + //涓 + dicSort[windNo] = Language.StringByID(R.MyInternationalizationString.Fan_Middle); + } + else if (info.Data2 == 3) + { + //楂橀 + dicSort[windNo] = Language.StringByID(R.MyInternationalizationString.Fan_Height); + } + } + } + #endregion + } + //濡傛灉寮�鍏冲拰鐧惧垎姣斾竴璧峰瓨鍦ㄧ殑璇�,鍒欎笉鏄剧ず寮�鍏虫枃瀛� + if (dicSort.ContainsKey(ControlNo) == true && dicSort.ContainsKey(persentNo) == true) + { + dicSort.Remove(ControlNo); } //鎷兼帴鏂囨湰 string txtvalue = string.Empty; - for (int i = 0; i < dicSort.Count; i++) + for (int i = 0; i <= MaxNo; i++) { - txtvalue += dicSort[i] + " "; + if (dicSort.ContainsKey(i) == true) + { + txtvalue += dicSort[i] + " "; + } } return txtvalue.Trim(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs index 048a5e9..925d1eb 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs @@ -77,7 +77,7 @@ } /// <summary> - /// 鍒锋柊鎴块棿鐨勫満鏅垪琛� + /// 鍒锋柊鏈湴鐨勫叏閮ㄥ満鏅� /// </summary> public async Task<bool> RefreshSceneUIList() { @@ -120,78 +120,124 @@ #region 鈻� 娣诲姞鍦烘櫙___________________________ /// <summary> - /// 娣诲姞鍦烘櫙(鏇存柊缃戝叧) 0澶辫触 1鎴愬姛 -1宸茬粡瀛樺湪 + /// 娣诲姞鏂板満鏅埌缃戝叧(杩斿洖null浠h〃鍑洪敊) /// </summary> - /// <returns>The scene.</returns> - /// <param name="sceneName">Scene name.</param> - /// <param name="sceneIconPath">鑳屾櫙鍥剧墖锛屼笉鍖呭惈浣忓畢璺緞 濡傛灉iconPathType=1鎴栬��2 闇�瑕佹嫾鎺ヤ綇瀹� 鍙樻垚 浣忓畢/sceneIconPath</param> - /// <param name="commons">Commons.</param> - /// <param name="iconPathType">I鍦烘櫙鑳屾櫙鍥剧墖鏉ユ簮绫诲瀷 鍥剧墖鏉ユ簮 0--鏈湴鍥惧簱 1--鎷嶇収 2--绯荤粺鍥惧簱 榛樿0</param> - public async Task<int> AddScene(Room i_room, string sceneName, string sceneIconPath, List<Scene.AddSceneMemberData> commons, int iconPathType) + /// <param name="sceneName">鍦烘櫙鍚嶇О</param> + /// <param name="listAdjustTarget">鎵ц鐩爣</param> + /// <returns></returns> + public async Task<SceneUI> AddNewSceneToGateway(string sceneName, List<Scene.DeviceListData> listAdjustTarget) { - var getSceneIdAllData = await Scene.GetSceneNewIdAsync(sceneName); - if (getSceneIdAllData == null || getSceneIdAllData.getSceneIdData == null) + var result1 = await Scene.GetSceneNewIdAsync(sceneName); + //鍏遍�氶敊璇娴� + string error = HdlCheckLogic.Current.CheckCommonErrorCode(result1); + if (error != null) { - return 0; + this.ShowErrorMsg(error); + return null; } - var getSceneIdData = getSceneIdAllData.getSceneIdData; - - bool result = true; - foreach (var common in commons) + if (result1 == null || result1.getSceneIdData == null) { - //娣诲姞鏂版垚鍛� - var addSceneMemberData = new Scene.AddSceneMemberData + //娣诲姞鍦烘櫙澶辫触 + string msg1 = Language.StringByID(R.MyInternationalizationString.AddSceneFail); + //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg + msg1 = UserCenterLogic.CombineGatewayTimeOutMsg(msg1, result1); + this.ShowTipMsg(msg1); + return null; + } + //娣诲姞鎵ц鐩爣 + var listSuccess = await this.AddTargetToScene(result1.getSceneIdData.NewScenesId, listAdjustTarget); + if (listSuccess == null) + { + return null; + } + + //鍒涘缓鍦烘櫙瀵硅薄 + var newScene = new SceneUI(); + newScene.Name = sceneName; + newScene.Id = result1.getSceneIdData.NewScenesId; + newScene.AdjustTargetList.AddRange(listSuccess); + //娣诲姞缂撳瓨 + newScene.Save(); + //鍔犲叆缂撳瓨 + this.dicScenes[newScene.Id] = newScene; + + return newScene; + } + + /// <summary> + /// 娣诲姞鎵ц鐩爣鍒版寚瀹氱殑鍦烘櫙(杩斿洖鎴愬姛娣诲姞鐨勬墽琛岀洰鏍�) + /// </summary> + /// <param name="sceneId">鍦烘櫙Id</param> + /// <param name="listAdjustTarget">鎵ц鐩爣</param> + /// <returns></returns> + private async Task<List<Scene.DeviceListData>> AddTargetToScene(int sceneId, List<Scene.DeviceListData> listAdjustTarget) + { + var listSuccess = new List<Scene.DeviceListData>(); + for (int i = 0; i < listAdjustTarget.Count; i++) + { + var data = listAdjustTarget[i]; + var addData = new Scene.AddSceneMemberData(); + if (data.Type == 0) { - Type = common.Type, - DeviceAddr = common.DeviceAddr, - Epoint = common.Epoint, - ScenesId = getSceneIdData.NewScenesId, - TaskList = common.TaskList, - DelayTime = common.DelayTime, - MemberNumber = common.MemberNumber, - ElseScenesId = common.ElseScenesId - }; + //璁惧 + addData.Type = 0; + addData.ScenesId = sceneId; + addData.DeviceAddr = data.DeviceAddr; + addData.Epoint = data.Epoint; + addData.TaskList = data.TaskList; + addData.DelayTime = 0; + addData.MemberNumber = i + 1; + } + else if (data.Type == 1) + { + //鍦烘櫙 + addData.Type = 1; + addData.ScenesId = sceneId; + addData.ElseScenesId = data.ElseScenesId; + addData.DelayTime = 0; + addData.MemberNumber = i + 1; + } + else + { + //寤舵椂 + addData.Type = 2; + addData.ScenesId = sceneId; + addData.DelayTime = data.DelayTime; + addData.MemberNumber = i + 1; + } + //娣诲姞鏂版垚鍛� 杩斿洖缁撴灉 - var addSceneMemberResponseAllData = await Scene.AddSceneMemberAsync(addSceneMemberData); - if (addSceneMemberResponseAllData == null || addSceneMemberResponseAllData.addSceneMemberResponseData == null) + var result2 = await Scene.AddSceneMemberAsync(addData); + if (result2 == null || result2.addSceneMemberResponseData == null + || result2.addSceneMemberResponseData.Result != 1) { continue; } - var addSceneMemberResponseData = addSceneMemberResponseAllData.addSceneMemberResponseData; - if (addSceneMemberResponseData == null && addSceneMemberResponseData.Result != 1) - { - result = false; - } + //鎷ユ湁鎴愬姛鐨� + listSuccess.Add(data); } - //鍔犲叆鎴愬姛 - if (result) + if (listSuccess.Count == 0) { - var sceneUI = new SceneUI - { - Name = sceneName, - Id = getSceneIdData.NewScenesId, - IconPath = sceneIconPath, - IconPathType = iconPathType, - AddSceneMemberDataList = commons - }; - //娣诲姞缂撳瓨 - sceneUI.Save(); - this.dicScenes[sceneUI.Id] = sceneUI; - if (i_room.ListSceneId.Contains(sceneUI.Id) == false) - { - i_room.ListSceneId.Add(sceneUI.Id); - i_room.Save(); - } - return 1; + //娣诲姞鎵ц鐩爣澶辫触 + string msg1 = Language.StringByID(R.MyInternationalizationString.uAddAdjustTargetFail); + this.ShowTipMsg(msg1); + return null; } - return 0; + //濡傛灉涓嶆槸鍏ㄩ儴鎴愬姛鐨勮瘽,鎻愮ず + if (listSuccess.Count != listAdjustTarget.Count) + { + //涓埆鎵ц鐩爣娣诲姞澶辫触 + string msg1 = Language.StringByID(R.MyInternationalizationString.uSomeAdjustTargetAddFail); + this.ShowTipMsg(msg1); + } + return listSuccess; } /// <summary> /// 娣诲姞鍦烘櫙(杩欎釜鍗曠函鍙敼鎴块棿) /// </summary> /// <param name="scene">Scene.</param> - public void AddScene(Room i_room, SceneUI scene) + public void AddSceneToRoom(Room i_room, SceneUI scene) { //娣诲姞缂撳瓨 if (i_room.ListSceneId.Contains(scene.Id) == false) @@ -199,6 +245,29 @@ i_room.ListSceneId.Add(scene.Id); i_room.Save(); } + } + + /// <summary> + /// 鏀瑰彉鍦烘櫙鎴块棿 + /// </summary> + /// <param name="scene">鍦烘櫙瀵硅薄</param> + /// <param name="newRoomId">鏂扮殑鎴块棿鐨処D</param> + public void ChangedSceneRoom(SceneUI scene, string newRoomId) + { + var room = HdlRoomLogic.Current.GetRoomBySceneId(scene.Id); + if (room != null) + { + //鎴块棿娌℃湁鏀瑰彉 + if (room.Id == newRoomId) + { + return; + } + //浠庢埧闂翠腑绉婚櫎缂撳瓨 + this.DeleteSceneFromRoom(room, scene); + } + //娣诲姞杩涙柊鎴块棿 + var newRoom = HdlRoomLogic.Current.GetRoomById(newRoomId); + this.AddSceneToRoom(newRoom, scene); } /// <summary> @@ -220,7 +289,7 @@ /// 鍒犻櫎鍦烘櫙(杩欎釜鍙Щ闄ゅ唴瀛�) /// </summary> /// <param name="scene"></param> - public void DeleteScene(Room i_room, SceneUI scene) + public void DeleteSceneFromRoom(Room i_room, SceneUI scene) { //绉婚櫎缂撳瓨 if (i_room.ListSceneId.Contains(scene.Id) == true) @@ -250,67 +319,120 @@ #region 鈻� 淇敼鍦烘櫙___________________________ /// <summary> - /// 淇敼鍦烘櫙璁惧 0澶辫触 1鎴愬姛 + /// 淇敼缃戝叧鐨勫満鏅� /// </summary> - /// <returns>The scene.</returns> - /// <param name="sceneUI">Scene user interface.</param> - /// <param name="sceneRemoveMemberData">Scene remove member data.</param> - /// <param name="addCommons">Add commons.</param> - public async Task<int> ModifyScene(SceneUI sceneUI, Scene.SceneRemoveMemberData sceneRemoveMemberData, List<Scene.AddSceneMemberData> addCommons) + /// <param name="sceneUI">鍦烘櫙瀵硅薄</param> + /// <param name="listAdjustTarget">鍏ㄩ儴鐨勬墽琛岀洰鏍�</param> + /// <returns></returns> + public async Task<bool> EditorSceneFromGateway(SceneUI sceneUI, List<Scene.DeviceListData> listAdjustTarget) { - bool result = true; - //绉婚櫎鎴愬憳 杩斿洖缁撴灉 - var removeSceneMemberResponseAllData = await ZigBee.Device.Scene.RemoveSceneMemberAsync(sceneRemoveMemberData); - if (removeSceneMemberResponseAllData == null || removeSceneMemberResponseAllData.removeSceneMemberResponseData == null) + //鍏堟竻绌哄叏閮ㄧ殑鎵ц鐩爣 + var deleteData = new Scene.SceneRemoveMemberData(); + var deleteTargetData = new List<Scene.RemoveSceneDeviceListInfo>(); + for (int i = 0; i < sceneUI.AdjustTargetList.Count; i++) { - return 0; - } - var removeSceneMemberResponseData = removeSceneMemberResponseAllData.removeSceneMemberResponseData; - if (removeSceneMemberResponseData == null) - { - return 0; - } - if (removeSceneMemberResponseData.Result != 0) - { - result = false; - } - //娣诲姞 - foreach (var addCommon in addCommons) - { - //娣诲姞鏂版垚鍛� - var addSceneMemberData = new ZigBee.Device.Scene.AddSceneMemberData + var data = sceneUI.AdjustTargetList[i]; + var removeData = new Scene.RemoveSceneDeviceListInfo(); + if (data.Type == 0) { - DeviceAddr = addCommon.DeviceAddr, - Type = addCommon.Type, - Epoint = addCommon.Epoint, - ScenesId = sceneUI.Id, - TaskList = addCommon.TaskList, - DelayTime = addCommon.DelayTime, - ElseScenesId = addCommon.ElseScenesId, - MemberNumber = addCommon.MemberNumber - }; - //娣诲姞鏂版垚鍛� 杩斿洖缁撴灉 - var addSceneMemberResponseAllData = await ZigBee.Device.Scene.AddSceneMemberAsync(addSceneMemberData); - if (addSceneMemberResponseAllData == null || addSceneMemberResponseAllData.addSceneMemberResponseData == null) - { - result = false; - System.Console.WriteLine("娣诲姞鍦烘櫙澶辫触"); - continue; + //璁惧 + removeData.Type = 0; + removeData.DeviceAddr = data.DeviceAddr; + removeData.Epoint = data.Epoint; + removeData.MemberNumber = data.MemberNumber; } - var addSceneMemberResponseData = addSceneMemberResponseAllData.addSceneMemberResponseData; - if (addSceneMemberResponseData == null && addSceneMemberResponseData.Result != 1) + else if (data.Type == 1) { - result = false; + //鍦烘櫙 + removeData.Type = 1; + removeData.ElseScenesId = data.ElseScenesId; + removeData.MemberNumber = data.MemberNumber; } + else + { + //寤舵椂 + removeData.Type = 2; + removeData.DelayTime = data.DelayTime; + removeData.MemberNumber = i + 1; + } + //鎷ユ湁鎴愬姛鐨� + deleteTargetData.Add(removeData); } - //鍔犲叆鎴愬姛 - if (result) + deleteData.DeviceList = deleteTargetData; + deleteData.ScenesId = sceneUI.Id; + //鎵ц娓呯┖ + var result = await Scene.RemoveSceneMemberAsync(deleteData); + if (result == null || result.removeSceneMemberResponseData == null) { - sceneUI.AddSceneMemberDataList = addCommons; - sceneUI.Save(); - return 1; + //鍒濆鍖栨墽琛岀洰鏍囧け璐� + string msg1 = Language.StringByID(R.MyInternationalizationString.uInitAdjustTargetFail); + //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg + msg1 = UserCenterLogic.CombineGatewayTimeOutMsg(msg1, result); + this.ShowTipMsg(msg1); + return false; } - return 0; + if (result.removeSceneMemberResponseData.Result != 0) + { + //鍒濆鍖栨墽琛岀洰鏍囧け璐� + string msg1 = Language.StringByID(R.MyInternationalizationString.uInitAdjustTargetFail); + this.ShowTipMsg(msg1); + return false; + } + //娓呯┖鍦烘櫙鐨勬墽琛岀洰鏍囧垪琛ㄧ殑缂撳瓨 + sceneUI.AdjustTargetList.Clear(); + + //鐒跺悗閲嶆柊娣诲姞 + var listSuccess = await this.AddTargetToScene(sceneUI.Id, listAdjustTarget); + if (listSuccess == null) + { + return false; + } + sceneUI.AdjustTargetList.AddRange(listSuccess); + sceneUI.Save(); + + return true; + } + + /// <summary> + /// 淇敼缃戝叧鐨勫満鏅悕绉� + /// </summary> + /// <param name="scene">鍦烘櫙瀵硅薄</param> + /// <param name="newName">鏂扮殑鍚嶅瓧</param> + /// <returns></returns> + public async Task<bool> EditorSceneNameFromGateway(SceneUI scene, string newName) + { + var result1 = await Scene.RenameSceneAsync(scene.Id, newName); + //鍏遍�氶敊璇娴� + string error = HdlCheckLogic.Current.CheckCommonErrorCode(result1); + if (error != null) + { + this.ShowErrorMsg(error); + return false; + } + if (result1 == null || result1.sceneRenameResponseData == null) + { + //淇敼鍦烘櫙鍚嶇О澶辫触 + string msg1 = Language.StringByID(R.MyInternationalizationString.uEditorSceneNameFail); + //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg + msg1 = UserCenterLogic.CombineGatewayTimeOutMsg(msg1, result1); + this.ShowTipMsg(msg1); + return false; + } + if (result1.sceneRenameResponseData.Result == 2) + { + //鐩爣鍦烘櫙涓嶅瓨鍦� + string msg1 = Language.StringByID(R.MyInternationalizationString.uTargetSceneIsNotExsit); + this.ShowTipMsg(msg1); + return false; + } + if (result1.sceneRenameResponseData.Result != 1) + { + //淇敼鍦烘櫙鍚嶇О澶辫触 + string msg1 = Language.StringByID(R.MyInternationalizationString.uEditorSceneNameFail); + this.ShowTipMsg(msg1); + return false; + } + return true; } #endregion @@ -550,6 +672,44 @@ #endregion + #region 鈻� 鑾峰彇鍦烘櫙鐨勬墽琛岀洰鏍囧垪琛╛____________ + + /// <summary> + /// 鑾峰彇鍦烘櫙鐨勬墽琛岀洰鏍囧垪琛� + /// </summary> + /// <param name="i_scene">鍦烘櫙瀵硅薄</param> + /// <returns></returns> + public async Task<List<Scene.DeviceListData>> GetAdjustTargetList(SceneUI i_scene) + { + var result = await Scene.GetSceneDeviceListAsync(i_scene.Id); + //鍏遍�氶敊璇娴� + string error = HdlCheckLogic.Current.CheckCommonErrorCode(result); + if (error != null) + { + this.ShowErrorMsg(error); + return null; + } + if (result == null || result.getSceneDeviceListInfo == null) + { + //鑾峰彇鎵ц鐩爣澶辫触 + string msg = Language.StringByID(R.MyInternationalizationString.uGetAdjustTargetFail); + //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg + msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result); + + this.ShowTipMsg(msg); + return null; + } + i_scene.AdjustTargetList = result.getSceneDeviceListInfo.DeviceList; + //淇濆瓨缂撳瓨 + i_scene.Save(false); + + var listData = new List<Scene.DeviceListData>(); + listData.AddRange(result.getSceneDeviceListInfo.DeviceList); + + return listData; + } + #endregion + #region 鈻� 寤舵椂鏃堕棿绾跨▼_______________________ /// <summary> @@ -599,6 +759,33 @@ } return listSceneFile; } + + /// <summary> + /// 鏄剧ず閿欒淇℃伅绐楀彛 + /// </summary> + /// <param name="msg"></param> + private void ShowErrorMsg(string msg) + { + Application.RunOnMainThread(() => + { + var contr = new ShowMsgControl(ShowMsgType.Error, msg); + contr.Show(); + }); + } + + /// <summary> + /// 鏄剧ずTip淇℃伅绐楀彛 + /// </summary> + /// <param name="msg"></param> + private void ShowTipMsg(string msg) + { + Application.RunOnMainThread(() => + { + var contr = new ShowMsgControl(ShowMsgType.Tip, msg); + contr.Show(); + }); + } + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs index 5c673dc..095152f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs @@ -655,7 +655,7 @@ var tempUi = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.SceneUI>(valueData); //鑾峰彇鍦烘櫙閲岄潰鐨勫叏閮ㄧ洰鏍�(2019.11.05杩藉姞鎿嶄綔,鏈夊彲鑳介偅涓澶囨槸鐢卞満鏅祵濂楁潵鐨�,鎵�浠ュ畠鏈夊彲鑳戒笉灞炰簬浠讳綍鎴块棿) - foreach (var data in tempUi.AddSceneMemberDataList) + foreach (var data in tempUi.AdjustTargetList) { //璁惧 if (data.Type == 0) @@ -952,7 +952,7 @@ /// <returns></returns> public void GetSceneDeviceList(Common.SceneUI scene, HashSet<string> listCheck, List<Common.SceneUI> listSceneUI, List<CommonDevice> listDevice) { - foreach (var data in scene.AddSceneMemberDataList) + foreach (var data in scene.AdjustTargetList) { //璁惧 if (data.Type == 0) @@ -1698,7 +1698,7 @@ /// <param name="listBindScene">缁戝畾鐨勫満鏅璞�</param> private void GetSceneBindListKeys(Common.SceneUI scene, ref Dictionary<string, string> dicDeviceKeys, ref List<SceneUI> listBindScene) { - foreach (var data in scene.AddSceneMemberDataList) + foreach (var data in scene.AdjustTargetList) { //璁惧 if (data.Type == 0) @@ -1729,7 +1729,7 @@ /// <param name="listKeys">涓婚敭鍒楄〃(璁惧鍜屽満鏅�)</param> private void GetSceneBindListKeys(Common.SceneUI scene, ref HashSet<string> listKeys) { - foreach (var data in scene.AddSceneMemberDataList) + foreach (var data in scene.AdjustTargetList) { //璁惧 if (data.Type == 0) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs index 0ba8540..bb2ab6f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs @@ -428,8 +428,13 @@ var actionForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1); if (actionForm != null && actionForm is CommonFormBase) { - //璋冪敤鐣岄潰閲嶆柊婵�娲荤殑鍑芥暟 - CallFormActionAgainEvent(form, index); + string formId = ((CommonFormBase)actionForm).FormID; + //瀵瑰簲寰愭缁ф壙浜嗗簳灞傦紝浣嗘槸涓嶅垵濮嬪寲鏁版嵁鐨勯棶棰� + if (UserCenterResourse.listActionFormId.Contains(formId) == true) + { + //璋冪敤鐣岄潰閲嶆柊婵�娲荤殑鍑芥暟 + CallFormActionAgainEvent(form, index); + } } else if (actionForm != null && actionForm is UserView.UserPage) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs index da41e2c..6959990 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs @@ -30,9 +30,12 @@ /// </summary> public static int TopFrameHeight = Application.GetRealHeight(110); /// <summary> - /// 鐢婚潰BodyFrameLayout鐨勯珮搴�(楂樺害锛�1736) + /// 鐢婚潰BodyFrameLayout鐨勯珮搴�(涓嶈兘鐩存帴鎸囧畾鏁板��,涓嶇劧鏈夊彲鑳戒細鍑虹幇璇樊,瀵艰嚧鏃犳硶閾烘弧) /// </summary> - public static int BodyFrameHeight = Application.GetRealHeight(1920 - 184); + public static int BodyFrameHeight + { + get { return UserView.HomePage.Instance.Height - Application.GetRealHeight(184); } + } /// <summary> /// 鐢婚潰BottomFrameLayout鐨勯珮搴�(楂樺害锛�141 娉細姝ゅ彉閲忓湪涓汉涓績涓嶄娇鐢�) /// </summary> @@ -61,5 +64,9 @@ /// 搴曠嚎楂樺害(鐩存帴鎸囧畾涓嶉渶瑕佸啀娆¤绠楃殑鐪熷疄鍊�) /// </summary> public static int BottomLineHeight = 1; + /// <summary> + /// 寰愭鐨勯棬閿佺晫闈㈡槸鍚︽槸鎵撳紑鐨勭姸鎬� + /// </summary> + public static bool IsDoorLockPageOpen = false; } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs index 1477384..9c6b433 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs @@ -20,6 +20,10 @@ /// </summary> private VerticalListControl listview = null; /// <summary> + /// 璁惧澶囨敞鎺т欢 + /// </summary> + private FrameCaptionInputControl btnNote = null; + /// <summary> /// 淇濆瓨榛樿鍚嶅瓧(涓昏閽堝娌℃湁淇敼鍚嶅瓧鐨勬椂鍊欙紝蹇呴』瑕佺粰涓�涓粯璁ゅ悕瀛楃粰缃戝叧) /// </summary> private string saveDefultName = string.Empty; @@ -49,6 +53,8 @@ //璁剧疆鍏ㄩ儴鍥炶矾鐨勯粯璁ゅ悕瀛� this.SetAllEpointName(); + //淇濆瓨闂ㄩ攣鏃堕棿 + this.SaveDoorTime(); } /// <summary> @@ -95,7 +101,7 @@ //璁惧澶囨敞 string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote); string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]); - var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2); + this.btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2); listview.AddChidren(btnNote); btnNote.InitControl(); //鍒掔嚎 @@ -173,6 +179,9 @@ btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uMoreSettion); btnHelp.ButtonClickEvent += (sender, e) => { + //鏀瑰悕瀛� + btnNote.txtInput.FinishInputEvent(); + var form = new DeviceMacInfoEditorForm(); form.AddForm(this.listNewDevice[0].DeviceAddr); }; @@ -226,6 +235,8 @@ detailBackFrame.AddChidren(btnFinish); btnFinish.MouseUpEventHandler += (sender, e) => { + //鏀瑰悕瀛� + btnNote.txtInput.FinishInputEvent(); //鍏抽棴鑷韩 this.CloseForm(); }; @@ -271,6 +282,24 @@ } } + /// <summary> + /// 淇濆瓨闂ㄩ攣鏃堕棿 + /// </summary> + private async void SaveDoorTime() + { + //濡傛灉鏄棬閿� + if (this.listNewDevice[0].Type == DeviceType.DoorLock) + { + var doorLock = this.listNewDevice[0] as ZigBee.Device.DoorLock; + //1銆佸叆缃戝悗鍏堣幏鍙栭棬閿佸湪缃戝叧涓殑鏃跺尯鏃堕棿 + var curDateTime = DoorLock.DoorLockCommonInfo.GetDoorLockZoneTime(); + //2銆佸皢鏃堕棿璁剧疆鍒扮綉鍏充腑 + var dateTime = new DateTime(curDateTime.Year, curDateTime.Month, curDateTime.Day, curDateTime.Hour, curDateTime.Minute, curDateTime.Second); + var setTimestamp = DoorLock.DoorLockCommonInfo.GetUnixTimeStamp(dateTime); + await doorLock.RectifyDoorLockTimeAsync(int.Parse(setTimestamp)); + } + } + #endregion #region 鈻� 鐢婚潰鍏抽棴___________________________ diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs index e21099e..8b0ad83 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs @@ -376,8 +376,6 @@ frameBorder.Width = Application.GetRealWidth(887); frameBorder.Height = Application.GetRealHeight(423); frameBorder.Radius = (uint)Application.GetRealHeight(6); - frameBorder.BorderWidth = 1; - frameBorder.BorderColor = 0xffd0d0d0; bodyFrameLayout.AddChidren(frameBorder); var frameBack = new FrameLayout(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs index 04fb935..0f7a798 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs @@ -275,6 +275,13 @@ rowMenu.frameTable.ButtonClickEvent += (sender, e) => { + //寮哄埗璺宠浆鐪熷疄璁惧鐣岄潰 + if (UserCenterResourse.HideOption.GotoRealDeviceForm == 1) + { + var form2 = new DeviceAddSuccessForm(); + form2.AddForm(deviceMac); + return; + } btnNew.Visible = false; var form = new DeviceMacInfoEditorForm(); form.AddForm(deviceMac); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs index 29791bd..2dba546 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -1184,18 +1184,8 @@ { //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘(鎷跨鐐规渶灏忕殑閭d釜鍥炶矾鍘诲畾浣�) bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]); - if (this.deviceEnumInfo.BeloneType == DeviceBeloneType.A鏅鸿兘闂ㄩ攣) - { - canTest = false; - } - else if (this.deviceEnumInfo.BeloneType == DeviceBeloneType.A浼犳劅鍣� - && this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir) - { - //浼犳劅鍣ㄩ櫎浜哖ir閮芥病鏈夊畾浣嶅姛鑳� - canTest = false; - } + var frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1); - string deviceMenu = string.Empty; if (canTest == true) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs index 06e5310..f478b5c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs @@ -88,6 +88,15 @@ unSelectPic = "Device/ButtonPanelFangyueEight.png"; this.AddMenuRow(objectText, unSelectPic, "PanelFangyueEightButtonDirectionForm"); + //鏂规偊鏂伴灏忔ā鍧�,鍥剧墖鍜�3璺户鐢靛櫒灏忔ā鍧楃浉鍚� + objectText = Language.StringByID(R.MyInternationalizationString.DeviceModelId2310); + unSelectPic = "Device/RelayThreeLoad.png"; + this.AddMenuRow(objectText, unSelectPic, "PanelFangyueFreshAirModulDirectionForm"); + //鏂规偊鏂伴闈㈡澘 + objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId250); + unSelectPic = "Device/ButtonPanelFangyueFreshAir.png"; + this.AddMenuRow(objectText, unSelectPic, "PanelFangyueFreshAirDirectionForm"); + //鏂规偊鐜闈㈡澘 objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId253); unSelectPic = "Device/ButtonPanelFangyueEnvironment.png"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs index f191903..5fe1158 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs @@ -32,7 +32,7 @@ framePic.Y = Application.GetRealHeight(144); bodyFrameLayout.AddChidren(framePic); var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); - btnPic.UnSelectedImagePath = "Instruct/PanelFreshAirModul.png"; + btnPic.UnSelectedImagePath = "Instruct/RelayThreeLoad.png"; framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏棯鐑� diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs index faf2482..c309fd3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs @@ -42,9 +42,13 @@ /// </summary> private List<int> listSearchLockId = new List<int>() { -1 }; /// <summary> - /// 鍏朵粬娑堟伅鐨勪富閿� + /// 鍏朵粬娑堟伅鐨勪富閿�,瀹冨瓨鍦ㄥ彟澶栫殑涓�寮犳暟鎹簱琛ㄤ腑 /// </summary> - private List<string> listOtherId = new List<string>(); + private List<string> listOtherMsgId = new List<string>(); + /// <summary> + /// 鏃犳硶璇嗗埆鐨勫紑閿佽褰曠殑鐢ㄦ埛ID(鍥犱负閭d釜瀵嗙爜鏈夊彲鑳芥病鏈夊垎閰嶇粰鎴愬憳) + /// </summary> + private List<string> listOtherUserId = new List<string>(); #endregion @@ -80,8 +84,11 @@ //纭娓呯┖褰撳墠璁板綍锛� this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uConfirmClearNowLog), () => { - //娓呯┖鎵�鏈夎褰� - this.ClearAllHistoryLog(); + HdlThreadLogic.Current.RunThread(() => + { + //娓呯┖鎵�鏈夎褰� + this.ClearAllHistoryLog(); + }); }); }); }; @@ -383,7 +390,7 @@ //浜虹墿 string perName = dicName.ContainsKey(historyInfo.CloudAccountId) == true ? dicName[historyInfo.CloudAccountId] : Language.StringByID(R.MyInternationalizationString.uOther); - var btnpersion = frameTable.AddBottomView(perName, 600); + frameTable.AddBottomView(perName, 600); //鏃堕棿 if (this.dateFromControl.dateValue == this.dateToControl.dateValue) @@ -445,40 +452,117 @@ //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁� var pra = this.GetDbInterfacePra(); - int nowPage = 0; + //娓呯┖涓婁竴娆$殑鍏朵粬ID + this.listOtherMsgId = new List<string>(); + this.listOtherUserId = new List<string>(); + + //鍏ㄩ儴鎴愬憳淇℃伅 + var dicMemberName = new Dictionary<string, string>(); + for (int i = 0; i < listMenberInfo.Count; i++) + { + dicMemberName.Add(listMenberInfo[i].SubAccountDistributedMark, string.IsNullOrEmpty(listMenberInfo[i].UserName) == false ? listMenberInfo[i].UserName : listMenberInfo[i].Account); + } + + //鑾峰彇闂ㄩ攣鐨勬墦寮�鍜屽叧闂褰� + var listAllLog = await this.GetDoorOpenHistoryLog(pra, dicMemberName); + //鑾峰彇闂ㄩ攣鐨勫叾浠栬褰� + var listOtherLog = await this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd); + listAllLog.AddRange(listOtherLog); + + //鎺掑簭涓�涓� + var dicAllData = new Dictionary<string, List<HistoryInfo>>(); + var listSortTime = new List<string>(); + //鏄惁鍖呭惈鍏朵粬 + bool getOtherFlage = this.listSearchUserId.Contains(""); + foreach (var data in listAllLog) + { + //濡傛灉鍗曠嫭鎸囧畾鏈夎璐﹀彿,鍙互鏄剧ず + if (this.listSearchUserId.Contains(data.CloudAccountId) == false) + { + //濡傛灉杩欎釜璐﹀彿娌℃湁鎸囧畾,骞朵笖鎸囧畾鏄剧ず鍏朵粬鐨勮瘽,骞朵笖鏃犳硶璇嗗埆杩欎釜鐢ㄦ埛ID鎵嶆樉绀� + if (getOtherFlage == true && dicMemberName.ContainsKey(data.CloudAccountId) == true) + { + continue; + } + } + //鎸夋椂闂村垎缁� + if (dicAllData.ContainsKey(data.UnlockTime) == false) + { + dicAllData[data.UnlockTime] = new List<HistoryInfo>(); + listSortTime.Add(data.UnlockTime); + } + dicAllData[data.UnlockTime].Add(data); + } + + //鎵ц鎺掑簭,鏃堕棿澶х殑鍦ㄥ墠闈� + listSortTime.Sort(); + var listSortLog = new List<HistoryInfo>(); + for (int i = listSortTime.Count - 1; i >= 0; i--) + { + listSortLog.AddRange(dicAllData[listSortTime[i]]); + } + + return listSortLog; + } + + /// <summary> + /// 鑾峰彇闂ㄩ攣鐨勬墦寮�鍜屽叧闂褰� + /// </summary> + /// <param name="i_pra"></param> + /// <returns></returns> + private async Task<List<HistoryInfo>> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra, Dictionary<string, string> dicMemberName) + { var listLog = new List<HistoryInfo>(); + + int nowPage = 0; while (true) { //璁块棶浜戠 - var result = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, pra); + var result = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, i_pra); if (result == null) { return null; } var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetHistoryDataResult>(result); - listLog.AddRange(dataInfo.PageData); + foreach (var data in dataInfo.PageData) + { + if (dicMemberName.ContainsKey(data.CloudAccountId) == false + && this.listOtherUserId.Contains(data.CloudAccountId) == false) + { + //鏀堕泦鏃犳硶璇嗗埆鐨勭敤鎴稩D + this.listOtherUserId.Add(data.CloudAccountId); + } + listLog.Add(data); + } + if (dataInfo.HasNextPage == false) { break; } //鑾峰彇涓嬩竴椤� nowPage++; - pra.PageSetting.Page = nowPage; + i_pra.PageSetting.Page = nowPage; } - //鎺掑簭涓�涓� - var dic = new Dictionary<string, List<HistoryInfo>>(); - var listSort = new List<string>(); - //娓呯┖涓婁竴娆$殑鍏朵粬ID - this.listOtherId = new List<string>(); + return listLog; + } + + /// <summary> + /// 鑾峰彇闂ㄩ攣鐨勫叾浠栬褰� + /// </summary> + /// <returns></returns> + private async Task<List<HistoryInfo>> GetDoorOtherHistoryLog(string beginTime, string endTime) + { + var listLog = new List<HistoryInfo>(); + //鏄惁鍖呭惈鍏朵粬 - bool flage = this.listSearchUserId.Contains("") || this.listSearchUserId.Contains("-1"); - if (flage == true) + bool getOtherFlage = this.listSearchUserId.Contains("") || this.listSearchUserId.Contains("-1"); + if (getOtherFlage == true) { //鍘昏幏鍙栧叾浠栦俊鎭� var pra2 = new MessageInfoPra(); - pra2.BeginTime = pra.UnlockTimeBegin; - pra2.EndTime = pra.UnlockTimeEnd; + pra2.BeginTime = beginTime; + pra2.EndTime = endTime; pra2.Topic = "/Alarms/SendAlarmInform"; pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2); @@ -487,53 +571,34 @@ return null; } var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); + string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint; foreach (var myInfo in dataInfo2.PageData) { - var data = new HistoryInfo(); - if (dic.ContainsKey(myInfo.CreatedOnUtc) == false) - { - dic[myInfo.CreatedOnUtc] = new List<HistoryInfo>(); - listSort.Add(myInfo.CreatedOnUtc); - } - //璁惧瀵硅薄 var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson); - data.DeviceMac = jobject.Value<string>("DeviceAddr"); - data.DeviceEpoint = jobject.Value<int>("Epoint"); + string deviceAddr = jobject.Value<string>("DeviceAddr"); + int deviceEpoint = jobject.Value<int>("Epoint"); + if (doorKey != deviceAddr + "_" + deviceEpoint) + { + //涓嶆槸鍚屼竴涓棬閿佺殑璁板綍 + continue; + } + + var data = new HistoryInfo(); + data.DeviceMac = deviceAddr; + data.DeviceEpoint = deviceEpoint; //娑堟伅 var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(jobject); data.AlarmMsg = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered); - dic[myInfo.CreatedOnUtc].Add(data); //鏃堕棿 data.UnlockTime = myInfo.CreatedOnUtc; - this.listOtherId.Add(myInfo.Id); + listLog.Add(data); + this.listOtherMsgId.Add(myInfo.Id); } - } - foreach (var data in listLog) - { - if (flage == false && string.IsNullOrEmpty(data.CloudAccountId) == true) - { - //娌℃湁鎸囧畾鏄剧ず鍏朵粬 - continue; - } - if (dic.ContainsKey(data.UnlockTime) == false) - { - dic[data.UnlockTime] = new List<HistoryInfo>(); - listSort.Add(data.UnlockTime); - } - dic[data.UnlockTime].Add(data); } - //鎵ц鎺掑簭,鏃堕棿澶х殑鍦ㄥ墠闈� - listSort.Sort(); - var listSortLog = new List<HistoryInfo>(); - for (int i = listSort.Count - 1; i >= 0; i--) - { - listSortLog.AddRange(dic[listSort[i]]); - } - - return listSortLog; + return listLog; } #endregion @@ -547,8 +612,27 @@ { //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁� var pra = this.GetDbInterfacePra(); + if (listSearchUserId.Contains("") == true) + { + //濡傛灉鎸囧畾鏈夊叾浠�,鍒欑敤鎴稩D閲嶆柊璁剧疆 + pra.CloudAccountIdArr = new List<string>(); + pra.CloudAccountIdArr.AddRange(listSearchUserId); + pra.CloudAccountIdArr.Remove(""); + if (this.listOtherUserId.Count > 0) + { + pra.CloudAccountIdArr.AddRange(listOtherUserId); + } + else + { + //杩欎竴姝ュ緢閲嶈,涓嶇劧鏈夊彲鑳藉崟鐙�夋嫨鍏朵粬鐨勬椂鍊� + //鍦ㄦ病鏈夋暟鎹殑鎯呭喌涓�,浼氭竻绌烘帀鍏ㄩ儴鐨勬暟鎹� + pra.CloudAccountIdArr.Add("other"); + } + } + //鎵撳紑杩涘害鏉� this.ShowProgressBar(); + var result = await UserCenterLogic.GetResultStatuByRequestHttps("DoorLock/ClearDoorLockHistory", true, pra); if (result == false) { @@ -556,13 +640,13 @@ } //鍒犻櫎鍏朵粬娑堟伅 - if (listOtherId.Count > 0) + if (listOtherMsgId.Count > 0) { var pra2 = new MessageReadStatuPra(); pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - for (int i = 0; i < listOtherId.Count; i++) + for (int i = 0; i < listOtherMsgId.Count; i++) { - pra2.Id = listOtherId[i]; + pra2.Id = listOtherMsgId[i]; result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra2); if (result == false) { @@ -576,11 +660,14 @@ { return; } - this.listView.frameTable.RemoveAll(); - listView.frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3); //娓呯┖ - this.listOtherId = new List<string>(); + this.listOtherMsgId = new List<string>(); + HdlThreadLogic.Current.RunMain(() => + { + this.listView.frameTable.RemoveAll(); + listView.frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3); + }); } #endregion @@ -596,23 +683,16 @@ DateTime dateFrom = new DateTime(dateFromControl.Year, dateFromControl.Month, dateFromControl.Day, 0, 0, 0); DateTime dateTo = new DateTime(dateToControl.Year, dateToControl.Month, dateToControl.Day, 23, 59, 59); - List<string> listUser = new List<string>(); - if (listSearchUserId.Count == 1 && listSearchUserId[0] == "") + List<string> listUser = null; + //涓�鏃︽寚瀹氫簡鍏朵粬,鍒欓渶瑕佸叏閮ㄨ鍙�,鍥犱负鏈変簺寮�閿侊紝瀹冪敤鐨勫瘑鐮佸苟娌℃湁鍒嗛厤缁欐垚鍛� + if (listSearchUserId.Contains("-1") == true || listSearchUserId.Contains("") == true) { - //濡傛灉鍗曠函鐨勫彧鏄�夋嫨鍏朵粬,鍒欒妫�绱㈡潯浠朵笉鎴愮珛鍗冲彲 - listUser.Add("鍏朵粬"); - } - else if (listSearchUserId.Contains("-1") == true) - { - //鍏ㄩ�� - for (int i = 0; i < listMenberInfo.Count; i++) - { - listUser.Add(listMenberInfo[i].SubAccountDistributedMark); - } + //鍏ㄩ�夊嵆涓篘ull } else { //鎸囧畾鐢ㄦ埛 + listUser = new List<string>(); listUser.AddRange(listSearchUserId); //绉婚櫎鍏朵粬,鍥犱负浜戠鍥哄畾浼氱粰 listUser.Remove(""); @@ -627,12 +707,13 @@ } var pra = new GetHistoryDataPra(); + pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString(); + pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString(); pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint; pra.CloudAccountIdArr = listUser; pra.OpenLockModeArr = listLock; - pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString(); - pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString(); + return pra; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs index 79d580c..bb77abd 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs @@ -193,9 +193,10 @@ //灞曞紑鎴栬�呯缉灏忕殑楂樺害 var value = Application.GetRealHeight(443); frameBack.Height += value; - //娣诲姞鎺ヨ繎鎰熷簲 - this.AddProximitySensorsRow(frameBack); } + + //娣诲姞鎺ヨ繎鎰熷簲 + this.AddProximitySensorsRow(frameBack); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs index cb4f3ab..cc5d10d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs @@ -75,37 +75,41 @@ { //娣诲姞鑺傝兘妯″紡鎺т欢 this.AddEnergyConservationRow(); + //娣诲姞灞忓箷浜害绾у埆鎺т欢 this.AddScreenBrightnesLevelControl(); //娣诲姞鑳屽厜鐏寒搴︽帶浠� this.AddBackLightControl(); - }); - //瀹瑰櫒琛ュ厖 - FinishInitControl(listview); + this.FinishInitControl(listview, energyModeInfo.enable); - //淇濆瓨 - var btnSave = new BottomClickButton(); - btnSave.TextID = R.MyInternationalizationString.uSave; - bodyFrameLayout.AddChidren(btnSave); - btnSave.ButtonClickEvent += (sender, e) => - { - //淇濆瓨闈㈡澘鏁版嵁 - this.SavePanelData(); - }; + //淇濆瓨 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uSave; + bodyFrameLayout.AddChidren(btnSave); + btnSave.ButtonClickEvent += (sender, e) => + { + //淇濆瓨闈㈡澘鏁版嵁 + this.SavePanelData(); + }; + }); } #endregion - #region 鈻� 灞忓箷浜害绾у埆_______________________ - + #region 鈻� 灞忓箷浜害绾у埆_______________________ /// <summary> /// 娣诲姞灞忓箷浜害绾у埆鎺т欢 /// </summary> private void AddScreenBrightnesLevelControl() { + var btnEspace = new NormalViewControl(600, 58, true); + btnEspace.X = ControlCommonResourse.XXLeft; + listview.AddChidren(btnEspace); + var frameBack = new FrameLayout(); frameBack.Height = Application.GetRealHeight(429); + frameBack.Y = Application.GetRealHeight(58); frameBack.BackgroundColor = UserCenterColor.Current.White; listview.AddChidren(frameBack); @@ -172,7 +176,6 @@ btnTemp2.Text = "5"; frameBack.AddChidren(btnTemp2); } - #endregion #region 鈻� 鑳屽厜鐏寒搴________________________ @@ -182,6 +185,10 @@ /// </summary> private void AddBackLightControl() { + var btnEspace = new NormalViewControl(600, 58, true); + btnEspace.X = ControlCommonResourse.XXLeft; + listview.AddChidren(btnEspace); + //鑳屾櫙 var frameBack = new FrameLayout(); frameBack.Y = Application.GetRealHeight(490); @@ -310,8 +317,7 @@ #endregion - #region 鈻� 鑺傝兘妯″紡琛宊________________________ - + #region 鈻� 鑺傝兘妯″紡琛宊________________________ /// <summary> /// 娣诲姞鑺傝兘妯″紡琛� /// </summary> @@ -402,9 +408,9 @@ //灞曞紑鎴栬�呯缉灏忕殑楂樺害 var value = Application.GetRealHeight(443); frameBack.Height += value; - //娣诲姞鎺ヨ繎鎰熷簲 - this.AddProximitySensorsRow(frameBack); - } + } + //娣诲姞鎺ヨ繎鎰熷簲 + this.AddProximitySensorsRow(frameBack); } #endregion @@ -498,37 +504,39 @@ private async void SavePanelData() { this.ShowProgressBar(); - //浜害璋冭妭鏇存敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) - var result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); - if (result == false) - { - this.CloseProgressBar(); - return; - } //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) //璁惧鍚屼簨璇撮粯璁ゅ幓绉掓椂闂达紝杩欐牱鎺ヨ繎鎰熷簲鍔熻兘鎵嶅悎鐞� energyModeInfo.time = 1; - result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); + var result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); if (result == false) { this.CloseProgressBar(); return; } - //鎺ヨ繎淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) + //鎺ヨ繎鎰熷簲(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) result = await HdlDevicePanelLogic.Current.SetProximitySensorStatus(panelDevice, proximitySensorsInfo.enable); if (result == false) { this.CloseProgressBar(); return; } + + //浜害璋冭妭鏇存敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) + //var result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); + //if (result == false) + //{ + // this.CloseProgressBar(); + // return; + //} + //璁剧疆鎸夐敭闈㈡澘鎸囧畾绔偣鐨勩�愭寚绀虹伅寮�鍏抽鑹层�戠殑淇℃伅 - result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData); - this.CloseProgressBar(); - if (result == false) - { - return; - } + //result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData); + //this.CloseProgressBar(); + //if (result == false) + //{ + // return; + //} //鍏抽棴鑷韩 this.CloseForm(); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs index 17e698e..c4a3719 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs @@ -92,10 +92,12 @@ rowNewWind.AddBottomLine(); //鍙崇澶� rowNewWind.AddRightArrow(); - var btnNewWindStatu = rowNewWind.AddMostRightView("鏂伴1", 700); + var msg = Language.StringByID(R.MyInternationalizationString.ReshAirRead); + // 鍥炶皟鏂伴涓暟 + var btnNewWindStatu = rowNewWind.AddMostRightView(msg + 2, 700); rowNewWind.ButtonClickEvent += (sender, e) => { - var form = new PanelFangyueEnvironmentTargetForm(); + var form = new PanelFangyueFreshAirTargetForm(); form.AddForm(this.deviceObj, string.Empty, 3); }; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs new file mode 100755 index 0000000..4be90e7 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs @@ -0,0 +1,297 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DevicePanel +{ + public class PanelFangyueFreshAirTargetForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鍒楄〃鎺т欢 + /// </summary> + private VerticalListControl listView = null; + /// <summary> + /// 鐩爣璁惧 + /// </summary> + private CommonDevice deviceTarget = null; + /// <summary> + /// 缁戝畾鐨勭洰鏍囩殑涓婚敭(鍙兘缁戝畾涓�涓�) + /// </summary> + private string bindTargetKey = null; + /// <summary> + /// 褰撳墠閫夋嫨鐨勬ゼ灞侷D + /// </summary> + private string nowSelectFloorId = string.Empty; + /// <summary> + /// 1锛氱┖璋冪洰鏍� 2锛氬湴鏆栫洰鏍� 3锛氭柊椋庣洰鏍� + /// </summary> + private int deviceDiv = -1; + /// <summary> + /// 鍙互鏄剧ず鐨勮澶囧璞� (Keys:鎴块棿ID) + /// </summary> + private Dictionary<string, List<CommonDevice>> dicShowDevice = new Dictionary<string, List<CommonDevice>>(); + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_deviceTarget">鐩爣璁惧</param> + /// <param name="i_bindTargetKey">缁戝畾鐨勭洰鏍囩殑涓婚敭(鍙兘缁戝畾涓�涓�)</param> + /// <param name="i_div">1锛歅M2.5浼犳劅鍣� 2锛氭柊椋庣洰鏍�</param> + public void ShowForm(CommonDevice i_deviceTarget, string i_bindTargetKey, int i_div) + { + this.deviceTarget = i_deviceTarget; + this.bindTargetKey = i_bindTargetKey; + this.deviceDiv = i_div; + + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uNewWindTarget)); + + //鍒濆鍖栧彸涓婅鐨勬帶浠� + this.InitTopRightMenuControl(); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + HdlThreadLogic.Current.RunThread(() => + { + var listRoom = HdlRoomLogic.Current.GetFloorSortRoom(this.nowSelectFloorId, false); + var listDataRoom = new List<Common.Room>(); + for (int i = 0; i < listRoom.Count; i++) + { + //妫�娴嬭兘鍚︽樉绀鸿鎴块棿 + if (this.CheckCanShowRoom(listRoom[i]) == true) + { + listDataRoom.Add(listRoom[i]); + } + } + + HdlThreadLogic.Current.RunMain(() => + { + if (listDataRoom.Count > 0) + { + //鍒濆鍖栨埧闂村拰璁惧鍒楄〃 + this.InitRoomAndDeviceRow(listDataRoom); + } + else + { + //濡傛灉娌℃湁鍙互娣诲姞鐨勭洰鏍� + bodyFrameLayout.RemoveAll(); + this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uNotHadAddTarget), "Item/NotShardPic.png", 383, 279); + } + }); + }); + } + + /// <summary> + /// 鍒濆鍖栧彸涓婅鐨勬帶浠� + /// </summary> + private void InitTopRightMenuControl() + { + //鑾峰彇妤煎眰 + var dicFloor = HdlRoomLogic.Current.GetFloorSortList(); + if (dicFloor.Count == 0) + { + return; + } + var btnIconContr = new MostRightIconControl(69, 69); + btnIconContr.UnSelectedImagePath = "Item/Drop_Down.png"; + topFrameLayout.AddChidren(btnIconContr); + btnIconContr.InitControl(); + + var btnFloor = new NormalViewControl(300, 69, true); + btnFloor.Gravity = Gravity.CenterVertical; + btnFloor.X = btnIconContr.X + btnIconContr.btnIcon.X - Application.GetRealWidth(300); + btnFloor.TextAlignment = TextAlignment.CenterRight; + topFrameLayout.AddChidren(btnFloor); + + foreach (var floorId in dicFloor.Keys) + { + //绗竴涓ゼ灞� + this.nowSelectFloorId = floorId; + btnFloor.Text = dicFloor[floorId]; + break; + } + + btnIconContr.ButtonClickEvent += (sender, e) => + { + //妤煎眰鑿滃崟 + var contr = new TopRightMenuControl(dicFloor.Count, 2, Language.StringByID(R.MyInternationalizationString.SelectFloor)); + foreach (var floorId in dicFloor.Keys) + { + contr.AddRowMenu(dicFloor[floorId], "Floor/Floor.png", "Floor/FloorSelected.png", () => + { + //璁板綍璧烽�夋嫨鐨処D + this.nowSelectFloorId = floorId; + this.bindTargetKey = string.Empty; + + btnFloor.Text = dicFloor[this.nowSelectFloorId]; + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + }); + } + }; + } + + #endregion + + #region 鈻� 鎴块棿鍜岃澶囧垪琛╛____________________ + + /// <summary> + /// 鍒濆鍖栨埧闂村拰璁惧鍒楄〃 + /// </summary> + /// <param name="listRoom">鍙互鏄剧ず鐨勬埧闂村璞�</param> + private void InitRoomAndDeviceRow(List<Common.Room> listRoom) + { + //鎴块棿鍒楄〃鎺т欢 + var roomContr = new RoomDeviceGroupMenuControl(listRoom); + bodyFrameLayout.AddChidren(roomContr); + + //鍒楄〃鎺т欢 + this.listView = new VerticalListControl(23); + listView.BackgroundColor = UserCenterColor.Current.White; + listView.Height = bodyFrameLayout.Height - roomContr.Height; + listView.Y = roomContr.Bottom; + bodyFrameLayout.AddChidren(listView); + + //淇濆瓨 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uSave; + bodyFrameLayout.AddChidren(btnSave); + btnSave.ButtonClickEvent += (sender, e) => + { + //淇濆瓨鐩爣璁惧 + this.SaveTargetDevice(); + }; + + roomContr.SelectRoomEvent += (selectRoom) => + { + HdlThreadLogic.Current.RunMainInThread(() => + { + //娣诲姞璁惧琛� + this.AddDeviceRow(selectRoom.Id); + }); + }; + //鎵ц鍒濆鍖栨埧闂存帶浠� + roomContr.InitControl(); + } + + /// <summary> + /// 娣诲姞璁惧琛� + /// </summary> + /// <param name="roomId"></param> + private void AddDeviceRow(string roomId) + { + //鍏堟竻绌� + this.listView.RemoveAll(); + listView.RecoverHeight(); + + DeviceSimpleSelectControl oldSelectContr = null; + var listDevice = this.dicShowDevice[roomId]; + //妫�鏌ョ鍚堢殑璁惧 + + for (int i = 0; i < listDevice.Count; i++) + { + string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(listDevice[i]); + var contr = new DeviceSimpleSelectControl(listDevice[i], false, this.listView.rowSpace / 2); + listView.AddChidren(contr); + contr.InitControl(); + if (i != listDevice.Count - 1) + { + //搴曠嚎 + contr.AddBottomLine(); + } + contr.ButtonClickEvent += (sender, e) => + { + contr.IsSelected = !contr.IsSelected; + //閫夋嫨浜嗗埆鐨勮澶� + if (contr.IsSelected == true) + { + if (oldSelectContr != null) + { + oldSelectContr.IsSelected = false; + } + oldSelectContr = contr; + this.bindTargetKey = mainKey; + } + //鍙栨秷閫夋嫨 + else + { + oldSelectContr = null; + this.bindTargetKey = string.Empty; + } + }; + if (this.bindTargetKey == mainKey) + { + //杩欎釜鏄畠涔嬪墠缁戝畾鐨勮澶� + contr.ButtonClickEvent(null, null); + } + } + //璋冩暣鐪熷疄楂樺害 + listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23)); + } + + #endregion + + #region 鈻� 淇濆瓨鏁版嵁___________________________ + + /// <summary> + /// 淇濆瓨鐩爣璁惧 + /// </summary> + private void SaveTargetDevice() + { + this.CloseForm(); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 妫�娴嬭鎴块棿鑳藉惁鏄剧ず + /// </summary> + /// <param name="room"></param> + /// <param name="i_div"></param> + /// <returns></returns> + private bool CheckCanShowRoom(Common.Room room) + { + bool canShow = false; + //鍏堟竻绌� + this.dicShowDevice[room.Id] = new List<CommonDevice>(); + + foreach (var deviceKeys in room.ListDevice) + { + var device = Common.LocalDevice.Current.GetDevice(deviceKeys); + if (device != null) + { + canShow = true; + //鏀堕泦鍙互鏄剧ず鐨勮澶� + this.dicShowDevice[room.Id].Add(device); + } + } + return canShow; + } + + private bool CheckdCanShowDevice(CommonDevice device) + { + bool canShow = false; + + return canShow; + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs index b4c3023..1c46c2c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs @@ -9,7 +9,11 @@ { public class DoorLockCommonInfo : CommonDevice { - #region 鏈湴鍙橀噺 + #region 鏈湴鍙橀噺 + /// <summary> + /// 缃戝叧锛堥棬閿侊級鎵�鍦ㄧ殑鏃堕棿 + /// </summary> + public static DateTime DoorlockZoneTime = DateTime.Now; /// <summary> /// 甯稿紑妯″紡鎵ц鏃堕棿 /// </summary> @@ -752,18 +756,59 @@ /// <summary> /// 灏嗙郴缁熸椂闂磋浆鎹㈡垚UNIX鏃堕棿鎴�(绮剧‘鍒扮) - /// </summary> /// <param name="dateTime">鍖椾含鏃堕棿</param> /// <param name="accurateToMilliseconds">绮剧‘鍒版绉掞紝鍚﹀埌绉�</param> + /// </summary> + /// <param name="dateTime"></param> /// <returns>杩斿洖涓�涓暱鏁存暟鏃堕棿鎴�</returns> public static string GetUnixTimeStamp(DateTime dateTime) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); - //DateTime dtNow = DateTime.Parse(DateTime.Now.ToString()); TimeSpan toNow = dateTime.Subtract(dtStart); string timeStamp = toNow.Ticks.ToString(); timeStamp = timeStamp.Substring(0, timeStamp.Length - 7); return timeStamp; + } + + /// <summary> + /// 鑾峰彇鏃跺尯鐨勬椂闂� + /// </summary> + /// <returns></returns> + public static DateTime GetDoorLockZoneTime() + { + //閫氳繃缁忓害鑾峰彇鏃跺尯 + var gwZone = int.Parse(CaculateTimeZone(Common.Config.Instance.Home.Longitude)); + //灏嗘湰鍦版椂闂磋浆鎹㈡垚涓栫晫鏃� + var utc = DateTime.Now.AddHours(-gwZone); + //涓栫晫鏃惰浆鎹㈡垚鏃堕棿鎴� + var utcUnix = GetUnixTimeStamp(utc); + //鏃跺尯鐨勬椂闂存埑 + var zoneUnix = int.Parse(utcUnix) + gwZone * 3600; + var zoneDateTime = GetLocalTime(zoneUnix); + DoorlockZoneTime = zoneDateTime; + return zoneDateTime; + } + + /// <summary> + /// 鑾峰彇鏃跺尯 + /// </summary> + /// <param name="currentLon">currentLon:"+"涓轰笢鍖猴紝鈥�-鈥濅负瑗垮尯</param> + /// <returns></returns> + public static String CaculateTimeZone(double currentLon) + { + int timeZone; + int shangValue = (int)(currentLon / 15); + double yushuValue = Math.Abs(currentLon % 15); + if (yushuValue <= 7.5) + { + timeZone = shangValue; + } + else + { + timeZone = shangValue + (currentLon > 0 ? 1 : -1); + } + return timeZone >= 0 ? "+" + Math.Abs(timeZone) : "-" + Math.Abs(timeZone); + } /// <summary> @@ -834,5 +879,150 @@ } #endregion + + public enum DoorLockMessType + { + /// <summary> + /// app鎿嶄綔 + /// </summary> + AppOperate = 0, + /// <summary> + /// 璁惧涓婃姤 + /// </summary> + DeviceReport = 1, + /// <summary> + /// 鏈嶅姟鍣ㄦ帹閫� + /// </summary> + ServicePush = 2, + } + + /// <summary> + /// 甯稿紑妯″紡澶辨晥澶勭悊 + /// </summary> + public static async void NomallyOpenModeInvalidDialog(ZigBee.Device.DoorLock doorLock, DoorLockMessType doorLockMessType, Action action) + { + if (UserCenterResourse.UserInfo.AuthorityNo != 1) + { + return; + } + string msg = Language.StringByID(R.MyInternationalizationString.NomallyModeIsCanceled).Replace("{0}", "\r\n"); + var confirm = Language.StringByID(R.MyInternationalizationString.SureCancel); + var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.NomallyOpenMode, msg, confirm); + var HaveLogicNormallyOpenMode = await Shared.Phone.Device.Logic.SkipView.Exist(); + + if (HaveLogicNormallyOpenMode) + { + //鏈夐�昏緫璁剧疆鐨勫脊绐� + alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.CancelNomallyOpenModeWithLogic, msg, confirm); + } + alert.Show(); + alert.MsgControlClickEvent += async () => + { + if (doorLockMessType == DoorLockMessType.DeviceReport || doorLockMessType == DoorLockMessType.ServicePush) + { + //鍙栨秷甯稿紑 + NormallyOpenModeValue(doorLock, false); + } + else + { + //淇濇寔甯稿紑 + NormallyOpenModeValue(doorLock, true); + } + action?.Invoke(); + action = null; + }; + alert.CancelClickEvent += async () => + { + if (doorLockMessType == DoorLockMessType.DeviceReport || doorLockMessType == DoorLockMessType.ServicePush) + { + var result = await doorLock.SetNormallyOpenModeFuncAsync(true); + if (result == null || result.defaultControlResponseData == null) + { + string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); + Application.RunOnMainThread(() => + { + new Tip() { MaxWidth = 150, Text = msg0, Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + }); + NormallyOpenModeValue(doorLock, false); + return; + } + if (result.defaultControlResponseData.status != 0) + { + string msg1 = Language.StringByID(R.MyInternationalizationString.OpenNormallyOpenModeFailed); + Application.RunOnMainThread(() => + { + new Tip() { MaxWidth = 150, Text = msg1, Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + }); + NormallyOpenModeValue(doorLock, false); + return; + } + else + { + NormallyOpenModeValue(doorLock, true); + } + } + else + { + NormallyOpenModeValue(doorLock, true); + } + action?.Invoke(); + action = null; + }; + alert.ConfirmClickEvent += async () => + { + if (doorLockMessType == DoorLockMessType.DeviceReport || doorLockMessType == DoorLockMessType.ServicePush) + { + NormallyOpenModeValue(doorLock, false); + } + else + { + var result = await doorLock.SetNormallyOpenModeFuncAsync(false); + if (result == null || result.defaultControlResponseData == null) + { + Application.RunOnMainThread(() => + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + }); + return; + } + if (result.defaultControlResponseData.status != 0) + { + string msg1 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeFailed); + Application.RunOnMainThread(() => { }); + + new Tip() { MaxWidth = 150, Text = msg1, Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + return; + } + else + { + NormallyOpenModeValue(doorLock, false); + string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess); + Application.RunOnMainThread(() => + { + new Tip() { MaxWidth = 150, Text = msg2, Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + }); + Shared.Phone.Device.Logic.SkipView.LockCloseLogic(doorLock); + } + } + action?.Invoke(); + action = null; + }; + } + + /// <summary> + /// 闂ㄩ攣甯稿紑妯″紡鍊� + /// </summary> + public static void NormallyOpenModeValue(ZigBee.Device.DoorLock doorLock, bool value) + { + string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + if (doorLock.IsDoorLockNormallyMode.ContainsKey(key)) + { + doorLock.IsDoorLockNormallyMode[key] = value; + } + else + { + doorLock.IsDoorLockNormallyMode.Add(key, value); + } + } } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs index d1de6cc..99aae10 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs @@ -179,12 +179,12 @@ btnMsg.Text = msgText; } - if (msgType == DoorLockMsgType.Confirm || msgType == DoorLockMsgType.InValid || msgType == DoorLockMsgType.NomallyOpenMode) + if (msgType == DoorLockMsgType.Confirm || msgType == DoorLockMsgType.InValid || msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) { //鍒濆鍖栫‘璁ょ被鍨嬬殑搴曢儴鎸夐挳 this.InitBottomConfirmButton(MsgControlFrameLayout, frameBack); } - else if (msgType == DoorLockMsgType.DoorLockLogic || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) + else if (msgType == DoorLockMsgType.DoorLockLogic) { //澶辨晥璁剧疆鐨勫簳閮ㄦ寜閽� this.InitBottomLogicButton(MsgControlFrameLayout, frameBack); @@ -326,7 +326,7 @@ var btnCancel = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127)); frameBack.AddChidren(btnCancel); var bottomLeftText = Language.StringByID(R.MyInternationalizationString.uCancel); - if (msgType == DoorLockMsgType.NomallyOpenMode) + if (msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) { bottomLeftText = Language.StringByID(R.MyInternationalizationString.KeepNomallyMode); } @@ -380,11 +380,12 @@ /// <returns></returns> private bool CheckInvalidTime(string tetxValue) { - if (tetxValue == string.Empty) + if (tetxValue == string.Empty) { - var msgContr = new ShowMsgControl(ShowMsgType.Error, "澶辨晥鏃堕棿涓嶈兘鐪佺暐"); + var msg = Language.StringByID(R.MyInternationalizationString.InvalidTimeIsEmpty); + var msgContr = new ShowMsgControl(ShowMsgType.Error, msg); msgContr.Show(); - return false; + return false; } foreach (var c in tetxValue) { @@ -395,7 +396,8 @@ } if (tetxValue.Length >= 3) { - var msgContr = new ShowMsgControl(ShowMsgType.Error, "澶辨晥鏃堕棿涓嶈兘澶т簬36灏忔椂"); + var msg = Language.StringByID(R.MyInternationalizationString.InvalidTimeMoreThan36); + var msgContr = new ShowMsgControl(ShowMsgType.Error, msg); msgContr.Show(); return false; } @@ -403,13 +405,15 @@ int value = Convert.ToInt32(tetxValue); if (value <= 0) { - var msgContr = new ShowMsgControl(ShowMsgType.Error, "澶辨晥鏃堕棿涓嶈兘灏忎簬1灏忔椂"); + var msg = Language.StringByID(R.MyInternationalizationString.InvalidTimeLessThan1); + var msgContr = new ShowMsgControl(ShowMsgType.Error, msg); msgContr.Show(); return false; } if (value > 36) { - var msgContr = new ShowMsgControl(ShowMsgType.Error, "澶辨晥鏃堕棿涓嶈兘澶т簬36灏忔椂"); + var msg = Language.StringByID(R.MyInternationalizationString.InvalidTimeMoreThan36); + var msgContr = new ShowMsgControl(ShowMsgType.Error, msg); msgContr.Show(); return false; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs index 1ad9beb..071fe66 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs @@ -173,6 +173,7 @@ TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, TextAlignment = TextAlignment.CenterRight, TextSize = 16, + Text = "--:--", }; MidTopFrameLayout.AddChidren(validTime); @@ -196,6 +197,7 @@ TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, TextAlignment = TextAlignment.CenterLeft, TextSize = 16, + Text = "--:--", }; MidTopFrameLayout.AddChidren(inValidTime); @@ -391,7 +393,9 @@ //璇�"鐐瑰嚮鐢熸垚"涓存椂瀵嗙爜锛� Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); + var mess = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1); + ShowMassage(ShowMsgType.Tip, mess); + }); return; } @@ -411,7 +415,8 @@ //璇�"鐐瑰嚮鐢熸垚"涓存椂瀵嗙爜锛� Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); + var mess = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -493,7 +498,8 @@ //璇�"鐐瑰嚮鐢熸垚"涓存椂瀵嗙爜锛� Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); + var mess = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -506,7 +512,8 @@ //鏃犳晥鐨勬椂闂磋缃� Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); + var mess = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -570,7 +577,7 @@ } //瀵瑰瘑鐮佽繘琛屽姞瀵嗗鐞� string hdlKey = "hD1(La3o"; - var enPsw = UserCenterLogic.EncryptPassword(hdlKey, doorLock.tempPasswordObject.TempPassword); + var enPsw = UserCenterLogic.EncryptPassword(hdlKey, doorLock.tempPasswordObject.TempPassword); addDoorLockTempPasswordData.TempPwd = enPsw; if (doorLock.DeviceAddr != null) { @@ -585,7 +592,8 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + var mess = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -593,7 +601,8 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetFailedXm1), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + var mess = Language.StringByID(R.MyInternationalizationString.SetFailedXm1); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -605,7 +614,8 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetFailedXm), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); + var mess = Language.StringByID(R.MyInternationalizationString.SetFailedXm); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -614,7 +624,8 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetFailedXm), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); + var mess = Language.StringByID(R.MyInternationalizationString.SetFailedXm); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -623,7 +634,8 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); + var mess = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); + this.ShowMassage(ShowMsgType.Tip, mess); }); return; } @@ -755,7 +767,8 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ClearFailedXm1) + ".", Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + var mess = Language.StringByID(R.MyInternationalizationString.ClearFailedXm1); + this.ShowMassage(ShowMsgType.Tip, mess); }); } } @@ -763,7 +776,8 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + var mess = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime); + this.ShowMassage(ShowMsgType.Tip, mess); }); } } @@ -771,14 +785,15 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ClearFailedXm1), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + var mess = Language.StringByID(R.MyInternationalizationString.ClearFailedXm1); + this.ShowMassage(ShowMsgType.Tip, mess); }); } } else { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDelText); - + var mess = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); + this.ShowMassage(ShowMsgType.Tip, mess); } } } @@ -827,7 +842,7 @@ tpObj.InValidTime = curDoorLockTempPaw.ValidEndTime; //瑙e瘑瀵嗙爜 string hdlKey = "hD1(La3o"; - var desPsw= UserCenterLogic.DecryptPassword(hdlKey, curDoorLockTempPaw.TempPwd); + var desPsw = UserCenterLogic.DecryptPassword(hdlKey, curDoorLockTempPaw.TempPwd); doorLock.LocalTempPassword = tpObj.TempPassword = desPsw; doorLock.tempPasswordObject = tpObj; TimeDateData(doorLock.tempPasswordObject.ValidTime, doorLock.tempPasswordObject.InValidTime); @@ -844,7 +859,8 @@ } else { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); + var mess = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime); + this.ShowMassage(ShowMsgType.Tip, mess); } } catch { } @@ -949,7 +965,7 @@ //鏈夋晥鏃堕棿 if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour == 100) { - validTime.Text = "00:00"; + validTime.Text = "--:--"; } else { @@ -975,14 +991,30 @@ if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour == 100) { - inValidTime.Text = "00:00"; + inValidTime.Text = "--:--"; } else { inValidTime.Text = hour + ":" + minute; } - validTimeDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay + Language.StringByID(R.MyInternationalizationString.Day); - inValidTimeDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay + Language.StringByID(R.MyInternationalizationString.Day); + + if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth == 0) + { + validTimeDate.Text = "-" + Language.StringByID(R.MyInternationalizationString.Month) + "-" + Language.StringByID(R.MyInternationalizationString.Day); + } + else + { + validTimeDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay + Language.StringByID(R.MyInternationalizationString.Day); + } + + if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth == 0) + { + inValidTimeDate.Text = "-" + Language.StringByID(R.MyInternationalizationString.Month) + "-" + Language.StringByID(R.MyInternationalizationString.Day); + } + else + { + inValidTimeDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay + Language.StringByID(R.MyInternationalizationString.Day); + } } } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs index 81832f0..2289e47 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs @@ -27,7 +27,7 @@ var dataReport = tempDevice.DeviceStatusReport.AttriBute[0]; if (tempDevice.DeviceStatusReport.CluterID == 10 && dataReport.AttributeId == 0) { - CurentDoorLockTime = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocalTime(dataReport.AttriButeData); + CurentDoorLockTime = DoorLockCommonInfo.GetLocalTime(dataReport.AttriButeData); Application.RunOnMainThread(() => { waitGetDoorLockTime = DateTime.MaxValue; @@ -60,6 +60,8 @@ this.doorLock = doorLock; setTimeType = timeType; BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + //璇婚棬閿佹椂鍖烘椂闂� + DoorLockCommonInfo.GetDoorLockZoneTime(); ZigBee.Device.ZbGateway.StatusList.Add(this); } #endregion @@ -180,7 +182,7 @@ }; this.midFrameLayout.AddChidren(midTopFrameLayout); - var dtNow = DateTime.Now; + var dtNow = DoorLockCommonInfo.DoorlockZoneTime;// DateTime.Now; for (int i = 0; i < 2; i++) { #region MidTopFrameLayout UI @@ -370,6 +372,7 @@ /// <summary> /// 娣诲姞銆愰棬閿佹椂闂淬�戣锛堥棬閿佷笓鐢級 /// </summary> + /// <param name="zoneFrameLayout"></param> private void AddDoorLocksTimeRow(FrameLayout zoneFrameLayout) { //闂ㄩ攣鏃堕棿 @@ -405,11 +408,17 @@ TextColor = Shared.Common.ZigbeeColor.Current.XMGray4, TextSize = 14, }; + rowLayout.AddChidren(textZone); textZone.Text = zoneData(); textZone.MouseDownEventHandler += (sender, e) => { - //GetSpecificZoneNowDate(); + //1銆佸叆缃戝悗鍏堣幏鍙栭棬閿佸湪缃戝叧涓殑鏃跺尯鏃堕棿 + var curDateTime = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockZoneTime(); + //2銆佸皢鏃堕棿璁剧疆鍒扮綉鍏充腑 + var dateTime = new DateTime(curDateTime.Year, curDateTime.Month, curDateTime.Day, curDateTime.Hour, curDateTime.Minute, curDateTime.Second); + var setTimestamp = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetUnixTimeStamp(dateTime); + doorLock.RectifyDoorLockTimeAsync(int.Parse(setTimestamp)); }; var btnLine = new FrameLayout() @@ -430,24 +439,86 @@ private string zoneData() { string zoneText = ""; - var gwZone = caculateTimeZone(Common.Config.Instance.Home.Longitude); + int num = 0; + var gwZone = DoorLockCommonInfo.CaculateTimeZone(Common.Config.Instance.Home.Longitude); + if (int.Parse(gwZone) != 0) + { + num = int.Parse(gwZone.Substring(1)); + } if (gwZone.Contains('+')) { - zoneText = Language.StringByID(R.MyInternationalizationString.East); + zoneText = EastZoneList(num - 1); + } + else if (gwZone.Contains('-')) + { + zoneText = WestZoneList(num - 1); } else { - zoneText = Language.StringByID(R.MyInternationalizationString.West); + zoneText = Language.StringByID(R.MyInternationalizationString.CurZoneText0); } - var num = ToNum(int.Parse(gwZone)); - return zoneText += num + Language.StringByID(R.MyInternationalizationString.CurZoneText); + return zoneText; + } + + /// <summary> + /// 杞崲涓滃尯 + /// </summary> + /// <param name="x"></param> + /// <returns></returns> + private string EastZoneList(int x) + { + var numString = new string[] + { + Language.StringByID(R.MyInternationalizationString.CurZoneText1), + Language.StringByID(R.MyInternationalizationString.CurZoneText2), + Language.StringByID(R.MyInternationalizationString.CurZoneText3), + Language.StringByID(R.MyInternationalizationString.CurZoneText4), + Language.StringByID(R.MyInternationalizationString.CurZoneText5), + Language.StringByID(R.MyInternationalizationString.CurZoneText6), + Language.StringByID(R.MyInternationalizationString.CurZoneText7), + Language.StringByID(R.MyInternationalizationString.CurZoneText8), + Language.StringByID(R.MyInternationalizationString.CurZoneText9), + Language.StringByID(R.MyInternationalizationString.CurZoneText10), + Language.StringByID(R.MyInternationalizationString.CurZoneText11), + Language.StringByID(R.MyInternationalizationString.CurZoneText12) + }; + var strChnNamesList = new List<string>(numString); + return strChnNamesList[x]; + } + + /// <summary> + /// 杞崲瑗垮尯 + /// </summary> + /// <param name="x"></param> + /// <returns></returns> + private string WestZoneList(int x) + { + var numString = new string[] + { + Language.StringByID(R.MyInternationalizationString.WestZoneText1), + Language.StringByID(R.MyInternationalizationString.WestZoneText2), + Language.StringByID(R.MyInternationalizationString.WestZoneText3), + Language.StringByID(R.MyInternationalizationString.WestZoneText4), + Language.StringByID(R.MyInternationalizationString.WestZoneText5), + Language.StringByID(R.MyInternationalizationString.WestZoneText6), + Language.StringByID(R.MyInternationalizationString.WestZoneText7), + Language.StringByID(R.MyInternationalizationString.WestZoneText8), + Language.StringByID(R.MyInternationalizationString.WestZoneText9), + Language.StringByID(R.MyInternationalizationString.WestZoneText10), + Language.StringByID(R.MyInternationalizationString.WestZoneText11), + Language.StringByID(R.MyInternationalizationString.WestZoneText12) + }; + var strChnNamesList = new List<string>(numString); + return strChnNamesList[x]; } /// <summary> /// 鑾峰彇鏃跺尯 /// <para>currentLon:"+"涓轰笢鍖猴紝鈥�-鈥濅负瑗垮尯</para> /// </summary> - public static String caculateTimeZone(double currentLon) + /// <param name="currentLon"></param> + /// <returns></returns> + public static String CaculateTimeZone(double currentLon) { int timeZone; int shangValue = (int)(currentLon / 15); @@ -464,58 +535,17 @@ } /// <summary> - /// 杞崲鏁板瓧 + /// 鑾峰彇鎵�鍦ㄦ椂鍖虹殑鏃堕棿 /// </summary> - private string ToNum(int x) + /// <param name="unix"></param> + /// <returns></returns> + public static int GetLocalTime(int unix) { - var numString = new string[] { "闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�", "鍗�", "鍗佷竴", "鍗佷簩" }; - var strChnNamesList = new List<string>(numString); - return strChnNamesList[x]; + var gwZone = CaculateTimeZone(Common.Config.Instance.Home.Longitude); + var data = unix + 8 * 3600; + + return data; } - - //濡備綍鏄剧ず鏃跺尯鎵�鍦ㄧ殑鏃堕棿 - public DateTime GetSpecificZoneNowDate(string zoneName = "") - { - DateTime curZoneDateTime; - - //聽鍒椾妇鎵�鏈夋敮鎸佺殑鏃跺尯鍒楄〃 - System.Collections.ObjectModel.ReadOnlyCollection<TimeZoneInfo> lst = TimeZoneInfo.GetSystemTimeZones(); - foreach (TimeZoneInfo tzi in lst) - { - var aa = tzi; - var aa1 = tzi.Id; - } - GetSpecificZoneNowDate1(); - zoneName = "Central聽America聽Standard聽Time";//缇庡浗 - //灏嗘湰鍦版椂闂磋浆鎹负缇庡浗鏍囧噯涓儴鏃堕棿 - DateTime dt = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now, TimeZoneInfo.Local); - curZoneDateTime = TimeZoneInfo.ConvertTimeFromUtc(dt, TimeZoneInfo.FindSystemTimeZoneById(zoneName)); - - zoneName = "China Standard Time";//涓浗 - //棣栧厛灏嗘湇鍔″櫒鐨勬椂闂磋浆鍖栦负utc鏃堕棿锛� - var utcdate = DateTime.Now.ToUniversalTime(); - //鐒跺悗杞崲鎴愭寚瀹氭椂鍖虹殑鏃ユ湡 - TimeZoneInfo beiJingZone = TimeZoneInfo.FindSystemTimeZoneById(zoneName); - curZoneDateTime = TimeZoneInfo.ConvertTimeFromUtc(utcdate, beiJingZone); - - return curZoneDateTime; - } - - public void GetSpecificZoneNowDate1() - { - // Get time in local time zone - DateTime thisTime = DateTime.Now; - Console.WriteLine("Time in {0} zone: {1}", TimeZoneInfo.Local.IsDaylightSavingTime(thisTime) ? - TimeZoneInfo.Local.DaylightName : TimeZoneInfo.Local.StandardName, thisTime); - Console.WriteLine(" UTC Time: {0}", TimeZoneInfo.ConvertTimeToUtc(thisTime, TimeZoneInfo.Local)); - // Get Tokyo Standard Time zone - TimeZoneInfo tst = TimeZoneInfo.FindSystemTimeZoneById("Tokyo Standard Time"); - DateTime tstTime = TimeZoneInfo.ConvertTime(thisTime, TimeZoneInfo.Local, tst); - Console.WriteLine("Time in {0} zone: {1}", TimeZoneInfo.Local.IsDaylightSavingTime(tstTime) ? - tst.DaylightName : tst.StandardName, tstTime); - Console.WriteLine(" UTC Time: {0}", TimeZoneInfo.ConvertTimeToUtc(tstTime, tst)); - } - #endregion @@ -559,7 +589,7 @@ try { var curDateTime = new DateTime(curYear, curMonth, curDay, curHour, curMin, curSec); - var setTimestamp = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetUnixTimeStamp(curDateTime); + var setTimestamp = DoorLockCommonInfo.GetUnixTimeStamp(curDateTime); Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); @@ -701,17 +731,19 @@ string nowValue2 = dtNow.Year.ToString() + curMonth.ToString().PadLeft(2, '0') + curDay.ToString().PadLeft(2, '0'); if (nowValue1.CompareTo(nowValue2) == 1) { - this.ShowMassage(ShowMsgType.Error, "鐢熸晥鏃ユ湡涓嶈兘澶т簬褰撳墠鏃ユ湡"); + var mess = Language.StringByID(R.MyInternationalizationString.ValidTimeNoLessThanCurrentTime); + this.ShowMassage(ShowMsgType.Error, mess); return; } //妫�鏌ユ椂闂� - var flage = this.CheckValidTime(dtNow.Year, curMonth, curDay, + var flage = this.CheckValidTime(dtNow.Year, curMonth, curDay, DoorLockCommonInfo.ValidDateHour, DoorLockCommonInfo.ValidDateMinute, DoorLockCommonInfo.ValidDateSecond, DoorLockCommonInfo.InValidDateYear, DoorLockCommonInfo.InValidDateMonth, DoorLockCommonInfo.InValidDateDay, DoorLockCommonInfo.InValidDateHour, DoorLockCommonInfo.InValidDateMinute, DoorLockCommonInfo.InValidDateSecond); if (flage == false) { - this.ShowMassage(ShowMsgType.Error, "鐢熸晥鏃堕棿涓嶈兘灏忎簬澶辨晥鏃堕棿"); + var mess = Language.StringByID(R.MyInternationalizationString.ValidTimeNoMoreThanInValidTime); + this.ShowMassage(ShowMsgType.Error, mess); return; } DoorLockCommonInfo.ValidDateYear = dtNow.Year; @@ -721,13 +753,14 @@ else { //妫�鏌ユ椂闂� - var flage = this.CheckValidTime(DoorLockCommonInfo.ValidDateYear, DoorLockCommonInfo.ValidDateMonth, DoorLockCommonInfo.ValidDateDay, + var flage = this.CheckValidTime(DoorLockCommonInfo.ValidDateYear, DoorLockCommonInfo.ValidDateMonth, DoorLockCommonInfo.ValidDateDay, DoorLockCommonInfo.ValidDateHour, DoorLockCommonInfo.ValidDateMinute, DoorLockCommonInfo.ValidDateSecond, dtNow.Year, curMonth, curDay, DoorLockCommonInfo.InValidDateHour, DoorLockCommonInfo.InValidDateMinute, DoorLockCommonInfo.InValidDateSecond); if (flage == false) { - this.ShowMassage(ShowMsgType.Error, "澶辨晥鏃堕棿涓嶈兘澶т簬鐢熸晥鏃堕棿"); + var mess = Language.StringByID(R.MyInternationalizationString.InvalidTimeNoLessThanValidTime); + this.ShowMassage(ShowMsgType.Error, mess); return; } @@ -806,7 +839,39 @@ } else { - curYear = y + 2009; + switch (y) + { + case 0: + curYear = dtNow.Year - 9; + break; + case 1: + curYear = dtNow.Year - 8; + break; + case 2: + curYear = dtNow.Year - 7; + break; + case 3: + curYear = dtNow.Year - 6; + break; + case 4: + curYear = dtNow.Year - 5; + break; + case 5: + curYear = dtNow.Year - 4; + break; + case 6: + curYear = dtNow.Year - 3; + break; + case 7: + curYear = dtNow.Year - 2; + break; + case 8: + curYear = dtNow.Year - 1; + break; + default: + curYear = dtNow.Year; + break; + } curMonth = m + 1; curDay = d + 1; } @@ -904,14 +969,14 @@ { if (setTimeType == "ValidTime") { - //妫�鏌ユ椂闂� var flage = this.CheckValidTime(DoorLockCommonInfo.ValidDateYear, DoorLockCommonInfo.ValidDateMonth, DoorLockCommonInfo.ValidDateDay, curHour, curMin, curSec, DoorLockCommonInfo.InValidDateYear, DoorLockCommonInfo.InValidDateMonth, DoorLockCommonInfo.InValidDateDay, DoorLockCommonInfo.InValidDateHour, DoorLockCommonInfo.InValidDateMinute, DoorLockCommonInfo.InValidDateSecond); if (flage == false) { - this.ShowMassage(ShowMsgType.Error, "澶辨晥鏃堕棿涓嶈兘澶т簬鐢熸晥鏃堕棿"); + var mess = Language.StringByID(R.MyInternationalizationString.ValidTimeNoMoreThanInValidTime); + this.ShowMassage(ShowMsgType.Error, mess); return; } @@ -928,7 +993,8 @@ curHour, curMin, curSec); if (flage == false) { - this.ShowMassage(ShowMsgType.Error, "澶辨晥鏃堕棿涓嶈兘澶т簬鐢熸晥鏃堕棿"); + var mess = Language.StringByID(R.MyInternationalizationString.InvalidTimeNoLessThanValidTime); + this.ShowMassage(ShowMsgType.Error, mess); return; } @@ -968,7 +1034,7 @@ + inValidHour.ToString().PadLeft(2, '0') + inValidMinute.ToString().PadLeft(2, '0') + inValidSecond.ToString().PadLeft(2, '0'); - + var aaaa = nowValue1.CompareTo(nowValue2); if (nowValue1.CompareTo(nowValue2) == 1) { return false; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs index b09c539..8a521d7 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs @@ -401,7 +401,7 @@ Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(63), Width = Application.GetRealWidth(762), - Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), + Text = Language.StringByID(R.MyInternationalizationString.MatchUser), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextSize = 16, TextAlignment = TextAlignment.Center, diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs index d29988a..50ddc77 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs @@ -14,12 +14,14 @@ /// </summary> /// <param name="room"></param> /// <param name="doorLock"></param> - public UserDoorLockPage(Shared.Common.Room room, CommonDevice doorLock) + public UserDoorLockPage(Room room, CommonDevice doorLock) { + //寰愭鐨勯棬閿佺晫闈㈡墦寮�(缃戝叧鍏ㄥ眬鎺ユ敹鏃朵娇鐢�) + ControlCommonResourse.IsDoorLockPageOpen = true; this.doorLock = doorLock as ZigBee.Device.DoorLock; currentRoom = room; deviceUI = doorLock; - BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor; ZbGateway.StatusList.Add(this); } @@ -168,6 +170,14 @@ /// 聽褰撳墠闊抽噺 /// </summary> int currentVolume = -1; + /// <summary> + /// waitClickTime + /// </summary> + DateTime waitClickTime = DateTime.MaxValue; + /// <summary> + /// IsClick + /// </summary> + bool IsClick = true; #endregion /// <summary> @@ -590,22 +600,27 @@ if (typeTag == "DoorLockProgrammingEventNotificationCommand" && tempDevice != null) { var tempDoor = (ZigBee.Device.DoorLock)tempDevice; - if (tempDoor.doorLockOperatingEventNotificationCommand != null) + if (tempDevice.DeviceEpoint == doorLock.DeviceEpoint + && tempDevice.DeviceAddr == doorLock.DeviceAddr) { - //闈炰富浜轰笉寮硅繖涓獥鍙� - if (UserCenterResourse.UserInfo.AuthorityNo != 1) - { - return; - } - //闈炵鐞嗗憳鐨勫瘑鐮�,涓嶅脊杩欎釜绐楀彛 - if (tempDoor.doorLockOperatingEventNotificationCommand.UserID > 9) - { - return; - } - - if (canOpenNormallyMode) + if (tempDoor.doorLockOperatingEventNotificationCommand != null) { - Application.RunOnMainThread(() => { NomallyOpenModeInvalidDialog(true); }); + //闈炰富浜轰笉寮硅繖涓獥鍙� + if (UserCenterResourse.UserInfo.AuthorityNo != 1) + { + return; + } + string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + if (doorLock.IsDoorLockNormallyMode.ContainsKey(key)) + { + if (doorLock.IsDoorLockNormallyMode[key] == true) + { + if (canOpenNormallyMode) + { + Application.RunOnMainThread(() => { NomallyOpenModeInvalidDialog(true); }); + } + } + } } } } @@ -625,7 +640,6 @@ Application.RunOnMainThread(() => { currentPower = dataReport.AttriButeData; - waitGetDoorLockPower = DateTime.MaxValue; UpdatePower(); }); } @@ -678,7 +692,7 @@ } NormallyOpenModeValue(tempRes); - + HaveLogicNormallyOpenMode = await Shared.Phone.Device.Logic.SkipView.Exist(); Application.RunOnMainThread(() => { UpdateNomallyOpenStatus(); @@ -816,15 +830,11 @@ btnCollect.IsSelected = !btnCollect.IsSelected; if (btnCollect.IsSelected) { - HdlRoomLogic.Current.AddLoveDevice(deviceUI);//鏀惰棌 - //Test - HaveLogicNormallyOpenMode = true; + HdlRoomLogic.Current.AddLoveDevice(deviceUI);//鏀惰棌 } else { - HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);//鍙栨秷鏀惰棌 - //Test - HaveLogicNormallyOpenMode = false; + HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);//鍙栨秷鏀惰棌 } }; btnCollectFrameLayout.MouseDownEventHandler += handerCollect; @@ -833,13 +843,30 @@ //寮�閿佷簨浠� EventHandler<MouseEventArgs> hander1 = async (sender, e) => { - //甯稿紑妯″紡涓�,鐐瑰嚮寮�閿佹棤鏁� - if (btnNormallyOpen.IsSelected == true) - { - this.ShowMassage(ShowMsgType.Remind, "褰撳墠鐘舵�佷负甯稿紑妯″紡"); - return; + + string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + if (doorLock.IsDoorLockNormallyMode.ContainsKey(key)) + { + if (doorLock.IsDoorLockNormallyMode[key] == true) + { + if (canOpenNormallyMode) + { + NomallyOpenModeInvalidDialog(false); + } + else + { + OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); + } + } + else + { + OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); + } } - OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); + else + { + OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); + } }; openFrameLayout.MouseUpEventHandler += hander1; btnDoorOpenPic.MouseUpEventHandler += hander1; @@ -1072,11 +1099,12 @@ var alertNomallyModeIsTurnOn = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.DoorLockLogic, msgNomallyModeIsTurnOn, doorLockInValidSetting); alertNomallyModeIsTurnOn.Show(); + //鐐瑰嚮鑷姩鍖� alertNomallyModeIsTurnOn.LogicClickEvent += () => { - //鑷姩鍖� - Shared.Phone.Device.Logic.SkipView.SkipAddLogic(2); - + //閫昏緫璋冪敤鍓嶈寰楃Щ闄� + ZbGateway.StatusList.Remove(this); + Shared.Phone.Device.Logic.SkipView.SkipAddLogic(2, doorLock); }; alertNomallyModeIsTurnOn.InvalidClickEvent += async () => { @@ -1100,7 +1128,6 @@ { if (UserCenterResourse.UserInfo.AuthorityNo != 1) { - //this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NoAccess)); return; } string msg = Language.StringByID(R.MyInternationalizationString.NomallyModeIsCanceled).Replace("{0}", "\r\n"); @@ -1168,7 +1195,7 @@ //纭鍙栨秷甯稿紑 if (IsFromReport) { - NormallyOpenModeValue(true); + NormallyOpenModeValue(false); UpdateNomallyOpenStatus(); } else @@ -1194,7 +1221,6 @@ string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess); this.ShowTipMsg(msg2); Shared.Phone.Device.Logic.SkipView.LockCloseLogic(doorLock); - // } } }; @@ -1228,8 +1254,7 @@ } var temp = int.Parse(obj); DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp; - Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime,doorLock); - //璋冪敤鑷姩鍖栨帴鍙h缃け鏁堟椂闂� + Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); }; } /// <summary> @@ -1274,10 +1299,10 @@ btnDoorOpenPic.Enable = false; if (UserCenterResourse.UserInfo.AuthorityNo != 1) { - var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid); + var result = await DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid); if (result == false) { - var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid); + var result1 = await DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid); if (result1 == true) { RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus, btnDoorLockTitle); @@ -1333,6 +1358,8 @@ /// </summary> public override void RemoveFromParent() { + //寰愭鐨勯棬閿佺晫闈㈠叧闂�(缃戝叧鍏ㄥ眬鎺ユ敹鏃朵娇鐢�) + ControlCommonResourse.IsDoorLockPageOpen = false; if (IsDrawerLockMode) { CommonPage.Instance.IsDrawerLockMode = false; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs index 0e14181..83e6910 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs @@ -62,15 +62,44 @@ btnHouse.TextID = R.MyInternationalizationString.uMyResidence; this.AddChidren(btnHouse); + //宸﹀彸婊戝姩鎺т欢鐨勮儗鏅鍣� + var frameBack = new FrameLayout(); + frameBack.Y = Application.GetRealHeight(302); + frameBack.Width = this.Width; ; + frameBack.Height = Application.GetRealHeight(478); + this.AddChidren(frameBack); + + //鎴块棿婊戝姩鎺т欢宸﹁竟鐨勮櫄鎷熷浘鐗� + var mLeftImageView = new ImageView(); + mLeftImageView.ImagePath = "RoomIcon/1.jpg"; + mLeftImageView.Radius = (uint)Application.GetRealHeight(17); + mLeftImageView.Width = Application.GetRealWidth(717); + mLeftImageView.Height = Application.GetRealHeight(478); + //鎴块棿婊戝姩鎺т欢鍙宠竟鐨勮櫄鎷熷浘鐗� + var mRightImageView = new ImageView(); + mRightImageView.ImagePath = "RoomIcon/2.jpg"; + mRightImageView.Radius = (uint)Application.GetRealHeight(17); + mRightImageView.Width = mLeftImageView.Width; + mRightImageView.Height = mLeftImageView.Height; + //宸﹀彸婊戝姩鐨勬埧闂� var roomPageView = new HorizontalPages(); - roomPageView.Y = Application.GetRealHeight(302); - roomPageView.Height = Application.GetRealHeight(478); - this.AddChidren(roomPageView); + roomPageView.Width = frameBack.Width; + roomPageView.Height = frameBack.Height; + frameBack.AddChidren(roomPageView); //绐佸嚭杈硅窛 roomPageView.TCBJ = Application.GetRealWidth(124); //涓や釜page涔嬮棿鐨勯棿璺� roomPageView.JMBJ = Application.GetRealWidth(58); + //鍦ㄨ繖涓帶浠剁殑涓嬮潰娣诲姞闃村奖鏁堟灉 + var btnRoomBottomShadow = new NormalViewControl(717, 81, true); + btnRoomBottomShadow.Y = frameBack.Bottom; + btnRoomBottomShadow.Gravity = Gravity.CenterHorizontal; + btnRoomBottomShadow.UnSelectedImagePath = "Room/RoomCardShadow.png"; + this.AddChidren(btnRoomBottomShadow); + + //璁剧疆鎺у埗鏈�宸﹀拰鏈�鍙�2杈瑰~鍏呯殑鍋囪儗鏅疺iew锛屼笉璁剧疆涓嶆樉绀猴紝闇�瑕佸湪AddChidren 鍓嶈皟鐢ㄨ鏂规硶 + roomPageView.SetLeftAndRightImageView(mLeftImageView, mRightImageView); //瀹㈠巺 var room1 = new Common.Room(); @@ -79,6 +108,7 @@ var roomView1 = new Phone.Device.CommonForm.RoomView(0, 0); roomPageView.AddChidren(roomView1); roomView1.Init(room1); + roomView1.HideName(false); //闃冲彴 var room2 = new Common.Room(); room2.BackgroundImage = "RoomIcon/1.jpg"; @@ -86,6 +116,7 @@ var roomView2 = new Phone.Device.CommonForm.RoomView(0, 0); roomPageView.AddChidren(roomView2); roomView2.Init(room2); + roomView2.HideName(true); //鍗у var room3 = new Common.Room(); room3.BackgroundImage = "RoomIcon/2.jpg"; @@ -93,12 +124,63 @@ var roomView3 = new Phone.Device.CommonForm.RoomView(0, 0); roomPageView.AddChidren(roomView3); roomView3.Init(room3); + roomView3.HideName(true); - roomPageView.PageIndex = 1; + //鍦ㄦ埧闂村崱鐗囧乏杈规坊鍔犻伄缃� + var btnRoomLeftShadow = new FrameLayout(); + btnRoomLeftShadow.Width = Application.GetRealWidth(124); + btnRoomLeftShadow.Height = roomPageView.Height - roomPageView.JMBJ * 2; + btnRoomLeftShadow.Gravity = Gravity.CenterVertical; + btnRoomLeftShadow.BackgroundColor = 0x1c000000; + btnRoomLeftShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight); + frameBack.AddChidren(btnRoomLeftShadow); + + //鍦ㄦ埧闂村崱鐗囧彸杈规坊鍔犻伄缃� + var btnRoomRightShadow = new FrameLayout(); + btnRoomRightShadow.Width = btnRoomLeftShadow.Width; + btnRoomRightShadow.Height = btnRoomLeftShadow.Height; + btnRoomRightShadow.X = Application.GetRealWidth(956); + btnRoomRightShadow.Gravity = Gravity.CenterVertical; + btnRoomRightShadow.BackgroundColor = btnRoomLeftShadow.BackgroundColor; + btnRoomRightShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); + frameBack.AddChidren(btnRoomRightShadow); + + //鎺т欢寮�濮嬫粦鍔ㄧ殑浜嬩欢 + roomPageView.StartScrollAction += () => + { + //寮�濮嬫粦鍔ㄦ椂,闅愯棌褰撳墠鐨勬暟鎹樉绀� + (roomPageView.GetChildren(roomPageView.PageIndex) as Phone.Device.CommonForm.RoomView).HideName(true); + btnRoomLeftShadow.Visible = false; + btnRoomRightShadow.Visible = false; + btnRoomBottomShadow.Visible = false; + }; + roomPageView.EndScrollAction += () => + { + int curIndex = roomPageView.PageIndex; + //鍓嶄竴寮犲崱鐗� + if (roomPageView.GetChildren(curIndex - 1) != null) + { + (roomPageView.GetChildren(curIndex - 1) as Phone.Device.CommonForm.RoomView).HideName(true); + } + //褰撳墠鍗$墖 + if (roomPageView.GetChildren(curIndex) != null) + { + (roomPageView.GetChildren(curIndex) as Phone.Device.CommonForm.RoomView).HideName(false); + } + //涓嬩竴寮犲崱鐗� + if (roomPageView.GetChildren(curIndex + 1) != null) + { + (roomPageView.GetChildren(curIndex + 1) as Phone.Device.CommonForm.RoomView).HideName(true); + } + btnRoomLeftShadow.Visible = true; + btnRoomRightShadow.Visible = true; + btnRoomBottomShadow.Visible = true; + }; + roomPageView.PageIndex = 0; //鍦烘櫙鍜屽姛鑳界殑鎺т欢 this.contrSwitch = new FrameLayout(); - contrSwitch.Y = roomPageView.Bottom + Application.GetRealHeight(52); + contrSwitch.Y = frameBack.Bottom + Application.GetRealHeight(52); contrSwitch.Gravity = Gravity.CenterHorizontal; contrSwitch.Width = Application.GetRealWidth(804); contrSwitch.Height = Application.GetRealHeight(124); @@ -125,29 +207,29 @@ contrSwitch.AddChidren(btnFunction); //鑷畾涔夊満鏅�1 - var sceneView1 = new Phone.Device.CommonForm.SceneMainView(0, 0); + var sceneView1 = new MainPage.Controls.SceneCardControl(); sceneView1.X = Application.GetRealWidth(46); - sceneView1.Y = roomPageView.Bottom + Application.GetRealHeight(233); + sceneView1.Y = frameBack.Bottom + Application.GetRealHeight(233); this.AddChidren(sceneView1); - sceneView1.Init(new Common.SceneUI() { Name = "Getup", IconPath = "SceneIcon/0.png" }); + sceneView1.InitControl(new Common.SceneUI() { Name = "Getup", IconPath = "SceneIcon/0.png" }); //鑷畾涔夊満鏅�2 - var sceneView2 = new Phone.Device.CommonForm.SceneMainView(0, 0); + var sceneView2 = new MainPage.Controls.SceneCardControl(); sceneView2.X = Application.GetRealWidth(553); sceneView2.Y = sceneView1.Y; this.AddChidren(sceneView2); - sceneView2.Init(new Common.SceneUI() { Name = "Relax", IconPath = "SceneIcon/1.png" }); + sceneView2.InitControl(new Common.SceneUI() { Name = "Relax", IconPath = "SceneIcon/1.png" }); //鑷畾涔夊満鏅�3 - var sceneView3 = new Phone.Device.CommonForm.SceneMainView(0, 0); + var sceneView3 = new MainPage.Controls.SceneCardControl(); sceneView3.X = sceneView1.X; sceneView3.Y = sceneView1.Bottom + Application.GetRealHeight(14); this.AddChidren(sceneView3); - sceneView3.Init(new Common.SceneUI() { Name = "Dinner", IconPath = "SceneIcon/2.png" }); + sceneView3.InitControl(new Common.SceneUI() { Name = "Dinner", IconPath = "SceneIcon/2.png" }); //鑷畾涔夊満鏅�4 - var sceneView4 = new Phone.Device.CommonForm.SceneMainView(0, 0); + var sceneView4 = new MainPage.Controls.SceneCardControl(); sceneView4.X = sceneView2.X; sceneView4.Y = sceneView3.Y; this.AddChidren(sceneView4); - sceneView4.Init(new Common.SceneUI() { Name = "Goodnight", IconPath = "SceneIcon/3.png" }); + sceneView4.InitControl(new Common.SceneUI() { Name = "Goodnight", IconPath = "SceneIcon/3.png" }); //搴曢儴鑿滃崟 var frameMenu = new FrameLayout(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs index c3226dd..305b4fd 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs @@ -111,11 +111,15 @@ btnZhezhao.Gravity = Gravity.CenterHorizontal; btnZhezhao.Radius = btnPic.Radius; bodyFrameLayout.AddChidren(btnZhezhao); - btnZhezhao.MouseUpEventHandler += (sender, e) => + //鍒嗕韩鐨勬埧闂翠笉鑳界紪杈� + if (this.editorRoom.IsSharedRoom == false) { - //鎴块棿鍥剧墖閫夋嫨 - this.RoomPictrueSelect(btnPic); - }; + btnZhezhao.MouseUpEventHandler += (sender, e) => + { + //鎴块棿鍥剧墖閫夋嫨 + this.RoomPictrueSelect(btnPic); + }; + } //鍙樻洿涓�涓嬮偅涓櫧鑹茶儗鏅殑Y杞�,瀹冨埌鍥剧墖鐨勪腑闂翠綅缃� frameBack1.Y = btnPic.Y + btnPic.Height / 2; @@ -134,27 +138,41 @@ private void AddAllMenuRow(InformationEditorControl tableContr, ImageView btnPic) { //銆愭埧闂村悕绉般�� - var txtRoomName = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uRoomName), this.cloneRoom.Name, this.listview.rowSpace / 2); - txtRoomName.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputRoomName); - listview.AddChidren(txtRoomName); - txtRoomName.InitControl(); - //搴曠嚎 - txtRoomName.AddBottomLine(); + FrameCaptionInputControl txtRoomName = null; + if (this.editorRoom.IsLove == false) + { + txtRoomName = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uRoomName), this.cloneRoom.Name, this.listview.rowSpace / 2); + txtRoomName.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputRoomName); + listview.AddChidren(txtRoomName); + txtRoomName.InitControl(); + //搴曠嚎 + txtRoomName.AddBottomLine(); + } + else + { + //鎴戠殑鍠滅埍涓嶈兘缂栬緫鍚嶅瓧 + var rowRoomName = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uRoomName), this.cloneRoom.Name, this.listview.rowSpace / 2); + listview.AddChidren(rowRoomName); + rowRoomName.UseClickStatu = false; + rowRoomName.InitControl(); + //搴曠嚎 + rowRoomName.AddBottomLine(); + } //璇PP涓烘湁妤煎眰鐨勬ā寮忔墠寮�鍚繖涓彍鍗� - if (string.IsNullOrEmpty(this.cloneRoom.FloorId) == false) + if (this.editorRoom.IsLove == false && string.IsNullOrEmpty(this.cloneRoom.FloorId) == false) { //銆愭墍灞炴ゼ灞傘�� var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.cloneRoom.FloorId], this.listview.rowSpace / 2); listview.AddChidren(btnBelone); btnBelone.InitControl(); - //鍙崇澶� - btnBelone.AddRightArrow(); //搴曠嚎 btnBelone.AddBottomLine(); //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀� if (this.editorRoom.IsSharedRoom == false) { + //鍙崇澶� + btnBelone.AddRightArrow(); btnBelone.ButtonClickEvent += (sender, e) => { //妤煎眰閫夋嫨 @@ -215,13 +233,22 @@ tableContr.FinishInitControl(bodyFrameLayout, this.listview); tableContr = null; + //鍒嗕韩鐨勬埧闂翠笉鑳戒繚瀛� + if (this.editorRoom.IsSharedRoom == true) + { + return; + } + //淇濆瓨 var btnFinish = new BottomClickButton(); btnFinish.TextID = R.MyInternationalizationString.uSave; bodyFrameLayout.AddChidren(btnFinish); btnFinish.ButtonClickEvent += (sender, e) => { - this.cloneRoom.Name = txtRoomName.Text; + if (txtRoomName != null) + { + this.cloneRoom.Name = txtRoomName.Text; + } //妫�娴嬭兘鍚︿繚瀛樻埧闂� if (this.CheckCanSaveRoom() == false) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs index 076ba16..7581816 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs @@ -68,7 +68,6 @@ } listView = new VerticalListControl(29); - listView.Y = Application.GetRealHeight(-6); listView.Height = bodyFrameLayout.Height + Application.GetRealHeight(6); listView.BackgroundColor = UserCenterColor.Current.White; bodyFrameLayout.AddChidren(listView); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs index 7ae5aec..f37f622 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs @@ -119,7 +119,7 @@ var btnStatu = row.frameTable.AddMostRightView("", 400); if (data.TaskList.Count > 0) { - btnStatu.Text = HdlSafeguardLogic.Current.GetLightAlarmStatuText(data.TaskList); + btnStatu.Text = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(data.TaskList); } else { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs new file mode 100755 index 0000000..30a38e4 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs @@ -0,0 +1,375 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.Safety +{ + /// <summary> + /// 绌鸿皟绫荤殑瀹夐槻鎶ヨ璁剧疆鐣岄潰 + /// </summary> + public class AlarmTargetStatuSelectAcForm : DialogCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 缁撴潫閫夋嫨鐨勪簨浠�(key:鍏ㄩ儴鐘舵�佺殑缈昏瘧鏂囨湰) + /// </summary> + public Action<string, List<Safeguard.TaskListInfo>> FinishSelectEvent = null; + /// <summary> + /// 鍔ㄤ綔淇℃伅 + /// </summary> + private Dictionary<int, Safeguard.TaskListInfo> dicTaskinfo = new Dictionary<int, Safeguard.TaskListInfo>(); + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="device"></param> + /// <param name="i_listTaskInfo"></param> + public void ShowForm(CommonDevice device, List<Safeguard.TaskListInfo> i_listTaskInfo) + { + if (i_listTaskInfo != null) + { + foreach (var data in i_listTaskInfo) + { + //浠ラ槻涓囦竴,鍓旈櫎涓嶅悎娉曟暟鎹� + if (data.TaskType == 5) + { + dicTaskinfo[data.Data1] = data; + } + } + } + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(device); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame(CommonDevice device) + { + //鐬庢悶鐨勪竴涓櫧妗� + var frameBack = new FrameLayout(); + frameBack.BackgroundColor = UserCenterColor.Current.White; + frameBack.Height = Application.GetRealHeight(1092); + frameBack.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); + frameBack.Gravity = Gravity.BottomCenter; + bodyFrameLayout.AddChidren(frameBack); + + //澶撮儴淇℃伅 + var btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(65), false); + btnTitle.Y = Application.GetRealHeight(34); + btnTitle.Text = Common.LocalDevice.Current.GetDeviceEpointName(device); + btnTitle.TextColor = UserCenterColor.Current.TextColor4; + btnTitle.TextSize = 16; + btnTitle.TextAlignment = TextAlignment.Center; + frameBack.AddChidren(btnTitle); + + //鍙栨秷 + var btnCancel = new NormalViewControl(200, 60, true); + btnCancel.X = Application.GetRealWidth(81); + btnCancel.Y = Application.GetRealHeight(39); + btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1; + btnCancel.TextID = R.MyInternationalizationString.uCancel; + frameBack.AddChidren(btnCancel); + btnCancel.ButtonClickEvent += (sender, e) => + { + this.CloseForm(); + }; + + //瀹屾垚 + var btnFinish = new NormalViewControl(200, 60, true); + btnFinish.X = Application.GetRealWidth(800); + btnFinish.Y = Application.GetRealHeight(39); + btnFinish.TextAlignment = TextAlignment.CenterRight; + btnFinish.TextColor = 0xfffb744a; + btnFinish.TextID = R.MyInternationalizationString.uFinish; + frameBack.AddChidren(btnFinish); + + //绾� + var btnLine1 = new NormalViewControl(frameBack.Width, ControlCommonResourse.BottomLineHeight, false); + btnLine1.Y = Application.GetRealHeight(138); + btnLine1.BackgroundColor = UserCenterColor.Current.ButtomLine; + frameBack.AddChidren(btnLine1); + + //寮� + var rowOpen = new FrameRowControl(); + rowOpen.Y = btnLine1.Bottom + Application.GetRealHeight(69); + rowOpen.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft; + rowOpen.RightOffset = ControlCommonResourse.XXLeft - Application.GetRealWidth(81); + frameBack.AddChidren(rowOpen); + var btnOpen = rowOpen.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSimpleOpen), 400); + btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3; + var btnOpenSelect = rowOpen.AddMostRightEmptyIcon(58, 58); + btnOpenSelect.UnSelectedImagePath = "Item/ItemSelected.png"; + btnOpenSelect.Visible = false; + //搴曠嚎 + var btnOpenLine = rowOpen.AddBottomLine(); + + //绌鸿皟閰嶇疆閫夋嫨绌洪棿 + var pickerView = new UIPickerView(); + pickerView.Y = rowOpen.Bottom; + pickerView.Height = Application.GetRealHeight(564); + frameBack.AddChidren(pickerView); + //杩欓噷鍔犱竴涓伄缃�,璁╁畠涓嶈兘鐐瑰嚮 + var framePickerShaw = new FrameLayout(); + framePickerShaw.Y = pickerView.Y; + framePickerShaw.Height = pickerView.Height; + framePickerShaw.BackgroundColor = 0x60ffffff; + frameBack.AddChidren(framePickerShaw); + //鎭掓俯鍣� Data1锛堟暟鍊硷級: 0鍔犵儹/1鍒跺喎/2鑷姩璋冭妭/3 璁剧疆宸ヤ綔妯″紡/4 璁剧疆鍔犵儹搴︽暟 5/璁剧疆鍒跺喎搴︽暟 6/璁剧疆椋庢墖妯″紡 + //鎭掓俯鍣―ata2鏁板�煎涓嬶細 + //銆愬綋Data1=0|1|2鏃讹紝Data2涓鸿鍙樺寲鐨勫害鏁帮紝鍗曚綅锛�0.1鈩� 銆傘�� + //銆愯嫢Data1=3锛孌ata2涓鸿璁惧畾鐨勭┖璋冩ā寮忥紙0-9锛夛紝0锛歰ff锛�1锛歛uto锛�3锛歝ool锛� 4锛歨eat 锛�5锛歟mergency heating, 6锛歱recooling锛�7锛歠an only 锛�8锛歞ry锛�9锛歴leep銆傘�� + //銆愯嫢Data1=4|5锛孌ata2涓哄姞鐑垨鍒跺喎搴︽暟锛屽崟浣�0.01鎽勬皬搴︺�傘�� + //銆愯嫢Data1=6锛孌ata2涓鸿璁惧畾鐨勯鎵囨ā寮忥紙0-6锛夛紝0锛歰ff锛�1锛歭ow锛�2锛歮edium锛�3锛歨igh锛�4锛歰n锛�5锛歛uto锛�6锛歴mart銆� + var listTemperature = new List<int>(); + var listTemperatureStr = new List<string>(); + for (int i = 16; i <= 32; i++) + { + listTemperature.Add(i); + listTemperatureStr.Add($"{i} 鈩�"); + } + //妯″紡 + var listMode = new List<int> { 1, 3, 4, 7, 8 }; + var listModeStr = new List<string> { + Language.StringByID(R.MyInternationalizationString.Mode_Auto), + Language.StringByID(R.MyInternationalizationString.Mode_Cool), + Language.StringByID(R.MyInternationalizationString.Mode_Heat), + Language.StringByID(R.MyInternationalizationString.Mode_FanOnly), + Language.StringByID(R.MyInternationalizationString.Mode_Dry) + }; + //椋庨�� + var listFan = new List<int> { 1, 2, 3 }; + var listFanStr = new List<string> { + Language.StringByID(R.MyInternationalizationString.Fan_Low), + Language.StringByID(R.MyInternationalizationString.Fan_Middle), + Language.StringByID(R.MyInternationalizationString.Fan_Height) + }; + pickerView.setNPicker(listTemperatureStr, listModeStr, listFanStr); + //绌鸿皟鎺т欢榛樿涓虹伆鑹� + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 0); + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 1); + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 2); + + //鎺т欢閫夋嫨浜嬩欢 + int selectTemperatureIndex = 0; + int selectModelIndex = 0; + int selectFanIndex = 0; + pickerView.OnSelectChangeEvent = (value1, value2, value3) => + { + //鏇存敼绱㈠紩 + selectTemperatureIndex = value1; + selectModelIndex = value2; + selectFanIndex = value3; + }; + //搴曠嚎 + var btnPickerLine = new NormalViewControl(btnOpenLine.Width, ControlCommonResourse.BottomLineHeight, false); + btnPickerLine.X = btnOpenLine.X; + btnPickerLine.Y = pickerView.Bottom; + btnPickerLine.BackgroundColor = UserCenterColor.Current.ButtomLine; + frameBack.AddChidren(btnPickerLine); + + //鍏� + var rowClose = new FrameRowControl(); + rowClose.Y = btnPickerLine.Bottom + Application.GetRealHeight(12); + rowClose.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft; + rowClose.RightOffset = ControlCommonResourse.XXLeft - Application.GetRealWidth(81); + frameBack.AddChidren(rowClose); + var btnClose = rowClose.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSimpleClose), 400); + btnClose.TextColor = UserCenterColor.Current.TextGrayColor3; + var btnCloseSelect = rowClose.AddMostRightEmptyIcon(58, 58); + btnCloseSelect.UnSelectedImagePath = "Item/ItemSelected.png"; + btnCloseSelect.Visible = false; + + //鐐瑰嚮寮� + rowOpen.ButtonClickEvent += (sender, e) => + { + if (btnOpenSelect.Visible == true) + { + //绌鸿皟鎺т欢鐗规晥 + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 0); + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 1); + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 2); + pickerView.setCurrentItems(selectTemperatureIndex, selectModelIndex, selectFanIndex); + framePickerShaw.Visible = true; + + //鍙栨秷,寮� 涓嶅彲鐢� + btnOpenSelect.Visible = false; + btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3; + } + else + { + //绌鸿皟鎺т欢鐗规晥 + pickerView.setTextColorCenter(UserCenterColor.Current.TextColor1, 0); + pickerView.setTextColorCenter(UserCenterColor.Current.TextColor1, 1); + pickerView.setTextColorCenter(UserCenterColor.Current.TextColor1, 2); + pickerView.setCurrentItems(selectTemperatureIndex, selectModelIndex, selectFanIndex); + framePickerShaw.Visible = false; + + //閫夋嫨鍥炬爣鍒囨崲 + btnOpenSelect.Visible = true; + btnCloseSelect.Visible = false; + + //寮� 鍙敤 + btnOpen.TextColor = UserCenterColor.Current.TextColor1; + //鍏� 涓嶅彲鐢� + btnClose.TextColor = UserCenterColor.Current.TextGrayColor3; + } + }; + //鐐瑰嚮鍏� + rowClose.ButtonClickEvent += (sender, e) => + { + if (framePickerShaw.Visible == false) + { + //绌鸿皟鎺т欢鐗规晥 + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 0); + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 1); + pickerView.setTextColorCenter(UserCenterColor.Current.TextGrayColor1, 2); + pickerView.setCurrentItems(selectTemperatureIndex, selectModelIndex, selectFanIndex); + framePickerShaw.Visible = true; + } + if (btnCloseSelect.Visible == true) + { + //鍙栨秷,鍏� 涓嶅彲鐢� + btnCloseSelect.Visible = false; + btnClose.TextColor = UserCenterColor.Current.TextGrayColor3; + } + else + { + //閫夋嫨鍥炬爣鍒囨崲 + btnCloseSelect.Visible = true; + btnOpenSelect.Visible = false; + + //鍏� 鍙敤 + btnClose.TextColor = UserCenterColor.Current.TextColor1; + //寮� 涓嶅彲鐢� + btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3; + } + }; + + //妫�娴嬬┖璋冪殑鎵撳紑鐘舵�� 0:鍏抽棴 1:鎵撳紑 + int openStatu = -1; + foreach (var data1 in dicTaskinfo.Keys) + { + var Taskinfo = dicTaskinfo[data1]; + if (data1 == 3) + { + if (Taskinfo.Data2 == 0) + { + //鍏崇姸鎬� + openStatu = 0; + } + else + { + //妯″紡 + selectModelIndex = listMode.IndexOf(Taskinfo.Data2); + openStatu = 1; + } + } + else if (data1 == 6) + { + //椋庨�� + selectFanIndex = listFan.IndexOf(Taskinfo.Data2); + openStatu = 1; + } + if (data1 == 4 || data1 == 5) + { + //娓╁害 + selectTemperatureIndex = listTemperature.IndexOf(Taskinfo.Data2 / 100); + openStatu = 1; + } + } + + //璁剧疆寮�鐨勯粯璁ゅ�� + if (openStatu == 1) + { + //璁剧疆绌鸿皟鐨勫垵濮嬪�� + pickerView.setCurrentItems(selectTemperatureIndex, selectModelIndex, selectFanIndex); + rowOpen.ButtonClickEvent?.Invoke(null, null); + } + else if (openStatu == 0) + { + rowClose.ButtonClickEvent?.Invoke(null, null); + } + + //瀹屾垚浜嬩欢 + btnFinish.ButtonClickEvent += (sender, e) => + { + var listData = new List<Safeguard.TaskListInfo>(); + //鍏� + if (btnCloseSelect.Visible == true) + { + var taskInfo = new Safeguard.TaskListInfo(); + taskInfo.TaskType = 5; + taskInfo.Data1 = 3; + taskInfo.Data2 = 0; + listData.Add(taskInfo); + } + //寮� + else if (btnOpenSelect.Visible == true) + { + //閫侀 + var taskInfo = new Safeguard.TaskListInfo(); + taskInfo.TaskType = 5; + taskInfo.Data1 = 6; + taskInfo.Data2 = listFan[selectFanIndex]; + listData.Add(taskInfo); + + //妯″紡 + var taskInfo2 = new Safeguard.TaskListInfo(); + taskInfo2.TaskType = 5; + taskInfo2.Data1 = 3; + taskInfo2.Data2 = listMode[selectModelIndex]; + listData.Add(taskInfo2); + + //娓╁害 + if (listMode[selectModelIndex] == 4) + { + //鍒剁儹 + var taskInfo3 = new Safeguard.TaskListInfo(); + taskInfo3.TaskType = 5; + taskInfo3.Data1 = 4; + taskInfo3.Data2 = listTemperature[selectTemperatureIndex] * 100; + listData.Add(taskInfo3); + } + else + { + //鎴戜篃涓嶇煡閬撹繖涓槸浠�涔堝垎鏀� + var taskInfo4 = new Safeguard.TaskListInfo(); + taskInfo4.TaskType = 5; + taskInfo4.Data1 = 5; + taskInfo4.Data2 = listTemperature[selectTemperatureIndex] * 100; + listData.Add(taskInfo4); + } + } + + //鑾峰彇鐘舵�佺殑鏄剧ず鏂囨湰 + string statuText = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(listData); + this.FinishSelectEvent(statuText, listData); + + this.CloseForm(); + }; + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + this.FinishSelectEvent = null; + base.CloseFormBefore(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectCurtainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectCurtainForm.cs index a4164ec..d1818c1 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectCurtainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectCurtainForm.cs @@ -286,7 +286,7 @@ } //鑾峰彇鐘舵�佺殑鏄剧ず鏂囨湰 - string statuText = HdlSafeguardLogic.Current.GetLightAlarmStatuText(listData); + string statuText = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(listData); this.FinishSelectEvent?.Invoke(statuText, listData); this.CloseForm(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs index aeb5165..996445d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs @@ -20,6 +20,10 @@ /// 鍔ㄤ綔淇℃伅 1 寮�鍏�/ 3浜害璋冭妭 /// </summary> private Dictionary<int, Safeguard.TaskListInfo> dicTaskinfo = new Dictionary<int, Safeguard.TaskListInfo>(); + /// <summary> + /// 杩涘害鏉℃渶澶у�� + /// </summary> + private int MaxValue = 254; #endregion @@ -131,13 +135,14 @@ detailBackFrame.AddChidren(btnPersent); if (dicTaskinfo.ContainsKey(3) == true) { - btnPersent.Text = dicTaskinfo[3].Data1 + "%"; + btnPersent.Text = ((int)(dicTaskinfo[3].Data1 * 1.0 / MaxValue * 100)) + "%"; } //杩涘害鏉� var seekBar = new SeekBarControl(919); seekBar.Y = Application.GetRealHeight(268); seekBar.ProgressBarColor = 0xfffdb500; + seekBar.MaxValue = this.MaxValue; seekBar.Enable = false; if (dicTaskinfo.ContainsKey(3) == true) { @@ -147,7 +152,7 @@ detailBackFrame.AddChidren(seekBar); seekBar.ProgressChangedEvent += (div, value) => { - btnPersent.Text = value + "%"; + btnPersent.Text = ((int)(value * 1.0 / MaxValue * 100)) + "%"; }; //绾� @@ -204,7 +209,7 @@ seekBar.Enable = true; if (seekBar.Progress == 0) { - seekBar.Progress = 100; + seekBar.Progress = MaxValue; btnPersent.Text = "100%"; } @@ -281,7 +286,7 @@ dicTaskinfo = null; //鑾峰彇鐘舵�佺殑鏄剧ず鏂囨湰 - string statuText = HdlSafeguardLogic.Current.GetLightAlarmStatuText(listData); + string statuText = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(listData); this.FinishSelectEvent?.Invoke(statuText, listData); this.CloseForm(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectSwitchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectSwitchForm.cs index 97290d5..afbb668 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectSwitchForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectSwitchForm.cs @@ -240,7 +240,7 @@ dicTaskinfo = null; //鑾峰彇鐘舵�佺殑鏄剧ず鏂囨湰 - string statuText = HdlSafeguardLogic.Current.GetLightAlarmStatuText(listData); + string statuText = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(listData); this.FinishSelectEvent(statuText, listData); this.CloseForm(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs index 3890e8f..caf8137 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs @@ -220,8 +220,8 @@ } var rowContact = new RowLayoutControl(); - rowContact.frameTable.UseClickStatu = false; listview.AddChidren(rowContact); + rowContact.frameTable.UseClickStatu = false; //鑱旂郴鏂瑰紡 rowContact.frameTable.AddLeftCaption(strPhone + " (" + data.PushNumberNote + ")", 800); rowContact.frameTable.AddBottomLine(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs index 06ff44c..5c4653d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs @@ -396,14 +396,18 @@ { //寮�鍚殣钘忚彍鍗� UserCenterResourse.HideOption.CenterHideMenu = 1; - this.ShowMassage(ShowMsgType.Tip, "Ok!"); } if (textValue == "0001") { var form = new Guide.GuideHouseForm(); form.ShowFrom(); - this.ShowMassage(ShowMsgType.Tip, "Ok!"); } + if (textValue == "12349") + { + //寮哄埗璺宠浆鐪熷疄璁惧鐣岄潰 + UserCenterResourse.HideOption.GotoRealDeviceForm = 1; + } + this.ShowMassage(ShowMsgType.Tip, "Ok!"); }); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs index 8998b82..5ad03f1 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs @@ -20,6 +20,9 @@ /// </summary> public void ShowForm() { + //璁颁綇瀹冨師鏉ョ殑鏄电О + UserCenterResourse.UserInfo.OldUserName = UserCenterResourse.UserInfo.UserName; + //鍥犱负鍒殑鐢婚潰浼氳皟鐢ㄨ繖涓嚱鏁帮紝鐒跺悗鍒锋柊鐢婚潰 this.ClearBodyFrame(); @@ -112,15 +115,27 @@ //杈撳叆缁撴潫浜嬩欢 txtName.FinishInputEvent += (() => { - if (txtName.Text.Trim() == string.Empty) - { - //鎶婂悕绉拌繕鍘熷洖鍘� - txtName.Text = UserCenterResourse.UserInfo.UserName; - return; - } //鏇存柊鐢ㄦ埛鍚� - this.SaveUserName(txtName.Text.Trim()); + this.SaveUserName(txtName, true); }); + //杈撳叆鍊兼敼鍙樹簨浠�(2020.04.05:浠ュ墠閮藉畾姝昏鎸夊洖杞﹂敭鎵嶆洿鏂�,鐜板湪鍙堣鍚嶅瓧娌℃湁鍚屾 + //鎵�浠ユ墠鍑烘涓嬬瓥,娣诲姞杩欎釜浜嬩欢) + txtName.TextChangeEventHandler += (sender, value) => + { + UserCenterResourse.UserInfo.UserName = value; + }; + //鍏夋爣鏀瑰彉浜嬩欢(2020.04.05:浠ュ墠閮藉畾姝昏鎸夊洖杞﹂敭鎵嶆洿鏂�,鐜板湪鍙堣鍚嶅瓧娌℃湁鍚屾 + //鎵�浠ユ墠鍑烘涓嬬瓥,娣诲姞杩欎釜浜嬩欢) + txtName.FoucsChanged += (sender, focusEvent) => + { + //鍏夋爣绂诲紑鏃�,鎵ц鍚嶅瓧淇敼 + if (focusEvent.Focus == false) + { + //鏇存柊鐢ㄦ埛鍚� + this.SaveUserName(txtName, false); + } + }; + //鑱斿姩绾跨殑鐘舵�� txtName.btnLine = btnNameLine; @@ -300,32 +315,38 @@ /// <summary> /// 鏇存柊鐢ㄦ埛鍚� /// </summary> - /// <param name="userName">鏄电О</param> - private async void SaveUserName(string userName) + /// <param name="txtName"></param> + private async void SaveUserName(TextInputExControl txtName, bool showMsg) { - if (UserCenterResourse.UserInfo.UserName == userName) + if (UserCenterResourse.UserInfo.UserName == string.Empty) { + //鎶婂悕绉拌繕鍘熷洖鍘� + txtName.Text = UserCenterResourse.UserInfo.OldUserName; + UserCenterResourse.UserInfo.UserName = UserCenterResourse.UserInfo.OldUserName; return; } - //鎵撳紑杩涘害鏉� - this.ShowProgressBar(); - + if (UserCenterResourse.UserInfo.OldUserName == UserCenterResourse.UserInfo.UserName) + { + //鏃犻渶淇敼 + return; + } var pra = new SaveUserNamePra(); - pra.UserName = userName; + pra.UserName = UserCenterResourse.UserInfo.UserName; bool result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdateUserName", false, pra); - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); if (result == false) { return; } - //鐢ㄦ埛鍚嶇О淇敼鎴愬姛! - string msg = Language.StringByID(R.MyInternationalizationString.uUserNameSaveSuccess); - this.ShowMassage(ShowMsgType.Tip, msg); + if (showMsg == true) + { + //鐢ㄦ埛鍚嶇О淇敼鎴愬姛! + string msg = Language.StringByID(R.MyInternationalizationString.uUserNameSaveSuccess); + this.ShowMassage(ShowMsgType.Tip, msg); + } - UserCenterResourse.UserInfo.UserName = userName; + UserCenterResourse.UserInfo.OldUserName = UserCenterResourse.UserInfo.UserName; } #endregion diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs index d273095..080a125 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs @@ -72,6 +72,11 @@ /// <para>瀹氫箟瀵硅薄锛歅anel</para> /// </summary> OtaDevice = 49153, + /// 鏂伴绌鸿皟 + /// <para>璁惧ID涓�53504</para> + /// <para>瀹氫箟瀵硅薄锛欶reshAirAC</para> + /// </summary> + FreshAirAC = 0xD100, /// 杞崲鍣� /// <para>璁惧ID涓�53251</para> /// <para>瀹氫箟瀵硅薄锛歍ransverter</para> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs index 90476ec..33bb1bc 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs @@ -983,8 +983,8 @@ /// <summary> /// 鐭闂ㄩ攣鏃堕棿 /// </summary> - /// <returns>The writable value async.</returns> - /// <param name="timestamp">鐭闂ㄩ攣鐨勬椂闂�</param> + /// <param name="timestamp"></param> + /// <returns></returns> public async System.Threading.Tasks.Task<SetWritableValueResponAllData> RectifyDoorLockTimeAsync(int timestamp) { if (Gateway == null) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs index 267baa4..7006480 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs @@ -467,7 +467,7 @@ /// 璁惧鍒楄〃 /// 褰揟ype=0鏃跺瓨鍦� /// </summary> - public List<TaskListInfo> TaskList = new List<TaskListInfo>(); + public List<Safeguard.TaskListInfo> TaskList = new List<Safeguard.TaskListInfo>(); /// <summary> /// 鍦烘櫙鎴愬憳鐨勫満鏅痠d @@ -483,63 +483,8 @@ /// 鍦烘櫙鍔ㄤ綔搴忓彿锛岃〃绀虹鍑犱釜鍔ㄤ綔 /// </summary> public int MemberNumber; - - - - - } - /// <summary> - /// 浠诲姟鍒楄〃涓殑鏁版嵁 - /// </summary> - [System.Serializable] - public class TaskListInfo - { - /// <summary> - /// 浠诲姟绫诲瀷銆� - ///<para>1锛氬紑鍏� 锛堣澶囧叿鏈夊紑鍏冲姛鑳芥椂鍙敤锛�</para> - ///<para>3锛氫寒搴﹁皟鏁达紙璁惧鍏锋湁浜害璋冭妭鍔熻兘鏃跺彲鐢級</para> - ///<para>4锛氶鑹茶皟鏁� 锛堣澶囧叿鏈夐鑹茶皟鑺傚姛鑳芥椂鍙敤锛�</para> - ///<para>5锛氭亽娓╁櫒锛堣澶囧叿鏈夋亽娓╁櫒鍔熻兘鏃跺彲鐢級</para> - ///<para>6: 绐楀笜璁惧锛堣澶囧叿鏈夌獥甯樺姛鑳芥椂鍙敤锛�</para> - ///<para>7锛氳澶噄dentify璇嗗埆銆�</para> - ///<para>8锛氬紑鍏虫姤璀︽ā寮� </para> - ///<para>9锛歴quawk command</para> - ///</summary> - public int TaskType; - /// <summary> - /// Data1鍙栧�� - /// <para>寮�鍏� :Data1锛堟暟鍊硷級: 0鍏�/1寮�</para> - ///<para>浜害璋冩暣 Data1锛堟暟鍊硷級锛氫寒搴﹀��</para> - ///<para>棰滆壊璋冩暣 Data1锛堟暟鍊硷級:鑹茶皟</para> - /// <para>鎭掓俯鍣� Data1锛堟暟鍊硷級: 0鍔犵儹/1鍒跺喎/2鑷姩璋冭妭/3 璁剧疆宸ヤ綔妯″紡/4 璁剧疆鍔犵儹搴︽暟 5/璁剧疆鍒跺喎搴︽暟 6/璁剧疆椋庢墖妯″紡</para> - /// <para>绐楀笜璁惧 Data1锛堟暟鍊硷級: 0 鎵撳紑/ 1鍏抽棴/ 2 鍋滄杞姩/ 4 璋冩暣鍒版寚瀹氶珮搴�/ 5 璋冩暣鍒版寚瀹氱殑鐧惧垎姣斿浣嶇疆 / 7 璋冩暣鍒版寚瀹氬�炬枩瑙�/ 8 璋冩暣鍒版寚瀹氱殑鐧惧垎姣斿�炬枩搴�</para> - /// <para>璁惧identify璇嗗埆銆侱ata1涓篿dentify闂儊闂儊鏃堕棿锛�0-65535绉掞級銆�</para> - /// <para>寮�鍏虫姤璀︽ā寮� Data1锛堟暟鍊硷紝4瀛楄妭鏁村瀷锛夌1瀛楄妭锛坆it0-bit7锛夎〃绀烘姤璀︽ā寮忥紝瀛楄妭鍊�0锛氬仠姝㈣渹楦e櫒1锛氱洍绐冩姤璀� 2锛氱伀鐏炬姤璀� 3锛氱揣鎬ユ儏鍐垫姤璀� 4锛氳杞﹀彂鍑虹殑鎶ヨ 5锛氭秷闃茶溅鍙戝嚭鐨勬姤璀� 6锛氬鐢ㄧ殑鎶ヨ銆傜2瀛楄妭锛坆it8-bit15锛夎〃绀烘槸鍚﹀惎鐢ㄦ姤璀︾伅锛屽瓧鑺傚�� 0锛氫笉鍚敤 1锛氬惎鐢ㄣ�傜3瀛楄妭锛坆it16-bit23锛夎〃绀烘姤璀﹂煶閲忥紝瀛楄妭鍊�0锛歀ow锛�1锛歁edium锛�2锛歨igh锛�3锛歷ery high銆�</para> - /// <para>squawk command Data1锛堟暟鍊硷紝4瀛楄妭鏁村瀷锛夌1瀛楄妭锛坆it0-bit7锛夎〃绀烘姤璀︽ā寮忥紝瀛楄妭鍊�0锛氬畨闃茬郴缁熲�滃竷闃测�濋煶鏁堚�� 锛�1锛氬畨闃茬郴缁熲�滄挙闃测�濋煶鏁堛�傜2瀛楄妭锛坆it8-bit15锛夎〃绀烘槸鍚﹀惎鍔ㄦ姤璀︾伅锛屽瓧鑺傚��0锛氫笉鍚姩锛�1锛氬惎鍔ㄣ�傜3瀛楄妭锛坆it16-bit23锛夎〃绀烘姤璀﹂煶閲忥紝瀛楄妭鍊�0锛歀ow 锛�1锛歁edium 锛�2锛歨igh 锛�3: very high銆�</para> - /// </summary> - public int Data1; - /// <summary> - /// Data2鍙栧�� - /// <para>寮�鍏� Data2锛堟暟鍊硷級: 0</para> - /// <para>浜害璋冩暣 Data2锛堟暟鍊硷級: 0</para> - /// <para>棰滆壊璋冩暣 Data2锛堟暟鍊硷級锛氶ケ鍜屽害 </para> - ///<para> 鎭掓俯鍣―ata2鏁板�煎涓嬶細 - /// 銆愬綋Data1=0|1|2鏃讹紝Data2涓鸿鍙樺寲鐨勫害鏁帮紝鍗曚綅锛�0.1鈩� 銆傘�� - ///銆愯嫢Data1=3锛孌ata2涓鸿璁惧畾鐨勭┖璋冩ā寮忥紙0-9锛夛紝0锛歰ff锛�1锛歛uto锛�3锛歝ool锛� 4锛歨eat 锛�5锛歟mergency heating, 6锛歱recooling锛�7锛歠an only 锛�8锛歞ry锛�9锛歴leep銆傘�� - ///銆愯嫢Data1=4|5锛孌ata2涓哄姞鐑垨鍒跺喎搴︽暟锛屽崟浣�0.01鎽勬皬搴︺�傘�� - ///銆愯嫢Data1=6锛孌ata2涓鸿璁惧畾鐨勯鎵囨ā寮忥紙0-6锛夛紝0锛歰ff锛�1锛歭ow锛�2锛歮edium锛�3锛歨igh锛�4锛歰n锛�5锛歛uto锛�6锛歴mart銆� </para> - ///<para>绐楀笜璁惧锛孌ata2鏁板�煎涓� - ///銆愬綋Data1=4鎴�7锛孌ata2涓鸿皟鏁寸殑楂樺害鎴栧�炬枩瑙掑害 鍊炬枩瑙掑害鍗曚綅涓�0.1掳銆戙�� - ///銆愬綋Data1=5 鎴� 8锛孌ata2涓虹櫨鍒嗘瘮锛�0-100琛ㄧず0%-100%銆�</para> - ///<para>璁惧identify璇嗗埆銆侱ata2锛堟暟鍊硷級: 0 </para> - ///<para>寮�鍏虫姤璀︽ā寮� Data2锛堟暟鍊硷紝4瀛楄妭鏁村瀷锛夌1銆�2瀛楄妭锛坆it0-bit15锛夎〃绀烘姤璀︽椂闀匡紝瀛楄妭鍊� 0-65535锛屽崟浣嶏細绉掋�傜3瀛楄妭锛坆it16-bit23锛夎〃绀洪棯鐑佸崰绌烘瘮锛屽瓧鑺傚��0-100銆傜4瀛楄妭锛坆it16-bit23锛夎〃绀烘姤璀︾伅浜害锛屽瓧鑺傚��0锛歀ow 锛�1锛歁edium 锛�2锛歨igh 锛�3: very high銆�</para> - ///<para>squawk command锛欴ata2锛堟暟鍊硷級: 0 </para> - /// </summary> - /// <value>The type of the task.</value> - public int Data2; - } #endregion #region 鑾峰彇鍦烘櫙鍒楄〃 @@ -1192,7 +1137,7 @@ /// 璁惧鍒楄〃 /// <para>Type=0鏃跺瓨鍦�</para> /// </summary> - public List<TaskListInfo> TaskList = new List<TaskListInfo>(); + public List<Safeguard.TaskListInfo> TaskList = new List<Safeguard.TaskListInfo>(); } #endregion diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs index 8d8cbea..ca05683 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs @@ -143,12 +143,6 @@ public List<CommonDevice> DeviceList = new List<CommonDevice>(); /// <summary> - /// 鎵�鏈夌綉鍏充腑鐨勮澶囧垪琛� - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public List<CommonDevice> AllGatewayDeviceList = new List<CommonDevice>(); - - /// <summary> /// 缃戝叧涓満鏅垪琛� /// 涓�涓満鏅腑鍖呭惈鎵�鏈変俊鎭紝鍖呮嫭鍦烘櫙璁惧淇℃伅 /// </summary> @@ -160,28 +154,6 @@ /// </summary> [Newtonsoft.Json.JsonIgnore] public List<Scene.GetSceneDeviceListInfo> SceneDeviceList = new List<Scene.GetSceneDeviceListInfo>(); - - /// <summary> - /// 缃戝叧涓環dl绉佹湁鎸夐敭缁戝畾鍒楄〃 - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public List<HDLbutton> HdlButtonList = new List<HDLbutton>(); - - //缃戝叧涓柊鐨勮澶囧垪琛� - [Newtonsoft.Json.JsonIgnore] - public List<CommonDevice> ListNewDeviceInfoData = new List<CommonDevice>(); - - /// <summary> - /// 绉佹湁鎸夐敭淇℃伅鍒楄〃 - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public System.Collections.Generic.Dictionary<string, HDLbutton> hdlButtonInfoList = new Dictionary<string, HDLbutton>(); - - /// <summary> - /// 浼犳劅鍣ㄤ俊鎭垪琛� - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public System.Collections.Generic.Dictionary<string, Scene.TaskListInfo> sceneTaskInfoList = new Dictionary<string, Scene.TaskListInfo>(); #region action variable /// <summary> diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs index 34c8a35..69b7488 100755 --- a/ZigbeeApp/Shared/R.cs +++ b/ZigbeeApp/Shared/R.cs @@ -466,6 +466,59 @@ /// 纭畾瑕佸彇娑堣鎴愬憳鎷ユ湁杩滅▼寮�閿佹潈闄愬悧锛� /// </summary> public const int SureCancelAccessToSubaccount = 268; + /// <summary> + /// 鏃跺尯 + /// </summary> + public const int CurZoneText0 = 269; + public const int CurZoneText1 = 270; + public const int CurZoneText2 = 271; + public const int CurZoneText3 = 272; + public const int CurZoneText4 = 273; + public const int CurZoneText5 = 274; + public const int CurZoneText6 = 275; + public const int CurZoneText7 = 276; + public const int CurZoneText8 = 277; + public const int CurZoneText9 = 278; + public const int CurZoneText10 = 279; + public const int CurZoneText11 = 280; + public const int CurZoneText12 = 281; + public const int WestZoneText1 = 282; + public const int WestZoneText2 = 283; + public const int WestZoneText3 = 284; + public const int WestZoneText4 = 285; + public const int WestZoneText5 = 286; + public const int WestZoneText6 = 287; + public const int WestZoneText7 = 288; + public const int WestZoneText8 = 289; + public const int WestZoneText9 = 290; + public const int WestZoneText10 = 291; + public const int WestZoneText11 = 292; + public const int WestZoneText12 = 293; + /// <summary> + /// 鐢熸晥鏃ユ湡涓嶈兘灏忎簬褰撳墠鏃ユ湡 + /// </summary> + public const int ValidTimeNoLessThanCurrentTime = 294; + /// <summary> + /// 鐢熸晥鏃堕棿涓嶈兘澶т簬澶辨晥鏃堕棿 + /// </summary> + public const int ValidTimeNoMoreThanInValidTime = 295; + /// <summary> + /// 澶辨晥鏃堕棿涓嶈兘灏忎簬鐢熸晥鏃堕棿 + /// </summary> + public const int InvalidTimeNoLessThanValidTime = 296; + /// <summary> + /// 澶辨晥鏃堕棿涓嶈兘鐪佺暐 + /// </summary> + public const int InvalidTimeIsEmpty = 297; + /// <summary> + /// 澶辨晥鏃堕棿涓嶈兘澶т簬36灏忔椂 + /// </summary> + public const int InvalidTimeMoreThan36 = 298; + /// <summary> + /// 澶辨晥鏃堕棿涓嶈兘灏忎簬1灏忔椂 + /// </summary> + public const int InvalidTimeLessThan1 = 299; + public readonly static int cancel = 5097; public readonly static int confrim = 5098; @@ -722,6 +775,7 @@ public readonly static int tiplocktextnull = 5379; public readonly static int openmode = 5380; public readonly static int addnull = 5381; + public readonly static int look = 5382; #region 鐧诲綍娉ㄥ唽 /// <summary> @@ -5489,8 +5543,34 @@ /// 鍒嗕韩浣忓畢宸叉洿鏀癸紝璇疯仈绯荤鐞嗗憳锛� /// </summary> public const int uShardResidenceHadDeletePleaseTakeToAdmin = 16080; - - + /// <summary> + /// 鑾峰彇鎵ц鐩爣澶辫触 + /// </summary> + public const int uGetAdjustTargetFail = 16081; + /// <summary> + /// 娌℃湁鍙互娣诲姞鐨勫満鏅� + /// </summary> + public const int uNotHadAddScene = 16082; + /// <summary> + /// 璇锋坊鍔犳墽琛岀洰鏍� + /// </summary> + public const int uPleaseAddAdjustTarget = 16083; + /// <summary> + /// 娣诲姞鎵ц鐩爣澶辫触 + /// </summary> + public const int uAddAdjustTargetFail = 16084; + /// <summary> + /// 涓埆鎵ц鐩爣娣诲姞澶辫触 + /// </summary> + public const int uSomeAdjustTargetAddFail = 16085; + /// <summary> + /// 鍒濆鍖栨墽琛岀洰鏍囧け璐� + /// </summary> + public const int uInitAdjustTargetFail = 16086; + /// <summary> + /// 淇敼鍦烘櫙鍚嶇О澶辫触 + /// </summary> + public const int uEditorSceneNameFail = 16087; //鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� /// <summary> diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems index b5793a5..dfe23a5 100755 --- a/ZigbeeApp/Shared/Shared.projitems +++ b/ZigbeeApp/Shared/Shared.projitems @@ -20,6 +20,9 @@ <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\UserLoginLocalRegionRes.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Pad\MainPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\AddOrEditorSceneForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\AdjustTargetAddDelayTimeForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\AdjustTargetAddDeviceForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\AdjustTargetAddSceneForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\CategoryMainForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\Base\DeviceRowCommon.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceAcRowControl.cs" /> @@ -230,6 +233,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueEnvironmentTargetForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirBackLightSettionForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirButtonSettionForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirTargetForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFunctionSettionForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\PirSensor\PirSensorDimmingModeForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\PirSensor\PirSensorTargetSelectForm.cs" /> @@ -293,6 +297,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\LookRoomDeviceListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\ResidenceManagementForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\LookRoomSettionForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Safety\AlarmTargetStatuSelectAcForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Safety\CoercePswAddNewForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Safety\CoercePswEditorForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Safety\PasswordUserEditorForm.cs" /> -- Gitblit v1.8.0