From 21923381bdac04d1633b168c97accc81f0898d84 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 23 三月 2020 16:45:31 +0800
Subject: [PATCH] 上传版本
---
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 183
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 228
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 38
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs | 6
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerZbGatewaySelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs | 76
ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainAutoOpenSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs | 41
ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterSelected2.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs | 10
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 18
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected.png | 0
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs | 113
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorDoorWindowSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureHumiditySelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerZbGatewaySelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs | 147
ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueTwoButtonTable.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksH06CSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected2.png | 0
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs | 2
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorInfraredSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs | 5
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs | 37
ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs | 26
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs | 591 +
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs | 12
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs | 6
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs | 96
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/ProgressBackground.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs | 5
ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs | 53
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/LowPower.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs | 35
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorDoorWindowSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Converter.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIcon.png | 0
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2
ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterZigbeeSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueTwoSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterZigbeeSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorWaterSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorInfraredSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayEpointSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13Icon.png | 0
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs | 66
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power60.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs | 36
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected.png | 0
ZigbeeApp/Home.Ios/Home.IOS.csproj | 120
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power100.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs | 113
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelOneSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs | 51
ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelCurtain.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorHumiditySelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSiphonateSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorCarbonMonoxideSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/BindPic/FreshAirIcon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayThreeLoadSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/Socket1Selected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs | 1
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/LightSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOn.png | 0
ZigbeeApp/Shared/Phone/Device/CommonForm/CommonFormResouce.cs | 8
ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs | 30
ZigbeeApp/Home.Ios/Resources/Phone/Device/DryContactSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIconOn.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power100.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPirSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs | 2
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFourSelected2.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs | 3
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelCurtain.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorSelected2.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs | 98
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/ProgressBackground.png | 0
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs | 455 +
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs | 36
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4Icon.png | 0
ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 1471 ++++
ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs | 19
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEightSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power40.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DryContactSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 26
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/14IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchCloudContrSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5Icon.png | 0
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs | 111
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11Icon.png | 0
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs | 13
ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs | 91
ZigbeeApp/Shared/Common/ZigbeeColor.cs | 18
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected2.png | 0
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceSensorRowControl.cs | 25
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorFireSelected2.png | 0
ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs | 54
ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOffline.png | 0
ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs | 39
ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs | 49
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected2.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs | 13
ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs | 20
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs | 24
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFourSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 1171 ++
ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs | 11
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected2.png | 0
ZigbeeApp/Shared/Shared.projitems | 30
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected.png | 0
ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs | 765 ++
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power60.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFourSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayThreeLoadSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueFourButtonTable.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected2.png | 0
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs | 111
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs | 112
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainAutoOpenSelected2.png | 0
ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs | 12
ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs | 113
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs | 12
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs | 4
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23Icon.png | 0
ZigbeeApp/Shared/Phone/Login/AccountLogin.cs | 331
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs | 35
ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideForm2.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs | 49
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17Icon.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs | 17
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs | 162
ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs | 9
ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 26
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorHumiditySelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs | 21
ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs | 19
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs | 41
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtain.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/Converter.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 170
ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs | 26
ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomShadow.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs | 79
ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4Icon.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs | 32
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 119
ZigbeeApp/Home.Ios/AppDelegate.cs | 1
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs | 23
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 8
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIconOn.png | 0
ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs | 26
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs | 84
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs | 37
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15Icon.png | 0
ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 597 +
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/PowerOffline.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs | 10
ZigbeeApp/Shared/Phone/ZigBee/Common/IStatus.cs | 15
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs | 84
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs | 33
ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs | 5
ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs | 139
ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs | 7
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPirSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected2.png | 0
ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs | 12
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelThreeSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected2.png | 0
ZigbeeApp/Home.Ios/Info.plist | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorWaterSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOffline.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs | 359
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SwitchSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power40.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485Selected2.png | 0
ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs | 315
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs | 42
ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs | 7
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelThreeSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Room/RoomShadow.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs | 406
ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs | 44
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs | 10
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIcon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueTwoButtonTable.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected.png | 0
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll | 0
ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 347
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3Icon.png | 0
ZigbeeApp/Shared/Common/CommonPage.cs | 7
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 10
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 2
ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs | 25
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOn.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs | 5
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs | 13
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorFireSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9Icon.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs | 13
ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightOneLoadSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchCloudContrSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power80.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksH06CSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSiphonateSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 11
ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs | 25
ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelCurtain.png | 0
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs | 204
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected2.png | 0
ZigbeeApp/Shared/R.cs | 180
ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelCurtain.png | 0
ZigbeeApp/Shared/Common/Logic.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs | 8
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs | 227
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtainSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs | 36
ZigbeeApp/Home.Ios/Resources/Phone/Device/LightSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 137
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs | 644 +
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs | 937 +-
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected2.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs | 13
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1Selected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/14IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueEightButtonTable.png | 0
ZigbeeApp/Shared/Common/House.cs | 2
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Language.ini | 176
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 130
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs | 4
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDryContactCardControl.cs | 77
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/GatewayBackupEnum.cs | 4
ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueFourButtonTable.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19Icon.png | 0
ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 328
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs | 10
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485Selected2.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs | 125
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected.png | 0
ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs | 26
ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/FreshAirIcon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayEpointSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/LowPower.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs | 39
ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs | 6
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelOneSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/PowerOffline.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs | 375 +
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs | 18
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs | 14
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelTwoSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs | 7
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorCarbonMonoxideSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs | 13
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 25
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtain.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelaySelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs | 34
ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs | 4
ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs | 30
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs | 38
ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs | 26
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2Icon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power80.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/RelaySelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs | 11
ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 1209 +++
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEightSelected2.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs | 15
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelTwoSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFourSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected.png | 0
ZigbeeApp/Shared/Common/SceneUI.cs | 12
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtainSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightOneLoadSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs | 124
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs | 26
ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs | 101
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelTable.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Language.ini | 176
ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueEightButtonTable.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs | 81
ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureHumiditySelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs | 93
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerEpointSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26Icon.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs | 176
ZigbeeApp/Home.Ios/Resources/Phone/Device/SwitchSelected2.png | 0
ZigbeeApp/Shared/Common/Device.cs | 150
ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs | 289
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDevice.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected2.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelTable.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs | 331
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs | 54
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8Icon.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueTwoSelected2.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected.png | 0
/dev/null | 3770 ----------
ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26Icon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs | 21
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDevice.png | 0
ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 403 -
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs | 5
477 files changed, 13,725 insertions(+), 8,172 deletions(-)
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
index 88e7404..9c7a3d0 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini
+++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -234,139 +234,44 @@
228=纭
229=鍒嗛厤鎴愬姛
230=纭畾瑕佸皢璇ヨ处鎴疯В鍐伙紵
-548=鎻愰啋璁剧疆
-550=鏂板鐢ㄦ埛
-551=澶村儚
-552=宸茬紪杈�
-553=鎸囩汗鍒楄〃
-554=鏈紪杈戝瘑鐮�
-555=鏈紪杈戞劅搴斿崱
-556=鍦烘櫙缂栬緫
-557=鏈紪杈戝満鏅�
-558=鏂板悕瀛�
-559=鍘熷悕瀛�
-560=绯荤粺璁剧疆
-561=瀵嗙爜鍒楄〃
-562=淇敼澶囨敞
-563=涓存椂瀵嗙爜
-564=鎰熷簲鍗�
-565=澶囨敞涓虹┖
-566=楠岃瘉鎴愬姛
-567=楠岃瘉棰戠箒锛岃5绉掑悗閲嶆柊鎿嶄綔
-568=鏈夋晥娆℃暟涓嶈秴杩�15娆�
-569=鏈夋晥鏃舵:
-570=鏈夋晥娆℃暟:
-571=鏃跺埢
-572= 娆�
-573=璇ヤ复鏃跺瘑鐮佹湁鏁�2娆�
-574=鐢熸垚涓存椂瀵嗙爜
-575=鏃� 鏈�
-576=鍒囨崲妯″紡浼氭竻闄ゆ寜閿腑鎵�鏈夌殑鐩爣锛岀‘瀹氳鍒囨崲鍚�
-577=鐭鏃堕棿
-578=鑷姩鐭鏃堕棿
-579=鎵嬪姩鐭鏃堕棿
-580=鍒�
-581=璁剧疆鎴愬姛
-582=璁剧疆澶辫触
-583=鍔ㄦ�佸瘑鐮�
-584=纭畾瑕侀噸鏂扮敓鎴愪复鏃跺姩鎬佸瘑鐮佸悧
-585=鎵�鏈夐�氱煡鎻愰啋
-586=寮�鍏抽棬鎻愰啋
-587=浣庣數鍘嬫姤璀�
-588=闃叉挰鎶ヨ
-589=闂ㄦ湭鍏虫姤璀�
-590=閿欒鎶ヨ
-591=閫氱煡鎻愰啋
-592=鎵嬫満鎺ㄩ�佹姤璀︿俊鎭�
-593=涓嶉�氱煡
-594=绫诲瀷
-595=鐢ㄦ埛
-596=鎸囩汗
-597=瀵嗙爜
-598=IC鍗�
-599=閽ュ寵
-600=杩滅▼
-601=涓存椂瀵嗙爜
-602=閽ュ寵
-603=瀵嗙爜閿欒
-604=闂ㄦ湭閿佸ソ
-605=鍔寔
-606=鐢甸噺涓嶈冻
-607=鎸囩汗閿欒
-608=鍗$墖閿欒
-609=寮�閿侊細
-610=鎶ヨ锛�
-611=寮�閿侀�氱煡
-612=淇℃伅鏇存敼
-614=鍙�夊満鏅�
-615=鍦烘櫙涓病鏈夌洰鏍囷紝鎺у埗澶辫触
-616=鐩爣閰嶇疆涓�
-617=鐩爣閰嶇疆鎴愬姛
-618=鎶ヨ鍦烘櫙璁剧疆
-619=璇疯緭鍏�6浣嶆暟瀛楀瘑鐮�
-620=璁剧疆瀵嗙爜闇�瑕佹寜璁惧鎸夐敭
-621=璇疯緭鍏�6浣嶅瘑鐮�
-622=瀵嗙爜鍙戦�佸け璐�
-623=鏇存敼瀵嗙爜鏃跺厛鍦ㄨ緭鍏ュ師瀵嗙爜
-624=璁剧疆瀵嗙爜闇�瑕佹寜璁惧閿�5s
-625=鏇存敼瀵嗙爜鏃跺厛杈撳叆鍘熷瘑鐮佺劧鍚庨暱鎸夎澶囨寜閿�5s鎵嶈兘鏇存敼瀵嗙爜
-626=鏃堕棿璁剧疆
-627=楠岃瘉棰戠箒锛岃15绉掑悗鍐嶆搷浣�
-628=璁惧涓嶅湪绾�
-629=璁剧疆瀵嗙爜
-630=鐢ㄦ埛鍚�
-631=鎵�鏈夐棬閿�
-632=瀵嗙爜涓嶅瓨鍦ㄣ�傚缓璁缃柊瀵嗙爜
-633=纭畾瑕佹洿鏀瑰瘑鐮佸悧
-634=鎵�鏈夊巻鍙茶褰�
-635=璁剧疆瀵嗙爜
-636=鎵惧洖瀵嗙爜
-637=璐︽埛瀵嗙爜
-638=璐︽埛瀵嗙爜閿欒
-639=鎵�鏈夎褰�
-640=杩滅▼寮�閿佸瘑鐮佽缃�/鏇存敼
-641=杩樻病璁剧疆瀵嗙爜
-642= 杩滅▼寮�閿佸瘑鐮佸凡缁忚缃�
-643= 娆㈣繋浣跨敤杩滅▼寮�閿�
-644=棣栨浣跨敤璇疯缃繙绋嬪紑閿佸瘑鐮�
-645=鐜板湪璁剧疆
-646=绋嶅悗璁剧疆
-647=绋嶅悗璇峰墠寰�绯荤粺璁剧疆涓缃垨鑰呮洿鏀瑰瘑鐮�
-648=璁剧疆6浣嶅瘑鐮�
-649=璇疯缃�6浣嶆柊瀵嗙爜
-650=璐︽埛瀵嗙爜涓虹┖
-651=鍦烘櫙鎶ヨ璁剧疆
-652=璁剧疆鐩爣澶辫触锛岃鍦ㄥ満鏅腑娣诲姞閫昏緫妯″潡
-653=鎺у埗澶辫触
-654=鏈煡鎸囩汗
-655=璇锋鏌ョ綉缁�
-656=鏈煡IC鍗�
-657=纭畾鎵撳紑鎶ヨ鎻愰啋?
-658=纭畾鍏抽棴鎶ヨ鎻愰啋锛�
-659=鎸囩汗璁板綍
-660=瀵嗙爜璁板綍
-661=IC鍗¤褰�
-662=杩滅▼璁板綍
-663=鎺ㄩ��
-664=鐢ㄦ埛
-665=璇疯緭鍏ユ帹閫佸唴瀹�
-666=褰撳墠宸茬粡閰嶇疆浜嗗満鏅紝纭畾瑕佹浛鎹㈠悧锛�
-667=鏀瑰満鏅凡缁忛�変腑
-668=娌℃湁鍙戠幇缃戝叧
-669=鍚屾閫氱煡鎴愬姛
-670=鍚屾閫氱煡澶辫触
-671=纭畾鍙戦�侀�氱煡鍚楋紵
-672=鎵撳紑闂ㄩ攣鎶ヨ鎴愬姛
-673=鎵撳紑闂ㄩ攣鎶ヨ澶辫触
-674=鍏抽棴闂ㄩ攣鎶ヨ鎴愬姛
-675=鍏抽棴闂ㄩ攣鎶ヨ澶辫触
-676=鍙戦�侀�氱煡鎴愬姛
-677=鍙戦�侀�氱煡澶辫触
-678=鎶ヨ閫氱煡
-679=宸茬粡缂栬緫鍦烘櫙
-680=鏈煡瀵嗙爜
-
-
+231=鎺ヨ繎鎰熷簲
+232=鎺ヨ繎鎰熷簲鍔熻兘璁剧疆缃け璐�
+233=鑾峰彇鎺ヨ繎鎰熷簲鍔熻兘澶辫触
+234=鏂规偊鏂伴灏忔ā鍧�
+235=鎸変綇闈㈡澘妯″紡锛圡ode)鍜岄閫燂紙Fan)鎸夐敭{0}缁胯壊鎸囩ず鐏寒璧枫�傚垯閰嶇綉鎴愬姛
+;涓夋寜閿潰鏉垮叆缃戞搷浣滄寚绀�
+236=缁胯壊鎸囩ず鐏棯鐑�
+237=鎸囩ず鐏�
+238=闀挎寜5绉掞紙鎸夐敭锛�
+239=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛
+;涓夋寜閿潰鏉垮叆缃戞搷浣滄寚绀�
+240= S-one
+241=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵
+242=鐢甸噺
+243=甯稿紑妯″紡宸插紑鍚�
+244=澶辨晥璁剧疆
+245=鑷姩鍖�
+246=闂ㄩ攣濮嬬粓鎵撳紑{0}灏忔椂
+247=褰撳墠鏃跺尯
+248=鍙栨秷甯稿紑
+249=鎮ㄧ殑甯稿紑妯″紡灏嗚鍙栨秷
+250=淇濇寔甯稿紑
+251=纭鍙栨秷
+252=(鏈鎿嶄綔浠呬负鍗曟鍙栨秷锛岃嫢闇�瑕佸仠姝㈡墽琛岃嚜鍔ㄥ寲锛岃閫夋嫨鍒嗙被-鑷姩鍖栬繘琛岃缃�)
+253=鑾峰彇闂ㄩ攣甯稿紑妯″紡澶辫触
+254=鎵撳紑闂ㄩ攣甯稿紑妯″紡鎴愬姛
+255=鎵撳紑闂ㄩ攣甯稿紑妯″紡澶辫触
+256=鍏抽棴闂ㄩ攣甯稿紑妯″紡鎴愬姛
+257=鍏抽棴闂ㄩ攣甯稿紑妯″紡鎴愬姛
+258=甯稿紑妯″紡涓嬫棤娉曟搷浣�
+259=澶辨晥鏃堕棿涓嶅悎娉曪紝璇烽噸鍐欒缃�
+260=闊抽噺璁剧疆澶辫触
+261=闊抽噺璁剧疆鎴愬姛
+262=褰撳墠鏃跺尯
+263=鍖�
+264=涓�
+265=瑗�
+266=褰撳墠璁惧涓嶆敮鎸佽鍔熻兘
5097=鍙栨秷
5098=纭畾
@@ -621,6 +526,7 @@
5377=娌℃湁鑷姩鍖杮\r\n} 璇风偣鍑诲彸涓婅娣诲姞
5378=鎺ㄩ�佸唴瀹逛笉鑳戒负绌�.
5379=鏆傛棤鑱斿姩浜嬩欢{\r\n} 璇风偣鍑诲彸涓婅娣诲姞
+5380=甯稿紑妯″紡
@@ -1830,6 +1736,7 @@
16071=绾�
16072=鑳屽厜鐏寒搴�
16073=鎵撳紑
+16074=鏃ョ珛绌鸿皟妯″潡
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1912,6 +1819,8 @@
21020=鎸変綇闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿寚绀虹伅{0}浜捣锛屽垯閰嶇綉鎴愬姛
;鏂规偊鐜闈㈡澘鍏ョ綉鎿嶄綔鎸囩ず
21021=鎸変綇闈㈡澘鍔熻兘(function)鎸夐敭锛屾墍鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔�
+;绐楀笜闈㈡澘鐨勫叆缃戞搷浣滄寚绀�
+21022=闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勭炕璇戝悕瀛�,浠�30000寮�濮嬧槄鈽呪槄鈽�
30000=绱ф�ユ寜閽�
@@ -1950,6 +1859,7 @@
30033=鏂规偊鐜闈㈡澘
30034=绠�绾�4鎸夐敭鍦烘櫙闈㈡澘
30035=绠�绾�2璺獥甯橀潰鏉�
+30036=鏂规偊/2璺獥甯橀潰鏉�-Z
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
40000=閬槼
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/FreshAirIcon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/FreshAirIcon.png
new file mode 100755
index 0000000..7dcb24c
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/FreshAirIcon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected2.png
new file mode 100755
index 0000000..b01d55f
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerSelected2.png
new file mode 100755
index 0000000..0915084
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerZbGatewaySelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerZbGatewaySelected2.png
new file mode 100755
index 0000000..0915084
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerZbGatewaySelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchCloudContrSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchCloudContrSelected2.png
new file mode 100755
index 0000000..f6bd66e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchCloudContrSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchSelected2.png
new file mode 100755
index 0000000..f6bd66e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirSwitchSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtain.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtain.png
new file mode 100755
index 0000000..a0e87e6
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtain.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtainSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtainSelected.png
new file mode 100755
index 0000000..af7c7f8
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelCurtainSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEightSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEightSelected2.png
new file mode 100755
index 0000000..d452d06
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png
new file mode 100755
index 0000000..b01a740
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFourSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFourSelected2.png
new file mode 100755
index 0000000..37ae231
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueFourSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueTwoSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueTwoSelected2.png
new file mode 100755
index 0000000..74d7490
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueTwoSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFourSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFourSelected2.png
new file mode 100755
index 0000000..202bc47
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFourSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelOneSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelOneSelected2.png
new file mode 100755
index 0000000..cd553a1
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelOneSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelSelected2.png
new file mode 100755
index 0000000..202bc47
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelThreeSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelThreeSelected2.png
new file mode 100755
index 0000000..4dccc79
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelThreeSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelTwoSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelTwoSelected2.png
new file mode 100755
index 0000000..f916586
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelTwoSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightSelected2.png
new file mode 100755
index 0000000..ebfa875
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Converter.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Converter.png
index b0e9c11..0785b95 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Converter.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Converter.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterSelected2.png
new file mode 100755
index 0000000..27d83fa
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485.png
index b0e9c11..0785b95 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485Selected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485Selected2.png
new file mode 100755
index 0000000..27d83fa
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ConverterZb485Selected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainAutoOpenSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainAutoOpenSelected2.png
new file mode 100755
index 0000000..79b2cdc
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainAutoOpenSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSelected2.png
new file mode 100755
index 0000000..79b2cdc
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSiphonateSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSiphonateSelected2.png
new file mode 100755
index 0000000..79b2cdc
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/CurtainSiphonateSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightOneLoadSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightOneLoadSelected2.png
new file mode 100755
index 0000000..30c23a0
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightOneLoadSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightSelected2.png
new file mode 100755
index 0000000..30c23a0
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DimmableLightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DryContactSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DryContactSelected2.png
new file mode 100755
index 0000000..4e40bb1
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/DryContactSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksH06CSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksH06CSelected2.png
new file mode 100755
index 0000000..7c8e31b
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksH06CSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksSelected2.png
new file mode 100755
index 0000000..7c8e31b
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/IntelligentLocksSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/LightSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/LightSelected2.png
new file mode 100755
index 0000000..ebfa875
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/LightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayEpointSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayEpointSelected2.png
new file mode 100755
index 0000000..fc7cea3
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayEpointSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelaySelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelaySelected2.png
new file mode 100755
index 0000000..951d3cb
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelaySelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayThreeLoadSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayThreeLoadSelected2.png
new file mode 100755
index 0000000..951d3cb
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RelayThreeLoadSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterSelected2.png
new file mode 100755
index 0000000..e313935
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterZigbeeSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterZigbeeSelected2.png
new file mode 100755
index 0000000..e313935
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/RepeaterZigbeeSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorCarbonMonoxideSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorCarbonMonoxideSelected2.png
new file mode 100755
index 0000000..5394ed4
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorCarbonMonoxideSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorDoorWindowSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorDoorWindowSelected2.png
new file mode 100755
index 0000000..1bcd0d2
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorDoorWindowSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorFireSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorFireSelected2.png
new file mode 100755
index 0000000..5801d33
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorFireSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorHumiditySelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorHumiditySelected2.png
new file mode 100755
index 0000000..3687727
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorHumiditySelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorInfraredSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorInfraredSelected2.png
new file mode 100755
index 0000000..43c9a9e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorInfraredSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorMotion.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorMotion.png
deleted file mode 100755
index 464710f..0000000
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorMotion.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPirSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPirSelected2.png
new file mode 100755
index 0000000..7f1aa90
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPirSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorSelected2.png
new file mode 100755
index 0000000..5e800e7
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureHumiditySelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureHumiditySelected2.png
new file mode 100755
index 0000000..51855c1
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureHumiditySelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureSelected2.png
new file mode 100755
index 0000000..a5dc658
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorTemperatureSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorWaterSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorWaterSelected2.png
new file mode 100755
index 0000000..4ecffea
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorWaterSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1Selected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1Selected2.png
new file mode 100755
index 0000000..f73889c
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1Selected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SwitchSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SwitchSelected2.png
new file mode 100755
index 0000000..f6bd66e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SwitchSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDevice.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDevice.png
index cf45a1f..c1770a3 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDevice.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDevice.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected.png
new file mode 100755
index 0000000..ec90708
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected2.png
new file mode 100755
index 0000000..9c4c795
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ThirdPartyDeviceSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEnvironmentBigPic.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ButtonPanelFangyueEnvironmentBigPic.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelFangyueEightButtonTable.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueEightButtonTable.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelFangyueEightButtonTable.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueEightButtonTable.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelFangyueFourButtonTable.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueFourButtonTable.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelFangyueFourButtonTable.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueFourButtonTable.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelFangyueTwoButtonTable.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueTwoButtonTable.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelFangyueTwoButtonTable.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelFangyueTwoButtonTable.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelTable.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelTable.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/PanelTable.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/DeviceItem/PanelTable.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/LowPower.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/LowPower.png
new file mode 100755
index 0000000..2b4273a
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/LowPower.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpen.png
new file mode 100755
index 0000000..c2c9532
--- /dev/null
+++ 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
new file mode 100755
index 0000000..209bbc6
--- /dev/null
+++ 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
new file mode 100755
index 0000000..8fb7203
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/NormallyOpenOn.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power100.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power100.png
new file mode 100755
index 0000000..e0097f1
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power100.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power40.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power40.png
new file mode 100755
index 0000000..a4533fb
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power40.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power60.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power60.png
new file mode 100755
index 0000000..b0e81f9
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power60.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power80.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power80.png
new file mode 100755
index 0000000..cf297c0
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Power80.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/PowerOffline.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/PowerOffline.png
new file mode 100755
index 0000000..3ca528d
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/PowerOffline.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/ProgressBackground.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/ProgressBackground.png
new file mode 100755
index 0000000..da1d1b2
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/ProgressBackground.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIcon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIcon.png
new file mode 100755
index 0000000..49f76cf
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIcon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIconOn.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIconOn.png
new file mode 100755
index 0000000..ec361fb
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/VolumeIconOn.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10Icon.png
index 31b4257..54c9dec 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected.png
index 8430524..27d15e2 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected2.png
new file mode 100755
index 0000000..8a9f054
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/10IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11Icon.png
index 0c0b4ee..87557ba 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected.png
index 2d565dc..d1145ad 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected2.png
new file mode 100755
index 0000000..9c26005
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/11IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12Icon.png
index 841ed27..82b9b40 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected.png
index f0abca5..d86edbe 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected2.png
new file mode 100755
index 0000000..31f4853
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/12IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13Icon.png
index f2b75da..ea10304 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected.png
index 2228105..758d770 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected2.png
new file mode 100755
index 0000000..82f7ac3
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/13IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/14IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/14IconSelected2.png
new file mode 100755
index 0000000..f4bd614
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/14IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15Icon.png
index a749360..10604dd 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected.png
index 4faa3e1..b39cf98 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected2.png
new file mode 100755
index 0000000..3ee6200
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/15IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16Icon.png
index e652a11..b20c8b8 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected.png
index 01699e8..5dcb7f2 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected2.png
new file mode 100755
index 0000000..ec24db4
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/16IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17Icon.png
index b20c8b8..82024d9 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected.png
index 5dcb7f2..a4f18d5 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected2.png
new file mode 100755
index 0000000..f544d34
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/17IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18Icon.png
index 39a1287..a1ce50c 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected.png
index 4ea13da..937ae2a 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected2.png
new file mode 100755
index 0000000..bc27876
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/18IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19Icon.png
index c6dad69..d18c088 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected.png
index 208edca..e9d54d9 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected2.png
new file mode 100755
index 0000000..ecb3778
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/19IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1Icon.png
index 28ac0a9..78d6483 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected.png
index ac6ce6c..adfd844 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected2.png
new file mode 100755
index 0000000..cf38e61
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/1IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20Icon.png
index d18c088..5b08b41 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected.png
index e9d54d9..9a3bdd9 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected2.png
new file mode 100755
index 0000000..15344d7
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/20IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21Icon.png
new file mode 100755
index 0000000..b2b7706
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected.png
new file mode 100755
index 0000000..8c8ae39
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected2.png
new file mode 100755
index 0000000..f601398
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/21IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22Icon.png
new file mode 100755
index 0000000..fb5c77a
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected.png
new file mode 100755
index 0000000..25ed769
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected2.png
new file mode 100755
index 0000000..fafddac
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/22IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23Icon.png
new file mode 100755
index 0000000..81ad331
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected.png
new file mode 100755
index 0000000..1827473
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected2.png
new file mode 100755
index 0000000..96ffb78
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/23IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24Icon.png
new file mode 100755
index 0000000..8324db8
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected.png
new file mode 100755
index 0000000..575b2f5
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected2.png
new file mode 100755
index 0000000..42f3819
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/24IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25Icon.png
new file mode 100755
index 0000000..d5bc294
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected.png
new file mode 100755
index 0000000..1dcd4c5
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected2.png
new file mode 100755
index 0000000..c6014ab
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/25IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26Icon.png
new file mode 100755
index 0000000..c4e0d1e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected.png
new file mode 100755
index 0000000..a5b4a71
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected2.png
new file mode 100755
index 0000000..863388e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/26IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27Icon.png
new file mode 100755
index 0000000..07c53a2
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected.png
new file mode 100755
index 0000000..8d01e8f
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected2.png
new file mode 100755
index 0000000..7d6782a
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/27IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28Icon.png
new file mode 100755
index 0000000..17c9898
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected.png
new file mode 100755
index 0000000..db47a3c
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected2.png
new file mode 100755
index 0000000..46606b4
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/28IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2Icon.png
index 59a5ad9..a7eadb4 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png
index 34011fb..4c98a55 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected2.png
new file mode 100755
index 0000000..61d3db8
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3Icon.png
index e19bb68..f2521ac 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected.png
index 9be55b9..7c37e9b 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected2.png
new file mode 100755
index 0000000..674d06f
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/3IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4Icon.png
index 7d4c142..09559e3 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected.png
index bd02961..1b952d6 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected2.png
new file mode 100755
index 0000000..e6940df
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/4IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5Icon.png
index aa55690..f3c7b17 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected.png
index 3f9b64a..d3c1005 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected2.png
new file mode 100755
index 0000000..d402904
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/5IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6Icon.png
index 92c63e4..88d8280 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected.png
index b48c0fd..ae4dd06 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected2.png
new file mode 100755
index 0000000..ee38c4f
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/6IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7Icon.png
index 48a6e27..a4f26c2 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected.png
index 2a26207..c5e5db8 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected2.png
new file mode 100755
index 0000000..19d5db3
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/7IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8Icon.png
index 4a3bbef..b82afcf 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected.png
index d11557c..8ede4b8 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected2.png
new file mode 100755
index 0000000..687ea40
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/8IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9Icon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9Icon.png
index f178284..d8b35dc 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9Icon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9Icon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected.png
index f095bfb..38e9ca2 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected2.png
new file mode 100755
index 0000000..86adf04
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/9IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelCurtain.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelCurtain.png
new file mode 100755
index 0000000..a68129c
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelCurtain.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelCurtain.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelCurtain.png
new file mode 100755
index 0000000..ae97ad5
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/ButtonPanelCurtain.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomShadow.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomShadow.png
index c626c4b..067e75f 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomShadow.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomShadow.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
index e60c884..4a0a2a6 100644
--- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
+++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
@@ -312,7 +312,6 @@
<AndroidAsset Include="Assets\Phone\Device\IntelligentLocks.png" />
<AndroidAsset Include="Assets\Phone\Device\IntelligentLocksH06C.png" />
<AndroidAsset Include="Assets\Phone\Device\Light.png" />
- <AndroidAsset Include="Assets\Phone\Device\PanelTable.png" />
<AndroidAsset Include="Assets\Phone\Device\Relay.png" />
<AndroidAsset Include="Assets\Phone\Device\RelayEpoint.png" />
<AndroidAsset Include="Assets\Phone\Device\RelayThreeLoad.png" />
@@ -324,7 +323,6 @@
<AndroidAsset Include="Assets\Phone\Device\SensorFire.png" />
<AndroidAsset Include="Assets\Phone\Device\SensorHumidity.png" />
<AndroidAsset Include="Assets\Phone\Device\SensorInfrared.png" />
- <AndroidAsset Include="Assets\Phone\Device\SensorMotion.png" />
<AndroidAsset Include="Assets\Phone\Device\SensorPir.png" />
<AndroidAsset Include="Assets\Phone\Device\SensorTemperature.png" />
<AndroidAsset Include="Assets\Phone\Device\SensorWater.png" />
@@ -1580,15 +1578,6 @@
<AndroidAsset Include="Assets\Phone\Instruct\PanelFangyueTwoButton.png" />
</ItemGroup>
<ItemGroup>
- <AndroidAsset Include="Assets\Phone\Device\PanelFangyueEightButtonTable.png" />
- </ItemGroup>
- <ItemGroup>
- <AndroidAsset Include="Assets\Phone\Device\PanelFangyueFourButtonTable.png" />
- </ItemGroup>
- <ItemGroup>
- <AndroidAsset Include="Assets\Phone\Device\PanelFangyueTwoButtonTable.png" />
- </ItemGroup>
- <ItemGroup>
<AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueEightSelected.png" />
</ItemGroup>
<ItemGroup>
@@ -1634,9 +1623,6 @@
<AndroidAsset Include="Assets\Phone\MenuGroud\TopRightMenu2_6.png" />
</ItemGroup>
<ItemGroup>
- <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueEnvironmentBigPic.png" />
- </ItemGroup>
- <ItemGroup>
<AndroidAsset Include="Assets\Phone\Room\RoomShadow.png" />
</ItemGroup>
<ItemGroup>
@@ -1648,6 +1634,339 @@
<ItemGroup>
<AndroidAsset Include="Assets\Phone\Room\RoomCardShadow.png" />
</ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\AirConditionerEpointSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\AirConditionerSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\AirConditionerZbGatewaySelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\AirSwitchCloudContrSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\AirSwitchSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueEightSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueEnvironmentSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueFourSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFangyueTwoSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelFourSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelOneSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelThreeSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelTwoSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ColorLightSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ConverterSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ConverterZb485Selected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\CurtainAutoOpenSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\CurtainSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\CurtainSiphonateSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\DimmableLightOneLoadSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\DimmableLightSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\DryContactSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\IntelligentLocksH06CSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\IntelligentLocksSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\LightSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\RelayEpointSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\RelaySelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\RelayThreeLoadSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\RepeaterSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\RepeaterZigbeeSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorCarbonMonoxideSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorDoorWindowSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorFireSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorHumiditySelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorPirSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorTemperatureHumiditySelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorTemperatureSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorWaterSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\Socket1Selected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SwitchSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ThirdPartyDeviceSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ThirdPartyDeviceSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\1IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\2IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\3IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\4IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\5IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\6IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\7IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\8IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\9IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\10IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\11IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\12IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\13IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\14IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\15IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\16IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\17IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\18IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\19IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\20IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\21Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\21IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\21IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\22Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\22IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\22IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\23Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\23IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\23IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\24Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\24IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\24IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\25Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\25IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\25IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\26Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\26IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\26IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\27Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\27IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\27IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\28Icon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\28IconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\28IconSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\SensorInfraredSelected2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Instruct\PanelCurtain.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DeviceItem\ButtonPanelFangyueEnvironmentBigPic.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DeviceItem\PanelFangyueEightButtonTable.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DeviceItem\PanelFangyueFourButtonTable.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DeviceItem\PanelFangyueTwoButtonTable.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DeviceItem\PanelTable.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\RealDevice\ButtonPanelCurtain.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelCurtain.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelCurtainSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\LowPower.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\NormallyOpen.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\NormallyOpenOffline.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\NormallyOpenOn.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\Power40.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\Power60.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\Power80.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\Power100.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\PowerOffline.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\ProgressBackground.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\VolumeIcon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\DoorLock\VolumeIconOn.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\BindPic\FreshAirIcon.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 b4e0a92..928e93a 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="2020030601" android:installLocation="auto" android:versionName="1.0.20030601">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020032001" android:installLocation="auto" android:versionName="1.0.20032001">
<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/Home.Ios/AppDelegate.cs b/ZigbeeApp/Home.Ios/AppDelegate.cs
index d9396e2..51a85b9 100644
--- a/ZigbeeApp/Home.Ios/AppDelegate.cs
+++ b/ZigbeeApp/Home.Ios/AppDelegate.cs
@@ -27,6 +27,7 @@
{
//base.FinishedLaunching(application, launchOptions);
Shared.Application.FontSize = 12;
+ Shared.Application.IsUsePingFang = true;
Window = new UIWindow(UIScreen.MainScreen.Bounds);
rootViewController = new UINavigationController(new GateWay.Ios.MainViewController()) { NavigationBarHidden = true };
Window.RootViewController = rootViewController;
diff --git a/ZigbeeApp/Home.Ios/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj
index e73774a..d8838be 100644
--- a/ZigbeeApp/Home.Ios/Home.IOS.csproj
+++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj
@@ -51,6 +51,7 @@
<MtouchDebug>true</MtouchDebug>
<MtouchExtraArgs>-gcc_flags -dead_strip</MtouchExtraArgs>
<MtouchI18n>cjk</MtouchI18n>
+<CodesignProvision>Home_Dev</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
@@ -184,6 +185,7 @@
<ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2688X1242.png" />
</ItemGroup>
<ItemGroup>
+ <BundleResource Include="Resources\Language.ini" />
<BundleResource Include="Resources\Phone\Guide\RightIcon.png" />
<BundleResource Include="Resources\Phone\Guide\LeftIcon.png" />
<BundleResource Include="Resources\Phone\Guide\Finger.png" />
@@ -214,6 +216,7 @@
<BundleResource Include="Resources\Phone\Instruct\AirSwitchCloudContr.png" />
<BundleResource Include="Resources\Phone\Instruct\SensorTemperatureHumidity.png" />
<BundleResource Include="Resources\Phone\Instruct\PanelFangyueTwoButton.png" />
+ <BundleResource Include="Resources\Phone\Instruct\PanelCurtain.png" />
<BundleResource Include="Resources\Phone\Instruct\PanelFangyueFourButton.png" />
<BundleResource Include="Resources\Phone\Instruct\PanelFourButton.png" />
<BundleResource Include="Resources\Phone\Instruct\AirConditionerZbGateway.png" />
@@ -314,6 +317,11 @@
<BundleResource Include="Resources\Phone\MenuGroud\TopRightMenu2_5.png" />
<BundleResource Include="Resources\Phone\MenuGroud\TopRightMenu2_4.png" />
<BundleResource Include="Resources\Phone\MenuGroud\TopRightMenu2_6.png" />
+ <BundleResource Include="Resources\Phone\DeviceItem\PanelFangyueTwoButtonTable.png" />
+ <BundleResource Include="Resources\Phone\DeviceItem\PanelTable.png" />
+ <BundleResource Include="Resources\Phone\DeviceItem\PanelFangyueEightButtonTable.png" />
+ <BundleResource Include="Resources\Phone\DeviceItem\ButtonPanelFangyueEnvironmentBigPic.png" />
+ <BundleResource Include="Resources\Phone\DeviceItem\PanelFangyueFourButtonTable.png" />
<BundleResource Include="Resources\Phone\Center\Abount.png" />
<BundleResource Include="Resources\Phone\Center\ResidenceManagement.png" />
<BundleResource Include="Resources\Phone\Center\Backup.png" />
@@ -353,6 +361,7 @@
<BundleResource Include="Resources\Phone\SceneIcon\0.jpg" />
<BundleResource Include="Resources\Phone\BindPic\BindEmptyPic.png" />
<BundleResource Include="Resources\Phone\BindPic\BindLeft.png" />
+ <BundleResource Include="Resources\Phone\BindPic\FreshAirIcon.png" />
<BundleResource Include="Resources\Phone\BindPic\BindAdd.png" />
<BundleResource Include="Resources\Phone\BindPic\BindDown.png" />
<BundleResource Include="Resources\Phone\BindPic\BindRoomColor.png" />
@@ -360,23 +369,31 @@
<BundleResource Include="Resources\Phone\BindPic\BindRoomColorOn.png" />
<BundleResource Include="Resources\Phone\DoorLock\DistributeUnlockIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\TypeIcon.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\LowPower.png" />
<BundleResource Include="Resources\Phone\DoorLock\TemPasswordInvisiable.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\NormallyOpenOffline.png" />
<BundleResource Include="Resources\Phone\DoorLock\UnLockButton.png" />
<BundleResource Include="Resources\Phone\DoorLock\AddFailedPic.png" />
<BundleResource Include="Resources\Phone\DoorLock\SelectedIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\Fingerprint207.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\VolumeIconOn.png" />
<BundleResource Include="Resources\Phone\DoorLock\DoorLockPicClose.png" />
<BundleResource Include="Resources\Phone\DoorLock\TempPasswordBackground.png" />
<BundleResource Include="Resources\Phone\DoorLock\AddFingerprintTipPic.png" />
<BundleResource Include="Resources\Phone\DoorLock\FavoriteIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\RightIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\ShareIcon.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\NormallyOpen.png" />
<BundleResource Include="Resources\Phone\DoorLock\DateIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\DoorLockOpen.png" />
<BundleResource Include="Resources\Phone\DoorLock\UnlockSuccess.png" />
<BundleResource Include="Resources\Phone\DoorLock\DoorLockClose.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\Power60.png" />
<BundleResource Include="Resources\Phone\DoorLock\UnLockBlankPic.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\Power100.png" />
<BundleResource Include="Resources\Phone\DoorLock\DelIcon.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\PowerOffline.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\ProgressBackground.png" />
<BundleResource Include="Resources\Phone\DoorLock\CancelIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\TemPasswordVisiable.png" />
<BundleResource Include="Resources\Phone\DoorLock\proximityCard.png" />
@@ -394,15 +411,19 @@
<BundleResource Include="Resources\Phone\DoorLock\Switch.png" />
<BundleResource Include="Resources\Phone\DoorLock\AddIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\DoorLockUserPic.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\Power40.png" />
<BundleResource Include="Resources\Phone\DoorLock\AllMethod.png" />
<BundleResource Include="Resources\Phone\DoorLock\RecordIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\FingerprintOn.png" />
<BundleResource Include="Resources\Phone\DoorLock\VisitorIcon.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\Power80.png" />
<BundleResource Include="Resources\Phone\DoorLock\TempPasswordBackground1.png" />
<BundleResource Include="Resources\Phone\DoorLock\DoorlockPicture.png" />
<BundleResource Include="Resources\Phone\DoorLock\UnlockFailed.png" />
<BundleResource Include="Resources\Phone\DoorLock\AddPasswordTicPic.png" />
<BundleResource Include="Resources\Phone\DoorLock\AllMethodOn.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\NormallyOpenOn.png" />
+ <BundleResource Include="Resources\Phone\DoorLock\VolumeIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\SettingIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\DoorlockIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\SideslipPic.png" />
@@ -625,37 +646,57 @@
<BundleResource Include="Resources\Phone\ZigeeLogic\sensor42.png" />
<BundleResource Include="Resources\Phone\Device\DimmableLightSelected.png" />
<BundleResource Include="Resources\Phone\Device\CurtainSiphonate.png" />
+ <BundleResource Include="Resources\Phone\Device\Socket1Selected2.png" />
<BundleResource Include="Resources\Phone\Device\DimmableLight.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelTwo.png" />
+ <BundleResource Include="Resources\Phone\Device\RelayEpointSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ConverterZb485Selected2.png" />
+ <BundleResource Include="Resources\Phone\Device\DimmableLightSelected2.png" />
<BundleResource Include="Resources\Phone\Device\SensorPir.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorFireSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEnvironmentSelected.png" />
<BundleResource Include="Resources\Phone\Device\LightSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\RelaySelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorWaterSelected2.png" />
<BundleResource Include="Resources\Phone\Device\SensorHumiditySelected.png" />
<BundleResource Include="Resources\Phone\Device\RelayThreeLoad.png" />
<BundleResource Include="Resources\Phone\Device\CurtainAutoOpen.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorTemperatureSelected2.png" />
<BundleResource Include="Resources\Phone\Device\IntelligentLocksH06CSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\CurtainSelected2.png" />
<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\Curtain.png" />
+ <BundleResource Include="Resources\Phone\Device\SwitchSelected2.png" />
<BundleResource Include="Resources\Phone\Device\AirSwitchCloudContr.png" />
<BundleResource Include="Resources\Phone\Device\Socket1.png" />
+ <BundleResource Include="Resources\Phone\Device\AirConditionerSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\RelayThreeLoadSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelSelected2.png" />
<BundleResource Include="Resources\Phone\Device\SensorCarbonMonoxideSelected.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFour.png" />
<BundleResource Include="Resources\Phone\Device\RelayEpointSelected.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorTemperatureHumidity.png" />
+ <BundleResource Include="Resources\Phone\Device\RepeaterZigbeeSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelCurtainSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorDoorWindowSelected2.png" />
<BundleResource Include="Resources\Phone\Device\RelayThreeLoadSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\DryContactSelected2.png" />
+ <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\PanelFangyueTwoButtonTable.png" />
<BundleResource Include="Resources\Phone\Device\Repeater.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueFour.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorInfraredSelected2.png" />
<BundleResource Include="Resources\Phone\Device\SensorHumidity.png" />
<BundleResource Include="Resources\Phone\Device\AirConditionerEpointSelected.png" />
<BundleResource Include="Resources\Phone\Device\CurtainAutoOpenSelected.png" />
- <BundleResource Include="Resources\Phone\Device\PanelTable.png" />
<BundleResource Include="Resources\Phone\Device\Sensor.png" />
<BundleResource Include="Resources\Phone\Device\RepeaterSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\AirSwitchSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ConverterSelected2.png" />
<BundleResource Include="Resources\Phone\Device\AirSwitchSelected.png" />
<BundleResource Include="Resources\Phone\Device\IntelligentLocksSelected.png" />
<BundleResource Include="Resources\Phone\Device\RelaySelected.png" />
@@ -665,16 +706,20 @@
<BundleResource Include="Resources\Phone\Device\ColorLightSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorEmergencyButton.png" />
<BundleResource Include="Resources\Phone\Device\AirSwitch.png" />
+ <BundleResource Include="Resources\Phone\Device\IntelligentLocksH06CSelected2.png" />
<BundleResource Include="Resources\Phone\Device\SwitchSelected.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelTwoSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorDoorWindowSelected.png" />
<BundleResource Include="Resources\Phone\Device\Light.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueTwoSelected.png" />
<BundleResource Include="Resources\Phone\Device\ThirdPartyDevice.png" />
+ <BundleResource Include="Resources\Phone\Device\AirConditionerZbGatewaySelected2.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEightSelected.png" />
- <BundleResource Include="Resources\Phone\Device\SensorMotion.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEnvironment.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelOneSelected2.png" />
<BundleResource Include="Resources\Phone\Device\AirConditionerEpoint.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorTemperatureHumiditySelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\AirConditionerEpointSelected2.png" />
<BundleResource Include="Resources\Phone\Device\DryContactSelected.png" />
<BundleResource Include="Resources\Phone\Device\CurtainSelected.png" />
<BundleResource Include="Resources\Phone\Device\Converter.png" />
@@ -685,38 +730,55 @@
<BundleResource Include="Resources\Phone\Device\Switch.png" />
<BundleResource Include="Resources\Phone\Device\AirConditionerSelected.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanel.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelTwoSelected2.png" />
<BundleResource Include="Resources\Phone\Device\AirConditionerZbGateway.png" />
<BundleResource Include="Resources\Phone\Device\DryContact.png" />
+ <BundleResource Include="Resources\Phone\Device\AirSwitchCloudContrSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFourSelected.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelOneSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorPirSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\CurtainSiphonateSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\LightSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelThreeSelected.png" />
<BundleResource Include="Resources\Phone\Device\IntelligentLocksH06C.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEightSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\IntelligentLocksSelected2.png" />
<BundleResource Include="Resources\Phone\Device\CurtainSiphonateSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorDoorWindow.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelOne.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEight.png" />
+ <BundleResource Include="Resources\Phone\Device\CurtainAutoOpenSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueFourSelected.png" />
- <BundleResource Include="Resources\Phone\Device\PanelFangyueEightButtonTable.png" />
+ <BundleResource Include="Resources\Phone\Device\ThirdPartyDeviceSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ThirdPartyDeviceSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorTemperature.png" />
<BundleResource Include="Resources\Phone\Device\SensorFire.png" />
<BundleResource Include="Resources\Phone\Device\DimmableLightOneLoadSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorTemperatureSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueTwoSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ColorLightSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\DimmableLightOneLoadSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelThree.png" />
<BundleResource Include="Resources\Phone\Device\SensorInfraredSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\RepeaterSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ConverterSelected.png" />
<BundleResource Include="Resources\Phone\Device\RepeaterZigbeeSelected.png" />
- <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEnvironmentBigPic.png" />
<BundleResource Include="Resources\Phone\Device\SensorCarbonMonoxide.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelFourSelected2.png" />
<BundleResource Include="Resources\Phone\Device\DimmableLightOneLoad.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorHumiditySelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorPirSelected2.png" />
<BundleResource Include="Resources\Phone\Device\AirSwitchCloudContrSelected.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueTwo.png" />
<BundleResource Include="Resources\Phone\Device\RelayEpoint.png" />
+ <BundleResource Include="Resources\Phone\Device\SensorSelected2.png" />
<BundleResource Include="Resources\Phone\Device\RepeaterZigbee.png" />
<BundleResource Include="Resources\Phone\Device\SensorWater.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelThreeSelected2.png" />
<BundleResource Include="Resources\Phone\Device\SensorSelected.png" />
<BundleResource Include="Resources\Phone\Device\SensorTemperatureHumiditySelected.png" />
- <BundleResource Include="Resources\Phone\Device\PanelFangyueFourButtonTable.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueFourSelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEnvironmentSelected2.png" />
<BundleResource Include="Resources\Phone\Light\DeskLampSelected.png" />
<BundleResource Include="Resources\Phone\Light\ON.png" />
<BundleResource Include="Resources\Phone\Light\Plug.png" />
@@ -774,44 +836,88 @@
<BundleResource Include="Resources\Phone\Scene\Background.png" />
<BundleResource Include="Resources\Phone\Scene\SceneIcon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\17Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\5IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\11IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\4Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\28Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\16IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\6IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\24IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\24IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\9IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\19IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\21Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\23IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\20IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\20Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\16Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\1IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\11IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\5Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\1IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\15IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\22Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\10IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\22IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\4IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\7Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\10IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\14Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\25IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\6Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\21IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\15Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\17IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\7IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\14IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\25IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\8IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\18IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\23Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\26Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\20IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\19Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\18IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\26IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\13IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\3Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\10Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\7IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\12IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\2IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\28IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\5IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\15IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\17IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\3IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\2Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\11Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\27Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\8IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\22IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\18Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\27IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\19IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\27IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\4IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\14IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\13Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\6IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\25Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\12IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\9Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\26IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\21IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\24Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\2IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\8Icon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\28IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\16IconSelected2.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\23IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\12Icon.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\13IconSelected.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\3IconSelected.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\9IconSelected2.png" />
<BundleResource Include="Resources\Phone\FunctionIcon\1Icon.png" />
<BundleResource Include="Resources\Phone\RealDevice\CurtainSiphonate.png" />
<BundleResource Include="Resources\Phone\RealDevice\ButtonPanelTwo.png" />
@@ -822,6 +928,7 @@
<BundleResource Include="Resources\Phone\RealDevice\SensorInfrared.png" />
<BundleResource Include="Resources\Phone\RealDevice\AirSwitchCloudContr.png" />
<BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFour.png" />
+ <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelCurtain.png" />
<BundleResource Include="Resources\Phone\RealDevice\Repeater.png" />
<BundleResource Include="Resources\Phone\RealDevice\SensorTemperatrueHumidity.png" />
<BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueFour.png" />
@@ -849,7 +956,6 @@
<BundleResource Include="Resources\Phone\Gateway\WiredGateway.png" />
<BundleResource Include="Resources\Phone\Gateway\WirelessGateway.png" />
<BundleResource Include="Resources\Phone\Gateway\AddGatewaySuccess.png" />
- <BundleResource Include="Resources\Language.ini" />
</ItemGroup>
<Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
diff --git a/ZigbeeApp/Home.Ios/Info.plist b/ZigbeeApp/Home.Ios/Info.plist
index abb8a0f..5b348d2 100755
--- a/ZigbeeApp/Home.Ios/Info.plist
+++ b/ZigbeeApp/Home.Ios/Info.plist
@@ -55,7 +55,7 @@
<string>remote-notification</string>
</array>
<key>CFBundleShortVersionString</key>
- <string>1.0.19080501</string>
+ <string>1.0.20031601</string>
<key>CFBundleVersion</key>
<string>2</string>
<key>CFBundleURLTypes</key>
diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini
index 88e7404..9c7a3d0 100755
--- a/ZigbeeApp/Home.Ios/Resources/Language.ini
+++ b/ZigbeeApp/Home.Ios/Resources/Language.ini
@@ -234,139 +234,44 @@
228=纭
229=鍒嗛厤鎴愬姛
230=纭畾瑕佸皢璇ヨ处鎴疯В鍐伙紵
-548=鎻愰啋璁剧疆
-550=鏂板鐢ㄦ埛
-551=澶村儚
-552=宸茬紪杈�
-553=鎸囩汗鍒楄〃
-554=鏈紪杈戝瘑鐮�
-555=鏈紪杈戞劅搴斿崱
-556=鍦烘櫙缂栬緫
-557=鏈紪杈戝満鏅�
-558=鏂板悕瀛�
-559=鍘熷悕瀛�
-560=绯荤粺璁剧疆
-561=瀵嗙爜鍒楄〃
-562=淇敼澶囨敞
-563=涓存椂瀵嗙爜
-564=鎰熷簲鍗�
-565=澶囨敞涓虹┖
-566=楠岃瘉鎴愬姛
-567=楠岃瘉棰戠箒锛岃5绉掑悗閲嶆柊鎿嶄綔
-568=鏈夋晥娆℃暟涓嶈秴杩�15娆�
-569=鏈夋晥鏃舵:
-570=鏈夋晥娆℃暟:
-571=鏃跺埢
-572= 娆�
-573=璇ヤ复鏃跺瘑鐮佹湁鏁�2娆�
-574=鐢熸垚涓存椂瀵嗙爜
-575=鏃� 鏈�
-576=鍒囨崲妯″紡浼氭竻闄ゆ寜閿腑鎵�鏈夌殑鐩爣锛岀‘瀹氳鍒囨崲鍚�
-577=鐭鏃堕棿
-578=鑷姩鐭鏃堕棿
-579=鎵嬪姩鐭鏃堕棿
-580=鍒�
-581=璁剧疆鎴愬姛
-582=璁剧疆澶辫触
-583=鍔ㄦ�佸瘑鐮�
-584=纭畾瑕侀噸鏂扮敓鎴愪复鏃跺姩鎬佸瘑鐮佸悧
-585=鎵�鏈夐�氱煡鎻愰啋
-586=寮�鍏抽棬鎻愰啋
-587=浣庣數鍘嬫姤璀�
-588=闃叉挰鎶ヨ
-589=闂ㄦ湭鍏虫姤璀�
-590=閿欒鎶ヨ
-591=閫氱煡鎻愰啋
-592=鎵嬫満鎺ㄩ�佹姤璀︿俊鎭�
-593=涓嶉�氱煡
-594=绫诲瀷
-595=鐢ㄦ埛
-596=鎸囩汗
-597=瀵嗙爜
-598=IC鍗�
-599=閽ュ寵
-600=杩滅▼
-601=涓存椂瀵嗙爜
-602=閽ュ寵
-603=瀵嗙爜閿欒
-604=闂ㄦ湭閿佸ソ
-605=鍔寔
-606=鐢甸噺涓嶈冻
-607=鎸囩汗閿欒
-608=鍗$墖閿欒
-609=寮�閿侊細
-610=鎶ヨ锛�
-611=寮�閿侀�氱煡
-612=淇℃伅鏇存敼
-614=鍙�夊満鏅�
-615=鍦烘櫙涓病鏈夌洰鏍囷紝鎺у埗澶辫触
-616=鐩爣閰嶇疆涓�
-617=鐩爣閰嶇疆鎴愬姛
-618=鎶ヨ鍦烘櫙璁剧疆
-619=璇疯緭鍏�6浣嶆暟瀛楀瘑鐮�
-620=璁剧疆瀵嗙爜闇�瑕佹寜璁惧鎸夐敭
-621=璇疯緭鍏�6浣嶅瘑鐮�
-622=瀵嗙爜鍙戦�佸け璐�
-623=鏇存敼瀵嗙爜鏃跺厛鍦ㄨ緭鍏ュ師瀵嗙爜
-624=璁剧疆瀵嗙爜闇�瑕佹寜璁惧閿�5s
-625=鏇存敼瀵嗙爜鏃跺厛杈撳叆鍘熷瘑鐮佺劧鍚庨暱鎸夎澶囨寜閿�5s鎵嶈兘鏇存敼瀵嗙爜
-626=鏃堕棿璁剧疆
-627=楠岃瘉棰戠箒锛岃15绉掑悗鍐嶆搷浣�
-628=璁惧涓嶅湪绾�
-629=璁剧疆瀵嗙爜
-630=鐢ㄦ埛鍚�
-631=鎵�鏈夐棬閿�
-632=瀵嗙爜涓嶅瓨鍦ㄣ�傚缓璁缃柊瀵嗙爜
-633=纭畾瑕佹洿鏀瑰瘑鐮佸悧
-634=鎵�鏈夊巻鍙茶褰�
-635=璁剧疆瀵嗙爜
-636=鎵惧洖瀵嗙爜
-637=璐︽埛瀵嗙爜
-638=璐︽埛瀵嗙爜閿欒
-639=鎵�鏈夎褰�
-640=杩滅▼寮�閿佸瘑鐮佽缃�/鏇存敼
-641=杩樻病璁剧疆瀵嗙爜
-642= 杩滅▼寮�閿佸瘑鐮佸凡缁忚缃�
-643= 娆㈣繋浣跨敤杩滅▼寮�閿�
-644=棣栨浣跨敤璇疯缃繙绋嬪紑閿佸瘑鐮�
-645=鐜板湪璁剧疆
-646=绋嶅悗璁剧疆
-647=绋嶅悗璇峰墠寰�绯荤粺璁剧疆涓缃垨鑰呮洿鏀瑰瘑鐮�
-648=璁剧疆6浣嶅瘑鐮�
-649=璇疯缃�6浣嶆柊瀵嗙爜
-650=璐︽埛瀵嗙爜涓虹┖
-651=鍦烘櫙鎶ヨ璁剧疆
-652=璁剧疆鐩爣澶辫触锛岃鍦ㄥ満鏅腑娣诲姞閫昏緫妯″潡
-653=鎺у埗澶辫触
-654=鏈煡鎸囩汗
-655=璇锋鏌ョ綉缁�
-656=鏈煡IC鍗�
-657=纭畾鎵撳紑鎶ヨ鎻愰啋?
-658=纭畾鍏抽棴鎶ヨ鎻愰啋锛�
-659=鎸囩汗璁板綍
-660=瀵嗙爜璁板綍
-661=IC鍗¤褰�
-662=杩滅▼璁板綍
-663=鎺ㄩ��
-664=鐢ㄦ埛
-665=璇疯緭鍏ユ帹閫佸唴瀹�
-666=褰撳墠宸茬粡閰嶇疆浜嗗満鏅紝纭畾瑕佹浛鎹㈠悧锛�
-667=鏀瑰満鏅凡缁忛�変腑
-668=娌℃湁鍙戠幇缃戝叧
-669=鍚屾閫氱煡鎴愬姛
-670=鍚屾閫氱煡澶辫触
-671=纭畾鍙戦�侀�氱煡鍚楋紵
-672=鎵撳紑闂ㄩ攣鎶ヨ鎴愬姛
-673=鎵撳紑闂ㄩ攣鎶ヨ澶辫触
-674=鍏抽棴闂ㄩ攣鎶ヨ鎴愬姛
-675=鍏抽棴闂ㄩ攣鎶ヨ澶辫触
-676=鍙戦�侀�氱煡鎴愬姛
-677=鍙戦�侀�氱煡澶辫触
-678=鎶ヨ閫氱煡
-679=宸茬粡缂栬緫鍦烘櫙
-680=鏈煡瀵嗙爜
-
-
+231=鎺ヨ繎鎰熷簲
+232=鎺ヨ繎鎰熷簲鍔熻兘璁剧疆缃け璐�
+233=鑾峰彇鎺ヨ繎鎰熷簲鍔熻兘澶辫触
+234=鏂规偊鏂伴灏忔ā鍧�
+235=鎸変綇闈㈡澘妯″紡锛圡ode)鍜岄閫燂紙Fan)鎸夐敭{0}缁胯壊鎸囩ず鐏寒璧枫�傚垯閰嶇綉鎴愬姛
+;涓夋寜閿潰鏉垮叆缃戞搷浣滄寚绀�
+236=缁胯壊鎸囩ず鐏棯鐑�
+237=鎸囩ず鐏�
+238=闀挎寜5绉掞紙鎸夐敭锛�
+239=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛
+;涓夋寜閿潰鏉垮叆缃戞搷浣滄寚绀�
+240= S-one
+241=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵
+242=鐢甸噺
+243=甯稿紑妯″紡宸插紑鍚�
+244=澶辨晥璁剧疆
+245=鑷姩鍖�
+246=闂ㄩ攣濮嬬粓鎵撳紑{0}灏忔椂
+247=褰撳墠鏃跺尯
+248=鍙栨秷甯稿紑
+249=鎮ㄧ殑甯稿紑妯″紡灏嗚鍙栨秷
+250=淇濇寔甯稿紑
+251=纭鍙栨秷
+252=(鏈鎿嶄綔浠呬负鍗曟鍙栨秷锛岃嫢闇�瑕佸仠姝㈡墽琛岃嚜鍔ㄥ寲锛岃閫夋嫨鍒嗙被-鑷姩鍖栬繘琛岃缃�)
+253=鑾峰彇闂ㄩ攣甯稿紑妯″紡澶辫触
+254=鎵撳紑闂ㄩ攣甯稿紑妯″紡鎴愬姛
+255=鎵撳紑闂ㄩ攣甯稿紑妯″紡澶辫触
+256=鍏抽棴闂ㄩ攣甯稿紑妯″紡鎴愬姛
+257=鍏抽棴闂ㄩ攣甯稿紑妯″紡鎴愬姛
+258=甯稿紑妯″紡涓嬫棤娉曟搷浣�
+259=澶辨晥鏃堕棿涓嶅悎娉曪紝璇烽噸鍐欒缃�
+260=闊抽噺璁剧疆澶辫触
+261=闊抽噺璁剧疆鎴愬姛
+262=褰撳墠鏃跺尯
+263=鍖�
+264=涓�
+265=瑗�
+266=褰撳墠璁惧涓嶆敮鎸佽鍔熻兘
5097=鍙栨秷
5098=纭畾
@@ -621,6 +526,7 @@
5377=娌℃湁鑷姩鍖杮\r\n} 璇风偣鍑诲彸涓婅娣诲姞
5378=鎺ㄩ�佸唴瀹逛笉鑳戒负绌�.
5379=鏆傛棤鑱斿姩浜嬩欢{\r\n} 璇风偣鍑诲彸涓婅娣诲姞
+5380=甯稿紑妯″紡
@@ -1830,6 +1736,7 @@
16071=绾�
16072=鑳屽厜鐏寒搴�
16073=鎵撳紑
+16074=鏃ョ珛绌鸿皟妯″潡
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1912,6 +1819,8 @@
21020=鎸変綇闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿寚绀虹伅{0}浜捣锛屽垯閰嶇綉鎴愬姛
;鏂规偊鐜闈㈡澘鍏ョ綉鎿嶄綔鎸囩ず
21021=鎸変綇闈㈡澘鍔熻兘(function)鎸夐敭锛屾墍鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔�
+;绐楀笜闈㈡澘鐨勫叆缃戞搷浣滄寚绀�
+21022=闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勭炕璇戝悕瀛�,浠�30000寮�濮嬧槄鈽呪槄鈽�
30000=绱ф�ユ寜閽�
@@ -1950,6 +1859,7 @@
30033=鏂规偊鐜闈㈡澘
30034=绠�绾�4鎸夐敭鍦烘櫙闈㈡澘
30035=绠�绾�2璺獥甯橀潰鏉�
+30036=鏂规偊/2璺獥甯橀潰鏉�-Z
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
40000=閬槼
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/BindPic/FreshAirIcon.png b/ZigbeeApp/Home.Ios/Resources/Phone/BindPic/FreshAirIcon.png
new file mode 100755
index 0000000..7dcb24c
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/BindPic/FreshAirIcon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerEpointSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerEpointSelected2.png
new file mode 100755
index 0000000..b01d55f
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerEpointSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerSelected2.png
new file mode 100755
index 0000000..0915084
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerZbGatewaySelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerZbGatewaySelected2.png
new file mode 100755
index 0000000..0915084
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirConditionerZbGatewaySelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchCloudContrSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchCloudContrSelected2.png
new file mode 100755
index 0000000..f6bd66e
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchCloudContrSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchSelected2.png
new file mode 100755
index 0000000..f6bd66e
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/AirSwitchSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtain.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtain.png
new file mode 100755
index 0000000..a0e87e6
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtain.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtainSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtainSelected.png
new file mode 100755
index 0000000..af7c7f8
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelCurtainSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEightSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEightSelected2.png
new file mode 100755
index 0000000..d452d06
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png
new file mode 100755
index 0000000..b01a740
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEnvironmentSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFourSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFourSelected2.png
new file mode 100755
index 0000000..37ae231
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueFourSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueTwoSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueTwoSelected2.png
new file mode 100755
index 0000000..74d7490
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueTwoSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFourSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFourSelected2.png
new file mode 100755
index 0000000..202bc47
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFourSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelOneSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelOneSelected2.png
new file mode 100755
index 0000000..cd553a1
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelOneSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelSelected2.png
new file mode 100755
index 0000000..202bc47
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelThreeSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelThreeSelected2.png
new file mode 100755
index 0000000..4dccc79
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelThreeSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelTwoSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelTwoSelected2.png
new file mode 100755
index 0000000..f916586
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelTwoSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightSelected2.png
new file mode 100755
index 0000000..ebfa875
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/Converter.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/Converter.png
index b0e9c11..0785b95 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/Device/Converter.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/Converter.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterSelected2.png
new file mode 100755
index 0000000..27d83fa
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485.png
index b0e9c11..0785b95 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485Selected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485Selected2.png
new file mode 100755
index 0000000..27d83fa
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ConverterZb485Selected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainAutoOpenSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainAutoOpenSelected2.png
new file mode 100755
index 0000000..79b2cdc
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainAutoOpenSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSelected2.png
new file mode 100755
index 0000000..79b2cdc
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSiphonateSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSiphonateSelected2.png
new file mode 100755
index 0000000..79b2cdc
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/CurtainSiphonateSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightOneLoadSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightOneLoadSelected2.png
new file mode 100755
index 0000000..30c23a0
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightOneLoadSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightSelected2.png
new file mode 100755
index 0000000..30c23a0
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/DimmableLightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/DryContactSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/DryContactSelected2.png
new file mode 100755
index 0000000..4e40bb1
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/DryContactSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksH06CSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksH06CSelected2.png
new file mode 100755
index 0000000..7c8e31b
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksH06CSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksSelected2.png
new file mode 100755
index 0000000..7c8e31b
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/IntelligentLocksSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/LightSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/LightSelected2.png
new file mode 100755
index 0000000..ebfa875
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/LightSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayEpointSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayEpointSelected2.png
new file mode 100755
index 0000000..fc7cea3
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayEpointSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelaySelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelaySelected2.png
new file mode 100755
index 0000000..951d3cb
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelaySelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayThreeLoadSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayThreeLoadSelected2.png
new file mode 100755
index 0000000..951d3cb
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RelayThreeLoadSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterSelected2.png
new file mode 100755
index 0000000..e313935
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterZigbeeSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterZigbeeSelected2.png
new file mode 100755
index 0000000..e313935
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/RepeaterZigbeeSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorCarbonMonoxideSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorCarbonMonoxideSelected2.png
new file mode 100755
index 0000000..5394ed4
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorCarbonMonoxideSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorDoorWindowSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorDoorWindowSelected2.png
new file mode 100755
index 0000000..1bcd0d2
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorDoorWindowSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorFireSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorFireSelected2.png
new file mode 100755
index 0000000..5801d33
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorFireSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorHumiditySelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorHumiditySelected2.png
new file mode 100755
index 0000000..3687727
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorHumiditySelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorInfraredSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorInfraredSelected2.png
new file mode 100755
index 0000000..43c9a9e
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorInfraredSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorMotion.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorMotion.png
deleted file mode 100755
index 464710f..0000000
--- a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorMotion.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPirSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPirSelected2.png
new file mode 100755
index 0000000..7f1aa90
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorPirSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorSelected2.png
new file mode 100755
index 0000000..5e800e7
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureHumiditySelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureHumiditySelected2.png
new file mode 100755
index 0000000..51855c1
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureHumiditySelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureSelected2.png
new file mode 100755
index 0000000..a5dc658
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorTemperatureSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorWaterSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorWaterSelected2.png
new file mode 100755
index 0000000..4ecffea
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorWaterSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/Socket1Selected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/Socket1Selected2.png
new file mode 100755
index 0000000..f73889c
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/Socket1Selected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SwitchSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SwitchSelected2.png
new file mode 100755
index 0000000..f6bd66e
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SwitchSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDevice.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDevice.png
index cf45a1f..c1770a3 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDevice.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDevice.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected.png
new file mode 100755
index 0000000..ec90708
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected2.png
new file mode 100755
index 0000000..9c4c795
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ThirdPartyDeviceSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEnvironmentBigPic.png b/ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/ButtonPanelFangyueEnvironmentBigPic.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelFangyueEightButtonTable.png b/ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueEightButtonTable.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelFangyueEightButtonTable.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueEightButtonTable.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelFangyueFourButtonTable.png b/ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueFourButtonTable.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelFangyueFourButtonTable.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueFourButtonTable.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelFangyueTwoButtonTable.png b/ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueTwoButtonTable.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelFangyueTwoButtonTable.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelFangyueTwoButtonTable.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelTable.png b/ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelTable.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/PanelTable.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/DeviceItem/PanelTable.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/LowPower.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/LowPower.png
new file mode 100755
index 0000000..2b4273a
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/LowPower.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpen.png
new file mode 100755
index 0000000..c2c9532
--- /dev/null
+++ 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
new file mode 100755
index 0000000..209bbc6
--- /dev/null
+++ 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
new file mode 100755
index 0000000..8fb7203
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/NormallyOpenOn.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power100.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power100.png
new file mode 100755
index 0000000..e0097f1
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power100.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power40.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power40.png
new file mode 100755
index 0000000..a4533fb
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power40.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power60.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power60.png
new file mode 100755
index 0000000..b0e81f9
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power60.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power80.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power80.png
new file mode 100755
index 0000000..cf297c0
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/Power80.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/PowerOffline.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/PowerOffline.png
new file mode 100755
index 0000000..3ca528d
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/PowerOffline.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/ProgressBackground.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/ProgressBackground.png
new file mode 100755
index 0000000..da1d1b2
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/ProgressBackground.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIcon.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIcon.png
new file mode 100755
index 0000000..49f76cf
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIcon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIconOn.png b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIconOn.png
new file mode 100755
index 0000000..ec361fb
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/DoorLock/VolumeIconOn.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10Icon.png
index 31b4257..54c9dec 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected.png
index 8430524..27d15e2 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected2.png
new file mode 100755
index 0000000..8a9f054
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/10IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11Icon.png
index 0c0b4ee..87557ba 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected.png
index 2d565dc..d1145ad 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected2.png
new file mode 100755
index 0000000..9c26005
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/11IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12Icon.png
index 841ed27..82b9b40 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected.png
index f0abca5..d86edbe 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected2.png
new file mode 100755
index 0000000..31f4853
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/12IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13Icon.png
index f2b75da..ea10304 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected.png
index 2228105..758d770 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected2.png
new file mode 100755
index 0000000..82f7ac3
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/13IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/14IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/14IconSelected2.png
new file mode 100755
index 0000000..f4bd614
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/14IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15Icon.png
index a749360..10604dd 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected.png
index 4faa3e1..b39cf98 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected2.png
new file mode 100755
index 0000000..3ee6200
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/15IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16Icon.png
index e652a11..b20c8b8 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected.png
index 01699e8..5dcb7f2 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected2.png
new file mode 100755
index 0000000..ec24db4
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/16IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17Icon.png
index b20c8b8..82024d9 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected.png
index 5dcb7f2..a4f18d5 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected2.png
new file mode 100755
index 0000000..f544d34
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/17IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18Icon.png
index 39a1287..a1ce50c 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected.png
index 4ea13da..937ae2a 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected2.png
new file mode 100755
index 0000000..bc27876
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/18IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19Icon.png
index c6dad69..d18c088 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected.png
index 208edca..e9d54d9 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected2.png
new file mode 100755
index 0000000..ecb3778
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/19IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1Icon.png
index 28ac0a9..78d6483 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected.png
index ac6ce6c..adfd844 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected2.png
new file mode 100755
index 0000000..cf38e61
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/1IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20Icon.png
index d18c088..5b08b41 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected.png
index e9d54d9..9a3bdd9 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected2.png
new file mode 100755
index 0000000..15344d7
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/20IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21Icon.png
new file mode 100755
index 0000000..b2b7706
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected.png
new file mode 100755
index 0000000..8c8ae39
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected2.png
new file mode 100755
index 0000000..f601398
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/21IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22Icon.png
new file mode 100755
index 0000000..fb5c77a
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected.png
new file mode 100755
index 0000000..25ed769
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected2.png
new file mode 100755
index 0000000..fafddac
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/22IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23Icon.png
new file mode 100755
index 0000000..81ad331
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected.png
new file mode 100755
index 0000000..1827473
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected2.png
new file mode 100755
index 0000000..96ffb78
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/23IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24Icon.png
new file mode 100755
index 0000000..8324db8
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected.png
new file mode 100755
index 0000000..575b2f5
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected2.png
new file mode 100755
index 0000000..42f3819
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/24IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25Icon.png
new file mode 100755
index 0000000..d5bc294
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected.png
new file mode 100755
index 0000000..1dcd4c5
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected2.png
new file mode 100755
index 0000000..c6014ab
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/25IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26Icon.png
new file mode 100755
index 0000000..c4e0d1e
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected.png
new file mode 100755
index 0000000..a5b4a71
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected2.png
new file mode 100755
index 0000000..863388e
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/26IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27Icon.png
new file mode 100755
index 0000000..07c53a2
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected.png
new file mode 100755
index 0000000..8d01e8f
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected2.png
new file mode 100755
index 0000000..7d6782a
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/27IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28Icon.png
new file mode 100755
index 0000000..17c9898
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected.png
new file mode 100755
index 0000000..db47a3c
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected2.png
new file mode 100755
index 0000000..46606b4
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/28IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2Icon.png
index 59a5ad9..a7eadb4 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected.png
index 34011fb..4c98a55 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected2.png
new file mode 100755
index 0000000..61d3db8
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/2IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3Icon.png
index e19bb68..f2521ac 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected.png
index 9be55b9..7c37e9b 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected2.png
new file mode 100755
index 0000000..674d06f
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/3IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4Icon.png
index 7d4c142..09559e3 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected.png
index bd02961..1b952d6 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected2.png
new file mode 100755
index 0000000..e6940df
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/4IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5Icon.png
index aa55690..f3c7b17 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected.png
index 3f9b64a..d3c1005 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected2.png
new file mode 100755
index 0000000..d402904
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/5IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6Icon.png
index 92c63e4..88d8280 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected.png
index b48c0fd..ae4dd06 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected2.png
new file mode 100755
index 0000000..ee38c4f
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/6IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7Icon.png
index 48a6e27..a4f26c2 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected.png
index 2a26207..c5e5db8 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected2.png
new file mode 100755
index 0000000..19d5db3
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/7IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8Icon.png
index 4a3bbef..b82afcf 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected.png
index d11557c..8ede4b8 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected2.png
new file mode 100755
index 0000000..687ea40
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/8IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9Icon.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9Icon.png
index f178284..d8b35dc 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9Icon.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9Icon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected.png
index f095bfb..38e9ca2 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected2.png
new file mode 100755
index 0000000..86adf04
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/FunctionIcon/9IconSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelCurtain.png b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelCurtain.png
new file mode 100755
index 0000000..a68129c
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelCurtain.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelCurtain.png b/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelCurtain.png
new file mode 100755
index 0000000..ae97ad5
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/RealDevice/ButtonPanelCurtain.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Room/RoomShadow.png b/ZigbeeApp/Home.Ios/Resources/Phone/Room/RoomShadow.png
index c626c4b..067e75f 100755
--- a/ZigbeeApp/Home.Ios/Resources/Phone/Room/RoomShadow.png
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/Room/RoomShadow.png
Binary files differ
diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs
index a46fe5e..e4507bc 100755
--- a/ZigbeeApp/Shared/Common/CommonPage.cs
+++ b/ZigbeeApp/Shared/Common/CommonPage.cs
@@ -43,11 +43,6 @@
Application.MainPage.AddChidren(Loading);
//}
Phone.UserView.HomePage.Instance.InitPage();
-
- var roomList = new Shared.Phone.Device.Room.RoomManagement();
-
- Instance.AddLeftView(roomList);
- roomList.Show();
}
public static string SoftTitle = "ZigBee";
@@ -62,7 +57,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string CodeIDString = "1.0.20030601";
+ public static string CodeIDString = "1.0.20032001";
/// <summary>
/// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee)
/// </summary>
diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs
index cdc9c4d..c59d1e3 100755
--- a/ZigbeeApp/Shared/Common/Device.cs
+++ b/ZigbeeApp/Shared/Common/Device.cs
@@ -475,9 +475,28 @@
//澶囦唤鏁版嵁
await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.AMac鍚嶇О, newMacName);
//濡傛灉瀹冨彧鏈変竴涓洖璺�,鍒欐洿鏀圭鐐瑰悕瀛�
- if (this.dicDeviceEpoint.ContainsKey(device.DeviceAddr) == true && this.dicDeviceEpoint[device.DeviceAddr].Count == 1)
+ if (this.dicDeviceEpoint.ContainsKey(device.DeviceAddr) == true)
{
- return await this.ReName(device, newMacName);
+ //鍙湁涓�涓鐐�
+ if (this.dicDeviceEpoint[device.DeviceAddr].Count == 1)
+ {
+ return await this.ReName(device, newMacName);
+ }
+ //濡傛灉瀹冩湁涓や釜绔偣鏃�,pir浼犳劅鍣ㄧ壒娈婂鐞�
+ else if (this.dicDeviceEpoint[device.DeviceAddr].Count == 2)
+ {
+ var myType = this.GetMyDeviceEnumInfo(listDevice);
+ if (myType.ConcreteType == DeviceConcreteType.Sensor_Pir)
+ {
+ foreach (var myDevice in listDevice)
+ {
+ if (myDevice.Type == DeviceType.IASZone)
+ {
+ return await this.ReName(myDevice, newMacName);
+ }
+ }
+ }
+ }
}
}
return true;
@@ -1145,6 +1164,33 @@
}
/// <summary>
+ /// 璁剧疆璁惧銆愬浘鏍囥�戝埌鎸囧畾鐨勬帶浠�(娉ㄦ剰,姝ゅ嚱鏁拌缃殑閫夋嫨鐘舵�佺殑鍥剧墖鏄櫧鑹茬殑)
+ /// </summary>
+ /// <param name="btnIcon">鎺т欢瀵硅薄</param>
+ /// <param name="device">璁惧瀵硅薄</param>
+ /// <returns></returns>
+ public void SetDeviceIconToControl2(Button btnIcon, CommonDevice device)
+ {
+ if (device == null)
+ {
+ btnIcon.UnSelectedImagePath = "Device/ThirdPartyDevice.png";
+ return;
+ }
+ string unSelectFilePath = device.IconPath;
+ string selectFilePath = unSelectFilePath.Replace(".png", "Selected2.png");
+
+ //鑾峰彇璁惧銆愬浘鏍囥��
+ if (btnIcon.UnSelectedImagePath != unSelectFilePath)
+ {
+ btnIcon.UnSelectedImagePath = unSelectFilePath;
+ }
+ if (btnIcon.SelectedImagePath != selectFilePath)
+ {
+ btnIcon.SelectedImagePath = selectFilePath;
+ }
+ }
+
+ /// <summary>
/// 鑾峰彇璁惧銆愬浘鏍囥��
/// </summary>
/// <param name="listdevice">璁惧瀵硅薄</param>
@@ -1397,6 +1443,9 @@
return null;
}
string modelKeys = device.ModelIdentifier;
+ //浜ゆ崲涓�涓嬫ā鍧桰D(楹︿箰鍏嬮偅杈圭殑浼犳劅鍣�)
+ this.ChangedDeviceModeId(ref modelKeys);
+
if (this.dicDeviceModelIdEnum.ContainsKey(modelKeys) == false)
{
//娌℃湁鍖归厤鍒版ā鍧桰D锛屽垯鐩存帴璧扮涓夋柟璁惧鐨勫垽鏂�
@@ -1814,6 +1863,80 @@
return null;
}
return HdlRoomLogic.Current.GetRoomById(this.dicDeviceRoomId[device.DeviceAddr]);
+ }
+
+ #endregion
+
+ #region 鈻� 璁惧鎺掑簭___________________________
+
+ /// <summary>
+ /// 璁惧鎺掑簭
+ /// </summary>
+ /// <param name="i_listDevice">璇风‘淇濊繖涓笢瑗垮凡缁忔寜mac鍜岀鐐规帓搴忎簡</param>
+ /// <returns></returns>
+ public List<CommonDevice> SortDeviceByBelongType(List<CommonDevice> i_listDevice)
+ {
+ //鑾峰彇鎺掑簭瑙勫垯
+ var listRule = this.GetBelongTypeSortRule();
+ var dicDevice = new Dictionary<DeviceBeloneType, List<CommonDevice>>();
+ dicDevice[DeviceBeloneType.A鏈煡璁惧] = new List<CommonDevice>();
+
+ foreach (var device in i_listDevice)
+ {
+ //鑾峰彇鎵�灞炵被鍨�
+ var typeInfo = this.GetDeviceBelongEnumInfo(device);
+ if (listRule.Contains(typeInfo.BeloneType) == false)
+ {
+ //涓嶅湪鎺掑簭鑼冨洿鍐�,閮戒涪鍦ㄦ渶鍚庨潰
+ dicDevice[DeviceBeloneType.A鏈煡璁惧].Add(device);
+ continue;
+ }
+ if (dicDevice.ContainsKey(typeInfo.BeloneType) == false)
+ {
+ dicDevice[typeInfo.BeloneType] = new List<CommonDevice>();
+ }
+ dicDevice[typeInfo.BeloneType].Add(device);
+ }
+
+ var listSort = new List<CommonDevice>();
+ foreach (var myType in listRule)
+ {
+ //鏍规嵁瑙勫垯椤哄簭,娣诲姞璁惧
+ if (dicDevice.ContainsKey(myType) == false || dicDevice[myType].Count == 0)
+ {
+ continue;
+ }
+ listSort.AddRange(dicDevice[myType]);
+ }
+
+ return listSort;
+ }
+
+ /// <summary>
+ /// 鑾峰彇璁惧鎵�灞炵被鍨嬬殑鐨勬帓搴忚鍒�
+ /// </summary>
+ /// <returns></returns>
+ public HashSet<DeviceBeloneType> GetBelongTypeSortRule()
+ {
+ //璋佸湪鍓嶉潰,璋佸氨浼樺厛鏄剧ず
+ var list = new HashSet<DeviceBeloneType>();
+ list.Add(DeviceBeloneType.A鐏厜);
+ list.Add(DeviceBeloneType.A褰╃伅);
+ list.Add(DeviceBeloneType.A寮�鍏�);
+ list.Add(DeviceBeloneType.A鎻掑骇);
+ list.Add(DeviceBeloneType.A璋冨厜鍣�);
+ list.Add(DeviceBeloneType.A绐楀笜);
+ list.Add(DeviceBeloneType.A绌鸿皟);
+ list.Add(DeviceBeloneType.A缁х數鍣�);
+ list.Add(DeviceBeloneType.A骞叉帴鐐�);
+ list.Add(DeviceBeloneType.A鏅鸿兘闂ㄩ攣);
+ list.Add(DeviceBeloneType.A鏅鸿兘绌哄紑);
+ list.Add(DeviceBeloneType.A浼犳劅鍣�);
+
+ //鍏朵粬鐨勭湅鐫�鍔炲憲,閮芥槸鎺掑湪鍚庨潰鐨�,閮藉綊涓鸿繖涓睘鎬�
+ list.Add(DeviceBeloneType.A鏈煡璁惧);
+
+ return list;
}
#endregion
@@ -2261,7 +2384,7 @@
//1銆佸湪杩欓噷濉啓涓婃ā鍧桰D锛岀劧鍚庢槸 DeviceConcreteType 锛岀劧鍚庢槸 DeviceBeloneType
//2銆佺劧鍚庡湪鏈�涓嬮潰鐨勩�愯嚜瀹氫箟璁惧绫诲瀷銆戞姌鍙犳爮閲屾坊鍔犮�愯澶囩殑鍏蜂綋绫诲瀷銆戯紝銆愯澶囩殑鎵�灞炵被鍨嬨��
//3銆佷互璁惧鐨勫叿浣撶被鍨嬩负鍚嶅瓧(鍘绘帀銆�-銆�)娣诲姞璁惧鐨勩�愭墍灞炲浘鐗囥�戯紝銆愮湡瀹炵墿鐞嗗浘鐗囥�戙�傚洖璺浘鐗囬渶瑕佺壒娈婂鐞�
- //4銆佹坊鍔燫鏂囦欢,娣诲姞Language鏂囦欢
+ //4銆佹坊鍔燫鏂囦欢(uDeviceModelId),娣诲姞Language鏂囦欢
//5銆佸鏋滈渶瑕佸叡鏈夊浘鐗�,鍒欏湪杩欎釜鍑芥暟鐨勬渶搴曚笅娣诲姞
//*********************************************************************
@@ -2285,6 +2408,7 @@
this.dicDeviceModelIdEnum["MP8B/TILE-ZB.18"] = "242-200";//鏂规偊鍥涘紑鍏帶闈㈡澘
this.dicDeviceModelIdEnum["MPFA/TILE-ZB.18"] = "250-200";//鏂规偊鏂伴闈㈡澘
this.dicDeviceModelIdEnum["MPTE3/TILE-ZB.18"] = "253-200";//鏂规偊鐜闈㈡澘
+ this.dicDeviceModelIdEnum["MP2W/TILE-ZB.18"] = "256-200";//绐楀笜闈㈡澘
//=========鈽呪槄PIR浼犳劅鍣ㄧ被(1200-1299)鈽呪槄=========
this.dicDeviceModelIdEnum["MSPIR01-ZB.10"] = "1200-1200";//pir浼犳劅鍣�220
@@ -2299,12 +2423,14 @@
//=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄=========
this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300";//3璺户鐢靛櫒灏忔ā鍧�
+ this.dicDeviceModelIdEnum["MFA01-ZB1.0"] = "2310-2300";//鏂规偊鏂伴灏忔ā鍧�
//=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄=========
this.dicDeviceModelIdEnum["MPD0101-ZB.10"] = "2500-2500";//1璺皟鍏夊櫒灏忔ā鍧�
//=========鈽呪槄鏅鸿兘闂ㄩ攣绫�(2800-????)鈽呪槄=========
this.dicDeviceModelIdEnum["H06C"] = "2800-2800";//鏅鸿兘闂ㄩ攣(H06C)
+ this.dicDeviceModelIdEnum["S-one"] = "2802-2800";//鏅鸿兘闂ㄩ攣(S-one)
//=========鈽呪槄绌鸿皟绫�(3600-3899)鈽呪槄=========
this.dicDeviceModelIdEnum["MAC/GW-ZB.10"] = "3600-3600";//zigbee绌鸿皟缃戝叧妯″潡
@@ -2340,6 +2466,8 @@
this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//绠�绾�4鎸夐敭闈㈡澘 娌跨敤 4鎸夐敭鐨勫浘鏍�
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鐨勫浘鏍�
+
}
#endregion
@@ -2434,11 +2562,15 @@
/// <summary>
/// 鏂规偊鏂伴闈㈡澘 闀滃儚id锛�250
/// </summary>
- ButtonPanel_FangyueNewWind = 250,
+ ButtonPanel_FangyueFreshAir = 250,
/// <summary>
/// 鏂规偊鐜闈㈡澘 闀滃儚id锛�253
/// </summary>
ButtonPanel_FangyueEnvironment = 253,
+ /// <summary>
+ /// 绐楀笜闈㈡澘 闀滃儚id锛�256
+ /// </summary>
+ ButtonPanel_Curtain = 256,
//=========鈽呪槄PIR浼犳劅鍣ㄧ被(1200-1299)鈽呪槄=========
/// <summary>
@@ -2505,7 +2637,11 @@
/// 涓夎矾缁х數鍣� 闀滃儚id锛�2300
/// </summary>
Relay_ThreeLoad = 2300,
-
+ /// <summary>
+ /// 鏂规偊鏂伴灏忔ā鍧� 闀滃儚id锛�2310
+ /// </summary>
+ Relay_FangyueFreshAirModul = 2310,
+
//=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄=========
/// <summary>
/// 璋冨厜鍣�
@@ -2525,6 +2661,10 @@
/// H06C
/// </summary>
IntelligentLocks_H06C = 2800,
+ /// <summary>
+ /// S-one
+ /// </summary>
+ IntelligentLocks_Sone = 2802,
//=========鈽呪槄褰╃伅绫�(????-????)鈽呪槄=========
/// <summary>
diff --git a/ZigbeeApp/Shared/Common/House.cs b/ZigbeeApp/Shared/Common/House.cs
index 7da0b22..0f8ae04 100755
--- a/ZigbeeApp/Shared/Common/House.cs
+++ b/ZigbeeApp/Shared/Common/House.cs
@@ -70,7 +70,7 @@
/// <summary>
/// 褰撳墠妤煎眰Id
/// </summary>
- public string CurrentFloorId;
+ public string CurrentFloorId = string.Empty;
/// <summary>
/// 鍏ㄥ眬鍦烘櫙璺緞鍒楄〃---澶囩敤
diff --git a/ZigbeeApp/Shared/Common/Logic.cs b/ZigbeeApp/Shared/Common/Logic.cs
index 879b843..1bc61e4 100755
--- a/ZigbeeApp/Shared/Common/Logic.cs
+++ b/ZigbeeApp/Shared/Common/Logic.cs
@@ -17,7 +17,7 @@
/// </summary>
public int Result;
/// <summary>
- /// 0.姝e父鑷姩鍖�;1.闂ㄩ攣鑷姩鍖�
+ /// 0.姝e父鑷姩鍖�;1.闂ㄩ攣鑷姩鍖�;2.闂ㄩ攣甯稿紑.鍏�;
/// </summary>
public int LogicType = 0;
/// <summary>
diff --git a/ZigbeeApp/Shared/Common/SceneUI.cs b/ZigbeeApp/Shared/Common/SceneUI.cs
index fa908a3..6a671f9 100755
--- a/ZigbeeApp/Shared/Common/SceneUI.cs
+++ b/ZigbeeApp/Shared/Common/SceneUI.cs
@@ -11,7 +11,7 @@
[System.Serializable]
public class SceneUI : ZigBee.Device.CommonDevice
{
- #region 鈻� 鍙橀噺澹版槑___________________________
+ #region 鈻� 鍙橀噺澹版槑_________________________
/// <summary>
/// 鍦烘櫙鏂囦欢
/// </summary>
@@ -60,6 +60,11 @@
[Newtonsoft.Json.JsonIgnore]
public int RemainTime;
/// <summary>
+ /// 寤舵椂鏃堕棿绾跨▼鏄惁杩愯
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public bool RemainThreadAction = false;
+ /// <summary>
/// 鍦烘櫙鎵ц鐩爣
/// </summary>
public List<ZigBee.Device.Scene.AddSceneMemberData> AddSceneMemberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData> { };
@@ -79,9 +84,8 @@
{
HdlAutoBackupLogic.AddOrEditorFile(FileName);
}
- }
-
+ }
+
#endregion
-
}
}
diff --git a/ZigbeeApp/Shared/Common/ZigbeeColor.cs b/ZigbeeApp/Shared/Common/ZigbeeColor.cs
index 79b9ea8..5010dce 100755
--- a/ZigbeeApp/Shared/Common/ZigbeeColor.cs
+++ b/ZigbeeApp/Shared/Common/ZigbeeColor.cs
@@ -45,6 +45,24 @@
public uint XMTitleLine = 0x40000000;
public uint XMInVisibleLine = 0x00000000;
public uint XMRowLine = 0x66CCCCCC;
+ /// <summary>
+ /// 0xFF232323
+ /// </summary>
+ public uint XMSeekBarBackgroundColor = 0xFF232323;
+ /// <summary>
+ /// 0xFFECECEC
+ /// </summary>
+ public uint XMProgressBarColor = 0xFFECECEC;
+ /// <summary>
+ /// 0xFFF5F6FA
+ /// </summary>
+ public uint XMPEditTextBackground = 0xFFF5F6FA;
+ /// <summary>
+ /// 0xFFF5F6FA
+ /// </summary>
+ public uint XMAlarmText = 0xFFF75858;
+
+
#endregion
diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll
index 931001e..56238f6 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 d022973..5cb2f79 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 bda1120..f20443e 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 5d80d69..3413a8b 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/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
new file mode 100755
index 0000000..fa0c778
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -0,0 +1,1471 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.Phone.UserView;
+using Shared.R;
+using Shared.Phone.Device.CommonForm;
+using Shared.Phone.UserCenter;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category
+{
+ /// <summary>
+ /// 鍒嗙被鐨勪富鐣岄潰
+ /// </summary>
+ public class CategoryMainForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// The instance.
+ /// </summary>
+ public static CategoryMainForm instance;
+ /// <summary>
+ /// 鍦烘櫙鍔熻兘涓儴鑳屾櫙bodyView(楂樺害涓鸿澶囪彍鍗曠殑閭d釜鐧借壊鑳屾櫙鐨勪笂閮ㄥ埌灞忓箷搴曢儴)
+ /// </summary>
+ public FrameLayout functionSceneBodyView;
+ /// <summary>
+ /// 涓儴鑳屾櫙bodyView(楂樺害涓哄満鏅姛鑳藉垏鎹㈡帶浠剁殑搴曢儴鍒板睆骞曞簳閮�)
+ /// </summary>
+ public FrameLayout functionSceneAutoBodyView;
+ /// <summary>
+ /// 鍙充笂瑙掓坊鍔犳寜閽�
+ /// </summary>
+ private IconViewControl btnTopRightAdd = null;
+ /// <summary>
+ /// 妤煎眰鎺т欢
+ /// </summary>
+ private NormalViewControl btnFloorName = null;
+ /// <summary>
+ /// 妤煎眰鍥炬爣鎺т欢
+ /// </summary>
+ private IconViewControl btnFloorIcon = null;
+ /// <summary>
+ /// 璁惧琛屾帶浠�
+ /// </summary>
+ private Dictionary<string, Controls.DeviceRowCommon> dicDeviceRowControl = new Dictionary<string, Controls.DeviceRowCommon>();
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鏋勯�犳柟娉�
+ /// </summary>
+ public CategoryMainForm()
+ {
+ BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
+ instance = this;
+ }
+
+ /// <summary>
+ /// 鏄剧ず鐣岄潰--榛樿鍦烘櫙鐣岄潰
+ /// </summary>
+ public void ShowForm()
+ {
+ //鍏堟竻闄ゅ惂
+ this.RemoveAll();
+ //鍒濆鍖栧ご閮ㄦ帶浠�
+ this.InitTopControl();
+ //鍒濆鍖栦腑闂存帶浠�
+ this.InitMidControls();
+ //娣诲姞璁惧鐘舵�佷笂鎶ヤ簨浠�
+ this.AddNormalDeviceReportEvent();
+ //娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠�
+ this.AddSensorDeviceReportEvent();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧ご閮ㄦ帶浠�
+ /// </summary>
+ private void InitTopControl()
+ {
+ //澶撮儴FrameLayout
+ this.topFrameLayout = new FrameLayout();
+ topFrameLayout.Y = Application.GetRealHeight(104);
+ topFrameLayout.Height = Application.GetRealHeight(127);
+ topFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
+ this.AddChidren(topFrameLayout);
+ //鏍囬鍒嗙被
+ var btnTitle = new NormalViewControl(300, 95, true);
+ btnTitle.X = ControlCommonResourse.XXLeft;
+ btnTitle.Gravity = Gravity.CenterVertical;
+ btnTitle.TextID = R.MyInternationalizationString.Category;
+ btnTitle.TextSize = 24;
+ btnTitle.TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor;
+ btnTitle.IsBold = true;
+ topFrameLayout.AddChidren(btnTitle);
+
+ //鍙充笂瑙掓坊鍔犳寜閽�
+ this.btnTopRightAdd = new IconViewControl(104);
+ btnTopRightAdd.X = Application.GetRealWidth(953);
+ btnTopRightAdd.Gravity = Gravity.CenterVertical;
+ btnTopRightAdd.UnSelectedImagePath = "Item/Add_Category.png";
+ topFrameLayout.AddChidren(btnTopRightAdd);
+ btnTopRightAdd.ButtonClickEvent += (sender, e) =>
+ {
+ if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 0)
+ {
+ //娣诲姞鍦烘櫙
+ Add_Scene();
+ }
+ else if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 2)
+ {
+ //娣诲姞鑷姩鍖�
+ Add_Automation();
+ }
+ };
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑闂存帶浠�
+ /// </summary>
+ private void InitMidControls()
+ {
+ //搴旇鏄痓ody鍚�
+ this.bodyFrameLayout = new FrameLayout();
+ bodyFrameLayout.Y = topFrameLayout.Bottom;
+ bodyFrameLayout.Height = Application.GetRealHeight(1549);
+ bodyFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
+ this.AddChidren(bodyFrameLayout);
+
+ //鍦烘櫙,鍔熻兘,鑷姩鍖栫殑鍒囨崲鎺т欢鐨勫鍣�
+ var frameSwitchBack = new FrameLayout();
+ frameSwitchBack.Height = Application.GetRealHeight(127);
+ bodyFrameLayout.AddChidren(frameSwitchBack);
+
+ //鎷ユ湁妤煎眰鏃�
+ this.btnFloorName = null;
+ this.btnFloorIcon = null;
+ if (Config.Instance.Home.FloorDics.Count > 0)
+ {
+ //妤煎眰鍚�
+ this.btnFloorName = new NormalViewControl(200, 69, true);
+ btnFloorName.X = frameSwitchBack.Width - Application.GetRealWidth(200 + 120);
+ btnFloorName.Y = Application.GetRealHeight(17);
+ btnFloorName.TextAlignment = TextAlignment.CenterRight;
+ btnFloorName.IsBold = true;
+ btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(Config.Instance.Home.CurrentFloorId);
+ frameSwitchBack.AddChidren(btnFloorName);
+ btnFloorName.ButtonClickEvent += (sender, e) =>
+ {
+ var floors = new Device.Category.SelectFloor();
+ AddChidren(floors);
+ floors.Init(580, 330, Direction.Right);
+ floors.changeFloor = true;
+ floors.FloorAction += (floorId) =>
+ {
+ btnFloorName.Text = Config.Instance.Home.GetFloorNameById(floorId);
+ HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
+ //鍒锋柊bodyView
+ this.RefreshBodyView();
+ };
+ };
+ //妤煎眰鍥炬爣
+ this.btnFloorIcon = new IconViewControl(69);
+ btnFloorIcon.X = Application.GetRealWidth(950);
+ btnFloorIcon.Y = btnFloorName.Y;
+ btnFloorIcon.UnSelectedImagePath = "Item/Drop_Down.png";
+ frameSwitchBack.AddChidren(btnFloorIcon);
+ btnFloorIcon.ButtonClickEvent += (sender, e) =>
+ {
+ btnFloorName.ButtonClickEvent?.Invoke(sender, e);
+ };
+ }
+
+ //鐩墠涓嶇煡閬撻儹闆煄鐨勮繖涓叿浣撴斁鍦ㄥ摢涓殑浣嶇疆
+ this.functionSceneAutoBodyView = new FrameLayout();
+ functionSceneAutoBodyView.Y = frameSwitchBack.Bottom;
+ functionSceneAutoBodyView.Height = Application.GetRealHeight(1423);
+ bodyFrameLayout.AddChidren(functionSceneAutoBodyView);
+
+ //鍦烘櫙,鍔熻兘,鑷姩鍖栫殑鍒囨崲鎺т欢
+ var switchContr = new SceneFunctionSwitchControl();
+ switchContr.Width = Application.GetRealWidth(650);
+ switchContr.Gravity = Gravity.CenterVertical;
+ frameSwitchBack.AddChidren(switchContr);
+ var listTitle = new List<string>();
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uScence));
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction));
+ if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
+ {
+ //鎴愬憳娌℃湁鑷姩鍖�
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.Automation));
+ }
+ //璁剧疆鍒濆鍊�
+ switchContr.SetDefultIndex(UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex);
+ //閫夋嫨浜嬩欢
+ switchContr.SelectTabEvent += (selectIndex) =>
+ {
+ UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = selectIndex;
+ //鍒锋柊bodyView
+ this.RefreshBodyView();
+ };
+ //寮�濮嬪垵濮嬪寲
+ switchContr.InitControl(listTitle);
+ }
+
+ /// <summary>
+ /// 鍒锋柊bodyView
+ /// </summary>
+ public void RefreshBodyView()
+ {
+ this.functionSceneAutoBodyView.RemoveAll();
+
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ bool floorVisible = true;
+ //鍦烘櫙
+ if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 0)
+ {
+ //鍒濆鍖栨埧闂磋彍鍗�
+ this.InitRoomMenuControl();
+ //鏄剧ず鍙充笂瑙掔殑鍔犲彿
+ this.btnTopRightAdd.Visible = true;
+ }
+ //鍔熻兘
+ else if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 1)
+ {
+ //鍒濆鍖栨埧闂磋彍鍗�
+ this.InitRoomMenuControl();
+ //闅愯棌鍙充笂瑙掔殑鍔犲彿
+ this.btnTopRightAdd.Visible = false;
+ }
+ //鑷姩鍖�
+ else if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 2)
+ {
+ this.ShowAutotion();
+ //闅愯棌妤煎眰
+ floorVisible = false;
+ //鏄剧ず鍙充笂瑙掔殑鍔犲彿
+ this.btnTopRightAdd.Visible = true;
+ }
+
+ //淇敼妤煎眰鐨勬樉绀烘晥鏋�
+ if (this.btnFloorName != null)
+ {
+ this.btnFloorName.Visible = floorVisible;
+ this.btnFloorIcon.Visible = floorVisible;
+ }
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鎴块棿鑿滃崟鎺т欢_______________________
+
+ /// <summary>
+ /// 鍒濆鍖栨埧闂磋彍鍗曟帶浠�
+ /// </summary>
+ private void InitRoomMenuControl()
+ {
+ //褰撳墠妤煎眰鐨勫叏閮ㄦ埧闂�
+ var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
+ //鎴块棿鑿滃崟鎺т欢
+ var roomSwitchContr = new RoomDeviceGroupMenuControl(lisrRoom);
+ roomSwitchContr.Y = Application.GetRealHeight(-55);
+ this.functionSceneAutoBodyView.AddChidren(roomSwitchContr);
+ //璁剧疆鍒濆鍊�
+ roomSwitchContr.SetDefultIndex(HdlRoomLogic.Current.CurrentRoom.Id);
+ //閫夋嫨浜嬩欢
+ roomSwitchContr.SelectRoomEvent += (selectRoom) =>
+ {
+ HdlRoomLogic.Current.CurrentRoom = selectRoom;
+ //鍦烘櫙
+ if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 0)
+ {
+ //鍦ㄥ闈㈡竻绌�(鐗规晥鐨勯棶棰�)
+ this.functionSceneBodyView.RemoveAll();
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ //鍒锋柊鍦烘櫙鍒嗘敮鎺т欢
+ this.RefreshSceneView(selectRoom);
+ });
+ }
+ //鍔熻兘
+ else if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 1)
+ {
+ //鍦ㄥ闈㈡竻绌�(鐗规晥鐨勯棶棰�)
+ this.functionSceneBodyView.RemoveAll();
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ //鍒锋柊璁惧鍒嗘敮鎺т欢
+ this.RefreshFunctionView(selectRoom);
+ });
+ }
+ };
+
+ //鍔熻兘鍜屽満鏅痓odyView
+ this.functionSceneBodyView = new FrameLayout();
+ functionSceneBodyView.Y = roomSwitchContr.Bottom;
+ functionSceneBodyView.Height = functionSceneAutoBodyView.Height - roomSwitchContr.Bottom;
+ functionSceneAutoBodyView.AddChidren(functionSceneBodyView);
+
+ //鎵ц鍒濆鍖�
+ roomSwitchContr.InitControl();
+ }
+
+ #endregion
+
+ #region 鈻� 鍔熻兘鍒嗘敮___________________________
+
+ /// <summary>
+ /// 鍒锋柊鍔熻兘鍒嗘敮鎺т欢
+ /// </summary>
+ /// <param name="room"></param>
+ private void RefreshFunctionView(Common.Room room)
+ {
+ //鑾峰彇鍒嗙粍鍚庣殑璁惧
+ var dicGroupDevice = this.GetAllGroupDevice(room);
+ if (dicGroupDevice.Count == 0)
+ {
+ this.ShowNoFunctionTip();
+ return;
+ }
+
+ //璁惧鑿滃崟鐨勭櫧鑹茶儗鏅�
+ var functionBack1 = new FrameLayout();
+ functionBack1.X = ControlCommonResourse.XXLeft;
+ functionBack1.Height = Application.GetRealHeight(160);
+ functionBack1.Width = Application.GetRealWidth(1028);
+ functionBack1.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+ functionSceneBodyView.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;
+ functionSceneBodyView.AddChidren(functionBack2);
+ functionBack2.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
+
+ //璁惧鑿滃崟鐨勫乏鍙虫粦鍔ㄧ殑鎺т欢
+ var HorizontalView = new HorizontalScrolViewLayout();
+ HorizontalView.X = Application.GetRealWidth(CommonFormResouce.X_Left);
+ HorizontalView.Height = Application.GetRealHeight(279);
+ HorizontalView.Width = Application.GetRealWidth(1028);
+ functionSceneBodyView.AddChidren(HorizontalView);
+
+ //璁惧鐨勮儗鏅鍣�
+ var frameDeviceBack = new FrameLayout();
+ frameDeviceBack.X = ControlCommonResourse.XXLeft;
+ frameDeviceBack.Y = HorizontalView.Bottom + Application.GetRealHeight(35);
+ frameDeviceBack.BackgroundColor = UserCenterColor.Current.White;
+ frameDeviceBack.Width = bodyFrameLayout.Width;
+ frameDeviceBack.Height = functionSceneBodyView.Height - HorizontalView.Bottom - Application.GetRealHeight(35);
+ frameDeviceBack.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
+ functionSceneBodyView.AddChidren(frameDeviceBack);
+
+ //璁惧鍒楄〃鎺т欢
+ var 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);
+
+ //涓婁竴娆¢�夋嫨鐨勮彍鍗�
+ MainPage.Controls.DeviceFunctionUnallocatedControl oldSelectContr = null;
+ DeviceRowInfo nowSelectDeviceInfo = null;
+ foreach (int Textid in dicGroupDevice.Keys)
+ {
+ var rowInfo = dicGroupDevice[Textid];
+
+ //璁惧绫诲瀷鐨勫鍣�
+ var devieFrame = new FrameLayout();
+ devieFrame.Width = Application.GetRealWidth(220);
+ HorizontalView.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);
+ });
+ }
+ };
+
+ if (nowSelectDeviceInfo == null)
+ {
+ //璁剧疆鍒濆閫夋嫨
+ nowSelectDeviceInfo = rowInfo;
+ //璁板綍鍒濆閫夋嫨鐨勮彍鍗曟帶浠�
+ oldSelectContr = deviceObjContr;
+ deviceObjContr.SetSelectStatu(true);
+ }
+ }
+ if (nowSelectDeviceInfo != null)
+ {
+ //鍒濆鍖栭粯璁ょ殑璁惧鍒楄〃鎺т欢
+ this.InitListDeviceControls(listDeviceView, nowSelectDeviceInfo);
+ }
+ }
+
+ /// <summary>
+ /// 鎻愮ず娌℃湁鍔熻兘
+ /// </summary>
+ private void ShowNoFunctionTip()
+ {
+ var noFunction = new Button()
+ {
+ Y = Application.GetRealHeight(320),
+ Width = Application.GetMinRealAverage(757),
+ Height = Application.GetMinRealAverage(435),
+ UnSelectedImagePath = "Item/NoFunction.png",
+ Gravity = Gravity.CenterHorizontal
+ };
+ functionSceneBodyView.AddChidren(noFunction);
+
+ var noFunctionTip = new Button()
+ {
+ Y = noFunction.Bottom + Application.GetRealHeight(32),
+ Height = Application.GetRealHeight(200),
+ Width = Application.GetRealWidth(700),
+ Gravity = Gravity.CenterHorizontal,
+ Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"),
+ TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
+ TextAlignment = TextAlignment.Center,
+ IsMoreLines = true
+ };
+ functionSceneBodyView.AddChidren(noFunctionTip);
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栬澶囧垪琛ㄦ帶浠禵________________
+
+ /// <summary>
+ /// 鍒濆鍖栬澶囧垪琛ㄦ帶浠�
+ /// </summary>
+ /// <param name="listView"></param>
+ /// <param name="rowInfo"></param>
+ private void InitListDeviceControls(VerticalListControl listView, DeviceRowInfo rowInfo)
+ {
+ //鍏堟竻绌�
+ listView.RemoveAll();
+
+ var listDevice = new List<CommonDevice>();
+ foreach (var mainkeys in rowInfo.listDeviceKeys)
+ {
+ var device = LocalDevice.Current.GetDevice(mainkeys);
+ if (device != null)
+ {
+ listDevice.Add(device);
+ }
+ }
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ var listContr = new List<Controls.DeviceRowCommon>();
+ foreach (var device in listDevice)
+ {
+ Controls.DeviceRowCommon cardContr = null;
+ //绐楀笜
+ if (device.Type == DeviceType.WindowCoveringDevice)
+ {
+ cardContr = new Controls.DeviceCurtainRowControl(listView.rowSpace / 2);
+ }
+ //缁х數鍣�
+ else if (device.Type == DeviceType.OnOffOutput)
+ {
+ cardContr = new Controls.DeviceRelayRowControl(listView.rowSpace / 2);
+ }
+ //绌烘皵寮�鍏�
+ else if (device.Type == DeviceType.AirSwitch)
+ {
+ cardContr = new Controls.DeviceAirSwitchRowControl(listView.rowSpace / 2);
+ }
+ //绌鸿皟
+ else if (device.Type == DeviceType.Thermostat)
+ {
+ cardContr = new Controls.DeviceAcRowControl(listView.rowSpace / 2);
+ }
+ //褰╃伅(璋冨厜鍣�)
+ else if (device.Type == DeviceType.DimmableLight)
+ {
+ cardContr = new Controls.DeviceColorLightRowControl(listView.rowSpace / 2);
+ }
+ //浼犳劅鍣�
+ else if (device.Type == DeviceType.IASZone)
+ {
+ cardContr = new Controls.DeviceSensorRowControl(listView.rowSpace / 2);
+ }
+ //娓╂箍搴�
+ else if (device.Type == DeviceType.TemperatureSensor)
+ {
+ cardContr = new Controls.DeviceTemperatureRowControl(listView.rowSpace / 2);
+ }
+ //闂ㄩ攣
+ else if (device.Type == DeviceType.DoorLock)
+ {
+ cardContr = new Controls.DeviceDoorLockRowControl(listView.rowSpace / 2);
+ }
+ //鏃犳硶璇嗗埆
+ else
+ {
+ cardContr = new Controls.DeviceRowCommon(listView.rowSpace / 2);
+ //娌℃湁鐘舵�佸姛鑳�
+ cardContr.hadStatuFunction = false;
+ }
+
+ //鍒濆鍖栧崱鐗�
+ listView.AddChidren(cardContr);
+ cardContr.InitControl(device);
+ //鎺т欢璁板綍鍒扮紦瀛樹腑
+ this.dicDeviceRowControl[LocalDevice.Current.GetDeviceMainKeys(device)] = cardContr;
+ //鍔犵紦瀛�,鐒跺悗鍙戝懡浠�
+ listContr.Add(cardContr);
+ }
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ for (int i = 0; i < listContr.Count; i++)
+ {
+ if (listView.Parent == null)
+ {
+ return;
+ }
+ System.Threading.Thread.Sleep(20);
+ //鍙戦�佽幏鍙栫姸鎬佺殑鍛戒护
+ listContr[i].SendStatuComand();
+ }
+
+ }, ShowErrorMode.NO);
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鍦烘櫙鍒嗘敮___________________________
+
+ /// <summary>
+ /// 鍒锋柊鍦烘櫙鍒嗘敮鎺т欢
+ /// </summary>
+ /// <param name="room"></param>
+ private void RefreshSceneView(Room room)
+ {
+ var listScene = new List<SceneUI>();
+ foreach (var sceneId in room.ListSceneId)
+ {
+ var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
+ if (scene != null)
+ {
+ listScene.Add(scene);
+ }
+ }
+ if (listScene.Count == 0)
+ {
+ this.ShowNoSceneTip();
+ return;
+ }
+
+ var dicSceneContr = new Dictionary<int, SceneCategoryView>();
+ var listview = new VerticalListControl();
+ functionSceneBodyView.AddChidren(listview);
+ foreach (var scene in listScene)
+ {
+ //鍦烘櫙鍗$墖鎺т欢
+ var sceneView = new SceneCategoryView();
+ listview.AddChidren(sceneView);
+ sceneView.InitControl(scene, room);
+
+ dicSceneContr[scene.Id] = sceneView;
+ }
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂�
+ this.GetAllDelayScene(dicSceneContr, listview);
+ }, ShowErrorMode.NO);
+ }
+
+ /// <summary>
+ /// 鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂�
+ /// </summary>
+ /// <param name="dicSceneContr"></param>
+ private async void GetAllDelayScene(Dictionary<int, SceneCategoryView> dicSceneContr, VerticalListControl listview)
+ {
+ //璇诲彇鍏ㄩ儴鐨勫欢鏃舵椂闂�
+ var result = await Scene.CatDelaySceneAsync();
+ if (result == null || result.catDelaySceneResponseData == null ||
+ result.catDelaySceneResponseData.DelayScenesList.Count == 0)
+ {
+ //鍑洪敊涓嶉笩瀹�
+ return;
+ }
+
+ string hourText = Language.StringByID(R.MyInternationalizationString.Hour);
+ string minuText = Language.StringByID(R.MyInternationalizationString.Minute);
+ string secondText = Language.StringByID(R.MyInternationalizationString.Second);
+
+ foreach (var data in result.catDelaySceneResponseData.DelayScenesList)
+ {
+ if (dicSceneContr.ContainsKey(data.ScenesId) == false)
+ {
+ //褰撳墠鐨勭晫闈㈡病鏈夋樉绀鸿繖涓満鏅�
+ continue;
+ }
+ var seceneContr = dicSceneContr[data.ScenesId];
+ //淇濆瓨缂撳瓨鏃堕棿
+ seceneContr.scene.RemainTime = data.RemainTime;
+ int remainTime = data.RemainTime;
+ if (remainTime <= 0)
+ {
+ continue;
+ }
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾)
+ HdlSceneLogic.Current.StartDelayTimeThread(seceneContr.scene);
+ while (remainTime > 0 && this.Parent != null)
+ {
+ System.Threading.Thread.Sleep(1000);
+ Application.RunOnMainThread(() =>
+ {
+ seceneContr.SetTimeText(this.GetTimeString(remainTime, hourText, minuText, secondText));
+ });
+ remainTime--;
+ }
+ Application.RunOnMainThread(() =>
+ {
+ if (listview.Parent != null)
+ {
+ seceneContr.SetTimeImage();
+ //寮�鍚疞oading鐗规晥
+ seceneContr.StartLoadingApreal();
+ }
+ });
+ });
+ }
+ }
+
+ /// <summary>
+ /// 鏄剧ず娌℃湁鍦烘櫙
+ /// </summary>
+ private void ShowNoSceneTip()
+ {
+ var noFunction = new Button()
+ {
+ Y = Application.GetRealHeight(320),
+ Width = Application.GetMinRealAverage(757),
+ Height = Application.GetMinRealAverage(435),
+ UnSelectedImagePath = "Item/NoFunction.png",
+ Gravity = Gravity.CenterHorizontal
+ };
+ functionSceneBodyView.AddChidren(noFunction);
+
+ var noScenceTip = new Button()
+ {
+ Y = noFunction.Bottom + Application.GetRealHeight(32),
+ Height = Application.GetRealHeight(200),
+ Width = Application.GetRealWidth(700),
+ Gravity = Gravity.CenterHorizontal,
+ Text = Language.StringByID(R.MyInternationalizationString.NoScene).Replace("{\\r\\n}", "\r\n"),
+ TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
+ TextAlignment = TextAlignment.Center,
+ IsMoreLines = true
+ };
+ functionSceneBodyView.AddChidren(noScenceTip);
+ }
+
+
+ #endregion
+
+ #region 鈻� 涓�鑸澶囩姸鎬佷笂鎶__________________
+
+ /// <summary>
+ /// 娣诲姞涓�鑸澶囩姸鎬佷笂鎶ヤ簨浠�
+ /// </summary>
+ private void AddNormalDeviceReportEvent()
+ {
+ //璁惧灞炴�т笂鎶�(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceStatus", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //澶勭悊涓�鑸澶囩殑涓婃姤鏁版嵁
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
+ {
+ //鍒锋柊鍗$墖淇℃伅
+ var locadevice = LocalDevice.Current.GetDevice(mainKeys);
+ this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
+ }
+ }, ShowErrorMode.NO);
+ });
+
+ //璁惧鍦ㄧ嚎涓婃姤(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceOnline", ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
+ {
+ //鍒锋柊鍗$墖鐘舵��
+ this.dicDeviceRowControl[mainKeys].SetRowOnlineStatu(report.IsOnline == 1);
+ return;
+ }
+
+ }, ShowErrorMode.NO);
+ });
+
+ //璁惧鎺у埗鍙嶉涓婃姤
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceRespone", ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
+ {
+ //璁惧鍗$墖
+ var deviceCardContr = this.dicDeviceRowControl[mainKeys];
+ //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉
+ deviceCardContr.SetHadGetResponeResultStatu();
+ }
+
+ }, ShowErrorMode.NO);
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 浼犳劅鍣ㄧ姸鎬佷笂鎶____________________
+
+ /// <summary>
+ /// 娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠�
+ /// </summary>
+ private void AddSensorDeviceReportEvent()
+ {
+ //浼犳劅鍣ㄤ笂鎶�(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewSensor", ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //澶勭悊浼犳劅鍣ㄤ笂鎶ユ暟鎹�
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
+ {
+ //鏈湴璁惧瀵硅薄
+ var locadevice = LocalDevice.Current.GetDevice(mainKeys);
+ //鍒锋柊鍗$墖淇℃伅
+ this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
+ }
+
+ }, ShowErrorMode.NO);
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鏁村悎璁惧___________________________
+
+ /// <summary>
+ /// 鑾峰彇鍒嗙粍鍚庣殑璁惧
+ /// </summary>
+ /// <returns></returns>
+ private Dictionary<int, DeviceRowInfo> GetAllGroupDevice(Common.Room room)
+ {
+ //鍏ㄩ儴鐨勮澶�
+ var listDevice = HdlRoomLogic.Current.GetRoomListDevice(room);
+ //鏍规嵁璁惧鎵�灞炵被鍨嬫帓搴�
+ 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()
+ {
+ //鎶婇潤鎬佸彉閲忕殑杩欎釜涓滆タ缃┖
+ instance = 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>
+ /// 娣诲姞鍦烘櫙(閮洩鍩庣殑浠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()
+ {
+ //new涓�涓柊閫昏緫瀵硅薄锛�
+ Common.Logic.CurrentLogic = new Common.Logic();
+ Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
+ Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
+ var addLogicPage = new Shared.Phone.Device.Logic.AddLogicPage();
+ UserView.HomePage.Instance.AddChidren(addLogicPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ addLogicPage.Show();
+ }
+
+ #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
+
+ #region 鈼� 鑷姩鍖朹_________________________
+
+ /// <summary>
+ /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
+ /// </summary>
+ private void ShowAutotion()
+ {
+ // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+ #region ---鎺ㄨ崘妯℃澘鐨勭粍浠�
+ //鎺ㄨ崘妯℃澘鑳屾櫙鎺т欢
+ var bjFrameLayout = new FrameLayout
+ {
+ Width = Application.GetRealWidth(1080 - 58),
+ Height = Application.GetRealHeight(170),
+ BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+ X = Application.GetRealWidth(58),
+ //Radius = (uint)Application.GetRealHeight(50),
+ Y = Application.GetRealHeight(30),
+
+ };
+ functionSceneAutoBodyView.AddChidren(bjFrameLayout);
+ bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
+ //鍥炬爣鎺т欢
+ var sigBtn = new Button
+ {
+ Width = Application.GetMinRealAverage(84),
+ Height = Application.GetMinRealAverage(84),
+ UnSelectedImagePath = "ZigeeLogic/sign.png",
+ X = Application.GetRealWidth(58),
+ Gravity = Gravity.CenterVertical,
+ };
+ bjFrameLayout.AddChidren(sigBtn);
+ //鎺ㄨ崘妯℃澘鏂囨湰鎺т欢
+ var recommendtextBtn = new Button
+ {
+ Width = Application.GetMinRealAverage(300),
+ Height = Application.GetMinRealAverage(84),
+ X = sigBtn.Right + Application.GetRealWidth(35),
+ TextAlignment = TextAlignment.CenterLeft,
+ //Text = "鎺ㄨ崘妯℃澘",
+ TextID = MyInternationalizationString.logictemplate,
+ Gravity = Gravity.CenterVertical,
+ TextColor = ZigbeeColor.Current.LogicBtnSelectedColor,
+ TextSize = 15,
+ };
+ bjFrameLayout.AddChidren(recommendtextBtn);
+ //鎺ㄨ崘妯℃澘寮�鍏虫帶浠�
+ var recommendswitchBtn = new Button
+ {
+ Width = Application.GetRealWidth(104),
+ Height = Application.GetRealHeight(63),
+ UnSelectedImagePath = "ZigeeLogic/logicclose.png",
+ SelectedImagePath = "ZigeeLogic/logicopen.png",
+ X = bjFrameLayout.Width - Application.GetRealWidth(104 + 58),
+ Gravity = Gravity.CenterVertical,
+ };
+ bjFrameLayout.AddChidren(recommendswitchBtn);
+ #endregion
+ //榛樿鎺ㄨ崘妯℃澘宸﹀彸鍙粦鎺т欢
+ var scenehorizontalScrol = new HorizontalScrolViewLayout
+ {
+ Width = Application.GetRealWidth(1080 - 58),
+ X = Application.GetRealWidth(58),
+ Y = bjFrameLayout.Bottom + Application.GetRealHeight(30),
+ Height = Application.GetRealHeight(0),
+ };
+ functionSceneAutoBodyView.AddChidren(scenehorizontalScrol);
+ //鏄剧ず鑷姩鍖栧垪琛ㄤ笂涓嬪彲婊戞帶浠�
+ var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
+ {
+ Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
+ //BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,/
+ X = Application.GetRealWidth(58),
+ Y = scenehorizontalScrol.Bottom,
+ };
+ functionSceneAutoBodyView.AddChidren(logicScrolView);
+ logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
+ bool no = false;
+ //鏄剧ず榛樿妯℃澘鐨勭晫闈簨浠�
+ recommendswitchBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ int Yheight = 0;
+ recommendswitchBtn.IsSelected = !recommendswitchBtn.IsSelected;
+ scenehorizontalScrol.RemoveAll();
+ if (recommendswitchBtn.IsSelected)
+ {
+ no = true;
+ scenehorizontalScrol.Height = Application.GetRealHeight(246);
+ Yheight = 20;
+ for (int i = 1; i < 4; i++)
+ {
+
+ var frameLayout = new FrameLayout
+ {
+ Width = Application.GetMinRealAverage(369 + 46),
+ Height = Application.GetMinRealAverage(246),
+ };
+ scenehorizontalScrol.AddChidren(frameLayout);
+ var logiciocnBtn = new Button
+ {
+ Width = Application.GetMinRealAverage(369),
+ Height = Application.GetMinRealAverage(246),
+ UnSelectedImagePath = "ZigeeLogic/" + i + ".png",
+ Tag = i,
+ };
+ frameLayout.AddChidren(logiciocnBtn);
+
+ var logicnameBtn = new Button
+ {
+ Width = Application.GetMinRealAverage(250),
+ Height = Application.GetMinRealAverage(80),
+ X = Application.GetRealWidth(23),
+ Y = Application.GetRealHeight(246 - 23 - 80),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+ TextSize = 14,
+ };
+ frameLayout.AddChidren(logicnameBtn);
+
+ if (i == 1)
+ {
+ logicnameBtn.Text = Language.StringByID(MyInternationalizationString.onlight);
+ }
+ else if (i == 2)
+ {
+ logicnameBtn.Text = Language.StringByID(MyInternationalizationString.offlight);
+ }
+ else if (i == 3)
+ {
+ logicnameBtn.Text = Language.StringByID(MyInternationalizationString.automation1);
+ }
+
+
+ EventHandler<MouseEventArgs> iconclick = (sender1, e1) =>
+ {
+ Common.Logic.CurrentLogic = new Common.Logic();
+ Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
+ if (logiciocnBtn.Tag.ToString() == "3")
+ {
+ Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;
+ //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
+ var addLogicPage = new Device.Logic.AddLogicPage();
+ HomePage.Instance.AddChidren(addLogicPage);
+ HomePage.Instance.PageIndex += 1;
+ addLogicPage.Show();
+ }
+ else
+ {
+
+ Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;
+ //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
+ Device.Logic.TemplatePage templatePage = new Device.Logic.TemplatePage();
+ Device.Logic.TemplatePage.s = logiciocnBtn.Tag.ToString();
+ HomePage.Instance.AddChidren(templatePage);
+ HomePage.Instance.PageIndex += 1;
+ templatePage.Show();
+ }
+ };
+ logiciocnBtn.MouseUpEventHandler += iconclick;
+ logicnameBtn.MouseUpEventHandler += iconclick;
+ }
+ }
+ else
+ {
+ no = false;
+ scenehorizontalScrol.Height = Application.GetRealHeight(0);
+ Yheight = 0;
+ }
+ logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight;
+ logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
+ Automationview(logicScrolView, no);
+ };
+ //涓嬫媺鍒锋柊鑷姩鍖栧垪琛ㄧ殑浜嬩欢
+ logicScrolView.BeginHeaderRefreshingAction += () =>
+ {
+ //閲嶆柊鍒锋柊logic鍒楄〃
+ Common.Logic.LogicList.Clear();
+ Read(logicScrolView, no);
+ //鍏抽棴鍒锋柊View锛�
+ logicScrolView.EndHeaderRefreshing();
+ };
+
+ Read(logicScrolView, no);
+
+ }
+ /// <summary>
+ /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱
+ /// </summary>
+ /// <param name="logicScrolView"></param>
+ private async void Read(VerticalRefreshLayout logicScrolView, bool no)
+ {
+ CommonPage.Loading.Start();
+ if (Common.Logic.LogicList.Count == 0)
+ {
+ var Idlist = await Device.Logic.Send.GetLogicId(0);
+ if (Idlist.Count != 0)
+ {
+ var listlogic = await Device.Logic.Send.ReadList(Idlist.Count, 0);
+ //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆�
+ for (int j = 0; j < listlogic.Count; j++)
+ {
+ var logic = listlogic[j];
+ if (logic.LogicType != 0)
+ {
+ continue;
+ }
+ Common.Logic.LogicList.Add(logic);
+ }
+ }
+ }
+ //鑷姩鍖�
+ Automationview(logicScrolView, no);
+ CommonPage.Loading.Hide();
+ }
+ /// <summary>
+ /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
+ /// </summary>
+ /// <param name="refresview">Refresview.</param>
+ private async void Automationview(VerticalRefreshLayout refresview, bool no)
+ {
+ refresview.RemoveAll();
+ if (Common.Logic.LogicList.Count == 0 && no == false)
+ {
+ //灏辨槸涓轰簡鏄剧ず寮曞娣诲姞鍥炬爣;
+ refresview.BackgroundColor = 0x00000000;
+ var noFrameLayout = new FrameLayout
+ {
+ Height = Application.GetRealHeight(434 + 200 + 32 + 160),
+ //BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ };
+ refresview.AddChidren(noFrameLayout);
+
+
+ var noIconBtn = new Button
+ {
+ Y = Application.GetRealHeight(160),
+ Width = Application.GetMinRealAverage(756),
+ Height = Application.GetMinRealAverage(434),
+ UnSelectedImagePath = "Item/NoFunction.png",
+ X = Application.GetRealWidth(104),
+ };
+ noFrameLayout.AddChidren(noIconBtn);
+
+ var noTextBtn = new Button()
+ {
+ Y = noIconBtn.Bottom,
+ Height = Application.GetRealHeight(200) + Application.GetRealHeight(32),
+ Width = Application.GetRealWidth(700),
+ //Gravity = Gravity.CenterHorizontal,
+ Text = Language.StringByID(MyInternationalizationString.automationaddtext).Replace("{\\r\\n}", "\r\n"),
+ TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
+ TextAlignment = TextAlignment.Center,
+ IsMoreLines = true,
+ X = Application.GetRealWidth(190 - 58),
+ };
+ noFrameLayout.AddChidren(noTextBtn);
+
+ }
+ else
+ {
+
+ if (Common.Logic.LogicList.Count == 0 && no == true)
+ {
+ ///鏀瑰彉婊戝姩view鐨勯鑹诧紱
+ refresview.BackgroundColor = 0x00000000;
+ }
+ else
+ {
+ refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+ }
+ }
+ foreach (var logic in Common.Logic.LogicList)
+ {
+
+
+ var logicRowlayout = new RowLayout
+ {
+ Height = Application.GetRealHeight(190 + 30),
+ Width = Application.GetRealWidth(1080 - 58),
+ LineColor = ZigbeeColor.Current.LogicBackgroundColor,
+ BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+ SubViewWidth = Application.GetRealWidth(184),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
+
+ };
+ refresview.AddChidren(logicRowlayout);
+
+
+
+ var logicnameBtn = new Button
+ {
+ Height = Application.GetRealHeight(58),
+ Width = Application.GetRealWidth(350),
+ Text = logic.LogicName,
+ X = Application.GetRealWidth(12 + 46),
+ Y = Application.GetRealHeight(30),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ TextSize = 14,
+ };
+ logicRowlayout.AddChidren(logicnameBtn);
+
+
+ var logicswitchBtn = new Button
+ {
+ Width = Application.GetRealWidth(104),
+ Height = Application.GetRealHeight(63),
+ UnSelectedImagePath = "ZigeeLogic/logicclose.png",
+ SelectedImagePath = "ZigeeLogic/logicopen.png",
+ X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
+ Y = Application.GetRealHeight(58 + 30 + 9 + 30),
+
+ };
+ logicRowlayout.AddChidren(logicswitchBtn);
+
+
+
+ logicswitchBtn.MouseUpEventHandler += (sender1, e1) =>
+ {
+ logicswitchBtn.IsSelected = !logicswitchBtn.IsSelected;
+ if (logicswitchBtn.IsSelected)
+ {
+ //閫昏緫寮�
+ logic.IsEnable = 1;
+ StatusColor(logic, logicRowlayout, 1);
+ }
+ else
+ {
+ //閫昏緫鍏�
+ logic.IsEnable = 0;
+ StatusColor(logic, logicRowlayout, 0);
+ }
+ Device.Logic.Send.LogicControlSwitch(logic);
+ //Logic.Send.AddModifyLogic(logic);
+ };
+ if (logic.IsEnable == 1)
+ {
+ logicswitchBtn.IsSelected = true;
+ StatusColor(logic, logicRowlayout, 1);
+ }
+ else if (logic.IsEnable == 0)
+ {
+ logicswitchBtn.IsSelected = false;
+ StatusColor(logic, logicRowlayout, 0);
+ }
+ ///缂栬緫
+ var edit = new Button
+ {
+ BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
+ Text = Language.StringByID(MyInternationalizationString.edit),
+ TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+ };
+ logicRowlayout.AddRightView(edit);
+ edit.MouseUpEventHandler += (sender, e) =>
+ {
+ Common.Logic.CurrentLogic = logic;
+ var logicCommunalPage = new Device.Logic.LogicCommunalPage();
+ HomePage.Instance.AddChidren(logicCommunalPage);
+ HomePage.Instance.PageIndex += 1;
+ logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview, no); });
+
+ };
+
+
+ ///鍒犻櫎
+ var del = new Button
+ {
+ BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
+ Text = Language.StringByID(MyInternationalizationString.del),
+ TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+ };
+ logicRowlayout.AddRightView(del);
+ del.MouseUpEventHandler += (sender, e) =>
+ {
+ var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+ Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
+ alert.ResultEventHandler += (sender1, e1) =>
+ {
+ if (e1)
+ {
+ Common.Logic.LogicList.Remove(logic);
+ Automationview(refresview, no);
+ Device.Logic.Send.DelLogic(logic.LogicId);
+ }
+ };
+ alert.Show();
+
+ };
+ var line = new Button
+ {
+ Y = Application.GetRealHeight(215),
+ Height = Application.GetRealHeight(5),
+ Width = Application.GetRealWidth(1080 - 58),
+ BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ X = Application.GetRealWidth(58),
+ };
+ logicRowlayout.AddChidren(line);
+ }
+
+ }
+ /// <summary>
+ /// 鏄剧ず鑷姩鍖栬緭鍑哄姛鑳芥ā鍧楀浘鏍囩殑棰滆壊
+ /// </summary>
+ /// <param name="logic"></param>
+ /// <param name="logicRowlayout"></param>
+ /// <param name="intvalue"></param>
+ private void StatusColor(Common.Logic logic, RowLayout logicRowlayout, int intvalue)
+ {
+
+ var logictimeBtn = new Button
+ {
+ Height = Application.GetRealHeight(58),
+ Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350),
+ Y = Application.GetRealHeight(30),
+ X = Application.GetRealWidth(365),
+ TextAlignment = TextAlignment.CenterRight,
+ TextColor = ZigbeeColor.Current.LogicListWeekTextColor,
+ };
+ logicRowlayout.AddChidren(logictimeBtn);
+
+ ///鏄剧ず鎵ц鍛ㄦ湡
+ Device.Logic.Method.UpdateWeek(logictimeBtn, logic);
+
+
+ List<string> indexlist = new List<string>();
+ List<string> iconIndexlist = new List<string>();
+ for (int i = 0; i < logic.Actions.Count; i++)
+ {
+ var linkType = logic.Actions[i]["LinkType"].ToString();
+ var d = indexlist.Find((value) => { return value == linkType; });
+ if (d == null)
+ {
+ indexlist.Add(linkType);
+ }
+ }
+ if (indexlist.Contains("0"))
+ {
+ iconIndexlist.Add("0");
+ }
+ if (indexlist.Contains("2"))
+ {
+ iconIndexlist.Add("2");
+ }
+ if (indexlist.Contains("6"))
+ {
+ iconIndexlist.Add("6");
+ }
+ if (indexlist.Contains("7"))
+ {
+ iconIndexlist.Add("7");
+ }
+ for (int i = 0; i < iconIndexlist.Count; i++)
+ {
+ var iconindex = iconIndexlist[i];
+ var typebjBtn = new FrameLayout
+ {
+ Width = Application.GetMinRealAverage(82),
+ Height = Application.GetMinRealAverage(82),
+ X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i),
+ Y = Application.GetRealHeight(58 + 30 + 30),
+ Radius = (uint)Application.GetRealHeight(41),
+ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ };
+ logicRowlayout.AddChidren(typebjBtn);
+
+ var typeIconBtn = new Button
+ {
+ Width = Application.GetMinRealAverage(58),
+ Height = Application.GetMinRealAverage(58),
+ Gravity = Gravity.Center,
+
+ };
+ typebjBtn.AddChidren(typeIconBtn);
+
+ var connectIconBtn = new Button
+ {
+ Y = typebjBtn.Y + Application.GetRealHeight(35),
+ X = Application.GetRealWidth(58) + Application.GetRealWidth((12 + 82 + 12) + (12 + 45 + 82 + 12) * i),
+ Width = Application.GetRealWidth(48),
+ Height = Application.GetRealHeight(15),
+ UnSelectedImagePath = "ZigeeLogic/connect.png",
+ };
+ logicRowlayout.AddChidren(connectIconBtn);
+ if (iconIndexlist.Count - 1 == i)
+ {
+ connectIconBtn.Visible = false;
+ }
+ switch (iconindex)
+ {
+ case "0":
+ {
+ if (intvalue == 1)
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/function1.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicFunction1Color;
+ }
+ else
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nofunction.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+ }
+ }
+ break;
+ case "2":
+ {
+
+ if (intvalue == 1)
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/scene1.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicScene1Color;
+ }
+ else
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/noscene.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+ }
+
+ }
+ break;
+ case "6":
+ {
+ if (intvalue == 1)
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/security1.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicSecurity1Color;
+
+ }
+ else
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nosecurity.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+ }
+
+ }
+ break;
+ case "7":
+ {
+ if (intvalue == 1)
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/delay1.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicDelay1Color;
+ }
+ else
+ {
+ typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nodelay.png";
+ typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+ }
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
new file mode 100755
index 0000000..89f1059
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
@@ -0,0 +1,455 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐨勮澶囪鎺т欢搴曞眰鍏遍��
+ /// </summary>
+ public class DeviceRowCommon : RowLayoutControl
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鏄惁鎷ユ湁鐘舵�佸姛鑳�(榛樿鎷ユ湁)
+ /// </summary>
+ public bool hadStatuFunction = true;
+ /// <summary>
+ /// 鎺т欢闇�瑕佽绉婚櫎鐨勪簨浠�
+ /// </summary>
+ public Action RowNeedRemoveEvent = null;
+ /// <summary>
+ /// 璁惧瀵硅薄
+ /// </summary>
+ public CommonDevice device;
+ /// <summary>
+ /// 璁惧鍥炬爣鑳屾櫙鎺т欢
+ /// </summary>
+ private FrameLayout frameIconBackGroud = null;
+ /// <summary>
+ /// 璁惧鍥炬爣鎺т欢
+ /// </summary>
+ private IconViewControl btnDeviceIcon = null;
+ /// <summary>
+ /// 璁惧鍚嶅瓧鎺т欢
+ /// </summary>
+ private NormalViewControl btnDeviceName = null;
+ /// <summary>
+ /// 鐘舵�佹帶浠�
+ /// </summary>
+ private NormalViewControl btnStatu = null;
+ /// <summary>
+ /// 寮�鍏虫帶浠�
+ /// </summary>
+ private MostRightIconControl btnSwitch = null;
+ /// <summary>
+ /// 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋� 0:娌℃湁鑾峰彇寰楀埌 1:宸茬粡鑾峰彇寰楀埌
+ /// </summary>
+ private int ResponeResult = 0;
+ /// <summary>
+ /// 鍒ゆ柇鏄惁鏈夊紑鍏冲姛鑳�
+ /// </summary>
+ private bool isHadOpenSwitch = true;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鏈垎閰嶇晫闈㈢殑璁惧閫夋嫨鎺т欢
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceRowCommon(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ this.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
+ this.Width = Application.GetRealWidth(1022);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device">璁惧瀵硅薄</param>
+ public virtual void InitControl(CommonDevice i_device)
+ {
+ this.device = i_device;
+ //璁惧鍥炬爣鑳屾櫙鎺т欢
+ this.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;
+ this.frameTable.AddChidren(frameIconBackGroud, ChidrenBindMode.NotBind);
+ if (chidrenYaxis != 0)
+ {
+ frameIconBackGroud.Y += chidrenYaxis;
+ }
+
+ //璁惧鍥炬爣鎺т欢
+ this.btnDeviceIcon = new IconViewControl(78);
+ btnDeviceIcon.Gravity = Gravity.Center;
+ Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
+ frameIconBackGroud.AddChidren(btnDeviceIcon);
+ //閲嶆柊缁戝畾浜嬩欢
+ this.frameTable.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEventOnly);
+
+ //璁惧鍚嶅瓧
+ this.btnDeviceName = new NormalViewControl(600, 60, true);
+ btnDeviceName.X = Application.GetRealWidth(181);
+ btnDeviceName.Y = Application.GetRealHeight(16) + this.chidrenYaxis;
+ btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
+ btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
+ this.frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+
+ if (this.hadStatuFunction == false)
+ {
+ //娌℃湁鐘舵�佸姛鑳�,鍒欐妸璁惧鍚嶅瓧鎺т欢涓�
+ this.btnDeviceName.Gravity = Gravity.CenterVertical;
+ }
+ //鎷ユ湁鐘舵�佸姛鑳�
+ if (this.hadStatuFunction == true)
+ {
+ //鐘舵��
+ this.btnStatu = new NormalViewControl(600, 50, true);
+ btnStatu.X = Application.GetRealWidth(181);
+ btnStatu.Y = Application.GetRealHeight(70) + this.chidrenYaxis;
+ btnStatu.TextSize = 10;
+ btnStatu.TextColor = UserCenterColor.Current.TextGrayColor1;
+ this.frameTable.AddChidren(btnStatu, ChidrenBindMode.BindEventOnly);
+ }
+
+ //搴曠嚎
+ var btnBottomLine = new NormalViewControl(Application.GetRealWidth(841), ControlCommonResourse.BottomLineHeight, false);
+ btnBottomLine.X = Application.GetRealWidth(181);
+ btnBottomLine.Y = this.Height - ControlCommonResourse.BottomLineHeight;
+ btnBottomLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+ this.frameTable.AddChidren(btnBottomLine, ChidrenBindMode.NotBind);
+
+ //寮�鍏虫帶浠�(鏆傛椂涓嶅姞鍏ョ埗鎺т欢)
+ this.btnSwitch = new MostRightIconControl(69, 69);
+ btnSwitch.UnSelectedImagePath = "Item/Switch.png";
+ btnSwitch.SelectedImagePath = "Item/SwitchSelected.png";
+
+ //鍒嗕韩鐨勬埧闂�,鍒欎笉鑳界紪杈戝拰鍒犻櫎
+ if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
+ {
+ //缂栬緫
+ var btnEditor = this.AddEditorControl();
+ btnEditor.ButtonClickEvent += (sender, e) =>
+ {
+ //鍏抽棴宸︽粦鑿滃崟
+ this.HideMenu();
+ var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
+ UserView.HomePage.Instance.AddChidren(detailInfo);
+ UserView.HomePage.Instance.PageIndex += 1;
+ detailInfo.Show(i_device, HdlRoomLogic.Current.CurrentRoom);
+ detailInfo.EditAction += (curDevice, curRoom) =>
+ {
+ if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
+ {
+ //褰撳墠鏄枩鐖辨埧闂存椂
+ if (HdlRoomLogic.Current.IsCollectInRoom(this.device) == false)
+ {
+ //鎴块棿鏀瑰彉浜�
+ this.RemoveFromParent();
+ //鍥炶皟鎺т欢琚Щ闄ょ殑浜嬩欢
+ this.RowNeedRemoveEvent?.Invoke();
+ return;
+ }
+ }
+ else if (HdlRoomLogic.Current.CurrentRoom.Id != curRoom.Id)
+ {
+ //鎴块棿鏀瑰彉浜�
+ this.RemoveFromParent();
+ //鍥炶皟鎺т欢琚Щ闄ょ殑浜嬩欢
+ this.RowNeedRemoveEvent?.Invoke();
+ return;
+ }
+ //鍒锋柊鎺т欢鐘舵��
+ this.RefreshControlInfo(i_device);
+ };
+ };
+ //鍒犻櫎
+ var btnDelete = this.AddDeleteControl();
+ btnDelete.ButtonClickEvent += (sender, e) =>
+ {
+ //纭畾瑕佺Щ闄よ鍔熻兘锛�
+ var alert = new ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.DeleteFunction));
+ alert.Show();
+ alert.ConfirmClickEvent += () =>
+ {
+ //绉婚櫎鏀惰棌(涓嶇浠�涔堟儏鍐�,鏀惰棌閮借绉婚櫎)
+ HdlRoomLogic.Current.DeleteLoveDevice(i_device);
+ if (HdlRoomLogic.Current.CurrentRoom.IsLove == false)
+ {
+ //浠庢埧闂翠腑绉婚櫎
+ HdlRoomLogic.Current.DeleteDevice(i_device);
+ }
+ this.RemoveFromParent();
+ //鍥炶皟鎺т欢琚Щ闄ょ殑浜嬩欢
+ this.RowNeedRemoveEvent?.Invoke();
+ };
+ };
+ }
+ //鍒锋柊鎺т欢鐘舵��
+ this.RefreshControlInfo(i_device);
+ }
+
+ #endregion
+
+ #region 鈻� 娣诲姞寮�鍏虫帶浠禵______________________
+
+ /// <summary>
+ /// 娣诲姞寮�鍏虫帶浠�
+ /// </summary>
+ /// <returns></returns>
+ public MostRightIconControl AddSwitchControl()
+ {
+ this.frameTable.AddChidren(this.btnSwitch, ChidrenBindMode.NotBind);
+ btnSwitch.InitControl();
+ btnSwitch.X -= ControlCommonResourse.XXLeft;
+ btnSwitch.Y += this.chidrenYaxis;
+
+ return btnSwitch;
+ }
+
+ #endregion
+
+ #region 鈻� 鍒锋柊鎺т欢鐘舵�乢______________________
+
+ /// <summary>
+ /// 鍒锋柊鎺т欢鐘舵��
+ /// </summary>
+ /// <param name="i_device">璁惧瀵硅薄,涓嶆槸鎺ㄩ�佺殑閭d釜</param>
+ public virtual void RefreshControlInfo(CommonDevice i_device)
+ {
+ //璁惧鍥炬爣涔熷埛鏂�
+ Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
+ //璁惧鍚嶅瓧
+ this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
+ //妫�娴嬭澶囨槸鍚︽槸鎵撳紑鐘舵��
+ bool isOpen = this.CheckIsOpenStatu(i_device);
+ this.SetRowOpenStatu(isOpen);
+ }
+
+ /// <summary>
+ /// 璁剧疆琛屾帶浠剁殑鎵撳紑鎴栬�呭叧闂殑鐘舵��
+ /// </summary>
+ /// <param name="isOpen"></param>
+ public void SetRowOpenStatu(bool isOpen)
+ {
+ //璁惧鐘舵�佸繀椤诲埛鏂�
+ if (this.btnStatu != null)
+ {
+ this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
+ }
+
+ if (this.btnDeviceName.IsSelected == isOpen)
+ {
+ //鐘舵�佷竴鏍�,鍒欎笉闇�瑕佸鐞�
+ return;
+ }
+ //璁惧鍚嶇О鎺т欢
+ this.btnDeviceName.IsSelected = isOpen;
+ this.btnDeviceName.IsBold = isOpen;
+ //璁惧鐨勮儗鏅渾鍦堝浘
+ if (isOpen == true)
+ {
+ this.frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCSelectedBackgroundColor;
+ }
+ else
+ {
+ this.frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor;
+ }
+ //璁惧鍥炬爣鎺т欢
+ this.btnDeviceIcon.IsSelected = isOpen;
+ //寮�鍏虫帶浠�
+ if (this.btnSwitch != null)
+ {
+ this.btnSwitch.IsSelected = isOpen;
+ }
+ }
+
+ /// <summary>
+ /// 璁剧疆琛屾帶浠剁殑鍦ㄧ嚎鐘舵��
+ /// </summary>
+ /// <param name="isOnline">鍦ㄧ嚎</param>
+ public void SetRowOnlineStatu(bool isOnline)
+ {
+ if (this.isHadOpenSwitch == true)
+ {
+ //濡傛灉杩欎釜璁惧鏈夊紑鍏冲姛鑳�,鍒欏湪绾跨姸鎬佷笉浼氭敼鍙樼姸鎬�
+ return;
+ }
+ this.SetRowOpenStatu(isOnline);
+ }
+
+ /// <summary>
+ /// 璁剧疆璁惧鐨勭姸鎬佹枃鏈�
+ /// </summary>
+ /// <param name="i_Text">鐘舵�佹枃鏈�</param>
+ public void SetDeviceStatuText(string i_Text)
+ {
+ if (this.btnStatu != null)
+ {
+ this.btnStatu.Text = i_Text;
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public virtual void SendStatuComand()
+ {
+ return;
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨槸鍚︽槸鎵撳紑鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public virtual bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ //濡傛灉杩欎釜鍑芥暟琚噸鍐欑殑璇�,鍒欎唬琛ㄨ繖涓澶囨湁寮�鍏冲姛鑳�
+ this.isHadOpenSwitch = false;
+ //榛樿鐢ㄥ湪绾跨姸鎬佹潵鍒ゆ柇
+ return i_device.IsOnline == 1;
+ }
+
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅鐨勮繑鍥炰簨浠禵____________
+
+ /// <summary>
+ /// 娣卞害鍗$墖淇℃伅鐨勮繑鍥炰簨浠�(搴曞眰涓撶敤)
+ /// </summary>
+ /// <param name="device">璁惧</param>
+ /// <param name="room">鎴块棿</param>
+ public void CardDetailInfoBackEvent(CommonDevice device, Common.Room room)
+ {
+ if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
+ {
+ //宸茬粡鍙栨秷鐨勬敹钘�
+ if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
+ {
+ //绉婚櫎杩欎釜鎺т欢
+ this.RemoveFromParent();
+ return;
+ }
+ }
+ else
+ {
+ //濡傛灉杩欎釜璁惧鏀瑰彉浜嗘埧闂寸殑璇�,鍥炶皟鍗$墖琚垹闄ょ殑鍑芥暟
+ var nowRoom = HdlRoomLogic.Current.GetRoomByDevice(device);
+ if (nowRoom == null || nowRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id)
+ {
+ //绉婚櫎杩欎釜鎺т欢
+ this.RemoveFromParent();
+ return;
+ }
+ }
+ //濡傛灉瀹冭繕鍦ㄨ繖涓埧闂寸殑璇�,鍒锋柊鍗$墖淇℃伅
+ this.RefreshControlInfo(device);
+ }
+
+ #endregion
+
+ #region 鈻� 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋淿____________
+
+ /// <summary>
+ /// <para>妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅</para>
+ /// <para>鑾峰彇鍒板洖澶嶇粨鏋滀箣鍚�,璁板緱璋冪敤SetHadGetResponeResultStatu()鍑芥暟璁剧疆鐘舵��</para>
+ /// </summary>
+ /// <param name="oldOpenStatu">璁惧鐩墠鐨勫紑鍏崇姸鎬�</param>
+ public void StartCheckResponeResult(bool oldOpenStatu)
+ {
+ this.ResponeResult = 0;
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ int waitime = 30;
+ while (waitime > 0)
+ {
+ System.Threading.Thread.Sleep(100);
+ if (this.ResponeResult == 1)
+ {
+ //宸茬粡鑾峰彇寰楀埌鏁版嵁
+ break;
+ }
+ waitime--;
+ }
+ if (waitime <= 0)
+ {
+ //娌℃湁鑾峰彇寰楀埌缁撴灉
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.FAIL));
+ msgContr.Show();
+ //鍙樻洿鍥炲師鏉ョ殑鐘舵��
+ this.SetRowOpenStatu(oldOpenStatu);
+ });
+ }
+ });
+ }
+
+ /// <summary>
+ /// 璁剧疆宸茬粡鑾峰彇鍒扮綉鍏崇殑鍙嶉缁撴灉
+ /// </summary>
+ public void SetHadGetResponeResultStatu()
+ {
+ this.ResponeResult = 1;
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ /// <returns></returns>
+ public bool CheckCanSendStatuComand()
+ {
+ if (this.device.HadReadDeviceStatu == false)
+ {
+ //杩樻病鏈夎鍙栬繃鏁版嵁
+ return true;
+ }
+ if ((DateTime.Now - this.device.LastDateTime).TotalMinutes >= 10)
+ {
+ //10鍒嗛挓鍚庡彲浠ュ啀娆¤幏鍙�
+ return true;
+ }
+ return false;
+ }
+
+ #endregion
+
+ #region 鈻� 鎺т欢鎽ф瘉___________________________
+
+ /// <summary>
+ /// 鎺т欢鎽ф瘉
+ /// </summary>
+ public override void RemoveFromParent()
+ {
+ this.RowNeedRemoveEvent = null;
+
+ base.RemoveFromParent();
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs
new file mode 100755
index 0000000..60a2c59
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs
@@ -0,0 +1,113 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭┖璋冭澶囪鎺т欢
+ /// </summary>
+ public class DeviceAcRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭┖璋冭澶囪鎺т欢
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceAcRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device)
+ {
+ base.InitControl(i_device);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+
+ //娣诲姞寮�鍏虫帶浠�
+ var btnSwitch = this.AddSwitchControl();
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ bool setStatu = !btnSwitch.IsSelected;
+ //鍙樻洿鍗$墖鐘舵��
+ this.SetRowOpenStatu(setStatu);
+ //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
+ this.StartCheckResponeResult(!setStatu);
+
+ if (setStatu == true)
+ {
+ //鎵撳紑
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
+ (i_device as AC).Open();
+ }
+ else
+ {
+ //鍏抽棴
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close));
+ (i_device as AC).Close();
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var acControl = new Phone.Device.AC.ACControl();
+ UserView.HomePage.Instance.AddChidren(acControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ acControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
+ acControl.action += this.CardDetailInfoBackEvent;
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return ((AC)i_device).currentSystemMode != 0;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendACStatuComand(this.device);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs
new file mode 100755
index 0000000..8577c0e
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs
@@ -0,0 +1,111 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭┖姘斿紑鍏宠澶囪鎺т欢
+ /// </summary>
+ public class DeviceAirSwitchRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭┖姘斿紑鍏宠澶囪鎺т欢
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceAirSwitchRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device)
+ {
+ base.InitControl(i_device);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+
+ //娣诲姞寮�鍏虫帶浠�
+ var btnSwitch = this.AddSwitchControl();
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ bool setStatu = !btnSwitch.IsSelected;
+ //鍙樻洿鍗$墖鐘舵��
+ this.SetRowOpenStatu(setStatu);
+ //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
+ this.StartCheckResponeResult(!setStatu);
+
+ if (setStatu == true)
+ {
+ //鎵撳紑
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
+ i_device.SwitchControl(1);
+ }
+ else
+ {
+ //鍏抽棴
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close));
+ i_device.SwitchControl(0);
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var lightControl = new Device.Light.AirSwitchControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ lightControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
+ lightControl.action += this.CardDetailInfoBackEvent;
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return ((LightBase)i_device).OnOffStatus == 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
new file mode 100755
index 0000000..b1a3dad
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
@@ -0,0 +1,112 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勫僵鐏�(璋冨厜鍣�)璁惧琛屾帶浠�
+ /// </summary>
+ public class DeviceColorLightRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勫僵鐏�(璋冨厜鍣�)璁惧琛屾帶浠�
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceColorLightRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device)
+ {
+ base.InitControl(i_device);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+
+ //娣诲姞寮�鍏虫帶浠�
+ var btnSwitch = this.AddSwitchControl();
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ bool setStatu = !btnSwitch.IsSelected;
+ //鍙樻洿鍗$墖鐘舵��
+ this.SetRowOpenStatu(setStatu);
+ //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
+ this.StartCheckResponeResult(!setStatu);
+
+ if (setStatu == true)
+ {
+ //鎵撳紑
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
+ i_device.SwitchControl(1);
+ }
+ else
+ {
+ //鍏抽棴
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close));
+ i_device.SwitchControl(0);
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
+ UserView.HomePage.Instance.AddChidren(dimmableLightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ dimmableLightControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
+ dimmableLightControl.action += this.CardDetailInfoBackEvent;
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return ((LightBase)i_device).OnOffStatus == 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
new file mode 100755
index 0000000..ef83e6e
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
@@ -0,0 +1,204 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭獥甯樿澶囪鎺т欢
+ /// </summary>
+ public class DeviceCurtainRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鎵撳紑鎺т欢
+ /// </summary>
+ private MostRightIconControl btnOpen = null;
+ /// <summary>
+ /// 鍋滄鎺т欢
+ /// </summary>
+ private MostRightIconControl btnStop = null;
+ /// <summary>
+ /// 鍏抽棴鎺т欢
+ /// </summary>
+ private MostRightIconControl btnClose = null;
+ /// <summary>
+ /// 绐楀笜绫诲瀷 4锛氬紑鍚堝笜 0锛氬嵎甯�
+ /// </summary>
+ private int WcdType = -2;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭獥甯樿澶囪鎺т欢
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceCurtainRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device)
+ {
+ base.InitControl(i_device);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+
+ //鎵撳紑鎺т欢
+ this.btnOpen = new MostRightIconControl(69, 69);
+ btnOpen.btnIcon.UseClickStatu = true;
+ this.frameTable.AddChidren(btnOpen, ChidrenBindMode.NotBind);
+ btnOpen.InitControl();
+ btnOpen.X = Application.GetRealWidth(625) - btnOpen.XOffset;
+ btnOpen.ButtonClickEvent += (sender, e) =>
+ {
+ ((Rollershade)i_device).CurtainUpDownStopControl(0);
+ };
+
+ //鍋滄鎺т欢
+ this.btnStop = new MostRightIconControl(69, 69);
+ btnStop.btnIcon.UseClickStatu = true;
+ btnStop.UnSelectedImagePath = "RollerShade/Stop.png";
+ btnStop.SelectedImagePath = "RollerShade/StopSelected.png";
+ this.frameTable.AddChidren(btnStop, ChidrenBindMode.NotBind);
+ btnStop.InitControl();
+ btnStop.X = Application.GetRealWidth(769) - btnOpen.XOffset;
+ btnStop.ButtonClickEvent += (sender, e) =>
+ {
+ ((Rollershade)i_device).CurtainUpDownStopControl(2);
+ };
+
+ //鍏抽棴
+ this.btnClose = new MostRightIconControl(69, 69);
+ btnClose.btnIcon.UseClickStatu = true;
+ this.frameTable.AddChidren(btnClose, ChidrenBindMode.NotBind);
+ btnClose.InitControl();
+ btnClose.X = Application.GetRealWidth(896) - btnOpen.XOffset;
+ btnClose.ButtonClickEvent += (sender, e) =>
+ {
+ ((Rollershade)i_device).CurtainUpDownStopControl(1);
+ };
+
+ //鍒锋柊鍥炬爣鎺т欢鐨勫浘鏍�
+ this.RefreshIconControlImage(i_device);
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
+ UserView.HomePage.Instance.AddChidren(rollerShadeControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ rollerShadeControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
+ rollerShadeControl.action += this.CardDetailInfoBackEvent;
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 10;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(this.device);
+ }
+ if (((Rollershade)this.device).WcdType == -1)
+ {
+ //璇诲彇绐楀笜绫诲瀷
+ ((Rollershade)this.device).ReadWcdType();
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍒锋柊鎺т欢鐘舵�乢______________________
+
+ /// <summary>
+ /// 鍒锋柊鎺т欢鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void RefreshControlInfo(CommonDevice i_device)
+ {
+ //鍒锋柊鍥炬爣鎺т欢鐨勫浘鏍�
+ this.RefreshIconControlImage(i_device);
+
+ base.RefreshControlInfo(i_device);
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鍒锋柊鍥炬爣鎺т欢鐨勫浘鏍�
+ /// </summary>
+ /// <param name="i_device"></param>
+ private void RefreshIconControlImage(CommonDevice i_device)
+ {
+ //杩樻病鏈夊垵濮嬪寲瀹屾垚
+ if (btnOpen == null) { return; }
+
+ int wcdType = ((Rollershade)i_device).WcdType;
+ if (this.WcdType == wcdType)
+ {
+ //鏃犻渶鍙樻洿
+ return;
+ }
+ if (this.WcdType == 0)
+ {
+ btnOpen.UnSelectedImagePath = "RollerShade/Up.png";
+ btnOpen.SelectedImagePath = "RollerShade/UpSelected.png";
+ btnClose.UnSelectedImagePath = "RollerShade/Down.png";
+ btnClose.SelectedImagePath = "RollerShade/DownSelected.png";
+ }
+ else
+ {
+ btnOpen.UnSelectedImagePath = "RollerShade/Open.png";
+ btnOpen.SelectedImagePath = "RollerShade/OpenSelected.png";
+ btnClose.UnSelectedImagePath = "RollerShade/Close.png";
+ btnClose.SelectedImagePath = "RollerShade/CloseSelected.png";
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs
new file mode 100755
index 0000000..52175d5
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs
@@ -0,0 +1,66 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勯棬閿佽澶囪鎺т欢
+ /// </summary>
+ public class DeviceDoorLockRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勯棬閿佽澶囪鎺т欢
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceDoorLockRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ //闂ㄩ攣鏆傛椂娌℃湁鐘舵�佸姛鑳�
+ this.hadStatuFunction = false;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device)
+ {
+ base.InitControl(i_device);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var userDoorLockPage = new UserCenter.DoorLock.UserDoorLockPage(UserCenter.HdlRoomLogic.Current.CurrentRoom, i_device);
+ UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ userDoorLockPage.Show();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs
new file mode 100755
index 0000000..30bc99c
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs
@@ -0,0 +1,111 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭户鐢靛櫒璁惧琛屾帶浠�
+ /// </summary>
+ public class DeviceRelayRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勭户鐢靛櫒璁惧琛屾帶浠�
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceRelayRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device)
+ {
+ base.InitControl(i_device);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+
+ //娣诲姞寮�鍏虫帶浠�
+ var btnSwitch = this.AddSwitchControl();
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ bool setStatu = !btnSwitch.IsSelected;
+ //鍙樻洿鍗$墖鐘舵��
+ this.SetRowOpenStatu(setStatu);
+ //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
+ this.StartCheckResponeResult(!setStatu);
+
+ if (setStatu == true)
+ {
+ //鎵撳紑
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
+ i_device.SwitchControl(1);
+ }
+ else
+ {
+ //鍏抽棴
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close));
+ i_device.SwitchControl(0);
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var lightControl = new Phone.Device.Light.OnOffControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ lightControl.Show(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom);
+ lightControl.action += this.CardDetailInfoBackEvent;
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return ((LightBase)i_device).OnOffStatus == 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceSensorRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceSensorRowControl.cs
new file mode 100755
index 0000000..ef2d347
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceSensorRowControl.cs
@@ -0,0 +1,25 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勪紶鎰熷櫒璁惧琛屾帶浠�
+ /// </summary>
+ public class DeviceSensorRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勪紶鎰熷櫒璁惧琛屾帶浠�
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceSensorRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs
new file mode 100755
index 0000000..ac16b4d
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs
@@ -0,0 +1,41 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勬俯婀垮害浼犳劅鍣ㄨ澶囪鎺т欢
+ /// </summary>
+ public class DeviceTemperatureRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勬俯婀垮害浼犳劅鍣ㄨ澶囪鎺т欢
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceTemperatureRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ (this.device as TemperatureSensor).ReadTemperatureOrHumidity();
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
index 3d4ef08..cc8fe56 100755
--- a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
@@ -134,7 +134,7 @@
txttitle.Name = "txtTitle";
txttitle.TextSize = 17;
txttitle.X = Application.GetRealWidth(161);
- txttitle.Height = Application.GetRealHeight(69);
+ txttitle.Height = Application.GetRealHeight(75);
txttitle.Width = Application.GetRealWidth(850);
txttitle.Gravity = Gravity.CenterVertical;
txttitle.TextColor = UserCenterColor.Current.TopLayoutTitleText;
@@ -408,6 +408,16 @@
back?.RemoveFromParent();
}
+ /// <summary>
+ /// 鑾峰彇杩斿洖閿�
+ /// </summary>
+ public BackViewControl GetBackButton()
+ {
+ //绉婚櫎杩斿洖閿�
+ var back = (BackViewControl)topFrameLayout.GetTagByKey("btnBack");
+ return back;
+ }
+
#endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
index f2442bc..04908bc 100755
--- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -125,15 +125,7 @@
#endregion
#region 鈼� 鎺ュ彛___________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- }
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
@@ -313,22 +305,7 @@
});
}
}
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
#endregion
#region 鈼� 鏋勯�犳柟娉昣_______________________
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index 9bb4cd1..252f21c 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -123,30 +123,7 @@
#endregion
#region 鈼� 鎺ュ彛____________________________
- /// <summary>
- /// 璇ユ帴鍙e皢寮冪敤 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
-
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
-
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
@@ -1955,11 +1932,11 @@
functionSceneBodyView.AddChidren(sceneScrolView);
foreach (var scene in sceneList)
{
- var sceneView = new SceneCategoryView(0, 0);
+ var sceneView = new SceneCategoryView();
sceneScrolView.AddChidren(sceneView);
- sceneView.Init(scene, room);
- GetDelayScene(sceneScrolView);
- }
+ sceneView.InitControl(scene, room);
+ }
+ GetDelayScene(sceneScrolView);
}
}
@@ -2014,6 +1991,10 @@
for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
{
var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView;
+ if (sceneView == null)
+ {
+ continue;
+ }
foreach (var delayScenesListResponseInfo in delayList)
{
if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
@@ -2021,21 +2002,26 @@
sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime;
var remainTime = delayScenesListResponseInfo.RemainTime;
if (remainTime > 0)
- {
+ {
+ //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾)
+ HdlSceneLogic.Current.StartDelayTimeThread(sceneView.scene);
new System.Threading.Thread(() =>
{
- while (remainTime-- > 0)
+ while (remainTime > 0 && this.Parent != null)
{
System.Threading.Thread.Sleep(1000);
Application.RunOnMainThread(() =>
{
sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime));
});
+ remainTime--;
}
Application.RunOnMainThread(() =>
{
- sceneView.scene.RemainTime = 0;
- sceneView.SetTimeImage();
+ if (this.Parent != null)
+ {
+ sceneView.SetTimeImage();
+ }
});
})
{ IsBackground = true }.Start();
@@ -2044,31 +2030,19 @@
}
}
}
- }
-
- /// <summary>
- /// GetExecScene
- /// </summary>
- /// <param name="scrolViewLayout"></param>
- private void GetExecScene(VerticalScrolViewLayout scrolViewLayout)
- {
- new System.Threading.Thread(() =>
- {
-
- })
- { IsBackground = true }.Start();
- }
+ }
+
#endregion
-
+
#region 鈼� 鑷姩鍖朹_________________________
-
+
/// <summary>
/// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
/// </summary>
- private void ShowAutotion()
+ private void ShowAutotion()
{
- // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-
+ // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+
var bjFrameLayout = new FrameLayout
{
Width = Application.GetRealWidth(1080 - 58),
@@ -2226,25 +2200,25 @@
}
logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight;
logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
- Automationview(logicScrolView,no);
+ Automationview(logicScrolView, no);
};
logicScrolView.BeginHeaderRefreshingAction += () =>
{
//閲嶆柊鍒锋柊logic鍒楄〃
Common.Logic.LogicList.Clear();
- Read(logicScrolView,no);
+ Read(logicScrolView, no);
//鍏抽棴鍒锋柊View锛�
logicScrolView.EndHeaderRefreshing();
- };
-
- Read(logicScrolView,no);
+ };
+
+ Read(logicScrolView, no);
}
/// <summary>
/// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱
/// </summary>
/// <param name="logicScrolView"></param>
- private async void Read(VerticalRefreshLayout logicScrolView,bool no)
+ private async void Read(VerticalRefreshLayout logicScrolView, bool no)
{
CommonPage.Loading.Start();
if (Common.Logic.LogicList.Count == 0)
@@ -2266,23 +2240,23 @@
}
}
//鑷姩鍖�
- Automationview(logicScrolView,no);
+ Automationview(logicScrolView, no);
CommonPage.Loading.Hide();
}
/// <summary>
/// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
/// </summary>
/// <param name="refresview">Refresview.</param>
- private async void Automationview(VerticalRefreshLayout refresview,bool no)
+ private async void Automationview(VerticalRefreshLayout refresview, bool no)
{
refresview.RemoveAll();
- if (Common.Logic.LogicList.Count == 0&&no==false)
+ if (Common.Logic.LogicList.Count == 0 && no == false)
{
//灏辨槸涓轰簡鏄剧ず寮曞娣诲姞鍥炬爣;
refresview.BackgroundColor = 0x00000000;
var noFrameLayout = new FrameLayout
{
- Height = Application.GetRealHeight(434+ 200+32+160),
+ Height = Application.GetRealHeight(434 + 200 + 32 + 160),
//BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
refresview.AddChidren(noFrameLayout);
@@ -2290,7 +2264,7 @@
var noIconBtn = new Button
{
- Y=Application.GetRealHeight(160),
+ Y = Application.GetRealHeight(160),
Width = Application.GetMinRealAverage(756),
Height = Application.GetMinRealAverage(434),
UnSelectedImagePath = "Item/NoFunction.png",
@@ -2301,14 +2275,14 @@
var noTextBtn = new Button()
{
Y = noIconBtn.Bottom,
- Height = Application.GetRealHeight(200)+Application.GetRealHeight(32),
+ Height = Application.GetRealHeight(200) + Application.GetRealHeight(32),
Width = Application.GetRealWidth(700),
//Gravity = Gravity.CenterHorizontal,
Text = Language.StringByID(MyInternationalizationString.automationaddtext).Replace("{\\r\\n}", "\r\n"),
TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
TextAlignment = TextAlignment.Center,
IsMoreLines = true,
- X = Application.GetRealWidth(190-58),
+ X = Application.GetRealWidth(190 - 58),
};
noFrameLayout.AddChidren(noTextBtn);
@@ -2327,16 +2301,16 @@
}
}
foreach (var logic in Common.Logic.LogicList)
- {
-
-
+ {
+
+
var logicRowlayout = new RowLayout
{
Height = Application.GetRealHeight(190 + 30),
- Width = Application.GetRealWidth(1080-58),
- LineColor = ZigbeeColor.Current.LogicBackgroundColor,
- BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor,
-
+ Width = Application.GetRealWidth(1080 - 58),
+ LineColor = ZigbeeColor.Current.LogicBackgroundColor,
+ BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+
};
refresview.AddChidren(logicRowlayout);
@@ -2411,9 +2385,9 @@
var logicCommunalPage = new Logic.LogicCommunalPage();
HomePage.Instance.AddChidren(logicCommunalPage);
HomePage.Instance.PageIndex += 1;
- logicCommunalPage.Show(() => {
+ logicCommunalPage.Show(() => {
logicnameBtn.Text = logic.LogicName;
- Automationview(refresview,no);
+ Automationview(refresview, no);
});
};
@@ -2444,7 +2418,7 @@
var line = new Button
{
Y = Application.GetRealHeight(215),
- Height = Application.GetRealHeight(5),
+ Height = Application.GetRealHeight(5),
Width = Application.GetRealWidth(1080 - 58),
BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
X = Application.GetRealWidth(58),
@@ -2924,10 +2898,10 @@
{
commonDeviceList.Add(common);
}
- }
-
+ }
+
#endregion
-
-
+
+
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/CommonFormResouce.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/CommonFormResouce.cs
index cb59ba2..2addb77 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/CommonFormResouce.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/CommonFormResouce.cs
@@ -54,13 +54,13 @@
/// </summary>
public const int TopFrameLayout_Height = 184;
/// <summary>
- /// topview 鐘舵�佹爮楂樺害 60
+ /// topview 鐘舵�佹爮楂樺害 74
/// </summary>
- public const int TopStatuFrameLayout_Height = 60;
+ public const int TopStatuFrameLayout_Height = 74;
/// <summary>
- /// topview 鐘舵�佹爮楂樺害 124
+ /// topview 鐘舵�佹爮楂樺害 110
/// </summary>
- public const int Topview_Height = 124;
+ public const int Topview_Height = 110;
/// <summary>
/// 鏍囬澶у皬 17
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
index f1d948a..a843033 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
@@ -13,10 +13,6 @@
/// Room
/// </summary>
private Common.Room room;
- /// <summary>
- /// action
- /// </summary>
- public Action action;
FrameLayout roomNameBackground;
@@ -33,31 +29,7 @@
CommonDevice humidDevice;
#region 鈼� 鎺ュ彛__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
@@ -180,11 +152,13 @@
/// <param name="r"></param>
public void Init(Common.Room r)
{
+ this.RemoveAll();
+
this.room = r;
- this.temperDevice= Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
+ this.temperDevice = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
- this.humidDevice= Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
+ this.humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
var roomBackView = new FrameLayout()
{
@@ -327,7 +301,8 @@
form.AddForm(room);
form.FinishEditorEvent += (roomName2) =>
{
- action?.Invoke();
+ //閲嶆柊鍒锋柊鎺т欢
+ this.Init(this.room);
};
};
}
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs
index d8341ed..15640bb 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs
@@ -6,8 +6,10 @@
namespace Shared.Phone.Device.CommonForm
{
- public class SceneCategoryView : FrameLayout
- {
+ public class SceneCategoryView : RowLayout
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
/// <summary>
/// scene
/// </summary>
@@ -15,174 +17,121 @@
/// <summary>
/// room
/// </summary>
- public Shared.Common.Room room;
+ private Common.Room room;
/// <summary>
- /// delayTimeBtn
+ /// 寤舵椂鏃堕棿
/// </summary>
- private Button delayTimeBtn;
+ private NormalViewControl btnDelayTime;
/// <summary>
- /// delayImgBtn
+ /// 寤舵椂鍥炬爣
/// </summary>
- private Button delayImgBtn;
- /// <summary>
- /// sceneImg
- /// </summary>
- private ImageView sceneImg;
-
+ private IconViewControl btnDelayIcon;
+ /// <summary>
+ /// 鍦烘櫙鍥剧墖鎺т欢
+ /// </summary>
+ private ScenePictrueControl sceneContr = null;
+ /// <summary>
+ /// 鏄惁宸茬粡瀹屾垚鎺т欢鍒濆鍖栫粨鏉�
+ /// </summary>
+ private bool isInitControlFinish = false;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
/// <summary>
/// SceneCategoryView
/// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public SceneCategoryView(int x, int y)
+ public SceneCategoryView()
{
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(397 + 46);
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
- }
-
- /// <summary>
- /// init
- /// </summary>
- public void Init(SceneUI sceneUI,Common.Room curRoom)
- {
- this.scene = sceneUI;
- this.room = curRoom;
-
- InitFrame();
- }
-
- /// <summary>
- /// InitFrame
- /// </summary>
- private void InitFrame()
- {
- RemoveAll();
- var sceneRowLayout = new RowLayout
- {
- Height = Application.GetRealHeight(440),
- LineColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- Tag = scene
+ this.Width = Application.GetRealWidth(1080);
+ this.Height = Application.GetRealHeight(397 + 46);
+ this.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
+ this.IsUseSameSubViewWidth = false;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖�
+ /// </summary>
+ /// <param name="i_scene"></param>
+ public void InitControl(SceneUI i_scene, Common.Room i_room)
+ {
+ this.RemoveAll();
+
+ this.LineColor = UserCenterColor.Current.Transparent;
+
+ this.scene = i_scene;
+ this.room = i_room;
+
+ //鑷畾涔夌殑鍦烘櫙鍥剧墖鎺т欢
+ this.sceneContr = new ScenePictrueControl();
+ this.AddChidren(sceneContr);
+ sceneContr.InitControl(this.scene);
+
+ //鍦烘櫙鐐瑰嚮
+ sceneContr.ButtonClickEvent += (sender, e) =>
+ {
+ this.SceneUpHandler();
};
- AddChidren(sceneRowLayout);
- sceneImg = new ImageView()
- {
- X = Application.GetRealWidth(179),
- Width = Application.GetRealWidth(844),
- Height = Application.GetRealHeight(397),
- ImagePath = scene.IconPathType == 0 ? scene.IconPath : System.IO.Path.Combine(Config.Instance.FullPath, scene.IconPath),
- Radius = (uint)Application.GetRealHeight(17)
- };
- sceneRowLayout.AddChidren(sceneImg);
- //闃村奖
- var btnShadow = new PicViewControl(sceneImg.Width + Application.GetRealWidth(14 * 2), sceneImg.Height + Application.GetRealHeight(43), false);
- btnShadow.X = sceneImg.X - Application.GetRealWidth(14);
- btnShadow.UnSelectedImagePath = "Scene/SceneShadow.png";
- sceneRowLayout.AddChidren(btnShadow);
- btnShadow.ButtonClickEvent += this.SceneUpHandler;
-
- var leftFL = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(58),
- Width = Application.GetRealWidth(251),
- Height = Application.GetRealHeight(282),
- BackgroundColor = 0xd6333333,
- Radius = (uint)Application.GetRealHeight(17)
- };
- sceneRowLayout.AddChidren(leftFL);
-
- var collectionBtn = new Button
- {
- X = Application.GetRealWidth(23),
- Y = Application.GetRealHeight(23),
- Width = Application.GetMinRealAverage(65),
- Height = Application.GetMinRealAverage(65),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png",
- IsSelected = HdlRoomLogic.Current.IsCollectInRoom(scene),
- Tag = scene
- };
- leftFL.AddChidren(collectionBtn);
-
- var sceneNameBtn = new Button()
- {
- Width = Application.GetRealWidth(176),
- Height = Application.GetRealHeight(150),
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- Text = scene.Name,
- Gravity = Gravity.Center,
- IsMoreLines = true
- };
- leftFL.AddChidren(sceneNameBtn);
-
- var collection = new Button
- {
- Tag = scene
- };
- leftFL.AddChidren(collection);
- collection.MouseUpEventHandler += (sender, e) =>
- {
+ //鏀惰棌
+ sceneContr.AddCollectionControl();
+ sceneContr.CollectEvent += (collect) =>
+ {
if (room.IsLove)
{
- HdlSceneLogic.Current.DeleteScene(HdlRoomLogic.Current.GetLoveRoom(), scene);
- RemoveViewByTag(collectionBtn.Tag);
- }
- else
- {
- collectionBtn.IsSelected = !collectionBtn.IsSelected;
- if (collectionBtn.IsSelected)
- {
- HdlSceneLogic.Current.AddScene(HdlRoomLogic.Current.GetLoveRoom(), scene);
- }
- else
- {
- HdlSceneLogic.Current.DeleteScene(HdlRoomLogic.Current.GetLoveRoom(), scene);
- }
- }
+ this.RemoveFromParent();
+ }
};
+
+ //寤舵椂鏃堕棿
+ this.btnDelayTime = new NormalViewControl(200, 58, true);
+ btnDelayTime.X = Application.GetRealWidth(780);
+ btnDelayTime.Y = Application.GetRealHeight(317);
+ btnDelayTime.Text = CommonFormResouce.GetTimeString(scene.SceneDelayTime);
+ btnDelayTime.TextAlignment = TextAlignment.CenterRight;
+ btnDelayTime.TextColor = ZigbeeColor.Current.GXCTextSelectedColor3;
+ btnDelayTime.IsBold = true;
+ this.AddChidren(btnDelayTime);
- delayTimeBtn = new Button
- {
- X = Application.GetRealWidth(780),
- Y = Application.GetRealHeight(317),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(58),
- Text = CommonFormResouce.GetTimeString(scene.SceneDelayTime),
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor3
- };
- sceneRowLayout.AddChidren(delayTimeBtn);
-
- delayImgBtn = new Button
- {
- X = Application.GetRealWidth(900),
- Y = Application.GetRealHeight(30),
- Width = Application.GetMinRealAverage(52),
- Height = Application.GetMinRealAverage(52),
- UnSelectedImagePath = "Scene/Delaying.png",
- Visible=false
- };
- sceneRowLayout.AddChidren(delayImgBtn);
+ //寤舵椂鍥炬爣
+ this.btnDelayIcon = new IconViewControl(52);
+ btnDelayIcon.X = Application.GetRealWidth(900);
+ btnDelayIcon.Y = Application.GetRealHeight(30);
+ btnDelayIcon.Width = Application.GetMinRealAverage(52);
+ btnDelayIcon.Height = Application.GetMinRealAverage(52);
+ btnDelayIcon.UnSelectedImagePath = "Scene/Delaying.png";
+ this.AddChidren(btnDelayIcon);
+ btnDelayIcon.Visible = false;
- sceneRowLayout.SubViewWidth = Application.GetRealWidth(199);
+ if (isInitControlFinish == true)
+ {
+ //缂栬緫鍦烘櫙鐨勫洖璋冨嚱鏁颁細閲嶆柊鍒锋柊鎺т欢
+ //鎵�浠ヨ繖閲屼笉鍐嶅垵濮嬪寲
+ return;
+ }
+ this.isInitControlFinish = true;
+
+ //娣诲姞宸﹁竟鐨勭┖鐧藉尯鍩�
+ var btnTemp1 = new NormalViewControl(Application.GetRealWidth(58), sceneContr.btnScenePic.Height, false);
+ this.AddLeftView(btnTemp1);
//瀹氭椂
- var btnDelay = new NormalViewControl(Application.GetRealWidth(199), sceneRowLayout.Height, false);
+ var btnDelay = new NormalViewControl(Application.GetRealWidth(199), sceneContr.btnScenePic.Height, false);
btnDelay.BackgroundColor = ZigbeeColor.Current.GXCTextSelectedColor;
btnDelay.TextID = R.MyInternationalizationString.Delay;
btnDelay.TextColor = ZigbeeColor.Current.GXCTextWhiteColor;
btnDelay.TextAlignment = TextAlignment.Center;
btnDelay.Tag = scene.SceneDelayTime;
btnDelay.Radius = (uint)Application.GetRealHeight(17);
- sceneRowLayout.AddLeftView(btnDelay);
+ btnDelay.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight |
+ HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
+ this.AddLeftView(btnDelay);
//鍙樻洿鎸夐挳鐨勯珮搴�
- btnDelay.Height = sceneImg.Height;
+ btnDelay.Height = sceneContr.btnScenePic.Height;
+ btnDelay.Y = 0;
- //缂栬緫
- var btnEditor = new NormalViewControl(Application.GetRealWidth(199), sceneImg.Height, false);
+ //缂栬緫
+ var btnEditor = new NormalViewControl(Application.GetRealWidth(199), sceneContr.btnScenePic.Height, false);
btnEditor.BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor;
btnEditor.TextID = R.MyInternationalizationString.Edit;
btnEditor.TextColor = ZigbeeColor.Current.GXCTextWhiteColor;
@@ -191,22 +140,27 @@
btnEditor.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerTopLeft);
//鍒犻櫎
- var btnDelete = new NormalViewControl(Application.GetRealWidth(199), sceneImg.Height, false);
+ var btnDelete = new NormalViewControl(Application.GetRealWidth(199), sceneContr.btnScenePic.Height, false);
btnDelete.Tag = scene;
btnDelete.BackgroundColor = ZigbeeColor.Current.GXCRedColor;
btnDelete.TextID = R.MyInternationalizationString.Delete;
btnDelete.TextColor = ZigbeeColor.Current.GXCTextWhiteColor;
btnDelete.TextAlignment = TextAlignment.Center;
- btnDelete.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight);
-
+ btnDelete.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight);
+
if (room.IsSharedRoom == false && room.IsLove == false)
{
//涓嶆槸鍒嗕韩,骞朵笖涓嶆槸鏀惰棌
- sceneRowLayout.AddRightView(btnEditor);
- sceneRowLayout.AddRightView(btnDelete);
+ this.AddRightView(btnEditor);
+ this.AddRightView(btnDelete);
//鍙樻洿鎸夐挳鐨勯珮搴�
- btnEditor.Height = sceneImg.Height;
- btnDelete.Height = sceneImg.Height;
+ btnEditor.Height = sceneContr.btnScenePic.Height;
+ btnEditor.Y = 0;
+ btnDelete.Height = sceneContr.btnScenePic.Height;
+ btnDelete.Y = 0;
+ //娣诲姞鍙宠竟绌虹櫧鍖哄煙
+ var btnTemp2 = new NormalViewControl(Application.GetRealWidth(58), sceneContr.btnScenePic.Height, false);
+ this.AddRightView(btnTemp2);
}
//鍒犻櫎鍦烘櫙
@@ -253,6 +207,8 @@
{
try
{
+ //鍏抽棴宸︽粦鑿滃崟
+ this.HideMenu();
var targetList = new List<SceneTargetDeviceUI> { };
CommonPage.Loading.Start();
//浠庣綉鍏充腑鍙嶅簭鍒楀寲鍑哄搴旂殑鎴块棿璁惧
@@ -261,8 +217,8 @@
{
CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheMainGatewayIsNotOnLine));
return;
- }
-
+ }
+
if (sceneDeviceList.getSceneDeviceListInfo != null)
{
var deviceList = sceneDeviceList.getSceneDeviceListInfo.DeviceList;
@@ -339,7 +295,7 @@
}
else
{
- Init(s, r);
+ this.InitControl(s, r);
}
};
}
@@ -366,63 +322,64 @@
timeSelect.Init();
timeSelect.TimeAction = (t) =>
{
+ //闅愯棌鍙冲垝鑿滃崟
+ this.HideMenu();
scene.SceneDelayTime = t;
- delayTimeBtn.Text = CommonFormResouce.GetTimeString(t);
+ btnDelayTime.Text = CommonFormResouce.GetTimeString(t);
};
- };
- }
+ };
+ }
+
+ #endregion
- /// <summary>
- /// SceneUpHandler
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="args"></param>
- private async void SceneUpHandler(object sender, MouseEventArgs args)
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="btnScenePic"></param>
+ /// <param name="btnSceneName"></param>
+ private async void SceneUpHandler()
{
- if (scene.RemainTime > 0 && scene.SceneDelayTime == 0)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying));
- return;
+ if (scene.SceneDelayTime <= 0 && scene.RemainTime <= 0)
+ {
+ //濡傛灉娌℃湁寤惰繜鐨勮瘽,鐩存帴寮�鍚疞oading鐗规晥
+ this.StartLoadingApreal();
}
- //1鎴愬姛 0澶辫触
- //鍚庨潰琛ヤ笂鐩稿叧鎻愮ず
- // Error鍙傛暟鍚箟
- //<para>1锛氱綉鍏虫棤娉曡В鏋愬懡浠ゆ暟鎹��</para>
- //<para>2锛氬崗璋冨櫒姝e湪鍗囩骇鎴栧浠�/鎭㈠鏁版嵁
- //<para>3锛氭搷浣滆澶�/缁�/鍦烘櫙涓嶅瓨鍦�</para>
- //<para>4锛氬叾浠栭敊璇�</para>
- //<para>5锛氭暟鎹紶杈撻敊璇紙鍦ㄦ煇娆″鎴风鍚戠綉鍏冲彂閫佹暟鎹殑杩囩▼涓紝缃戝叧鍦ㄥ悎鐞嗘椂闂磋寖鍥村唴鎺ユ敹瀹㈡埛绔暟鎹笉瀹屾暣瀵艰嚧璇ラ敊璇彂鐢熴�傚瀹㈡埛绔悜缃戝叧涓�娆″彂閫�100涓瓧鑺傜殑鏁版嵁锛屼絾缃戝叧绛夊緟鎺ユ敹浜嗕竴绉掑彧鎺ユ敹浜�80涓瓧鑺傘�傚彂鐢熻閿欒锛岀綉鍏冲皢涓诲姩鍏抽棴瀹㈡埛绔繛鎺ワ級</para>
- var sceneOpenAllData = await ZigBee.Device.Scene.ControlSceneAsync(scene.Id, scene.SceneDelayTime);
-
- if (sceneOpenAllData == null || sceneOpenAllData.sceneOpenData == null)
+ //璋冪敤鍦烘櫙
+ var result = await HdlSceneLogic.Current.ControlScene(scene);
+ if (result == false)
{
return;
}
- if (sceneOpenAllData.sceneOpenData.Result == 0)
- {
- if (sceneOpenAllData.errorResponData == null)
- {
- return;
- }
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.ControlSceneFail));
- }
-
+
scene.RemainTime = scene.SceneDelayTime;
scene.SceneDelayTime = 0;
+ if (scene.RemainTime <= 0)
+ {
+ return;
+ }
+ int myRemainTime = scene.RemainTime;
+ //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾)
+ HdlSceneLogic.Current.StartDelayTimeThread(scene);
+
new System.Threading.Thread(() =>
{
- while (scene.RemainTime > 0)
+ while (myRemainTime > 0 && this.Parent != null)
{
System.Threading.Thread.Sleep(1000);
Application.RunOnMainThread(() =>
{
SetTimeText(CommonFormResouce.GetTimeString(scene.RemainTime));
});
- scene.RemainTime -= 1;
+ myRemainTime--;
}
Application.RunOnMainThread(() =>
{
- SetTimeImage();
+ if (this.Parent != null)
+ {
+ SetTimeImage();
+ //鐩存帴寮�鍚疞oading鐗规晥
+ this.StartLoadingApreal();
+ }
});
})
{ IsBackground = true }.Start();
@@ -434,8 +391,8 @@
/// <param name="name"></param>
public void SetTimeText(string name)
{
- delayImgBtn.Visible = true;
- delayTimeBtn.Text = name;
+ btnDelayIcon.Visible = true;
+ btnDelayTime.Text = name;
}
/// <summary>
@@ -443,8 +400,65 @@
/// </summary>
public void SetTimeImage()
{
- delayImgBtn.Visible = false;
- delayTimeBtn.Text = string.Empty;
+ btnDelayIcon.Visible = false;
+ btnDelayTime.Text = string.Empty;
+ }
+
+ /// <summary>
+ /// 寮�鍚疞oading鐗规晥
+ /// </summary>
+ public void StartLoadingApreal()
+ {
+ //寮勪釜閬僵閬綇
+ var frameBack1 = new FrameLayout();
+ frameBack1.Y = sceneContr.btnScenePic.Y;
+ frameBack1.X = sceneContr.btnScenePic.X;
+ frameBack1.Width = sceneContr.btnScenePic.Width;
+ frameBack1.Height = sceneContr.btnScenePic.Height;
+ frameBack1.Radius = (uint)Application.GetRealHeight(17);
+ frameBack1.BackgroundColor = 0xb3000000;
+ this.AddChidren(frameBack1);
+
+ var frameBack2 = new FrameLayout();
+ frameBack2.Y = sceneContr.btnSceneName.Y;
+ frameBack2.X = sceneContr.btnSceneName.X;
+ frameBack2.Width = sceneContr.btnSceneName.Width;
+ frameBack2.Height = sceneContr.btnSceneName.Height;
+ frameBack2.Radius = (uint)Application.GetRealHeight(17);
+ frameBack2.BackgroundColor = 0xb3000000;
+ this.AddChidren(frameBack2);
+
+ //鍐嶅姞涓浆鍦堢殑
+ var loadContr = new MyProgressLoading();
+ loadContr.LoadingBackgroundColor = UserCenterColor.Current.Transparent;
+ frameBack1.AddChidren(loadContr);
+ loadContr.StartLoading(1000);
+ loadContr.DisponeEvent += () =>
+ {
+ frameBack1.RemoveFromParent();
+ frameBack2.RemoveFromParent();
+ };
+ }
+
+ /// <summary>
+ /// 鑷畾涔夋帶浠�(闇�瑕佺殑瀹冪Щ闄や簨浠�)
+ /// </summary>
+ private class MyProgressLoading : ProgressLoading
+ {
+ /// <summary>
+ /// 鎺т欢閿�姣佺殑浜嬩欢
+ /// </summary>
+ public Action DisponeEvent = null;
+ /// <summary>
+ /// 鎺т欢閿�姣�
+ /// </summary>
+ public override void RemoveFromParent()
+ {
+ base.RemoveFromParent();
+
+ this.DisponeEvent?.Invoke();
+ this.DisponeEvent = null;
+ }
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs
index a9624fe..9c161ec 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/TopFrameLayout.cs
@@ -9,7 +9,7 @@
/// <summary>
/// 杩斿洖閿�
/// </summary>
- public BackButton backButton;
+ public UserCenter.BackViewControl backButton;
/// <summary>
/// 鐘舵�佹爮-楂樺害涓�80
/// </summary>
@@ -88,8 +88,11 @@
/// <returns>The back button.</returns>
private void AddBackBtn()
{
- backButton = new BackButton { };
- topView.AddChidren(backButton);
+ backButton = new UserCenter.BackViewControl();
+ topView.AddChidren(backButton);
+ backButton.InitControl();
+ //鍚庣画鍐嶈皟鏁�
+ backButton.Y = backButton.Y - Application.GetRealHeight(4);
}
#endregion
@@ -116,17 +119,16 @@
/// 鏍囬
/// </summary>
private void AddTitle()
- {
- topTitle = new Button
- {
- X = Application.GetRealWidth(164),
- Height = Application.GetRealHeight(CommonFormResouce.TopFrameLayout_Height - CommonFormResouce.TopStatuFrameLayout_Height),
- Width = Application.GetRealWidth(CommonFormResouce.TopTitle_Width),
- TextSize = CommonFormResouce.TopTitle_TextSize,
- TextColor = ZigbeeColor.Current.GXCTitleBlackTitle,
- TextAlignment = TextAlignment.CenterLeft,
- IsBold = true,
- };
+ {
+ topTitle = new Button();
+ topTitle.TextSize = 17;
+ topTitle.X = Application.GetRealWidth(161);
+ topTitle.Height = Application.GetRealHeight(75);
+ topTitle.Width = Application.GetRealWidth(850);
+ topTitle.Gravity = Gravity.CenterVertical;
+ topTitle.TextColor = UserCenter.UserCenterColor.Current.TopLayoutTitleText;
+ topTitle.TextAlignment = TextAlignment.CenterLeft;
+ topTitle.IsBold = true;
topView.AddChidren(topTitle);
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
index ff4d23b..bc33a45 100755
--- a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
@@ -96,15 +96,7 @@
#endregion
#region 鈼� 鎺ュ彛___________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- }
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
@@ -206,22 +198,7 @@
});
}
}
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
#endregion
#region 鈼� 鏋勯�犳柟娉昣_______________________
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
index 7f279dc..a2d4684 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
@@ -78,31 +78,7 @@
#endregion
#region 鈼� 鎺ュ彛__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
index c0f6072..ce0324d 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
@@ -79,31 +79,7 @@
#endregion
#region 鈼� 鎺ュ彛__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
index b08c627..504214d 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
@@ -70,31 +70,7 @@
#endregion
#region 鈼� 鎺ュ彛__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
index 9baac28..bb3e05b 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
@@ -78,31 +78,7 @@
#endregion
#region 鈼� 鎺ュ彛__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs
index 6ef1e93..50969c8 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs
@@ -71,31 +71,7 @@
#endregion
#region 鈼� 鎺ュ彛__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
index 53eb7f4..3d0f6c6 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -33,21 +33,21 @@
};
this.AddChidren(middle);
///鏃堕棿
- FunView timeview = new FunView();
- timeview.iconBtn.UnSelectedImagePath = "ZigeeLogic/time.png";
- timeview.funnameBtn.TextID = MyInternationalizationString.timecondition;
- middle.AddChidren(timeview.FunFrameView());
- timeview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ FunView timeView = new FunView();
+ timeView.iconBtn.UnSelectedImagePath = "ZigeeLogic/time.png";
+ timeView.funnameBtn.TextID = MyInternationalizationString.timecondition;
+ middle.AddChidren(timeView.FunFrameView());
+ timeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
TimeView();
};
///璁惧
- FunView functionview = new FunView();
- functionview.funFrameLayout.Y = timeview.funFrameLayout.Bottom;
- functionview.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
- functionview.funnameBtn.TextID = MyInternationalizationString.device;
- middle.AddChidren(functionview.FunFrameView());
- functionview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ FunView functionView = new FunView();
+ functionView.funFrameLayout.Y = timeView.funFrameLayout.Bottom;
+ functionView.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
+ functionView.funnameBtn.TextID = MyInternationalizationString.device;
+ middle.AddChidren(functionView.FunFrameView());
+ functionView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
var roomAndDeviceView = new RoomAndDeviceView();
UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
@@ -56,25 +56,31 @@
roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.devicestate));
};
///瀹夐槻
- FunView securityview = new FunView();
- securityview.funFrameLayout.Y = functionview.funFrameLayout.Bottom;
- securityview.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
- securityview.funnameBtn.TextID = MyInternationalizationString.security;
- middle.AddChidren(securityview.FunFrameView());
- securityview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ FunView securityView = new FunView();
+ securityView.funFrameLayout.Y = functionView.funFrameLayout.Bottom;
+ securityView.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
+ securityView.funnameBtn.TextID = MyInternationalizationString.security;
+ middle.AddChidren(securityView.FunFrameView());
+ securityView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
+ //CurtainPanel.ButtonSet buttonSet = new CurtainPanel.ButtonSet();
+ //UserView.HomePage.Instance.AddChidren(buttonSet);
+ //UserView.HomePage.Instance.PageIndex += 1;
+ //buttonSet.Show();
+ //return;
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
this.AddChidren(flMain);
SecurityView(flMain, false);
};
///鍦扮悊鍥存爮
- FunView positionview = new FunView();
- positionview.funFrameLayout.Y = securityview.funFrameLayout.Bottom;
- positionview.iconBtn.UnSelectedImagePath = "ZigeeLogic/position.png";
- positionview.funnameBtn.TextID = MyInternationalizationString.location;
- positionview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
- middle.AddChidren(positionview.FunFrameView());
- positionview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ FunView positionView = new FunView();
+ positionView.funFrameLayout.Y = securityView.funFrameLayout.Bottom;
+ positionView.funFrameLayout.Height = Application.GetRealHeight(160+20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ positionView.iconBtn.UnSelectedImagePath = "ZigeeLogic/position.png";
+ positionView.funnameBtn.TextID = MyInternationalizationString.location;
+ positionView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+ middle.AddChidren(positionView.FunFrameView());
+ positionView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
this.AddChidren(flMain);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
index 213e42d..c911959 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
@@ -31,10 +31,6 @@
Height = Application.GetRealHeight(1920 - 260 - 200 - 184),
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
- public FrameLayout saveframeLayout = new FrameLayout {
- Height = Application.GetRealHeight(260),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
Button roombjButton = new Button();
Button roomTextButton = new Button();
@@ -79,23 +75,10 @@
this.AddChidren(roomhorizontalScrol);
middle.Y = roomhorizontalScrol.Bottom;
this.AddChidren(middle);
- saveframeLayout.Y = middle.Bottom;
- this.AddChidren(saveframeLayout);
-
- var btnsave = new Button
- {
- X = Application.GetRealWidth(85),
- Height = Application.GetRealHeight(130),
- Width = Application.GetRealWidth(910),
- Radius = (uint)Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
- TextID = MyInternationalizationString.Save,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize = 16,
- };
- saveframeLayout.AddChidren(btnsave);
-
- btnsave.MouseUpEventHandler += (sender2, e2) =>
+ LogicView.SaveView saveView = new LogicView.SaveView();
+ saveView.frameLayout.Y = middle.Bottom;
+ this.AddChidren(saveView.Show());
+ saveView.clickviewBtn.MouseUpEventHandler += (sender2, e2) =>
{
if (clickTag == "no" || tempScene == null)
{
@@ -183,8 +166,8 @@
var btnfoolricon = new Button
{
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
UnSelectedImagePath = "Floor/Floor.png",
Gravity = Gravity.CenterVertical,
};
@@ -331,11 +314,10 @@
};
middle.AddChidren(sceneFramelayout);
-
var sceneIconBtn = new Button
{
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(58),
Y = Application.GetRealHeight(55),
UnSelectedImagePath = "ZigeeLogic/scene.png",
@@ -349,8 +331,7 @@
Width = Application.GetRealWidth(850),
Height = Application.GetRealHeight(130),
X = Application.GetRealWidth(176 + 10),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
+ LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
};
sceneFramelayout.AddChidren(sceneRow);
@@ -366,15 +347,23 @@
var selectedBtn = new Button
{
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
+ Width = Application.GetMinRealAverage(60),
+ Height = Application.GetMinRealAverage(60),
X = Application.GetRealWidth(789),
UnSelectedImagePath = "ZigeeLogic/selected.png",
Visible = false,
Gravity = Gravity.CenterVertical,
};
sceneRow.AddChidren(selectedBtn);
-
+ var lineBtn = new Button
+ {
+ Y = sceneFramelayout.Height - 1,
+ Width = Application.GetRealWidth(850),
+ Height = 1,
+ X = Application.GetRealWidth(176 + 10),
+ BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ };
+ sceneFramelayout.AddChidren(lineBtn);
EventHandler<MouseEventArgs> sceneclick = (sender, e) =>
{
tempScene = scene;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
index 317bb6c..203f4c8 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
@@ -22,7 +22,10 @@
completeView.Btntitle.Text = common.DeviceEpointName;
EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
{
- UserView.HomePage.Instance.ScrollEnabled = true;
+ if (!edit)
+ {
+ UserView.HomePage.Instance.ScrollEnabled = true;
+ }
flMain.RemoveFromParent();
};
flMain.MouseUpEventHandler += clickcancel;
@@ -34,29 +37,31 @@
openView.titleBtn.TextID = MyInternationalizationString.open;
mFunView closeView = new mFunView();
- closeView.frameLayout.Y = openView.frameLayout.Bottom;
+ closeView.frameLayout.Y = Application.GetRealHeight(140 + 20+160);
+ // closeView.frameLayout.Y = openView.frameLayout.Bottom;
//completeView.Show(l).AddChidren(closeView.Show());
closeView.titleBtn.TextID = MyInternationalizationString.close;
mFunView takebackView = new mFunView();
- takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
+ takebackView.frameLayout.Y = Application.GetRealHeight(140+20+160+160);
+ // takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
//completeView.Show(l).AddChidren(takebackView.Show());
takebackView.titleBtn.TextID = MyInternationalizationString.onoff;
takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-
+ #region -------杩涘害鏉℃帶浠�
var horizontalSeekBarRowLien = new RowLayout
{
- Y = openView.frameLayout.Bottom,
- Width = Application.GetRealWidth(920),
+ //Y = openView.frameLayout.Bottom,
+ Width = Application.GetRealWidth(915),
Height = Application.GetRealHeight(160),
X = Application.GetRealWidth(80),
LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
var horizontalSeekBarVol = new DiyImageSeekBar
{
- Y = openView.frameLayout.Bottom,
+ //Y = openView.frameLayout.Bottom,
X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(920),
+ Width = Application.GetRealWidth(915),
Height = Application.GetRealHeight(160),
IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
@@ -64,9 +69,10 @@
ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
- ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏�
- SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
+ ProgressTextSize = 9,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏�12
+ SeekBarViewHeight = Application.GetRealHeight(5),//杩涘害鏉$殑楂樺害10
};
+ #endregion
#endregion
#region -------鏁版嵁澶勭悊閮ㄥ垎
@@ -207,7 +213,9 @@
completeView.Show(l).AddChidren(openView.Show());
completeView.Show(l).AddChidren(closeView.Show());
+ //closeView.frameLayout.Y = openView.frameLayout.Bottom;
completeView.Show(l).AddChidren(takebackView.Show());
+ //takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
#endregion
@@ -485,13 +493,96 @@
break;
case DeviceType.DoorLock:
{
+ if (_if[0] == "condition")
+ {
+ flMain.RemoveFromParent();
+ var memberList = new MemberList();
+ UserView.HomePage.Instance.AddChidren(memberList);
+ UserView.HomePage.Instance.PageIndex += 1;
+ MemberList.edit = false;
+ memberList.Show(common);
+ }
+ else
+ {
+ completeView.Btntitle.TextID = MyInternationalizationString.openmode;
+ completeView.Show(2).AddChidren(openView.Show());
+ completeView.Show(2).AddChidren(closeView.Show());
+ openView.titleBtn.TextID = MyInternationalizationString.logicopen;
+ closeView.titleBtn.TextID = MyInternationalizationString.logicclose;
+ //闂ㄩ攣鏁版嵁鐗规畩锛岃繘琛岀壒娈婂鐞�;
+ if (actionsInfo.ContainsKey("LinkType"))
+ {
+ actionsInfo.Remove("LinkType");
+ }
+ //鐩爣闂ㄩ攣绫诲瀷鏄�8锛�
+ actionsInfo.Add("LinkType", 8);
+ if (actionsInfo.ContainsKey("TaskList"))
+ {
+ actionsInfo.Remove("TaskList");
+ }
+ if (actionsInfo.ContainsKey("Time"))
+ {
+ actionsInfo.Remove("Time");
+ }
+ closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+ ///
+ openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ openView.selectedIconBtn.Visible = true;
+ closeView.selectedIconBtn.Visible = false;
+ openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+ closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+ SelectedDeviceStatus = "DoorLock";
+ if (actionsInfo.ContainsKey("PassData"))
+ {
+ actionsInfo.Remove("PassData");
+ }
+ actionsInfo.Add("PassData", "055704010112");//闂ㄩ攣甯稿紑
+ };
+ ///鐐瑰嚮鍙栨秷浜嬩欢
+ closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ openView.selectedIconBtn.Visible = false;
+ closeView.selectedIconBtn.Visible = true;
+ openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+ closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+ SelectedDeviceStatus = "DoorLock";
+ if (actionsInfo.ContainsKey("PassData"))
+ {
+ actionsInfo.Remove("PassData");
+ }
+ actionsInfo.Add("PassData", "055704010113");//闂ㄩ攣甯稿叧
- flMain.RemoveFromParent();
- var memberList = new MemberList();
- UserView.HomePage.Instance.AddChidren(memberList);
- UserView.HomePage.Instance.PageIndex += 1;
- MemberList.edit = false;
- memberList.Show(common);
+ };
+ if (edit)
+ {
+ foreach (var deviceinfo in Common.Logic.CurrentLogic.Actions)
+ {
+ if (deviceinfo["LinkType"].ToString() == "8")
+ {
+ if (deviceinfo["DeviceAddr"].ToString() == common.DeviceAddr && deviceinfo["Epoint"].ToString() == common.DeviceEpoint.ToString())
+ {
+ if (deviceinfo["PassData"].ToString() == "055704010112")
+ {//寮�鍚�
+ openView.selectedIconBtn.Visible = true;
+ closeView.selectedIconBtn.Visible = false;
+ openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+ closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+ }
+ else
+ {//鍏抽棴
+ openView.selectedIconBtn.Visible = false;
+ closeView.selectedIconBtn.Visible = true;
+ openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+ closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
}
break;
case DeviceType.TemperatureSensor:
@@ -631,8 +722,12 @@
taskListInfo.Add(switchdictionary);
completeView.Show(l).AddChidren(openView.Show());
openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+
+ horizontalSeekBarRowLien.Y = openView.frameLayout.Bottom;
+ horizontalSeekBarVol.Y = openView.frameLayout.Bottom;
completeView.Show(l).AddChidren(horizontalSeekBarRowLien);
completeView.Show(l).AddChidren(horizontalSeekBarVol);
+
closeView.frameLayout.Y = horizontalSeekBarRowLien.Bottom;
completeView.Show(l).AddChidren(closeView.Show());
@@ -748,6 +843,9 @@
openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+
+ horizontalSeekBarRowLien.Y = openView.frameLayout.Bottom;
+ horizontalSeekBarVol.Y = openView.frameLayout.Bottom;
completeView.Show(l).AddChidren(horizontalSeekBarRowLien);
completeView.Show(l).AddChidren(horizontalSeekBarVol);
@@ -1194,7 +1292,14 @@
}
else
{ //娣诲姞鐩爣
- LogicIfon.AddDeviceactions(common, actionsInfo);
+ if (SelectedDeviceStatus == "DoorLock")
+ {//闂ㄩ攣鏁版嵁鐗规畩,杩涜鐗规畩澶勭悊;
+ LogicIfon.AddDoorLockActions(common, actionsInfo);
+ }
+ else
+ {
+ LogicIfon.AddDeviceActions(common, actionsInfo);
+ }
}
}
else
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs
index 4a0de72..5f733d0 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs
@@ -15,11 +15,11 @@
{
this.action = action;
}
-
+
public void Show()
{
Tag = "Logic";
-
+
#region 涓婇潰鐨勫竷灞�浠g爜
TopView view = new TopView();
this.AddChidren(view.TopRowView());
@@ -35,354 +35,127 @@
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
this.AddChidren(middle);
-
-
- var btnsave = new Button
- {
- Y= middle.Height-Application.GetRealHeight(260),
- X = Application.GetRealWidth(85),
- Height = Application.GetRealHeight(130),
- Width = Application.GetRealWidth(910),
- Radius = (uint)Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
- TextID = MyInternationalizationString.Save,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize = 16,
- };
- middle.AddChidren(btnsave);
+ LogicView.SaveView saveView = new LogicView.SaveView();
+ saveView.frameLayout.Y = middle.Height - Application.GetRealHeight(260);
+ middle.AddChidren(saveView.Show());
#region ----鎵ц涓�娆�----
- var onceFramelayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(onceFramelayout);
-
- var onceIconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- UnSelectedImagePath = "ZigeeLogic/point.png",
-
- };
- onceFramelayout.AddChidren(onceIconBtn);
-
- var onceRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- onceFramelayout.AddChidren(onceRow);
- var onceTextBtn = new Button
- {
- Text = Language.StringByID(MyInternationalizationString.executeonce),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
- };
- onceRow.AddChidren(onceTextBtn);
-
- var onceBackBtn = new SelectedButton(789);
- onceRow.AddChidren(onceBackBtn);
-
-
+ FunView onceView = new FunView();
+ onceView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+ onceView.funnameBtn.TextID = MyInternationalizationString.executeonce;
+ onceView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ onceView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ onceView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ onceView.funnextBtn.Visible = false;
+ middle.AddChidren(onceView.FunFrameView());
#endregion
#region ----姣忓ぉ----
- var everydayFramelayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- Y = onceFramelayout.Bottom,
- };
- middle.AddChidren(everydayFramelayout);
+ FunView dayView = new FunView();
+ dayView.funFrameLayout.Y = onceView.funFrameLayout.Bottom;
+ dayView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+ dayView.funnameBtn.TextID = MyInternationalizationString.everyday;
+ dayView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ dayView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ dayView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ dayView.funnextBtn.Visible = false;
+ middle.AddChidren(dayView.FunFrameView());
- var everydayIconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- UnSelectedImagePath = "ZigeeLogic/point.png",
-
- };
- everydayFramelayout.AddChidren(everydayIconBtn);
-
- var everydayRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- everydayFramelayout.AddChidren(everydayRow);
-
-
- var everydayTxetBtn = new Button
- {
- TextID = MyInternationalizationString.everyday,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
- };
- everydayRow.AddChidren(everydayTxetBtn);
-
- var everydayBack = new SelectedButton(789);
- everydayRow.AddChidren(everydayBack);
-
-
#endregion
#region ----姣忓懆----
- var weekFramelayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = everydayFramelayout.Bottom,
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(weekFramelayout);
- var weekIconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- UnSelectedImagePath = "ZigeeLogic/point.png",
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- };
- weekFramelayout.AddChidren(weekIconBtn);
-
- var weekRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- weekFramelayout.AddChidren(weekRow);
-
-
- var weekTextBtn = new Button
- {
- TextAlignment = TextAlignment.CenterLeft,
- TextID = MyInternationalizationString.weekly,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
- };
- weekRow.AddChidren(weekTextBtn);
-
- var weekBack = new Button
- {
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
- UnSelectedImagePath = "ZigeeLogic/next.png",
- X = Application.GetRealWidth(789),
- Gravity = Gravity.CenterVertical,
- };
- weekRow.AddChidren(weekBack);
+ FunView weekView = new FunView();
+ weekView.funFrameLayout.Y = dayView.funFrameLayout.Bottom;
+ weekView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+ weekView.funnameBtn.TextID = MyInternationalizationString.weekly;
+ middle.AddChidren(weekView.FunFrameView());
#endregion
#region ----姣忔湀----
- var monthlyFramelayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = weekFramelayout.Bottom,
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(monthlyFramelayout);
+ FunView monView = new FunView();
+ monView.funFrameLayout.Y = weekView.funFrameLayout.Bottom;
+ monView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ monView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
+ monView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+ monView.funnameBtn.TextID = MyInternationalizationString.monthly;
+ middle.AddChidren(monView.FunFrameView());
- var monthlyIconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- UnSelectedImagePath = "ZigeeLogic/point.png",
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- };
- monthlyFramelayout.AddChidren(monthlyIconBtn);
-
- var monthlyRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- monthlyFramelayout.AddChidren(monthlyRow);
-
- var monthlyTextBtn = new Button
- {
- TextAlignment = TextAlignment.CenterLeft,
- TextID = MyInternationalizationString.monthly,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
- };
- monthlyRow.AddChidren(monthlyTextBtn);
-
- var monthlyBack = new Button
- {
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
- UnSelectedImagePath = "ZigeeLogic/next.png",
- X = Application.GetRealWidth(789),
- Gravity = Gravity.CenterVertical,
- };
- monthlyRow.AddChidren(monthlyBack);
#endregion
#region ----姣忓勾----
- var yearFramelayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = monthlyFramelayout.Bottom,
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- //middle.AddChidren(yearFramelayout);
+ FunView yearView = new FunView();
+ yearView.funFrameLayout.Y = monView.funFrameLayout.Bottom;
+ yearView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+ yearView.funnameBtn.TextID = MyInternationalizationString.everyyear;
+ //middle.AddChidren(yearView.FunFrameView());
- var yearIconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- UnSelectedImagePath = "ZigeeLogic/point.png",
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- };
- yearFramelayout.AddChidren(yearIconBtn);
-
- var yearRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- yearFramelayout.AddChidren(yearRow);
-
-
- var yearTextBtn = new Button
- {
- TextAlignment = TextAlignment.CenterLeft,
- TextID = MyInternationalizationString.everyyear,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
- };
- yearRow.AddChidren(yearTextBtn);
-
- var yearBack = new Button
- {
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
- UnSelectedImagePath = "ZigeeLogic/next.png",
- X = Application.GetRealWidth(789),
- Gravity = Gravity.CenterVertical,
- };
- yearRow.AddChidren(yearBack);
-
- EventHandler<MouseEventArgs> yearclick = (sender, e) =>
+ yearView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
var everyyearPage = new EveryyearPage();
UserView.HomePage.Instance.AddChidren(everyyearPage);
UserView.HomePage.Instance.PageIndex += 1;
everyyearPage.Show();
-
};
- yearFramelayout.MouseUpEventHandler += yearclick;
- yearTextBtn.MouseUpEventHandler += yearclick;
- yearBack.MouseUpEventHandler += yearclick;
- yearIconBtn.MouseUpEventHandler += yearclick;
- yearRow.MouseUpEventHandler += yearclick;
+
#endregion
- EventHandler<MouseEventArgs> onceclick = (sender, e) =>
+ onceView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- onceBackBtn.Visible = true;
- everydayBack.Visible = false;
+ onceView.funnextBtn.Visible = true;
+ dayView.funnextBtn.Visible = false;
};
- onceTextBtn.MouseUpEventHandler += onceclick;
- onceBackBtn.MouseUpEventHandler += onceclick;
- onceFramelayout.MouseUpEventHandler += onceclick;
- onceIconBtn.MouseUpEventHandler += onceclick;
- onceRow.MouseUpEventHandler += onceclick;
-
- EventHandler<MouseEventArgs> everydayclick = (sender, e) =>
+ dayView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- onceBackBtn.Visible = false;
- everydayBack.Visible = true;
+ onceView.funnextBtn.Visible = false;
+ dayView.funnextBtn.Visible = true;
};
- everydayFramelayout.MouseUpEventHandler += everydayclick;
- everydayTxetBtn.MouseUpEventHandler += everydayclick;
- everydayBack.MouseUpEventHandler += everydayclick;
- everydayIconBtn.MouseUpEventHandler += everydayclick;
- everydayRow.MouseUpEventHandler += everydayclick;
-
- EventHandler<MouseEventArgs> weekclick = (sender, e) =>
+ weekView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- onceBackBtn.Visible = false;
- everydayBack.Visible = false;
+ onceView.funnextBtn.Visible = false;
+ dayView.funnextBtn.Visible = false;
var weekPage = new WeekPage();
UserView.HomePage.Instance.AddChidren(weekPage);
UserView.HomePage.Instance.PageIndex += 1;
- weekPage.Show(weekTextBtn.Text);
+ weekPage.Show(weekView.funnameBtn.Text);
};
- weekFramelayout.MouseUpEventHandler += weekclick;
- weekTextBtn.MouseUpEventHandler += weekclick;
- weekBack.MouseUpEventHandler += weekclick;
- weekIconBtn.MouseUpEventHandler += weekclick;
- weekRow.MouseUpEventHandler += weekclick;
-
- EventHandler<MouseEventArgs> monthlyclick = (sender, e) =>
+ monView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- onceBackBtn.Visible = false;
- everydayBack.Visible = false;
+ onceView.funnextBtn.Visible = false;
+ dayView.funnextBtn.Visible = false;
var everymonthPage = new EverymonthPage();
UserView.HomePage.Instance.AddChidren(everymonthPage);
UserView.HomePage.Instance.PageIndex += 1;
- everymonthPage.Show(monthlyTextBtn.Text);
+ everymonthPage.Show(monView.funnameBtn.Text);
};
- monthlyFramelayout.MouseUpEventHandler += monthlyclick;
- monthlyIconBtn.MouseUpEventHandler += monthlyclick;
- monthlyRow.MouseUpEventHandler += monthlyclick;
- monthlyTextBtn.MouseUpEventHandler += monthlyclick;
- monthlyBack.MouseUpEventHandler += monthlyclick;
if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 0)
{
- onceBackBtn.Visible = true;
- everydayBack.Visible = false;
+ onceView.funnextBtn.Visible = true;
+ dayView.funnextBtn.Visible = false;
}
else if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 2)
{
- onceBackBtn.Visible = false;
- everydayBack.Visible = true;
+ onceView.funnextBtn.Visible = false;
+ dayView.funnextBtn.Visible = true;
}
else
{
- onceBackBtn.Visible = false;
- everydayBack.Visible = false;
+ onceView.funnextBtn.Visible = false;
+ dayView.funnextBtn.Visible = false;
}
-
- btnsave.MouseUpEventHandler += (sedder, e) =>
+ saveView.clickviewBtn.MouseUpEventHandler += (sedder, e) =>
{
- if (!onceBackBtn.Visible && !everydayBack.Visible)
+ if (!onceView.funnextBtn.Visible && !dayView.funnextBtn.Visible)
{
-
+
var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
Language.StringByID(MyInternationalizationString.selectweek),
@@ -390,12 +163,12 @@
alert.Show();
return;
}
- if (onceBackBtn.Visible)
+ if (onceView.funnextBtn.Visible)
{
Common.Logic.CurrentLogic.TimeAttribute.Repeat = 0;
}
- if (everydayBack.Visible)
+ if (dayView.funnextBtn.Visible)
{
Common.Logic.CurrentLogic.TimeAttribute.Repeat = 2;
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
index 867e73b..61b6a9d 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
@@ -36,7 +36,7 @@
};
this.AddChidren(middle);
- var blancolor = new FrameLayout
+ var blancolorFl = new FrameLayout
{
Width = Application.GetMinRealAverage(200),
Height = Application.GetMinRealAverage(200),
@@ -45,32 +45,32 @@
Radius = (uint)Application.GetMinRealAverage(100),
X = Application.GetRealWidth(440),
};
- middle.AddChidren(blancolor);
- var color = new FrameLayout
+ middle.AddChidren(blancolorFl);
+ var colorBtn = new Button
{
- Width = blancolor.Width - Application.GetMinRealAverage(24),
- Height = blancolor.Height - Application.GetMinRealAverage(24),
- Y = Application.GetRealHeight(12),
+ Width = Application.GetMinRealAverage(200-24),
+ Height =Application.GetMinRealAverage(200-24),
+ X = Application.GetMinRealAverage(12),
+ Y = Application.GetMinRealAverage(12),
BackgroundColor = 0xFFFEF1ED,
- Radius = (uint)Application.GetMinRealAverage(86),
- X = Application.GetRealWidth(12),
+ Radius = (uint)Application.GetMinRealAverage(88),
};
- blancolor.AddChidren(color);
+ blancolorFl.AddChidren(colorBtn);
var btnicon = new Button
{
- X = Application.GetRealWidth(48),
- Width = Application.GetRealWidth(80),
- Height = Application.GetRealHeight(80),
- Y = Application.GetRealHeight(48),
+ X = Application.GetMinRealAverage(58),
+ Y = Application.GetMinRealAverage(58),
+ Width = Application.GetMinRealAverage(84),
+ Height = Application.GetMinRealAverage(84),
UnSelectedImagePath = "ZigeeLogic/delay.png",
};
- color.AddChidren(btnicon);
+ blancolorFl.AddChidren(btnicon);
var titleText = new Button
{
- Width = Application.GetMinRealAverage(580),
- Height = Application.GetMinRealAverage(60),
+ Width = Application.GetRealWidth(580),
+ Height = Application.GetRealHeight(60),
X = Application.GetRealWidth(250),
- Y = blancolor.Bottom + Application.GetRealHeight(50),
+ Y = blancolorFl.Bottom + Application.GetRealHeight(50),
TextID = MyInternationalizationString.createtimetext,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
TextSize = 15,
@@ -91,12 +91,14 @@
{
Y = Application.GetRealHeight(50),
Height = Application.GetRealHeight(600),
+ //Width=Application.GetRealWidth(1080-400),
+ //X=Application.GetRealWidth(200),
};
PickerViewfra.AddChidren(mUIPickerView);
var mList1 = new List<string>();
var mList2 = new List<string>();
- for (int i = 0; i < 61; i++)
+ for (int i = 0; i < 60; i++)
{
if (i < 10)
{
@@ -111,7 +113,8 @@
}
}
- mUIPickerView.setNPicker(mList1, mList2, new List<string>());
+
+ mUIPickerView.setNPicker(mList1, mList2,null);
///榛樿鐘舵��
mUIPickerView.setCurrentItems(0, 5, 0);
int timevalue = 5;
@@ -146,6 +149,9 @@
};
+
+
+
var btnsave = new Button
{
Y = PickerViewfra.Height - Application.GetRealHeight(260),
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
index 93a3a2a..eb8dd95 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
@@ -15,7 +15,12 @@
{
Tag = "Logic";
}
- public void Show ()
+ /// <summary>
+ /// 娣诲姞鐩爣鍔熻兘绫�
+ /// </summary>
+ /// <param name="str1">璁惧鐣岄潰璇嗗埆瀛楃涓�</param>
+ /// <param name="str2">鍦烘櫙鐣岄潰璇嗗埆瀛楃涓�</param>
+ public void Show (string str1,string str2)
{
#region 鏈�涓婇潰鐨勫竷灞�浠g爜
@@ -46,7 +51,7 @@
var roomAndDeviceView = new RoomAndDeviceView();
UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
UserView.HomePage.Instance.PageIndex += 1;
- roomAndDeviceView.IfType = LogicView.IfString.Action_Logic;
+ roomAndDeviceView.IfType = str1;
roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addaction));
};
@@ -63,7 +68,7 @@
var addScenePage = new AddScenePage();
UserView.HomePage.Instance.AddChidren(addScenePage);
UserView.HomePage.Instance.PageIndex += 1;
- addScenePage.Show(LogicView.IfString.Action_LogicScene);
+ addScenePage.Show(str2);
};
#endregion
@@ -72,7 +77,16 @@
securityview.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
securityview.funnameBtn.TextID = MyInternationalizationString.securitymode;
securityview.funFrameLayout.Y = sceneview.funFrameLayout.Bottom;
- middle.AddChidren(securityview.FunFrameView());
+ if (str1 == LogicView.IfString.Action_Logic)
+ { ///鑱斿姩浜嬩欢杈撳嚭-涓嶆敮鎸佸畨闃叉ā寮�
+ ///鑷姩鍖栬緭鍑�-鏀寔瀹夐槻妯″紡
+ middle.AddChidren(securityview.FunFrameView());
+ }
+ else
+ {
+ ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
+ sceneview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+ }
securityview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
var securityMode = new SecurityMode();
@@ -89,8 +103,14 @@
delayedview.iconBtn.UnSelectedImagePath = "ZigeeLogic/delay.png";
delayedview.funnameBtn.TextID = MyInternationalizationString.delayed;
delayedview.funFrameLayout.Y = securityview.funFrameLayout.Bottom;
- delayedview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
- middle.AddChidren(delayedview.FunFrameView());
+ delayedview.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ delayedview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
+ if (str1 == LogicView.IfString.Action_Logic)
+ {
+ ///鑱斿姩浜嬩欢杈撳嚭-涓嶆敮鎸佸欢鏃�
+ ///鑷姩鍖栬緭鍑�-鏀寔寤舵椂
+ middle.AddChidren(delayedview.FunFrameView());
+ }
delayedview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
var delayTime = new DelayTime();
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
deleted file mode 100755
index fec52b8..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-锘縰sing System;
-using Shared;
-using Shared.Common;
-using Shared.R;
-
-namespace Shared.Phone.Device.Logic.DoorLockLogic
-{
- public class AddAction : FrameLayout
- {
-
- public AddAction()
- {
- Tag = "Logic";
- }
- public void Show()
- {
- #region 涓婇潰鐨勫竷灞�浠g爜
- TopView view = new TopView();
- this.AddChidren(view.TopRowView());
- view.toptitleNameBtn.TextID = MyInternationalizationString.addaction;
- view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
- #endregion
-
- var middle = new FrameLayout
- {
- Y =view.topRowLayout.Bottom,
- Height = Application.GetRealHeight(1920 - 184),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- this.AddChidren(middle);
-
- #region ----- 璁惧------
-
- FunView deviceview = new FunView();
- deviceview.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
- deviceview.funnameBtn.TextID = MyInternationalizationString.device;
- middle.AddChidren(deviceview.FunFrameView());
- deviceview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
- {
- var roomAndDeviceView = new RoomAndDeviceView();
- UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
- UserView.HomePage.Instance.PageIndex += 1;
- roomAndDeviceView.IfType = LogicView.IfString.Action_LockAction;
- roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addaction));
- };
-
- #endregion
-
- #region ----- 鍦烘櫙------
- FunView sceneview = new FunView();
- sceneview.iconBtn.UnSelectedImagePath = "ZigeeLogic/scene.png";
- sceneview.funnameBtn.TextID = MyInternationalizationString.scene;
- sceneview.funFrameLayout.Y = deviceview.funFrameLayout.Bottom;
- middle.AddChidren(sceneview.FunFrameView());
- sceneview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
- {
- var addScenePage = new AddScenePage();
- UserView.HomePage.Instance.AddChidren(addScenePage);
- UserView.HomePage.Instance.PageIndex += 1;
- addScenePage.Show(LogicView.IfString.Action_LockScene);
- };
- #endregion
-
- }
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
index 03a8f3f..2a2bfc8 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -22,6 +22,7 @@
{
#region 鏈�涓婇潰鐨勫竷灞�浠g爜
+ UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦
TopView view = new TopView();
this.AddChidren(view.TopRowView());
if (Common.Logic.CurrentLogic.LogicId != 0)
@@ -34,6 +35,7 @@
}
view.clickBtn.MouseDownEventHandler += (sender, e) =>
{
+ //UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦
action();
RemoveFromParent();
};
@@ -127,6 +129,9 @@
{
SelectedDeviceView selecteddevice = new SelectedDeviceView();
selecteddevice.Show(middle);
+ selecteddevice.stateRow.AddRightView(selecteddevice.edit);
+ selecteddevice.stateRow.AddRightView(selecteddevice.del);
+
var Type = int.Parse(ListConditions[i]["Type"]);
var conditions = ListConditions[i];
switch (Type)
@@ -201,10 +206,7 @@
addactionview.clickBtn.MouseUpEventHandler += (sender, e) =>
{
Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
- var addAction = new AddAction();
- UserView.HomePage.Instance.AddChidren(addAction);
- UserView.HomePage.Instance.PageIndex += 1;
- addAction.Show();
+ Method.View(LogicView.IfString.Action_LockAction, LogicView.IfString.Action_LockScene);
};
List<Dictionary<string, object>> ListActions = new List<Dictionary<string, object>>();
@@ -218,15 +220,12 @@
{
LogicView.AddDeviceView addflview = new LogicView.AddDeviceView();
- addflview.titleBtn.TextID = MyInternationalizationString.selectunlockingmode;
+ addflview.titleBtn.TextID = MyInternationalizationString.addaction;
middle.AddChidren(addflview.AddFl());
addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
{
Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
- var addAction = new AddAction();
- UserView.HomePage.Instance.AddChidren(addAction);
- UserView.HomePage.Instance.PageIndex += 1;
- addAction.Show();
+ Method.View(LogicView.IfString.Action_LockAction, LogicView.IfString.Action_LockScene);
};
}
else
@@ -241,7 +240,9 @@
string state = "";
switch (linkType)
{
+
case 0:
+ case 8:
{
var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
@@ -489,6 +490,20 @@
}
}
break;
+ case DeviceType.DoorLock:
+ {
+ //闂ㄩ攣鐗规畩
+ icon = "ZigeeLogic/doorlock.png";
+ if (actions["PassData"].ToString() == "055704010112")
+ {
+ state = Language.StringByID(MyInternationalizationString.logicopen);
+ }
+ else
+ {
+ state = Language.StringByID(MyInternationalizationString.logicclose);
+ }
+ }
+ break;
}
@@ -497,6 +512,7 @@
break;
case 2:
{
+ actiondevice.edit.Visible = false;//闅愯棌缂栬緫鎸夐挳(鍦烘櫙涓嶉渶瑕佺紪杈�)
//鍦ㄦ湰鍦版煡鎵捐鍦烘櫙;
var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString()));
//鏈湴娌℃湁瀛樺湪;
@@ -531,7 +547,11 @@
}
break;
}
-
+ if (linkType != 2)
+ {
+ actiondevice.stateRow.AddRightView(actiondevice.edit);
+ }
+ actiondevice.stateRow.AddRightView(actiondevice.del);
//鐘舵��
actiondevice.deviceNameBtn.Visible = true;
actiondevice.deviceNameBtn.Text = name;
@@ -544,6 +564,7 @@
switch (linkType)
{
case 0:
+ case 8:
{
var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
index 642f04f..bcc6ffa 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -156,6 +156,7 @@
Height = Application.GetRealHeight(190),
LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+ SubViewWidth = Application.GetRealWidth(184),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
};
middle.AddChidren(logicRowlayout);
@@ -176,8 +177,8 @@
var logicswitchBtn = new Button
{
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(63),
+ Width = Application.GetRealWidth(104),
+ Height = Application.GetRealHeight(63),
UnSelectedImagePath = "ZigeeLogic/logicclose.png",
SelectedImagePath = "ZigeeLogic/logicopen.png",
X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs
index 871ad42..c4ab55c 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs
@@ -110,8 +110,8 @@
Text = k.ToString().Length == 1 ? "0" + k.ToString() : k.ToString(),
Y = Application.GetRealHeight(40),
- Height = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(100),
+ Height = Application.GetMinRealAverage(100),
+ Width = Application.GetMinRealAverage(100),
X = Application.GetRealWidth(35 * j) + Application.GetRealWidth(100 * (j - 1)),
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs b/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs
index 4e11f1f..1dcfe21 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs
@@ -33,76 +33,51 @@
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
this.AddChidren(middle);
+ LogicView.SaveView saveView = new LogicView.SaveView();
+ saveView.frameLayout.Y = middle.Bottom;
+ this.AddChidren(saveView.Show());
+
int selectetimedvalue = 0;
var timestrlist = new List<string> { "2", "5", "10", "20", "30", Language.StringByID(MyInternationalizationString.logiccustom) };
- foreach (var intvalue in timestrlist)
+ foreach (var intValue in timestrlist)
{
- var timeframelayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(timeframelayout);
-
- var timeniconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- UnSelectedImagePath = "ZigeeLogic/point.png",
-
- };
- timeframelayout.AddChidren(timeniconBtn);
-
- var timeRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- timeframelayout.AddChidren(timeRow);
-
- var timeBtn = new Button
- {
- Text = intvalue.ToString() + Language.StringByID(MyInternationalizationString.Minute),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- Tag = intvalue,
- TextSize = 14,
- };
- timeRow.AddChidren(timeBtn);
+ FunView monView = new FunView();
+ monView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+ monView.funnameBtn.Text = intValue + Language.StringByID(MyInternationalizationString.Minute);
+ monView.funnameBtn.Tag = intValue;
+ monView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ monView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ monView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ monView.funnextBtn.Visible = false;
+ middle.AddChidren(monView.FunFrameView());
- var selected = new SelectedButton(789);
- timeRow.AddChidren(selected);
//鍒ゆ柇涓�涓瓧绗︽槸瀛楃涓茶繕鏄暟瀛�
- if (intvalue.Length < 3)
+ if (intValue.Length < 3)
{
- if (timevalue== int.Parse(intvalue) * 60)
+ if (timevalue == int.Parse(intValue) * 60)
{
selectedIcon.Visible = false;
- selectedIcon = selected;
- selected.Visible = true;
+ selectedIcon = monView.funnextBtn;
+ monView.funnextBtn.Visible = true;
}
}
else
{
- timeRow.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+ monView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ monView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
}
- EventHandler<MouseEventArgs> timeclick = (sender, e) =>
+ monView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
{
selectedIcon.Visible = false;
- selectedIcon = selected;
- selected.Visible = true;
- if (Language.StringByID(MyInternationalizationString.logiccustom) == timeBtn.Tag.ToString())
+ selectedIcon = monView.funnextBtn;
+ monView.funnextBtn.Visible = true;
+ if (Language.StringByID(MyInternationalizationString.logiccustom) == monView.funnameBtn.Tag.ToString())
{
var secondList = new List<string>();
var minuteList = new List<string>();
- for (int i = 0; i < 61; i++)
+ for (int i = 0; i < 60; i++)
{
if (i < 10)
{
@@ -129,51 +104,27 @@
selectIndex1 = timevalue / 60;
selectIndex2 = timevalue % 60;
}
- PickerView.ShowNormal(minuteList, secondList, new List<string>(), (Index1, Index2, Index3) =>
+ PickerView.ShowNormal(minuteList, secondList, null, (Index1, Index2, Index3) =>
{
selectetimedvalue = int.Parse(minuteList[Index1].Split(' ')[0]) * 60 + int.Parse(secondList[Index2].Split(' ')[0]);
- timemethod(common, selectetimedvalue, timevalue, edit);
+ TimeMethod(common, selectetimedvalue, timevalue, edit);
}, selectIndex1, selectIndex2, 0, Language.StringByID(MyInternationalizationString.logiccustom));
}
else
{
- selectetimedvalue = int.Parse(timeBtn.Tag.ToString()) * 60;
+ selectetimedvalue = int.Parse(monView.funnameBtn.Tag.ToString()) * 60;
}
};
- timeframelayout.MouseUpEventHandler += timeclick;
- timeniconBtn.MouseUpEventHandler += timeclick;
- timeRow.MouseUpEventHandler += timeclick;
- timeBtn.MouseUpEventHandler += timeclick;
- selected.MouseUpEventHandler += timeclick;
+
}
- var saveFrameLayout = new FrameLayout
+ saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- Y = middle.Bottom,
- Height = Application.GetRealHeight(260),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- this.AddChidren(saveFrameLayout);
-
- var btnsave = new Button
- {
- X = Application.GetRealWidth(85),
- Height = Application.GetRealHeight(130),//194
- Width = Application.GetRealWidth(910),
- Radius = (uint)Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
- TextID = MyInternationalizationString.Save,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize = 16,
- };
- saveFrameLayout.AddChidren(btnsave);
- btnsave.MouseUpEventHandler += (sender, e) =>
- {
- timemethod(common, selectetimedvalue, timevalue, edit);
+ TimeMethod(common, selectetimedvalue, timevalue, edit);
};
}
- public void timemethod(CommonDevice common, int selectetimedvalue, int timevalue, bool edit)
+ public void TimeMethod(CommonDevice common, int selectetimedvalue, int timevalue, bool edit)
{
var deviceConditionsInfo = new Dictionary<string, string>();
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
index 69a957f..0cd43ec 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -23,6 +23,7 @@
{
#region View甯冨眬浠g爜
+ UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦
TopView view = new TopView();
this.AddChidren(view.TopRowView());
if (Common.Logic.CurrentLogic.LogicId != 0)
@@ -35,6 +36,7 @@
}
view.clickBtn.MouseDownEventHandler += (sender, e) =>
{
+ // UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦
action();
RemoveFromParent();
};
@@ -179,6 +181,9 @@
{
SelectedDeviceView selecteddevice = new SelectedDeviceView();
selecteddevice.Show(middle);
+ selecteddevice.stateRow.AddRightView(selecteddevice.edit);
+ selecteddevice.stateRow.AddRightView(selecteddevice.del);
+
var Type = int.Parse(ListConditions[i]["Type"]);
var conditions = ListConditions[i];
string name = "";
@@ -679,10 +684,7 @@
addactionview.clickBtn.MouseUpEventHandler+= (sender, e) =>
{
Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
- var deviceTarget = new DeviceTarget();
- UserView.HomePage.Instance.AddChidren(deviceTarget);
- UserView.HomePage.Instance.PageIndex += 1;
- deviceTarget.Show();
+ Method.View(IfString.Action_Logic,IfString.Action_LogicScene);
};
List<Dictionary<string, object>> ListActions = new List<Dictionary<string, object>>();
@@ -701,10 +703,7 @@
addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
{
Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
- var deviceTarget = new DeviceTarget();
- UserView.HomePage.Instance.AddChidren(deviceTarget);
- UserView.HomePage.Instance.PageIndex += 1;
- deviceTarget.Show();
+ Method.View(IfString.Action_Logic, IfString.Action_LogicScene);
};
}
else
@@ -721,13 +720,13 @@
switch (linkType)
{
case 0:
+ case 8:
{
var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
name = deviceinof.DeviceEpointName;
actiondevice.regionNameBtn.Visible = true;
Method.RoomNmae(actiondevice.regionNameBtn, deviceinof);
-
switch (deviceinof.Type)
{
case DeviceType.OnOffOutput:
@@ -968,16 +967,28 @@
}
}
break;
-
+ case DeviceType.DoorLock:
+ {
+ //闂ㄩ攣鐗规畩
+ icon = "ZigeeLogic/doorlock.png";
+ if (actions["PassData"].ToString() == "055704010112")
+ {
+ state = Language.StringByID(MyInternationalizationString.logicopen);
+ }
+ else
+ {
+ state = Language.StringByID(MyInternationalizationString.logicclose);
+ }
+ }
+ break;
}
-
}
break;
case 2:
{
- //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙;
- var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString()));
+ //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙;
+ var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString()));
//鏈湴娌℃湁瀛樺湪;
if (sceneinof == null)
{
@@ -1052,7 +1063,7 @@
var seconds = delaytimevalue % 60;
icon = "ZigeeLogic/delay.png";
-
+
if (Minutes != 0)
{
if (seconds == 0)
@@ -1073,6 +1084,13 @@
};
break;
}
+
+ if (linkType != 2)
+ {
+ actiondevice.stateRow.AddRightView(actiondevice.edit);
+ }
+ actiondevice.stateRow.AddRightView(actiondevice.del);
+
if (linkType == 6 || linkType == 7)
{
actiondevice.ordinaryBtn.Visible = true;
@@ -1093,7 +1111,7 @@
{
switch (linkType)
{
-
+ case 8:
case 0:
{
var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
@@ -1119,6 +1137,7 @@
delayTime.Show(int.Parse(actiondevice.edit.Tag.ToString()), true);
}
break;
+
}
};
///鍒犻櫎鎺т欢
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
index 01df463..af09f9e 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
@@ -126,7 +126,7 @@
/// </summary>
/// <param name="common">Common.</param>
/// <param name="actionsInfo">Objecttype.</param>
- public static void AddDeviceactions(ZigBee.Device.CommonDevice common, Dictionary<string, object> actionsInfo)
+ public static void AddDeviceActions(ZigBee.Device.CommonDevice common, Dictionary<string, object> actionsInfo)
{
for (int i = 0; i < Common.Logic.CurrentLogic.Actions.Count; i++)
{
@@ -143,6 +143,27 @@
Common.Logic.CurrentLogic.Actions.Add(actionsInfo);
}
/// <summary>
+ /// 娣诲姞闂ㄩ攣璁惧杈撳嚭鐨勬柟娉�
+ /// </summary>
+ /// <param name="common">Common.</param>
+ /// <param name="actionsInfo">Objecttype.</param>
+ public static void AddDoorLockActions(ZigBee.Device.CommonDevice common, Dictionary<string, object> actionsInfo)
+ {
+ for (int i = 0; i < Common.Logic.CurrentLogic.Actions.Count; i++)
+ {
+ if (Common.Logic.CurrentLogic.Actions[i]["LinkType"].ToString() == "8")
+ {
+ if (Common.Logic.CurrentLogic.Actions[i]["DeviceAddr"].ToString() == common.DeviceAddr && Common.Logic.CurrentLogic.Actions[i]["Epoint"].ToString() == common.DeviceEpoint.ToString())
+ {
+ Common.Logic.CurrentLogic.Actions.RemoveAt(i);
+ Common.Logic.CurrentLogic.Actions.Insert(i, actionsInfo);
+ return;
+ }
+ }
+ }
+ Common.Logic.CurrentLogic.Actions.Add(actionsInfo);
+ }
+ /// <summary>
/// 娣诲姞Scene杈撳嚭鐨勬柟娉�
/// </summary>
/// <param name="Scene">Common.</param>
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs
index b283963..73b019c 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs
@@ -12,9 +12,9 @@
};
public Button lineBtn = new Button
{
- Y = Application.GetRealHeight(155),
+ //Y = Application.GetRealHeight(155),
Width = Application.GetRealWidth(1080-58-58),
- Height = Application.GetRealHeight(5),
+ Height =1,
X = Application.GetRealWidth(58),
BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
@@ -34,8 +34,8 @@
public Button iconBtn = new Button
{
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
+ Width = Application.GetMinRealAverage(58),
+ Height = Application.GetMinRealAverage(58),
UnSelectedImagePath = "ZigeeLogic/add.png",
X = Application.GetRealWidth(1080 - 58-58),
Y = Application.GetRealHeight(30 + 36),
@@ -44,8 +44,8 @@
public Button switchBtn = new Button
{
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(63),
+ Width = Application.GetRealWidth(104),
+ Height = Application.GetRealHeight(63),
UnSelectedImagePath = "ZigeeLogic/logicclose.png",
SelectedImagePath = "ZigeeLogic/logicopen.png",
X = Application.GetRealWidth(1080 - 58 - 104),
@@ -65,6 +65,7 @@
public FrameLayout AddDeviceView()
{
+ lineBtn.Y = frameLayout.Height - 1;
frameLayout.AddChidren(lineBtn);
frameLayout.AddChidren(titleBtn);
frameLayout.AddChidren(iconBtn);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs
index 4a26274..ce135b9 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs
@@ -26,30 +26,33 @@
TextID = MyInternationalizationString.cancel,
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
+ Width = Application.GetRealWidth(150),
X = Application.GetRealWidth(80),
TextAlignment = TextAlignment.CenterLeft,
TextSize = 14,
+
};
public Button Btntitle = new Button
{
//TextID = MyInternationalizationString.type,
TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(420),
+ Width = Application.GetRealWidth(580),
TextAlignment = TextAlignment.Center,
- X = Application.GetRealWidth(280 + 50),
+ X = Application.GetRealWidth(230+20),
TextSize = 16,
+
};
public Button Btncomplete = new Button
{
TextID = MyInternationalizationString.complete,
TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
+ Width = Application.GetRealWidth(150),
TextAlignment = TextAlignment.CenterRight,
- X = Application.GetRealWidth(750+50),
+ X = Application.GetRealWidth(850),
TextSize = 14,
+
};
#endregion
@@ -57,7 +60,7 @@
{
//n澶氬皯琛�
fraView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
- fraView.Height = Application.GetRealHeight(140 + 70 + 160 * n);
+ fraView.Height = Application.GetRealHeight(1+140 + 70 + 160 * n);//1浣滅敤灏辨槸瑕嗙洊搴曡壊
fraView.Y = Application.GetRealHeight(1920 - 140 - 70 - 160 * n);
fraView.AddChidren(titleRow);
fraView.AddChidren(Btncancel);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs
index efced4a..0ac3aeb 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs
@@ -15,8 +15,8 @@
};
public Button iconBtn = new Button
{
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(58),
Y = Application.GetRealHeight(55),
//UnSelectedImagePath = $"ZigeeLogic/{iocn}.png",
@@ -34,17 +34,16 @@
};
public Button funnextBtn = new Button
{
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
+ Width = Application.GetMinRealAverage(58),
+ Height = Application.GetMinRealAverage(58),
UnSelectedImagePath = "ZigeeLogic/next.png",
X = Application.GetRealWidth(789 + 176),
Y = Application.GetRealHeight(30 + 36),
};
public Button lineBtn = new Button
{
- Y = Application.GetRealHeight(155),
Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(5),
+ Height =1,
X = Application.GetRealWidth(176),
BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
@@ -55,10 +54,10 @@
public FrameLayout FunFrameView()
{
-
funFrameLayout.AddChidren(iconBtn);
funFrameLayout.AddChidren(funnameBtn);
funFrameLayout.AddChidren(funnextBtn);
+ lineBtn.Y = funFrameLayout.Height - 1;
funFrameLayout.AddChidren(lineBtn);
funFrameLayout.AddChidren(clickviewBtn);
return funFrameLayout;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedButton.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedButton.cs
deleted file mode 100755
index 8c3bfec..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedButton.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-锘縰sing System;
-using Shared;
-namespace Shared.Phone.Device.Logic
-{
- public class SelectedButton : Button
- {
-
- /// <summary>
- /// 妯潗鏍囦綅缃�
- /// </summary>
- /// <param name="Xwidth"></param>
- public SelectedButton(int Xwidth = 860)
- {
- X = Application.GetRealWidth(Xwidth);
- Width = Application.GetMinRealAverage(60);
- Height = Application.GetMinRealAverage(60);
- UnSelectedImagePath = "ZigeeLogic/selected.png";
- Visible = false;
- Gravity = Gravity.CenterVertical;
- }
- ///// <summary>
- ///// 妯潗鏍囦綅缃�
- ///// </summary>
- ///// <param name="Xwidth"></param>
- //public void SelectedBtnIcon(int Xwidth = 860)
- //{
- // X = Application.GetRealWidth(Xwidth);
- // Width = Application.GetMinRealAverage(60);
- // Height = Application.GetMinRealAverage(60);
- // UnSelectedImagePath = "ZigeeLogic/selected.png";
- // Visible = false;
- // Gravity = Gravity.CenterVertical;
- //}
- //public void BackBtnIcon()
- //{
- // Width = Application.GetRealWidth(30);
- // Height = Application.GetRealHeight(51);
- // X = Application.GetRealWidth(58);
- // Y = Application.GetRealHeight(98);
- // //Gravity = Gravity.CenterVertical;
- // UnSelectedImagePath = "ZigeeLogic/back.png";
- //}
-
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs
index faf0fb9..a35381e 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs
@@ -17,8 +17,8 @@
/// </summary>
public Button iconBtn = new Button
{
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(104),
Y = Application.GetRealHeight(25),
// UnSelectedImagePath = "ZigeeLogic/time.png",
@@ -27,11 +27,12 @@
///
public RowLayout stateRow = new RowLayout
{
- Width = Application.GetRealWidth(800),
+ Width = Application.GetRealWidth(800+58),
Height = Application.GetRealHeight(130),
X = Application.GetRealWidth(222),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
+ LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+ SubViewWidth=Application.GetRealWidth(184),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
+ };
/// <summary>
/// 鏄剧ず鍚嶅瓧(闄よ澶囩被鍨嬪)
/// </summary>
@@ -49,7 +50,7 @@
/// </summary>
public Button deviceNameBtn = new Button
{
- Y = Application.GetRealHeight(20),
+ Y = Application.GetRealHeight(18),
Height = Application.GetRealHeight(50),
Width = Application.GetRealWidth(400),
TextAlignment = TextAlignment.CenterLeft,
@@ -63,7 +64,7 @@
/// </summary>
public Button regionNameBtn = new Button
{
- Y = Application.GetRealHeight(10 + 70),
+ Y = Application.GetRealHeight(6+ 70),
Width = Application.GetRealWidth(400),
TextAlignment = TextAlignment.CenterLeft,
Height = Application.GetRealHeight(50),
@@ -84,8 +85,15 @@
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
TextSize = 14,
};
-
+ public Button lineBtn = new Button
+ {
+ Width = Application.GetRealWidth(800),
+ // Y=Application.GetRealHeight(130-5),
+ Height =1,//Application.GetRealHeight(5),
+ X = Application.GetRealWidth(222),
+ BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ };
/// <summary>
/// 缂栬緫
@@ -109,12 +117,14 @@
middle.AddChidren(selecetdFrameLayout);
selecetdFrameLayout.AddChidren(iconBtn);
selecetdFrameLayout.AddChidren(stateRow);
- stateRow.AddRightView(edit);
- stateRow.AddRightView(del);
+ //stateRow.AddRightView(edit);
+ //stateRow.AddRightView(del);
stateRow.AddChidren(deviceNameBtn);
stateRow.AddChidren(regionNameBtn);
stateRow.AddChidren(ordinaryBtn);
stateRow.AddChidren(selecetddevicestateBtn);
+ lineBtn.Y = selecetdFrameLayout.Height - 1;
+ selecetdFrameLayout.AddChidren(lineBtn);
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs
index d90b0fe..49164d9 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs
@@ -48,9 +48,9 @@
public Button lineBtn = new Button
{
- Y = Application.GetRealHeight(155),
+ // Y = Application.GetRealHeight(155),
Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(5),
+ Height =1,// Application.GetRealHeight(5),
X = Application.GetRealWidth(58),
BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
@@ -63,6 +63,7 @@
frameLayout.AddChidren(textBtn);
frameLayout.AddChidren(titleBtn);
frameLayout.AddChidren(backBtn);
+ lineBtn.Y = frameLayout.Height - 1;
frameLayout.AddChidren(lineBtn);
frameLayout.AddChidren(clickviewBtn);
return frameLayout;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs
index 2994079..80e6b93 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs
@@ -37,9 +37,9 @@
};
public Button lineBtn = new Button
{
- Y = Application.GetRealHeight(155),
+ //Y = Application.GetRealHeight(155),
Width = Application.GetRealWidth(920),
- Height = Application.GetRealHeight(5),
+ Height = 1, //Application.GetRealHeight(5),
X = Application.GetRealWidth(80),
BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
@@ -51,6 +51,7 @@
{
frameLayout.AddChidren(titleBtn);
frameLayout.AddChidren(selectedIconBtn);
+ lineBtn.Y = frameLayout.Height - 1;
frameLayout.AddChidren(lineBtn);
frameLayout.AddChidren(clickviewBtn);
return frameLayout;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
index db4d658..e0e8a72 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -91,14 +91,13 @@
/// <summary>
/// 鎺掑垪鎵�鏈夎澶囩被鍨嬬殑鍒楄〃
/// </summary>
- /// <param name="type">鍒ゆ柇瀛楃涓�</param>
/// <param name="devicelist">璁惧鍒楄〃</param>
/// <returns></returns>
- public static List<string> GetDeviceTypeList(string type, List<CommonDevice> devicelist)
+ public static List<string> GetDeviceTypeList(List<CommonDevice> devicelist)
{
List<string> devicetypelist = new List<string>();
devicetypelist.Clear();
- var lightjosn = devicelist.Find((device) => device.Type == DeviceType.ColorDimmableLight || device.Type == DeviceType.OnOffOutput);
+ var lightjosn = devicelist.Find((device) => device.Type == DeviceType.DimmableLight || device.Type == DeviceType.OnOffOutput);
if (lightjosn != null)
{
devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
@@ -326,12 +325,16 @@
}
break;
case "action_logic":
- { //鑷姩鍖栨敮鎸佺殑鐩爣璁惧
+ {
+
+ //鑷姩鍖栨敮鎸佺殑鐩爣璁惧
deviceTypeList.Add(DeviceType.OnOffOutput);
deviceTypeList.Add(DeviceType.DimmableLight);
deviceTypeList.Add(DeviceType.WindowCoveringDevice);
deviceTypeList.Add(DeviceType.Thermostat);
deviceTypeList.Add(DeviceType.AirSwitch);
+ ///闂ㄩ攣鐗规畩
+ deviceTypeList.Add(DeviceType.DoorLock);
}
break;
case "condition_mould":
@@ -352,6 +355,8 @@
deviceTypeList.Add(DeviceType.WindowCoveringDevice);
deviceTypeList.Add(DeviceType.Thermostat);
deviceTypeList.Add(DeviceType.AirSwitch);
+ ///闂ㄩ攣鐗规畩
+ deviceTypeList.Add(DeviceType.DoorLock);
}
break;
@@ -769,6 +774,17 @@
}
}
-
+ /// <summary>
+ /// 璺冲叆杈撳嚭鐩爣鍔熻兘鐣岄潰鐨勬柟娉�
+ /// </summary>
+ /// <param name="str1">璁惧鐣岄潰璇嗗埆瀛楃涓�</param>
+ /// <param name="str2">鍦烘櫙鐣岄潰璇嗗埆瀛楃涓�</param>
+ public static void View(string str1, string str2)
+ {
+ var deviceTarget = new DeviceTarget();
+ UserView.HomePage.Instance.AddChidren(deviceTarget);
+ UserView.HomePage.Instance.PageIndex += 1;
+ deviceTarget.Show(str1, str2);
+ }
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
index 4a21360..c4d535f 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
@@ -59,14 +59,14 @@
public void Show(string Name)
{
#region 涓婇潰鐨勫竷灞�浠g爜
- UserView.HomePage.Instance.ScrollEnabled = false;
+ UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦
this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
TopView view = new TopView();
this.AddChidren(view.TopRowView(true));
- view.toptitleNameBtn.Text = Name;
+ view.toptitleNameBtn.Text = Name;
view.clickBtn.MouseDownEventHandler += (sender, e) =>
{
- UserView.HomePage.Instance.ScrollEnabled = true;
+ UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦
RemoveFromParent();
};
view.foolrnameBtn.Text = Config.Instance.Home.GetCurrentFloorName;
@@ -87,8 +87,9 @@
var roomlists = Method.GetRoomList(IfType, Config.Instance.Home.CurrentFloorId);
if (roomlists.Count == 0)
{
- ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
- return;
+ //杩斿洖娌℃湁鎴块棿闅愯棌涓嬮潰鏁村潡;
+ devicetypehorizontalScrol.Height = 0;
+ middle.Height = 0;
}
/// 璁惧绫诲瀷鍒楄〃
var deviceTypeList = Method.GetDevice(IfType);
@@ -98,110 +99,110 @@
devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft);
middle.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft);
///妤煎眰鐐瑰嚮浜嬩欢
- view.foolrclickBtn.MouseUpEventHandler+= (sender, e) =>
- {
- var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
- this.AddChidren(flMain);
- flMain.MouseUpEventHandler += (sender2, e2) =>
+ view.foolrclickBtn.MouseUpEventHandler += (sender, e) =>
{
- flMain.RemoveFromParent();
- };
- var foolrbjicon = new FrameLayout
- {
-
- Width = Application.GetRealWidth(450),
- Height = Application.GetRealHeight(780),
- X = Application.GetRealWidth(1080 - 468 - 35),
- Y = Application.GetRealHeight(184),
- BackgroundImagePath = "Item/SelectFloor_Right.png",
- };
- flMain.AddChidren(foolrbjicon);
-
- var btnfoolrtext = new Button
- {
- Width = Application.GetRealWidth(450),
- Height = Application.GetRealHeight(150),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- X = Application.GetRealWidth(80),
- TextID = MyInternationalizationString.selecfoolr,
- TextSize = 14,
- };
- foolrbjicon.AddChidren(btnfoolrtext);
-
- var foolrbj = new VerticalScrolViewLayout
- {
-
- Width = Application.GetRealWidth(450),
- Height = foolrbjicon.Height - btnfoolrtext.Height,
- X = Application.GetRealWidth(80),
- Y = btnfoolrtext.Bottom,
- };
- foolrbjicon.AddChidren(foolrbj);
-
- foreach (var foolr in Config.Instance.Home.FloorDics)
- {
- var foolrRowLayout = new RowLayout
+ var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+ this.AddChidren(flMain);
+ flMain.MouseUpEventHandler += (sender2, e2) =>
+ {
+ flMain.RemoveFromParent();
+ };
+ var foolrbjicon = new FrameLayout
{
- Height = Application.GetRealHeight(150),
- LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+
+ Width = Application.GetRealWidth(450),
+ Height = Application.GetRealHeight(780),
+ X = Application.GetRealWidth(1080 - 468 - 35),
+ Y = Application.GetRealHeight(184),
+ BackgroundImagePath = "Item/SelectFloor_Right.png",
};
- foolrbj.AddChidren(foolrRowLayout);
+ flMain.AddChidren(foolrbjicon);
- var btnfoolricon = new Button
+ var btnfoolrtext = new Button
{
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- UnSelectedImagePath = "Floor/Floor.png",
- Gravity = Gravity.CenterVertical,
- };
- foolrRowLayout.AddChidren(btnfoolricon);
-
- var btnfoolrname = new Button
- {
- Width = Application.GetRealWidth(250),
+ Width = Application.GetRealWidth(450),
Height = Application.GetRealHeight(150),
- Text = foolr.Value,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
- Tag = foolr.Key,
- X = btnfoolricon.Right + Application.GetRealWidth(12),
+ TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ X = Application.GetRealWidth(80),
+ TextID = MyInternationalizationString.selecfoolr,
TextSize = 14,
};
- foolrRowLayout.AddChidren(btnfoolrname);
- if (view.foolrnameBtn.Text == foolr.Value)
+ foolrbjicon.AddChidren(btnfoolrtext);
+
+ var foolrbj = new VerticalScrolViewLayout
{
- btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
- btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
+
+ Width = Application.GetRealWidth(450),
+ Height = foolrbjicon.Height - btnfoolrtext.Height,
+ X = Application.GetRealWidth(80),
+ Y = btnfoolrtext.Bottom,
+ };
+ foolrbjicon.AddChidren(foolrbj);
+
+ foreach (var foolr in Config.Instance.Home.FloorDics)
+ {
+ var foolrRowLayout = new RowLayout
+ {
+ Height = Application.GetRealHeight(150),
+ LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ };
+ foolrbj.AddChidren(foolrRowLayout);
+
+ var btnfoolricon = new Button
+ {
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
+ UnSelectedImagePath = "Floor/Floor.png",
+ Gravity = Gravity.CenterVertical,
+ };
+ foolrRowLayout.AddChidren(btnfoolricon);
+
+ var btnfoolrname = new Button
+ {
+ Width = Application.GetRealWidth(250),
+ Height = Application.GetRealHeight(150),
+ Text = foolr.Value,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+ Tag = foolr.Key,
+ X = btnfoolricon.Right + Application.GetRealWidth(12),
+ TextSize = 14,
+ };
+ foolrRowLayout.AddChidren(btnfoolrname);
+ if (view.foolrnameBtn.Text == foolr.Value)
+ {
+ btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
+ btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
+ }
+
+ EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
+ {
+
+ roomhorizontalScrol.RemoveAll();
+ devicetypehorizontalScrol.RemoveAll();
+ middle.RemoveAll();
+ view.foolrnameBtn.Text = btnfoolrname.Text;
+ flMain.RemoveFromParent();
+ var list = Method.GetRoomList(IfType, btnfoolrname.Tag.ToString());
+ if (list.Count == 0)
+ {
+ devicetypehorizontalScrol.Height = 0;
+ middle.Height = 0;
+ }
+ else
+ {
+ devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
+ middle.Height = Application.GetRealHeight(1920 - 40 - 184 - 280 - 200);
+ }
+ AllRoomView(list, deviceTypeList);
+ };
+ foolrRowLayout.MouseUpEventHandler += foolrnameclick;
+ btnfoolrname.MouseUpEventHandler += foolrnameclick;
+
}
- EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
- {
-
- roomhorizontalScrol.RemoveAll();
- devicetypehorizontalScrol.RemoveAll();
- middle.RemoveAll();
- view.foolrnameBtn.Text = btnfoolrname.Text;
- flMain.RemoveFromParent();
- var list = Method.GetRoomList(IfType, btnfoolrname.Tag.ToString());
- if (list.Count == 0)
- {
- devicetypehorizontalScrol.Height= 0;
- middle.Height = 0;
- }
- else
- {
- devicetypehorizontalScrol.Height= Application.GetRealHeight(280);
- middle.Height= Application.GetRealHeight(1920 - 40 - 184 - 280 - 200);
- }
- AllRoomView(list, deviceTypeList);
- };
- foolrRowLayout.MouseUpEventHandler += foolrnameclick;
- btnfoolrname.MouseUpEventHandler += foolrnameclick;
-
- }
-
- };
+ };
AllRoomView(roomlists, deviceTypeList);
}
/// <summary>
@@ -286,7 +287,7 @@
/// <param name="devicelist">Devicelist.</param>
void AllDeviceTypeView(List<CommonDevice> devicelist)
{
- var devicetypelist = Method.GetDeviceTypeList(IfType, devicelist);
+ var devicetypelist = Method.GetDeviceTypeList(devicelist);
devicetypehorizontalScrol.RemoveAll();
for (int i = 0; i < devicetypelist.Count; i++)
{
@@ -323,8 +324,8 @@
var devicetypeicon = new Button
{
- Width = Application.GetRealWidth(84),
- Height = Application.GetRealHeight(84),
+ Width = Application.GetMinRealAverage(84),
+ Height = Application.GetMinRealAverage(84),
X = Application.GetRealWidth(46),
Y = Application.GetRealHeight(30),
UnSelectedImagePath =Method.GetDeviceTypeIcon(devicetype),
@@ -389,18 +390,18 @@
middle.AddChidren(deviceFramelayout);
var bjFramelayout = new FrameLayout
{
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealHeight(112),
+ Width = Application.GetMinRealAverage(112),
+ Height = Application.GetMinRealAverage(112),
X = Application.GetRealWidth(58),
Y = Application.GetRealHeight(30 + 9),
- // Radius = (uint)Application.GetRealHeight(56),
+ Radius = (uint)Application.GetMinRealAverage(56),
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
deviceFramelayout.AddChidren(bjFramelayout);
var deviceIconBtn = new Button
{
- Width = Application.GetRealWidth(82),
- Height = Application.GetRealHeight(82),
+ Width = Application.GetMinRealAverage(82),
+ Height = Application.GetMinRealAverage(82),
Gravity = Gravity.Center,
};
bjFramelayout.AddChidren(deviceIconBtn);
@@ -410,9 +411,9 @@
Y = Application.GetRealHeight(30),
Width = Application.GetRealWidth(850),
Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176 + 10),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
+ X = Application.GetRealWidth(176 + 25),
+ //LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
};
deviceFramelayout.AddChidren(deviceRow);
var devicename = new Button
@@ -424,6 +425,16 @@
TextSize = 14,
};
deviceRow.AddChidren(devicename);
+
+ var lineBtn = new Button
+ {
+ Y = deviceFramelayout.Height-1,
+ Height = 1,
+ Width = Application.GetRealWidth(850),
+ X = Application.GetRealWidth(176 + 25),
+ BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ };
+ deviceFramelayout.AddChidren(lineBtn);
EventHandler<MouseEventArgs> devicclick = (sen, e) =>
{
clickbutton.IsSelected = false;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
index 543c435..c90e508 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
@@ -34,268 +34,116 @@
middle.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
this.AddChidren(middle);
- var btnsave = new Button
- {
- Y= middle.Height-Application.GetRealHeight(260),
- X = Application.GetRealWidth(85),
- Height = Application.GetRealHeight(130),
- Width = Application.GetRealWidth(910),
- Radius = (uint)Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
- TextID = MyInternationalizationString.Save,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize=16,
-
- };
- middle.AddChidren(btnsave);
-
+ LogicView.SaveView saveView = new LogicView.SaveView();
+ saveView.frameLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+ saveView.frameLayout.Y = middle.Height - Application.GetRealHeight(260);
+ middle.AddChidren(saveView.Show());
#region ----(鍦ㄥ/绂诲)甯冮槻 鎾ら槻 鑳佽揩鎾ら槻----
#region 鍦ㄥ甯冮槻
+ FunView athomeView = new FunView();
+ athomeView.iconBtn.UnSelectedImagePath = "ZigeeLogic/athome.png";
+ athomeView.funnameBtn.TextID = MyInternationalizationString.logicathomegarrison;
+ athomeView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ athomeView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ athomeView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ athomeView.funnextBtn.Visible = false;
+ middle.AddChidren(athomeView.FunFrameView());
- var athomeFrameLayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(athomeFrameLayout);
- var athomeiconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- UnSelectedImagePath = "ZigeeLogic/athome.png",
- };
- athomeFrameLayout.AddChidren(athomeiconBtn);
-
- var athomedefenceRowLayout = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- athomeFrameLayout.AddChidren(athomedefenceRowLayout);
-
- var btnathomedefence = new Button
- {
- Text = Language.StringByID(MyInternationalizationString.logicathomegarrison),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
-
- };
- athomedefenceRowLayout.AddChidren(btnathomedefence);
- var athomedefenceSelected = new SelectedButton(789);
- athomedefenceRowLayout.AddChidren(athomedefenceSelected);
#endregion
#region 绂诲甯冮槻
- var leavehomeFrameLayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = athomeFrameLayout.Bottom,
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(leavehomeFrameLayout);
+ FunView leaveView= new FunView();
+ leaveView.funFrameLayout.Y = athomeView.funFrameLayout.Bottom;
+ leaveView.iconBtn.UnSelectedImagePath = "ZigeeLogic/leavehome.png";
+ leaveView.funnameBtn.TextID = MyInternationalizationString.logicremovehomegarrison;
+ leaveView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ leaveView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ leaveView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ leaveView.funnextBtn.Visible = false;
+ middle.AddChidren(leaveView.FunFrameView());
- var leavehomeiconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- UnSelectedImagePath = "ZigeeLogic/leavehome.png",
-
- };
- leavehomeFrameLayout.AddChidren(leavehomeiconBtn);
-
-
- var leavehomedefenceRowLayout = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- leavehomeFrameLayout.AddChidren(leavehomedefenceRowLayout);
-
- var leavehomebtndefence = new Button
- {
- Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
-
- };
- leavehomedefenceRowLayout.AddChidren(leavehomebtndefence);
- var leavehomedefenceSelected = new SelectedButton(789);
- leavehomedefenceRowLayout.AddChidren(leavehomedefenceSelected);
#endregion
#region 鎾ら槻
-
- var withdrawalFrameLayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = leavehomeFrameLayout.Bottom,
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(withdrawalFrameLayout);
-
-
- var withdrawaliconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- UnSelectedImagePath = "ZigeeLogic/withdrawal.png",
-
- };
- withdrawalFrameLayout.AddChidren(withdrawaliconBtn);
-
-
-
- var withdrawalRowLayout = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- withdrawalFrameLayout.AddChidren(withdrawalRowLayout);
-
- var btnwithdrawal = new Button
- {
-
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextID = MyInternationalizationString.withdrawal,
- TextSize = 15,
-
- };
- withdrawalRowLayout.AddChidren(btnwithdrawal);
- var withdrawalSelected = new SelectedButton(789);
- withdrawalRowLayout.AddChidren(withdrawalSelected);
+ FunView withdrawalView= new FunView();
+ withdrawalView.funFrameLayout.Y = leaveView.funFrameLayout.Bottom;
+ withdrawalView.iconBtn.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
+ withdrawalView.funnameBtn.TextID = MyInternationalizationString.withdrawal;
+ withdrawalView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ withdrawalView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ withdrawalView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ withdrawalView.funnextBtn.Visible = false;
+ middle.AddChidren(withdrawalView.FunFrameView());
#endregion
#region 鑳佽揩鎾ら槻
- var urgentwithdFrameLayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = withdrawalFrameLayout.Bottom,
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(urgentwithdFrameLayout);
-
- var urgentwithdiconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- UnSelectedImagePath = "ZigeeLogic/withdrawal.png",
-
- };
- urgentwithdFrameLayout.AddChidren(urgentwithdiconBtn);
-
- var urgentwithdrawalRowLayout = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- urgentwithdFrameLayout.AddChidren(urgentwithdrawalRowLayout);
-
- var btnurgentwithdrawal = new Button
- {
- TextID = MyInternationalizationString.urgentwithdrawal,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
- };
- urgentwithdrawalRowLayout.AddChidren(btnurgentwithdrawal);
-
- var urgentwithdrawalSelected = new SelectedButton(789);
- urgentwithdrawalRowLayout.AddChidren(urgentwithdrawalSelected);
+ FunView urgentwithdView = new FunView();
+ urgentwithdView.funFrameLayout.Y = withdrawalView.funFrameLayout.Bottom;
+ urgentwithdView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ urgentwithdView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
+ urgentwithdView.iconBtn.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
+ urgentwithdView.funnameBtn.TextID = MyInternationalizationString.urgentwithdrawal;
+ urgentwithdView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ urgentwithdView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ urgentwithdView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ urgentwithdView.funnextBtn.Visible = false;
+ middle.AddChidren(urgentwithdView.FunFrameView());
#endregion
#endregion
///鍦ㄥ甯冮槻鐐瑰嚮浜嬩欢
- EventHandler<MouseEventArgs> athomeclick = (sedner14, e14) =>
+ athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- athomedefenceSelected.Visible = true;
- leavehomedefenceSelected.Visible = false;
- withdrawalSelected.Visible = false;
- urgentwithdrawalSelected.Visible = false;
+ athomeView.funnextBtn.Visible = true;
+ leaveView.funnextBtn.Visible = false;
+ withdrawalView.funnextBtn.Visible = false;
+ urgentwithdView.funnextBtn.Visible = false;
};
- athomedefenceRowLayout.MouseUpEventHandler += athomeclick;
- btnathomedefence.MouseUpEventHandler += athomeclick;
- athomedefenceSelected.MouseUpEventHandler += athomeclick;
- athomeFrameLayout.MouseUpEventHandler += athomeclick;
- athomeiconBtn.MouseUpEventHandler += athomeclick;
+
///绂诲甯冮槻鐐瑰嚮浜嬩欢
- EventHandler<MouseEventArgs> leavehomeclick = (sedner14, e14) =>
+ leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- athomedefenceSelected.Visible = false;
- leavehomedefenceSelected.Visible = true;
- withdrawalSelected.Visible = false;
- urgentwithdrawalSelected.Visible = false;
+ athomeView.funnextBtn.Visible = false;
+ leaveView.funnextBtn.Visible = true;
+ withdrawalView.funnextBtn.Visible = false;
+ urgentwithdView.funnextBtn.Visible = false;
};
- leavehomedefenceRowLayout.MouseUpEventHandler += leavehomeclick;
- leavehomebtndefence.MouseUpEventHandler += leavehomeclick;
- leavehomedefenceSelected.MouseUpEventHandler += leavehomeclick;
- leavehomeFrameLayout.MouseUpEventHandler += leavehomeclick;
- leavehomeiconBtn.MouseUpEventHandler += leavehomeclick;
+
///鎾ら槻鐐瑰嚮浜嬩欢
- EventHandler<MouseEventArgs> disableclick = (seder, e) =>
+ withdrawalView.clickviewBtn.MouseUpEventHandler+= (seder, e) =>
{
- athomedefenceSelected.Visible = false;
- leavehomedefenceSelected.Visible = false;
- withdrawalSelected.Visible = true;
- urgentwithdrawalSelected.Visible = false;
+ athomeView.funnextBtn.Visible = false;
+ leaveView.funnextBtn.Visible = false;
+ withdrawalView.funnextBtn.Visible = true;
+ urgentwithdView.funnextBtn.Visible = false;
};
- withdrawalRowLayout.MouseUpEventHandler += disableclick;
- btnwithdrawal.MouseUpEventHandler += disableclick;
- withdrawalSelected.MouseUpEventHandler += disableclick;
- withdrawalFrameLayout.MouseUpEventHandler += disableclick;
- withdrawaliconBtn.MouseUpEventHandler += disableclick;
+
///鑳佽揩鎾ら槻鐐瑰嚮浜嬩欢
- EventHandler<MouseEventArgs> urgentwithdrawalclick = (seder, e) =>
+ urgentwithdView.clickviewBtn.MouseUpEventHandler += (seder, e) =>
{
- athomedefenceSelected.Visible = false;
- leavehomedefenceSelected.Visible = false;
- withdrawalSelected.Visible = false;
- urgentwithdrawalSelected.Visible = true;
+ athomeView.funnextBtn.Visible = false;
+ leaveView.funnextBtn.Visible = false;
+ withdrawalView.funnextBtn.Visible = false;
+ urgentwithdView.funnextBtn.Visible = true;
};
- urgentwithdrawalRowLayout.MouseUpEventHandler += urgentwithdrawalclick;
- btnurgentwithdrawal.MouseUpEventHandler += urgentwithdrawalclick;
- urgentwithdrawalSelected.MouseUpEventHandler+= urgentwithdrawalclick;
- urgentwithdFrameLayout.MouseUpEventHandler += urgentwithdrawalclick;
- urgentwithdiconBtn.MouseUpEventHandler += urgentwithdrawalclick;
+
if (IsDeviceEditor)
{
@@ -308,17 +156,17 @@
{
if (actions["Password"].ToString() == "888888")
{
- athomedefenceSelected.Visible = false;
- leavehomedefenceSelected.Visible = false;
- withdrawalSelected.Visible = false;
- urgentwithdrawalSelected.Visible = true;
+ athomeView.funnextBtn.Visible = false;
+ leaveView.funnextBtn.Visible = false;
+ withdrawalView.funnextBtn.Visible = false;
+ urgentwithdView.funnextBtn.Visible = true;
}
else
{
- athomedefenceSelected.Visible = false;
- leavehomedefenceSelected.Visible = false;
- withdrawalSelected.Visible = true;
- urgentwithdrawalSelected.Visible = false;
+ athomeView.funnextBtn.Visible = false;
+ leaveView.funnextBtn.Visible = false;
+ withdrawalView.funnextBtn.Visible = true;
+ urgentwithdView.funnextBtn.Visible = false;
}
}
@@ -327,17 +175,17 @@
if (actions["SecurityModeId"].ToString() == "1")
{
- athomedefenceSelected.Visible = true;
- leavehomedefenceSelected.Visible = false;
- withdrawalSelected.Visible = false;
- urgentwithdrawalSelected.Visible = false;
+ athomeView.funnextBtn.Visible = true;
+ leaveView.funnextBtn.Visible = false;
+ withdrawalView.funnextBtn.Visible = false;
+ urgentwithdView.funnextBtn.Visible = false;
}
else
{
- athomedefenceSelected.Visible = false;
- leavehomedefenceSelected.Visible = true;
- withdrawalSelected.Visible = false;
- urgentwithdrawalSelected.Visible = false;
+ athomeView.funnextBtn.Visible = false;
+ leaveView.funnextBtn.Visible = true;
+ withdrawalView.funnextBtn.Visible = false;
+ urgentwithdView.funnextBtn.Visible = false;
}
}
@@ -348,13 +196,12 @@
}
}
-
- btnsave.MouseUpEventHandler += (sender, e) =>
+ saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- if (!athomedefenceSelected.Visible && !leavehomedefenceSelected.Visible && !withdrawalSelected.Visible && !urgentwithdrawalSelected.Visible)
+ if (!athomeView.funnextBtn.Visible && !leaveView.funnextBtn.Visible && !withdrawalView.funnextBtn.Visible && !urgentwithdView.funnextBtn.Visible)
{
-
+
var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
Language.StringByID(MyInternationalizationString.securitytip),
Language.StringByID(MyInternationalizationString.confrim));
@@ -378,7 +225,7 @@
actionsInfo.Add("LinkType", 6);
actionsInfo.Add("CheckIASStatus", 0);
actionsInfo.Add("IsDelayStart", 0);
-
+
if (actionsInfo.ContainsKey("Password"))
{
actionsInfo.Remove("Password");
@@ -392,7 +239,7 @@
actionsInfo.Remove("SecurityModeId");
}
///鍦ㄥ甯冮槻
- if (athomedefenceSelected.Visible)
+ if (athomeView.funnextBtn.Visible)
{
actionsInfo.Add("SecuritySetting", "1");
actionsInfo.Add("SecurityModeId", "1");
@@ -400,7 +247,7 @@
}
///绂诲甯冮槻
- if (leavehomedefenceSelected.Visible)
+ if (leaveView.funnextBtn.Visible)
{
actionsInfo.Add("SecuritySetting", "1");
actionsInfo.Add("SecurityModeId", "2");
@@ -408,7 +255,7 @@
}
///鎾ら槻
- if (withdrawalSelected.Visible)
+ if (withdrawalView.funnextBtn.Visible)
{
actionsInfo.Add("SecuritySetting", "0");
actionsInfo.Add("SecurityModeId", "0");
@@ -416,7 +263,7 @@
}
///绱ц揩鎾ら槻
- if (urgentwithdrawalSelected.Visible)
+ if (urgentwithdView.funnextBtn.Visible)
{
actionsInfo.Add("SecuritySetting", "0");
actionsInfo.Add("SecurityModeId", "0");
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
index c2fa1b9..dbca6ba 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -462,6 +462,16 @@
};
actions.Add(timeInfo);
break;
+ case 8:
+ var lockInfo = new JObject
+ {
+ ["LinkType"] = int.Parse(dictionary["LinkType"].ToString()),
+ ["DeviceAddr"] = dictionary["DeviceAddr"].ToString(),
+ ["Epoint"] = int.Parse(dictionary["Epoint"].ToString()),
+ ["PassData"] =dictionary["PassData"].ToString(),
+ };
+ actions.Add(lockInfo);
+ break;
}
}
var accounts = new JArray();
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
index 33feefe..d781ff4 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
@@ -26,6 +26,7 @@
{
#region 鏈�涓婇潰鐨勫竷灞�浠g爜
+ UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦
TopView view = new TopView();
this.AddChidren(view.TopRowView());
if (Common.Logic.CurrentLogic.LogicId != 0)
@@ -38,7 +39,7 @@
}
view.clickBtn.MouseDownEventHandler += (sender, e) =>
{
-
+ //UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦
RemoveFromParent();
};
#endregion
@@ -202,6 +203,8 @@
{
SelectedDeviceView selecteddevice = new SelectedDeviceView();
selecteddevice.Show(middle);
+ selecteddevice.stateRow.AddRightView(selecteddevice.edit);
+ selecteddevice.stateRow.AddRightView(selecteddevice.del);
var Type = int.Parse(ListConditions[i]["Type"]);
var conditions = ListConditions[i];
switch (Type)
@@ -342,6 +345,8 @@
SelectedDeviceView actiondevice = new SelectedDeviceView();
actiondevice.Show(middle);
+ actiondevice.stateRow.AddRightView(actiondevice.edit);
+ actiondevice.stateRow.AddRightView(actiondevice.del);
var linkType = int.Parse(ListActions[i]["LinkType"].ToString());
var actions = ListActions[i];
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
index ef3652f..ae014e0 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
@@ -50,7 +50,9 @@
TypeView typeView = new TypeView();
middle.AddChidren(typeView.Show());
typeView.textBtn.TextID = MyInternationalizationString.type;
+ typeView.titleBtn.Width = Application.GetRealWidth(630+70);
typeView.titleBtn.TextID = MyInternationalizationString.timeframe;
+ typeView.backBtn.Visible = false;
#endregion
@@ -67,7 +69,9 @@
TypeView endView = new TypeView();
endView.frameLayout.Y = startView.frameLayout.Bottom;
+ endView.frameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
middle.AddChidren(endView.Show());
+ endView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;//鏀瑰彉鏈�鍚庝竴琛岀嚎棰滆壊;
endView.textBtn.TextID = MyInternationalizationString.endtime;
endView.titleBtn.Tag = "0";
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs
index 8e1134d..6994a1b 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs
@@ -14,13 +14,12 @@
{
Tag = "Logic";
}
-
Dictionary<string, string> timeifon = new Dictionary<string, string>();
- Button beforeClickButton = new Button();
TimeView timeview = new TimeView
{
- Height = Application.GetRealHeight(600),
- BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor,
+
+ Height = Application.GetRealHeight(550),
+ BackgroundColor =0x40ffffff,// ZigbeeColor.Current.LogicTopViewBackgroundColor,
Width = Application.GetRealWidth(1080),
};
/// <summary>
@@ -96,17 +95,20 @@
void SelectedTimeTypeView(FrameLayout middle, int TypeValue)
{
middle.RemoveAll();
- #region -----绔嬪嵆鎵ц 鏃跺埢
+ #region -----绫诲瀷 鏃跺埢
TypeView typeView = new TypeView();
middle.AddChidren(typeView.Show());
typeView.textBtn.TextID = MyInternationalizationString.type;
+ typeView.titleBtn.Width = Application.GetRealWidth(630 + 70);
typeView.titleBtn.TextID = MyInternationalizationString.immediateexecution;
-
- TypeView timeView = new TypeView();
- timeView.frameLayout.Y = typeView.frameLayout.Bottom;
- middle.AddChidren(timeView.Show());
- timeView.textBtn.TextID = MyInternationalizationString.moment;
- timeView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+ typeView.backBtn.Visible = false;
+
+
+ TypeView skView = new TypeView();
+ skView.frameLayout.Y = typeView.frameLayout.Bottom;
+ middle.AddChidren(skView.Show());
+ skView.textBtn.TextID = MyInternationalizationString.moment;
+ skView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
TimeTypeView(middle, TypeValue);
};
@@ -117,13 +119,13 @@
{
case 0:
{
- timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.logiccustom);
+ skView.titleBtn.Text = Language.StringByID(MyInternationalizationString.logiccustom);
textvalue = timeifon["StartHour"] + ":" + timeifon["StartMin"];
}
break;
case 1:
{
- timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.sunrise);
+ skView.titleBtn.Text = Language.StringByID(MyInternationalizationString.sunrise);
if (int.Parse(timeifon["AdjustTime"]) > 0)
{
textvalue = Language.StringByID(MyInternationalizationString.delayed) + timeifon["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
@@ -140,7 +142,7 @@
break;
case 2:
{
- timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.sunset);
+ skView.titleBtn.Text = Language.StringByID(MyInternationalizationString.sunset);
if (int.Parse(timeifon["AdjustTime"]) > 0)
{
textvalue = Language.StringByID(MyInternationalizationString.delayed) + timeifon["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
@@ -157,7 +159,7 @@
break;
case 3:
{
- timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.noon);
+ skView.titleBtn.Text = Language.StringByID(MyInternationalizationString.noon);
if (int.Parse(timeifon["AdjustTime"]) > 0)
{
textvalue = Language.StringByID(MyInternationalizationString.delayed) + timeifon["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
@@ -177,24 +179,13 @@
{
#region -----鑷畾涔夋椂闂�
- typeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
- timeView.backBtn.UnSelectedImagePath = "ZigeeLogic/dropdown.png";
- var linebtn = new Button
+ skView.backBtn.UnSelectedImagePath = "ZigeeLogic/dropdown.png";
+ var rowTimeView = new FrameLayout
{
- Y = timeView.frameLayout.Bottom,
- Height = Application.GetRealHeight(5),
- BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- X = Application.GetRealWidth(58),
- Width = Application.GetRealWidth(965),
- };
- middle.AddChidren(linebtn);
- var rowTimeView = new RowLayout
- {
- Y = linebtn.Bottom,
+ Y = skView.frameLayout.Bottom,
Height = Application.GetRealHeight(600),
};
middle.AddChidren(rowTimeView);
-
rowTimeView.AddChidren(timeview);
#endregion
}
@@ -204,10 +195,12 @@
#region -----鎻愬墠/寤舵椂
TypeView delayView = new TypeView();
- delayView.frameLayout.Y = timeView.frameLayout.Bottom;
+ delayView.frameLayout.Y = skView.frameLayout.Bottom;
+ delayView.frameLayout.Height = Application.GetRealHeight(160+20);//澧為珮鏈�鍚庝竴琛岀殑楂樺害20;
middle.AddChidren(delayView.Show());
delayView.textBtn.TextID = MyInternationalizationString.Advancedelay;
delayView.titleBtn.Text = textvalue;
+ delayView.lineBtn.BackgroundColor = BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
delayView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
var mList = new List<string>();
mList.Add(Language.StringByID(MyInternationalizationString.advance));
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
index 16e8dff..c30fa40 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -32,25 +32,9 @@
};
this.AddChidren(middle);
- var saveFramelayout = new FrameLayout
- {
- Y = middle.Bottom,
- Height = Application.GetRealHeight(260),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- this.AddChidren(saveFramelayout);
- var saveBtn= new Button
- {
- X = Application.GetRealWidth(85),
- Height = Application.GetRealHeight(130),//194
- Width = Application.GetRealWidth(910),
- Radius = (uint)Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
- TextID = MyInternationalizationString.Save,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize = 16,
- };
- saveFramelayout.AddChidren(saveBtn);
+ LogicView.SaveView saveView = new LogicView.SaveView();
+ saveView.frameLayout.Y = middle.Bottom;
+ this.AddChidren(saveView.Show());
if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 5)
{
@@ -113,68 +97,29 @@
foreach (var name in cyclelist)
{
- var weekFramelayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(weekFramelayout);
-
- var weekIconBtn = new Button
- {
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
- UnSelectedImagePath = "ZigeeLogic/point.png",
- X = Application.GetRealWidth(58),
- Y = Application.GetRealHeight(55),
- };
- weekFramelayout.AddChidren(weekIconBtn);
-
- var weekRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(850),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(176),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- weekFramelayout.AddChidren(weekRow);
-
-
- var weekTextBtn = new Button
- {
- TextAlignment = TextAlignment.CenterLeft,
- Text = name,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 15,
- };
- weekRow.AddChidren(weekTextBtn);
-
- var selectedBtn = new Button
- {
- X = Application.GetRealWidth(789),
- Width = Application.GetMinRealAverage(60),
- Height = Application.GetMinRealAverage(60),
- UnSelectedImagePath = "ZigeeLogic/selected.png",
- Gravity = Gravity.CenterVertical,
- Visible = false,
- };
- weekRow.AddChidren(selectedBtn);
-
+ FunView monView = new FunView();
+ monView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+ monView.funnameBtn.Text= name;
+ monView.funnextBtn.Width = Application.GetMinRealAverage(60);
+ monView.funnextBtn.Height = Application.GetMinRealAverage(60);
+ monView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+ monView.funnextBtn.Visible = false;
+ middle.AddChidren(monView.FunFrameView());
if (Language.StringByID(MyInternationalizationString.sun) == name)
{
- weekRow.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+ monView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ monView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
}
var str = weeklist.Find((o) => { return o == name; });
if (str != null)
{
- selectedBtn.Visible = true;
+ monView.funnextBtn.Visible = true;
}
- EventHandler<MouseEventArgs> weekclick = (sender, e) =>
+ monView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
{
- selectedBtn.Visible = !selectedBtn.Visible;
- if (selectedBtn.Visible)
+ monView.funnextBtn.Visible = !monView.funnextBtn.Visible;
+ if (monView.funnextBtn.Visible)
{
var d = weeklist.Find((o) => { return o == name; });
if (d == null)
@@ -191,16 +136,11 @@
}
};
- weekFramelayout.MouseUpEventHandler += weekclick;
- weekTextBtn.MouseUpEventHandler += weekclick;
- selectedBtn.MouseUpEventHandler += weekclick;
- weekIconBtn.MouseUpEventHandler += weekclick;
- weekRow.MouseUpEventHandler += weekclick;
}
- saveBtn.MouseUpEventHandler += (sender, e) =>
+ saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
int weekvalue = 0;
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
index 6a7e5bc..de1c241 100755
--- a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
@@ -33,9 +33,10 @@
};
topView.AddChidren(title);
- var back = new Device.CommonForm.BackButton() { };鈥� topView.AddChidren(back);
+ var back = new UserCenter.BackViewControl();鈥� topView.AddChidren(back);
+ back.InitControl();
- back.MouseUpEventHandler += (sender, e) =>
+ back.ButtonClickEvent += (sender, e) =>
{
this.RemoveFromParent();
};
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
index e5f57fc..1a22030 100755
--- a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
@@ -57,31 +57,7 @@
#endregion
#region 鈼� 鎺ュ彛__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
+
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs b/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs
deleted file mode 100755
index afd3ceb..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using Shared.Phone.Device.Category;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.UserView;
-
-namespace Shared.Phone.Device.Room
-{
-
- public class RoomManagement : FrameLayout
- {
-
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
-
- private Button floorBtn;
- /// <summary>
- /// 褰撳墠妤煎眰id
- /// </summary>
- private string curFloorId;
-
- public FrameLayout itemView;
-
- static RoomManagement roomManagement;
- public static RoomManagement Instance
- {
- get
- {
- if (roomManagement == null)
- {
- roomManagement = new RoomManagement { };
- }
- return roomManagement;
- }
- }
-
- /// <summary>
- /// 鏄惁鍙互瑙﹀彂鐐瑰嚮浜嬩欢--鏄惁鍙互璺宠浆涓婚〉鎴块棿
- /// </summary>
- public bool CanClick = true;
-
- #endregion
-
-
- public Action action;
-
-
-
- public override void RemoveFromParent()
- {
- //action?.Invoke();
- base.RemoveFromParent();
- }
- /// <summary>
- /// 鎴块棿绠$悊
- /// </summary>
- public void Show()
- {
- RemoveAll();
-
- AddTop();
-
- AddBodyView(Config.Instance.Home.CurrentFloorId);
- }
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.RoomList);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.CloseLeftMenu();
- };
-
- floorBtn = new Button()
- {
- X = Application.GetRealWidth(650),
- Width = Application.GetRealWidth(300),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 14,
- IsBold = true
- };
-
- var selectFloorBtn = new Button()
- {
- X = Application.GetRealWidth(950),
- Width = Application.GetMinRealAverage(69),
- Height = Application.GetMinRealAverage(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Drop_Down.png"
- };
-
- floorBtn.Text = Config.Instance.Home.GetCurrentFloorName;
- if(Config.Instance.Home.FloorDics.Count>0)
- {
- curFloorId = Config.Instance.Home.CurrentFloorId;
- top.topView.AddChidren(floorBtn);
- top.topView.AddChidren(selectFloorBtn);
- }
- selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- }
-
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- var floors = new SelectFloor();
- AddChidren(floors);
- floors.changeFloor = false;
- floors.CurFloorId = curFloorId;
- floors.Init(599, 161,Direction.Right);
- floors.FloorAction += (floorId) =>
- {
- curFloorId = floorId;
- floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
- AddBodyView(floorId);
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(string floorId)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- try
- {
- if (UserCenter.HdlRoomLogic.Current.GetAllListRooms().Count <= 1)
- {
- return;
- }
- var roomScrolView = new VerticalScrolViewLayout { };
- bodyFrameLayout.AddChidren(roomScrolView);
- var roomList = UserCenter.HdlRoomLogic.Current.GetRoomsByFloorId(floorId);
- if (roomList == null || roomList.Count == 0)
- {
- itemView = new FrameLayout()
- {
- Height = Application.GetRealHeight(354 + 58)
- };
- roomScrolView.AddChidren(itemView);
-
- var roomView = new RoomNoNameMainView(34, 58);
- itemView.AddChidren(roomView);
- roomView.Init();
-
- roomView.Icon.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent;
- roomView.RoomNameButton.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent;
- roomView.iconFL.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent;
- }
- else
- {
- for (int i = 0; i < roomList.Count + 1; i++)
- {
- int xx = 43 + i % 2 * (20 + 487);
- int yy = 0;
- if (i == 0 || i == 1)
- {
- if (i % 2 == 0)
- {
- itemView = new FrameLayout()
- {
- Height = Application.GetRealHeight(354 + 58)
- };
- roomScrolView.AddChidren(itemView);
- }
- yy = 58;
- }
- else if (i % 2 == 0)
- {
- itemView = new FrameLayout()
- {
- Height = Application.GetRealHeight(354)
- };
- roomScrolView.AddChidren(itemView);
- }
-
- if (i < roomList.Count)
- {
- var room = roomList[i];
- var roomView = new RoomMainView(xx, yy);
- itemView.AddChidren(roomView);
- roomView.Init(this, room);
- roomView.SetRoomName(room.Name);
- roomView.SetRoomIcon(room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage));
- roomView.ClickBtn.MouseUpEventHandler += (sender, e) =>
- {
- if (CanClick == false)
- {
- return;
- }
- CommonPage.Instance.CloseLeftMenu();
- UserCenter.HdlRoomLogic.Current.CurrentRoom = room;
- Config.Instance.Home.CurrentFloorId = room.FloorId;
- UserPage.Instance.Fresh();
- };
- }
- else
- {
- var roomView = new RoomNoNameMainView(xx, yy);
- itemView.AddChidren(roomView);
- roomView.Init();
-
- roomView.Icon.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent;
- roomView.RoomNameButton.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent;
- roomView.iconFL.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent;
- }
- }
- }
-
- }
- catch (Exception ex)
- {
- string tt=ex.Message;
- }
- }
-
- #endregion
-
- /// <summary>
- /// 鎴块棿绠$悊鐣岄潰
- /// </summary>
- public RoomManagement()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- roomManagement = this;
- }
-
- /// <summary>
- /// ShowUnallocatedRoom_MouseUpEvent
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="mouseEventArgs"></param>
- private void ShowUnallocatedRoom_MouseUpEvent(object sender,MouseEventArgs mouseEventArgs)
- {
- if(CanClick==false)
- {
- return;
- }
- var unalloctedRoom = new UnallocatedRoom();
- AddChidren(unalloctedRoom);
- unalloctedRoom.Show();
- }
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs
deleted file mode 100755
index 75f24f9..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs
+++ /dev/null
@@ -1,698 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.Category;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Room
-{
- public class UnallocatedRoom:FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// top
- /// </summary>
- private TopFrameLayout top;
- private Button selectAllBtn;
-
- /// <summary>
- /// 涓儴鑳屾櫙bodyView
- /// </summary>
- public FrameLayout functionSceneBodyView;
- /// <summary>
- /// 褰撳墠鍔熻兘绫诲瀷鎸夐挳
- /// </summary>
- private FunctionButton tempFunctionTypeBtn;
- /// <summary>
- /// 鍔熻兘绫诲瀷鎸夐挳
- /// </summary>
- private FunctionButton functionTypeIMG;
- /// <summary>
- /// 鍔熻兘绫诲瀷
- /// </summary>
- private HorizontalScrolViewLayout functionTypeScrowView;
- /// <summary>
- /// 璁惧绫诲瀷RowLayout
- /// </summary>
- private FrameLayout typeRowLayout;
- /// <summary>
- /// 鐩稿悓鐨勮澶囧垪琛�
- /// </summary>
- public VerticalScrolViewLayout deviceListScrolView;
- /// <summary>
- /// dList
- /// </summary>
- private List<CommonDevice> devList;
- /// <summary>
- /// sceneList
- /// </summary>
- private List<SceneUI> sceneList;
-
- /// <summary>
- /// 鐩稿悓绫诲瀷鐨勮澶囧垪琛�
- /// </summary>
- private Dictionary<int ,List<CommonDevice>> typeDeviceDic;
- /// <summary>
- /// 璁惧绫诲瀷鐨勫浘id
- /// </summary>
- private Dictionary<int, DeviceConcreteType> typeIdDic;
- /// <summary>
- /// 褰撳墠閫夋嫨鐨勫垎鏀� 0:鍦烘櫙 1:鍔熻兘
- /// </summary>
- private int NowSelectIndex = 0;
-
- #endregion
-
- /// <summary>
- /// UnallocatedRoom
- /// </summary>
- public UnallocatedRoom()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- /// <summary>
- /// 鏈垎閰嶆埧闂寸鐞�
- /// </summary>
- public void Show()
- {
- RemoveAll();
- InitData();
- AddTop();
- AddBodyView();
- }
-
- /// <summary>
- /// InitData
- /// </summary>
- private void InitData()
- {
- typeDeviceDic = new Dictionary<int, List<CommonDevice>> { };
- typeIdDic = new Dictionary<int, DeviceConcreteType> { };
-
- RefreshData();
- }
-
- /// <summary>
- /// RefreshData
- /// </summary>
- private void RefreshData()
- {
- devList = UserCenter.HdlRoomLogic.Current.GetUnalloctedDevice();
- sceneList = UserCenter.HdlSceneLogic.Current.GetUnalloctedScenes();
- typeDeviceDic.Clear();
- typeIdDic.Clear();
- if (devList == null)
- {
- return;
- }
- foreach (var device in devList)
- {
- var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
- if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false)
- {
- var sameDevList = new List<CommonDevice> { };
- sameDevList.Add(device);
- typeDeviceDic[info.BeloneTextId] = sameDevList;
- }
- else
- {
- typeDeviceDic[info.BeloneTextId].Add(device);
- }
- typeIdDic[info.BeloneTextId] = info.ConcreteType;
- }
- }
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.Unallocated);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- //鍦烘櫙鍔熻兘鍒囨崲鎺т欢
- var btnSceneFunctionSwitch = new UserCenter.SceneFunctionSwitchControl();
- btnSceneFunctionSwitch.Y = Application.GetRealHeight(43);
- bodyFrameLayout.AddChidren(btnSceneFunctionSwitch);
- btnSceneFunctionSwitch.SelectTabEvent += (index) =>
- {
- this.NowSelectIndex = index;
- this.RefreshBodyView();
- };
-
- //鍔熻兘鍜屽満鏅痓odyView
- functionSceneBodyView = new FrameLayout()
- {
- Y = Application.GetRealHeight(127),
- Height = Application.GetRealHeight(1607),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- bodyFrameLayout.AddChidren(functionSceneBodyView);
-
- //寮�濮嬪垵濮嬪寲鍦烘櫙鍔熻兘鍒囨崲鎺т欢
- var listTitle = new List<string>();
- listTitle.Add(Language.StringByID(R.MyInternationalizationString.uScence));
- listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction));
- btnSceneFunctionSwitch.InitControl(listTitle);
- }
-
- #endregion
-
- #region 鈼� 鍒锋柊____________________________
- /// <summary>
- /// 鍒锋柊bodyView
- /// </summary>
- public void RefreshBodyView()
- {
- functionSceneBodyView.RemoveAll();
-
- if (this.NowSelectIndex == 1)
- {
- ShowFunction();
- }
- else if (this.NowSelectIndex == 0)
- {
- ShowScene();
- }
- }
-
- #endregion
-
- #region 鈼� 鍔熻兘____________________________
- /// <summary>
- /// 鍔熻兘
- /// </summary>
- public void ShowFunction()
- {
- if (typeIdDic.Count == 0)
- {
- ShowNoFunctionTip();
- }
- else
- {
- var functionTypeView1 = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(58),
- Height = Application.GetRealHeight(160),
- Width = Application.GetRealWidth(1028),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(functionTypeView1);
- functionTypeView1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft);
-
- var functionTypeView2 = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(58+150),
- Height = Application.GetRealHeight(279-150),
- Width = Application.GetRealWidth(1028),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(functionTypeView2);
- functionTypeView2.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
-
- functionTypeScrowView = new HorizontalScrolViewLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y=Application.GetRealHeight(58),
- Height = Application.GetRealHeight(279),
- Width = Application.GetRealWidth(1028)
- };
- functionSceneBodyView.AddChidren(functionTypeScrowView);
-
- deviceListScrolView = new VerticalScrolViewLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(372),
- Width = Application.GetRealWidth(1028),
- Height = Application.GetRealHeight(1034),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- functionSceneBodyView.AddChidren(deviceListScrolView);
- deviceListScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-
- tempFunctionTypeBtn = new FunctionButton();
- tempFunctionTypeBtn.Init("", "");
-
- foreach (var deviceType in typeIdDic)
- {
- typeRowLayout = new FrameLayout()
- {
- Width = Application.GetRealWidth(220),
- };
- functionTypeScrowView.AddChidren(typeRowLayout);
-
- functionTypeIMG = new FunctionButton()
- {
- Tag = deviceType.Key
- };
- string imgPath=string.Empty;
- string imgSeletedPath=string.Empty;
- Common.LocalDevice.Current.GetDeviceObjectIcon(deviceType.Value, ref imgPath ,ref imgSeletedPath);
- functionTypeIMG.Init(imgPath,imgSeletedPath);
- functionTypeIMG.SetTitle(deviceType.Key);
- typeRowLayout.AddChidren(functionTypeIMG);
-
- functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
-
- if (functionTypeScrowView.ChildrenCount == 1)
- {
- ShowSameTypeFunction(functionTypeIMG.ImageBtn, null);
- }
- }
-
- }
- }
-
- /// <summary>
- /// 鏄剧ず鐩稿悓绫诲瀷鐨勫姛鑳�
- /// </summary>
- /// <param name="typeSender">typeSender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ShowSameTypeFunction(object typeSender, MouseEventArgs mouseEventArgs)
- {
- tempFunctionTypeBtn.IsSelected = false;
- tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton;
- ((typeSender as Button).Parent as FunctionButton).IsSelected = true;
-
- deviceListScrolView.RemoveAll();
-
- var sameTypeList = new List<CommonDevice> { };
- var selectedList = new List<CommonDevice> { };
- sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
-
- foreach (var deviceUI in sameTypeList)
- {
- var deviceTypeRowLayout = new FrameLayout()
- {
- Height = Application.GetRealHeight(127 + 35),
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- var deviceRow = new SelectFunctionView(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
- {
- deviceRow.IsSelected = !deviceRow.IsSelected;
- if (deviceRow.IsSelected)
- {
- if (!selectedList.Contains(deviceUI))
- {
- selectedList.Add(deviceUI);
- }
- }
- else
- {
- if (selectedList.Contains(deviceUI))
- {
- selectedList.Remove(deviceUI);
- }
- }
- };
- deviceRow.ClickBtn.MouseUpEventHandler += eventHandler;
- }
-
- selectAllBtn?.RemoveFromParent();
- selectAllBtn = new Button()
- {
- X = Application.GetRealWidth(1080 - 150 - 80),
- Width = Application.GetRealWidth(150),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = CommonFormResouce.TopTitle_TextSize,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.AllSelect
- };
- top.topView.AddChidren(selectAllBtn);
- selectAllBtn.MouseUpEventHandler += (sender, e) =>
- {
- try
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- for (int i = 0; i < deviceListScrolView.ChildrenCount; i++)
- {
- var frame = deviceListScrolView.GetChildren(i) as FrameLayout;
- (frame.GetChildren(0) as SelectFunctionView).IsSelected = (sender as Button).IsSelected;
- }
- if ((sender as Button).IsSelected)
- {
- (sender as Button).TextID = R.MyInternationalizationString.Cancel;
- selectedList.Clear();
- selectedList.AddRange(sameTypeList);
- }
- else
- {
- (sender as Button).TextID = R.MyInternationalizationString.AllSelect;
- selectedList.Clear();
- }
- }
- catch
- {
-
- }
- };
-
- var addBackground = new Button
- {
- Y = Application.GetRealHeight(1405),
- Width = Application.GetMinRealAverage(1080),
- Height = Application.GetMinRealAverage(202),
- UnSelectedImagePath = "Room/AddBackground.png"
- };
- functionSceneBodyView.AddChidren(addBackground);
- var add = new Button
- {
- Y = Application.GetRealHeight(1428),
- Width = Application.GetRealWidth(1034),
- Height = Application.GetRealHeight(156),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- Radius = (uint)Application.GetRealHeight(35),
- TextID = R.MyInternationalizationString.AddTo,
- Gravity = Gravity.CenterHorizontal,
- TextSize = 17
- };
- functionSceneBodyView.AddChidren(add);
- add.MouseUpEventHandler += (sender, e) =>
- {
- var selectZone = new SelectZone();
- selectZone.title = Language.StringByID(R.MyInternationalizationString.AddTo);
- selectZone.Init();
- selectZone.ZoneAction += (r) =>
- {
- foreach (var d in selectedList)
- {
- UserCenter.HdlRoomLogic.Current.AddDevice(r, d, true);
- deviceListScrolView.RemoveViewByTag(d);
- }
-
- if (sameTypeList.Count == selectedList.Count)
- {
- RefreshData();
- RefreshBodyView();
- }
- else
- {
- RefreshData();
- sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
- }
- };
- };
- }
-
- /// <summary>
- /// 鎻愮ず娌℃湁鍔熻兘
- /// </summary>
- private void ShowNoFunctionTip()
- {
- return;
- var noFunction = new Button()
- {
- Y = Application.GetRealHeight(320),
- Width = Application.GetMinRealAverage(757),
- Height = Application.GetMinRealAverage(435),
- UnSelectedImagePath = "Item/NoFunction.png",
- Gravity = Gravity.CenterHorizontal
- };
- functionSceneBodyView.AddChidren(noFunction);
-
- var noFunctionTip = new Button()
- {
- Y = noFunction.Bottom + Application.GetRealHeight(32),
- Height = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(700),
- Gravity = Gravity.CenterHorizontal,
- Text= Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noFunctionTip);
- }
-
- #endregion
-
- #region 鈼� 鍦烘櫙____________________________
- /// <summary>
- /// 閫夋嫨鍦烘櫙--鎵�鏈夋埧闂寸殑鎵�鏈夊満鏅�
- /// </summary>
- public void ShowScene()
- {
- List<SceneUI> selectedList = new List<SceneUI>();
- if (sceneList == null || sceneList.Count == 0)
- {
- ShowNoSceneTip();
- }
- else
- {
- var sceneScrolView = new VerticalScrolViewLayout
- {
- Y = Application.GetRealHeight(81),
- Height=Application.GetRealHeight(1405-22)
- };
- functionSceneBodyView.AddChidren(sceneScrolView);
- foreach (var sceneUI in sceneList)
- {
- var sceneFL = new FrameLayout()
- {
- Width = Application.GetRealWidth(CommonFormResouce.AppRealWidth),
- Height = Application.GetRealHeight(397 + 46),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- Tag = sceneUI,
- Radius = (uint)Application.GetRealHeight(17)
- };
- sceneScrolView.AddChidren(sceneFL);
-
- var sceneImg = new ImageView()
- {
- X = Application.GetRealWidth(179),
- Width = Application.GetRealWidth(844),
- Height = Application.GetRealHeight(397),
- ImagePath = sceneUI.IconPath,
- Radius = (uint)Application.GetRealHeight(17)
- };
- sceneFL.AddChidren(sceneImg);
-
- //闃村奖
- var btnShadow = new UserCenter.PicViewControl(sceneImg.Width + Application.GetRealWidth(14 * 2), sceneImg.Height + Application.GetRealHeight(43), false);
- btnShadow.X = sceneImg.X - Application.GetRealWidth(14);
- btnShadow.UnSelectedImagePath = "Scene/SceneShadow.png";
- sceneFL.AddChidren(btnShadow);
-
- var selectedBtn = new Button
- {
- X = Application.GetRealWidth(919),
- Y = Application.GetRealHeight(45),
- Width = Application.GetMinRealAverage(60),
- Height = Application.GetMinRealAverage(60),
- UnSelectedImagePath = "Room/ItemUnSelected.png",
- SelectedImagePath = "Room/ItemSelected.png",
- };
- sceneFL.AddChidren(selectedBtn);
-
- var leftFL = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(58),
- Width = Application.GetRealWidth(251),
- Height = Application.GetRealHeight(282),
- BackgroundColor = 0xd6333333,
- Radius = (uint)Application.GetRealHeight(17)
- };
- sceneFL.AddChidren(leftFL);
-
- var collectionBtn = new Button
- {
- X = Application.GetRealWidth(23),
- Y = Application.GetRealHeight(23),
- Width = Application.GetMinRealAverage(65),
- Height = Application.GetMinRealAverage(65),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- leftFL.AddChidren(collectionBtn);
-
- var sceneNameBtn = new Button()
- {
- Width = Application.GetRealWidth(176),
- Height = Application.GetRealHeight(200),
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- Text = sceneUI.Name,
- Gravity = Gravity.Center,
- IsMoreLines = true
- };
- leftFL.AddChidren(sceneNameBtn);
-
- EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
- {
- selectedBtn.IsSelected = !selectedBtn.IsSelected;
- if (selectedBtn.IsSelected)
- {
- if (!selectedList.Contains(sceneUI))
- {
- selectedList.Add(sceneUI);
- }
- }
- else
- {
- if (selectedList.Contains(sceneUI))
- {
- selectedList.Remove(sceneUI);
- }
- }
- };
- selectedBtn.MouseUpEventHandler += eventHandler;
- sceneImg.MouseUpEventHandler += eventHandler;
- }
-
- selectAllBtn?.RemoveFromParent();
- selectAllBtn = new Button()
- {
- X = Application.GetRealWidth(1080 - 150 - 80),
- Width = Application.GetRealWidth(150),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = CommonFormResouce.TopTitle_TextSize,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.AllSelect
- };
- top.topView.AddChidren(selectAllBtn);
- selectAllBtn.MouseUpEventHandler += (sender, e) =>
- {
- try
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- for (int i = 0; i < sceneScrolView.ChildrenCount; i++)
- {
- var frame = sceneScrolView.GetChildren(i) as FrameLayout;
- (frame.GetChildren(1) as Button).IsSelected = (sender as Button).IsSelected;
- }
-
- if ((sender as Button).IsSelected)
- {
- (sender as Button).TextID = R.MyInternationalizationString.Cancel;
- selectedList.AddRange(sceneList);
- }
- else
- {
- (sender as Button).TextID = R.MyInternationalizationString.AllSelect;
- selectedList.Clear();
- }
- }
- catch
- {
-
- }
- };
-
- var addBackground = new Button
- {
- Y = Application.GetRealHeight(1405),
- Width = Application.GetMinRealAverage(1080),
- Height = Application.GetMinRealAverage(202),
- UnSelectedImagePath = "Room/AddBackground.png"
- };
- functionSceneBodyView.AddChidren(addBackground);
-
- var add = new Button
- {
- Y = Application.GetRealHeight(1428),
- Width = Application.GetRealWidth(1034),
- Height = Application.GetRealHeight(156),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- Radius = (uint)Application.GetRealHeight(35),
- TextID = R.MyInternationalizationString.AddTo,
- Gravity = Gravity.CenterHorizontal,
- TextSize=17,
- };
- functionSceneBodyView.AddChidren(add);
- add.MouseUpEventHandler += (sender, e) =>
- {
- var selectZone = new SelectZone();
- selectZone.title = Language.StringByID(R.MyInternationalizationString.AddTo);
- selectZone.Init();
- selectZone.ZoneAction += (r) =>
- {
- foreach (var s in selectedList)
- {
- UserCenter.HdlSceneLogic.Current.AddScene(r, s);
- sceneScrolView.RemoveViewByTag(s);
- }
- RefreshData();
- };
- };
- }
- }
-
- /// <summary>
- /// 鏄剧ず娌℃湁鍦烘櫙
- /// </summary>
- private void ShowNoSceneTip()
- {
- return;
- var noFunction = new Button()
- {
- Y = Application.GetRealHeight(320),
- Width = Application.GetMinRealAverage(757),
- Height = Application.GetMinRealAverage(435),
- UnSelectedImagePath = "Item/NoFunction.png",
- Gravity = Gravity.CenterHorizontal
- };
- functionSceneBodyView.AddChidren(noFunction);
-
- var noScenceTip = new Button()
- {
- Y = noFunction.Bottom + Application.GetRealHeight(32),
- Height = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(700),
- Gravity = Gravity.CenterHorizontal,
- Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noScenceTip);
- }
- #endregion
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs b/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs
index 5c33746..065cd53 100755
--- a/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs
@@ -28,9 +28,13 @@
/// </summary>
private EmailLoginRowForm emailRow;
/// <summary>
- /// pwdRow
+ /// phonePwdRow
/// </summary>
- private PwdLoginRowForm pwdRow;
+ private PwdLoginRowForm phonePwdRow;
+ /// <summary>
+ /// emailPwdRow
+ /// </summary>
+ private PwdLoginRowForm emailPwdRow;
/// <summary>
/// 璐﹀彿瀵嗙爜fl
@@ -57,14 +61,6 @@
/// </summary>
private Button registerBtn;
/// <summary>
- /// 璐﹀彿
- /// </summary>
- private string account;
- /// <summary>
- /// 瀵嗙爜
- /// </summary>
- private string password;
- /// <summary>
/// wechat
/// </summary>
private Button wechatBtn;
@@ -72,7 +68,10 @@
/// qq
/// </summary>
private Button qqBtn;
-
+ /// <summary>
+ /// 杈撳叆鐨勭櫥闄嗚处鍙�(閲嶆柊鐧婚檰鏃朵娇鐢�)
+ /// </summary>
+ private string oldInputAccount = string.Empty;
#endregion
@@ -110,7 +109,7 @@
}
else
{
- LoginViewShow(account, password);
+ LoginViewShow(account);
}
}
@@ -118,11 +117,12 @@
/// Logins the view show.
/// </summary>
/// <param name="account">Account.</param>
- /// <param name="password">Password.</param>
- public void LoginViewShow(string account = "", string password = "")
+ public void LoginViewShow(string account = "")
{
- this.account = account;
- this.password = password;
+ //璁剧疆涓�涓嬪垵濮嬪��
+ if (account.Contains("@") == true) { this.oldInputAccount = account; }
+ else { this.oldInputAccount = account; }
+
#region midFrameLayout
midFrameLayout = new FrameLayout()
{
@@ -229,8 +229,7 @@
SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor,
BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor,
Radius = (uint)Application.GetRealHeight(127 / 2),
- Enable = !string.IsNullOrEmpty(pwdRow.PasswrodET?.Text),
- IsSelected = !string.IsNullOrEmpty(pwdRow.PasswrodET?.Text),
+ Enable = false,
IsBold=true
};
midFrameLayout.AddChidren(loginBtn);
@@ -286,14 +285,9 @@
BindEvent();
- if (string.IsNullOrEmpty(account) == false && AccountLogic.Instance.CheckEmail(account) == true)
+ if (account.Contains("@") == true)
{
SelectPhoneOrEmail_MouseUpEvent(phoneEmailForm.SelectedEmail, null);
- this.account = string.Empty;
- }
- else
- {
- this.account = string.Empty;
}
}
@@ -336,11 +330,11 @@
{
if (phoneEmailForm.SelectedPhone.IsSelected)
{
- Login(phoneRow.AccountET.Text.Trim(), pwdRow.PasswrodET.Text.Trim());
+ Login(phoneRow.AccountET.Text.Trim(), phonePwdRow.PasswrodET.Text.Trim());
}
else
{
- Login(emailRow.AccountET.Text.Trim(), pwdRow.PasswrodET.Text.Trim());
+ Login(emailRow.AccountET.Text.Trim(), emailPwdRow.PasswrodET.Text.Trim());
}
}
@@ -351,124 +345,124 @@
/// <param name="accountStr">Account.</param>
/// <param name="passwordStr">Password.</param>
private void Login(string accountStr, string passwordStr)
- {
+ {
//Application.RunOnMainThread( () =>
//{
Action action = async () =>
{
try
{
- if(CheckAccount(accountStr)==false)
- {
- return;
- }
-
+ if(CheckAccount(accountStr)==false)
+ {
+ return;
+ }
+
CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining));
- var requestObj = new SendDataToServer.LoginObj
- {
- Account = accountStr,
- Password = passwordStr,
- Source = CommonPage.Source,
- Company = CommonPage.Company
- };
- var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
- var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/Login", System.Text.Encoding.UTF8.GetBytes(requestJson));
- if (revertObj == null)
- {
- CommonPage.Instance.FailureToServer();
- CommonPage.Loading.Hide();
- return;
- }
- var stateCodeStr = revertObj.StateCode.ToUpper();
- //Error 涓嶈兘鐩存帴浠庢湇鍔″櫒鍙栵紝鍙兘鏍规嵁鐘舵�佺爜閫愪竴鍒ゆ柇
- if (stateCodeStr == "SUCCESS")
- {
- if (revertObj.ResponseData == null)
- {
- return;
- }
-
+ var requestObj = new SendDataToServer.LoginObj
+ {
+ Account = accountStr,
+ Password = passwordStr,
+ Source = CommonPage.Source,
+ Company = CommonPage.Company
+ };
+ var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
+ var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/Login", System.Text.Encoding.UTF8.GetBytes(requestJson));
+ if (revertObj == null)
+ {
+ CommonPage.Instance.FailureToServer();
+ CommonPage.Loading.Hide();
+ return;
+ }
+ var stateCodeStr = revertObj.StateCode.ToUpper();
+ //Error 涓嶈兘鐩存帴浠庢湇鍔″櫒鍙栵紝鍙兘鏍规嵁鐘舵�佺爜閫愪竴鍒ゆ柇
+ if (stateCodeStr == "SUCCESS")
+ {
+ if (revertObj.ResponseData == null)
+ {
+ return;
+ }
+
HomePage.Instance.ShowLoginLoadView();
- new System.Threading.Thread(async () =>
- {
- //瀛樺偍鏁版嵁
- var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString());
- var revertData = responseDataObj;
- Config.ReFresh();
- Config.Instance.Account = revertData.Account;
+ new System.Threading.Thread(async () =>
+ {
+ //瀛樺偍鏁版嵁
+ var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString());
+ var revertData = responseDataObj;
+ Config.ReFresh();
+ Config.Instance.Account = revertData.Account;
Config.Instance.Password = passwordStr;
Config.Instance.MD5PWD = revertData.MD5PWD;
- Config.Instance.Guid = revertData.Guid;
- Config.Instance.LoginDateTime = DateTime.Now;
- Config.Instance.LoginToken = revertData.Token;
- if (Config.Instance.AccountList.Find((obj) => obj == revertData.Account) == null)
- {
- Config.Instance.AccountList.Add(revertData.Account);
- }
- Config.Instance.Save();
-
- var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID();
- var homes = await House.GetHomeLists();
- //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
+ Config.Instance.Guid = revertData.Guid;
+ Config.Instance.LoginDateTime = DateTime.Now;
+ Config.Instance.LoginToken = revertData.Token;
+ if (Config.Instance.AccountList.Find((obj) => obj == revertData.Account) == null)
+ {
+ Config.Instance.AccountList.Add(revertData.Account);
+ }
+ Config.Instance.Save();
+
+ var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID();
+ var homes = await House.GetHomeLists();
+ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
//鍚姩ZigBee
- ZigBee.Common.Application.Init();
-
- UserCenter.HdlRoomLogic.Current.InitAllRoom();
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- this.RemoveFromParent();
+ ZigBee.Common.Application.Init();
+
+ UserCenter.HdlRoomLogic.Current.InitAllRoom();
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ this.RemoveFromParent();
CommonPage.Instance.RemoveViewByTag("Login");
- UserPage.Instance.Fresh();
- });
- })
- { IsBackground = true }.Start();
+ UserPage.Instance.Fresh();
+ });
+ })
+ { IsBackground = true }.Start();
+ }
+ else if (stateCodeStr == "NOTVERIFY")
+ {
+ CommonPage.Loading.Hide();
+ //鏈縺娲�
+ loginErrorBtn.TextID = R.MyInternationalizationString.NOTVERIFY;
+ }
+ else if (stateCodeStr == "NOTENABLE")
+ {
+ CommonPage.Loading.Hide();
+ //璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤
+ loginErrorBtn.TextID = R.MyInternationalizationString.NOTENABLE;
+ }
+ else if (stateCodeStr == "USERNAMEORPWDERROR")
+ {
+ CommonPage.Loading.Hide();
+ //璐﹀彿鎴栧瘑鐮侀敊璇�
+ loginErrorBtn.TextID = R.MyInternationalizationString.USERNAMEORPWDERROR;
+ }
+ else if (stateCodeStr == "ACCOUNTNOEXISTS")
+ {
+ CommonPage.Loading.Hide();
+ //璐﹀彿涓嶅瓨鍦�
+ loginErrorBtn.TextID = R.MyInternationalizationString.ACCOUNTNOEXISTS;
+ }
+ else if (stateCodeStr == "YOUDATANOISLOCALREGION")
+ {
+ CommonPage.Loading.Hide();
+ //涓嶅湪鏈尯鍩燂紝闇�瑕侀噸瀹氬悜鍖哄煙鍚庡啀娆¤姹傜櫥褰�
+ if (revertObj.ResponseData == null)
+ {
+ return;
+ }
+ var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginLocalRegionRes>(revertObj.ResponseData.ToString());
+ CommonPage.RequestHttpsHost = responseDataObj.RegionServer;
+ //鍐嶆鐧诲綍
+ Login(accountStr, passwordStr);
+ }
+ else
+ {
+ loginErrorBtn.TextID = R.MyInternationalizationString.RequestServerFailed;
}
- else if (stateCodeStr == "NOTVERIFY")
- {
- CommonPage.Loading.Hide();
- //鏈縺娲�
- loginErrorBtn.TextID = R.MyInternationalizationString.NOTVERIFY;
- }
- else if (stateCodeStr == "NOTENABLE")
- {
- CommonPage.Loading.Hide();
- //璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤
- loginErrorBtn.TextID = R.MyInternationalizationString.NOTENABLE;
- }
- else if (stateCodeStr == "USERNAMEORPWDERROR")
- {
- CommonPage.Loading.Hide();
- //璐﹀彿鎴栧瘑鐮侀敊璇�
- loginErrorBtn.TextID = R.MyInternationalizationString.USERNAMEORPWDERROR;
- }
- else if (stateCodeStr == "ACCOUNTNOEXISTS")
- {
- CommonPage.Loading.Hide();
- //璐﹀彿涓嶅瓨鍦�
- loginErrorBtn.TextID = R.MyInternationalizationString.ACCOUNTNOEXISTS;
- }
- else if (stateCodeStr == "YOUDATANOISLOCALREGION")
- {
- CommonPage.Loading.Hide();
- //涓嶅湪鏈尯鍩燂紝闇�瑕侀噸瀹氬悜鍖哄煙鍚庡啀娆¤姹傜櫥褰�
- if (revertObj.ResponseData == null)
- {
- return;
- }
- var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginLocalRegionRes>(revertObj.ResponseData.ToString());
- CommonPage.RequestHttpsHost = responseDataObj.RegionServer;
- //鍐嶆鐧诲綍
- Login(accountStr, passwordStr);
- }
- else
- {
- loginErrorBtn.TextID = R.MyInternationalizationString.RequestServerFailed;
- }
- }
+ }
catch (Exception ex)
{
System.Console.WriteLine($"鐧诲綍澶辫触--{ex.Message}");
@@ -550,14 +544,14 @@
else
{
new System.Threading.Thread(async () =>
- {
+ {
var re = await isBindAuthAsync(authStr);
if (re)
{
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread(() =>
{
//鐩存帴鐧诲綍
- HomePage.Instance.ShowLoginLoadView();
+ HomePage.Instance.ShowLoginLoadView();
});
var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID();
var homes = await House.GetHomeLists();
@@ -618,7 +612,7 @@
ZigBee.Common.Application.Init();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- Shared.Common.Room.InitAllRoom();
+ UserCenter.HdlRoomLogic.Current.InitAllRoom();
Application.RunOnMainThread(() =>
{
this.RemoveFromParent();
@@ -738,24 +732,56 @@
/// <param name="phoneOrEmail"></param>
private void AddPhoneOrEmailFL(FrameLayout accountPwdFrameLayout,string phoneOrEmail)
{
- accountPwdFrameLayout.RemoveAll();
-
if (phoneOrEmail == "Phone")
{
+ if (phoneRow != null)
+ {
+ phoneRow.Visible = true;
+ phonePwdRow.Visible = true;
+ if (emailRow != null)
+ {
+ emailRow.Visible = false;
+ emailPwdRow.Visible = false;
+ }
+ this.Pwd_TextChange(phonePwdRow);
+ return;
+ }
phoneRow = new PhoneLoginRowForm();
- phoneRow.Init(accountPwdFrameLayout, this, this.account, 29, 29);
- phoneRow.AccountET.TextChangeEventHandler += Account_TextChange;
+ phoneRow.Init(accountPwdFrameLayout, this, this.oldInputAccount, 29, 29);
+ phoneRow.AccountET.TextChangeEventHandler += Account_TextChange;
+
+ phonePwdRow = new PwdLoginRowForm();
+ phonePwdRow.Init(accountPwdFrameLayout, 29, 225);
+ phonePwdRow.PasswrodET.TextChangeEventHandler += (sender, e) =>
+ {
+ this.Pwd_TextChange(phonePwdRow);
+ };
}
else
{
+ if (emailRow != null)
+ {
+ emailRow.Visible = true;
+ emailPwdRow.Visible = true;
+ if (phoneRow != null)
+ {
+ phoneRow.Visible = false;
+ phonePwdRow.Visible = false;
+ }
+ this.Pwd_TextChange(emailPwdRow);
+ return;
+ }
emailRow = new EmailLoginRowForm();
- emailRow.Init(accountPwdFrameLayout, this.account, 29, 29);
- emailRow.AccountET.TextChangeEventHandler += Account_TextChange;
+ emailRow.Init(accountPwdFrameLayout, this.oldInputAccount, 29, 29);
+ emailRow.AccountET.TextChangeEventHandler += Account_TextChange;
+
+ emailPwdRow = new PwdLoginRowForm();
+ emailPwdRow.Init(accountPwdFrameLayout, 29, 225);
+ emailPwdRow.PasswrodET.TextChangeEventHandler += (sender, e) =>
+ {
+ this.Pwd_TextChange(emailPwdRow);
+ };
}
-
- pwdRow = new PwdLoginRowForm();
- pwdRow.Init(accountPwdFrameLayout, 29, 225);
- pwdRow.PasswrodET.TextChangeEventHandler += Pwd_TextChange;
}
#endregion
@@ -803,23 +829,22 @@
/// <summary>
/// 瀵嗙爜鐩戝惉浜嬩欢
/// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void Pwd_TextChange(object sender,string mouseEventArgs)
+ /// <param name="pwdRow">Sender.</param>
+ private void Pwd_TextChange(PwdLoginRowForm pwdRow)
{
loginErrorBtn.Text = string.Empty;
- if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length>0))
+ string pswText = pwdRow.PasswrodET.Text.Trim();
+ if (1 <= pswText.Length && pswText.Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length>0))
{
loginBtn.Enable = loginBtn.IsSelected = true;
}
- else if (pwdRow.PasswrodET.Text.Trim().Length > 16)
+ else if (pswText.Length > 16)
{
- pwdRow.PasswrodET.Text = mouseEventArgs.Remove(16);
- }
- else if (pwdRow.PasswrodET.Text.Trim().Length > 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length > 0))
- {
- loginBtn.Enable = loginBtn.IsSelected = true;
- pwdRow.PasswrodET.Text = mouseEventArgs.Remove(16);
+ pwdRow.PasswrodET.Text = pswText.Substring(0, 16);
+ if (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length > 0)
+ {
+ loginBtn.Enable = loginBtn.IsSelected = true;
+ }
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs b/ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs
index c70ba52..30ccf5e 100755
--- a/ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs
@@ -303,7 +303,7 @@
if (CheckAccount(account) == false)
{
return;
- }
+ }
var reqLoginByCode = new SendDataToServer.LoginValidCodeOBJ()
{
Account = account,
@@ -311,7 +311,7 @@
Language = CommonPage.ZigBeeLanguage,
AreaCode = int.Parse(CommonPage.PhoneZoneStr)
};
- var requestRevetLoginCodeOBJ = await CommonFormResouce.LoginByCode(reqLoginByCode);
+ var requestRevetLoginCodeOBJ = await CommonFormResouce.LoginByCode(reqLoginByCode);
if (requestRevetLoginCodeOBJ == null)
{
CommonPage.Instance.FailureToServer();
@@ -512,14 +512,14 @@
else
{
new System.Threading.Thread(async () =>
- {
- var re = await isBindAuthAsync(authStr);
+ {
+ var re = await isBindAuthAsync(authStr);
if (re)
- {
- Application.RunOnMainThread(() =>
- {
- //鐩存帴鐧诲綍
- HomePage.Instance.ShowLoginLoadView();
+ {
+ Application.RunOnMainThread(() =>
+ {
+ //鐩存帴鐧诲綍
+ HomePage.Instance.ShowLoginLoadView();
});
var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID();
var homes = await House.GetHomeLists();
@@ -580,7 +580,7 @@
ZigBee.Common.Application.Init();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- Shared.Common.Room.InitAllRoom();
+ UserCenter.HdlRoomLogic.Current.InitAllRoom();
Application.RunOnMainThread(() =>
{
this.RemoveFromParent();
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
index 6818f7f..d0e6db7 100755
--- a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
@@ -107,7 +107,7 @@
CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining));
Action action = async () => {
- var loginSuccess = await HomePage.Instance.LoginByPWDAsync(account, password);
+ var loginSuccess = await HomePage.Instance.LoginByPWDAsync(account, password);
if (loginSuccess==1)
{
new System.Threading.Thread(async () =>
@@ -145,7 +145,7 @@
Config.Instance.Save();
var login = new AccountLogin { };
CommonPage.Instance.AddChidren(login);
- login.Show(account, password);
+ login.Show(account);
}
};
action();
diff --git a/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs b/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs
index 24ca941..432436e 100755
--- a/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs
+++ b/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs
@@ -145,18 +145,19 @@
TextSize = CommonFormResouce.TextSize
};
accountFL.AddChidren(PhoneZoneBtn);
- PhoneZoneBtn.MouseUpEventHandler += (sender, e) =>
- {
- var form = new AreaCodeSelectForm();
- parFL.AddChidren(form);
- form.InitForm();
- form.ShowForm();
- form.FinishSelectEvent += (code) =>
- {
- (sender as Button).Text = "+" + code;
- CommonPage.PhoneZoneStr = code;
- };
- };
+ //鐩墠鍙拡瀵�+86
+ //PhoneZoneBtn.MouseUpEventHandler += (sender, e) =>
+ //{
+ // var form = new AreaCodeSelectForm();
+ // parFL.AddChidren(form);
+ // form.InitForm();
+ // form.ShowForm();
+ // form.FinishSelectEvent += (code) =>
+ // {
+ // (sender as Button).Text = "+" + code;
+ // CommonPage.PhoneZoneStr = code;
+ // };
+ //};
AccountET = new EditText()
{
@@ -226,16 +227,13 @@
/// <param name="frameLayout"></param>
/// <param name="account"></param>
public void Init(FrameLayout frameLayout, FrameLayout parFL, string account, int x, int y)
- {
- var accountFL = new FrameLayout()
- {
- X = Application.GetRealWidth(x),
- Y = Application.GetRealHeight(y),
- Width = Application.GetRealWidth(CommonFormResouce.Row_Width),
- Height = Application.GetRealHeight(CommonFormResouce.Row_Height),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- frameLayout.AddChidren(accountFL);
+ {
+ this.X = Application.GetRealWidth(x);
+ this.Y = Application.GetRealHeight(y);
+ this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width);
+ this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height);
+ this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+ frameLayout.AddChidren(this);
var accountBtn = new Button()
{
@@ -245,7 +243,7 @@
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = "Account/Account.png"
};
- accountFL.AddChidren(accountBtn);
+ this.AddChidren(accountBtn);
AccountET = new EditText()
{
@@ -258,9 +256,10 @@
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
Text = account,
TextAlignment = TextAlignment.CenterLeft,
- TextSize = CommonFormResouce.PlaceHolderTextSize
+ TextSize = CommonFormResouce.PlaceHolderTextSize,
+ IsNumberKeyboardType = true
};
- accountFL.AddChidren(AccountET);
+ this.AddChidren(AccountET);
accountLine = new Button()
{
@@ -269,7 +268,7 @@
Height = 1,
BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor
};
- accountFL.AddChidren(accountLine);
+ this.AddChidren(accountLine);
AccountET.FoucsChanged += Text_FoucesChangeEvent;
@@ -407,16 +406,13 @@
/// <param name="frameLayout"></param>
/// <param name="account"></param>
public void Init(FrameLayout frameLayout, string account, int x, int y)
- {
- var accountFL = new FrameLayout()
- {
- X = Application.GetRealWidth(x),
- Y = Application.GetRealHeight(y),
- Width = Application.GetRealWidth(CommonFormResouce.Row_Width),
- Height = Application.GetRealHeight(CommonFormResouce.Row_Height),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- frameLayout.AddChidren(accountFL);
+ {
+ this.X = Application.GetRealWidth(x);
+ this.Y = Application.GetRealHeight(y);
+ this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width);
+ this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height);
+ this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+ frameLayout.AddChidren(this);
var accountBtn = new Button()
{
@@ -426,11 +422,11 @@
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = "Account/Account.png"
};
- accountFL.AddChidren(accountBtn);
+ this.AddChidren(accountBtn);
AccountET = new EditText()
{
- X = Application.GetRealWidth(222),
+ X = Application.GetRealWidth(193),
Width = Application.GetRealWidth(700),
Height = Application.GetRealHeight(Button_Height),
Gravity = Gravity.CenterVertical,
@@ -441,7 +437,7 @@
TextAlignment = TextAlignment.CenterLeft,
TextSize = CommonFormResouce.PlaceHolderTextSize
};
- accountFL.AddChidren(AccountET);
+ this.AddChidren(AccountET);
accountLine = new Button()
{
@@ -450,7 +446,7 @@
Height = 1,
BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor
};
- accountFL.AddChidren(accountLine);
+ this.AddChidren(accountLine);
AccountET.FoucsChanged += Text_FoucesChangeEvent;
}
@@ -828,16 +824,13 @@
/// <param name="x"></param>
/// <param name="y"></param>
public void Init(FrameLayout frameLayout, int x, int y, string password = "")
- {
- var pwdFL = new FrameLayout()
- {
- X = Application.GetRealWidth(x),
- Y = Application.GetRealHeight(y),
- Width = Application.GetRealWidth(CommonFormResouce.Row_Width),
- Height = Application.GetRealHeight(CommonFormResouce.Row_Height),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- frameLayout.AddChidren(pwdFL);
+ {
+ this.X = Application.GetRealWidth(x);
+ this.Y = Application.GetRealHeight(y);
+ this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width);
+ this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height);
+ this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+ frameLayout.AddChidren(this);
var passwordBtn = new Button()
{
@@ -847,7 +840,7 @@
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = "Account/Password.png"
};
- pwdFL.AddChidren(passwordBtn);
+ this.AddChidren(passwordBtn);
PasswrodET = new EditText()
{
@@ -863,7 +856,7 @@
TextSize = CommonFormResouce.PlaceHolderTextSize,
SecureTextEntry = true
};
- pwdFL.AddChidren(PasswrodET);
+ this.AddChidren(PasswrodET);
hidenPWDbtn = new Button()
{
@@ -875,7 +868,7 @@
UnSelectedImagePath = "Account/UnhidePwd.png",
IsSelected = true
};
- pwdFL.AddChidren(hidenPWDbtn);
+ this.AddChidren(hidenPWDbtn);
hidenPWDbtn.MouseUpEventHandler += (sender, e) =>
{
@@ -890,7 +883,7 @@
Height = 1,
BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor
};
- pwdFL.AddChidren(pwdLine);
+ this.AddChidren(pwdLine);
PasswrodET.FoucsChanged += Text_FoucesChangeEvent;
}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
index ecd5188..9ecbb97 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
@@ -14,6 +14,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 璁惧瀵硅薄
+ /// </summary>
+ public CommonDevice device = null;
+ /// <summary>
/// 鍗$墖闇�瑕佽绉婚櫎鐨勪簨浠�
/// </summary>
public Action CardNeedRemoveEvent = null;
@@ -28,7 +32,7 @@
/// <summary>
/// 璁惧鐨勮儗鏅渾鍦堝浘鎺т欢
/// </summary>
- private NormalViewControl btnDeviceRound = null;
+ private FrameLayout fraDeviceRound = null;
/// <summary>
/// 璁惧鍥炬爣鎺т欢
/// </summary>
@@ -42,9 +46,17 @@
/// </summary>
private PicViewControl btnSwitch = null;
/// <summary>
+ /// 鏀堕泦鎺т欢
+ /// </summary>
+ private IconViewControl btnCollect = null;
+ /// <summary>
/// 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋� 0:娌℃湁鑾峰彇寰楀埌 1:宸茬粡鑾峰彇寰楀埌
/// </summary>
private int ResponeResult = 0;
+ /// <summary>
+ /// 鍒ゆ柇鏄惁鏈夊紑鍏冲姛鑳�
+ /// </summary>
+ private bool isHadOpenSwitch = true;
#endregion
@@ -69,6 +81,7 @@
/// <param name="i_device">鎸囧畾璁惧</param>
public virtual void InitControl(CommonDevice i_device)
{
+ this.device = i_device;
//鑳屾櫙鍥剧墖
this.btnBackGroud = new PicViewControl(this.Width, this.Height, false);
btnBackGroud.UnSelectedImagePath = "Item/FunctionCardView.png";
@@ -87,7 +100,7 @@
this.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
//鏀堕泦鎺т欢
- var btnCollect = new IconViewControl(107);
+ this.btnCollect = new IconViewControl(107);
btnCollect.X = Application.GetMinRealAverage(350);
btnCollect.Y = Application.GetMinRealAverage(12);
btnCollect.UnSelectedImagePath = "Item/Collection1.png";
@@ -116,19 +129,20 @@
};
//璁惧鐨勮儗鏅渾鍦堝浘
- this.btnDeviceRound = new NormalViewControl(Application.GetMinRealAverage(124), Application.GetMinRealAverage(124), false);
- btnDeviceRound.Radius = (uint)Application.GetMinRealAverage(124) / 2;
- btnDeviceRound.X = Application.GetMinRealAverage(44);
- btnDeviceRound.Y = Application.GetMinRealAverage(101);
- btnDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor;
- btnDeviceRound.SelectedBackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionBackgroundColor;
- this.AddChidren(btnDeviceRound, ChidrenBindMode.BindEventOnly);
+ this.fraDeviceRound = new FrameLayout();
+ fraDeviceRound.Width = Application.GetMinRealAverage(124);
+ fraDeviceRound.Height = Application.GetMinRealAverage(124);
+ fraDeviceRound.Radius = (uint)Application.GetMinRealAverage(124) / 2;
+ fraDeviceRound.X = Application.GetMinRealAverage(44);
+ fraDeviceRound.Y = Application.GetMinRealAverage(101);
+ fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor;
+ this.AddChidren(fraDeviceRound, ChidrenBindMode.BindEventOnly);
//璁惧鍥炬爣鎺т欢
this.btnDeviceIcon = new IconViewControl(86);
- btnDeviceIcon.X = Application.GetMinRealAverage(63);
- btnDeviceIcon.Y = Application.GetMinRealAverage(121);
- this.AddChidren(btnDeviceIcon, ChidrenBindMode.BindEventOnly);
+ btnDeviceIcon.Gravity = Gravity.Center;
+ fraDeviceRound.AddChidren(btnDeviceIcon);
+ this.ChangedChidrenBindMode(fraDeviceRound, ChidrenBindMode.BindEventOnly);
//鐘舵�佹枃鏈帶浠�
this.btnStatu = new NormalViewControl(Application.GetMinRealAverage(280), Application.GetMinRealAverage(63), false);
@@ -145,8 +159,6 @@
btnSwitch.Y = Application.GetMinRealAverage(202);
btnSwitch.UnSelectedImagePath = "Item/Switch1.png";
btnSwitch.SelectedImagePath = "Item/SwitchSelected1.png";
- this.AddChidren(this.btnSwitch, ChidrenBindMode.NotBind);
- btnSwitch.Visible = false;
//鍒锋柊淇℃伅
this.RefreshControlInfo(i_device);
@@ -162,7 +174,7 @@
/// <returns></returns>
public PicViewControl AddSwitchControl()
{
- btnSwitch.Visible = true;
+ this.AddChidren(this.btnSwitch, ChidrenBindMode.NotBind);
return btnSwitch;
}
@@ -176,21 +188,27 @@
/// <param name="i_device">璁惧瀵硅薄,涓嶆槸鎺ㄩ�佺殑閭d釜</param>
public void RefreshControlInfo(CommonDevice i_device)
{
- //璁惧鐘舵�佸繀椤诲埛鏂�
- this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(i_device);
+ bool collect = HdlRoomLogic.Current.IsCollectInRoom(i_device);
+ if (btnCollect.IsSelected != collect)
+ {
+ btnCollect.IsSelected = collect;
+ }
//璁惧鍥炬爣涔熷埛鏂�
- Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
+ Common.LocalDevice.Current.SetDeviceIconToControl2(btnDeviceIcon, i_device);
//妫�娴嬭澶囨槸鍚︽槸鎵撳紑鐘舵��
bool isOpen = this.CheckIsOpenStatu(i_device);
- this.SetCardStatu(isOpen);
+ this.SetCardOpenStatu(isOpen);
}
/// <summary>
/// 璁剧疆鍗$墖鐘舵��
/// </summary>
/// <param name="isOpen"></param>
- public void SetCardStatu(bool isOpen)
+ public void SetCardOpenStatu(bool isOpen)
{
+ //璁惧鐘舵�佸繀椤诲埛鏂�
+ this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
+
if (this.btnBackGroud.IsSelected == isOpen)
{
//鐘舵�佷竴鏍�,鍒欎笉闇�瑕佸鐞�
@@ -202,13 +220,37 @@
this.btnDeviceName.IsSelected = isOpen;
this.btnDeviceName.IsBold = isOpen;
//璁惧鐨勮儗鏅渾鍦堝浘
- this.btnDeviceRound.IsSelected = isOpen;
+ if (isOpen == true)
+ {
+ fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionBackgroundColor;
+ }
+ else
+ {
+ fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor;
+ }
//璁惧鍥炬爣鎺т欢
this.btnDeviceIcon.IsSelected = isOpen;
//鐘舵�佹枃鏈帶浠�
this.btnStatu.IsSelected = isOpen;
//寮�鍏虫帶浠�
- this.btnSwitch.IsSelected = isOpen;
+ if (btnSwitch != null)
+ {
+ this.btnSwitch.IsSelected = isOpen;
+ }
+ }
+
+ /// <summary>
+ /// 璁剧疆鍗$墖鐨勫湪绾跨姸鎬�
+ /// </summary>
+ /// <param name="isOnline">鍦ㄧ嚎</param>
+ public void SetCardOnlineStatu(bool isOnline)
+ {
+ if (this.isHadOpenSwitch == true)
+ {
+ //濡傛灉杩欎釜璁惧鏈夊紑鍏冲姛鑳�,鍒欏湪绾跨姸鎬佷笉浼氭敼鍙樼姸鎬�
+ return;
+ }
+ this.SetCardOpenStatu(isOnline);
}
/// <summary>
@@ -227,8 +269,7 @@
/// <summary>
/// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
/// </summary>
- /// <param name="i_device"></param>
- public virtual void SendStatuComand(CommonDevice i_device)
+ public virtual void SendStatuComand()
{
return;
}
@@ -244,6 +285,8 @@
/// <returns></returns>
public virtual bool CheckIsOpenStatu(CommonDevice i_device)
{
+ //濡傛灉杩欎釜鍑芥暟琚噸鍐欑殑璇�,鍒欎唬琛ㄨ繖涓澶囨湁寮�鍏冲姛鑳�
+ this.isHadOpenSwitch = false;
//榛樿鐢ㄥ湪绾跨姸鎬佹潵鍒ゆ柇
return i_device.IsOnline == 1;
}
@@ -290,9 +333,12 @@
public void StartCheckResponeResult(bool oldOpenStatu)
{
this.ResponeResult = 0;
+ //寮�鍏虫寜閽笉鑳藉啀鐐瑰嚮
+ if (btnSwitch != null) { this.btnSwitch.CanClick = false; }
+
HdlThreadLogic.Current.RunThread(() =>
{
- int waitime = 30 * 100;
+ int waitime = 30;
while (waitime > 0)
{
System.Threading.Thread.Sleep(100);
@@ -301,6 +347,7 @@
//宸茬粡鑾峰彇寰楀埌鏁版嵁
break;
}
+ waitime--;
}
if (waitime <= 0)
{
@@ -310,9 +357,11 @@
var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.FAIL));
msgContr.Show();
//鍙樻洿鍥炲師鏉ョ殑鐘舵��
- this.SetCardStatu(oldOpenStatu);
+ this.SetCardOpenStatu(oldOpenStatu);
});
}
+ //寮�鍏虫寜閽笉鑳藉啀鐐瑰嚮
+ if (btnSwitch != null) { this.btnSwitch.CanClick = true; }
});
}
@@ -326,6 +375,29 @@
#endregion
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ /// <returns></returns>
+ public bool CheckCanSendStatuComand()
+ {
+ if (this.device.HadReadDeviceStatu == false)
+ {
+ //杩樻病鏈夎鍙栬繃鏁版嵁
+ return true;
+ }
+ if ((DateTime.Now - this.device.LastDateTime).TotalMinutes >= 10)
+ {
+ //10鍒嗛挓鍚庡彲浠ュ啀娆¤幏鍙�
+ return true;
+ }
+ return false;
+ }
+
+ #endregion
+
#region 鈻� 鎺т欢鎽ф瘉___________________________
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs
index 20ec7b1..343c2df 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs
@@ -29,7 +29,7 @@
{
bool setStatu = !btnSwitch.IsSelected;
//鍙樻洿鍗$墖鐘舵��
- this.SetCardStatu(setStatu);
+ this.SetCardOpenStatu(setStatu);
//妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
this.StartCheckResponeResult(!setStatu);
@@ -60,8 +60,6 @@
//娣卞害鍗$墖淇℃伅
this.ButtonClickEvent += (sender, e) =>
{
- Common.CommonPage.Instance.IsDrawerLockMode = true;
-
var lightControl = new Phone.Device.AC.ACControl();
UserView.HomePage.Instance.AddChidren(lightControl);
UserView.HomePage.Instance.PageIndex += 1;
@@ -92,10 +90,13 @@
/// <summary>
/// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
/// </summary>
- /// <param name="i_device"></param>
- public override void SendStatuComand(CommonDevice i_device)
+ public override void SendStatuComand()
{
- Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendACStatuComand(i_device);
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendACStatuComand(this.device);
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs
index 5aaad31..c028337 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs
@@ -29,7 +29,7 @@
{
bool setStatu = !btnSwitch.IsSelected;
//鍙樻洿鍗$墖鐘舵��
- this.SetCardStatu(setStatu);
+ this.SetCardOpenStatu(setStatu);
//妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
this.StartCheckResponeResult(!setStatu);
@@ -60,8 +60,6 @@
//娣卞害鍗$墖淇℃伅
this.ButtonClickEvent += (sender, e) =>
{
- Common.CommonPage.Instance.IsDrawerLockMode = true;
-
var lightControl = new Phone.Device.Light.AirSwitchControl();
UserView.HomePage.Instance.AddChidren(lightControl);
UserView.HomePage.Instance.PageIndex += 1;
@@ -92,10 +90,13 @@
/// <summary>
/// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
/// </summary>
- /// <param name="i_device"></param>
- public override void SendStatuComand(CommonDevice i_device)
+ public override void SendStatuComand()
{
- Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(i_device);
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device);
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
index 0b2751f..f764ca3 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
@@ -29,7 +29,7 @@
{
bool setStatu = !btnSwitch.IsSelected;
//鍙樻洿鍗$墖鐘舵��
- this.SetCardStatu(setStatu);
+ this.SetCardOpenStatu(setStatu);
//妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
this.StartCheckResponeResult(!setStatu);
@@ -60,8 +60,6 @@
//娣卞害鍗$墖淇℃伅
this.ButtonClickEvent += (sender, e) =>
{
- Common.CommonPage.Instance.IsDrawerLockMode = true;
-
var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
UserView.HomePage.Instance.AddChidren(dimmableLightControl);
UserView.HomePage.Instance.PageIndex += 1;
@@ -92,10 +90,13 @@
/// <summary>
/// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
/// </summary>
- /// <param name="i_device"></param>
- public override void SendStatuComand(CommonDevice i_device)
+ public override void SendStatuComand()
{
- Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(i_device);
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(this.device);
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs
index 5ae5246..a5ac473 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs
@@ -29,7 +29,7 @@
{
bool setStatu = !btnSwitch.IsSelected;
//鍙樻洿鍗$墖鐘舵��
- this.SetCardStatu(setStatu);
+ this.SetCardOpenStatu(setStatu);
//妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
this.StartCheckResponeResult(!setStatu);
@@ -60,7 +60,6 @@
//娣卞害鍗$墖淇℃伅
this.ButtonClickEvent += (sender, e) =>
{
- Common.CommonPage.Instance.IsDrawerLockMode = true;
var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
UserView.HomePage.Instance.AddChidren(rollerShadeControl);
UserView.HomePage.Instance.PageIndex += 1;
@@ -92,10 +91,18 @@
/// <summary>
/// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
/// </summary>
- /// <param name="i_device"></param>
- public override void SendStatuComand(CommonDevice i_device)
+ public override void SendStatuComand()
{
- Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(i_device);
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(this.device);
+ }
+ if (((Rollershade)this.device).WcdType == -1)
+ {
+ //璇诲彇绐楀笜绫诲瀷
+ ((Rollershade)this.device).ReadWcdType();
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs
index 914841c..b4c470e 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs
@@ -36,9 +36,8 @@
//娣卞害鍗$墖淇℃伅
this.ButtonClickEvent += (sender, e) =>
{
- Common.CommonPage.Instance.IsDrawerLockMode = true;
-
var userDoorLockPage = new UserCenter.DoorLock.UserDoorLockPage(UserCenter.HdlRoomLogic.Current.CurrentRoom, i_device);
+ userDoorLockPage.IsDrawerLockMode = true;
UserView.HomePage.Instance.AddChidren(userDoorLockPage);
UserView.HomePage.Instance.PageIndex += 1;
userDoorLockPage.Show();
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDryContactCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDryContactCardControl.cs
new file mode 100755
index 0000000..2b0ef1a
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDryContactCardControl.cs
@@ -0,0 +1,77 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.MainPage.Controls
+{
+ /// <summary>
+ /// 骞叉帴鐐瑰崱鐗囨帶浠�(鏆傛椂搴熸)
+ /// </summary>
+ public class DeviceDryContactCardControl: DeviceCardCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device)
+ {
+ base.InitControl(i_device);
+
+ //娣诲姞寮�鍏虫帶浠�
+ var btnSwitch = this.AddSwitchControl();
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ bool setStatu = !btnSwitch.IsSelected;
+ //鍙樻洿鍗$墖鐘舵��
+ this.SetCardOpenStatu(setStatu);
+ //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
+ this.StartCheckResponeResult(!setStatu);
+
+ if (setStatu == true)
+ {
+ //鎵撳紑
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
+ i_device.SwitchControl(1);
+ }
+ else
+ {
+ //鍏抽棴
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close));
+ i_device.SwitchControl(0);
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return true;
+ //return ((LightBase)i_device).OnOffStatus == 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device);
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs
index 22bd1ae..82b698e 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs
@@ -29,7 +29,7 @@
{
bool setStatu = !btnSwitch.IsSelected;
//鍙樻洿鍗$墖鐘舵��
- this.SetCardStatu(setStatu);
+ this.SetCardOpenStatu(setStatu);
//妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
this.StartCheckResponeResult(!setStatu);
@@ -60,8 +60,6 @@
//娣卞害鍗$墖淇℃伅
this.ButtonClickEvent += (sender, e) =>
{
- Common.CommonPage.Instance.IsDrawerLockMode = true;
-
var lightControl = new Phone.Device.Light.OnOffControl();
UserView.HomePage.Instance.AddChidren(lightControl);
UserView.HomePage.Instance.PageIndex += 1;
@@ -92,10 +90,13 @@
/// <summary>
/// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
/// </summary>
- /// <param name="i_device"></param>
- public override void SendStatuComand(CommonDevice i_device)
+ public override void SendStatuComand()
{
- Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(i_device);
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device);
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs
index 60c97e1..b9b5160 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs
@@ -15,11 +15,13 @@
/// <summary>
/// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
/// </summary>
- /// <param name="i_device"></param>
- public override void SendStatuComand(CommonDevice i_device)
+ public override void SendStatuComand()
{
- (i_device as TemperatureSensor).ReadTemperatureOrHumidity();
- Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(i_device);
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ (this.device as TemperatureSensor).ReadTemperatureOrHumidity();
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs
new file mode 100755
index 0000000..f23edeb
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs
@@ -0,0 +1,98 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.MainPage.Controls
+{
+ /// <summary>
+ /// 鏈垎閰嶇晫闈㈢殑璁惧鍔熻兘鍥炬爣鎺т欢
+ /// </summary>
+ public class DeviceFunctionUnallocatedControl : FrameLayoutControl
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鑳屾櫙鎺т欢
+ /// </summary>
+ private PicViewControl btnBackGroud = null;
+ /// <summary>
+ /// 璁惧鍥炬爣鎺т欢
+ /// </summary>
+ private IconViewControl btnDeviceIcon = null;
+ /// <summary>
+ /// 鏂囨湰鎺т欢
+ /// </summary>
+ private NormalViewControl btnDeviceName = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鏈垎閰嶇晫闈㈢殑璁惧鍔熻兘鍥炬爣鎺т欢
+ /// </summary>
+ public DeviceFunctionUnallocatedControl()
+ {
+ this.Width = Application.GetRealWidth(220);
+ this.Height = Application.GetRealHeight(279);
+ this.UseClickStatu = false;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖�
+ /// </summary>
+ /// <param name="text">鏄剧ず鐨勬枃鏈�</param>
+ /// <param name="unSelectPath">鍥剧墖1</param>
+ /// <param name="selectPath">鍥剧墖2</param>
+ /// <param name="listDevice">璁惧鍒楄〃</param>
+ public void InitControl(string text, string unSelectPath, string selectPath, List<string> listDevice)
+ {
+ //鑳屾櫙鎺т欢
+ this.btnBackGroud = new PicViewControl(150, 173);
+ btnBackGroud.Y = Application.GetRealHeight(35);
+ btnBackGroud.Gravity = Gravity.CenterHorizontal;
+ btnBackGroud.UnSelectedImagePath = "Item/Category_FunctionBG.png";
+ btnBackGroud.SelectedImagePath = "Item/Category_FunctionBGSelected.png";
+ this.AddChidren(btnBackGroud, ChidrenBindMode.BindEventOnly);
+
+ //璁惧鍥炬爣
+ this.btnDeviceIcon = new IconViewControl(84);
+ btnDeviceIcon.Y = Application.GetRealHeight(63);
+ btnDeviceIcon.UnSelectedImagePath = unSelectPath;
+ btnDeviceIcon.SelectedImagePath = selectPath;
+ btnDeviceIcon.Gravity = Gravity.CenterHorizontal;
+ this.AddChidren(btnDeviceIcon, ChidrenBindMode.BindEventOnly);
+
+ //鏂囨湰
+ this.btnDeviceName = new NormalViewControl(170, 60, true);
+ btnDeviceName.Y = Application.GetRealHeight(200);
+ btnDeviceName.Gravity = Gravity.CenterHorizontal;
+ btnDeviceName.TextColor = Common.ZigbeeColor.Current.GXCTextBlackColor;
+ btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
+ btnDeviceName.TextSize = 11;
+ btnDeviceName.Text = text;
+ btnDeviceName.TextAlignment = TextAlignment.Center;
+ this.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ }
+
+ #endregion
+
+ #region 鈻� 璁剧疆鐘舵�乢__________________________
+
+ /// <summary>
+ /// 璁剧疆閫夋嫨鐘舵��
+ /// </summary>
+ /// <param name="isSelect"></param>
+ public void SetSelectStatu(bool isSelect)
+ {
+ this.btnBackGroud.IsSelected = isSelect;
+ this.btnDeviceIcon.IsSelected = isSelect;
+ this.btnDeviceName.IsSelected = isSelect;
+ this.btnDeviceName.IsBold = isSelect;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs
new file mode 100755
index 0000000..aafb758
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs
@@ -0,0 +1,176 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.MainPage.Controls
+{
+ /// <summary>
+ /// 鏈垎閰嶇晫闈㈢殑璁惧閫夋嫨鎺т欢
+ /// </summary>
+ public class DeviceSelectUnallocatedControl : FrameRowControl
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 璁惧瀵硅薄
+ /// </summary>
+ public CommonDevice device;
+ /// <summary>
+ /// 鐘舵��
+ /// </summary>
+ private StatuMode Statu = StatuMode.UN_SELECT;
+ /// <summary>
+ /// 鏄惁澶勪簬閫夋嫨鐘舵��
+ /// </summary>
+ public bool IsSelected
+ {
+ get { return Statu == StatuMode.SELECT; }
+ set
+ {
+ if (value == false)
+ {
+ this.SetUnselectStatu();
+ }
+ else
+ {
+ this.SetSelectStatu();
+ }
+ }
+ }
+
+ /// <summary>
+ /// 璁惧鍥炬爣鑳屾櫙鎺т欢
+ /// </summary>
+ private FrameLayout frameIconBackGroud = null;
+ /// <summary>
+ /// 璁惧鍥炬爣鎺т欢
+ /// </summary>
+ private IconViewControl btnDeviceIcon = null;
+ /// <summary>
+ /// 璁惧鍚嶅瓧鎺т欢
+ /// </summary>
+ private NormalViewControl btnDeviceName = null;
+ /// <summary>
+ /// 閫夋嫨鎺т欢
+ /// </summary>
+ private MostRightIconControl btnSelect = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鏈垎閰嶇晫闈㈢殑璁惧閫夋嫨鎺т欢
+ /// </summary>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ public DeviceSelectUnallocatedControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+ {
+ this.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device">璁惧瀵硅薄</param>
+ public void InitControl(CommonDevice i_device)
+ {
+ this.device = i_device;
+ //璁惧鍥炬爣鑳屾櫙鎺т欢
+ this.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;
+ this.AddChidren(frameIconBackGroud, ChidrenBindMode.NotBind);
+ if (chidrenYaxis != 0)
+ {
+ frameIconBackGroud.Y += chidrenYaxis;
+ }
+
+ //璁惧鍥炬爣鎺т欢
+ this.btnDeviceIcon = new IconViewControl(78);
+ btnDeviceIcon.Gravity = Gravity.Center;
+ Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
+ frameIconBackGroud.AddChidren(btnDeviceIcon);
+ //閲嶆柊缁戝畾浜嬩欢
+ this.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEventOnly);
+
+ //璁惧鍚嶅瓧
+ this.btnDeviceName = new NormalViewControl(Application.GetRealWidth(600), this.Height, false);
+ btnDeviceName.X = Application.GetRealWidth(181);
+ btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
+ btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
+ btnDeviceName.Gravity = Gravity.CenterVertical;
+ this.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ if (chidrenYaxis != 0)
+ {
+ btnDeviceName.Y += chidrenYaxis;
+ }
+
+ //閫夋嫨鎺т欢
+ this.btnSelect = new MostRightIconControl(70, 70);
+ btnSelect.X = Application.GetRealWidth(895);
+ btnSelect.UseClickStatu = false;
+ btnSelect.UnSelectedImagePath = "Room/ItemUnSelected_Black.png";
+ btnSelect.SelectedImagePath = "Room/ItemSelected.png";
+ this.AddChidren(btnSelect, ChidrenBindMode.NotBind);
+ btnSelect.InitControl();
+ //澶嶅悎鎺т欢闇�瑕佺壒娈婂鐞�
+ this.ChangedChidrenBindMode(btnSelect, ChidrenBindMode.BindEventOnly);
+ if (chidrenYaxis != 0)
+ {
+ btnSelect.btnIcon.Y += chidrenYaxis;
+ }
+
+ //搴曠嚎
+ var btnBottomLine = new NormalViewControl(Application.GetRealWidth(835), ControlCommonResourse.BottomLineHeight, false);
+ btnBottomLine.X = Application.GetRealWidth(181);
+ btnBottomLine.Y = this.Height - ControlCommonResourse.BottomLineHeight;
+ btnBottomLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+ this.AddChidren(btnBottomLine, ChidrenBindMode.NotBind);
+ }
+
+ #endregion
+
+ #region 鈻� 閫夋嫨鐘舵�乢__________________________
+
+ /// <summary>
+ /// 璁惧畾閫夋嫨鐘舵��
+ /// </summary>
+ private void SetSelectStatu()
+ {
+ if (Statu == StatuMode.SELECT)
+ {
+ return;
+ }
+ btnDeviceIcon.IsSelected = true;
+ btnDeviceName.IsSelected = true;
+ frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCSelectedBackgroundColor;
+ btnSelect.IsSelected = true;
+ //鐘舵�佸彉鏇�
+ Statu = StatuMode.SELECT;
+ }
+
+ /// <summary>
+ /// 璁剧疆闈為�夋嫨鐘舵��
+ /// </summary>
+ private void SetUnselectStatu()
+ {
+ if (Statu == StatuMode.UN_SELECT)
+ {
+ return;
+ }
+ btnDeviceIcon.IsSelected = false;
+ btnDeviceName.IsSelected = false;
+ frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor;
+ btnSelect.IsSelected = false;
+ //鐘舵�佸彉鏇�
+ Statu = StatuMode.UN_SELECT;
+ }
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
new file mode 100755
index 0000000..d0773fd
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
@@ -0,0 +1,125 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.MainPage.Controls
+{
+ /// <summary>
+ /// 宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈤噷闈㈢殑鎴块棿鍗$墖鎺т欢
+ /// </summary>
+ public class ListRoomCardControl : FrameLayoutControl
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鎴块棿ID
+ /// </summary>
+ private string roomId = string.Empty;
+ /// <summary>
+ /// 鎴块棿鍥剧墖鎺т欢
+ /// </summary>
+ private ImageView picRoom = null;
+ /// <summary>
+ /// 鎴块棿鍚嶇О鎺т欢
+ /// </summary>
+ private NormalViewControl btnRoomName = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈤噷闈㈢殑鎴块棿鍗$墖鎺т欢
+ /// </summary>
+ public ListRoomCardControl()
+ {
+ this.Width = Application.GetRealWidth(495);
+ this.Height = Application.GetRealHeight(354);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨埧闂村崱鐗囨帶浠�
+ /// </summary>
+ /// <param name="room"></param>
+ public void InitControl(Common.Room room)
+ {
+ this.roomId = room.Id;
+
+ //鎴块棿搴曢儴闃村奖鏁堟灉
+ var btnRoomShadow = new NormalViewControl(this.Width, this.Height, false);
+ btnRoomShadow.UnSelectedImagePath = "Room/RoomCardView.png";
+ this.AddChidren(btnRoomShadow, ChidrenBindMode.NotBind);
+
+ //鎴块棿鍥剧墖
+ this.picRoom = new ImageView();
+ picRoom.Gravity = Gravity.CenterHorizontal;
+ picRoom.Width = Application.GetRealWidth(467);
+ picRoom.Height = Application.GetRealHeight(311);
+ picRoom.Radius = (uint)Application.GetRealHeight(29);
+ this.AddChidren(picRoom, ChidrenBindMode.NotBind);
+
+ //閬僵
+ var frameBack = new NormalViewControl(picRoom.Width, picRoom.Height, false);
+ frameBack.Gravity = picRoom.Gravity;
+ frameBack.Radius = picRoom.Radius;
+ frameBack.BackgroundColor = 0x33000000;
+ this.AddChidren(picRoom, ChidrenBindMode.BindEventOnly);
+
+ //鎴块棿鍚嶅瓧鐨勮儗鏅�
+ var btnRoomNameBackGroud = new NormalViewControl(Application.GetRealWidth(141), Application.GetRealHeight(84), false);
+ btnRoomNameBackGroud.X = Application.GetRealWidth(14);
+ btnRoomNameBackGroud.UnSelectedImagePath = "Room/RoomCardView_Name.png";
+ this.AddChidren(btnRoomNameBackGroud, ChidrenBindMode.BindEventOnly);
+
+ //鎴块棿鍚嶅瓧
+ this.btnRoomName = new NormalViewControl(btnRoomNameBackGroud.Width, btnRoomNameBackGroud.Height, false);
+ btnRoomName.X = Application.GetRealWidth(14);
+ btnRoomName.TextSize = 12;
+ btnRoomName.IsBold = true;
+ btnRoomName.TextAlignment = TextAlignment.Center;
+ btnRoomName.TextColor = UserCenterColor.Current.White;
+ this.AddChidren(btnRoomName, ChidrenBindMode.BindEventOnly);
+
+ //鍒锋柊鎺т欢淇℃伅
+ this.RefreshControl();
+ }
+
+ #endregion
+
+ #region 鈻� 鍒锋柊鎺т欢___________________________
+
+ /// <summary>
+ /// 鍒锋柊鎺т欢淇℃伅
+ /// </summary>
+ public void RefreshControl()
+ {
+ var room = HdlRoomLogic.Current.GetRoomById(this.roomId);
+ if (room != null)
+ {
+ //鍒锋柊鍚嶅瓧
+ btnRoomName.Text = room.Name;
+ if (btnRoomName.GetRealWidthByText() > Application.GetRealWidth(141))
+ {
+ //瀛椾綋闀垮害瓒呰繃
+ btnRoomName.TextAlignment = TextAlignment.CenterLeft;
+ }
+ else
+ {
+ btnRoomName.TextAlignment = TextAlignment.Center;
+ }
+ //鍒锋柊鍥剧墖
+ if (room.BackgroundImageType == 0)
+ {
+ picRoom.ImagePath = room.BackgroundImage;
+ }
+ else
+ {
+ picRoom.ImagePath = System.IO.Path.Combine(Common.Config.Instance.FullPath, room.BackgroundImage);
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs
index def39fb..7290a4b 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs
@@ -59,8 +59,6 @@
this.ButtonClickEvent += (sender, e) =>
{
- //寮�鍚疞oading鐗规晥
- this.StartLoadingApreal();
//璋冪敤鍦烘櫙
this.SetSceneAction();
};
@@ -73,6 +71,9 @@
public void InitControl(Common.SceneUI i_scene)
{
this.SceneId = i_scene.Id;
+ string hourText = Language.StringByID(R.MyInternationalizationString.Hour);
+ string minuText = Language.StringByID(R.MyInternationalizationString.Minute);
+ string secondText = Language.StringByID(R.MyInternationalizationString.Second);
//鍦烘櫙鍥剧墖鎺т欢
this.btnScenePic = new ImageView();
@@ -93,6 +94,10 @@
btnTimeView.Y = Application.GetMinRealAverage(10);
btnTimeView.TextColor = 0xffffb400;
btnTimeView.IsBold = true;
+ if (i_scene.SceneDelayTime > 0)
+ {
+ btnTimeView.Text= this.GetTimeString(i_scene.SceneDelayTime, hourText, minuText, secondText);
+ }
this.AddChidren(btnTimeView, ChidrenBindMode.BindEventOnly);
//鏃堕棿鍥炬爣鎺т欢
@@ -100,7 +105,34 @@
btnTimeIcon.X = Application.GetMinRealAverage(37);
btnTimeIcon.Y = Application.GetMinRealAverage(20);
btnTimeIcon.UnSelectedImagePath = "Item/Time.png";
- this.AddChidren(btnTimeIcon, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnTimeIcon, ChidrenBindMode.NotBind);
+ if (i_scene.SceneDelayTime > 0)
+ {
+ btnTimeIcon.Visible = false;
+ }
+ btnTimeIcon.ButtonClickEvent += (sender, e) =>
+ {
+ if (i_scene.RemainTime > 0)
+ {
+ //璇ュ満鏅鍦ㄥ欢鏃讹紝璇风◢鍚�
+ var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying));
+ msgContr.Show();
+ return;
+ }
+ var timeSelect = new Device.CommonForm.SelectTime();
+ Common.CommonPage.Instance.AddChidren(timeSelect);
+ timeSelect.TempTime = i_scene.SceneDelayTime;
+ timeSelect.Init();
+ timeSelect.TimeAction = (time) =>
+ {
+ i_scene.SceneDelayTime = time;
+
+ //鏃堕棿鍥炬爣涓嶆樉绀�
+ this.btnTimeIcon.Visible = false;
+ //鏄剧ず鍓╀綑鐨勬椂闂�
+ this.btnTimeView.Text = this.GetTimeString(time, hourText, minuText, secondText);
+ };
+ };
//鏀惰棌鎺т欢
var btnCollect = new IconViewControl(107);
@@ -154,38 +186,22 @@
{
//杩欎釜鍦烘櫙涓嶈鐨勬儏鍐靛簲璇ヤ笉鍙兘
var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(this.SceneId);
- if (scene.RemainTime > 0 )
+ if (scene.SceneDelayTime <= 0 && scene.RemainTime <= 0)
{
- //璇ュ満鏅鍦ㄥ欢鏃讹紝璇风◢鍚�
- var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying));
- msgContr.Show();
- return;
+ //濡傛灉娌℃湁寤惰繜鐨勮瘽,鐩存帴寮�鍚疞oading鐗规晥
+ this.StartLoadingApreal();
}
//鎵ц璋冪敤鍦烘櫙
- var result = await ZigBee.Device.Scene.ControlSceneAsync(scene.Id, scene.SceneDelayTime);
- if (result == null || result.sceneOpenData == null)
+ var result = await HdlSceneLogic.Current.ControlScene(scene);
+ if (result == false)
{
- //鎺у埗鍦烘櫙澶辫触
- string msg = Language.StringByID(R.MyInternationalizationString.ControlSceneFail);
- //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
- msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
- var msgContr = new ShowMsgControl(ShowMsgType.Tip, msg);
- msgContr.Show();
- return;
- }
- if (result.sceneOpenData.Result == 0)
- {
- //鎺у埗鍦烘櫙澶辫触
- string msg = Language.StringByID(R.MyInternationalizationString.ControlSceneFail);
- var msgContr = new ShowMsgControl(ShowMsgType.Tip, msg);
- msgContr.Show();
return;
}
//淇敼鏃堕棿
scene.RemainTime = scene.SceneDelayTime;
scene.SceneDelayTime = 0;
//寮�鍚欢鏃跺�掕鏃剁壒鏁�
- this.StartRemainTimeApreal(scene, true);
+ this.StartRemainTimeApreal(scene);
}
#endregion
@@ -218,7 +234,7 @@
}
//寮�鍚欢鏃跺�掕鏃剁壒鏁�
- this.StartRemainTimeApreal(i_scene, false);
+ this.StartRemainTimeApreal(i_scene);
}
#endregion
@@ -229,8 +245,7 @@
/// 寮�鍚欢鏃跺�掕鏃剁壒鏁�
/// </summary>
/// <param name="i_scene"></param>
- /// <param name="setTime">鏄惁鏇存敼鍦烘櫙瀵硅薄閲岄潰鐨勯偅涓椂闂�,鏃ㄥ湪瀵瑰簲鍚屼竴涓満鏅湪澶氫釜鍦版柟鏄剧ず鐨勫悓姝ラ棶棰�</param>
- private void StartRemainTimeApreal(Common.SceneUI i_scene, bool setTime)
+ private void StartRemainTimeApreal(Common.SceneUI i_scene)
{
if (i_scene.RemainTime <= 0)
{
@@ -246,29 +261,27 @@
//鏄剧ず鍓╀綑鐨勬椂闂�
this.btnTimeView.Text = this.GetTimeString(i_scene.RemainTime, hourText, minuText, secondText);
+ //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾)
+ HdlSceneLogic.Current.StartDelayTimeThread(i_scene);
+
new System.Threading.Thread(() =>
{
- while (remainTine > 0)
+ while (remainTine > 0 && this.Parent != null)
{
System.Threading.Thread.Sleep(1000);
Application.RunOnMainThread(() =>
{
this.btnTimeView.Text = this.GetTimeString(remainTine, hourText, minuText, secondText);
});
- if (setTime == true)
- {
- //瑕嗙洊鍓╀綑鏃堕棿
- i_scene.RemainTime = remainTine;
- }
+ remainTine--;
}
Application.RunOnMainThread(() =>
{
- //鏃犳潯浠惰鐩栧墿浣欐椂闂�
- i_scene.RemainTime = 0;
-
//鍊掕鏃剁粨鏉熸椂锛屾椂闂村浘鏍囨樉绀�
this.btnTimeIcon.Visible = true;
this.btnTimeView.Text = string.Empty;
+ //鐩存帴寮�鍚疞oading鐗规晥
+ this.StartLoadingApreal();
});
})
{ IsBackground = true }.Start();
@@ -291,7 +304,7 @@
var loadContr = new MyProgressLoading();
loadContr.LoadingBackgroundColor = UserCenterColor.Current.Transparent;
frameBack.AddChidren(loadContr);
- loadContr.StartLoading();
+ loadContr.StartLoading(1000);
loadContr.DisponeEvent += () =>
{
frameBack.RemoveFromParent();
@@ -330,7 +343,7 @@
int hour = second / 3600;
int minu = second % 3600 / 60;
int sec = second % 60;
- if (hour >= 0)
+ if (hour > 0)
{
timeStr += hour + hourText;
}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
new file mode 100755
index 0000000..2dfd8a5
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
@@ -0,0 +1,1209 @@
+锘縰sing Shared.Common;
+using Shared.Phone.Device.CommonForm;
+using Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.MainPage
+{
+ /// <summary>
+ /// 涓婚〉(娉ㄦ剰,BodyFrameLyout鏄満鏅拰鍔熻兘鐨勬甯�)
+ /// </summary>
+ public class HomeMainPageForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鎴块棿鐨勬粦鍔ㄥ鍣ㄦ帶浠�
+ /// </summary>
+ private HorizontalPages roomPageView = null;
+ /// <summary>
+ /// 璁惧鍗$墖鎺т欢(涓婚敭涓�:璁惧涓婚敭)
+ /// </summary>
+ private Dictionary<string, Controls.DeviceCardCommon> dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
+ /// <summary>
+ /// 鍦烘櫙鍗$墖鎺т欢(涓婚敭涓�:鍦烘櫙ID)
+ /// </summary>
+ private Dictionary<int, Controls.SceneCardControl> dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
+ /// <summary>
+ /// 妤煎眰鍚嶅瓧鎺т欢
+ /// </summary>
+ private NormalViewControl btnFloorName = null;
+ /// <summary>
+ /// 鎴块棿姝e湪鍙樻洿涓�
+ /// </summary>
+ private bool isRoomChanging = false;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐣岄潰鏄剧ず
+ /// </summary>
+ public void ShowForm()
+ {
+ //鍏堝垵濮嬪寲宸︽粦鎴块棿鍒楄〃鐣岄潰
+ if (ListRoomViewFrom.Instance == null)
+ {
+ var roomList = new ListRoomViewFrom();
+ CommonPage.Instance.AddLeftView(roomList);
+ roomList.ShowForm();
+ }
+ this.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
+ //娓呴櫎鍏ㄩ儴
+ this.RemoveAll();
+
+ //鍒濆鍖栧ご閮ㄦ帶浠�
+ this.InitTopFrameLayoutControl();
+ //鍒濆鍖栦腑闂存帶浠�
+ this.InitMidFrameLayoutControl();
+ //娣诲姞璁惧鐘舵�佷笂鎶ヤ簨浠�
+ this.AddNormalDeviceReportEvent();
+ //娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠�
+ this.AddSensorDeviceReportEvent();
+ //灏嗗綋鍓嶇殑鐢婚潰淇濆瓨鍒板唴瀛樺綋涓�
+ UserCenterLogic.AddActionForm(this);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧ご閮ㄦ帶浠�
+ /// </summary>
+ private void InitTopFrameLayoutControl()
+ {
+ //澶撮儴瀹瑰櫒
+ base.topFrameLayout = new FrameLayout();
+ topFrameLayout.Y = Application.GetRealHeight(60);
+ topFrameLayout.Height = Application.GetRealHeight(127);
+ topFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
+ this.AddChidren(topFrameLayout);
+
+ //鎷ユ湁妤煎眰
+ this.btnFloorName = null;
+ if (Config.Instance.Home.FloorDics.Count > 0)
+ {
+ //妤煎眰鍥炬爣
+ var btnFloorIcon = new IconViewControl(69);
+ btnFloorIcon.X = ControlCommonResourse.XXLeft;
+ btnFloorIcon.Gravity = Gravity.CenterVertical;
+ btnFloorIcon.UnSelectedImagePath = "Item/Floor.png";
+ topFrameLayout.AddChidren(btnFloorIcon);
+ btnFloorIcon.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
+ this.ShowSelectFloorForm(btnFloorName);
+ };
+ //妤煎眰鍚�
+ this.btnFloorName = new NormalViewControl(500, 100, true);
+ btnFloorName.X = btnFloorIcon.Right;
+ btnFloorName.Gravity = Gravity.CenterVertical;
+ btnFloorName.TextColor = ZigbeeColor.Current.GXCTextColor;
+ btnFloorName.Text = Config.Instance.Home.GetCurrentFloorName;
+ btnFloorName.IsBold = true;
+ btnFloorName.Width = btnFloorName.GetRealWidthByText() + Application.GetRealWidth(20);
+ topFrameLayout.AddChidren(btnFloorName);
+ btnFloorName.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
+ this.ShowSelectFloorForm(btnFloorName);
+ };
+ }
+ //瀹夐槻蹇嵎鏂瑰紡
+ if (UserCenterResourse.ResidenceOption.SafetyShortcut)
+ {
+ var btnSafety = new Controls.SafetyShortcutControl();
+ btnSafety.X = Application.GetRealWidth(860);
+ btnSafety.Gravity = Gravity.CenterVertical;
+ topFrameLayout.AddChidren(btnSafety);
+ }
+ //娑堟伅鍥炬爣
+ var btnMessage = new MessageManagementControl();
+ btnMessage.X = Application.GetRealWidth(953);
+ btnMessage.Gravity = Gravity.CenterVertical;
+ btnMessage.UnSelectedImagePath = "Item/Message.png";
+ btnMessage.SelectedImagePath = "Item/MessageSelected.png";
+ topFrameLayout.AddChidren(btnMessage);
+
+ //浣忓畢鍚嶅瓧
+ var btnHouseName = new NormalViewControl(700, 95, true);
+ btnHouseName.X = ControlCommonResourse.XXLeft;
+ btnHouseName.Y = Application.GetRealHeight(161);
+ btnHouseName.TextSize = 24;
+ btnHouseName.TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor;
+ btnHouseName.IsBold = true;
+ btnHouseName.Text = Config.Instance.Home.Name;
+ btnHouseName.Width = btnHouseName.GetRealWidthByText();
+ this.AddChidren(btnHouseName);
+
+ //鍒囨崲浣忓畢
+ btnHouseName.MouseLongEventHandler += (sender, e) =>
+ {
+ if (Config.Instance.HomeFilePathList.Count == 0)
+ {
+ //褰撳墠浣忓畢涓虹┖锛岃鍏堝缓绔嬩綇瀹�
+ this.ShowMassage(ShowMsgType.Remind, Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst));
+ }
+ else
+ {
+ var selectHouse = new Device.Category.SelectHouse();
+ selectHouse.Init();
+ selectHouse.HouseAction = (houseId) =>
+ {
+ ChangeResidence(House.GetHouseByHouseId(houseId));
+ };
+ }
+ };
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑闂存帶浠�
+ /// </summary>
+ private void InitMidFrameLayoutControl()
+ {
+ //妫�娴嬫槸鍚︾粦瀹氭湁缃戝叧
+ if (this.CheckHadBindGateway() == false)
+ {
+ //鏄剧ず娌℃湁缁戝畾杩囩綉鍏崇殑鐣岄潰
+ this.ShowNoGatewayTip();
+ }
+ else
+ {
+ //鍒濆鍖栧満鏅�,鍔熻兘鐨勫垏鎹㈡帶浠�
+ this.InitSceneFunctionSwitchControl();
+
+ //鍒濆鍖栨埧闂存粦鍔ㄦ帶浠�
+ this.InitRoomHorizontalPagesControl();
+ }
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧満鏅�,鍔熻兘鐨勫垏鎹㈡帶浠�
+ /// </summary>
+ private void InitSceneFunctionSwitchControl()
+ {
+ //鍔熻兘鍜屽満鏅殑鑳屾櫙鍥�
+ var functionSceneView = new FrameLayout();
+ functionSceneView.Y = Application.GetRealHeight(861);
+ functionSceneView.Width = Application.GetRealWidth(832);
+ functionSceneView.Height = Application.GetRealHeight(167);
+ functionSceneView.Gravity = Gravity.CenterHorizontal;
+ functionSceneView.BackgroundImagePath = "Item/SceneFunctionBG.png";
+ this.AddChidren(functionSceneView);
+
+ //鍦烘櫙
+ var btnScene = new NormalViewControl(350, 100, true);
+ btnScene.X = Application.GetRealWidth(30);
+ btnScene.Y = Application.GetRealHeight(12);
+ btnScene.TextColor = ZigbeeColor.Current.GXCTextGrayColor3;
+ btnScene.SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor;
+ btnScene.TextID = R.MyInternationalizationString.Scence;
+ btnScene.TextSize = 15;
+ btnScene.TextAlignment = TextAlignment.Center;
+ functionSceneView.AddChidren(btnScene);
+
+ //鍔熻兘
+ var btnFunction = new NormalViewControl(360, 100, true);
+ btnFunction.X = Application.GetRealWidth(430);
+ btnFunction.Y = Application.GetRealHeight(12);
+ btnFunction.TextColor = ZigbeeColor.Current.GXCTextGrayColor3;
+ btnFunction.SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor;
+ btnFunction.TextSize = 15;
+ btnFunction.TextID = R.MyInternationalizationString.Function;
+ btnFunction.TextAlignment = TextAlignment.Center;
+ functionSceneView.AddChidren(btnFunction);
+ if (UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex == 1)
+ {
+ btnScene.IsSelected = true;
+ btnScene.TextSize = 16;
+ btnScene.IsBold = true;
+ }
+ else if (UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex == 2)
+ {
+ btnFunction.IsSelected = true;
+ btnFunction.TextSize = 16;
+ btnFunction.IsBold = true;
+ }
+
+ //鍔熻兘鍜屽満鏅痓odyView
+ this.bodyFrameLayout = new FrameLayout()
+ {
+ Y = functionSceneView.Bottom,
+ Height = Application.GetRealHeight(750),
+ Gravity = Gravity.CenterHorizontal,
+ BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
+ };
+ this.AddChidren(bodyFrameLayout);
+
+ //閫夋嫨鍔熻兘鍒嗘爮
+ btnFunction.ButtonClickEvent += (sender, e) =>
+ {
+ if (btnFunction.IsSelected == true)
+ {
+ return;
+ }
+ //鍔熻兘鍒嗘敮閫夋嫨
+ UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex = 2;
+
+ btnScene.IsSelected = false;
+ btnScene.TextSize = 15;
+ btnScene.IsBold = false;
+
+ btnFunction.IsSelected = true;
+ btnFunction.TextSize = 16;
+ btnFunction.IsBold = true;
+ //鍒锋柊璁惧妗屽竷鎺т欢
+ this.RefreshBodyView();
+ };
+ //閫夋嫨鍦烘櫙鍒嗘爮
+ btnScene.ButtonClickEvent += (sender, e) =>
+ {
+ if (btnScene.IsSelected == true)
+ {
+ return;
+ }
+ //鍦烘櫙鍒嗘敮閫夋嫨
+ UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex = 1;
+
+ btnScene.IsSelected = true;
+ btnScene.TextSize = 16;
+ btnScene.IsBold = true;
+
+ btnFunction.IsSelected = false;
+ btnFunction.TextSize = 15;
+ btnFunction.IsBold = false;
+ //鍒锋柊璁惧妗屽竷鎺т欢
+ this.RefreshBodyView();
+ };
+ }
+
+ /// <summary>
+ /// 鎻愮ず鐢ㄦ埛娌℃湁缃戝叧锛屽苟蹇�熻烦杞埌娣诲姞缃戝叧鐣岄潰
+ /// </summary>
+ private void ShowNoGatewayTip()
+ {
+ var bg = new PicViewControl(717, 478);
+ bg.Y = Application.GetRealHeight(302);
+ bg.Gravity = Gravity.CenterHorizontal;
+ bg.UnSelectedImagePath = "Item/NoBindGW.png";
+ this.AddChidren(bg);
+
+ var tip = new NormalViewControl(Application.GetMinRealAverage(717), Application.GetMinRealAverage(58), false);
+ tip.Y = Application.GetRealHeight(815);
+ tip.Gravity = Gravity.CenterHorizontal;
+ tip.TextID = R.MyInternationalizationString.NewAccountNeedBingGW;
+ tip.TextColor = ZigbeeColor.Current.GXCTextGrayColor;
+ tip.TextAlignment = TextAlignment.Center;
+ this.AddChidren(tip);
+
+ var addBG = new PicViewControl(971, 366);
+ addBG.Y = Application.GetRealHeight(1048);
+ addBG.UnSelectedImagePath = "Item/VirtualFrame.png";
+ addBG.Gravity = Gravity.CenterHorizontal;
+ this.AddChidren(addBG);
+
+ var addGatewayBtn = new IconViewControl(89);
+ addGatewayBtn.Y = Application.GetRealHeight(1143);
+ addGatewayBtn.UnSelectedImagePath = "Item/Add_GW.png";
+ addGatewayBtn.Gravity = Gravity.CenterHorizontal;
+ this.AddChidren(addGatewayBtn);
+ addGatewayBtn.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm();
+ form.AddForm();
+ };
+
+ var addTip = new PicViewControl(717, 58);
+ addTip.Y = Application.GetRealHeight(1256);
+ addTip.Gravity = Gravity.CenterHorizontal;
+ addTip.TextID = R.MyInternationalizationString.AddSmartGW;
+ addTip.TextColor = ZigbeeColor.Current.GXCTextBlackColor;
+ addTip.TextAlignment = TextAlignment.Center;
+ AddChidren(addTip);
+
+ addTip.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm();
+ form.AddForm();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栨埧闂存粦鍔ㄦ帶浠禵________________
+
+ /// <summary>
+ /// 鍒濆鍖栨埧闂存粦鍔ㄦ帶浠�
+ /// </summary>
+ private void InitRoomHorizontalPagesControl()
+ {
+ //宸﹀彸婊戝姩鎺т欢鐨勮儗鏅鍣�
+ var frameBack = new FrameLayout();
+ frameBack.Y = Application.GetRealHeight(302);
+ frameBack.Width = Application.GetRealWidth(CommonPage.AppRealWidth);
+ frameBack.Height = Application.GetRealHeight(478);
+ this.AddChidren(frameBack);
+
+ this.roomPageView = new HorizontalPages();
+ 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);
+
+ //褰撳墠鎴块棿
+ var listRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
+ var curIndex = 0;
+ for (int i = 0; i < listRoom.Count; i++)
+ {
+ var roomView = new RoomView(0, 0);
+ roomPageView.AddChidren(roomView);
+ roomView.Init(listRoom[i]);
+
+ if (listRoom[i].Id == HdlRoomLogic.Current.CurrentRoom.Id)
+ {
+ //褰撳墠鎴块棿,鍒欐樉绀洪偅浜涙暟鎹嚭鏉�
+ roomView.HideName(false);
+ //褰撳墠绱㈠紩
+ curIndex = i;
+ }
+ else
+ {
+ roomView.HideName(true);
+ }
+ }
+ //璁剧疆鎴块棿鐨勫垵濮嬮�夋嫨
+ roomPageView.PageIndex = curIndex;
+ //鎴块棿鑳藉婊戝姩鐨勬椂鍊欐墠鏄剧ず
+ 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);
+ }
+ //鎺т欢寮�濮嬫粦鍔ㄧ殑浜嬩欢
+ 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; }
+ btnRoomBottomShadow.Visible = false;
+ };
+ roomPageView.EndScrollAction += () =>
+ {
+ curIndex = roomPageView.PageIndex;
+ //鍓嶄竴寮犲崱鐗�
+ if (roomPageView.GetChildren(curIndex - 1) != null)
+ {
+ (roomPageView.GetChildren(curIndex - 1) as RoomView).HideName(true);
+ }
+ //褰撳墠鍗$墖
+ if (roomPageView.GetChildren(curIndex) != null)
+ {
+ (roomPageView.GetChildren(curIndex) as RoomView).HideName(false);
+ }
+ //涓嬩竴寮犲崱鐗�
+ if (roomPageView.GetChildren(curIndex + 1) != null)
+ {
+ (roomPageView.GetChildren(curIndex + 1) as RoomView).HideName(true);
+ }
+
+ if (btnRoomLeftShadow != null) { btnRoomLeftShadow.Visible = curIndex >= 1; }
+ if (btnRoomRightShadow != null) { btnRoomRightShadow.Visible = curIndex < listRoom.Count - 1; }
+ btnRoomBottomShadow.Visible = true;
+ //鍒囨崲褰撳墠鎴块棿
+ HdlRoomLogic.Current.CurrentRoom = listRoom[curIndex];
+ //鍒锋柊璁惧妗屽竷鎺т欢
+ this.isRoomChanging = false;
+ this.RefreshBodyView();
+ };
+ }
+
+ /// <summary>
+ /// 璁剧疆鎴块棿鐨勬粦鍔ㄥ鍣ㄦ帶浠堕�夋嫨鎸囧畾鐨勬埧闂�(渚涘閮ㄨ皟鐢�)
+ /// </summary>
+ /// <param name="room"></param>
+ public void SetRoomPageViewSelect(Room room)
+ {
+ var listRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
+ for (int i = 0; i < listRoom.Count; i++)
+ {
+ if (room.Id == listRoom[i].Id)
+ {
+ if (roomPageView.PageIndex != i)
+ {
+ //涓嶇浉鍚屾椂鎵嶅埛鏂�
+ roomPageView.PageIndex = i;
+ }
+ break;
+ }
+ }
+ //閲嶇疆涓�涓嬫ゼ灞傚悕瀛�
+ if (this.btnFloorName != null)
+ {
+ btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(Config.Instance.Home.CurrentFloorId);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍔熻兘鍒嗘敮___________________________
+
+ /// <summary>
+ /// 鏄剧ず鍔熻兘
+ /// </summary>
+ private void ShowFunction()
+ {
+ //鍏堟竻绌虹紦瀛�
+ bodyFrameLayout.RemoveAll();
+ this.dicSceneCardControl.Clear();
+ this.dicDeviceCardControl.Clear();
+
+ var listDevice = new List<CommonDevice>();
+ foreach (var mainkeys in HdlRoomLogic.Current.CurrentRoom.ListDevice)
+ {
+ var device = LocalDevice.Current.GetDevice(mainkeys);
+ if (device == null
+ || device.Type == DeviceType.OnOffSwitch)//骞叉帴鐐�
+ {
+ //杩欎釜璁惧涓嶈浜�
+ continue;
+ }
+ listDevice.Add(device);
+ }
+
+ //褰撳墠鎴块棿鐨勮澶囨暟
+ if (listDevice.Count == 0)
+ {
+ ShowNoFunctionTip();
+ return;
+ }
+ //鍒楄〃鎺т欢
+ var listView = new VerticalFrameControl();
+ listView.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listView);
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鍒濆鍖栬澶囧崱鐗囧垪琛ㄦ帶浠�
+ this.InitDeviceListCardControl(listView, listDevice);
+ });
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栬澶囧崱鐗囧垪琛ㄦ帶浠�
+ /// </summary>
+ /// <param name="listView"></param>
+ private void InitDeviceListCardControl(VerticalFrameControl listView, List<CommonDevice> listDevice)
+ {
+ //璁惧璁℃暟
+ int contrCount = 0;
+ //X杞村潗鏍�(鍥剧墖宸﹁竟鏈変綑鐧�)
+ int XX = Application.GetMinRealAverage(44);
+ //Y杞村潗鏍�
+ int YY = 0;
+ var listContr = new List<Controls.DeviceCardCommon>();
+ foreach (var device in listDevice)
+ {
+ if (this.isRoomChanging == true || listView.Parent == null)
+ {
+ //鏀惧純鍒濆鍖栨帶浠�
+ return;
+ }
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ Controls.DeviceCardCommon cardContr = null;
+ //绐楀笜
+ if (device.Type == DeviceType.WindowCoveringDevice)
+ {
+ cardContr = new Controls.DeviceCurtainCardControl();
+ }
+ //缁х數鍣�
+ else if (device.Type == DeviceType.OnOffOutput)
+ {
+ cardContr = new Controls.DeviceRelayCardControl();
+ }
+ //绌烘皵寮�鍏�
+ else if (device.Type == DeviceType.AirSwitch)
+ {
+ cardContr = new Controls.DeviceAirSwitchCardControl();
+ }
+ //绌鸿皟
+ else if (device.Type == DeviceType.Thermostat)
+ {
+ cardContr = new Controls.DeviceAcCardControl();
+ }
+ //褰╃伅(璋冨厜鍣�)
+ else if (device.Type == DeviceType.DimmableLight)
+ {
+ cardContr = new Controls.DeviceColorLightCardControl();
+ }
+ //浼犳劅鍣�
+ else if (device.Type == DeviceType.IASZone)
+ {
+ cardContr = new Controls.DeviceSensorCardControl();
+ }
+ //娓╂箍搴�
+ else if (device.Type == DeviceType.TemperatureSensor)
+ {
+ cardContr = new Controls.DeviceTemperatureCardControl();
+ }
+ //闂ㄩ攣
+ else if (device.Type == DeviceType.DoorLock)
+ {
+ cardContr = new Controls.DeviceDoorLockCardControl();
+ }
+ //鏃犳硶璇嗗埆
+ else
+ {
+ cardContr = new Controls.DeviceCardCommon();
+ }
+
+ //鍒濆鍖栧崱鐗�
+ cardContr.X = XX;
+ cardContr.Y = YY;
+ listView.frameTable.AddChidren(cardContr);
+ cardContr.InitControl(device);
+ //鍗$墖闇�瑕佽绉婚櫎鐨勪簨浠�
+ cardContr.CardNeedRemoveEvent += () =>
+ {
+ //閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
+ this.ResetDeviceCardControlLocation(LocalDevice.Current.GetDeviceMainKeys(device));
+ };
+ //璁惧璁℃暟
+ contrCount++;
+ //鍗$墖宸﹀彸涓よ竟鏈�14鐨勪綑鐧�,姣忎袱涓悗,X杞撮噸缃�
+ XX = contrCount % 2 == 0 ? Application.GetMinRealAverage(44) : cardContr.Right + Application.GetMinRealAverage(20);
+ if (contrCount % 2 == 0)
+ {
+ //娌′袱涓箣鍚�,Y杞撮�掑
+ YY = cardContr.Bottom + Application.GetMinRealAverage(15);
+ }
+ //鎺т欢璁板綍鍒扮紦瀛樹腑
+ this.dicDeviceCardControl[LocalDevice.Current.GetDeviceMainKeys(device)] = cardContr;
+ //鍔犵紦瀛�,鐒跺悗鍙戝懡浠�
+ listContr.Add(cardContr);
+
+ if (contrCount == listDevice.Count)
+ {
+ //璋冩暣妗屽竷澶у皬
+ listView.AdjustTableHeight();
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ for (int i = 0; i < listContr.Count; i++)
+ {
+ if (listView.Parent == null)
+ {
+ return;
+ }
+ System.Threading.Thread.Sleep(20);
+ //鍙戦�佽幏鍙栫姸鎬佺殑鍛戒护
+ listContr[i].SendStatuComand();
+ }
+
+ }, ShowErrorMode.NO);
+ }
+ });
+
+ System.Threading.Thread.Sleep(50);
+ }
+ }
+
+ /// <summary>
+ /// 鏄剧ず娌℃湁鍔熻兘
+ /// </summary>
+ private void ShowNoFunctionTip()
+ {
+ var noFunction = new Button
+ {
+ Y = Application.GetRealHeight(69),
+ Width = Application.GetMinRealAverage(683),
+ Height = Application.GetMinRealAverage(392),
+ Gravity = Gravity.CenterHorizontal,
+ UnSelectedImagePath = "Item/NoFunction.png"
+ };
+ bodyFrameLayout.AddChidren(noFunction);
+
+ var noFunctionTip = new Button()
+ {
+ Y = noFunction.Bottom,
+ Height = Application.GetRealHeight(200),
+ Text = Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"),
+ TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
+ TextAlignment = TextAlignment.Center,
+ IsMoreLines = true
+ };
+ bodyFrameLayout.AddChidren(noFunctionTip);
+ }
+
+ #endregion
+
+ #region 鈻� 閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣_______________
+
+ /// <summary>
+ /// 閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
+ /// </summary>
+ /// <param name="deleteKey">闇�瑕佽鍒犻櫎鐨勫崱鐗囦富閿�</param>
+ private void ResetDeviceCardControlLocation(string deleteKey)
+ {
+ if (this.dicDeviceCardControl.ContainsKey(deleteKey) == false)
+ {
+ //濡傛灉鍒楄〃閲岄潰娌℃湁杩欎釜鎺т欢鐨勮瘽
+ return;
+ }
+ var deleteContr = this.dicDeviceCardControl[deleteKey];
+
+ //璁惧璁℃暟
+ int contrCount = 0;
+
+ bool canMove = false;
+ int YY = 0;
+ foreach (var mainkey in this.dicDeviceCardControl.Keys)
+ {
+ if (deleteKey == mainkey)
+ {
+ //濡傛灉宸茬粡鍒颁簡瑕佸垹闄ょ殑鍗$墖,鍒犻櫎鎺夊畠,鐒跺悗瀹冧箣鍚庣殑鍗$墖鍏ㄩ儴鍚戜笂绉诲姩
+ canMove = true;
+ continue;
+ }
+ //璁惧璁℃暟
+ contrCount++;
+ //鍗$墖宸﹀彸涓よ竟鏈�14鐨勪綑鐧�,姣忎袱涓悗,X杞撮噸缃�
+ int XX = 0;
+ if (contrCount % 2 == 1)
+ {
+ //绗竴涓浐瀹�44
+ XX = Application.GetMinRealAverage(44);
+ }
+ else
+ {
+ //绗簩涓槸44+鎺т欢瀹藉害+20浣欑櫧
+ XX = Application.GetMinRealAverage(44) + this.dicDeviceCardControl[mainkey].Width + Application.GetMinRealAverage(20);
+ }
+
+ //姣忎袱涓箣鍚�,骞朵笖鏄涓�涓殑鏃跺��,Y杞撮�掑
+ if (contrCount > 2 && contrCount % 2 == 1)
+ {
+ //姹傚晢
+ int value = contrCount / 2;
+ //鎺т欢鐨勫簳閮ㄦ湁15鐨勯棿闅�
+ YY = value * (this.dicDeviceCardControl[mainkey].Height + Application.GetMinRealAverage(15));
+ }
+ if (canMove == true)
+ {
+ //绉诲姩鎺т欢
+ this.dicDeviceCardControl[mainkey].X = XX;
+ this.dicDeviceCardControl[mainkey].Y = YY;
+ }
+ }
+ //鍘绘壘涓�涓嬭繖涓帶浠剁殑鍒楄〃瀹瑰櫒
+ var listView = deleteContr.Parent.Parent as VerticalFrameControl;
+
+ //鍒犻櫎鎺夐偅寮犲崱鐗囩殑涓婚敭
+ deleteContr.RemoveFromParent();
+ this.dicDeviceCardControl.Remove(deleteKey);
+
+ //璋冩暣妗屽竷楂樺害
+ listView?.AdjustTableHeight();
+ }
+
+ #endregion
+
+ #region 鈻� 鍦烘櫙鍒嗘敮___________________________
+
+ /// <summary>
+ /// 鏄剧ず鍦烘櫙
+ /// </summary>
+ private void ShowScene()
+ {
+ //鍏堟竻绌虹紦瀛�
+ bodyFrameLayout.RemoveAll();
+ this.dicSceneCardControl.Clear();
+ this.dicDeviceCardControl.Clear();
+
+ var listScene = new List<SceneUI>();
+ foreach (int sceneId in HdlRoomLogic.Current.CurrentRoom.ListSceneId)
+ {
+ var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
+ if (sceneUi == null)
+ {
+ //杩欎釜鍦烘櫙涓嶈浜�
+ continue;
+ }
+ listScene.Add(sceneUi);
+ }
+
+ if (listScene.Count == 0)
+ {
+ //鏄剧ず娌″満鏅�
+ this.ShowNoSceneTip();
+ return;
+ }
+ //鍒楄〃鎺т欢
+ var listView = new VerticalFrameControl();
+ listView.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listView);
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鍒濆鍖栬澶囧崱鐗囧垪琛ㄦ帶浠�
+ this.InitSceneListCardControl(listView, listScene);
+ });
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧満鏅崱鐗囧垪琛ㄦ帶浠�
+ /// </summary>
+ /// <param name="listView"></param>
+ private void InitSceneListCardControl(VerticalFrameControl listView, List<SceneUI> listScene)
+ {
+ //鍦烘櫙璁℃暟
+ int contrCount = 0;
+ //X杞村潗鏍�(鍥剧墖宸﹁竟鏈変綑鐧�)
+ int XX = Application.GetMinRealAverage(44);
+ //Y杞村潗鏍�
+ int YY = 0;
+ foreach (var sceneUi in listScene)
+ {
+ if (this.isRoomChanging == true || listView.Parent == null)
+ {
+ //鏀惧純鍒濆鍖栨帶浠�
+ return;
+ }
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒濆鍖栧崱鐗�
+ var cardContr = new Controls.SceneCardControl();
+ cardContr.X = XX;
+ cardContr.Y = YY;
+ listView.frameTable.AddChidren(cardContr);
+ cardContr.InitControl(sceneUi);
+ //鍗$墖闇�瑕佽绉婚櫎鐨勪簨浠�
+ cardContr.CardNeedRemoveEvent += () =>
+ {
+ //閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
+ this.ResetSceneCardControlLocation(sceneUi.Id);
+ };
+ //璁惧璁℃暟
+ contrCount++;
+ //姣忎袱涓悗,X杞撮噸缃�
+ XX = contrCount % 2 == 0 ? Application.GetMinRealAverage(44) : cardContr.Right + Application.GetMinRealAverage(20);
+ if (contrCount % 2 == 0)
+ {
+ //娌′袱涓箣鍚�,Y杞撮�掑
+ YY = cardContr.Bottom + Application.GetMinRealAverage(15);
+ }
+ //鎺т欢璁板綍鍒扮紦瀛樹腑
+ this.dicSceneCardControl[sceneUi.Id] = cardContr;
+ if (contrCount == listScene.Count)
+ {
+ //璋冩暣妗屽竷楂樺害
+ listView.AdjustTableHeight();
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //璁剧疆鐩墠鍦烘櫙鐨勫欢杩熺姸鎬�
+ this.SetSceneDelayTime(listView);
+ });
+ }
+ });
+ System.Threading.Thread.Sleep(50);
+ }
+ }
+
+ /// <summary>
+ /// 鏄剧ず娌″満鏅�
+ /// </summary>
+ private void ShowNoSceneTip()
+ {
+ var noScene = new Button
+ {
+ Y = Application.GetRealHeight(69),
+ Width = Application.GetMinRealAverage(683),
+ Height = Application.GetMinRealAverage(392),
+ Gravity = Gravity.CenterHorizontal,
+ UnSelectedImagePath = "Item/NoFunction.png"
+ };
+ bodyFrameLayout.AddChidren(noScene);
+ var noScenceTip = new Button()
+ {
+ Y = noScene.Bottom,
+ Height = Application.GetRealHeight(200),
+ Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"),
+ TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
+ TextAlignment = TextAlignment.Center,
+ IsMoreLines = true
+ };
+ bodyFrameLayout.AddChidren(noScenceTip);
+ }
+
+ /// <summary>
+ /// 璁剧疆鍦烘櫙鐨勫欢杩熺姸鎬�
+ /// </summary>
+ /// <param name="listView"></param>
+ private async void SetSceneDelayTime(VerticalFrameControl listView)
+ {
+ await System.Threading.Tasks.Task.Delay(1500);
+ if (listView.Parent == null)
+ {
+ //鎺т欢宸茬粡琚Щ闄�
+ return;
+ }
+ //绛夊緟1.5绉掍箣鍚�,鑾峰彇寤惰繜鐘舵��
+ var result = await Scene.CatDelaySceneAsync();
+ if (result == null || result.catDelaySceneResponseData == null)
+ {
+ return;
+ }
+ if (listView.Parent == null)
+ {
+ //鎺т欢宸茬粡琚Щ闄�
+ return;
+ }
+ foreach (var data in result.catDelaySceneResponseData.DelayScenesList)
+ {
+ var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(data.ScenesId);
+ if (sceneUi == null)
+ {
+ continue;
+ }
+ if (this.dicSceneCardControl.ContainsKey(data.ScenesId) == false)
+ {
+ continue;
+ }
+ //淇敼鍓╀綑寤惰繜鏃堕棿
+ sceneUi.RemainTime = data.RemainTime;
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒锋柊鍗$墖淇℃伅
+ this.dicSceneCardControl[data.ScenesId].RefreshControlInfo(sceneUi);
+ });
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 閲嶇疆鍦烘櫙鍗$墖鎺т欢鍧愭爣_______________
+
+ /// <summary>
+ /// 閲嶇疆鍦烘櫙鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
+ /// </summary>
+ /// <param name="deleteKey">闇�瑕佽鍒犻櫎鐨勫崱鐗囦富閿�</param>
+ private void ResetSceneCardControlLocation(int deleteId)
+ {
+ if (this.dicSceneCardControl.ContainsKey(deleteId) == false)
+ {
+ //濡傛灉鍒楄〃閲岄潰娌℃湁杩欎釜鎺т欢鐨勮瘽
+ return;
+ }
+ var deleteContr = this.dicSceneCardControl[deleteId];
+ //璁惧璁℃暟
+ int contrCount = 0;
+
+ bool canMove = false;
+ int YY = 0;
+ foreach (var sceneId in this.dicSceneCardControl.Keys)
+ {
+ if (deleteId == sceneId)
+ {
+ //濡傛灉宸茬粡鍒颁簡瑕佸垹闄ょ殑鍗$墖,鍒犻櫎鎺夊畠,鐒跺悗瀹冧箣鍚庣殑鍗$墖鍏ㄩ儴鍚戜笂绉诲姩
+ canMove = true;
+ continue;
+ }
+ //璁惧璁℃暟
+ contrCount++;
+ //姣忎袱涓悗,X杞撮噸缃�
+ int XX = 0;
+ if (contrCount % 2 == 1)
+ {
+ //绗竴涓浐瀹�44
+ XX = Application.GetMinRealAverage(44);
+ }
+ else
+ {
+ //绗簩涓槸44+鎺т欢瀹藉害+20浣欑櫧
+ XX = Application.GetMinRealAverage(44) + this.dicSceneCardControl[sceneId].Width + Application.GetMinRealAverage(20);
+ }
+
+ //姣忎袱涓箣鍚�,骞朵笖鏄涓�涓椂,Y杞撮�掑
+ if (contrCount > 2 && contrCount % 2 == 1)
+ {
+ //姹傚晢
+ int value = contrCount / 2;
+ //鎺т欢鐨勫簳閮ㄦ湁15鐨勯棿闅�
+ YY = value * (this.dicSceneCardControl[sceneId].Height + Application.GetMinRealAverage(15));
+ }
+ if (canMove == true)
+ {
+ //绉诲姩鎺т欢
+ this.dicSceneCardControl[sceneId].X = XX;
+ this.dicSceneCardControl[sceneId].Y = YY;
+ }
+ }
+ //鍘绘壘涓�涓嬭繖涓帶浠剁殑鍒楄〃瀹瑰櫒
+ var listView = deleteContr.Parent.Parent as VerticalFrameControl;
+
+ //鍒犻櫎鎺夐偅寮犲崱鐗囩殑涓婚敭
+ deleteContr.RemoveFromParent();
+ this.dicSceneCardControl.Remove(deleteId);
+
+ //璋冩暣妗屽竷楂樺害
+ listView?.AdjustTableHeight();
+ }
+
+ #endregion
+
+ #region 鈻� 鍒锋柊妗屽竷鎺т欢_______________________
+
+ /// <summary>
+ /// 鍒锋柊璁惧妗屽竷鎺т欢
+ /// </summary>
+ public void RefreshBodyView()
+ {
+ bodyFrameLayout.RemoveAll();
+
+ //璁╃晫闈㈠埆闂儊
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ if (UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex == 2)
+ {
+ //鍔熻兘
+ this.ShowFunction();
+ }
+ else
+ {
+ //鍦烘櫙
+ this.ShowScene();
+ }
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鍒囨崲浣忓畢___________________________
+ /// <summary>
+ /// 鍒囨崲浣忓畢
+ /// </summary>
+ /// <param name="home">Home.</param>
+ private void ChangeResidence(House home)
+ {
+ try
+ {
+ CommonPage.Loading.Start();
+ new System.Threading.Thread(async () =>
+ {
+ Config.Instance.HomeId = home.Id;
+ Config.Instance.Home = House.GetHouseByFilePath(home.FileName);
+ Global.CreateHomeDirectory(home.Id);
+ Config.Instance.Save();
+ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
+ await UserCenterLogic.InitUserCenterMenmoryAndThread();
+ //鍒濆鍖栧叏閮ㄦ埧闂�
+ HdlRoomLogic.Current.InitAllRoom();
+
+ Application.RunOnMainThread(() =>
+ {
+ ShowForm();
+ CommonPage.Loading.Hide();
+ });
+ })
+ { IsBackground = true }.Start();
+ }
+ catch (Exception ex)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ Console.WriteLine(ex.Message);
+ });
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸澶囩姸鎬佷笂鎶__________________
+
+ /// <summary>
+ /// 娣诲姞涓�鑸澶囩姸鎬佷笂鎶ヤ簨浠�
+ /// </summary>
+ private void AddNormalDeviceReportEvent()
+ {
+ //璁惧灞炴�т笂鎶�(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceStatus", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //澶勭悊涓�鑸澶囩殑涓婃姤鏁版嵁
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true)
+ {
+ //鍒锋柊鍗$墖淇℃伅
+ var locadevice = LocalDevice.Current.GetDevice(mainKeys);
+ this.dicDeviceCardControl[mainKeys].RefreshControlInfo(locadevice);
+ }
+ }, ShowErrorMode.NO);
+ });
+
+ //璁惧鍦ㄧ嚎涓婃姤(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceOnline", ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true)
+ {
+ //鍒锋柊鍗$墖鐘舵��
+ this.dicDeviceCardControl[mainKeys].SetCardOnlineStatu(report.IsOnline == 1);
+ return;
+ }
+
+ }, ShowErrorMode.NO);
+ });
+
+ //璁惧鎺у埗鍙嶉涓婃姤
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceRespone", ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true)
+ {
+ //璁惧鍗$墖
+ var deviceCardContr = this.dicDeviceCardControl[mainKeys];
+ //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉
+ deviceCardContr.SetHadGetResponeResultStatu();
+ }
+
+ }, ShowErrorMode.NO);
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 浼犳劅鍣ㄧ姸鎬佷笂鎶____________________
+
+ /// <summary>
+ /// 娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠�
+ /// </summary>
+ private void AddSensorDeviceReportEvent()
+ {
+ //浼犳劅鍣ㄤ笂鎶�(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewSensor", ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�, (report) =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //澶勭悊浼犳劅鍣ㄤ笂鎶ユ暟鎹�
+ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
+ if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true)
+ {
+ //鏈湴璁惧瀵硅薄
+ var locadevice = LocalDevice.Current.GetDevice(mainKeys);
+ //鍒锋柊鍗$墖淇℃伅
+ this.dicDeviceCardControl[mainKeys].RefreshControlInfo(locadevice);
+ }
+
+ }, ShowErrorMode.NO);
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鍒囨崲妤煎眰___________________________
+
+ /// <summary>
+ /// 鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
+ /// </summary>
+ private void ShowSelectFloorForm(NormalViewControl btnFloor)
+ {
+ var floorFL = new Device.Category.SelectFloor();
+ this.AddChidren(floorFL);
+ floorFL.Init(35, 153);
+ floorFL.changeFloor = true;
+ floorFL.FloorAction = (floorId) =>
+ {
+ btnFloor.Text = Config.Instance.Home.GetFloorNameById(floorId);
+ HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
+ this.ShowForm();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鐣岄潰鍏抽棴___________________________
+
+ /// <summary>
+ /// 鐣岄潰鍏抽棴
+ /// </summary>
+ public override void CloseFormBefore()
+ {
+ HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceOnline");
+ HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceRespone");
+ HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceStatus");
+ HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewSensor");
+
+ base.CloseFormBefore();
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 妫�娴嬫槸鍚︾粦瀹氭湁缃戝叧
+ /// </summary>
+ private bool CheckHadBindGateway()
+ {
+ //鑾峰彇鏈湴宸茬粡缁戝畾鐨勭綉鍏�
+ var gatewayList = HdlGatewayLogic.Current.GetAllLocalGateway();
+ if (gatewayList.Count == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________
+
+ /// <summary>
+ /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠�
+ /// </summary>
+ public override int FormActionAgainEvent()
+ {
+ CommonPage.Instance.IsDrawerLockMode = false;
+ return 1;
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
new file mode 100755
index 0000000..f5d841a
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
@@ -0,0 +1,289 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.Phone.Device.Category;
+using Shared.Phone.Device.CommonForm;
+using Shared.Phone.UserCenter;
+using Shared.Phone.UserView;
+
+namespace Shared.Phone.MainPage
+{
+ /// <summary>
+ /// 宸︽粦鑿滃崟鐨勭殑鎴块棿鍒楄〃鐣岄潰
+ /// </summary>
+ public class ListRoomViewFrom : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ private static ListRoomViewFrom roomManagement = null;
+ /// <summary>
+ /// 宸︽粦鑿滃崟鐨勭殑鎴块棿瀵硅薄
+ /// </summary>
+ public static ListRoomViewFrom Instance
+ {
+ get
+ {
+ return roomManagement;
+ }
+ }
+
+ /// <summary>
+ /// 鏄惁鍙互瑙﹀彂鐐瑰嚮浜嬩欢--鏄惁鍙互璺宠浆涓婚〉鎴块棿
+ /// </summary>
+ public bool CanClick = true;
+ /// <summary>
+ /// 褰撳墠妤煎眰id
+ /// </summary>
+ private string curFloorId = string.Empty;
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalFrameControl listView = null;
+ /// <summary>
+ /// 鍗$墖鎺т欢闆嗗悎
+ /// </summary>
+ private Dictionary<string, Controls.ListRoomCardControl> dicCardControl = new Dictionary<string, Controls.ListRoomCardControl>();
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず
+ /// </summary>
+ public void ShowForm()
+ {
+ roomManagement = this;
+ //鍒濆鍖栧ご閮ㄤ俊鎭�
+ this.InitTopFrame();
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitBodyFrameLayout();
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.RoomList));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧ご閮ㄤ俊鎭�
+ /// </summary>
+ private void InitTopFrame()
+ {
+ //鍒濆鍖栧ご閮ㄦ帶浠�
+ this.InitTopFrameLayout();
+ //閲嶇疆杩斿洖鎸夐敭鐨勪簨浠�
+ var btnBack = this.GetBackButton();
+ btnBack.ButtonClickEvent = null;
+ btnBack.ButtonClickEvent += (sender, e) =>
+ {
+ //鏀惰捣宸﹁彍鍗�
+ CommonPage.Instance.CloseLeftMenu();
+ };
+
+ //鑾峰彇妤煎眰
+ var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
+ if (dicFloor.Count == 0)
+ {
+ return;
+ }
+ this.curFloorId = Config.Instance.Home.CurrentFloorId;
+ //妤煎眰鍥炬爣
+ var btnIconContr = new MostRightIconControl(69, 69);
+ btnIconContr.UnSelectedImagePath = "Item/Drop_Down.png";
+ topFrameLayout.AddChidren(btnIconContr);
+ btnIconContr.InitControl();
+ //妤煎眰鍚�
+ var btnFloor = new NormalViewControl(200, 69, true);
+ btnFloor.Gravity = Gravity.CenterVertical;
+ btnFloor.X = btnIconContr.X + btnIconContr.btnIcon.X - Application.GetRealWidth(200);
+ btnFloor.TextAlignment = TextAlignment.CenterRight;
+ btnFloor.Text = HdlResidenceLogic.Current.GetFloorNameById(this.curFloorId);
+ topFrameLayout.AddChidren(btnFloor);
+
+ btnIconContr.ButtonClickEvent += (sender, e) =>
+ {
+ //妤煎眰鑿滃崟
+ var floors = new SelectFloor();
+ AddChidren(floors);
+ floors.changeFloor = false;
+ floors.CurFloorId = curFloorId;
+ floors.Init(599, 161, Direction.Right);
+ floors.FloorAction += (floorId) =>
+ {
+ this.curFloorId = floorId;
+ btnFloor.Text = dicFloor[floorId];
+ //鍒锋柊鎴块棿鍒楄〃
+ this.RefreshListRoom();
+ };
+ };
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ this.listView = new VerticalFrameControl();
+ listView.Height = bodyFrameLayout.Height;
+ listView.Width = bodyFrameLayout.Width;
+ bodyFrameLayout.AddChidren(listView);
+ //鍒锋柊鎴块棿鍒楄〃
+ this.RefreshListRoom();
+ }
+
+ #endregion
+
+ #region 鈻� 鍒锋柊鎴块棿鍒楄〃_______________________
+
+ /// <summary>
+ /// 鍒锋柊鎴块棿鍒楄〃
+ /// </summary>
+ public void RefreshListRoom()
+ {
+ //鍏堟竻绌�
+ this.listView.frameTable.RemoveAll();
+ this.listView.frameTable.Height = Application.GetRealHeight(100);
+ this.dicCardControl.Clear();
+
+ var listRoom = HdlRoomLogic.Current.GetFloorSortRoom(curFloorId);
+ //杩藉姞鎴戠殑鍠滅埍
+ listRoom.Insert(0, HdlRoomLogic.Current.GetLoveRoom());
+
+ //X杞�
+ int XX = Application.GetRealWidth(43);
+ //Y杞�
+ int YY = Application.GetRealWidth(58);
+ //鎴块棿璁℃暟
+ int roomCount = 0;
+ foreach (var room in listRoom)
+ {
+ roomCount++;
+ //鍒濆鍖栧崱鐗囨帶浠�
+ var contr = new Controls.ListRoomCardControl();
+ contr.X = XX;
+ contr.Y = YY;
+ listView.frameTable.AddChidren(contr);
+ contr.InitControl(room);
+ //鍔犵紦瀛�
+ this.dicCardControl[room.Id] = contr;
+ //姣忎袱涓噸缃甔杞�
+ XX = roomCount % 2 == 0 ? Application.GetRealWidth(43) : contr.Right + Application.GetRealWidth(3);
+ //姣忎袱涓疮鍔燳杞�
+ if (roomCount >= 2 && roomCount % 2 == 0)
+ {
+ YY = contr.Bottom + Application.GetRealHeight(14);
+ }
+ contr.ButtonClickEvent += (sender, e) =>
+ {
+ if (CanClick == false)
+ {
+ return;
+ }
+ string oldFloorId = Config.Instance.Home.CurrentFloorId;
+ CommonPage.Instance.CloseLeftMenu();
+ HdlRoomLogic.Current.CurrentRoom = room;
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //绛夊緟鎺т欢鍚戝乏绉诲姩缁撴潫
+ System.Threading.Thread.Sleep(300);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鐐瑰嚮鐨勬槸鏀惰棌鎴块棿鐨勮瘽,涓嶅彉鏇村綋鍓嶆ゼ灞俰d
+ if (room.FloorId != string.Empty)
+ {
+ Config.Instance.Home.CurrentFloorId = room.FloorId;
+ if (oldFloorId != room.FloorId)
+ {
+ //妤煎眰閮藉垏鎹㈢殑璇�,鍒锋柊鏁翠釜涓婚〉
+ UserPage.Instance.Fresh();
+ return;
+ }
+ }
+ //濡傛灉鍙槸鍒囨崲褰撳墠妤煎眰鐨勫叾浠栨埧闂�,鍒欏彧婊戝姩涓婚〉鐨勬粦鍔ㄦ帶浠�
+ this.LoadFormMethodByName("HomeMainPageForm", "SetRoomPageViewSelect", room);
+ });
+ });
+ };
+ }
+ //鍒濆鍖栨湭鍒嗛厤鍗$墖
+ this.InitRoomCardControl(XX, YY);
+ //璋冩暣妗屽竷楂樺害
+ this.listView.AdjustTableHeight();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨湭鍒嗛厤鍗$墖
+ /// </summary>
+ private void InitRoomCardControl(int XX, int YY)
+ {
+ //妗屽竷鎺т欢
+ var frameBack = new FrameLayoutControl();
+ frameBack.X = XX;
+ frameBack.Y = YY;
+ frameBack.Width = Application.GetRealWidth(495);
+ frameBack.Height = Application.GetRealHeight(354);
+ listView.frameTable.AddChidren(frameBack);
+
+ //搴曢儴闃村奖鏁堟灉
+ var btnShadow = new NormalViewControl(frameBack.Width, frameBack.Height, false);
+ btnShadow.UnSelectedImagePath = "Room/RoomCardView.png";
+ frameBack.AddChidren(btnShadow, ChidrenBindMode.NotBind);
+
+ //鑳屾櫙鎺т欢
+ var picBackGroud = new NormalViewControl(467, 311, true);
+ picBackGroud.Gravity = Gravity.CenterHorizontal;
+ picBackGroud.Radius = (uint)Application.GetRealHeight(29);
+ picBackGroud.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor3;
+ frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEventOnly);
+
+ //鏈垎閰嶅浘鏍�
+ var btnIcon = new PicViewControl(92, 72);
+ btnIcon.X = Application.GetRealWidth(129);
+ btnIcon.Y = Application.GetRealHeight(141);
+ btnIcon.UnSelectedImagePath = "Room/NoNameRoom.png";
+ frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+
+ //鏈垎閰�
+ var btnName = new NormalViewControl(141, 84, true);
+ btnName.X = Application.GetRealWidth(244);
+ btnName.Y = Application.GetRealHeight(131);
+ btnName.IsBold = true;
+ btnName.TextColor = UserCenterColor.Current.White;
+ btnName.TextID = R.MyInternationalizationString.Unallocated;
+ frameBack.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
+ frameBack.ButtonClickEvent += (sender, e) =>
+ {
+ if (this.CanClick == false)
+ {
+ return;
+ }
+ //鏈垎閰�
+ var unalloctedRoom = new UnallocatedRoomForm();
+ this.AddChidren(unalloctedRoom);
+ unalloctedRoom.ShowForm();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鍒锋柊鎸囧畾鎴块棿_______________________
+
+ /// <summary>
+ /// 鍒锋柊鎸囧畾鎴块棿
+ /// </summary>
+ /// <param name="room"></param>
+ public void RefreshRoomInfo(Room room)
+ {
+ if (this.dicCardControl.ContainsKey(room.Id) == true)
+ {
+ //鍒锋柊鍗$墖淇℃伅
+ this.dicCardControl[room.Id].RefreshControl();
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs
new file mode 100755
index 0000000..451e58f
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs
@@ -0,0 +1,765 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.Phone.Device.Category;
+using Shared.Phone.Device.CommonForm;
+using Shared.Phone.UserCenter;
+using Shared.Phone.UserView;
+using ZigBee.Device;
+
+namespace Shared.Phone.MainPage
+{
+ /// <summary>
+ /// 鏈垎閰嶇殑绠$悊鐣岄潰
+ /// </summary>
+ public class UnallocatedRoomForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 娣诲姞鍒� 鐨勮儗鏅浘鎺т欢
+ /// </summary>
+ private FrameLayoutControl frameAddBackGroud = null;
+ /// <summary>
+ /// 鍔熻兘鐨勬甯冩帶浠�
+ /// </summary>
+ private FrameLayout DeviceBodyTableControl = null;
+ /// <summary>
+ /// 鍦烘櫙鐨勫垪琛ㄦ帶浠�
+ /// </summary>
+ private VerticalFrameControl listSceneView = null;
+ /// <summary>
+ /// 璁惧鐨勫垪琛ㄦ帶浠�
+ /// </summary>
+ private VerticalListControl listDeviceView = null;
+ /// <summary>
+ /// 鍦烘櫙鐨勬甯冩帶浠�
+ /// </summary>
+ private FrameLayout SceneBodyTableControl = null;
+ /// <summary>
+ /// 鍏ㄩ�夋帶浠�
+ /// </summary>
+ private NormalViewControl btnAllSelect = null;
+ /// <summary>
+ /// 閫夋嫨鐨勫満鏅�
+ /// </summary>
+ private Dictionary<int, SceneUI> dicSelectScene = new Dictionary<int, SceneUI>();
+ /// <summary>
+ /// 閫夋嫨鐨勮澶�
+ /// </summary>
+ private Dictionary<string, CommonDevice> dicSelectDevice = new Dictionary<string, CommonDevice>();
+ /// <summary>
+ /// 褰撳墠閫夋嫨鐨勮澶囩被鍨嬩俊鎭�(涓轰簡澶勭悊閫熷害浣跨敤)
+ /// </summary>
+ private DeviceRowInfo nowSelectDeviceInfo = null;
+ /// <summary>
+ /// 鍏ㄩ儴鍒嗙粍鐨勮澶囦俊鎭�
+ /// </summary>
+ private Dictionary<int, DeviceRowInfo> dicGroupDevice = null;
+ /// <summary>
+ /// 鏄惁宸茬粡鏀瑰彉浜嗘暟鎹�
+ /// </summary>
+ private bool dataHadChanged = false;
+ /// <summary>
+ /// 鑳藉惁鍏ㄩ�夌殑鐘舵��
+ /// </summary>
+ private bool canSelectAll = true;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //鍒濆鍖栧ご閮ㄦ帶浠�
+ this.InitTopFrameLayout();
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitBodyFrameLayout();
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.Unallocated));
+
+ //鍒濆鍖栧叏閫夋帶浠�
+ this.InitAllSelectControl();
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ var tabControl = new SceneFunctionSwitchControl();
+ tabControl.Y = Application.GetRealHeight(40);
+ bodyFrameLayout.AddChidren(tabControl);
+
+ //鍒濆鍖栧満鏅甯�
+ this.SceneBodyTableControl = new FrameLayout();
+ SceneBodyTableControl.Y = tabControl.Bottom;
+ SceneBodyTableControl.Height = bodyFrameLayout.Height - tabControl.Bottom;
+ bodyFrameLayout.AddChidren(SceneBodyTableControl);
+ //鍒濆鍖栬澶囨甯�
+ this.DeviceBodyTableControl = new FrameLayout();
+ DeviceBodyTableControl.Y = tabControl.Bottom;
+ DeviceBodyTableControl.Height = bodyFrameLayout.Height - tabControl.Bottom;
+ bodyFrameLayout.AddChidren(DeviceBodyTableControl);
+
+ tabControl.SelectTabEvent += (index) =>
+ {
+ //鍦烘櫙
+ if (index == 0)
+ {
+ //鍒濆鍖栧満鏅垎鏀殑鎺т欢
+ this.InitSceneCaseControl();
+ //妫�娴嬪悇鎺т欢鐘舵��
+ this.CheckControlsStatu(null);
+ }
+ //鍔熻兘
+ else
+ {
+ //鍒濆鍖栧姛鑳藉垎鏀殑鎺т欢
+ this.InitDeviceCaseControl();
+ //妫�娴嬪悇鎺т欢鐘舵��
+ this.CheckControlsStatu(this.nowSelectDeviceInfo);
+ }
+ };
+
+ //寮�濮嬪垵濮嬪寲鍦烘櫙鍔熻兘鍒囨崲鎺т欢
+ var listTitle = new List<string>();
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uScence));
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction));
+ //浠栦細鑷姩鍥炶皟浜嬩欢
+ tabControl.InitControl(listTitle);
+ }
+
+ #endregion
+
+ #region 鈻� 鍦烘櫙鍒嗘敮___________________________
+
+ /// <summary>
+ /// 鍒濆鍖栧満鏅垎鏀殑鎺т欢
+ /// </summary>
+ private void InitSceneCaseControl()
+ {
+ //闅愯棌璁惧鍒楄〃
+ this.DeviceBodyTableControl.Visible = false;
+ //鏄剧ず鍦烘櫙
+ this.SceneBodyTableControl.Visible = true;
+ if (this.SceneBodyTableControl.Name == "Scene")
+ {
+ //宸茬粡鍒濆鍖栬繃
+ return;
+ }
+ //鎵撲釜鏍囪瘑鑰屽凡
+ this.SceneBodyTableControl.Name = "Scene";
+ //寮�濮嬫墽琛屽垵濮嬪寲鍦烘櫙鍒嗘敮鐨勬帶浠�
+ this.DoInitSceneCaseControl();
+ }
+
+ /// <summary>
+ /// 寮�濮嬫墽琛屽垵濮嬪寲鍦烘櫙鍒嗘敮鐨勬帶浠�
+ /// </summary>
+ private void DoInitSceneCaseControl()
+ {
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ //娓呯┖妗屽竷
+ this.SceneBodyTableControl.RemoveAll();
+
+ this.listSceneView = new VerticalFrameControl(3);
+ listSceneView.Y = Application.GetRealHeight(53);
+ listSceneView.Height = SceneBodyTableControl.Height;
+ SceneBodyTableControl.AddChidren(listSceneView);
+
+ var listScene = HdlSceneLogic.Current.GetUnalloctedScenes();
+ if (listScene == null || listScene.Count == 0) { return; }
+
+ foreach (var data in listScene)
+ {
+ //鍦烘櫙鍥剧墖
+ var frameContr = new ScenePictrueControl();
+ listSceneView.AddChidrenFrame(frameContr);
+ frameContr.InitControl(data);
+
+ //娣诲姞閫夋嫨鎺т欢
+ frameContr.AddSelectControl();
+
+ //鏀惰棌
+ frameContr.AddCollectionControl();
+ frameContr.CollectEvent += (collect) =>
+ {
+ //濡傛灉褰撳墠鏄敹钘忔埧闂�,鍒欓渶瑕佸埛鏂颁富椤�
+ if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
+ {
+ this.dataHadChanged = true;
+ }
+ };
+
+ frameContr.ButtonClickEvent += (sender, e) =>
+ {
+ //閫夋嫨
+ frameContr.IsSelected = !frameContr.IsSelected;
+ if (frameContr.IsSelected == true)
+ {
+ dicSelectScene[data.Id] = data;
+ }
+ else
+ {
+ dicSelectScene.Remove(data.Id);
+ }
+ //妫�娴嬪悇鎺т欢鐘舵��
+ this.CheckControlsStatu(null);
+ };
+ }
+ //淇冧娇瀹冭秴杩囨椂,鑳藉寰�涓婃粦
+ var frameTemp = new FrameLayout();
+ frameTemp.Height = Application.GetRealHeight(202 + 23);
+ listSceneView.AddChidrenFrame(frameTemp);
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鍔熻兘鍒嗘敮___________________________
+
+ /// <summary>
+ /// 鍒濆鍖栧姛鑳藉垎鏀殑鎺т欢
+ /// </summary>
+ private void InitDeviceCaseControl()
+ {
+ //闅愯棌鍦烘櫙鍒楄〃
+ this.SceneBodyTableControl.Visible = false;
+ //鏄剧ず鍔熻兘
+ this.DeviceBodyTableControl.Visible = true;
+ if (this.DeviceBodyTableControl.Name == "Function")
+ {
+ //宸茬粡鍒濆鍖栬繃
+ return;
+ }
+ //鎵撲釜鏍囪瘑鑰屽凡
+ this.DeviceBodyTableControl.Name = "Function";
+ //寮�濮嬫墽琛屽垵濮嬪寲鍔熻兘鍒嗘敮鐨勬帶浠�
+ this.DoInitDeviceCaseControl();
+ }
+
+ /// <summary>
+ /// 寮�濮嬫墽琛屽垵濮嬪寲鍔熻兘鍒嗘敮鐨勬帶浠�
+ /// </summary>
+ private void DoInitDeviceCaseControl()
+ {
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ //娓呯┖妗屽竷,涓嶆竻绌鸿繖涓殑璇�,瀹冮噷闈㈣繕鏈変笂涓�娆$殑涓滆タ
+ this.listDeviceView?.RemoveAll();
+ this.DeviceBodyTableControl.RemoveAll();
+
+ //鑾峰彇鍒嗙粍鍚庣殑璁惧鍒楄〃
+ this.dicGroupDevice = this.GetAllGroupDevice();
+ if (dicGroupDevice.Count == 0)
+ {
+ this.listDeviceView = null;
+ return;
+ }
+
+ //璁惧鐨勮儗鏅鍣�
+ var frameDeviceBack = new FrameLayout();
+ frameDeviceBack.X = ControlCommonResourse.XXLeft;
+ frameDeviceBack.Y = Application.GetRealHeight(369);
+ frameDeviceBack.BackgroundColor = UserCenterColor.Current.White;
+ frameDeviceBack.Width = bodyFrameLayout.Width;
+ frameDeviceBack.Height = Application.GetRealHeight(1236);
+ frameDeviceBack.Radius = (uint)Application.GetRealHeight(58);
+ DeviceBodyTableControl.AddChidren(frameDeviceBack);
+ //璁惧鍒楄〃鎺т欢
+ this.listDeviceView = new VerticalListControl(35);
+ listDeviceView.Y = Application.GetRealHeight(14);
+ listDeviceView.Height = Application.GetRealHeight(1236 - 14);
+ frameDeviceBack.AddChidren(listDeviceView);
+
+ //鍒濆鍖栬澶囩被鍨嬭彍鍗�
+ this.InitDeviceObjectMenu();
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栬澶囩被鍨嬭彍鍗昣________________
+
+ /// <summary>
+ /// 鍒濆鍖栬澶囩被鍨嬭彍鍗�
+ /// </summary>
+ private void InitDeviceObjectMenu()
+ {
+ //澶撮儴鐨勭櫧鑹茶儗鏅�
+ var functionBack1 = new FrameLayout();
+ functionBack1.X = ControlCommonResourse.XXLeft;
+ functionBack1.Y = Application.GetRealHeight(55);
+ functionBack1.Height = Application.GetRealHeight(160);
+ functionBack1.Width = Application.GetRealWidth(1028);
+ functionBack1.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+ DeviceBodyTableControl.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;
+ DeviceBodyTableControl.AddChidren(functionBack2);
+ functionBack2.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
+
+ //宸﹀彸婊戝姩鐨勬帶浠�
+ var HorizontalView = new HorizontalScrolViewLayout();
+ HorizontalView.X = Application.GetRealWidth(CommonFormResouce.X_Left);
+ HorizontalView.Y = Application.GetRealHeight(55);
+ HorizontalView.Height = Application.GetRealHeight(279);
+ HorizontalView.Width = Application.GetRealWidth(1028);
+ DeviceBodyTableControl.AddChidren(HorizontalView);
+
+ //涓婁竴娆¢�夋嫨鐨勮彍鍗�
+ Controls.DeviceFunctionUnallocatedControl oldSelectContr = null;
+ foreach (int Textid in this.dicGroupDevice.Keys)
+ {
+ var rowInfo = dicGroupDevice[Textid];
+
+ //璁惧绫诲瀷鐨勫鍣�
+ var devieFrame = new FrameLayout();
+ devieFrame.Width = Application.GetRealWidth(220);
+ HorizontalView.AddChidren(devieFrame);
+
+ //鑿滃崟鍥剧墖鎺т欢
+ var deviceObjContr = new Controls.DeviceFunctionUnallocatedControl();
+ devieFrame.AddChidren(deviceObjContr);
+ deviceObjContr.InitControl(Language.StringByID(Textid), rowInfo.IconPath, rowInfo.IconPathSelected, rowInfo.listDeviceKeys);
+ deviceObjContr.ButtonClickEvent += (sender, e) =>
+ {
+ //閫夋嫨鐨勬槸鍚屼竴涓笢瑗跨殑璇�,涓嶅鐞�
+ if (this.nowSelectDeviceInfo.TextId != rowInfo.TextId)
+ {
+ //涓婁竴娆$殑鑿滃崟鍙栨秷,鏈鑿滃崟閫夋嫨
+ oldSelectContr.SetSelectStatu(false);
+ deviceObjContr.SetSelectStatu(true);
+ oldSelectContr = deviceObjContr;
+
+ this.nowSelectDeviceInfo = rowInfo;
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ //鍒濆鍖栬澶囧垪琛ㄦ帶浠�
+ this.InitListDeviceControls(rowInfo);
+ //妫�娴嬪悇鎺т欢鐘舵��
+ this.CheckControlsStatu(this.nowSelectDeviceInfo);
+ });
+ }
+ };
+
+ if (this.nowSelectDeviceInfo == null)
+ {
+ //璁剧疆鍒濆閫夋嫨
+ this.nowSelectDeviceInfo = rowInfo;
+ //璁板綍鍒濆閫夋嫨鐨勮彍鍗曟帶浠�
+ oldSelectContr = deviceObjContr;
+ deviceObjContr.SetSelectStatu(true);
+ }
+ }
+ if (this.nowSelectDeviceInfo != null)
+ {
+ //鍒濆鍖栭粯璁ょ殑璁惧鍒楄〃鎺т欢
+ this.InitListDeviceControls(nowSelectDeviceInfo);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栬澶囧垪琛ㄦ帶浠禵________________
+
+ /// <summary>
+ /// 鍒濆鍖栬澶囧垪琛ㄦ帶浠�
+ /// </summary>
+ /// <param name="rowInfo"></param>
+ /// <param name="listView"></param>
+ private void InitListDeviceControls(DeviceRowInfo rowInfo)
+ {
+ this.listDeviceView.RemoveAll();
+ //鍒濆鍖栬澶囧垪琛ㄦ帶浠�
+ foreach (var deviceKey in rowInfo.listDeviceKeys)
+ {
+ var device = LocalDevice.Current.GetDevice(deviceKey);
+ var deviceRow = new Controls.DeviceSelectUnallocatedControl(listDeviceView.rowSpace / 2);
+ listDeviceView.AddChidren(deviceRow);
+ deviceRow.InitControl(device);
+
+ if (this.dicSelectDevice.ContainsKey(deviceKey) == true)
+ {
+ //濡傛灉瀹冧箣鍓嶉�夋嫨浜嗙殑璇�
+ deviceRow.IsSelected = true;
+ }
+ deviceRow.ButtonClickEvent += (sender, e) =>
+ {
+ deviceRow.IsSelected = !deviceRow.IsSelected;
+ //璁板綍缂撳瓨
+ if (deviceRow.IsSelected == true)
+ {
+ this.dicSelectDevice[deviceKey] = device;
+ }
+ else
+ {
+ this.dicSelectDevice.Remove(deviceKey);
+ }
+ //妫�娴嬪悇鎺т欢鐘舵��
+ this.CheckControlsStatu(rowInfo);
+ };
+ }
+ //淇冧娇瀹冭秴杩囨椂,鑳藉寰�涓婃粦
+ var frameTemp = new FrameLayout();
+ frameTemp.Height = Application.GetRealHeight(202 + 23);
+ listDeviceView.AddChidren(frameTemp);
+ }
+
+ #endregion
+
+ #region 鈻� 鍏ㄩ�夋帶浠禵__________________________
+
+ /// <summary>
+ /// 鍒濆鍖栧叏閫夋帶浠�
+ /// </summary>
+ private void InitAllSelectControl()
+ {
+ this.btnAllSelect = new NormalViewControl(150, 70, true);
+ btnAllSelect.TextAlignment = TextAlignment.CenterRight;
+ btnAllSelect.X = topFrameLayout.Width - Application.GetRealWidth(150 + 115);
+ btnAllSelect.Gravity = Gravity.CenterVertical;
+ btnAllSelect.TextID = R.MyInternationalizationString.AllSelect;
+ btnAllSelect.IsBold = true;
+ topFrameLayout.AddChidren(btnAllSelect);
+ btnAllSelect.ButtonClickEvent += (sender, e) =>
+ {
+ //鍦烘櫙鍒嗘敮
+ if (SceneBodyTableControl.Visible == true)
+ {
+ if (listSceneView == null) { return; }
+ for (int i = 0; ; i++)
+ {
+ var myContr = listSceneView.frameTable.GetChildren(i);
+ if (myContr == null)
+ {
+ break;
+ }
+ if (myContr is ScenePictrueControl)
+ {
+ ((ScenePictrueControl)myContr).IsSelected = this.canSelectAll;
+ var scene = ((ScenePictrueControl)myContr).scene;
+ if (this.canSelectAll == true)
+ {
+ //娣诲姞缂撳瓨
+ dicSelectScene[scene.Id] = scene;
+ }
+ else
+ {
+ //绉婚櫎缂撳瓨
+ dicSelectScene.Remove(scene.Id);
+ }
+ }
+ }
+ //妫�娴嬪悇鎺т欢鐘舵��
+ this.CheckControlsStatu(null);
+ }
+ //鍔熻兘鍒嗘敮
+ else
+ {
+ if (listDeviceView == null) { return; }
+ for (int i = 0; ; i++)
+ {
+ var myContr = listDeviceView.GetChildren(i);
+ if (myContr == null)
+ {
+ break;
+ }
+ if (myContr is Controls.DeviceSelectUnallocatedControl)
+ {
+ ((Controls.DeviceSelectUnallocatedControl)myContr).IsSelected = this.canSelectAll;
+ var device = ((Controls.DeviceSelectUnallocatedControl)myContr).device;
+ if (this.canSelectAll == true)
+ {
+ //娣诲姞缂撳瓨
+ dicSelectDevice[LocalDevice.Current.GetDeviceMainKeys(device)] = device;
+ }
+ else
+ {
+ //绉婚櫎缂撳瓨
+ dicSelectDevice.Remove(LocalDevice.Current.GetDeviceMainKeys(device));
+ }
+ }
+ }
+ //妫�娴嬪悇鎺т欢鐘舵��
+ this.CheckControlsStatu(this.nowSelectDeviceInfo);
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� [娣诲姞鍒癩鎺т欢_______________________
+
+ /// <summary>
+ /// 鍒濆鍖栨坊鍔犲埌鎺т欢
+ /// </summary>
+ private void InitAddToControl()
+ {
+ //娣诲姞鍒� 鐨勮儗鏅浘鎺т欢
+ this.frameAddBackGroud = new FrameLayoutControl();
+ frameAddBackGroud.UseClickStatu = false;
+ frameAddBackGroud.Height = Application.GetRealHeight(202);
+ frameAddBackGroud.Gravity = Gravity.BottomCenter;
+ frameAddBackGroud.BackgroundImagePath = "Room/AddBackground.png";
+ bodyFrameLayout.AddChidren(frameAddBackGroud);
+ frameAddBackGroud.Visible = false;
+
+ //娣诲姞鍒� 鎸夐挳
+ var btnAdd = new NormalViewControl(1034, 156, true);
+ btnAdd.Gravity = Gravity.Center;
+ btnAdd.BackgroundColor = UserCenterColor.Current.White;
+ btnAdd.TextColor = ZigbeeColor.Current.GXCTextSelectedColor4;
+ btnAdd.TextAlignment = TextAlignment.Center;
+ btnAdd.TextID = R.MyInternationalizationString.AddTo;
+ btnAdd.TextSize = 17;
+ btnAdd.Radius = (uint)Application.GetRealHeight(35);
+ frameAddBackGroud.AddChidren(btnAdd, ChidrenBindMode.BindEventOnly);
+ frameAddBackGroud.ButtonClickEvent += (sender, e) =>
+ {
+ var selectZone = new SelectZone();
+ selectZone.title = Language.StringByID(R.MyInternationalizationString.AddTo);
+ selectZone.Init();
+ selectZone.ZoneAction += (selectRoom) =>
+ {
+ //鍙樻洿浜嗗綋鍓嶆埧闂寸殑涓滆タ,涓婚〉闇�瑕佸埛鏂�
+ if (HdlRoomLogic.Current.CurrentRoom.Id == selectRoom.Id)
+ {
+ this.dataHadChanged = true;
+ }
+ //淇濆瓨閫夋嫨鐨勮澶囧拰鍦烘櫙
+ this.SaveSelectDeviceAndScene(selectRoom);
+ };
+ };
+ }
+
+ /// <summary>
+ /// 淇濆瓨閫夋嫨鐨勮澶囧拰鍦烘櫙
+ /// </summary>
+ /// <param name="room"></param>
+ private void SaveSelectDeviceAndScene(Room room)
+ {
+ foreach (var deviceKey in this.dicSelectDevice.Keys)
+ {
+ //娣诲姞璁惧
+ HdlRoomLogic.Current.AddDevice(room, dicSelectDevice[deviceKey], true);
+ foreach (var rowInf in dicGroupDevice.Values)
+ {
+ //绉婚櫎缂撳瓨
+ if (rowInf.listDeviceKeys.Contains(deviceKey) == true)
+ {
+ rowInf.listDeviceKeys.Remove(deviceKey);
+ }
+ }
+ }
+ foreach (var scene in this.dicSelectScene.Values)
+ {
+ //娣诲姞鍦烘櫙
+ HdlSceneLogic.Current.AddScene(room, scene);
+ }
+ //娓呯┖缂撳瓨
+ this.dicSelectScene.Clear();
+ this.dicSelectDevice.Clear();
+ //鍙充笂瑙掔殑鏂囧瓧鍒囨崲涓� 鍏ㄩ��
+ btnAllSelect.TextID = R.MyInternationalizationString.AllSelect;
+ this.canSelectAll = true;
+
+ //鍦烘櫙鍒嗘敮闇�瑕侀噸鏂板垵濮嬪寲
+ this.DoInitSceneCaseControl();
+
+ if (this.nowSelectDeviceInfo != null)
+ {
+
+ bool allHadDevice = true;
+ foreach (var data in this.dicGroupDevice.Values)
+ {
+ if (data.listDeviceKeys.Count == 0)
+ {
+ //鏈夊垎鏀凡缁忔病鏈夎澶囦簡
+ allHadDevice = false;
+ break;
+ }
+ }
+ //濡傛灉鎵�鏈夊垎鏀兘杩樻湁璁惧鐨勮瘽,灏卞埛鏂板綋鍓嶇殑鍒楄〃鍗冲彲
+ if (allHadDevice == true)
+ {
+ //鍒濆鍖栬澶囧垪琛ㄦ帶浠�
+ this.InitListDeviceControls(this.nowSelectDeviceInfo);
+ }
+ else
+ {
+ //濡傛灉瀛樺湪鍒嗘敮宸茬粡娌℃湁璁惧浜嗙殑璇�,閭d箞瀹冪殑鑿滃崟涔熼渶瑕佸垹闄ゆ帀,鎵�浠ラ渶瑕侀噸鏂板垵濮嬪寲
+ this.nowSelectDeviceInfo = null;
+ this.DoInitDeviceCaseControl();
+ }
+ }
+ //闅愯棌 娣诲姞鍒� 鎸夐挳
+ this.frameAddBackGroud.Visible = false;
+ }
+
+ #endregion
+
+ #region 鈻� 鏁村悎璁惧___________________________
+
+ /// <summary>
+ /// 鑾峰彇鍒嗙粍鍚庣殑璁惧
+ /// </summary>
+ /// <returns></returns>
+ private Dictionary<int, DeviceRowInfo> GetAllGroupDevice()
+ {
+ //鍏ㄩ儴鐨勮澶�
+ var listDevice = HdlRoomLogic.Current.GetUnalloctedDevice();
+ //鏍规嵁璁惧鎵�灞炵被鍨嬫帓搴�
+ 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;
+ //鑾峰彇鍥剧墖
+ Common.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()
+ {
+ if (this.dataHadChanged == true)
+ {
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ //鍒锋柊涓婚〉
+ this.LoadFormMethodByName("HomeMainPageForm", "RefreshBodyView");
+ });
+ }
+ base.CloseFormBefore();
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 妫�娴嬪悇鎺т欢鐘舵��
+ /// </summary>
+ private void CheckControlsStatu(DeviceRowInfo rowInfo)
+ {
+ if (this.frameAddBackGroud == null)
+ {
+ //鍒濆鍖栨坊鍔犲埌鎺т欢
+ this.InitAddToControl();
+ }
+
+ if (dicSelectScene.Count == 0 && dicSelectDevice.Count == 0)
+ {
+ //闅愯棌 娣诲姞鍒� 鎺т欢
+ if (frameAddBackGroud.Visible == true)
+ {
+ frameAddBackGroud.Visible = false;
+ }
+ }
+ else
+ {
+ //鏄剧ず 娣诲姞鍒� 鎺т欢
+ if (frameAddBackGroud.Visible == false)
+ {
+ frameAddBackGroud.Visible = true;
+ }
+ }
+ //褰撳墠閫夋嫨鐨勬槸鍦烘櫙鍒嗘敮
+ if (rowInfo == null)
+ {
+ if (this.dicSelectScene.Count > 0)
+ {
+ //鍙充笂瑙掔殑鏂囧瓧鍒囨崲涓� 鍙栨秷
+ btnAllSelect.TextID = R.MyInternationalizationString.Cancel;
+ this.canSelectAll = false;
+ }
+ else
+ {
+ //鍙充笂瑙掔殑鏂囧瓧鍒囨崲涓� 鍏ㄩ��
+ btnAllSelect.TextID = R.MyInternationalizationString.AllSelect;
+ this.canSelectAll = true;
+ }
+ }
+ //褰撳墠閫夋嫨鐨勬槸鍔熻兘鍒嗘敮
+ else
+ {
+ foreach (var deviceKey in rowInfo.listDeviceKeys)
+ {
+ //濡傛灉褰撳墠鐨勮澶囩被鍨嬮�夋嫨鍒嗘敮涓嬶紝瀛樺湪涔嬪墠閫夋嫨鐨勮澶囩殑璇�
+ if (this.dicSelectDevice.ContainsKey(deviceKey) == true)
+ {
+ //鍙充笂瑙掔殑鏂囧瓧鍒囨崲涓� 鍙栨秷
+ btnAllSelect.TextID = R.MyInternationalizationString.Cancel;
+ this.canSelectAll = false;
+ return;
+ }
+ }
+ //濡傛灉涓嶅瓨鍦ㄧ殑璇�,鍙充笂瑙掔殑鏂囧瓧鍒囨崲涓� 鍏ㄩ��
+ btnAllSelect.TextID = R.MyInternationalizationString.AllSelect;
+ this.canSelectAll = 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/MainPage/UserHomeView2.cs b/ZigbeeApp/Shared/Phone/MainPage/UserHomeView2.cs
deleted file mode 100755
index 6e70833..0000000
--- a/ZigbeeApp/Shared/Phone/MainPage/UserHomeView2.cs
+++ /dev/null
@@ -1,1222 +0,0 @@
-锘縰sing Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.UserCenter;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using ZigBee.Device;
-
-namespace Shared.Phone.MainPage
-{
- /// <summary>
- /// 涓婚〉(娉ㄦ剰,BodyFrameLyout鏄満鏅拰鍔熻兘鐨勬甯�)
- /// </summary>
- public class UserHomeView2 : EditorCommonForm
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 璁惧鍗$墖鎺т欢(涓婚敭涓�:璁惧涓婚敭)
- /// </summary>
- private Dictionary<string, Controls.DeviceCardCommon> dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
- /// <summary>
- /// 鍦烘櫙鍗$墖鎺т欢(涓婚敭涓�:鍦烘櫙ID)
- /// </summary>
- private Dictionary<int, Controls.SceneCardControl> dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
- /// <summary>
- /// 褰撳墠閫夋嫨鐨勫垎鏀� 1:鍦烘櫙 2:鍔熻兘
- /// </summary>
- private int NowSelectIndex = 1;
-
- #endregion
-
- #region 鈻� 鍒濆鍖朹____________________________
-
- /// <summary>
- /// 鐣岄潰鏄剧ず
- /// </summary>
- public void ShowForm()
- {
- this.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
- //娓呴櫎鍏ㄩ儴
- this.RemoveAll();
- //鍒濆鍖栧ご閮ㄦ帶浠�
- this.InitTopFrameLayoutControl();
- //鍒濆鍖栦腑闂存帶浠�
- this.InitMidFrameLayoutControl();
- //娣诲姞璁惧鐘舵�佷笂鎶ヤ簨浠�
- this.AddNormalDeviceReportEvent();
- //娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠�
- this.AddSensorDeviceReportEvent();
- }
-
- /// <summary>
- /// 鍒濆鍖栧ご閮ㄦ帶浠�
- /// </summary>
- private void InitTopFrameLayoutControl()
- {
- //澶撮儴瀹瑰櫒
- base.topFrameLayout = new FrameLayout();
- topFrameLayout.Y = Application.GetRealHeight(60);
- topFrameLayout.Height = Application.GetRealHeight(127);
- topFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
- this.AddChidren(topFrameLayout);
-
- //鎷ユ湁妤煎眰
- if (Config.Instance.Home.FloorDics.Count > 0)
- {
- //妤煎眰鍚�
- var btnFloor = new NormalViewControl(500, 100, true);
- //妤煎眰鍥炬爣
- var btnFloorIcon = new IconViewControl(69);
- btnFloorIcon.X = ControlCommonResourse.XXLeft;
- btnFloorIcon.Gravity = Gravity.CenterVertical;
- btnFloorIcon.UnSelectedImagePath = "Item/Floor.png";
- topFrameLayout.AddChidren(btnFloorIcon);
- btnFloorIcon.ButtonClickEvent += (sender, e) =>
- {
- //鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
- this.ShowSelectFloorForm(btnFloor);
- };
- //妤煎眰鍚�
- btnFloor = new NormalViewControl(500, 100, true);
- btnFloor.X = btnFloorIcon.Right;
- btnFloor.Gravity = Gravity.CenterVertical;
- btnFloor.TextColor = ZigbeeColor.Current.GXCTextColor;
- btnFloor.Text = Config.Instance.Home.GetCurrentFloorName;
- btnFloor.IsBold = true;
- topFrameLayout.AddChidren(btnFloor);
- btnFloor.ButtonClickEvent += (sender, e) =>
- {
- //鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
- this.ShowSelectFloorForm(btnFloor);
- };
- }
- //瀹夐槻蹇嵎鏂瑰紡
- if (UserCenterResourse.ResidenceOption.SafetyShortcut)
- {
- var btnSafety = new Controls.SafetyShortcutControl();
- btnSafety.X = Application.GetRealWidth(860);
- btnSafety.Gravity = Gravity.CenterVertical;
- topFrameLayout.AddChidren(btnSafety);
- }
- //娑堟伅鍥炬爣
- var btnMessage = new MessageManagementControl();
- btnMessage.X = Application.GetRealWidth(953);
- btnMessage.Gravity = Gravity.CenterVertical;
- btnMessage.UnSelectedImagePath = "Item/Message.png";
- btnMessage.SelectedImagePath = "Item/MessageSelected.png";
- topFrameLayout.AddChidren(btnMessage);
-
- //浣忓畢鍚嶅瓧
- var btnHouseName = new NormalViewControl(700, 95, true);
- btnHouseName.X = ControlCommonResourse.XXLeft;
- btnHouseName.Y = Application.GetRealHeight(161);
- btnHouseName.TextSize = 24;
- btnHouseName.TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor;
- btnHouseName.IsBold = true;
- btnHouseName.Text = Config.Instance.Home.Name;
- this.AddChidren(btnHouseName);
-
- //鍒囨崲浣忓畢
- btnHouseName.MouseLongEventHandler += (sender, e) =>
- {
- if (Config.Instance.HomeFilePathList.Count == 0)
- {
- //褰撳墠浣忓畢涓虹┖锛岃鍏堝缓绔嬩綇瀹�
- this.ShowMassage(ShowMsgType.Remind, Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst));
- }
- else
- {
- var selectHouse = new Device.Category.SelectHouse();
- selectHouse.Init();
- selectHouse.HouseAction = (houseId) =>
- {
- ChangeResidence(House.GetHouseByHouseId(houseId));
- };
- }
- };
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑闂存帶浠�
- /// </summary>
- private void InitMidFrameLayoutControl()
- {
- //妫�娴嬫槸鍚︾粦瀹氭湁缃戝叧
- if (this.CheckHadBindGateway() == false)
- {
- //鏄剧ず娌℃湁缁戝畾杩囩綉鍏崇殑鐣岄潰
- this.ShowNoGatewayTip();
- }
- else
- {
- var roomPageView = new HorizontalPages();
- roomPageView.Y = Application.GetRealHeight(302);
- roomPageView.Width = Application.GetRealWidth(CommonPage.AppRealWidth);
- roomPageView.Height = Application.GetRealHeight(478);
- this.AddChidren(roomPageView);
- //绐佸嚭杈硅窛
- roomPageView.TCBJ = Application.GetRealWidth(112);
- //涓や釜page涔嬮棿鐨勯棿璺�
- roomPageView.JMBJ = Application.GetRealWidth(69);
-
- //褰撳墠鎴块棿
- var rList = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
- foreach (var room in rList)
- {
- var roomView = new RoomView(0, 0);
- roomPageView.AddChidren(roomView);
- roomView.Init(room);
- roomView.HideName(true);
- roomView.action += () =>
- {
- this.ShowForm();
- };
- }
- //璁剧疆鎴块棿鐨勫垵濮嬮�夋嫨
- var curIndex = rList.FindIndex((obj) => obj.Id == HdlRoomLogic.Current.CurrentRoom.Id);
- roomPageView.PageIndex = curIndex;
- if (roomPageView.GetChildren(roomPageView.PageIndex) != null)
- {
- //褰撳墠鎴块棿,鍒欎笉鏄剧ず閭d簺鏁版嵁鍑烘潵
- (roomPageView.GetChildren(roomPageView.PageIndex) as RoomView).HideName(false);
- }
- //鎺т欢寮�濮嬫粦鍔ㄧ殑浜嬩欢
- //roomPageView.StartScrollAction += () =>
- //{
- // //寮�濮嬫粦鍔ㄦ椂,闅愯棌褰撳墠鐨勬暟鎹樉绀�
- // (roomPageView.GetChildren(roomPageView.PageIndex) as RoomView).HideName(true);
- //};
- roomPageView.PageChange += (sender, e) =>
- {
- if (roomPageView.GetChildren(roomPageView.PageIndex - 1) != null)
- {
- (roomPageView.GetChildren(roomPageView.PageIndex - 1) as RoomView).HideName(true);
- }
- if (roomPageView.GetChildren(roomPageView.PageIndex + 1) != null)
- {
- (roomPageView.GetChildren(roomPageView.PageIndex + 1) as RoomView).HideName(true);
- }
- if (roomPageView.GetChildren(roomPageView.PageIndex) != null)
- {
- (roomPageView.GetChildren(roomPageView.PageIndex) as RoomView).HideName(false);
- }
- //鍒囨崲褰撳墠鎴块棿
- HdlRoomLogic.Current.CurrentRoom = rList[roomPageView.PageIndex];
- //鍒锋柊璁惧妗屽竷鎺т欢
- this.RefreshBodyView();
- };
-
- //鍔熻兘鍜屽満鏅殑鑳屾櫙鍥�
- var functionSceneView = new FrameLayout();
- functionSceneView.Y = Application.GetRealHeight(861);
- functionSceneView.Width = Application.GetRealWidth(832);
- functionSceneView.Height = Application.GetRealHeight(167);
- functionSceneView.Gravity = Gravity.CenterHorizontal;
- functionSceneView.BackgroundImagePath = "Item/SceneFunctionBG.png";
- this.AddChidren(functionSceneView);
-
- //鍦烘櫙
- var btnScene = new NormalViewControl(350, 100, true);
- btnScene.X = Application.GetRealWidth(30);
- btnScene.Y = Application.GetRealHeight(12);
- btnScene.TextColor = ZigbeeColor.Current.GXCTextGrayColor3;
- btnScene.SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor;
- btnScene.TextID = R.MyInternationalizationString.Scence;
- btnScene.IsSelected = true;
- btnScene.TextSize = 16;
- btnScene.IsBold = true;
- btnScene.TextAlignment = TextAlignment.Center;
- functionSceneView.AddChidren(btnScene);
-
- //鍔熻兘
- var btnFunction = new NormalViewControl(360, 100, true);
- btnFunction.X = Application.GetRealWidth(430);
- btnFunction.Y = Application.GetRealHeight(12);
- btnFunction.TextColor = ZigbeeColor.Current.GXCTextGrayColor3;
- btnFunction.SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor;
- btnFunction.TextID = R.MyInternationalizationString.Function;
- btnFunction.IsSelected = false;
- btnFunction.TextAlignment = TextAlignment.Center;
- functionSceneView.AddChidren(btnFunction);
-
- //鍔熻兘鍜屽満鏅痓odyView
- this.bodyFrameLayout = new FrameLayout()
- {
- Y = functionSceneView.Bottom,
- Height = Application.GetRealHeight(750),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- this.AddChidren(bodyFrameLayout);
-
- //閫夋嫨鍔熻兘鍒嗘爮
- btnFunction.ButtonClickEvent += (sender, e) =>
- {
- //鍔熻兘鍒嗘敮閫夋嫨
- this.NowSelectIndex = 2;
-
- btnScene.IsSelected = false;
- btnFunction.IsSelected = true;
- btnScene.TextSize = 14;
- btnScene.IsBold = false;
- btnFunction.TextSize = 16;
- btnFunction.IsBold = true;
- //鍒锋柊璁惧妗屽竷鎺т欢
- this.RefreshBodyView();
- };
- //閫夋嫨鍦烘櫙鍒嗘爮
- btnScene.ButtonClickEvent += (sender, e) =>
- {
- //鍦烘櫙鍒嗘敮閫夋嫨
- this.NowSelectIndex = 1;
-
- btnFunction.IsSelected = false;
- btnScene.IsSelected = true;
- btnScene.TextSize = 16;
- btnScene.IsBold = true;
- btnFunction.TextSize = 14;
- btnFunction.IsBold = false;
- this.RefreshBodyView();
- };
- //鍒锋柊璁惧妗屽竷鎺т欢
- this.RefreshBodyView();
- }
- }
-
- /// <summary>
- /// 鎻愮ず鐢ㄦ埛娌℃湁缃戝叧锛屽苟蹇�熻烦杞埌娣诲姞缃戝叧鐣岄潰
- /// </summary>
- private void ShowNoGatewayTip()
- {
- var bg = new PicViewControl(717, 478);
- bg.Y = Application.GetRealHeight(302);
- bg.Gravity = Gravity.CenterHorizontal;
- bg.UnSelectedImagePath = "Item/NoBindGW.png";
- this.AddChidren(bg);
-
- var tip = new NormalViewControl(Application.GetMinRealAverage(717), Application.GetMinRealAverage(58), false);
- tip.Y = Application.GetRealHeight(815);
- tip.Gravity = Gravity.CenterHorizontal;
- tip.TextID = R.MyInternationalizationString.NewAccountNeedBingGW;
- tip.TextColor = ZigbeeColor.Current.GXCTextGrayColor;
- tip.TextAlignment = TextAlignment.Center;
- this.AddChidren(tip);
-
- var addBG = new PicViewControl(971, 366);
- addBG.Y = Application.GetRealHeight(1048);
- addBG.UnSelectedImagePath = "Item/VirtualFrame.png";
- addBG.Gravity = Gravity.CenterHorizontal;
- this.AddChidren(addBG);
-
- var addGatewayBtn = new IconViewControl(89);
- addGatewayBtn.Y = Application.GetRealHeight(1143);
- addGatewayBtn.UnSelectedImagePath = "Item/Add_GW.png";
- addGatewayBtn.Gravity = Gravity.CenterHorizontal;
- this.AddChidren(addGatewayBtn);
- addGatewayBtn.ButtonClickEvent += (sender, e) =>
- {
- var form = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm();
- form.AddForm();
- };
-
- var addTip = new PicViewControl(717, 58);
- addTip.Y = Application.GetRealHeight(1256);
- addTip.Gravity = Gravity.CenterHorizontal;
- addTip.TextID = R.MyInternationalizationString.AddSmartGW;
- addTip.TextColor = ZigbeeColor.Current.GXCTextBlackColor;
- addTip.TextAlignment = TextAlignment.Center;
- AddChidren(addTip);
-
- addTip.ButtonClickEvent += (sender, e) =>
- {
- var form = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm();
- form.AddForm();
- };
- }
-
- #endregion
-
- #region 鈻� 鍔熻兘鍒嗘敮___________________________
-
- /// <summary>
- /// 鏄剧ず鍔熻兘
- /// </summary>
- private void ShowFunction()
- {
- //鍏堟竻绌虹紦瀛�
- bodyFrameLayout.RemoveAll();
- this.dicDeviceCardControl.Clear();
-
- //褰撳墠鎴块棿鐨勮澶囨暟
- if (HdlRoomLogic.Current.CurrentRoom.ListDevice.Count == 0)
- {
- ShowNoFunctionTip();
- return;
- }
- //鍒楄〃鎺т欢
- var listView = new VerticalFrameControl();
- listView.Height = bodyFrameLayout.Height;
- bodyFrameLayout.AddChidren(listView);
-
- HdlThreadLogic.Current.RunThread(() =>
- {
- //鍒濆鍖栬澶囧崱鐗囧垪琛ㄦ帶浠�
- this.InitDeviceListCardControl(listView);
- });
- }
-
- /// <summary>
- /// 鍒濆鍖栬澶囧崱鐗囧垪琛ㄦ帶浠�
- /// </summary>
- /// <param name="listView"></param>
- private void InitDeviceListCardControl(VerticalFrameControl listView)
- {
- var listDevice = new List<CommonDevice>();
- foreach (var mainkeys in HdlRoomLogic.Current.CurrentRoom.ListDevice)
- {
- var device = LocalDevice.Current.GetDevice(mainkeys);
- if (device == null)
- {
- //杩欎釜璁惧涓嶈浜�
- continue;
- }
- listDevice.Add(device);
- }
-
- //璁惧璁℃暟
- int contrCount = 0;
- //X杞村潗鏍�(鍥剧墖宸﹁竟鏈変綑鐧�)
- int XX = Application.GetMinRealAverage(44);
- //Y杞村潗鏍�
- int YY = 0;
- foreach (var device in listDevice)
- {
- if (listView.Parent == null)
- {
- return;
- }
- System.Threading.Thread.Sleep(20);
- HdlThreadLogic.Current.RunMain(() =>
- {
- Controls.DeviceCardCommon cardContr = null;
- //绐楀笜
- if (device.Type == DeviceType.WindowCoveringDevice)
- {
- cardContr = new Controls.DeviceCurtainCardControl();
- }
- //缁х數鍣�
- else if (device.Type == DeviceType.OnOffOutput)
- {
- cardContr = new Controls.DeviceRelayCardControl();
- }
- //绌烘皵寮�鍏�
- else if (device.Type == DeviceType.AirSwitch)
- {
- cardContr = new Controls.DeviceAirSwitchCardControl();
- }
- //绌鸿皟
- else if (device.Type == DeviceType.Thermostat)
- {
- cardContr = new Controls.DeviceAcCardControl();
- }
- //褰╃伅(璋冨厜鍣�)
- else if (device.Type == DeviceType.DimmableLight)
- {
- cardContr = new Controls.DeviceColorLightCardControl();
- }
- //浼犳劅鍣�
- else if (device.Type == DeviceType.IASZone)
- {
- cardContr = new Controls.DeviceSensorCardControl();
- }
- //娓╂箍搴�
- else if (device.Type == DeviceType.TemperatureSensor)
- {
- cardContr = new Controls.DeviceTemperatureCardControl();
- }
- //闂ㄩ攣
- else if (device.Type == DeviceType.DoorLock)
- {
- cardContr = new Controls.DeviceDoorLockCardControl();
- }
- //鏃犳硶璇嗗埆
- else
- {
- cardContr = new Controls.DeviceCardCommon();
- }
-
- //鍒濆鍖栧崱鐗�
- cardContr.X = XX;
- cardContr.Y = YY;
- listView.frameTable.AddChidren(cardContr);
- cardContr.InitControl(device);
- //鍗$墖闇�瑕佽绉婚櫎鐨勪簨浠�
- cardContr.CardNeedRemoveEvent += () =>
- {
- //閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
- this.ResetDeviceCardControlLocation(LocalDevice.Current.GetDeviceMainKeys(device));
- };
- //璁惧璁℃暟
- contrCount++;
- //鍗$墖宸﹀彸涓よ竟鏈�14鐨勪綑鐧�,姣忎袱涓悗,X杞撮噸缃�
- XX = contrCount % 2 == 0 ? Application.GetMinRealAverage(44) : cardContr.Right + Application.GetMinRealAverage(20);
- if (contrCount % 2 == 0)
- {
- //娌′袱涓箣鍚�,Y杞撮�掑
- YY = cardContr.Bottom + Application.GetMinRealAverage(15);
- }
- //鎺т欢璁板綍鍒扮紦瀛樹腑
- this.dicDeviceCardControl[LocalDevice.Current.GetDeviceMainKeys(device)] = cardContr;
- //鍙戦�佽幏鍙栫姸鎬佺殑鍛戒护
- cardContr.SendStatuComand(device);
- if (contrCount == listDevice.Count)
- {
- //璋冩暣妗屽竷澶у皬
- listView.AdjustTableHeight();
- }
- });
- }
- }
-
- /// <summary>
- /// 鏄剧ず娌℃湁鍔熻兘
- /// </summary>
- private void ShowNoFunctionTip()
- {
- var noFunction = new Button
- {
- Y = Application.GetRealHeight(69),
- Width = Application.GetMinRealAverage(683),
- Height = Application.GetMinRealAverage(392),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/NoFunction.png"
- };
- bodyFrameLayout.AddChidren(noFunction);
-
- var noFunctionTip = new Button()
- {
- Y = noFunction.Bottom,
- Height = Application.GetRealHeight(200),
- Text = Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- bodyFrameLayout.AddChidren(noFunctionTip);
- }
-
- #endregion
-
- #region 鈻� 閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣_______________
-
- /// <summary>
- /// 閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
- /// </summary>
- /// <param name="deleteKey">闇�瑕佽鍒犻櫎鐨勫崱鐗囦富閿�</param>
- private void ResetDeviceCardControlLocation(string deleteKey)
- {
- if (this.dicDeviceCardControl.ContainsKey(deleteKey) == false)
- {
- //濡傛灉鍒楄〃閲岄潰娌℃湁杩欎釜鎺т欢鐨勮瘽
- return;
- }
- //璁惧璁℃暟
- int contrCount = 0;
-
- bool canMove = false;
- foreach (var mainkey in this.dicDeviceCardControl.Keys)
- {
- if (deleteKey == mainkey)
- {
- //濡傛灉宸茬粡鍒颁簡瑕佸垹闄ょ殑鍗$墖,鍒犻櫎鎺夊畠,鐒跺悗瀹冧箣鍚庣殑鍗$墖鍏ㄩ儴鍚戜笂绉诲姩
- this.dicDeviceCardControl[mainkey].RemoveFromParent();
- canMove = true;
- continue;
- }
- //璁惧璁℃暟
- contrCount++;
- //鍗$墖宸﹀彸涓よ竟鏈�14鐨勪綑鐧�,姣忎袱涓悗,X杞撮噸缃�
- int XX = 0;
- if (contrCount % 2 == 1)
- {
- //绗竴涓浐瀹�44
- XX = Application.GetMinRealAverage(44);
- }
- else
- {
- //绗簩涓槸44+鎺т欢瀹藉害+20浣欑櫧
- XX = Application.GetMinRealAverage(44) + this.dicDeviceCardControl[mainkey].Width + Application.GetMinRealAverage(20);
- }
-
- //娌′袱涓箣鍚�,Y杞撮�掑
- int YY = 0;
- if (contrCount > 2)
- {
- //姹傚晢
- int value = contrCount / 2;
- //鎺т欢鐨勫簳閮ㄦ湁15鐨勯棿闅�
- YY = value * (this.dicDeviceCardControl[mainkey].Height + Application.GetMinRealAverage(15));
- }
- if (canMove == true)
- {
- //绉诲姩鎺т欢
- this.dicDeviceCardControl[mainkey].X = XX;
- this.dicDeviceCardControl[mainkey].Y = YY;
- }
- }
- //鍒犻櫎鎺夐偅寮犲崱鐗囩殑涓婚敭
- this.dicDeviceCardControl.Remove(deleteKey);
- }
-
- #endregion
-
- #region 鈻� 鍦烘櫙鍒嗘敮___________________________
-
- /// <summary>
- /// 鏄剧ず鍦烘櫙
- /// </summary>
- private void ShowScene()
- {
- //鍏堟竻绌虹紦瀛�
- bodyFrameLayout.RemoveAll();
- this.dicSceneCardControl.Clear();
-
- if (HdlRoomLogic.Current.CurrentRoom.ListSceneId.Count == 0)
- {
- //鏄剧ず娌″満鏅�
- this.ShowNoSceneTip();
- return;
- }
- //鍒楄〃鎺т欢
- var listView = new VerticalFrameControl();
- listView.Height = bodyFrameLayout.Height;
- bodyFrameLayout.AddChidren(listView);
-
- HdlThreadLogic.Current.RunThread(() =>
- {
- //鍒濆鍖栬澶囧崱鐗囧垪琛ㄦ帶浠�
- this.InitSceneListCardControl(listView);
- });
- }
-
- /// <summary>
- /// 鍒濆鍖栧満鏅崱鐗囧垪琛ㄦ帶浠�
- /// </summary>
- /// <param name="listView"></param>
- private void InitSceneListCardControl(VerticalFrameControl listView)
- {
- var listScene = new List<SceneUI>();
- foreach (int sceneId in HdlRoomLogic.Current.CurrentRoom.ListSceneId)
- {
- var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
- if (sceneUi == null)
- {
- //杩欎釜鍦烘櫙涓嶈浜�
- continue;
- }
- listScene.Add(sceneUi);
- }
-
- //鍦烘櫙璁℃暟
- int contrCount = 0;
- //X杞村潗鏍�(鍥剧墖宸﹁竟鏈変綑鐧�)
- int XX = Application.GetMinRealAverage(44);
- //Y杞村潗鏍�
- int YY = 0;
- foreach (var sceneUi in listScene)
- {
- if (listView.Parent == null)
- {
- return;
- }
- System.Threading.Thread.Sleep(20);
- HdlThreadLogic.Current.RunMain(() =>
- {
- //鍒濆鍖栧崱鐗�
- var cardContr = new Controls.SceneCardControl();
- cardContr.X = XX;
- cardContr.Y = YY;
- listView.frameTable.AddChidren(cardContr);
- cardContr.InitControl(sceneUi);
- //鍗$墖闇�瑕佽绉婚櫎鐨勪簨浠�
- cardContr.CardNeedRemoveEvent += () =>
- {
- //閲嶇疆璁惧鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
- this.ResetSceneCardControlLocation(sceneUi.Id);
- };
- //璁惧璁℃暟
- contrCount++;
- //姣忎袱涓悗,X杞撮噸缃�
- XX = contrCount % 2 == 0 ? Application.GetMinRealAverage(44) : cardContr.Right + Application.GetMinRealAverage(20);
- if (contrCount % 2 == 0)
- {
- //娌′袱涓箣鍚�,Y杞撮�掑
- YY = cardContr.Bottom + Application.GetMinRealAverage(15);
- }
- //鎺т欢璁板綍鍒扮紦瀛樹腑
- this.dicSceneCardControl[sceneUi.Id] = cardContr;
- if (contrCount == listScene.Count)
- {
- //璋冩暣妗屽竷楂樺害
- listView.AdjustTableHeight();
- //璁剧疆鐩墠鍦烘櫙鐨勫欢杩熺姸鎬�
- this.SetSceneDelayTime(listView);
- }
- });
- }
- }
-
- /// <summary>
- /// 鏄剧ず娌″満鏅�
- /// </summary>
- private void ShowNoSceneTip()
- {
- var noScene = new Button
- {
- Y = Application.GetRealHeight(69),
- Width = Application.GetMinRealAverage(683),
- Height = Application.GetMinRealAverage(392),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/NoFunction.png"
- };
- bodyFrameLayout.AddChidren(noScene);
- var noScenceTip = new Button()
- {
- Y = noScene.Bottom,
- Height = Application.GetRealHeight(200),
- Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- bodyFrameLayout.AddChidren(noScenceTip);
- }
-
- /// <summary>
- /// 璁剧疆鍦烘櫙鐨勫欢杩熺姸鎬�
- /// </summary>
- /// <param name="listView"></param>
- private async void SetSceneDelayTime(VerticalFrameControl listView)
- {
- await System.Threading.Tasks.Task.Delay(1500);
- //绛夊緟1.5绉掍箣鍚�,鑾峰彇寤惰繜鐘舵��
- var result = await Scene.CatDelaySceneAsync();
- if (result == null || result.catDelaySceneResponseData == null)
- {
- return;
- }
- if (listView.Parent == null)
- {
- //鎺т欢宸茬粡琚Щ闄�
- return;
- }
- foreach (var data in result.catDelaySceneResponseData.DelayScenesList)
- {
- var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(data.ScenesId);
- if (sceneUi == null)
- {
- continue;
- }
- if (this.dicSceneCardControl.ContainsKey(data.ScenesId) == false)
- {
- //鐩墠涓婚〉涓婅繕娌℃湁杩欎釜鍦烘櫙
- continue;
- }
- //淇敼鍓╀綑寤惰繜鏃堕棿
- sceneUi.RemainTime = data.RemainTime;
- HdlThreadLogic.Current.RunMain(() =>
- {
- //鍒锋柊鍗$墖淇℃伅
- this.dicSceneCardControl[data.ScenesId].RefreshControlInfo(sceneUi);
- });
- }
- }
-
- #endregion
-
- #region 鈻� 閲嶇疆鍦烘櫙鍗$墖鎺т欢鍧愭爣_______________
-
- /// <summary>
- /// 閲嶇疆鍦烘櫙鍗$墖鎺т欢鍧愭爣(鍗$墖闇�瑕佽鍒犻櫎涓撶敤)
- /// </summary>
- /// <param name="deleteKey">闇�瑕佽鍒犻櫎鐨勫崱鐗囦富閿�</param>
- private void ResetSceneCardControlLocation(int deleteId)
- {
- if (this.dicSceneCardControl.ContainsKey(deleteId) == false)
- {
- //濡傛灉鍒楄〃閲岄潰娌℃湁杩欎釜鎺т欢鐨勮瘽
- return;
- }
- //璁惧璁℃暟
- int contrCount = 0;
-
- bool canMove = false;
- foreach (var sceneId in this.dicSceneCardControl.Keys)
- {
- if (deleteId == sceneId)
- {
- //濡傛灉宸茬粡鍒颁簡瑕佸垹闄ょ殑鍗$墖,鍒犻櫎鎺夊畠,鐒跺悗瀹冧箣鍚庣殑鍗$墖鍏ㄩ儴鍚戜笂绉诲姩
- this.dicSceneCardControl[sceneId].RemoveFromParent();
- canMove = true;
- continue;
- }
- //璁惧璁℃暟
- contrCount++;
- //姣忎袱涓悗,X杞撮噸缃�
- int XX = 0;
- if (contrCount % 2 == 1)
- {
- //绗竴涓浐瀹�44
- XX = Application.GetMinRealAverage(44);
- }
- else
- {
- //绗簩涓槸44+鎺т欢瀹藉害+20浣欑櫧
- XX = Application.GetMinRealAverage(44) + this.dicSceneCardControl[sceneId].Width + Application.GetMinRealAverage(20);
- }
-
- //娌′袱涓箣鍚�,Y杞撮�掑
- int YY = 0;
- if (contrCount > 2)
- {
- //姹傚晢
- int value = contrCount / 2;
- //鎺т欢鐨勫簳閮ㄦ湁15鐨勯棿闅�
- YY = value * (this.dicSceneCardControl[sceneId].Height + Application.GetMinRealAverage(15));
- }
- if (canMove == true)
- {
- //绉诲姩鎺т欢
- this.dicSceneCardControl[sceneId].X = XX;
- this.dicSceneCardControl[sceneId].Y = YY;
- }
- }
- //鍒犻櫎鎺夐偅寮犲崱鐗囩殑涓婚敭
- this.dicSceneCardControl.Remove(deleteId);
- }
-
- #endregion
-
- #region 鈻� 鍒锋柊_______________________________
-
- /// <summary>
- /// 鍒锋柊璁惧妗屽竷鎺т欢
- /// </summary>
- public void RefreshBodyView()
- {
- bodyFrameLayout.RemoveAll();
-
- if (this.NowSelectIndex == 2)
- {
- ShowFunction();
- }
- else
- {
- ShowScene();
- }
- }
-
- #endregion
-
- #region 鈻� 鍒囨崲浣忓畢___________________________
- /// <summary>
- /// 鍒囨崲浣忓畢
- /// </summary>
- /// <param name="home">Home.</param>
- private void ChangeResidence(House home)
- {
- try
- {
- CommonPage.Loading.Start();
- new System.Threading.Thread(async () =>
- {
- Config.Instance.HomeId = home.Id;
- Config.Instance.Home = House.GetHouseByFilePath(home.FileName);
- Global.CreateHomeDirectory(home.Id);
- Config.Instance.Save();
- //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
- await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- //鍒濆鍖栧叏閮ㄦ埧闂�
- HdlRoomLogic.Current.InitAllRoom();
-
- Application.RunOnMainThread(() =>
- {
- ShowForm();
- CommonPage.Loading.Hide();
- });
- })
- { IsBackground = true }.Start();
- }
- catch (Exception ex)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- Console.WriteLine(ex.Message);
- });
- }
- }
-
- #endregion
-
- #region 鈻� 涓�鑸澶囩姸鎬佷笂鎶__________________
-
- /// <summary>
- /// 娣诲姞涓�鑸澶囩姸鎬佷笂鎶ヤ簨浠�
- /// </summary>
- private void AddNormalDeviceReportEvent()
- {
- //璁惧灞炴�т笂鎶�
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceStatus", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
- {
- HdlThreadLogic.Current.RunMain(() =>
- {
- //澶勭悊涓�鑸澶囩殑涓婃姤鏁版嵁
- this.AdjustNormalDeviceReportData(report);
-
- }, ShowErrorMode.NO);
- });
-
- //璁惧鍦ㄧ嚎涓婃姤
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceOnline", ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤, (report) =>
- {
- HdlThreadLogic.Current.RunMain(() =>
- {
- string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
- if (this.dicDeviceCardControl.ContainsKey(mainKeys) == false)
- {
- //褰撳墠涓婚〉娌℃湁杩欎釜涓滆タ
- return;
- }
- //璁惧鍗$墖
- var deviceCardContr = this.dicDeviceCardControl[mainKeys];
- var localDevice = LocalDevice.Current.GetDevice(mainKeys);
- localDevice.IsOnline = report.IsOnline;
- //鍒锋柊鍗$墖鐘舵��
- deviceCardContr.SetCardStatu(localDevice.IsOnline == 1);
-
- }, ShowErrorMode.NO);
- });
-
- //璁惧鎺у埗鍙嶉涓婃姤
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceRespone", ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, (report) =>
- {
- HdlThreadLogic.Current.RunMain(() =>
- {
- string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
- if (this.dicDeviceCardControl.ContainsKey(mainKeys) == false)
- {
- //褰撳墠涓婚〉娌℃湁杩欎釜涓滆タ
- return;
- }
- //璁惧鍗$墖
- var deviceCardContr = this.dicDeviceCardControl[mainKeys];
- //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉
- deviceCardContr.SetHadGetResponeResultStatu();
-
- }, ShowErrorMode.NO);
- });
- }
-
- /// <summary>
- /// 澶勭悊涓�鑸澶囩殑涓婃姤鏁版嵁
- /// </summary>
- /// <param name="report"></param>
- private void AdjustNormalDeviceReportData(CommonDevice report)
- {
- string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
- if (this.dicDeviceCardControl.ContainsKey(mainKeys) == false)
- {
- //褰撳墠涓婚〉娌℃湁杩欎釜涓滆タ
- return;
- }
- //璁惧鍗$墖
- var deviceCardContr = this.dicDeviceCardControl[mainKeys];
- //鏈湴璁惧瀵硅薄
- var locadevice = LocalDevice.Current.GetDevice(mainKeys);
- //鏈夊弽棣�,杩欎釜璁惧鑲畾鏄湪绾跨殑
- locadevice.IsOnline = 1;
- locadevice.LastDateTime = DateTime.Now;
-
- #region 鈻� 寮�鍏冲姛鑳�
- //寮�鍏冲姛鑳�
- if (report.DeviceStatusReport.CluterID == 6)
- {
- locadevice.DeviceStatusReport = report.DeviceStatusReport;
- ((LightBase)locadevice).OnOffStatus = report.DeviceStatusReport.AttriBute[0].AttriButeData;
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- #endregion
-
- #region 鈻� 绐楀笜鏁版嵁
- //绐楀笜鏁版嵁
- else if (report.DeviceStatusReport.CluterID == 258)
- {
- //绐楀笜绫诲瀷
- if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
- {
- locadevice.DeviceStatusReport = report.DeviceStatusReport;
- ((Rollershade)report).WcdType = report.DeviceStatusReport.AttriBute[0].AttriButeData;
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- //绐楀笜鐧惧垎姣�
- else if (report.DeviceStatusReport.AttriBute[0].AttributeId == 8)
- {
- locadevice.DeviceStatusReport = report.DeviceStatusReport;
- ((Rollershade)report).WcdCurrentPositionLiftPercentage = report.DeviceStatusReport.AttriBute[0].AttriButeData;
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- }
- #endregion
-
- #region 鈻� 绌鸿皟鏁版嵁
- //绌鸿皟鏁版嵁
- else if (report.DeviceStatusReport.CluterID == 513)
- {
- locadevice.DeviceStatusReport = report.DeviceStatusReport;
- foreach (var attData in report.DeviceStatusReport.AttriBute)
- {
- var curTemp = attData.AttriButeData / 100;
- if (attData.AttributeId == 0)
- {
- //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
- ((AC)locadevice).currentLocalTemperature = curTemp;
- }
- else if (attData.AttributeId == 17)
- {
- //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
- ((AC)locadevice).currentCoolingSetpoint = curTemp;
- }
- else if (attData.AttributeId == 18)
- {
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ((AC)locadevice).currentHeatingSetpoint = curTemp;
- }
- else if (attData.AttributeId == 28)
- {
- //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
- ((AC)locadevice).currentSystemMode = attData.AttriButeData;
- }
- else if (attData.AttributeId == 4096)
- {
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ((AC)locadevice).currentAutoSetpoint = curTemp;
- }
- }
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- //绌鸿皟鏁版嵁
- else if (report.DeviceStatusReport.CluterID == 514)
- {
- locadevice.DeviceStatusReport = report.DeviceStatusReport;
- foreach (var attData in report.DeviceStatusReport.AttriBute)
- {
- if (attData.AttributeId == 0)
- {
- //椋庢墖妯″紡
- ((AC)locadevice).currentFanMode = attData.AttriButeData;
- }
- else if (attData.AttributeId == 4096)
- {
- //椋庢墖鎵
- ((AC)locadevice).currentFanSwingMode = attData.AttriButeData;
- }
- }
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- #endregion
-
- #region 鈻� 浜害鏁版嵁
- //浜害鏁版嵁
- else if (report.DeviceStatusReport.CluterID == 8)
- {
- locadevice.DeviceStatusReport = report.DeviceStatusReport;
- if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
- {
- //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
- ((DimmableLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- }
- #endregion
-
- #region 鈻� 娓╁害鏁版嵁
- //娓╁害鏁版嵁
- else if (report.DeviceStatusReport.CluterID == 1026)
- {
- foreach (var attData in report.DeviceStatusReport.AttriBute)
- {
- //娓╁害
- if (attData.AttributeId == (int)AttriButeId.MeasuredValue)
- {
- if (attData.AttriButeData == 0)
- {
- ((TemperatureSensor)locadevice).Temperatrue = 0;
- }
- else if (attData.AttriButeData > 32767)
- {
- //璐熸暟(鐗规畩澶勭悊)
- string strValue = (attData.AttriButeData - 65536).ToString();
- //灏忔暟鐐归渶瑕佷竴浣�
- strValue = strValue.Substring(0, strValue.Length - 1);
- ((TemperatureSensor)locadevice).Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�
- string strValue = attData.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- ((TemperatureSensor)locadevice).Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- }
- }
- #endregion
-
- #region 鈻� 婀垮害鏁版嵁
- //婀垮害鏁版嵁
- else if (report.DeviceStatusReport.CluterID == 1029)
- {
- foreach (var attData in report.DeviceStatusReport.AttriBute)
- {
- //婀垮害
- if (attData.AttributeId == (int)AttriButeId.MeasuredValue)
- {
- if (attData.AttriButeData == 0)
- {
- ((TemperatureSensor)locadevice).Humidity = 0;
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
- string strValue = attData.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- ((TemperatureSensor)locadevice).Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
- }
- }
- #endregion
- }
-
- #endregion
-
- #region 鈻� 浼犳劅鍣ㄧ姸鎬佷笂鎶____________________
-
- /// <summary>
- /// 娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠�
- /// </summary>
- private void AddSensorDeviceReportEvent()
- {
- //浼犳劅鍣ㄤ笂鎶�
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewSensor", ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�, (report) =>
- {
- HdlThreadLogic.Current.RunMain(() =>
- {
- //澶勭悊浼犳劅鍣ㄤ笂鎶ユ暟鎹�
- this.AdjustSensorDeviceReportData(report);
-
- }, ShowErrorMode.NO);
- });
- }
-
- /// <summary>
- /// 澶勭悊浼犳劅鍣ㄤ笂鎶ユ暟鎹�
- /// </summary>
- /// <param name="report"></param>
- private void AdjustSensorDeviceReportData(CommonDevice report)
- {
- string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
- if (this.dicDeviceCardControl.ContainsKey(mainKeys) == false)
- {
- //褰撳墠涓婚〉娌℃湁杩欎釜涓滆タ
- return;
- }
- //璁惧鍗$墖
- var deviceCardContr = this.dicDeviceCardControl[mainKeys];
- //鏈湴璁惧瀵硅薄
- var locadevice = LocalDevice.Current.GetDevice(mainKeys);
- ((IASZone)locadevice).iASInfo = ((IASZone)report).iASInfo;
- //鏈夊弽棣�,杩欎釜璁惧鑲畾鏄湪绾跨殑
- locadevice.IsOnline = 1;
- locadevice.LastDateTime = DateTime.Now;
- //鍒锋柊鍗$墖淇℃伅
- deviceCardContr.RefreshControlInfo(locadevice);
- }
-
- #endregion
-
- #region 鈻� 鍒囨崲妤煎眰___________________________
-
- /// <summary>
- /// 鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
- /// </summary>
- private void ShowSelectFloorForm(NormalViewControl btnFloor)
- {
- var floorFL = new Device.Category.SelectFloor();
- this.AddChidren(floorFL);
- floorFL.Init(35, 153);
- floorFL.changeFloor = true;
- floorFL.FloorAction = (floorId) =>
- {
- btnFloor.Text = Config.Instance.Home.GetFloorNameById(floorId);
- HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
- this.ShowForm();
- };
- }
-
- #endregion
-
- #region 鈻� 鐣岄潰鍏抽棴___________________________
-
- /// <summary>
- /// 鐣岄潰鍏抽棴
- /// </summary>
- public override void CloseFormBefore()
- {
- HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceOnline");
- HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceRespone");
- HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceStatus");
- HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewSensor");
-
- base.CloseFormBefore();
- }
-
- #endregion
-
- #region 鈻� 涓�鑸柟娉昣__________________________
-
- /// <summary>
- /// 妫�娴嬫槸鍚︾粦瀹氭湁缃戝叧
- /// </summary>
- private bool CheckHadBindGateway()
- {
- //鑾峰彇鏈湴宸茬粡缁戝畾鐨勭綉鍏�
- var gatewayList = HdlGatewayLogic.Current.GetAllLocalGateway();
- if (gatewayList.Count == 0)
- {
- return false;
- }
- //涓讳汉鎴栬�呯鐞嗗憳鎵嶈
- if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
- {
- return true;
- }
- return false;
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/GatewayBackupEnum.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/GatewayBackupEnum.cs
index c80de9c..a49de58 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/GatewayBackupEnum.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/GatewayBackupEnum.cs
@@ -61,5 +61,9 @@
/// 绌鸿皟鎽嗛鍔熻兘
/// </summary>
A绌鸿皟鎽嗛鍔熻兘 = 13,
+ /// <summary>
+ /// 闈㈡澘鎺ヨ繎鎰熷簲鍔熻兘
+ /// </summary>
+ A闈㈡澘鎺ヨ繎鎰熷簲鍔熻兘 = 14,
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs
index 2461b93..18d80cf 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs
@@ -35,6 +35,16 @@
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public int DoorLockMaxAlarmMsgDay = 5;
+ /// <summary>
+ /// 褰撳墠涓婚〉,鍦烘櫙鍜屽姛鑳芥墍閫夋嫨鐨勫垎鏀� 1:鍦烘櫙 2:鍔熻兘
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public int HomeMainPageSwitchIndex = 1;
+ /// <summary>
+ /// 褰撳墠鍒嗙被,鍦烘櫙鍜屽姛鑳芥墍閫夋嫨鐨勫垎鏀� 0:鍦烘櫙 1:鍔熻兘 2:鑷姩鍖�
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public int CategoryPageSwitchIndex = 0;
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
index fc1c8a2..cbae180 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
@@ -19,24 +19,18 @@
/// <returns>淇℃伅瀹瑰櫒鎺т欢</returns>
public VerticalListControl InitControl(FrameLayout bodyFrameLayout, string title, int Y, int Height)
{
- //寮у害鐨勫渾鐨勪竴鍗婄殑楂樺害(鍥哄畾)
- int halfRoundHeigth = Application.GetRealHeight(116) / 2;
- //寮у害鐨勫渾
- var btnRound = new NormalViewControl(bodyFrameLayout.Width, halfRoundHeigth * 2, false);
- btnRound.Y = Application.GetRealHeight(Y);
- btnRound.BackgroundColor = UserCenterColor.Current.White;
- btnRound.Radius = (uint)halfRoundHeigth;
- bodyFrameLayout.AddChidren(btnRound);
- //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙(瑕嗙洊寮у害鐨勫渾鐨勫崐杈�)
+ //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙
var detailBackFrame = new FrameLayout();
- detailBackFrame.Y = btnRound.Bottom - btnRound.Height / 2;
- detailBackFrame.Height = Application.GetRealHeight(Height);//楂樺害灏辨槸瑕佸畠瓒呰繃
+ detailBackFrame.Y = Application.GetRealHeight(Y);
+ detailBackFrame.Height = Application.GetRealHeight(Height + 100);//楂樺害灏辨槸瑕佸畠瓒呰繃
detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
+ detailBackFrame.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
bodyFrameLayout.AddChidren(detailBackFrame);
//淇℃伅缂栬緫
var btnTile = new NormalViewControl(800, 60, true);
btnTile.X = ControlCommonResourse.XXLeft;
+ btnTile.Y = Application.GetRealHeight(81);
btnTile.TextSize = 15;
btnTile.TextColor = UserCenterColor.Current.TextColor2;
btnTile.Text = title;
@@ -44,7 +38,7 @@
var listview = new VerticalListControl(12);
listview.Y = btnTile.Bottom + Application.GetRealHeight(17);
- listview.Height = Application.GetRealHeight(Height) - halfRoundHeigth - btnTile.Bottom - Application.GetRealHeight(17);
+ listview.Height = Application.GetRealHeight(Height) - btnTile.Bottom - Application.GetRealHeight(17);
detailBackFrame.AddChidren(listview);
return listview;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
index 91b3a5f..539ff34 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
@@ -93,12 +93,12 @@
//瀹瑰櫒
bodyFrameLayout = new FrameLayout();
bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor;
-
- var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
- if (nowForm != null && (nowForm is ViewGroup) == true)
- {
- ((ViewGroup)nowForm).AddChidren(bodyFrameLayout);
- }
+ Common.CommonPage.Instance.AddChidren(bodyFrameLayout);
+ //var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
+ //if (nowForm != null && (nowForm is ViewGroup) == true)
+ //{
+ // ((ViewGroup)nowForm).AddChidren(bodyFrameLayout);
+ //}
var frameBack = new FrameLayout();
frameBack.Width = Application.GetRealWidth(674);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
index 056f16c..3412d86 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
@@ -100,6 +100,7 @@
frameTemp.Width = ControlCommonResourse.XXLeft / 2;
scrolContr.AddChidren(frameTemp);
+ int defultIndex = 0;
if (this.dicRoom != null)
{
//鍒濆鍖栨埧闂存ā寮忕殑鎺т欢
@@ -109,6 +110,7 @@
{
//鍒濆鍊�
oldSelectKeys = keys;
+ defultIndex = keys;
}
this.DoInitControl(scrolContr, keys, dicRoom[keys].Name);
}
@@ -116,16 +118,21 @@
else
{
//鍒濆鍖栬澶囨ā寮忕殑鎺т欢
+ int index = 0;
foreach (int keys in dicDevice.Keys)
{
if (oldSelectKeys == -1)
{
//鍒濆鍊�
oldSelectKeys = keys;
+ defultIndex = index;
}
this.DoInitControl(scrolContr, keys, Language.StringByID(keys));
+ index++;
}
}
+ //璁╂帶浠舵粦鍔ㄥ埌鎸囧畾鐨勭储寮曚綅缃�
+ scrolContr.ScrollToViewIndex(defultIndex);
}
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs
index 272203e..373ca78 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs
@@ -49,6 +49,7 @@
public SceneFunctionSwitchControl()
{
this.Height = Application.GetRealHeight(90);
+ this.Y = Application.GetRealHeight(40);
}
/// <summary>
@@ -66,7 +67,7 @@
{
btnTemp.Text = listTitleText[i];
//寮�濮嬪垵濮嬪寲
- XX = this.InitTitleTextControl(i, listTitleText[i], btnTemp.GetTextWidth(), XX);
+ XX = this.InitTitleTextControl(i, listTitleText[i], btnTemp.GetRealWidthByText(), XX);
}
//鍥炶皟鏂规硶
this.frameDefult.ButtonClickEvent?.Invoke(null, null);
@@ -89,6 +90,7 @@
//鍚嶇О
var btnName = new NormalViewControl(frameBack.Width, Application.GetRealHeight(63), false);
btnName.Text = titleText;
+ btnName.TextAlignment = TextAlignment.Center;
if (m_nowSelectIndex == i_index)
{
this.frameDefult = frameBack;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
index 7f39997..b35a549 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
@@ -117,10 +117,6 @@
{
//璋冩暣妗屽竷楂樺害
this.m_frameTable.Height = child.Bottom;
- //if (this.m_frameTable.Height < child.Bottom)
- //{
- // this.m_frameTable.Height = child.Bottom;
- //}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs
index c0fc2a1..908648b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs
@@ -89,16 +89,10 @@
/// </summary>
private void InitMsgControl()
{
- //娣诲姞鐣岄潰
- var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
- if (nowForm == null || (nowForm is ViewGroup) == false)
- {
- return;
- }
//涓绘帶浠�
var frameMain = new FrameLayout();
frameMain.BackgroundColor = UserCenterColor.Current.DialogBackColor;
- ((ViewGroup)nowForm).AddChidren(frameMain);
+ Common.CommonPage.Instance.AddChidren(frameMain);
//鐧借壊鑳屾櫙妗�
var frameBack = new FrameLayout();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs
index ff87091..c4b3515 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs
@@ -39,6 +39,14 @@
}
/// <summary>
+ /// X杞寸殑鐪熷疄鍋忕Щ閲�(璇风‘淇濆凡缁忓姞鍏ョ埗鎺т欢)
+ /// </summary>
+ public int XOffset
+ {
+ get { return (this.Width - btnIcon.Width) / 2; }
+ }
+
+ /// <summary>
/// 鍋氭垚鏀惧湪鐢婚潰鍙宠竟鐨勭殑鍥炬爣鎺т欢(娉ㄦ剰,瀹冧笉鑳界敤鏉ュ仛銆愬悜鍙炽�戠殑鍥炬爣)
/// </summary>
/// <param name="i_width">鎺т欢绌哄害</param>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs
index 380731e..c017895 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs
@@ -45,6 +45,7 @@
public RowLayoutControl(int i_ChidrenYaxis = 0)
{
this.LineColor = UserCenterColor.Current.Transparent;
+ this.SubViewWidth = Application.GetRealWidth(184);
this.chidrenYaxis = i_ChidrenYaxis;
this.Height = ControlCommonResourse.ListViewRowHeight;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs
index 0e07a8a..d3448cd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs
@@ -9,6 +9,45 @@
/// </summary>
public class ScenePictrueControl : FrameRowControl
{
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鍦烘櫙鍥剧墖鎺т欢
+ /// </summary>
+ public ImageView btnScenePic = null;
+ /// <summary>
+ /// 鍦烘櫙鍚嶅瓧鎺т欢
+ /// </summary>
+ public NormalViewControl btnSceneName = null;
+ /// <summary>
+ /// 鍦烘櫙瀵硅薄
+ /// </summary>
+ public Common.SceneUI scene = null;
+ /// <summary>
+ /// 鏀惰棌瑙﹀彂鐨勪簨浠� true:娣诲姞鏀惰棌 false:鍙栨秷鏀惰棌
+ /// </summary>
+ public Action<bool> CollectEvent = null;
+ /// <summary>
+ /// 閫夋嫨鎺т欢(璋冪敤AddSelectControl()鍑芥暟鍒濆鍖�)
+ /// </summary>
+ private IconViewControl btnSelect = null;
+
+ private bool m_IsSelected = false;
+ /// <summary>
+ /// 閫夋嫨鐘舵��
+ /// </summary>
+ public bool IsSelected
+ {
+ get { return m_IsSelected; }
+ set
+ {
+ m_IsSelected = value;
+ if (btnSelect != null) { btnSelect.IsSelected = m_IsSelected; }
+ }
+ }
+
+ #endregion
+
#region 鈻� 鍒濆鍖朹____________________________
/// <summary>
@@ -26,39 +65,105 @@
/// <param name="sceneUI">鍦烘櫙鎺т欢</param>
public void InitControl(Common.SceneUI sceneUI)
{
+ this.scene = sceneUI;
//鍦烘櫙鍥剧墖
- var btnPic = new ImageView();
- btnPic.X = Application.GetRealWidth(179);
- btnPic.Width = Application.GetRealWidth(844);
- btnPic.Height = Application.GetRealHeight(397);
+ this.btnScenePic = new ImageView();
+ btnScenePic.X = Application.GetRealWidth(179);
+ btnScenePic.Width = Application.GetRealWidth(844);
+ btnScenePic.Height = Application.GetRealHeight(397);
if (sceneUI.IconPathType == 0)
{
- btnPic.ImagePath = sceneUI.IconPath;
+ btnScenePic.ImagePath = sceneUI.IconPath;
}
else if (Common.Global.IsExistsByHomeId(sceneUI.IconPath) == true)
{
- btnPic.ImageBytes = Common.Global.ReadFileByHomeId(sceneUI.IconPath);
+ btnScenePic.ImageBytes = Common.Global.ReadFileByHomeId(sceneUI.IconPath);
}
- btnPic.Radius = (uint)Application.GetRealHeight(17);
- this.AddChidren(btnPic, ChidrenBindMode.NotBind);
+ btnScenePic.Radius = (uint)Application.GetRealHeight(17);
+ this.AddChidren(btnScenePic, ChidrenBindMode.NotBind);
//闃村奖
- var btnShadow = new PicViewControl(btnPic.Width + Application.GetRealWidth(14 * 2), btnPic.Height + Application.GetRealHeight(43), false);
- btnShadow.X = btnPic.X - Application.GetRealWidth(14);
+ var btnShadow = new PicViewControl(btnScenePic.Width + Application.GetRealWidth(14 * 2), btnScenePic.Height + Application.GetRealHeight(43), false);
+ btnShadow.X = btnScenePic.X - Application.GetRealWidth(14);
btnShadow.UnSelectedImagePath = "Scene/SceneShadow.png";
this.AddChidren(btnShadow, ChidrenBindMode.BindEventOnly);
- var btnName = new NormalViewControl(251, 282, true);
- btnName.IsMoreLines = true;
- btnName.X = ControlCommonResourse.XXLeft;
- btnName.Y = Application.GetRealHeight(58);
- btnName.BackgroundColor = 0xd6333333;
- btnName.RadiusEx = 17;
- btnName.Text = sceneUI.Name;
- btnName.TextSize = 15;
- btnName.TextColor = UserCenterColor.Current.White;
- btnName.TextAlignment = TextAlignment.Center;
- this.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
+ this.btnSceneName = new NormalViewControl(251, 282, true);
+ btnSceneName.IsMoreLines = true;
+ btnSceneName.X = ControlCommonResourse.XXLeft;
+ btnSceneName.Y = Application.GetRealHeight(58);
+ btnSceneName.BackgroundColor = 0xd6333333;
+ btnSceneName.RadiusEx = 17;
+ btnSceneName.Text = sceneUI.Name;
+ btnSceneName.TextSize = 15;
+ btnSceneName.TextColor = UserCenterColor.Current.White;
+ btnSceneName.TextAlignment = TextAlignment.Center;
+ this.AddChidren(btnSceneName, ChidrenBindMode.NotBind);
+ }
+
+ #endregion
+
+ #region 鈻� 閫夋嫨鎺т欢___________________________
+
+ /// <summary>
+ /// 娣诲姞閫夋嫨鎺т欢
+ /// </summary>
+ public void AddSelectControl()
+ {
+ this.btnSelect = new IconViewControl(58);
+ btnSelect.UnSelectedImagePath = "Item/ItemUnSelected.png";
+ btnSelect.SelectedImagePath = "Item/ItemSelected.png";
+ btnSelect.X = Application.GetRealWidth(887);
+ btnSelect.Y = Application.GetRealHeight(35);
+ this.AddChidren(btnSelect, ChidrenBindMode.BindEventOnly);
+ }
+
+ #endregion
+
+ #region 鈻� 鏀惰棌鎺т欢___________________________
+
+ /// <summary>
+ /// 娣诲姞鏀惰棌鎺т欢(CollectEvent鏄敹钘忕殑鍥炶皟浜嬩欢)
+ /// </summary>
+ public void AddCollectionControl()
+ {
+ var btnCollection = new IconViewControl(65);
+ btnCollection.X = Application.GetRealWidth(81);
+ btnCollection.Y = Application.GetRealHeight(81);
+ btnCollection.UnSelectedImagePath = "Item/Collection.png";
+ btnCollection.SelectedImagePath = "Item/CollectionSelected.png";
+ if (HdlRoomLogic.Current.IsCollectInRoom(scene) == true)
+ {
+ btnCollection.IsSelected = true;
+ }
+ this.AddChidren(btnCollection, ChidrenBindMode.NotBind);
+ btnCollection.ButtonClickEvent += (sender, e) =>
+ {
+ btnCollection.IsSelected = !btnCollection.IsSelected;
+ if (btnCollection.IsSelected == true)
+ {
+ HdlSceneLogic.Current.AddLoveScene(scene);
+ }
+ else
+ {
+ HdlSceneLogic.Current.DeleteLoveScene(scene);
+ }
+ this.CollectEvent?.Invoke(btnCollection.IsSelected);
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鎺т欢鎽ф瘉___________________________
+
+ /// <summary>
+ /// 鎺т欢鎽ф瘉
+ /// </summary>
+ public override void RemoveFromParent()
+ {
+ this.CollectEvent = null;
+
+ base.RemoveFromParent();
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs
index c7b8dc2..2f7a1b2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs
@@ -142,7 +142,7 @@
public async Task<bool> CommitCurtainLimitPoint(Rollershade rollershade, Rollershade.CurtainPrivateInstalledLimi limiType, int upLimit, int downLimit)
{
CommonDevice.SetWritableValueResponAllData result = null;
- if (upLimit == -1 && upLimit == -1)
+ if (upLimit == -1 && downLimit == -1)
{
//杩欎釜鏄嵎甯�
result = await rollershade.SetCurtainInstalledLimitAsync(limiType);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs
index b741e66..03de7f2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs
@@ -211,7 +211,17 @@
isRightData = true;
if (data.AttriButeDataHex.Length > 2)
{
- var value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
+ string value;
+ if (Common.LocalDevice.Current.IsHdlDevice(device) == false)
+ {
+ //绗笁鏂硅澶�
+ value = data.AttriButeDataHex.Substring(2);
+ }
+ else
+ {
+ //娌充笢璁惧
+ value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
+ }
if (device.SerialNumber != value)
{
//灞炴�у彉鏇翠簡
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
index 8c56b72..90a72cc 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
@@ -205,6 +205,87 @@
#endregion
+ #region 鈻� 鎺ヨ繎鎰熷簲___________________________
+ /// <summary>
+ /// 鑾峰彇鎺ヨ繎鎰熷簲閰嶇疆锛坲i鍙帴杩戞劅搴�,浣跨敤杩斿洖鍊肩殑panelProximitySensorInfo锛�
+ /// </summary>
+ /// <param name="device">璁惧瀵硅薄</param>
+ /// <returns></returns>
+ public async Task<Panel.PanelProximitySensorInfo> GetDeviceProximitySensorsSettion(CommonDevice device)
+ {
+ //鍊熺敤瀹冪殑鍑芥暟
+ var panel = new Panel();
+ panel.DeviceAddr = device.DeviceAddr;
+ panel.DeviceEpoint = device.DeviceEpoint;
+ panel.CurrentGateWayId = device.CurrentGateWayId;
+
+ var result = await panel.GetProximitySensorAsync();
+ panel = null;
+ //鍏遍�氶敊璇娴�
+ string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+ if (error != null)
+ {
+ this.ShowErrorMsg(error);
+ return null;
+ }
+ if (result == null || result.panelProximitySensorInfo == null || string.IsNullOrEmpty(result.errorMessageBase) == false)
+ {
+ //鑾峰彇鎺ヨ繎鎰熷簲淇℃伅澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.GetPanelProximityFail);
+ this.ShowErrorMsg(msg);
+ return null;
+ }
+ return result.panelProximitySensorInfo;
+ }
+
+
+ /// <summary>
+ /// 閰嶇疆鎺ヨ繎浼犳劅
+ /// </summary>
+ /// <param name="device">璁惧瀵硅薄</param>
+ /// <para>sensorEnable:浼犳劅鍣ㄤ娇鑳�</para>
+ /// <returns></returns>
+ public async Task<bool> SetProximitySensorStatus(CommonDevice device, bool sensorEnable)
+ {
+ //鍊熺敤瀹冪殑鍑芥暟
+ var panel = new Panel();
+ panel.DeviceAddr = device.DeviceAddr;
+ panel.DeviceEpoint = device.DeviceEpoint;
+ panel.CurrentGateWayId = device.CurrentGateWayId;
+
+ var result = await panel.SetProximitySensor(sensorEnable);
+ panel = null;
+
+ //鍏遍�氶敊璇娴�
+ string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+ if (error != null)
+ {
+ this.ShowErrorMsg(error);
+ return false;
+ }
+
+ if (result == null || result.responseData == null)
+ {
+ //鎺ヨ繎浼犳劅閰嶇疆澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.SetPannelProximityFail);
+ //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
+ msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+
+ this.ShowTipMsg(msg);
+ return false;
+ }
+
+ // 澶囦唤璁惧
+ var backData = new Newtonsoft.Json.Linq.JObject
+ {
+ { "sensorEnable",sensorEnable }
+ };
+ //澶囦唤璁惧
+ await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.A闈㈡澘鎺ヨ繎鎰熷簲鍔熻兘, backData);
+ return true;
+ }
+ #endregion
+
#region 鈻� 鑺傝兘妯″紡___________________________
/// <summary>
/// 鑾峰彇璁惧鑺傝兘妯″紡鐨勯厤缃姸鎬�(ui鍙妭鑳芥ā寮�)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
index aeffe47..3f1200f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -204,7 +204,13 @@
/// <param name="zbGateway">缃戝叧</param>
/// <param name="mode">鏄惁鏄剧ず閿欒</param>
public async Task<bool> AddNewGateway(ZbGateway zbGateway, ShowErrorMode mode)
- {
+ {
+ //璁剧疆缃戝叧鐨勭粡绾害
+ bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude, ShowErrorMode.NO);
+ if (falge == false)
+ {
+ return falge;
+ }
//鎵ц娣诲姞缃戝叧鍒板唴瀛�
var result = await this.DoAddGatewayToMemory(zbGateway, mode);
//鍓嶇殑缃戝叧缁戝畾鍦ㄤ簡褰撳墠璐﹀彿涓嬬殑涓嶅悓浣忓畢閲岄潰
@@ -226,9 +232,7 @@
{
return false;
}
- //璁剧疆缃戝叧鐨勭粡绾害
- bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude);
- return falge;
+ return true;
}
/// <summary>
@@ -438,7 +442,7 @@
return -1;
}
//璁剧疆缃戝叧鐨勭粡绾害
- bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude);
+ bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude, ShowErrorMode.YES);
if (falge == false)
{
return -1;
@@ -2209,15 +2213,19 @@
/// <param name="gateway">缃戝叧瀵硅薄</param>
/// <param name="Longitude">缁忓害</param>
/// <param name="Latitude">缁村害</param>
+ /// <param name="mode">鏄剧ず閿欒</param>
/// <returns></returns>
- public bool SetGatewaySite(ZbGateway gateway, double Longitude, double Latitude)
+ public bool SetGatewaySite(ZbGateway gateway, double Longitude, double Latitude, ShowErrorMode mode)
{
ZbGateway realWay = null;
if (this.GetRealGateway(ref realWay, gateway) == false)
{
- //閿欒:缃戝叧瀵硅薄涓㈠け
- string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
- this.ShowTipMsg(msg);
+ if (mode == ShowErrorMode.YES)
+ {
+ //閿欒:缃戝叧瀵硅薄涓㈠け
+ string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
+ this.ShowTipMsg(msg);
+ }
return false;
}
@@ -2262,13 +2270,16 @@
realWay.Actions -= action;
if (result != 0)
{
- //璁剧疆缃戝叧缁忕含搴﹀け璐�
- string msg = Language.StringByID(R.MyInternationalizationString.uSetGatewaySiteFail);
- if (result == -1)
+ if (mode == ShowErrorMode.YES)
{
- msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "鍥炲瓒呮椂");
+ //璁剧疆缃戝叧缁忕含搴﹀け璐�
+ string msg = Language.StringByID(R.MyInternationalizationString.uSetGatewaySiteFail);
+ if (result == -1)
+ {
+ msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "鍥炲瓒呮椂");
+ }
+ this.ShowTipMsg(msg);
}
- this.ShowTipMsg(msg);
return false;
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
index 619dd26..4cab21b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -194,10 +194,207 @@
var deviceAddr = receiveData.Value<string>("DeviceAddr");
var deviceEpoint = receiveData.Value<int>("Epoint");
- var tempDevice = new CommonDevice { DeviceAddr = deviceAddr, DeviceEpoint = deviceEpoint };
- tempDevice.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceStatusReportData>(receiveData["Data"].ToString());
+ var report = new CommonDevice { DeviceAddr = deviceAddr, DeviceEpoint = deviceEpoint };
+ report.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceStatusReportData>(receiveData["Data"].ToString());
+ if (report.DeviceStatusReport.AttriBute.Count == 0)
+ {
+ //缃戝叧鏈変簺濂囪懇锛屾病鏈夊睘鎬у畠涔熶細鍙戣繃鏉�
+ return;
+ }
- this.DeviceReportPush(tempDevice, ReceiveComandDiv.A璁惧灞炴�т笂鎶�);
+ //澶勭悊缃戝叧涓婃姤鐨勬暟鎹�,鐒跺悗鍙樻洿鏈湴缂撳瓨
+ var locadevice = Common.LocalDevice.Current.GetDevice(deviceAddr, deviceEpoint);
+ if (locadevice != null)
+ {
+ //鏈夊弽棣�,杩欎釜璁惧鑲畾鏄湪绾跨殑
+ locadevice.IsOnline = 1;
+ locadevice.LastDateTime = DateTime.Now;
+
+ #region 鈻� 寮�鍏冲姛鑳�
+ //寮�鍏冲姛鑳�
+ if (report.DeviceStatusReport.CluterID == 6)
+ {
+ if (locadevice is LightBase)
+ {
+ locadevice.DeviceStatusReport = report.DeviceStatusReport;
+ ((LightBase)locadevice).OnOffStatus = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ #endregion
+
+ #region 鈻� 绐楀笜鏁版嵁
+ //绐楀笜鏁版嵁
+ else if (report.DeviceStatusReport.CluterID == 258)
+ {
+ //绐楀笜绫诲瀷
+ if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+ {
+ locadevice.DeviceStatusReport = report.DeviceStatusReport;
+ ((Rollershade)locadevice).WcdType = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ //杩欎釜涓滆タ瑕佷繚瀛�
+ locadevice.ReSave();
+ }
+ //绐楀笜鐧惧垎姣�
+ else if (report.DeviceStatusReport.AttriBute[0].AttributeId == 8)
+ {
+ locadevice.DeviceStatusReport = report.DeviceStatusReport;
+ ((Rollershade)locadevice).WcdCurrentPositionLiftPercentage = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ #endregion
+
+ #region 鈻� 绌鸿皟鏁版嵁
+ //绌鸿皟鏁版嵁
+ else if (report.DeviceStatusReport.CluterID == 513)
+ {
+ locadevice.DeviceStatusReport = report.DeviceStatusReport;
+ foreach (var attData in report.DeviceStatusReport.AttriBute)
+ {
+ var curTemp = attData.AttriButeData / 100;
+ if (attData.AttributeId == 0)
+ {
+ //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
+ ((AC)locadevice).currentLocalTemperature = curTemp;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ else if (attData.AttributeId == 17)
+ {
+ //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
+ ((AC)locadevice).currentCoolingSetpoint = curTemp;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ else if (attData.AttributeId == 18)
+ {
+ //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+ ((AC)locadevice).currentHeatingSetpoint = curTemp;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ else if (attData.AttributeId == 28)
+ {
+ //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
+ ((AC)locadevice).currentSystemMode = attData.AttriButeData;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ else if (attData.AttributeId == 4096)
+ {
+ //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+ ((AC)locadevice).currentAutoSetpoint = curTemp;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ }
+ //绌鸿皟鏁版嵁
+ else if (report.DeviceStatusReport.CluterID == 514)
+ {
+ locadevice.DeviceStatusReport = report.DeviceStatusReport;
+ foreach (var attData in report.DeviceStatusReport.AttriBute)
+ {
+ if (attData.AttributeId == 0)
+ {
+ //椋庢墖妯″紡
+ ((AC)locadevice).currentFanMode = attData.AttriButeData;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ else if (attData.AttributeId == 4096)
+ {
+ //椋庢墖鎵
+ ((AC)locadevice).currentFanSwingMode = attData.AttriButeData;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ }
+ #endregion
+
+ #region 鈻� 浜害鏁版嵁
+ //浜害鏁版嵁
+ else if (report.DeviceStatusReport.CluterID == 8)
+ {
+ locadevice.DeviceStatusReport = report.DeviceStatusReport;
+ if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+ {
+ //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
+ ((DimmableLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ #endregion
+
+ #region 鈻� 娓╁害鏁版嵁
+ //娓╁害鏁版嵁
+ else if (report.DeviceStatusReport.CluterID == 1026)
+ {
+ foreach (var attData in report.DeviceStatusReport.AttriBute)
+ {
+ //娓╁害
+ if (attData.AttributeId == (int)AttriButeId.MeasuredValue)
+ {
+ if (attData.AttriButeData == 0)
+ {
+ ((TemperatureSensor)locadevice).Temperatrue = 0;
+ }
+ else if (attData.AttriButeData > 32767)
+ {
+ //璐熸暟(鐗规畩澶勭悊)
+ string strValue = (attData.AttriButeData - 65536).ToString();
+ //灏忔暟鐐归渶瑕佷竴浣�
+ strValue = strValue.Substring(0, strValue.Length - 1);
+ ((TemperatureSensor)locadevice).Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
+ }
+ else
+ {
+ //灏忔暟鐐归渶瑕佷竴浣�
+ string strValue = attData.AttriButeData.ToString();
+ strValue = strValue.Substring(0, strValue.Length - 1);
+ ((TemperatureSensor)locadevice).Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
+ }
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ }
+ #endregion
+
+ #region 鈻� 婀垮害鏁版嵁
+ //婀垮害鏁版嵁
+ else if (report.DeviceStatusReport.CluterID == 1029)
+ {
+ foreach (var attData in report.DeviceStatusReport.AttriBute)
+ {
+ //婀垮害
+ if (attData.AttributeId == (int)AttriButeId.MeasuredValue)
+ {
+ if (attData.AttriButeData == 0)
+ {
+ ((TemperatureSensor)locadevice).Humidity = 0;
+ }
+ else
+ {
+ //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
+ string strValue = attData.AttriButeData.ToString();
+ strValue = strValue.Substring(0, strValue.Length - 1);
+ ((TemperatureSensor)locadevice).Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
+ }
+ }
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ #endregion
+ }
+
+ this.DeviceReportPush(report, ReceiveComandDiv.A璁惧灞炴�т笂鎶�);
}
#endregion
@@ -218,6 +415,15 @@
{
//淇濆瓨瀹夐槻鎶ヨ淇℃伅鍒版湰鍦�
HdlAlarmsLogic.Current.SaveSafeguardAlarmInfo(ias);
+ }
+
+ //澶勭悊缃戝叧涓婃姤鐨勬暟鎹�,鐒跺悗鍙樻洿鏈湴缂撳瓨
+ var locadevice = Common.LocalDevice.Current.GetDevice(ias.DeviceAddr, ias.DeviceEpoint);
+ if (locadevice != null)
+ {
+ ((IASZone)locadevice).iASInfo = ias.iASInfo;
+ //璁板綍鍥炲鏃堕棿
+ locadevice.LastDateTime = DateTime.Now;
}
this.DeviceReportPush(ias, ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�);
@@ -260,7 +466,17 @@
}
var tempDevice = new CommonDevice() { DeviceAddr = receiveData.Value<string>("DeviceAddr"), DeviceEpoint = receiveData.Value<int>("Epoint") };
tempDevice.IsOnline = Convert.ToInt32(receiveData["Data"]["IsOnline"].ToString());
-
+
+ //澶勭悊缃戝叧涓婃姤鐨勬暟鎹�,鐒跺悗鍙樻洿鏈湴缂撳瓨
+ var locadevice = Common.LocalDevice.Current.GetDevice(tempDevice.DeviceAddr, tempDevice.DeviceEpoint);
+ if (locadevice != null)
+ {
+ locadevice.IsOnline = tempDevice.IsOnline;
+ //璁板綍鍥炲鏃堕棿
+ locadevice.LastDateTime = DateTime.Now;
+ locadevice.ReSave();
+ }
+
this.DeviceReportPush(tempDevice, ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤);
}
@@ -517,11 +733,11 @@
#region 鈻� 涓�鑸柟娉昣__________________________
/// <summary>
- /// 璁惧涓婃姤鎺ㄩ��
+ /// 璁惧涓婃姤鎺ㄩ��(璋冪敤姝ゆ柟娉�,浠栦細鎺ㄩ�佸埌鍚勮嚜鐨勭晫闈�)
/// </summary>
/// <param name="common"></param>
/// <param name="comand"></param>
- private void DeviceReportPush(CommonDevice common, ReceiveComandDiv comand)
+ public void DeviceReportPush(CommonDevice common, ReceiveComandDiv comand)
{
if (this.dicDeviceEvent.Count == 0)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
index a44eb08..f0ea83f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
@@ -136,7 +136,7 @@
{
Application.RunOnMainThread(() =>
{
- Phone.Device.Room.RoomManagement.Instance.Show();
+ MainPage.ListRoomViewFrom.Instance?.ShowForm();
});
}
@@ -683,12 +683,28 @@
/// <returns></returns>
public List<CommonDevice> GetRoomListDevice(Room i_room)
{
- var listDevice = new List<CommonDevice>();
+ var dicSort = new Dictionary<string, List<int>>();
foreach (var mainKeys in i_room.ListDevice)
{
var device = LocalDevice.Current.GetDevice(mainKeys);
if (device != null)
{
+ if (dicSort.ContainsKey(device.DeviceAddr) == false)
+ {
+ dicSort[device.DeviceAddr] = new List<int>();
+ }
+ dicSort[device.DeviceAddr].Add(device.DeviceEpoint);
+ }
+ }
+ var listDevice = new List<CommonDevice>();
+ foreach (var strMac in dicSort.Keys)
+ {
+ var listEpont = dicSort[strMac];
+ //鎺掑簭
+ listEpont.Sort();
+ for (int i = 0; i < listEpont.Count; i++)
+ {
+ var device = LocalDevice.Current.GetDevice(strMac, listEpont[i]);
listDevice.Add(device);
}
}
@@ -766,10 +782,6 @@
listDevice.Add(device);
}
}
- if (listDevice.Count == 0)
- {
- return null;
- }
return listDevice;
}
@@ -825,7 +837,7 @@
#region 鈻� 妤煎眰鍜屾埧闂撮『搴忕浉鍏砡________________
/// <summary>
- /// 鏍规嵁妤煎眰鐨勪富閿幏鍙栨帓搴忓悗鐨勬埧闂村垪琛�
+ /// 鏍规嵁妤煎眰鐨勪富閿幏鍙栨帓搴忓悗鐨勬埧闂村垪琛�(鏀寔鏃犳ゼ灞傛ā寮�)
/// </summary>
/// <param name="i_floorKeys">妤煎眰鐨勪富閿�</param>
/// <param name="getShard">鍒嗕韩鐨勬埧闂存槸鍚︿篃鑾峰彇</param>
@@ -854,11 +866,16 @@
var dicRoom = new Dictionary<string, Common.Room>();
foreach (var room in this.dicRooms.Values)
{
- if (room.FloorId != i_floorKeys || room.IsLove == true)
+ if (room.FloorId != i_floorKeys && i_floorKeys != string.Empty)
{
//涓嶆槸鍚屼竴涓ゼ灞�
continue;
}
+ if (room.IsLove == true)
+ {
+ //涓嶈鎴戠殑鍠滅埍
+ continue;
+ }
if (listRoomSort.Contains(room.Id) == false)
{
//鏂版坊鍔犵殑鎴块棿
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
index 23e7d57..1ec286d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
@@ -234,7 +234,7 @@
//澶勭悊璁惧
foreach (var data2 in allData.DeviceList)
{
- string mainKey = data2.MacAddr + data2.Epoint;
+ string mainKey = LocalDevice.Current.GetDeviceMainKeys(data2.MacAddr, data2.Epoint);
//浼犳劅鍣ㄨ澶囦俊鎭�
var Deviceinfo = new Safeguard.ZoneDeviceListData();
Deviceinfo.IsBypass = data2.IsBypass;
@@ -295,7 +295,7 @@
if (data.Type == 0)
{
//鏈湴鏄惁鏈夎繖涓澶�
- string mainKey = data.DeviceAddr + data.Epoint;
+ string mainKey = LocalDevice.Current.GetDeviceMainKeys(data.DeviceAddr, data.Epoint);
//鎶ヨ淇℃伅
zoneInfo.dicAlarmDevice[mainKey] = data;
CommonDevice device = LocalDevice.Current.GetDevice(mainKey);
@@ -559,7 +559,7 @@
//涓�鎵硅澶囬噷闈紝鎴愬姛娣诲姞鐨�
if (data.Status == 0)
{
- listSuccess.Add(data.MacAddr + data.Epoint);
+ listSuccess.Add(LocalDevice.Current.GetDeviceMainKeys(data.MacAddr, data.Epoint));
}
else if (data.Status == 1)
{
@@ -745,7 +745,7 @@
{
if (data.Status == 0)
{
- listKeys.Add(data.MacAddr + data.Epoint);
+ listKeys.Add(LocalDevice.Current.GetDeviceMainKeys(data.MacAddr, data.Epoint));
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
index ff5759c..0d8549e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
@@ -493,6 +493,85 @@
#endregion
+ #region 鈻� 璋冪敤鍦烘櫙___________________________
+
+ /// <summary>
+ /// 璋冪敤鍦烘櫙
+ /// </summary>
+ /// <param name="scene"></param>
+ /// <returns></returns>
+ public async Task<bool> ControlScene(SceneUI scene)
+ {
+ if (scene.RemainTime > 0)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //璇ュ満鏅鍦ㄥ欢鏃讹紝璇风◢鍚�
+ var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying));
+ msgContr.Show();
+ });
+ return false;
+ }
+ //鎵ц璋冪敤鍦烘櫙
+ var result = await Scene.ControlSceneAsync(scene.Id, scene.SceneDelayTime);
+ if (result == null || result.sceneOpenData == null)
+ {
+ //鎺у埗鍦烘櫙澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.ControlSceneFail);
+ //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
+ msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //璇ュ満鏅鍦ㄥ欢鏃讹紝璇风◢鍚�
+ var msgContr = new ShowMsgControl(ShowMsgType.Tip, msg);
+ msgContr.Show();
+ });
+ return false;
+ }
+ if (result.sceneOpenData.Result == 0)
+ {
+ //鎺у埗鍦烘櫙澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.ControlSceneFail);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //璇ュ満鏅鍦ㄥ欢鏃讹紝璇风◢鍚�
+ var msgContr = new ShowMsgControl(ShowMsgType.Tip, msg);
+ msgContr.Show();
+ });
+ return false;
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region 鈻� 寤舵椂鏃堕棿绾跨▼_______________________
+
+ /// <summary>
+ /// 寮�鍚欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾)
+ /// </summary>
+ public void StartDelayTimeThread(SceneUI i_scene)
+ {
+ if (i_scene.RemainThreadAction == true)
+ {
+ //绾跨▼鍦ㄨ繍琛屼腑
+ return;
+ }
+ i_scene.RemainThreadAction = true;
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ while (i_scene.RemainTime > 0)
+ {
+ System.Threading.Thread.Sleep(1000);
+ i_scene.RemainTime--;
+ }
+ i_scene.RemainThreadAction = false;
+ });
+ }
+
+ #endregion
+
#region 鈻� 涓�鑸柟娉昣__________________________
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index 26f82ee..97d8067 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -428,74 +428,17 @@
var actionForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
if (actionForm != null && actionForm is CommonFormBase)
{
- //璁剧疆褰撳墠婵�娲荤殑鐢婚潰ID
- UserCenterResourse.NowActionFormID = UserCenterResourse.listActionFormId[index];
- //杩藉姞鏉′欢涓�:鍏抽棴鐨勭晫闈负EditorCommonForm鐨勬椂鍊欐墠澶勭悊
- if ((form is EditorCommonForm) && UserCenterResourse.DicActionForm.ContainsKey(UserCenterResourse.NowActionFormID) == true)
- {
- try
- {
- EditorCommonForm Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID] as EditorCommonForm;
- if (Myform != null)
- {
- //閲嶇疆宸︽粦浣胯兘
- Myform.ScrollEnabled = Myform.ScrollEnabled;
- //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢
- int value = Myform.FormActionAgainEvent();
- if (value == 1)
- {
- //Log鍑哄姏
- HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 琚縺娲�");
- }
- }
- }
- catch (Exception ex)
- {
- //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け
- var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
- alert.Show();
-
- //Log鍑哄姏
- HdlLogLogic.Current.WriteLog(ex);
- }
- }
+ //璋冪敤鐣岄潰閲嶆柊婵�娲荤殑鍑芥暟
+ CallFormActionAgainEvent(form, index);
}
else if (actionForm != null && actionForm is UserView.UserPage)
{
- //杩欓噷瀹冨凡缁忛��鍒颁富椤典簡,濡傛灉瀹冨寘鍚釜浜轰腑蹇冧富椤电殑璇�
- if (UserCenterResourse.listActionFormId.Contains("UserMainForm") == true)
+ //杩欓噷瀹冨凡缁忛��鍒颁富椤典簡
+ if (UserCenterResourse.listActionFormId.Contains("UserMainForm") == true//涓汉涓績
+ || UserCenterResourse.listActionFormId.Contains("HomeMainPageForm") == true)//
{
- //璁剧疆褰撳墠婵�娲荤殑鐢婚潰ID
- UserCenterResourse.NowActionFormID = UserCenterResourse.listActionFormId[index];
- //杩藉姞鏉′欢涓�:鍏抽棴鐨勭晫闈负EditorCommonForm鐨勬椂鍊欐墠澶勭悊
- if ((form is EditorCommonForm) && UserCenterResourse.DicActionForm.ContainsKey(UserCenterResourse.NowActionFormID) == true)
- {
- try
- {
- EditorCommonForm Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID] as EditorCommonForm;
- if (Myform != null)
- {
- //閲嶇疆宸︽粦浣胯兘
- Myform.ScrollEnabled = Myform.ScrollEnabled;
- //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢
- int value = Myform.FormActionAgainEvent();
- if (value == 1)
- {
- //Log鍑哄姏
- HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 琚縺娲�");
- }
- }
- }
- catch (Exception ex)
- {
- //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け
- var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
- alert.Show();
-
- //Log鍑哄姏
- HdlLogLogic.Current.WriteLog(ex);
- }
- }
+ //璋冪敤鐣岄潰閲嶆柊婵�娲荤殑鍑芥暟
+ CallFormActionAgainEvent(form, index);
}
}
}
@@ -504,6 +447,43 @@
UserCenterResourse.listActionFormId.Remove(UserCenterResourse.DicActionForm[formName].FormID);
//绉婚櫎鐢婚潰
UserCenterResourse.DicActionForm.Remove(formName);
+ }
+ }
+
+ /// <summary>
+ /// 璋冪敤鐣岄潰閲嶆柊婵�娲荤殑鍑芥暟
+ /// </summary>
+ /// <param name="form">鍏抽棴鐨勭晫闈㈠璞�</param>
+ /// <param name="index">褰撳墠闇�瑕侀噸鏂版縺娲荤晫闈㈢殑绱㈠紩</param>
+ private static void CallFormActionAgainEvent(CommonFormBase form, int index)
+ {
+ //璁剧疆褰撳墠婵�娲荤殑鐢婚潰ID
+ UserCenterResourse.NowActionFormID = UserCenterResourse.listActionFormId[index];
+ //杩藉姞鏉′欢涓�:鍏抽棴鐨勭晫闈负EditorCommonForm鐨勬椂鍊欐墠澶勭悊
+ if ((form is EditorCommonForm) && UserCenterResourse.DicActionForm.ContainsKey(UserCenterResourse.NowActionFormID) == true)
+ {
+ try
+ {
+ var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID] as EditorCommonForm;
+ //閲嶇疆宸︽粦浣胯兘
+ Myform.ScrollEnabled = Myform.ScrollEnabled;
+ //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢
+ int value = Myform.FormActionAgainEvent();
+ if (value == 1)
+ {
+ //Log鍑哄姏
+ HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 琚縺娲�");
+ }
+ }
+ catch (Exception ex)
+ {
+ //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け
+ var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
+ alert.Show();
+
+ //Log鍑哄姏
+ HdlLogLogic.Current.WriteLog(ex, "鐣岄潰閲嶆柊婵�娲诲紓甯�");
+ }
}
}
@@ -701,6 +681,13 @@
while (UserView.HomePage.Instance.ChildrenCount > 0)
{
var view = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
+ //(鍥犲簳灞傛帶浠朵慨鏀逛簡, 鐖舵帶浠剁Щ闄ゆ椂, 涓嶈Е鍙戝瓙鎺т欢鐨勭Щ闄や簨浠�)
+ if (view is ViewGroup)
+ {
+ //鍏抽棴鍔犺浇鍦╒iewGroup閲岄潰鐨勮嚜瀹氫箟鐣岄潰Form
+ CloseViewGroupChildren((ViewGroup)view);
+ }
+
if (view is CommonFormBase)
{
if (((CommonFormBase)view).FormID == tagetFrom)
@@ -717,6 +704,23 @@
else
{
view.RemoveFromParent();
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鍏抽棴鍔犺浇鍦╒iewGroup閲岄潰鐨勮嚜瀹氫箟鐣岄潰Form(鍥犲簳灞傛帶浠朵慨鏀逛簡,鐖舵帶浠剁Щ闄ゆ椂,涓嶈Е鍙戝瓙鎺т欢鐨勭Щ闄や簨浠�)
+ /// </summary>
+ /// <param name="group"></param>
+ private static void CloseViewGroupChildren(ViewGroup group)
+ {
+ for (int i = 0; i < group.ChildrenCount; i++)
+ {
+ var view = group.GetChildren(i);
+ if (view is CommonFormBase)
+ {
+ ((CommonFormBase)view).CloseForm();
+ i--;
}
}
}
@@ -841,7 +845,7 @@
{
//APP缂撳瓨鍔犺浇寮�濮�
UserCenterResourse.AccountOption.AppCanSignout = false;
- //杩樺師杩滅▼杩炴帴鍙橀噺
+ //杩樺師杩滅▼杩炴帴鏉冮檺鍙橀噺
ZigBee.Device.ZbGateway.AllowRemoteCtrl = true;
//鍙湁鍦ㄤ綇瀹匢D涓嶄竴鏍风殑鏃跺�欐墠鍋氳繖涓搷浣�
@@ -855,17 +859,8 @@
}
catch { }
- //娑堟伅璁板綍閲嶆柊璇诲彇鍙婃娴�
- ControlCommonResourse.ReadMessageAgain = true;
- ControlCommonResourse.HadNewMessage = false;
- HdlThreadLogic.Current.RunMain(() =>
- {
- for (int i = 0; i < ControlCommonResourse.listMessageManaContr.Count; i++)
- {
- //鏄剧ず瑙掓爣鐗规晥
- ControlCommonResourse.listMessageManaContr[i].IsSelected = false;
- }
- });
+ //娓呯┖鎵�鏈夋垚鍛樼紦瀛�
+ ClearAllMemberMemory();
//鍔犺浇璐﹀彿閰嶇疆淇℃伅
var optionInfo = UserCenterResourse.AccountOption.Load();
@@ -943,6 +938,29 @@
return true;
}
+ /// <summary>
+ /// 娓呯┖鎵�鏈夋垚鍛樼紦瀛�
+ /// </summary>
+ private static void ClearAllMemberMemory()
+ {
+ //娑堟伅璁板綍閲嶆柊璇诲彇鍙婃娴�
+ ControlCommonResourse.ReadMessageAgain = true;
+ ControlCommonResourse.HadNewMessage = false;
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ for (int i = 0; i < ControlCommonResourse.listMessageManaContr.Count; i++)
+ {
+ //鏄剧ず瑙掓爣鐗规晥
+ ControlCommonResourse.listMessageManaContr[i].IsSelected = false;
+ }
+ });
+
+ //褰撳墠涓婚〉,鍦烘櫙鍜屽姛鑳芥墍閫夋嫨鐨勫垎鏀� 1:鍦烘櫙 2:鍔熻兘
+ UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex = 1;
+ //褰撳墠鍒嗙被,鍦烘櫙鍜屽姛鑳芥墍閫夋嫨鐨勫垎鏀� 0:鍦烘櫙 1:鍔熻兘 2:鑷姩鍖�
+ UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 0;
+ }
+
#endregion
#region 鈻� 鍒濆鍖栫櫥闄嗚处鍙风殑淇℃伅_______________
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs
index aef3ae0..2680692 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs
@@ -170,6 +170,11 @@
//閲嶅伐绌鸿皟妯″潡
textView = Language.StringByID(R.MyInternationalizationString.uHicAirConditioningModule);
}
+ else if (info.Name.Contains("IRACC_HITACHI") == true)
+ {
+ //鏃ョ珛绌鸿皟妯″潡
+ textView = Language.StringByID(R.MyInternationalizationString.uHitachiAirConditioningModule);
+ }
else
{
//绌鸿皟鍗囩骇妯″潡
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
index 4c2bb2d..7b91537 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
@@ -8,19 +8,8 @@
using static ZigBee.Device.Panel;
namespace Shared.Phone.UserCenter.DeviceBind
{
- public class AddDevicePage : BindCommonLayout, ZigBee.Common.IStatus
+ public class AddDevicePage : BindCommonLayout
{
- /// <summary>
- /// 鎸夐敭妯″紡鎺ユ敹
- /// </summary>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- Shared.Application.RunOnMainThread(() =>
- {
- });
- }
-
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="doorLock"></param>
@@ -629,6 +618,7 @@
TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
TextAlignment = TextAlignment.CenterLeft,
Tag = device.DeviceEpointName,
+ Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
TextSize = 15,
};
rowLayout.AddChidren(btnBindName);
@@ -701,14 +691,6 @@
btnBindName.MouseUpEventHandler += hander;
btnChoose.MouseUpEventHandler += hander;
- if (string.IsNullOrEmpty(device.DeviceEpointName))
- {
- btnBindName.Text = device.DeviceAddr + "_" + device.DeviceEpoint;
- }
- else
- {
- btnBindName.Text = device.DeviceEpointName;
- }
foreach (var bindedDev in targetList)
{
var id = device.DeviceAddr + device.DeviceEpoint;
@@ -877,18 +859,6 @@
rowFrameLayout.MouseUpEventHandler += hander;
btnMethodText.MouseUpEventHandler += hander;
}
- }
-
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
-
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
-
- public void ChangedISceneStatus(Scene scene)
- {
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
index 7098e3d..0dfc34c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -10,19 +10,8 @@
namespace Shared.Phone.UserCenter.DeviceBind
{
- public class AddScenePage : BindCommonLayout, ZigBee.Common.IStatus
+ public class AddScenePage : BindCommonLayout
{
- /// <summary>
- /// 鎸夐敭妯″紡鎺ユ敹
- /// </summary>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- Shared.Application.RunOnMainThread(() =>
- {
- });
- }
-
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="doorLock"></param>
@@ -968,18 +957,6 @@
}
}
return tempSceneUIList;
- }
-
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
-
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
-
- public void ChangedISceneStatus(Scene scene)
- {
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
index b6a7c54..be9b319 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -11,19 +11,8 @@
/// <summary>
/// 鎸夐敭绠$悊
/// </summary>
- public class BindTargetsPage : BindCommonLayout, ZigBee.Common.IStatus
+ public class BindTargetsPage : BindCommonLayout
{
- /// <summary>
- /// 鎸夐敭妯″紡鎺ユ敹
- /// </summary>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- Shared.Application.RunOnMainThread(() =>
- {
- });
- }
-
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="doorLock"></param>
@@ -107,11 +96,15 @@
//鑾峰彇鏈湴鍦烘櫙鍒楄〃
scList = HdlSceneLogic.Current.GetAllRoomSceneList();
//鑾峰彇缃戝叧鍦烘櫙琛�
- var gwSceneObj = await currentKey.GetSceneInfoAsync();
- if (gwSceneObj != null && gwSceneObj.getSceneInfo != null)
+ if (gwScenesList.Count == 0)
{
- gwScenesList = gwSceneObj.getSceneInfo.ScenesList;
+ var gwSceneObj = await currentKey.GetSceneInfoAsync();
+ if (gwSceneObj != null && gwSceneObj.getSceneInfo != null)
+ {
+ gwScenesList = gwSceneObj.getSceneInfo.ScenesList;
+ }
}
+
//鍔ㄦ�佽幏鍙栨寜閿敮鎸佺殑澶х被
typeModeList = await GetTypeMode();
#region 璇诲彇闈㈡澘褰撳墠妯″紡
@@ -187,6 +180,7 @@
Application.RunOnMainThread(() =>
{
CommonPage.Loading.Hide();
+ midVerticalRefreshLayout.EndHeaderRefreshing();
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
return;
});
@@ -217,6 +211,7 @@
{
RefreshList();
CommonPage.Loading.Hide();
+ midVerticalRefreshLayout.EndHeaderRefreshing();
});
}
else
@@ -224,6 +219,7 @@
Application.RunOnMainThread(() =>
{
CommonPage.Loading.Hide();
+ midVerticalRefreshLayout.EndHeaderRefreshing();
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
});
return;
@@ -370,7 +366,6 @@
midVerticalRefreshLayout.BeginHeaderRefreshing();
IsRead = true;
InitListInfo();
- midVerticalRefreshLayout.EndHeaderRefreshing();
};
BlankPicUI();
@@ -453,6 +448,7 @@
midVerticalRefreshLayout.AddChidrenRow(rowLayout);
rowLayout.frameTable.UseClickStatu = false;
var devicePic = rowLayout.frameTable.AddLeftIcon();
+ devicePic.Y = Application.GetRealHeight(49);
devicePic.UnSelectedImagePath = "DoorLock/DoorLockUserPic.png";
#region 缁戝畾鏁版嵁澶勭悊
@@ -524,7 +520,6 @@
}
devicePic.UnSelectedImagePath = tempDev.IconPath;
- devicePic.Width = Application.GetRealWidth(110);
devicePic.Text = "";
if (string.IsNullOrEmpty(tempDev.DeviceEpointName))
@@ -539,7 +534,6 @@
else
{
btnBindNameText = bindDevice.BindMacAddr + "_" + bindDevice.BindEpoint;
- devicePic.Width = Application.GetMinRealAverage(200);
devicePic.TextAlignment = TextAlignment.CenterLeft;
devicePic.TextColor = UserCenterColor.Current.Gray;
devicePic.Text = Language.StringByID(R.MyInternationalizationString.uOffLine);
@@ -1283,18 +1277,6 @@
localDeviceList.Clear();
scList.Clear();
base.RemoveFromParent();
- }
-
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
-
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
-
- public void ChangedISceneStatus(Scene scene)
- {
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
index 8230911..bf7b169 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
@@ -5,19 +5,8 @@
using static ZigBee.Device.BindObj;
namespace Shared.Phone.UserCenter.DeviceBind
{
- public class ChooseKeyModePage : BindCommonLayout, ZigBee.Common.IStatus
+ public class ChooseKeyModePage : BindCommonLayout
{
- /// <summary>
- /// 鎸夐敭妯″紡鎺ユ敹
- /// </summary>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- Shared.Application.RunOnMainThread(() =>
- {
- });
- }
-
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="doorLock"></param>
@@ -1106,19 +1095,6 @@
btnChoose.MouseUpEventHandler += hander;
i++;
}
- }
-
-
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
-
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
-
- public void ChangedISceneStatus(Scene scene)
- {
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
index cd6cbe0..de7b257 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
@@ -252,6 +252,8 @@
frameBack.AddChidren(btnProgressView);
int progressValue = (int)(curtainData.OpenLimitValue / (curtainData.CurtainLength * 1.0) * 100);
+ //璁剧疆鐧惧垎姣旂殑鍒濆鍊�
+ curtainData.OpenLimitPersent = progressValue;
var btnProgress1 = new NormalViewControl(200, 50, true);
btnProgress1.X = Application.GetRealWidth(200);
btnProgress1.Y = btnProgressView.Y;
@@ -422,6 +424,8 @@
frameBack.AddChidren(btnProgressView);
int progressValue = (int)(curtainData.CloseLimitValue / (curtainData.CurtainLength * 1.0) * 100);
+ //璁剧疆鐧惧垎姣旂殑鍒濆鍊�
+ curtainData.CloseLimitPersent = progressValue;
var btnProgress1 = new NormalViewControl(200, 50, true);
btnProgress1.X = Application.GetRealWidth(200);
btnProgress1.Y = btnProgressView.Y;
@@ -655,7 +659,7 @@
this.receiveCloseLimit = false;
this.sendDiv = 0;
- bool receiptData = false;
+ int receiptDataCount = 0;
string mainkeys = LocalDevice.Current.GetDeviceMainKeys(curtainDevice);
HdlGatewayReceiveLogic.Current.AddAttributeEvent("CurtainDeviceAttribute", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (device) =>
{
@@ -679,23 +683,25 @@
//姝e悜
curtainData.Direction = false;
}
+ receiptDataCount++;
}
else if (attriBute.AttributeId == 1)
{
//绐楀笜鎬婚暱
curtainData.CurtainLength = attriBute.AttriButeData;
+ receiptDataCount++;
}
else if (attriBute.AttributeId == 16)
{
//寮�闄愪綅
curtainData.OpenLimitValue = attriBute.AttriButeData;
+ receiptDataCount++;
}
else if (attriBute.AttributeId == 17)
{
//鍚堥檺浣�
curtainData.CloseLimitValue = attriBute.AttriButeData;
- //鏁版嵁鎺ユ敹缁撴潫
- receiptData = true;
+ receiptDataCount++;
}
}
});
@@ -703,7 +709,7 @@
HdlDeviceCurtainLogic.Current.SetGetCurtainLimitSettionComand(curtainDevice);
int timeCount = 30;
- while (receiptData == false && timeCount >= 0)
+ while (receiptDataCount != 4 && timeCount >= 0)
{
System.Threading.Thread.Sleep(100);
timeCount--;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index 4d7cdf6..7e06c98 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -242,17 +242,6 @@
}
//鏇存敼杩囦竴娆′箣鍚庯紝鍒欑晫闈㈠叧闂悗涓嶅啀鏇存敼
this.saveDefultName = string.Empty;
-
- //濡傛灉瀹冪殑鍥炶矾鍙湁涓�涓殑璇濓紝鍒欏湪璁惧涓婃姤鐨勬椂鍊欙紝淇敼MAC鍚嶅瓧涔嬪悗锛岃繛鍚岀鐐瑰悕瀛椾篃涓�璧蜂慨鏀�
- if (this.listNewDevice.Count == 1 && (this.listNewDevice[0] is OTADevice) == false)
- {
- //淇敼绔偣鍚嶅瓧
- result = await Common.LocalDevice.Current.ReName(this.listNewDevice[0], deviceName, mode);
- if (result == false)
- {
- return;
- }
- }
}
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index fe01496..a80cecc 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -418,7 +418,7 @@
form.AddForm(device, true);
}
//鏂伴闈㈡澘
- else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueNewWind)
+ else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
{
var form = new DeviceFunctionSettionForm();
form.AddForm(device, true);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
index 6997bc6..083edd8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -233,8 +233,13 @@
//娣诲姞銆愭寜閿缃�戣(闈㈡澘涓撶敤)
this.AddPanelSettionRow();
}
- //娣诲姞銆愬姛鑳借缃�戣
- this.AddFunctionSettionRow();
+
+ if (this.IsFangyueFreshaAirPanel() == false)
+ {
+ //娣诲姞銆愬姛鑳借缃�戣
+ this.AddFunctionSettionRow();
+ }
+
//娣诲姞銆愬共鎺ョ偣璁剧疆銆戣
this.AddDryContactSettionRow();
}
@@ -494,7 +499,7 @@
|| deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
|| deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight
|| deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment
- || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueNewWind)
+ || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
{
//鎸夐敭璁剧疆
string caption = Language.StringByID(R.MyInternationalizationString.uPanelSettion);
@@ -511,7 +516,7 @@
|| deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
|| deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight)
{
- //鏂规偊闈㈡澘鐨勬寜閿厤缃�
+ //鏂规偊鎸夐敭闈㈡澘[鍗曞紑鍙屾帶/鍙屽紑鍥涙帶/鍥涘紑鍏帶]閰嶇疆
var form = new DevicePanel.PanelFangyueButtonSettionForm();
form.AddForm(listNewDevice[0]);
}
@@ -524,8 +529,26 @@
else
{
//鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃�
+ var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm();
+ form.AddForm(listNewDevice[0]);
}
};
+ return true;
+ }
+ return false;
+ }
+
+ #endregion
+
+ #region 鈻� 鎸夐敭璁剧疆(鏂规偊)_____________________
+
+ /// <summary>
+ /// 鏄惁鏄柟鎮︽柊椋庨潰鏉�
+ /// </summary>
+ private bool IsFangyueFreshaAirPanel()
+ {
+ if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
+ {
return true;
}
return false;
@@ -642,7 +665,7 @@
return;
}
if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment
- || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueNewWind)
+ || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
{
//鐜闈㈡澘娌℃湁鍔熻兘璁剧疆
return;
@@ -773,10 +796,11 @@
btnSwitch.ButtonClickEvent += async (sender, e) =>
{
//鍒囨崲妯″紡
- var result = await HdlDeviceCurtainLogic.Current.SetHandPullControl(deviceCurtain, !btnSwitch.IsSelected);
+ bool statu = !btnSwitch.IsSelected;
+ var result = await HdlDeviceCurtainLogic.Current.SetHandPullControl(deviceCurtain, statu);
if (result == true)
{
- btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ btnSwitch.IsSelected = statu;
}
};
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
index a32c91a..4102a31 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
@@ -60,6 +60,10 @@
/// 杩涘害鍊肩殑鏄剧ず鏂囨湰
/// </summary>
private NormalViewControl btnProgressView = null;
+ /// <summary>
+ /// 缃戝叧鏄惁鍏佽鍏ョ綉鐨勬爣璇�
+ /// </summary>
+ private bool gatewayCanAddDevice = false;
#endregion
@@ -138,20 +142,8 @@
btnProgressView.Text = "0%";
frameProgress.AddChidren(btnProgressView);
- HdlThreadLogic.Current.RunThread(() =>
- {
- //钃濇墠鍒氳鏈夋椂鍊欑綉鍏充細鏀朵笉鍒板叆缃戠殑鍛戒护,鎵�浠ュ彂涓夋
- for (int i = 0; i < 3; i++)
- {
- if (this.Parent == null)
- {
- return;
- }
- //璁╃綉鍏冲厑璁稿叆缃�
- this.realGateway.AddNewDeviceToGateway(180);
- System.Threading.Thread.Sleep(1000);
- }
- });
+ //鍏佽璁惧鍏ョ綉
+ this.StartDeviceCanAddToGateway(false);
//娣诲姞鐩戣璁惧鏂颁笂鎶ョ殑浜嬩欢
this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
@@ -343,12 +335,18 @@
while (this.Parent != null)
{
System.Threading.Thread.Sleep(500);
- timeCount++;
- if (timeCount >= 240)
+
+ //缃戝叧鍏佽璁惧鍏ョ綉鍚庢墠寮�濮嬭鏃�
+ if (this.gatewayCanAddDevice == true)
{
- //120绉掑悗,鍐嶆鍙戦�佺綉鍏宠澶囧叆缃戝懡浠�
- this.realGateway.AddNewDeviceToGateway(180);
- timeCount = 0;
+ timeCount++;
+ if (timeCount >= 360)
+ {
+ this.gatewayCanAddDevice = false;
+ //鍐嶆鍙戦�佸厑璁歌澶囧叆缃�
+ this.StartDeviceCanAddToGateway(true);
+ timeCount = 0;
+ }
}
Application.RunOnMainThread(() =>
{
@@ -378,15 +376,34 @@
/// <returns></returns>
private int CheckIsDeviceComming(string topic, string resultData)
{
- if (topic == gatewayId + "/Device/DeviceAnnounce_Respon")
+ if (topic == gatewayId + "/Device/SearchNewDevice")
+ {
+ //缃戝叧鍥炲璁惧宸茬粡鍙互鍏ョ綉
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
+ var info = Newtonsoft.Json.JsonConvert.DeserializeObject<SearchNewDeviceResult>(jobject["Data"].ToString());
+ if (info.time > 0)
+ {
+ this.gatewayCanAddDevice = true;
+ }
+ return 0;
+ }
+ else if (topic == gatewayId + "/Device/DeviceAnnounce_Respon")
{
this.topTimeOut = topMaxTime;
+
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
+ var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceAnnounceInfo>(jobject["Data"].ToString());
+ if (info.IsNew == 6 || info.IsNew == 7)
+ {
+ return 0;
+ }
//缃戝叧鍛婄煡瀹㈡埛绔湁璁惧澹版槑
this.SetDeviceProgressValue(1);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceGetActiveEP_Respon")
{
+ this.topTimeOut = topMaxTime;
//缃戝叧鍛婄煡瀹㈡埛绔幏鍙栬澶囨椿鍔ㄧ鐐逛俊鎭�
var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceResultInfo>(jobject["Data"].ToString());
@@ -397,13 +414,13 @@
HdlLogLogic.Current.WriteLog(-1, resultData);
return 2;
}
- this.topTimeOut = topMaxTime;
//璁剧疆杩涘害鍊�
this.SetDeviceProgressValue(2);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceGetActiveEPSimpleDesc_Respon")
{
+ this.topTimeOut = topMaxTime;
//缃戝叧鍛婄煡瀹㈡埛绔幏鍙栬澶囨墍鏈夋椿鍔ㄧ鐐圭畝鍗曟弿杩扮淇℃伅
var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceResultInfo>(jobject["Data"].ToString());
@@ -414,13 +431,13 @@
HdlLogLogic.Current.WriteLog(-1, resultData);
return 2;
}
- this.topTimeOut = topMaxTime;
//璁剧疆杩涘害鍊�
this.SetDeviceProgressValue(3);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceGetDefaultBind_Respon")
{
+ this.topTimeOut = topMaxTime;
//缃戝叧鍛婄煡瀹㈡埛绔幏鍙栬澶囬粯璁ょ粦瀹氳〃淇℃伅
var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceResultInfo>(jobject["Data"].ToString());
@@ -431,13 +448,13 @@
HdlLogLogic.Current.WriteLog(-1, resultData);
return 2;
}
- this.topTimeOut = topMaxTime;
//璁剧疆杩涘害鍊�
this.SetDeviceProgressValue(4);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceAutoBindZBCoord_Respon")
{
+ this.topTimeOut = topMaxTime;
//缃戝叧鍛婄煡瀹㈡埛绔澶囪嚜鍔ㄧ粦瀹氬崗璋冨櫒淇℃伅
var jobject = Newtonsoft.Json.Linq.JObject.Parse(resultData);
var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceResultInfo>(jobject["Data"].ToString());
@@ -448,7 +465,6 @@
HdlLogLogic.Current.WriteLog(-1, resultData);
return 2;
}
- this.topTimeOut = topMaxTime;
//璁剧疆杩涘害鍊�
this.SetDeviceProgressValue(5);
return 2;
@@ -521,6 +537,33 @@
#endregion
+ #region 鈻� 鍏佽璁惧鍏ョ綉_______________________
+
+ /// <summary>
+ /// 鍏佽璁惧鍏ョ綉
+ /// </summary>
+ /// <param name="close"></param>
+ private void StartDeviceCanAddToGateway(bool close)
+ {
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ if (close == true)
+ {
+ //鍏抽棴鍏ョ綉妯″紡
+ this.realGateway.AddNewDeviceToGateway(0);
+ System.Threading.Thread.Sleep(2000);
+ }
+ while (gatewayCanAddDevice == false && this.Parent != null)
+ {
+ //璁╃綉鍏冲厑璁稿叆缃�
+ this.realGateway.AddNewDeviceToGateway(180);
+ System.Threading.Thread.Sleep(6000);
+ }
+ });
+ }
+
+ #endregion
+
#region 鈻� 鐢婚潰鍏抽棴___________________________
/// <summary>
@@ -555,6 +598,28 @@
public int Result = -1;
}
+ /// <summary>
+ /// 缃戝叧鍛婄煡瀹㈡埛绔湁璁惧澹版槑
+ /// </summary>
+ private class DeviceAnnounceInfo
+ {
+ /// <summary>
+ /// 钃濇墠鍒氳 6鍜�7 杩欎袱涓槸璁惧閲嶅惎涓婃姤鐨勶紝鐩墠鏆傛椂涓嶈兘鏄剧ず鍒板叆缃戞楠ら偅閲岀殑
+ /// </summary>
+ public int IsNew = -1;
+ }
+
+ /// <summary>
+ /// 缃戝叧鍥炲鍏佽璁惧鍏ョ綉
+ /// </summary>
+ private class SearchNewDeviceResult
+ {
+ /// <summary>
+ /// 鍏佽璁惧鍏ョ綉鐨勬椂闂�
+ /// </summary>
+ public int time = 0;
+ }
+
#endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
index 4775048..06e5310 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
@@ -91,7 +91,12 @@
//鏂规偊鐜闈㈡澘
objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId253);
unSelectPic = "Device/ButtonPanelFangyueEnvironment.png";
- this.AddMenuRow(objectText, unSelectPic, "PanelFangyueEnvironmentDirectionForm");
+ this.AddMenuRow(objectText, unSelectPic, "PanelFangyueEnvironmentDirectionForm");
+
+ //绐楀笜闈㈡澘
+ objectText = "绐楀笜闈㈡澘";
+ unSelectPic = "Device/ButtonPanelCurtain.png";
+ this.AddMenuRow(objectText, unSelectPic, "PanelCurtainDirectionForm");
//3璺户鐢靛櫒灏忔ā鍧�
objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId2300);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs
new file mode 100755
index 0000000..dd721fa
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs
@@ -0,0 +1,84 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter.DeviceDirection
+{
+ /// <summary>
+ /// 绐楀笜闈㈡澘鐨勬坊鍔犳楠ょ晫闈�
+ /// </summary>
+ public class PanelCurtainDirectionForm : DirectionCommonForm
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //鍥剧墖
+ var framePic = new FrameLayout();
+ framePic.Width = Application.GetMinRealAverage(835);
+ framePic.Height = Application.GetMinRealAverage(711);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.Y = Application.GetRealHeight(115);
+ bodyFrameLayout.AddChidren(framePic);
+ var btnPic = new PicViewControl(framePic.Width, framePic.Height, false);
+ btnPic.UnSelectedImagePath = "Instruct/PanelCurtain.png";
+ framePic.AddChidren(btnPic);
+
+ //鎸夐敭鎸囩ず鐏寒璧�
+ var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(463), Application.GetMinRealAverage(45), false);
+ btnGreanLinght.X = Application.GetMinRealAverage(372);
+ btnGreanLinght.Y = Application.GetMinRealAverage(258);
+ btnGreanLinght.TextAlignment = TextAlignment.Center;
+ btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnGreanLinght.TextSize = 10;
+ btnGreanLinght.TextID = R.MyInternationalizationString.uKeyIndicatorLightsUp;
+ framePic.AddChidren(btnGreanLinght);
+
+ //鎸変綇姝ゆ寜閿�
+ var btnPress = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false);
+ btnPress.X = Application.GetMinRealAverage(144);
+ btnPress.Y = Application.GetMinRealAverage(275);
+ btnPress.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnPress.TextSize = 10;
+ btnPress.TextID = R.MyInternationalizationString.uPressAndHoldThisKey;
+ framePic.AddChidren(btnPress);
+
+ //闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿�
+ //鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔�
+ string[] msgArry = Language.StringByID(R.MyInternationalizationString.uAddCurtaunPanelMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+
+ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ msg1.Y = Application.GetRealHeight(1037);
+ msg1.Text = msgArry[0];
+ msg1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ msg1.TextAlignment = TextAlignment.Center;
+ bodyFrameLayout.AddChidren(msg1);
+ var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ msg2.Y = msg1.Bottom;
+ if (msgArry.Length > 1)
+ {
+ msg2.Text = msgArry[1];
+ }
+ msg2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ msg2.TextAlignment = TextAlignment.Center;
+ bodyFrameLayout.AddChidren(msg2);
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs
new file mode 100755
index 0000000..4470e76
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs
@@ -0,0 +1,76 @@
+锘縰sing System;
+namespace Shared.Phone.UserCenter.DeviceDirection
+{
+ public class PanelFangyueFreshAirDirectionForm : DirectionCommonForm
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //鍥剧墖
+ var framePic = new FrameLayout();
+ framePic.Width = Application.GetMinRealAverage(835);
+ framePic.Height = Application.GetMinRealAverage(711);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.Y = Application.GetRealHeight(144);
+ bodyFrameLayout.AddChidren(framePic);
+ var btnPic = new PicViewControl(framePic.Width, framePic.Height, false);
+ btnPic.UnSelectedImagePath = "Instruct/PanelFreshAir.png";
+ framePic.AddChidren(btnPic);
+
+ var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false);
+ btnGreanLinght.X = Application.GetMinRealAverage(374);
+ btnGreanLinght.Y = Application.GetMinRealAverage(319);
+ btnGreanLinght.TextAlignment = TextAlignment.Center;
+ btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnGreanLinght.TextSize = 10;
+ btnGreanLinght.TextID = R.MyInternationalizationString.uKeyIndicatorLightsUp;
+ framePic.AddChidren(btnGreanLinght);
+
+ //鎸変綇姝ゆ寜閿�
+ var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false);
+ btnSecond.X = Application.GetMinRealAverage(441);
+ btnSecond.Y = Application.GetMinRealAverage(583);
+ btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnSecond.TextSize = 10;
+ btnSecond.TextID = R.MyInternationalizationString.uPressAndHoldThisKey;
+ framePic.AddChidren(btnSecond);
+
+ //闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑�
+ //杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛
+ string[] msgArry = Language.StringByID(R.MyInternationalizationString.AddFreshAirPanelMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+
+ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ msg1.Y = Application.GetRealHeight(1037);
+ msg1.Text = msgArry[0];
+ msg1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ msg1.TextAlignment = TextAlignment.Center;
+ bodyFrameLayout.AddChidren(msg1);
+ var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ msg2.Y = msg1.Bottom;
+ if (msgArry.Length > 1)
+ {
+ msg2.Text = msgArry[1];
+ }
+ msg2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ msg2.TextAlignment = TextAlignment.Center;
+ bodyFrameLayout.AddChidren(msg2);
+ }
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs
new file mode 100755
index 0000000..f191903
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs
@@ -0,0 +1,93 @@
+锘縰sing System;
+using Shared.Phone.UserCenter.DeviceDirection;
+
+namespace Shared.Phone.UserCenter.DeviceDirection
+{
+ public class PanelFangyueFreshAirModulDirectionForm : DirectionCommonForm
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //鍥剧墖
+ var framePic = new FrameLayout();
+ framePic.Width = Application.GetMinRealAverage(873);
+ framePic.Height = Application.GetMinRealAverage(665);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.Y = Application.GetRealHeight(144);
+ bodyFrameLayout.AddChidren(framePic);
+ var btnPic = new PicViewControl(framePic.Width, framePic.Height, false);
+ btnPic.UnSelectedImagePath = "Instruct/PanelFreshAirModul.png";
+ framePic.AddChidren(btnPic);
+
+ //缁胯壊鎸囩ず鐏棯鐑�
+ var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false);
+ btnGreanLinght.X = Application.GetMinRealAverage(442);
+ btnGreanLinght.Y = Application.GetMinRealAverage(368);
+ btnGreanLinght.TextAlignment = TextAlignment.Center;
+ btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnGreanLinght.TextSize = 10;
+ btnGreanLinght.TextID = R.MyInternationalizationString.GreenLightLighting;
+ framePic.AddChidren(btnGreanLinght);
+
+ //鎸囩ず鐏�
+ var btnLinght = new NormalViewControl(Application.GetMinRealAverage(250), Application.GetMinRealAverage(45), false);
+ btnLinght.X = Application.GetMinRealAverage(340);
+ btnLinght.Y = Application.GetMinRealAverage(514);
+ btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnLinght.TextSize = 10;
+ btnLinght.TextID = R.MyInternationalizationString.uPilotLamp;
+ framePic.AddChidren(btnLinght);
+
+ //浠绘剰鎸夐敭闀挎寜5绉�
+ string textMsg = Language.StringByID(R.MyInternationalizationString.LongPressFiveSecond);
+ if (textMsg.Contains("{0}") == true)
+ {
+ textMsg = string.Format(textMsg, "5");
+ }
+ var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false);
+ btnSecond.X = Application.GetMinRealAverage(518);
+ btnSecond.Y = Application.GetMinRealAverage(545);
+ btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnSecond.TextSize = 10;
+ btnSecond.Text = textMsg;
+ framePic.AddChidren(btnSecond);
+
+ //闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑�
+ //杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛
+ string[] msgArry = Language.StringByID(R.MyInternationalizationString.uAddTwoButtonPanelMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+
+ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ msg1.Y = Application.GetRealHeight(1037);
+ msg1.Text = msgArry[0];
+ msg1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ msg1.TextAlignment = TextAlignment.Center;
+ bodyFrameLayout.AddChidren(msg1);
+ var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+ msg2.Y = msg1.Bottom;
+ if (msgArry.Length > 1)
+ {
+ msg2.Text = msgArry[1];
+ }
+ msg2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ msg2.TextAlignment = TextAlignment.Center;
+ bodyFrameLayout.AddChidren(msg2);
+ }
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
index bb36178..b38c2f3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
@@ -486,8 +486,8 @@
{
return null;
}
- var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
- foreach (var myInfo in dataInfo.PageData)
+ var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
+ foreach (var myInfo in dataInfo2.PageData)
{
var data = new HistoryInfo();
if (dic.ContainsKey(myInfo.CreatedOnUtc) == false)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs
new file mode 100755
index 0000000..870a8e0
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs
@@ -0,0 +1,644 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using ZigBee.Device;
+namespace Shared.Phone.UserCenter.DevicePanel
+{
+ public class PanelBackLighWithSensorForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalScrolViewLayout listview = null;
+
+ /// <summary>
+ /// 闈㈡澘鐨勫洖璺�
+ /// </summary>
+ private Panel panelDevice = null;
+ /// <summary>
+ /// 浜害璋冭妭鐨勪俊鎭�
+ /// </summary>
+ private Panel.PanelSwitchLevelInfo linghtLevelInfo = null;
+ /// <summary>
+ /// 浜害璋冭妭鐨勪俊鎭�
+ /// </summary>
+ private Panel.PanelProximitySensorInfo proximitySensorsInfo = null;
+ /// <summary>
+ /// 鑺傝兘妯″紡
+ /// </summary>
+ private Panel.PanelSaveEnergyModeInfo energyModeInfo = null;
+ /// <summary>
+ /// 鎸夐敭鐨勯鑹叉暟鎹�
+ /// </summary>
+ private Panel.KeyColorData keyColorData = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_listdevice">闈㈡澘璁惧鐨勫叏閮ㄥ洖璺�</param>
+ public void ShowForm(Panel i_panel)
+ {
+ this.ScrollEnabled = false;
+
+ this.panelDevice = i_panel;
+
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uBackLight));
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ });
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private async void InitMiddleFrame()
+ {
+ //鑾峰彇璁惧鍒濆鏁版嵁
+ var result = await this.GetDeviceDefultData();
+ if (result == false)
+ {
+ return;
+ }
+
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ listview = new VerticalScrolViewLayout();
+ listview.Height = Application.GetRealHeight(1981 - 184);
+ bodyFrameLayout.AddChidren(listview);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //娣诲姞鑺傝兘妯″紡
+ this.AddEnergyConservationRow();
+ //娣诲姞鐐瑰嚮鍓嶏紝浜害杩涘害鏉�
+ this.AddBeforeClickProgress();
+ //娣诲姞鐐瑰嚮鍚庯紝浜害杩涘害鏉�
+ this.AddAfterClickProgress();
+ });
+ //瀹瑰櫒琛ュ厖
+ FinishInitControl(listview);
+ //淇濆瓨
+ var btnSave = new BottomClickButton();
+ btnSave.TextID = R.MyInternationalizationString.uSave;
+ bodyFrameLayout.AddChidren(btnSave);
+ btnSave.ButtonClickEvent += (sender, e) =>
+ {
+ //淇濆瓨闈㈡澘鏁版嵁
+ this.SavePanelData();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鑺傝兘妯″紡琛宊________________________
+ /// <summary>
+ /// 娣诲姞鑺傝兘妯″紡琛�
+ /// </summary>
+ /// <param name="frameLinght">鍚勭鑳屽厜鐏殑瀹瑰櫒(鎺т欢浼哥缉浣跨敤)</param>
+ private void AddEnergyConservationRow()
+ {
+ //缂╁皬:170 鎵╁ぇ:429
+ var frameBack = new FrameRowControl();
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.UseClickStatu = false;
+ frameBack.Height = Application.GetRealHeight(170);
+ listview.AddChidren(frameBack);
+
+ //鑺傝兘妯″紡
+ frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uEnergyConservationMode), 400);
+ //寮�鍏虫帶浠�
+ var btnSwitch = frameBack.AddMostRightSwitchIcon();
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ energyModeInfo.enable = btnSwitch.IsSelected;
+ //灞曞紑鎴栬�呯缉灏忕殑楂樺害
+ var value = Application.GetRealHeight(443);
+ if (btnSwitch.IsSelected == true)
+ {
+ frameBack.Height += value;
+ }
+ else
+ {
+ frameBack.Height -= value;
+ }
+ //瀹瑰櫒琛ュ厖
+ this.FinishInitControl(listview, energyModeInfo.enable);
+ };
+ if (energyModeInfo.enable == true)
+ {
+ btnSwitch.IsSelected = true;
+ }
+
+ //褰撳墠浜害
+ var btnProgressView1 = new NormalViewControl(200, 49, true);
+ btnProgressView1.X = ControlCommonResourse.XXLeft;
+ btnProgressView1.Y = Application.GetRealHeight(164);
+ btnProgressView1.TextSize = 12;
+ btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
+ frameBack.AddChidren(btnProgressView1);
+ var btnProgress1 = new NormalViewControl(200, 49, true);
+ btnProgress1.X = Application.GetRealWidth(222);
+ btnProgress1.Y = Application.GetRealHeight(164);
+ btnProgress1.TextSize = 12;
+ btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgress1.Text = energyModeInfo.level + "%";
+ frameBack.AddChidren(btnProgress1);
+
+ //杩涘害鏉�
+ var seekBar1 = new SeekBarControl();
+ seekBar1.Y = Application.GetRealHeight(253);
+ seekBar1.ProgressBarColor = 0xff3e99f4;
+ frameBack.AddChidren(seekBar1);
+ seekBar1.ProgressChangedEvent += (div, value) =>
+ {
+ btnProgress1.Text = value + "%";
+ //鏁版嵁鍙樻洿
+ energyModeInfo.level = value;
+ };
+ seekBar1.Progress = energyModeInfo.level;
+
+ var btnTemp1 = new NormalViewControl(200, 49, true);
+ btnTemp1.X = ControlCommonResourse.XXLeft;
+ btnTemp1.Y = Application.GetRealHeight(325);
+ btnTemp1.TextSize = 12;
+ btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp1.Text = "0%";
+ frameBack.AddChidren(btnTemp1);
+
+ var btnTemp2 = new NormalViewControl(200, 49, true);
+ btnTemp2.X = listview.Width - Application.GetRealWidth(200 + 49);
+ btnTemp2.Y = Application.GetRealHeight(325);
+ btnTemp2.TextAlignment = TextAlignment.CenterRight;
+ btnTemp2.TextSize = 12;
+ btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp2.Text = "100%";
+ frameBack.AddChidren(btnTemp2);
+
+ if (energyModeInfo.enable == true)
+ {
+ //灞曞紑鎴栬�呯缉灏忕殑楂樺害
+ var value = Application.GetRealHeight(443);
+ frameBack.Height += value;
+ //娣诲姞鎺ヨ繎鎰熷簲
+ this.AddProximitySensorsRow(frameBack);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鎺ヨ繎鎰熷簲___________________________
+
+ /// <summary>
+ /// 鎺ヨ繎鎰熷簲琛�
+ /// </summary>
+ private void AddProximitySensorsRow(FrameRowControl frameRowControl)
+ {
+ //鎺ヨ繎鎰熷簲琛�
+ var frameBack = new FrameRowControl();
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.UseClickStatu = false;
+ frameBack.Y = Application.GetRealHeight(443);
+ frameBack.Height = Application.GetRealHeight(170);
+ frameRowControl.AddChidren(frameBack);
+
+ //鎺ヨ繎鎰熷簲
+ frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400);
+ //寮�鍏虫帶浠�
+ var btnSwitch = frameBack.AddMostRightSwitchIcon();
+
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ proximitySensorsInfo.enable = btnSwitch.IsSelected;
+ };
+ if (proximitySensorsInfo.enable == true)
+ {
+ btnSwitch.IsSelected = true;
+ }
+ }
+ #endregion
+
+ #region 鈻� 鐐瑰嚮鍓峗____________________________
+
+ /// <summary>
+ /// 娣诲姞鐐瑰嚮鍓嶇殑鑳屽厜鐏繘搴︽潯
+ /// </summary>
+ /// <param name="frameLinght">鍚勭鑳屽厜鐏殑瀹瑰櫒</param>
+ private void AddBeforeClickProgress()
+ {
+ //鐐瑰嚮鍓�
+ var btnClick = new NormalViewControl(600, 107, true);
+ btnClick.X = ControlCommonResourse.XXLeft;
+ btnClick.TextSize = 12;
+ btnClick.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnClick.TextID = R.MyInternationalizationString.uBeforeClick;
+ listview.AddChidren(btnClick);
+ //鑳屾櫙
+ var frameBack = new FrameLayout();
+ frameBack.Y = Application.GetRealHeight(107);
+ frameBack.Height = Application.GetRealHeight(395);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ listview.AddChidren(frameBack);
+ //褰撳墠浜害
+ var btnProgressView1 = new NormalViewControl(200, 49, true);
+ btnProgressView1.X = ControlCommonResourse.XXLeft;
+ btnProgressView1.Y = Application.GetRealHeight(52);
+ btnProgressView1.TextSize = 12;
+ btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
+ frameBack.AddChidren(btnProgressView1);
+ var btnProgress1 = new NormalViewControl(200, 49, true);
+ btnProgress1.X = Application.GetRealWidth(222);
+ btnProgress1.Y = Application.GetRealHeight(52);
+ btnProgress1.TextSize = 12;
+ btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgress1.Text = linghtLevelInfo.panelBacklightLevel + "%";
+ frameBack.AddChidren(btnProgress1);
+
+ //杩涘害鏉�
+ var seekBar1 = new SeekBarControl();
+ seekBar1.Y = Application.GetRealHeight(147);
+ frameBack.AddChidren(seekBar1);
+ seekBar1.ProgressChangedEvent += (div, value) =>
+ {
+ btnProgress1.Text = value + "%";
+ //鏁版嵁鍙樻洿
+ linghtLevelInfo.panelBacklightLevel = value;
+ };
+ seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
+
+ var btnTemp1 = new NormalViewControl(200, 49, true);
+ btnTemp1.X = ControlCommonResourse.XXLeft;
+ btnTemp1.Y = Application.GetRealHeight(216);
+ btnTemp1.TextSize = 12;
+ btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp1.Text = "0%";
+ frameBack.AddChidren(btnTemp1);
+
+ var btnTemp2 = new NormalViewControl(200, 49, true);
+ btnTemp2.X = listview.Width - Application.GetRealWidth(200 + 49);
+ btnTemp2.Y = Application.GetRealHeight(216);
+ btnTemp2.TextAlignment = TextAlignment.CenterRight;
+ btnTemp2.TextSize = 12;
+ btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp2.Text = "100%";
+ frameBack.AddChidren(btnTemp2);
+
+ var frameColor = new FrameLayoutControl();
+ frameColor.UseClickStatu = false;
+ frameColor.Width = Application.GetRealHeight(262);
+ frameColor.Height = Application.GetMinRealAverage(79);
+ frameColor.Y = Application.GetRealHeight(26);
+ frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
+ frameBack.AddChidren(frameColor);
+
+ //棰滆壊
+ var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false);
+ btnColorView.Gravity = Gravity.CenterVertical;
+ btnColorView.TextAlignment = TextAlignment.CenterRight;
+ btnColorView.TextSize = 12;
+ btnColorView.Y = Application.GetRealHeight(5);
+ btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnColorView.TextID = R.MyInternationalizationString.uColor;
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+
+ int R1 = Convert.ToInt32(this.keyColorData.CloseColorR, 16);
+ int G1 = Convert.ToInt32(this.keyColorData.CloseColorG, 16);
+ int B1 = Convert.ToInt32(this.keyColorData.CloseColorB, 16);
+ uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
+
+ //棰滆壊澶栨
+ var btnColorLine = new FrameLayoutControl();
+ btnColorLine.Width = Application.GetRealHeight(79);
+ btnColorLine.Height = Application.GetMinRealAverage(79);
+ btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
+ btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2;
+ btnColorLine.BorderWidth = 1;
+ btnColorLine.BorderColor = 0xffcccccc;
+ frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
+
+ var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false);
+ btnColor.Gravity = Gravity.Center;
+ btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2;
+ btnColor.BackgroundColor = backColor;
+ btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
+
+ //鍙樻洿婊戝姩鏉$殑棰滆壊
+ seekBar1.ProgressBarColor = backColor;
+
+ var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
+ btnRight.UnSelectedImagePath = "Item/RightNext.png";
+ btnRight.Y = Application.GetRealHeight(5);
+ btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ btnRight.Y += Application.GetMinRealAverage(8);
+
+ frameColor.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new PanelColorSelectForm();
+ form.AddForm(R1, G1, B1);
+ form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
+ {
+ R1 = Rcolor;
+ G1 = Gcolor;
+ B1 = Bcolor;
+
+ this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
+ this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
+ this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
+
+ btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
+ //鍙樻洿婊戝姩鏉$殑棰滆壊
+ seekBar1.ProgressBarColor = btnColor.BackgroundColor;
+ };
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鐐瑰嚮鍚巁____________________________
+
+ /// <summary>
+ /// 娣诲姞鐐瑰嚮鍚庣殑鑳屽厜鐏繘搴︽潯
+ /// </summary>
+ /// <param name="frameLinght">鍚勭鑳屽厜鐏殑瀹瑰櫒</param>
+ private void AddAfterClickProgress()
+ {
+ //鐐瑰嚮鍚�
+ var btnClick = new NormalViewControl(600, 107, true);
+ btnClick.X = ControlCommonResourse.XXLeft;
+ btnClick.TextSize = 12;
+ btnClick.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnClick.TextID = R.MyInternationalizationString.uAfterClick;
+ listview.AddChidren(btnClick);
+ //鑳屾櫙
+ var frameBack = new FrameLayout();
+ frameBack.Y = Application.GetRealHeight(608);
+ frameBack.Height = Application.GetRealHeight(395);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ listview.AddChidren(frameBack);
+ //褰撳墠浜害
+ var btnProgressView1 = new NormalViewControl(200, 49, true);
+ btnProgressView1.X = ControlCommonResourse.XXLeft;
+ btnProgressView1.Y = Application.GetRealHeight(52);
+ btnProgressView1.TextSize = 12;
+ btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
+ frameBack.AddChidren(btnProgressView1);
+ var btnProgress1 = new NormalViewControl(200, 49, true);
+ btnProgress1.X = Application.GetRealWidth(222);
+ btnProgress1.Y = Application.GetRealHeight(52);
+ btnProgress1.TextSize = 12;
+ btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgress1.Text = linghtLevelInfo.panelDirectionsLevel + "%";
+ frameBack.AddChidren(btnProgress1);
+
+ //杩涘害鏉�
+ var seekBar1 = new SeekBarControl();
+ seekBar1.Y = Application.GetRealHeight(147);
+ frameBack.AddChidren(seekBar1);
+ seekBar1.ProgressChangedEvent += (div, value) =>
+ {
+ btnProgress1.Text = value + "%";
+ //鏁版嵁鍙樻洿
+ linghtLevelInfo.panelDirectionsLevel = value;
+ };
+ seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel;
+
+ var btnTemp1 = new NormalViewControl(200, 49, true);
+ btnTemp1.X = ControlCommonResourse.XXLeft;
+ btnTemp1.Y = Application.GetRealHeight(216);
+ btnTemp1.TextSize = 12;
+ btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp1.Text = "0%";
+ frameBack.AddChidren(btnTemp1);
+
+ var btnTemp2 = new NormalViewControl(200, 49, true);
+ btnTemp2.X = listview.Width - Application.GetRealWidth(200 + 49);
+ btnTemp2.Y = Application.GetRealHeight(216);
+ btnTemp2.TextAlignment = TextAlignment.CenterRight;
+ btnTemp2.TextSize = 12;
+ btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp2.Text = "100%";
+ frameBack.AddChidren(btnTemp2);
+
+ var frameColor = new FrameLayoutControl();
+ frameColor.UseClickStatu = false;
+ frameColor.Width = Application.GetRealHeight(262);
+ frameColor.Height = Application.GetMinRealAverage(79);
+ frameColor.Y = Application.GetRealHeight(26);
+ frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
+ frameBack.AddChidren(frameColor);
+
+ //棰滆壊
+ var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false);
+ btnColorView.Gravity = Gravity.CenterVertical;
+ btnColorView.TextAlignment = TextAlignment.CenterRight;
+ btnColorView.TextSize = 12;
+ btnColorView.Y = Application.GetRealHeight(5);
+ btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnColorView.TextID = R.MyInternationalizationString.uColor;
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+
+ int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16);
+ int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16);
+ int B1 = Convert.ToInt32(this.keyColorData.OpenColorB, 16);
+ uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
+
+ //棰滆壊澶栨
+ var btnColorLine = new FrameLayoutControl();
+ btnColorLine.Width = Application.GetRealHeight(79);
+ btnColorLine.Height = Application.GetMinRealAverage(79);
+ btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
+ btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2;
+ btnColorLine.BorderWidth = 1;
+ btnColorLine.BorderColor = 0xffcccccc;
+ frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
+
+ var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false);
+ btnColor.Gravity = Gravity.Center;
+ btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2;
+ btnColor.BackgroundColor = backColor;
+ btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
+
+ //鍙樻洿婊戝姩鏉$殑棰滆壊
+ seekBar1.ProgressBarColor = backColor;
+
+ var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
+ btnRight.UnSelectedImagePath = "Item/RightNext.png";
+ btnRight.Y = Application.GetRealHeight(5);
+ btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ btnRight.Y += Application.GetMinRealAverage(8);
+
+ frameColor.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new PanelColorSelectForm();
+ form.AddForm(R1, G1, B1);
+ form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
+ {
+ R1 = Rcolor;
+ G1 = Gcolor;
+ B1 = Bcolor;
+
+ this.keyColorData.OpenColorR = Convert.ToString(Rcolor, 16);
+ this.keyColorData.OpenColorG = Convert.ToString(Gcolor, 16);
+ this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
+
+ btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
+ //鍙樻洿婊戝姩鏉$殑棰滆壊
+ seekBar1.ProgressBarColor = btnColor.BackgroundColor;
+ };
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鑾峰彇鍒濆鏁版嵁_______________________
+
+ /// <summary>
+ /// 鑾峰彇璁惧鍒濆鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ private async Task<bool> GetDeviceDefultData()
+ {
+ //寮�鍚繘搴︽潯
+ this.ShowProgressBar();
+ //浜害璋冭妭(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
+ linghtLevelInfo = await HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
+ if (linghtLevelInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ //鎺ヨ繎鎰熷簲(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
+ proximitySensorsInfo = await HdlDevicePanelLogic.Current.GetDeviceProximitySensorsSettion(panelDevice);
+ if (proximitySensorsInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ //鑺傝兘妯″紡(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
+ energyModeInfo = await HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
+ if (energyModeInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ keyColorData = await HdlDevicePanelLogic.Current.GetPanelEpointColorInfo(panelDevice);
+ if (this.keyColorData == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
+
+ return true;
+ }
+
+ #endregion
+
+ #region 鈻� 淇濆瓨鏁版嵁___________________________
+
+ /// <summary>
+ /// 淇濆瓨闈㈡澘鏁版嵁
+ /// </summary>
+ 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);
+ if (result == false)
+ {
+ this.CloseProgressBar();
+ return;
+ }
+ //鎺ヨ繎淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�)
+ result = await HdlDevicePanelLogic.Current.SetProximitySensorStatus(panelDevice, proximitySensorsInfo.enable);
+ if (result == false)
+ {
+ this.CloseProgressBar();
+ return;
+ }
+ //璁剧疆鎸夐敭闈㈡澘鎸囧畾绔偣鐨勩�愭寚绀虹伅寮�鍏抽鑹层�戠殑淇℃伅
+ result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
+ this.CloseProgressBar();
+ if (result == false)
+ {
+ return;
+ }
+ //鍏抽棴鑷韩
+ this.CloseForm();
+ }
+
+ #endregion
+
+ #region 鈻� 琛ュ厖瀹瑰櫒___________________________
+ /// <summary>
+ /// 琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout锛屼娇涔嬭兘婊戝姩
+ /// </summary>
+ /// <param name="listview">褰撳墠婊戝姩椤佃寖鍥�</param>
+ /// <param name="enable">鏄惁娣诲姞瀹瑰櫒</param>
+ public void FinishInitControl(VerticalScrolViewLayout listview, bool enable = false)
+ {
+ //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩
+ var frameTemp = new FrameLayout();
+ listview.AddChidren(frameTemp);
+ frameTemp.Tag = "绉婚櫎瀹瑰櫒";
+ if (enable == true)
+ {
+ listview.ScrollEnabled = true;
+ frameTemp.Height = Application.GetRealHeight(2212 - 1921 + 173);
+ }
+ else
+ {
+ listview.RemoveViewByTag("绉婚櫎瀹瑰櫒");
+ listview.ScrollEnabled = false;
+ }
+ }
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 灏哛GB杞崲涓洪鑹�
+ /// </summary>
+ /// <param name="R"></param>
+ /// <param name="G"></param>
+ /// <param name="B"></param>
+ /// <returns></returns>
+ private uint GetColorByRGB(byte R, byte G, byte B)
+ {
+ return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B);
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
index d5851af..37de610 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
@@ -437,7 +437,7 @@
bodyFrameLayout.AddChidren(frameBorder);
var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
- btnPic.UnSelectedImagePath = "Device/PanelTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelTable.png";
frameBorder.AddChidren(btnPic);
if (listOffSwitch.Count == 4)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
index f381cb9..9c1b5b4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing Shared.Common;
+using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
@@ -173,8 +174,6 @@
this.AddBindRow();
//娣诲姞鑳屽厜鐏
this.AddBackLightRow();
- //娣诲姞鎺ヨ繎鎰熷簲琛�
- this.AddProximityInductionRow();
//鍒濆鍖栨甯冨畬鎴�
tableContr.FinishInitControl(bodyFrameLayout, this.listview);
@@ -273,34 +272,25 @@
btnLight.AddRightArrow();
btnLight.ButtonClickEvent += (sender, e) =>
{
- var form = new PanelBackLightSettionForm();
- form.AddForm((Panel)nowSelectDevice);
+ List<CommonDevice> listNewDevice = new List<CommonDevice> { };
+ listNewDevice.Add((Panel)nowSelectDevice);
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listNewDevice);
+ //濡傛灉璁惧鏄柟鎮﹀紑鎺ц澶囷紝鑳屽厜鐏〉闇�瑕佹粦鍔ㄤ笖鏈夋帴杩戞劅搴斿姛鑳�
+ if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo
+ || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
+ || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight)
+ {
+ var form = new PanelBackLighWithSensorForm();
+ form.AddForm((Panel)nowSelectDevice);
+ }
+ else
+ {
+ //涓嶅甫鎺ヨ繎鎰熷簲鐨�
+ var form = new PanelBackLightSettionForm();
+ form.AddForm((Panel)nowSelectDevice);
+ }
};
}
- }
-
- #endregion
-
- #region 鈻� 鎺ヨ繎鎰熷簲___________________________
-
- /// <summary>
- /// 娣诲姞鎺ヨ繎鎰熷簲琛�
- /// </summary>
- private void AddProximityInductionRow()
- {
- //鎺ヨ繎鎰熷簲
- var rowContr = new FrameRowControl(listview.rowSpace / 2);
- rowContr.UseClickStatu = false;
- listview.AddChidren(rowContr);
- rowContr.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uProximityInduction), 600);
- //搴曠嚎
- rowContr.AddBottomLine();
- //寮�鍏�
- var btnSwitch = rowContr.AddMostRightSwitchIcon();
- btnSwitch.ButtonClickEvent += (sender, e) =>
- {
- btnSwitch.IsSelected = !btnSwitch.IsSelected;
- };
}
#endregion
@@ -357,19 +347,19 @@
if (listOffSwitch.Count == 8)
{
//鍏寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueEightButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueEightButtonTable.png";
this.InitEightButtonPanelIcon(frameBorder, listOffSwitch);
}
else if (listOffSwitch.Count == 4)
{
//鍥涙寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueFourButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueFourButtonTable.png";
this.InitFourButtonPanelIcon(frameBorder, listOffSwitch);
}
else
{
//浜屾寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueTwoButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueTwoButtonTable.png";
this.InitTwoButtonPanelIcon(frameBorder, listOffSwitch);
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs
index 88ebf68..ffaf75f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs
@@ -54,7 +54,7 @@
//鍥剧墖
var btnPic = new PicViewControl(426, 426);
btnPic.Y = Application.GetRealHeight(150);
- btnPic.UnSelectedImagePath = "Device/ButtonPanelFangyueEnvironmentBigPic.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png";
btnPic.Gravity = Gravity.CenterHorizontal;
bodyFrameLayout.AddChidren(btnPic);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
new file mode 100755
index 0000000..cb4f3ab
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
@@ -0,0 +1,591 @@
+锘縰sing System;
+using System.Threading.Tasks;
+using ZigBee.Device;
+namespace Shared.Phone.UserCenter.DevicePanel
+{
+ public class PanelFangyueFreshAirBackLightSettionForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalScrolViewLayout listview = null;
+ /// <summary>
+ /// 闈㈡澘鐨勫洖璺�
+ /// </summary>
+ private Panel panelDevice;
+ /// <summary>
+ /// 浜害璋冭妭鐨勪俊鎭�
+ /// </summary>
+ private Panel.PanelSwitchLevelInfo linghtLevelInfo = null;
+ /// <summary>
+ /// 浜害璋冭妭鐨勪俊鎭�
+ /// </summary>
+ private Panel.PanelProximitySensorInfo proximitySensorsInfo = null;
+ /// <summary>
+ /// 鑺傝兘妯″紡
+ /// </summary>
+ private Panel.PanelSaveEnergyModeInfo energyModeInfo = null;
+ /// <summary>
+ /// 鎸夐敭鐨勯鑹叉暟鎹�
+ /// </summary>
+ private Panel.KeyColorData keyColorData = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_device">璁惧鐨勬煇涓�鍥炶矾</param>
+ public void ShowForm(Panel i_panel)
+ {
+ //宸︽粦浣胯兘涓嶅彲
+ this.ScrollEnabled = false;
+ this.panelDevice = i_panel;
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uLightRegulation));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private async void InitMiddleFrame()
+ {
+ //鑾峰彇璁惧鍒濆鏁版嵁
+ var result = await this.GetDeviceDefultData();
+ if (result == false)
+ {
+ return;
+ }
+
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ listview = new VerticalScrolViewLayout();
+ listview.Height = Application.GetRealHeight(1981 - 184);
+ bodyFrameLayout.AddChidren(listview);
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //娣诲姞鑺傝兘妯″紡鎺т欢
+ this.AddEnergyConservationRow();
+ //娣诲姞灞忓箷浜害绾у埆鎺т欢
+ this.AddScreenBrightnesLevelControl();
+ //娣诲姞鑳屽厜鐏寒搴︽帶浠�
+ this.AddBackLightControl();
+ });
+
+ //瀹瑰櫒琛ュ厖
+ FinishInitControl(listview);
+
+ //淇濆瓨
+ var btnSave = new BottomClickButton();
+ btnSave.TextID = R.MyInternationalizationString.uSave;
+ bodyFrameLayout.AddChidren(btnSave);
+ btnSave.ButtonClickEvent += (sender, e) =>
+ {
+ //淇濆瓨闈㈡澘鏁版嵁
+ this.SavePanelData();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 灞忓箷浜害绾у埆_______________________
+
+ /// <summary>
+ /// 娣诲姞灞忓箷浜害绾у埆鎺т欢
+ /// </summary>
+ private void AddScreenBrightnesLevelControl()
+ {
+ var frameBack = new FrameLayout();
+ frameBack.Height = Application.GetRealHeight(429);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ listview.AddChidren(frameBack);
+
+ //灞忓箷浜害绾у埆
+ var btnLevelView = new NormalViewControl(400, 60, true);
+ btnLevelView.X = ControlCommonResourse.XXLeft;
+ btnLevelView.Y = Application.GetRealHeight(54);
+ btnLevelView.TextID = R.MyInternationalizationString.uScreenBrightnesLevel;
+ frameBack.AddChidren(btnLevelView);
+
+ //?绾�
+ string strRank = Language.StringByID(R.MyInternationalizationString.uRank);
+ var btnLevel = new NormalViewControl(167, 60, true);
+ btnLevel.X = Application.GetRealWidth(855);
+ btnLevel.Y = Application.GetRealHeight(54);
+ btnLevel.TextAlignment = TextAlignment.CenterRight;
+ btnLevel.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnLevel.Text = "3" + strRank;
+ frameBack.AddChidren(btnLevel);
+
+ //褰撳墠浜害
+ var btnProgressView1 = new NormalViewControl(200, 50, true);
+ btnProgressView1.X = ControlCommonResourse.XXLeft;
+ btnProgressView1.Y = Application.GetRealHeight(157);
+ btnProgressView1.TextSize = 12;
+ btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
+ frameBack.AddChidren(btnProgressView1);
+ var btnProgress1 = new NormalViewControl(200, 50, true);
+ btnProgress1.X = Application.GetRealWidth(222);
+ btnProgress1.Y = Application.GetRealHeight(157);
+ btnProgress1.TextSize = 12;
+ btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgress1.Text = "4";
+ frameBack.AddChidren(btnProgress1);
+
+ //杩涘害鏉�
+ var seekBar1 = new SeekBarControl();
+ seekBar1.MaxValue = 5;
+ seekBar1.ProgressBarColor = 0xff3e99f4;
+ seekBar1.Y = Application.GetRealHeight(253);
+ frameBack.AddChidren(seekBar1);
+ seekBar1.ProgressChangedEvent += (div, value) =>
+ {
+ btnProgress1.Text = value.ToString();
+ //鏁版嵁鍙樻洿
+ };
+ //seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
+
+ var btnTemp1 = new NormalViewControl(200, 50, true);
+ btnTemp1.X = ControlCommonResourse.XXLeft;
+ btnTemp1.Y = Application.GetRealHeight(322);
+ btnTemp1.TextSize = 12;
+ btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp1.Text = "0";
+ frameBack.AddChidren(btnTemp1);
+
+ var btnTemp2 = new NormalViewControl(100, 50, true);
+ btnTemp2.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(100);
+ btnTemp2.Y = Application.GetRealHeight(322);
+ btnTemp2.TextAlignment = TextAlignment.CenterRight;
+ btnTemp2.TextSize = 12;
+ btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp2.Text = "5";
+ frameBack.AddChidren(btnTemp2);
+ }
+
+ #endregion
+
+ #region 鈻� 鑳屽厜鐏寒搴________________________
+
+ /// <summary>
+ /// 娣诲姞鑳屽厜鐏寒搴︽帶浠�
+ /// </summary>
+ private void AddBackLightControl()
+ {
+ //鑳屾櫙
+ var frameBack = new FrameLayout();
+ frameBack.Y = Application.GetRealHeight(490);
+ frameBack.Height = Application.GetRealHeight(429);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ listview.AddChidren(frameBack);
+
+ //鑳屽厜鐏寒搴�
+ var btnLevelView = new NormalViewControl(400, 60, true);
+ btnLevelView.X = ControlCommonResourse.XXLeft;
+ btnLevelView.Y = Application.GetRealHeight(54);
+ btnLevelView.TextID = R.MyInternationalizationString.uBacklightBrightness;
+ frameBack.AddChidren(btnLevelView);
+
+ //褰撳墠浜害
+ var btnProgressView1 = new NormalViewControl(200, 50, true);
+ btnProgressView1.X = ControlCommonResourse.XXLeft;
+ btnProgressView1.Y = Application.GetRealHeight(157);
+ btnProgressView1.TextSize = 12;
+ btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
+ frameBack.AddChidren(btnProgressView1);
+ var btnProgress1 = new NormalViewControl(200, 50, true);
+ btnProgress1.X = Application.GetRealWidth(222);
+ btnProgress1.Y = Application.GetRealHeight(157);
+ btnProgress1.TextSize = 12;
+ btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgress1.Text = "70%";
+ frameBack.AddChidren(btnProgress1);
+
+ //杩涘害鏉�
+ var seekBar1 = new SeekBarControl();
+ seekBar1.Y = Application.GetRealHeight(253);
+ frameBack.AddChidren(seekBar1);
+ seekBar1.ProgressChangedEvent += (div, value) =>
+ {
+ btnProgress1.Text = value + "%";
+ //鏁版嵁鍙樻洿
+ };
+ //seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
+
+ var btnTemp1 = new NormalViewControl(200, 50, true);
+ btnTemp1.X = ControlCommonResourse.XXLeft;
+ btnTemp1.Y = Application.GetRealHeight(322);
+ btnTemp1.TextSize = 12;
+ btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp1.Text = "0%";
+ frameBack.AddChidren(btnTemp1);
+
+ var btnTemp2 = new NormalViewControl(200, 50, true);
+ btnTemp2.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(200);
+ btnTemp2.Y = Application.GetRealHeight(322);
+ btnTemp2.TextAlignment = TextAlignment.CenterRight;
+ btnTemp2.TextSize = 12;
+ btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp2.Text = "100%";
+ frameBack.AddChidren(btnTemp2);
+
+ var frameColor = new FrameLayoutControl();
+ frameColor.UseClickStatu = false;
+ frameColor.Width = Application.GetRealHeight(262);
+ frameColor.Height = Application.GetMinRealAverage(79);
+ frameColor.Y = Application.GetRealHeight(26);
+ frameColor.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
+ frameBack.AddChidren(frameColor);
+ //棰滆壊
+ var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(50), false);
+ btnColorView.Gravity = Gravity.CenterVertical;
+ btnColorView.TextAlignment = TextAlignment.CenterRight;
+ btnColorView.TextSize = 12;
+ btnColorView.Y = Application.GetRealHeight(5);
+ btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnColorView.TextID = R.MyInternationalizationString.uColor;
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+
+ int R1 = Convert.ToInt32("d8", 16);
+ int G1 = Convert.ToInt32("95", 16);
+ int B1 = Convert.ToInt32("e3", 16);
+ uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
+
+ //棰滆壊澶栨
+ var btnColorLine = new NormalViewControl(Application.GetMinRealAverage(79), Application.GetMinRealAverage(79), false);
+ btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
+ btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2;
+ btnColorLine.BorderWidth = 1;
+ btnColorLine.BorderColor = 0xff666666;
+ frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
+
+ var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false);
+ btnColor.Y = Application.GetRealHeight(5);
+ btnColor.X = btnColorView.Right + Application.GetRealHeight(23);
+ btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2;
+ btnColor.BackgroundColor = UserCenterColor.Current.ErrorColor;
+ frameColor.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
+
+ //鍙樻洿婊戝姩鏉$殑棰滆壊
+ seekBar1.ProgressBarColor = backColor;
+
+ var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
+ btnRight.UnSelectedImagePath = "Item/RightNext.png";
+ btnRight.Y = Application.GetRealHeight(5);
+ btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ btnRight.Y += Application.GetMinRealAverage(8);
+
+ frameColor.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new PanelColorSelectForm();
+ form.AddForm(R1, G1, B1);
+ form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
+ {
+ R1 = Rcolor;
+ G1 = Gcolor;
+ B1 = Bcolor;
+
+ //this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
+ //this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
+ //this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
+
+ btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
+ //鍙樻洿婊戝姩鏉$殑棰滆壊
+ seekBar1.ProgressBarColor = btnColor.BackgroundColor;
+ };
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鑺傝兘妯″紡琛宊________________________
+
+ /// <summary>
+ /// 娣诲姞鑺傝兘妯″紡琛�
+ /// </summary>
+ /// <param name="frameLinght">鍚勭鑳屽厜鐏殑瀹瑰櫒(鎺т欢浼哥缉浣跨敤)</param>
+ private void AddEnergyConservationRow()
+ {
+ //缂╁皬:170 鎵╁ぇ:429
+ var frameBack = new FrameRowControl();
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.UseClickStatu = false;
+ frameBack.Height = Application.GetRealHeight(170);
+ listview.AddChidren(frameBack);
+
+ //鑺傝兘妯″紡
+ frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uEnergyConservationMode), 400);
+ //寮�鍏虫帶浠�
+ var btnSwitch = frameBack.AddMostRightSwitchIcon();
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ energyModeInfo.enable = btnSwitch.IsSelected;
+ //灞曞紑鎴栬�呯缉灏忕殑楂樺害
+ var value = Application.GetRealHeight(443);
+ if (btnSwitch.IsSelected == true)
+ {
+ frameBack.Height += value;
+ }
+ else
+ {
+ frameBack.Height -= value;
+ }
+ //瀹瑰櫒琛ュ厖
+ this.FinishInitControl(listview, energyModeInfo.enable);
+ };
+ if (energyModeInfo.enable == true)
+ {
+ btnSwitch.IsSelected = true;
+ }
+
+ //褰撳墠浜害
+ var btnProgressView1 = new NormalViewControl(200, 49, true);
+ btnProgressView1.X = ControlCommonResourse.XXLeft;
+ btnProgressView1.Y = Application.GetRealHeight(164);
+ btnProgressView1.TextSize = 12;
+ btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
+ frameBack.AddChidren(btnProgressView1);
+ var btnProgress1 = new NormalViewControl(200, 49, true);
+ btnProgress1.X = Application.GetRealWidth(222);
+ btnProgress1.Y = Application.GetRealHeight(164);
+ btnProgress1.TextSize = 12;
+ btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnProgress1.Text = energyModeInfo.level + "%";
+ frameBack.AddChidren(btnProgress1);
+
+ //杩涘害鏉�
+ var seekBar1 = new SeekBarControl();
+ seekBar1.Y = Application.GetRealHeight(253);
+ seekBar1.ProgressBarColor = 0xff3e99f4;
+ frameBack.AddChidren(seekBar1);
+ seekBar1.ProgressChangedEvent += (div, value) =>
+ {
+ btnProgress1.Text = value + "%";
+ //鏁版嵁鍙樻洿
+ energyModeInfo.level = value;
+ };
+ seekBar1.Progress = energyModeInfo.level;
+
+ var btnTemp1 = new NormalViewControl(200, 49, true);
+ btnTemp1.X = ControlCommonResourse.XXLeft;
+ btnTemp1.Y = Application.GetRealHeight(325);
+ btnTemp1.TextSize = 12;
+ btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp1.Text = "0%";
+ frameBack.AddChidren(btnTemp1);
+
+ var btnTemp2 = new NormalViewControl(200, 49, true);
+ btnTemp2.X = listview.Width - Application.GetRealWidth(200 + 49);
+ btnTemp2.Y = Application.GetRealHeight(325);
+ btnTemp2.TextAlignment = TextAlignment.CenterRight;
+ btnTemp2.TextSize = 12;
+ btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnTemp2.Text = "100%";
+ frameBack.AddChidren(btnTemp2);
+
+ if (energyModeInfo.enable == true)
+ {
+ //灞曞紑鎴栬�呯缉灏忕殑楂樺害
+ var value = Application.GetRealHeight(443);
+ frameBack.Height += value;
+ //娣诲姞鎺ヨ繎鎰熷簲
+ this.AddProximitySensorsRow(frameBack);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鎺ヨ繎鎰熷簲___________________________
+
+ /// <summary>
+ /// 鎺ヨ繎鎰熷簲琛�
+ /// </summary>
+ private void AddProximitySensorsRow(FrameRowControl frameRowControl)
+ {
+ //鎺ヨ繎鎰熷簲琛�
+ var frameBack = new FrameRowControl();
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.UseClickStatu = false;
+ frameBack.Y = Application.GetRealHeight(443);
+ frameBack.Height = Application.GetRealHeight(170);
+ frameRowControl.AddChidren(frameBack);
+
+ //鎺ヨ繎鎰熷簲
+ frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400);
+ //寮�鍏虫帶浠�
+ var btnSwitch = frameBack.AddMostRightSwitchIcon();
+
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ proximitySensorsInfo.enable = btnSwitch.IsSelected;
+ };
+ if (proximitySensorsInfo.enable == true)
+ {
+ btnSwitch.IsSelected = true;
+ }
+ }
+ #endregion
+
+ #region 鈻� 鑾峰彇鍒濆鏁版嵁_______________________
+
+ /// <summary>
+ /// 鑾峰彇璁惧鍒濆鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ private async Task<bool> GetDeviceDefultData()
+ {
+ //寮�鍚繘搴︽潯
+ this.ShowProgressBar();
+ //浜害璋冭妭(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
+ linghtLevelInfo = await HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
+ if (linghtLevelInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ //鎺ヨ繎鎰熷簲(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
+ proximitySensorsInfo = await HdlDevicePanelLogic.Current.GetDeviceProximitySensorsSettion(panelDevice);
+ if (proximitySensorsInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ //鑺傝兘妯″紡(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
+ energyModeInfo = await HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
+ if (energyModeInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ keyColorData = await HdlDevicePanelLogic.Current.GetPanelEpointColorInfo(panelDevice);
+ if (this.keyColorData == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return false;
+ }
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
+
+ return true;
+ }
+
+ #endregion
+
+ #region 鈻� 淇濆瓨鏁版嵁___________________________
+
+ /// <summary>
+ /// 淇濆瓨闈㈡澘鏁版嵁
+ /// </summary>
+ 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);
+ if (result == false)
+ {
+ this.CloseProgressBar();
+ return;
+ }
+ //鎺ヨ繎淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�)
+ result = await HdlDevicePanelLogic.Current.SetProximitySensorStatus(panelDevice, proximitySensorsInfo.enable);
+ if (result == false)
+ {
+ this.CloseProgressBar();
+ return;
+ }
+ //璁剧疆鎸夐敭闈㈡澘鎸囧畾绔偣鐨勩�愭寚绀虹伅寮�鍏抽鑹层�戠殑淇℃伅
+ result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
+ this.CloseProgressBar();
+ if (result == false)
+ {
+ return;
+ }
+ //鍏抽棴鑷韩
+ this.CloseForm();
+ }
+
+ #endregion
+
+ #region 鈻� 淇濆瓨閰嶇疆___________________________
+
+ /// <summary>
+ /// 淇濆瓨閰嶇疆
+ /// </summary>
+ private void SaveSettionData()
+ {
+ this.CloseForm();
+ }
+
+ #endregion
+
+ #region 鈻� 琛ュ厖瀹瑰櫒___________________________
+ /// <summary>
+ /// 琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout锛屼娇涔嬭兘婊戝姩
+ /// </summary>
+ /// <param name="listview">褰撳墠婊戝姩椤佃寖鍥�</param>
+ /// <param name="enable">鏄惁娣诲姞瀹瑰櫒</param>
+ public void FinishInitControl(VerticalScrolViewLayout listview, bool enable = false)
+ {
+ //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩
+ var frameTemp = new FrameLayout();
+ listview.AddChidren(frameTemp);
+ frameTemp.Tag = "绉婚櫎瀹瑰櫒";
+ if (enable == true)
+ {
+ listview.ScrollEnabled = true;
+ frameTemp.Height = Application.GetRealHeight(2212 - 1921 + 173);
+ }
+ else
+ {
+ listview.RemoveViewByTag("绉婚櫎瀹瑰櫒");
+ listview.ScrollEnabled = false;
+ }
+ }
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 灏哛GB杞崲涓洪鑹�
+ /// </summary>
+ /// <param name="R"></param>
+ /// <param name="G"></param>
+ /// <param name="B"></param>
+ /// <returns></returns>
+ private uint GetColorByRGB(byte R, byte G, byte B)
+ {
+ return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B);
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
new file mode 100755
index 0000000..17e698e
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
@@ -0,0 +1,162 @@
+锘縰sing System;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.DevicePanel
+{
+ /// <summary>
+ /// 鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃晫闈�
+ /// </summary>
+ public class PanelFangyueFreshAirButtonSettionForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalListControl listview = null;
+ /// <summary>
+ /// 璁惧鐨勬煇涓�鍥炶矾
+ /// </summary>
+ private CommonDevice deviceObj = null;
+
+ #endregion
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_device">璁惧鐨勬煇涓�鍥炶矾</param>
+ public void ShowForm(CommonDevice i_device)
+ {
+ this.deviceObj = i_device;
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uPanelSettion));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+
+ //鍒濆鍖栧彸涓婅鑿滃崟
+ this.InitTopRightMenu();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ //鍥剧墖
+ var btnPic = new PicViewControl(426, 426);
+ btnPic.Y = Application.GetRealHeight(150);
+ btnPic.UnSelectedImagePath = "RealDevice/ButtonPanelFangyueFreshAir.png";
+ btnPic.Gravity = Gravity.CenterHorizontal;
+ bodyFrameLayout.AddChidren(btnPic);
+
+ //鍒濆鍖栨甯�
+ var tableContr = new InformationEditorControl();
+ this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+
+ //鍒濆鍖栬彍鍗曡
+ this.InitMenuRow();
+
+ //鍒濆鍖栨甯冨畬鎴�
+ tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr = null;
+
+ //淇濆瓨
+ var btnFinish = new BottomClickButton();
+ btnFinish.TextID = R.MyInternationalizationString.uSave;
+ bodyFrameLayout.AddChidren(btnFinish);
+ btnFinish.ButtonClickEvent += (sender, e) =>
+ {
+ //鍏抽棴鑷韩
+ this.CloseForm();
+ };
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栬彍鍗曡
+ /// </summary>
+ private void InitMenuRow()
+ {
+ this.listview.RemoveAll();
+
+ //鏂伴鐩爣
+ var rowNewWind = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowNewWind);
+ rowNewWind.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewWindTarget), 600);
+ //搴曠嚎
+ rowNewWind.AddBottomLine();
+ //鍙崇澶�
+ rowNewWind.AddRightArrow();
+ var btnNewWindStatu = rowNewWind.AddMostRightView("鏂伴1", 700);
+ rowNewWind.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new PanelFangyueEnvironmentTargetForm();
+ form.AddForm(this.deviceObj, string.Empty, 3);
+ };
+
+ //浜害璋冭妭
+ var rowLight = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowLight);
+ rowLight.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uLightRegulation), 600);
+ //搴曠嚎
+ rowLight.AddBottomLine();
+ //鍙崇澶�
+ rowLight.AddRightArrow();
+ rowLight.ButtonClickEvent += (sender, e) =>
+ {
+ //缁欐柊椋庨潰鏉垮缓绔嬩竴涓柊鐨勬敮鎸侀潰鏉垮璞★紝鐢�200绔偣璁剧疆
+ var panel = new Panel();
+ panel.DeviceAddr = this.deviceObj.DeviceAddr;
+ panel.DeviceEpoint = 200;
+ panel.CurrentGateWayId = this.deviceObj.CurrentGateWayId;
+ var form = new PanelFangyueFreshAirBackLightSettionForm();
+ form.AddForm(panel);
+ };
+ }
+ #endregion
+
+ #region 鈻� 鍙充笂瑙掕彍鍗昣________________________
+ /// <summary>
+ /// 鍒濆鍖栧彸涓婅鑿滃崟
+ /// </summary>
+ private void InitTopRightMenu()
+ {
+ //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘
+ if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(deviceObj) == false)
+ {
+ return;
+ }
+ var btnIcon = new MostRightIconControl(69, 69);
+ btnIcon.UnSelectedImagePath = "Item/More.png";
+ topFrameLayout.AddChidren(btnIcon);
+ btnIcon.InitControl();
+ btnIcon.ButtonClickEvent += ((sender, e) =>
+ {
+ //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ this.ShowTopRightMenu();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ /// </summary>
+ private void ShowTopRightMenu()
+ {
+ var frame = new TopRightMenuControl(1, 1);
+ //瀹氫綅
+ string deviceMenu = Language.StringByID(R.MyInternationalizationString.uFixedPosition);
+ frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
+ {
+ //鍙戦�佸畾浣嶅姛鑳�
+ Common.LocalDevice.Current.SetFixedPositionCommand(deviceObj);
+ });
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
index 6354ba4..4bfeba7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
@@ -407,19 +407,19 @@
if (listSort.Count == 8)
{
//鍏寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueEightButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueEightButtonTable.png";
this.InitEightButtonPanelIcon(frameBorder, listSort);
}
else if (listSort.Count == 4)
{
//鍥涙寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueFourButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueFourButtonTable.png";
this.InitFourButtonPanelIcon(frameBorder, listSort);
}
else
{
//浜屾寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueTwoButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueTwoButtonTable.png";
this.InitTwoButtonPanelIcon(frameBorder, listSort);
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
index 933a9be..afd919d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
@@ -401,7 +401,7 @@
bodyFrameLayout.AddChidren(frameBorder);
var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
- btnPic.UnSelectedImagePath = "Device/PanelTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelTable.png";
frameBorder.AddChidren(btnPic);
if (listSort.Count == 4)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs
index 0a4211b..29fe305 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs
@@ -370,7 +370,11 @@
}
//寤舵椂
- string strMinute = pirConfigure.transitionTime / 60 + Language.StringByID(R.MyInternationalizationString.uMinute);
+ string strMinute = string.Empty;
+ if (pirConfigure.transitionTime / 60 > 0)
+ {
+ strMinute = pirConfigure.transitionTime / 60 + Language.StringByID(R.MyInternationalizationString.uMinute);
+ }
string strSecond = pirConfigure.transitionTime % 60 + Language.StringByID(R.MyInternationalizationString.uSecond);
var rowDelay = new FrameRowControl(listView.rowSpace / 2);
rowDelay.LeftOffset = Application.GetRealWidth(138) - ControlCommonResourse.XXLeft;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
index 2a6aae0..554ba28 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
@@ -3,7 +3,7 @@
namespace Shared.Phone.UserCenter.DoorLock
{
- public class AddUnLockMethod : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class AddUnLockMethod : DoorLockCommonLayout
{
/// 鏋勯�犲嚱鏁�
/// </summary>
@@ -147,38 +147,5 @@
btnText.MouseUpEventHandler += eHandler;
}
}
-
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
index 07ff554..123a88f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
@@ -5,7 +5,7 @@
namespace Shared.Phone.UserCenter.DoorLock
{
- public class AddUnLockMethodTip : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class AddUnLockMethodTip : DoorLockCommonLayout
{
/// 鏋勯�犲嚱鏁�
/// </summary>
@@ -74,7 +74,6 @@
/// </summary>
public override void RemoveFromParent()
{
- ZbGateway.StatusList.Remove(this);
if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null)
{
doorLock.Gateway.GwResDataAction -= action;
@@ -291,40 +290,5 @@
entryStatusPage.Show();
};
}
-
-
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
index 50f9bfe..4c8f07e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+using Shared.Common;
using ZigBee.Device;
namespace Shared.Phone.UserCenter.DoorLock
@@ -9,6 +10,14 @@
public class DoorLockCommonInfo : CommonDevice
{
#region 鏈湴鍙橀噺
+ /// <summary>
+ /// 鏄惁甯稿紑妯″紡[褰撴暟鎹幏鍙栧け璐ワ紝杩斿洖绌篯
+ /// </summary>
+ public static bool? IsDoorLockNormallyMode = new bool?();
+ /// <summary>
+ /// 甯稿紑妯″紡鏃堕棿
+ /// </summary>
+ public static int NormallyOpenModeInvalidTime = 12;
/// <summary>
/// 鏄惁鏀寔淇敼
/// </summary>
@@ -67,6 +76,69 @@
public static int InValidDateSecond = 0;
#endregion
+ /// <summary>
+ /// 鑾峰彇褰撳墠闂ㄩ攣鐨勫父寮�妯″紡
+ /// </summary>
+ /// <param name="doorLock:褰撳墠闂ㄩ攣"></param>
+ /// <returns></returns>
+ public static async System.Threading.Tasks.Task<bool?> GetNormallyOpenMode(ZigBee.Device.DoorLock doorLock)
+ {
+ var result = await doorLock.ReadNormallyOpenModeFuncAsync();
+ //鍏遍�氶敊璇娴�
+ string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+
+ if (result == null || result.errorMessageBase != null || result.errorResponData != null)
+ {
+ IsDoorLockNormallyMode = null;
+ }
+
+ if (result.command == "10")
+ {
+ IsDoorLockNormallyMode = true;
+ }
+ if (result.command == "11")
+ {
+ IsDoorLockNormallyMode = false;
+ }
+
+ return IsDoorLockNormallyMode;
+ }
+
+ /// <summary>
+ /// 闂ㄩ攣鏄惁鏀寔甯稿紑[杩欓噷鏆傛椂鍙湁S-One闂ㄩ攣鏀寔锛孒06C涓嶆敮鎸�, 鍚庢湡閫氳繃鑳藉姏鍊兼敮鎸乚
+ /// </summary>
+ /// <param name="doorLock:褰撳墠闂ㄩ攣"></param>
+ /// <returns></returns>
+ public static bool CanNormallyOpen(ZigBee.Device.DoorLock doorLock)
+ {
+ var listDevice = new List<CommonDevice> { };
+ listDevice.Add(doorLock);
+ var devTemp = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
+ if (devTemp.ConcreteType == DeviceConcreteType.IntelligentLocks_Sone)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// 闂ㄩ攣鏄惁鏀寔闊抽噺[杩欓噷鏆傛椂鍙湁S-One闂ㄩ攣鏀寔锛孒06C涓嶆敮鎸侊紝鍚庢湡閫氳繃鑳藉姏鍊兼敮鎸乚
+ /// </summary>
+ /// <param name="doorLock:褰撳墠闂ㄩ攣"></param>
+ /// <returns></returns>
+ public static bool CanVolume(ZigBee.Device.DoorLock doorLock)
+ {
+ var listDevice = new List<CommonDevice> { };
+ listDevice.Add(doorLock);
+ var devTemp = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
+ if (devTemp.ConcreteType == DeviceConcreteType.IntelligentLocks_Sone)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ #region 浠庝簯绔幏鍙栫殑鏂规硶
/// <summary>
/// 鑾峰彇褰撳墠璐︽埛闂ㄩ攣鎿嶄綔鏉冮檺锛堟槸鍚﹁鍐荤粨锛�
/// </summary>
@@ -520,24 +592,32 @@
}
var getDoorLockInfoList = await ZigBee.Device.DoorLock.GetDoorLockInfoFromServer("DoorLock/GetDoorLockPager", localDoorLockObj);
- if (getDoorLockInfoList != null)
+
+ if (getDoorLockInfoList == null)
{
- if (getDoorLockInfoList.PageData.Count != 0)
- {
- getDoorLockInfoAllList.Add(getDoorLockInfoList);
- }
+ getDoorLockInfoAllList = null;
}
- if (getDoorLockInfoList.TotalPages > 1)
+ else
{
- for (int j = 1; j < getDoorLockInfoList.TotalPages; j++)
+ if (getDoorLockInfoList != null)
{
- var pageSetting = new ZigBee.Device.DoorLock.PageSetting() { };
- pageSetting.Page = j + 1;
- localDoorLockObj.pageSetting = pageSetting;
- var getDoorLockInfoListTemp = await ZigBee.Device.DoorLock.GetDoorLockInfoFromServer("DoorLock/GetDoorLockPager", localDoorLockObj);
- if (getDoorLockInfoListTemp != null)
+ if (getDoorLockInfoList.PageData.Count != 0)
{
- getDoorLockInfoAllList.Add(getDoorLockInfoListTemp);
+ getDoorLockInfoAllList.Add(getDoorLockInfoList);
+ }
+ }
+ if (getDoorLockInfoList.TotalPages > 1)
+ {
+ for (int j = 1; j < getDoorLockInfoList.TotalPages; j++)
+ {
+ var pageSetting = new ZigBee.Device.DoorLock.PageSetting() { };
+ pageSetting.Page = j + 1;
+ localDoorLockObj.pageSetting = pageSetting;
+ var getDoorLockInfoListTemp = await ZigBee.Device.DoorLock.GetDoorLockInfoFromServer("DoorLock/GetDoorLockPager", localDoorLockObj);
+ if (getDoorLockInfoListTemp != null)
+ {
+ getDoorLockInfoAllList.Add(getDoorLockInfoListTemp);
+ }
}
}
}
@@ -727,5 +807,36 @@
/// </summary>
public string PrimaryId = "";
}
+
+ #endregion
+
+ #region 涓�鑸柟娉�
+ /// <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/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
index 1577b96..08dbd3b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -247,7 +247,7 @@
DateTime oldTime = DateTime.MaxValue;
doorDialog.dialogBtnConfirm.MouseUpEventHandler += async (sender1, e1) =>
{
- Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
if (DateTime.Now < ZigBee.Device.DoorLock.minValue)
{
CommonPage.Loading.Hide();
@@ -355,6 +355,52 @@
}
/// <summary>
+ /// 缁戝畾杩滅▼寮�閿佹潈闄愮獥鍙�
+ /// </summary>
+ /// <param name="doorLock"></param>
+ /// <param name="btnDoorLockTitle"></param>
+ public void BindRemoteUnlockDoorlock(ZigBee.Device.DoorLock doorLock, Button btnDoorLockTitle = null)
+ {
+ string msgRemoteUnlockRequest = Language.StringByID(R.MyInternationalizationString.BindRemoteUnlockDoorlock);
+ var alertRemoteUnlockRequest = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgRemoteUnlockRequest, Language.StringByID(R.MyInternationalizationString.GoSetting));
+ alertRemoteUnlockRequest.Show();
+ //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
+ alertRemoteUnlockRequest.ConfirmClickEvent += () =>
+ {
+ var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ functionSetting.Show();
+ functionSetting.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (btnDoorLockTitle != null)
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ }
+ }
+ };
+ };
+ }
+
+ /// <summary>
+ /// 绯荤粺浜屾纭绐楀彛
+ /// </summary>
+ public void SystemSecondAuthentication()
+ {
+ string msgDoorUnLockByRemote = Language.StringByID(R.MyInternationalizationString.GoPersonalCenter).Replace("{0}", "\r\n");
+ var alertDoorUnLockByRemote = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgDoorUnLockByRemote, Language.StringByID(R.MyInternationalizationString.GoSetting));
+ alertDoorUnLockByRemote.Show();
+ //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
+ alertDoorUnLockByRemote.ConfirmClickEvent += () =>
+ {
+ var form = new UserCenter.UserMain.SecondAuthenticationForm();
+ form.AddForm();
+ };
+ }
+
+ /// <summary>
/// 杩滅▼寮�閿佽姹�
/// </summary>
/// <param name="doorLock">闂ㄩ攣璁惧</param>
@@ -365,41 +411,13 @@
{
if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
{
- string msgRemoteUnlockRequest = Language.StringByID(R.MyInternationalizationString.BindRemoteUnlockDoorlock);
- var alertRemoteUnlockRequest = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgRemoteUnlockRequest, Language.StringByID(R.MyInternationalizationString.GoSetting));
- alertRemoteUnlockRequest.Show();
- //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
- alertRemoteUnlockRequest.ConfirmClickEvent += () =>
- {
- var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- functionSetting.Show();
- functionSetting.devicNameAction += (deviceRename) =>
- {
- if (!string.IsNullOrEmpty(deviceRename))
- {
- if (btnDoorLockTitle != null)
- {
- btnDoorLockTitle.Text = deviceRename;
- }
- }
- };
- };
+ BindRemoteUnlockDoorlock(doorLock, btnDoorLockTitle);
return;
}
if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
{
- string msgDoorUnLockByRemote = Language.StringByID(R.MyInternationalizationString.GoPersonalCenter).Replace("{0}", "\r\n");
- var alertDoorUnLockByRemote = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgDoorUnLockByRemote, Language.StringByID(R.MyInternationalizationString.GoSetting));
- alertDoorUnLockByRemote.Show();
- //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
- alertDoorUnLockByRemote.ConfirmClickEvent += () =>
- {
- var form = new UserCenter.UserMain.SecondAuthenticationForm();
- form.AddForm();
- };
+ SystemSecondAuthentication();
return;
}
@@ -434,7 +452,8 @@
});
//杩滅▼寮�閿�
var remoteControlResult = await doorLock.RemoteControlAsync(doorLock.RemoteUnlockPassword);
- //寮�閿佹垚鍔燂紝杩斿洖榛樿鍝嶅簲
+
+ //杩滅▼寮�閿佹垚鍔燂紝杩斿洖榛樿鍝嶅簲
if (remoteControlResult != null && remoteControlResult.responseData != null)
{
if (remoteControlResult.responseData.status == 0)
@@ -444,80 +463,47 @@
{
if (progressButton != null)
{
- progressButton.Y = Application.GetRealHeight(347);
+ progressButton.Y = Application.GetRealHeight(10);
}
if (btnDoorLockPic != null)
{
- btnDoorLockPic.IsSelected = false;
+ btnDoorLockPic.IsSelected = true;
}
if (btnStatus != null)
{
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.DoorLockOpen);
+ btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.DoorLockOpen);
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnlockSuccess), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
}
});
+ //寮�閿佹垚鍔燂紝榛樿5绉掑悗闂ㄩ攣鑷姩鍏抽攣锛屾牴鎹笉鍚岀殑闂ㄩ攣鍙兘鏃堕棿涓嶅悓锛岃繖閲屼互鈥淗06C鈥濋棬閿佺粰鐨勬椂闂�
System.Threading.Thread.Sleep(5000);
}
else
{
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnlockFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
});
}
}
+ //鐢ㄤ簬杩滅▼寮�閿佺殑闂ㄩ攣涓殑瀵嗙爜琚垹闄ゆ儏鍐�
else if (remoteControlResult != null && remoteControlResult.IsPawDispear == true)
{
+ //杩滅▼寮�閿佹湁3娆¤繛缁搷浣滃け璐ョ殑鏈轰細
ZigBee.Device.DoorLock.failedCount--;
if (ZigBee.Device.DoorLock.failedCount != 0)
{
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnlockFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
});
}
else
{
+ //3娆℃搷浣滃け璐ヨ繙绋嬪紑閿佸け璐ュ悗锛岄噸鍐欒缃繙绋嬪紑閿佸瘑鐮�
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.DoorlockPasswordDispear), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
- CommonPage.Loading.Hide();
doorLock.RemoteUnlockPassword = "";
var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
@@ -536,22 +522,11 @@
});
}
}
+ //杩滅▼寮�閿佸け璐ョ殑鎯呭喌
else
{
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
});
}
@@ -561,9 +536,17 @@
{
Application.RunOnMainThread(() =>
{
+ if (progressButton != null)
+ {
+ progressButton.Y = Application.GetRealHeight(347);
+ }
+ if (btnDoorLockPic != null)
+ {
+ btnDoorLockPic.IsSelected = false;
+ }
if (btnStatus != null)
{
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
+ btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.CLose);
}
CommonPage.Loading.Hide();
});
@@ -626,5 +609,35 @@
}
}
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鏄剧ず閿欒淇℃伅绐楀彛
+ /// </summary>
+ /// <param name="msg"></param>
+ public void ShowErrorMsg(string msg)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var contr = new ShowMsgControl(ShowMsgType.Error, msg);
+ contr.Show();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ずTip淇℃伅绐楀彛
+ /// </summary>
+ /// <param name="msg"></param>
+ public void ShowTipMsg(string msg)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
+ contr.Show();
+ CommonPage.Loading.Hide();
+ });
+ }
+
+ #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
index 0217b3a..aee5ff4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
@@ -8,7 +8,7 @@
namespace Shared.Phone.UserCenter.DoorLock
{
- public class EntryStatusPage : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class EntryStatusPage : DoorLockCommonLayout
{
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -343,39 +343,5 @@
}
};
}
-
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
index 99766b2..aba9c27 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -5,7 +5,7 @@
namespace Shared.Phone.UserCenter.DoorLock
{
- public class FunctionSetting : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class FunctionSetting : DoorLockCommonLayout
{
#region 鏋勯�犲嚱鏁�
/// <summary>
@@ -18,7 +18,6 @@
this.doorLock = doorLock;
listNewDevice.Add(doorLock);
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
- ZigBee.Device.ZbGateway.StatusList.Add(this);
}
#endregion
@@ -463,40 +462,6 @@
listview.AddChidren(frameTemp);
}
}
- }
- #endregion
-
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
}
#endregion
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs
index b49e762..b1fb776 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs
@@ -3,7 +3,7 @@
using ZigBee.Device;
namespace Shared.Phone.UserCenter.DoorLock
{
- public class MasterManagementPage : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class MasterManagementPage : DoorLockCommonLayout
{
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -164,39 +164,5 @@
btnMemberName.MouseUpEventHandler += eHandler;
}
}
-
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
index 3947cb4..141413a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
@@ -5,7 +5,7 @@
using ZigBee.Device;
namespace Shared.Phone.UserCenter.DoorLock
{
- public class MemberFrozenPage : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class MemberFrozenPage : DoorLockCommonLayout
{
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -783,39 +783,5 @@
});
};
}
-
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs
new file mode 100755
index 0000000..366e7e6
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs
@@ -0,0 +1,375 @@
+锘縰sing System;
+using System.Text;
+using System.Text.RegularExpressions;
+using Shared.Common;
+
+namespace Shared.Phone.UserCenter.DoorLock
+{
+ /// <summary>
+ /// 鏄剧ず涓�涓俊鎭
+ /// </summary>
+ public class ShowDoorLockMsgControl
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+ public Action<string> InvalidTimeAction = null;
+ /// <summary>
+ /// 鐐瑰嚮鍙栨秷鐨勪簨浠�
+ /// </summary>
+ public Action CancelClickEvent = null;
+ /// <summary>
+ /// 鐐瑰嚮鑷姩鍖栫殑浜嬩欢
+ /// </summary>
+ public Action LogicClickEvent = null;
+ /// <summary>
+ /// 鐐瑰嚮纭鐨勪簨浠�
+ /// </summary>
+ public Action InvalidClickEvent = null;
+ /// <summary>
+ /// 鐐瑰嚮纭鐨勪簨浠�
+ /// </summary>
+ public Action ConfirmClickEvent = null;
+ /// <summary>
+ /// 淇℃伅绫诲瀷
+ /// </summary>
+ private DoorLockMsgType msgType = DoorLockMsgType.Confirm;
+ /// <summary>
+ /// 娑堟伅
+ /// </summary>
+ private string msgText = string.Empty;
+ /// <summary>
+ /// 纭鎸夐挳鐨勬枃鏈�
+ /// </summary>
+ private string buttonOkText = null;
+ /// <summary>
+ /// 澶辨晥鏃堕棿缂栬緫
+ /// </summary>
+ private EditText editInvalidTime = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鏄剧ず涓�涓渶瑕佺‘璁ょ殑淇℃伅妗�
+ /// </summary>
+ /// <param name="i_msgType">淇℃伅绫诲瀷</param>
+ /// <param name="i_msg">淇℃伅</param>
+ /// <param name="buttonText">纭鎸夐挳鐨勬枃鏈�</param>
+ public ShowDoorLockMsgControl(DoorLockMsgType i_msgType, string i_msg, string buttonText = null)
+ {
+ //纭鎸夐挳鏂囨湰
+ this.buttonOkText = buttonText == null ? Language.StringByID(R.MyInternationalizationString.OkMsg) : buttonText;
+ this.msgType = i_msgType;
+ this.msgText = i_msg;
+ }
+
+ #endregion
+
+ #region 鈻� 鏄剧ず娑堟伅___________________________
+
+ /// <summary>
+ /// 鏄剧ず
+ /// </summary>
+ public void Show()
+ {
+ try
+ {
+ //鍒濆鍖栨帶浠�
+ this.InitMsgControl();
+ }
+ catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栨帶浠禵________________________
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ private void InitMsgControl()
+ {
+ //娣诲姞鐣岄潰
+ var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
+ if (nowForm == null || (nowForm is ViewGroup) == false)
+ {
+ return;
+ }
+ //涓绘帶浠�
+ var frameMain = new FrameLayout();
+ frameMain.BackgroundColor = UserCenterColor.Current.DialogBackColor;
+ ((ViewGroup)nowForm).AddChidren(frameMain);
+
+ //鐧借壊鑳屾櫙妗�
+ var frameBack = new FrameLayout();
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Gravity = Gravity.CenterHorizontal;
+ frameBack.Radius = (uint)Application.GetRealHeight(17);
+ if (msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic)
+ {
+ frameBack.Height = Application.GetRealHeight(409 + 127);
+ frameBack.Width = Application.GetRealWidth(850);
+ frameBack.Y = Application.GetRealHeight(648);
+ }
+ else
+ {
+ frameBack.Height = Application.GetRealHeight(478);
+ frameBack.Width = Application.GetRealWidth(792);
+ frameBack.Y = Application.GetRealHeight(706);
+ }
+ frameMain.AddChidren(frameBack);
+
+ //鏍囬
+ var btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(65), false);
+ btnTitle.Y = Application.GetRealHeight(68);
+ btnTitle.TextColor = 0xff333443;
+ btnTitle.TextAlignment = TextAlignment.Center;
+ btnTitle.TextSize = 16;
+ frameBack.AddChidren(btnTitle);
+ if (msgType == DoorLockMsgType.Confirm || msgType == DoorLockMsgType.DoorLockLogic || msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic)
+ {
+ btnTitle.TextID = R.MyInternationalizationString.NormalTip;
+ }
+ else if (msgType == DoorLockMsgType.InValid)
+ {
+ btnTitle.TextID = R.MyInternationalizationString.DoorLockInValidSetting;
+ }
+ else if (msgType == DoorLockMsgType.NomallyOpenMode)
+ {
+ btnTitle.TextID = R.MyInternationalizationString.CancelNomallyMode;
+ }
+
+ if (msgType == DoorLockMsgType.InValid)
+ {
+ InitInValidTimeDialog(frameBack);
+ }
+ else if (msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic)
+ {
+ CancelNormallyOpenModeWithLogicDialog(frameBack);
+ }
+ else
+ {
+ //娑堟伅
+ var btnMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(180), false);
+ btnMsg.Y = Application.GetRealHeight(141);
+ btnMsg.IsMoreLines = true;
+ btnMsg.TextAlignment = TextAlignment.Center;
+ btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnMsg.Gravity = Gravity.CenterHorizontal;
+ frameBack.AddChidren(btnMsg);
+ btnMsg.Text = msgText;
+ }
+
+ if (msgType == DoorLockMsgType.Confirm || msgType == DoorLockMsgType.InValid || msgType == DoorLockMsgType.NomallyOpenMode)
+ {
+ //鍒濆鍖栫‘璁ょ被鍨嬬殑搴曢儴鎸夐挳
+ this.InitBottomConfirmButton(frameMain, frameBack);
+ }
+ else if (msgType == DoorLockMsgType.DoorLockLogic || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic)
+ {
+ //澶辨晥璁剧疆鐨勫簳閮ㄦ寜閽�
+ this.InitBottomLogicButton(frameMain, frameBack);
+ }
+ }
+
+ /// <summary>
+ /// 鍙栨秷甯稿紑妯″紡甯︽湁鑷姩鍖栫殑寮圭獥鏄剧ず
+ /// </summary>
+ /// <param name="frameMain"></param>
+ /// <param name="frameBack"></param>
+ private void CancelNormallyOpenModeWithLogicDialog(FrameLayout frameBack)
+ {
+ //娑堟伅
+ var btnMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(63), false);
+ btnMsg.Y = Application.GetRealHeight(173);
+ btnMsg.IsMoreLines = true;
+ btnMsg.TextAlignment = TextAlignment.Center;
+ btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnMsg.Gravity = Gravity.CenterHorizontal;
+ frameBack.AddChidren(btnMsg);
+ btnMsg.Text = msgText;
+
+ var alarmMsg = Language.StringByID(R.MyInternationalizationString.XingTip);//.Replace("{0}", "\r\n");
+ var btnAlarmMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(104), false);
+ btnAlarmMsg.Y = Application.GetRealHeight(259);
+ btnAlarmMsg.IsMoreLines = true;
+ btnAlarmMsg.TextAlignment = TextAlignment.Center;
+ btnAlarmMsg.TextColor = ZigbeeColor.Current.XMAlarmText;
+ btnAlarmMsg.Gravity = Gravity.CenterHorizontal;
+ frameBack.AddChidren(btnAlarmMsg);
+ btnAlarmMsg.Text = alarmMsg;
+ }
+
+ /// <summary>
+ /// 澶辨晥鏃堕棿璁剧疆鐨勫脊绐楁樉绀�
+ /// </summary>
+ /// <param name="frameMain"></param>
+ /// <param name="frameBack"></param>
+ private void InitInValidTimeDialog(FrameLayout frameBack)
+ {
+ //娑堟伅
+ string[] msgArray = msgText.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+ var btnMsg1 = new Button()
+ {
+ Width = Application.GetRealWidth(389),
+ Height = Application.GetRealHeight(180),
+ Y = Application.GetRealHeight(141),
+ IsMoreLines = false,
+ TextColor = UserCenterColor.Current.TextGrayColor1,
+ TextAlignment = TextAlignment.CenterRight,
+ Text = msgArray[0],
+ };
+ frameBack.AddChidren(btnMsg1);
+
+ //澶辨晥鏃堕棿璁剧疆
+ var editTextFrameLayout = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(132),
+ Height = Application.GetRealHeight(81 + 40 * 2),
+ Y = Application.GetRealHeight(184 - 40),
+ X = btnMsg1.Right,
+ };
+ frameBack.AddChidren(editTextFrameLayout);
+ editInvalidTime = new EditText()
+ {
+ Height = Application.GetRealHeight(81),
+ X = Application.GetRealWidth(132),
+ Y = Application.GetRealHeight(40),
+ Gravity = Gravity.Center,
+ Radius = (uint)Application.GetMinRealAverage(17),
+ BackgroundColor = ZigbeeColor.Current.XMPEditTextBackground,
+ TextColor = ZigbeeColor.Current.XMBlack,
+ TextAlignment = TextAlignment.Center,
+ TextSize = 14,
+ Text = DoorLockCommonInfo.NormallyOpenModeInvalidTime.ToString(),
+ PlaceholderTextColor = ZigbeeColor.Current.XMGray3,
+ };
+ editTextFrameLayout.AddChidren(editInvalidTime);
+
+ var btnMsg2 = new Button()
+ {
+ Width = Application.GetRealWidth(271),
+ Height = Application.GetRealHeight(180),
+ Y = Application.GetRealHeight(141),
+ X = editTextFrameLayout.Right,
+ IsMoreLines = false,
+ TextColor = UserCenterColor.Current.TextGrayColor1,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = msgArray[1]
+ };
+ frameBack.AddChidren(btnMsg2);
+ }
+
+ /// <summary>
+ /// 澶辨晥璁剧疆鐨勫簳閮ㄦ寜閽�
+ /// </summary>
+ /// <param name="frameMain"></param>
+ /// <param name="frameBack"></param>
+ private void InitBottomLogicButton(FrameLayout frameMain, FrameLayout frameBack)
+ {
+ //鑷姩鍖栨寜閽�
+ var btnDoorLockLogic = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127));
+ frameBack.AddChidren(btnDoorLockLogic);
+ btnDoorLockLogic.InitControl(Language.StringByID(R.MyInternationalizationString.DoorLockLogic));
+ btnDoorLockLogic.ButtonClickEvent += (sender, e) =>
+ {
+ //绉婚櫎鐣岄潰
+ frameMain.RemoveFromParent();
+ //鍥炶皟鍑芥暟
+ this.LogicClickEvent?.Invoke();
+ this.LogicClickEvent = null;
+ };
+
+ //澶辨晥璁剧疆鎸夐挳
+ var btnInvalid = new BottomRightClickButton(frameBack.Width - btnDoorLockLogic.Width, btnDoorLockLogic.Height);
+ frameBack.AddChidren(btnInvalid);
+ btnInvalid.InitControl(buttonOkText);
+ btnInvalid.ButtonClickEvent += (sender, e) =>
+ {
+ //绉婚櫎鐣岄潰
+ frameMain.RemoveFromParent();
+ //鍥炶皟鍑芥暟
+ this.InvalidClickEvent?.Invoke();
+ this.InvalidClickEvent = null;
+ };
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栫‘璁ょ被鍨嬬殑搴曢儴鎸夐挳
+ /// </summary>
+ /// <param name="frameMain"></param>
+ /// <param name="frameBack"></param>
+ private void InitBottomConfirmButton(FrameLayout frameMain, FrameLayout frameBack)
+ {
+ //鍙栨秷鎸夐挳
+ var btnCancel = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127));
+ frameBack.AddChidren(btnCancel);
+ var bottomLeftText = Language.StringByID(R.MyInternationalizationString.uCancel);
+ if (msgType == DoorLockMsgType.NomallyOpenMode)
+ {
+ bottomLeftText = Language.StringByID(R.MyInternationalizationString.KeepNomallyMode);
+ }
+ btnCancel.InitControl(bottomLeftText);
+ btnCancel.ButtonClickEvent += (sender, e) =>
+ {
+ //绉婚櫎鐣岄潰
+ frameMain.RemoveFromParent();
+ //鍥炶皟鍑芥暟
+ this.CancelClickEvent?.Invoke();
+ this.CancelClickEvent = null;
+ };
+
+ //纭畾鎸夐挳
+ var btnConfirm = new BottomRightClickButton(frameBack.Width - btnCancel.Width, btnCancel.Height);
+ frameBack.AddChidren(btnConfirm);
+ btnConfirm.InitControl(buttonOkText);
+ btnConfirm.ButtonClickEvent += (sender, e) =>
+ {
+ //绉婚櫎鐣岄潰
+ frameMain.RemoveFromParent();
+ if (msgType == DoorLockMsgType.InValid)
+ {
+ if (InvalidTimeAction != null)
+ {
+ InvalidTimeAction(editInvalidTime.Text);
+ }
+ }
+ else
+ {
+ //鍥炶皟鍑芥暟
+ this.ConfirmClickEvent?.Invoke();
+ this.ConfirmClickEvent = null;
+ }
+ };
+ }
+
+ #endregion
+
+ /// <summary>
+ /// 淇℃伅鏄剧ず鐨勭被鍨�
+ /// </summary>
+ public enum DoorLockMsgType
+ {
+ /// <summary>
+ /// 纭绫诲瀷
+ /// </summary>
+ Confirm = 1,
+ /// <summary>
+ /// 澶辨晥璁剧疆
+ /// </summary>
+ InValid = 2,
+ /// <summary>
+ /// 閫昏緫绫诲瀷
+ /// </summary>
+ DoorLockLogic = 3,
+ /// <summary>
+ /// 甯稿紑妯″紡
+ /// </summary>
+ NomallyOpenMode = 4,
+ /// <summary>
+ /// 鍙栨秷甯︽湁閫昏緫鐨勫父寮�妯″紡
+ /// </summary>
+ CancelNomallyOpenModeWithLogic = 5,
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
index 6e5ce47..cd8183c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
@@ -6,7 +6,7 @@
namespace Shared.Phone.UserCenter.DoorLock
{
- public class TemporaryPassword : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class TemporaryPassword : DoorLockCommonLayout
{
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -16,7 +16,6 @@
{
this.doorLock = doorLock;
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
- ZigBee.Device.ZbGateway.StatusList.Add(this);
}
#region 鍙橀噺鐢虫槑
@@ -983,39 +982,5 @@
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);
}
-
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
index 424eb2f..8e98169 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
@@ -7,6 +7,7 @@
{
public class TimeSettignPage : DoorLockCommonLayout, ZigBee.Common.IStatus
{
+ #region 涓婃姤鏁版嵁澶勭悊
/// <summary>
/// 澶勭悊鍙樺寲浜嬩欢
/// </summary>
@@ -47,7 +48,9 @@
}
}
}
+ #endregion
+ #region 鏋勯�犲嚱鏁�
/// <summary>
/// 鏋勯�犲嚱鏁�
/// </summary>
@@ -59,7 +62,9 @@
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
ZigBee.Device.ZbGateway.StatusList.Add(this);
}
+ #endregion
+ #region UI鍐呭
#region 鍙橀噺鐢虫槑
/// <summary>
/// 褰撳墠闂ㄩ攣
@@ -116,15 +121,6 @@
#endregion
/// <summary>
- /// 閲嶅啓绉婚櫎鏂规硶
- /// </summary>
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- base.RemoveFromParent();
- }
-
- /// <summary>
/// UI鏄剧ず
/// </summary>
public void Show()
@@ -151,6 +147,7 @@
this.MidFrameLayout(this);
MidFrameLayoutContent();
}
+
/// <summary>
/// 涓儴甯冨眬
/// </summary>
@@ -158,34 +155,30 @@
{
if (setTimeType == "DoorLockTime")
{
- CommonPage.Loading.Start("");
- // 鍙湁閲嶆柊鍚姩鏃朵細鎱紝鐒跺悗鍏朵粬鏃跺埢閮芥槸鏈夊�肩殑
- new System.Threading.Thread(() =>
- {
- while (this.Parent != null)
- {
- if (DateTime.Now > waitGetDoorLockTime)
- {
- Application.RunOnMainThread(() =>
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
- CommonPage.Loading.Hide();
- });
- }
- //璇婚棬閿佹椂闂�
- //绛夊緟10绉掞紝娌℃湁鏀跺埌鎻愮ず瓒呮椂閫�鍑�
- waitGetDoorLockTime = DateTime.Now.AddSeconds(+5);
- doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock);
- System.Threading.Thread.Sleep(5 * 1000);
- }
- })
- { IsBackground = true }.Start();
+ ReadDoorlockTime();
}
- var MidTopFrameLayout = new FrameLayout()
+ var zoneFrameLayout = new FrameLayout()
{
+ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
};
- this.midFrameLayout.AddChidren(MidTopFrameLayout);
+ this.midFrameLayout.AddChidren(zoneFrameLayout);
+
+ if (setTimeType == "DoorLockTime")
+ {
+ zoneFrameLayout.Height = Application.GetRealHeight(150) + 1;
+ AddDoorLocksTimeRow(zoneFrameLayout);
+ }
+ else
+ {
+ zoneFrameLayout.Height = Application.GetRealHeight(0);
+ }
+
+ var midTopFrameLayout = new FrameLayout()
+ {
+ Y = zoneFrameLayout.Bottom,
+ };
+ this.midFrameLayout.AddChidren(midTopFrameLayout);
var dtNow = DateTime.Now;
for (int i = 0; i < 2; i++)
@@ -196,7 +189,7 @@
Height = Application.GetRealHeight(127 + 23),
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
};
- MidTopFrameLayout.AddChidren(rowLayout);
+ midTopFrameLayout.AddChidren(rowLayout);
var btnDateTime = new Button()
{
@@ -241,7 +234,7 @@
X = Application.GetRealWidth(58),
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
};
- MidTopFrameLayout.AddChidren(btnLine);
+ midTopFrameLayout.AddChidren(btnLine);
#endregion
#region 鏄剧ず澶勭悊
@@ -328,296 +321,7 @@
int curIndex = i;
EventHandler<MouseEventArgs> hander = (sender, e) =>
{
- this.midFrameLayout.AddChidren(this.shadowRadiusFrameLayout);
- this.bottomRadiusFrameLayout.RemoveAll();
- this.BottomRadiusFrameLayout(this);
- var mUIPickerView = new UIPickerView()
- {
- X = Application.GetRealWidth(0),
- Height = Application.GetRealHeight(440),
- };
- this.bottomRadiusFrameLayout.AddChidren(mUIPickerView);
-
- if (curIndex == 0)
- {
- //鏃ユ湡
- if (setTimeType != "DoorLockTime")
- {
- this.btnBottomTitle.TextID = R.MyInternationalizationString.Date;
- }
- else
- {
- this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentDate;
- }
-
- mUIPickerView.Y = Application.GetRealWidth(245);
- var mList1 = new List<string>();
- var mList2 = new List<string>();
- var mList3 = new List<string>();
- var oldMonth = dtNow.Month;
-
- int year = dtNow.Year + 1;
- int days = DateTime.DaysInMonth(dtNow.Year, dtNow.Month);
-
- for (int y = dtNow.Year - 9; y < dtNow.Year + 1; y++)
- {
- mList1.Add(y.ToString());
- }
- for (int m = 1; m < 13; m++)
- {
- if (Language.CurrentLanguage == "Chinese")
- {
- mList2.Add(m.ToString() + "鏈�");
- }
- else
- {
- mList2.Add(m.ToString());
- }
- }
- for (int d = 1; d < days + 1; d++)
- {
- if (Language.CurrentLanguage == "Chinese")
- {
- mList3.Add(d.ToString() + "鏃�");
- }
- else
- {
- mList3.Add(d.ToString());
- }
- }
-
- if (setTimeType != "DoorLockTime")
- {
- mUIPickerView.setNPicker(mList2, mList3, null);
- mUIPickerView.setCurrentItems(dtNow.Month - 1, dtNow.Day - 1, 0);
- curMonth = dtNow.Month;
- curDay = dtNow.Day;
-
- if (setTimeType == "ValidTime")
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateYear = dtNow.Year;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth = curMonth;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay = curDay;
- }
- else
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateYear = dtNow.Year;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth = curMonth;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay = curDay;
- }
- var btnOk = new Button
- {
- X = Application.GetRealWidth(919),
- Y = Application.GetRealHeight(40),
- Height = Application.GetRealHeight(58),
- Width = Application.GetRealWidth(101),
- Text = Language.StringByID(R.MyInternationalizationString.Complete),
- TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
- TextSize = 14,
- };
- this.bottomRadiusFrameLayout.AddChidren(btnOk);
- btnOk.MouseUpEventHandler += (sender1, e1) =>
- {
- if (setTimeType == "ValidTime")
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateYear = dtNow.Year;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth = curMonth;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay = curDay;
- }
- else
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateYear = dtNow.Year;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth = curMonth;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay = curDay;
- }
- if (timeSetAction != null)
- {
- timeSetAction();
- }
- this.shadowRadiusFrameLayout.RemoveFromParent();
- MidFrameLayoutContent();
- };
- }
- else
- {
- mUIPickerView.setNPicker(mList1, mList2, mList3);
- mUIPickerView.setCurrentItems(9, dtNow.Month - 1, dtNow.Day - 1);
- curYear = dtNow.Year;
- curMonth = dtNow.Month;
- curDay = dtNow.Day;
- if (CurentDoorLockTime != null)
- {
- curHour = CurentDoorLockTime.Hour;
- curMin = CurentDoorLockTime.Minute;
- curSec = CurentDoorLockTime.Second;
- }
- else
- {
- curHour = dtNow.Hour;
- curMin = dtNow.Minute;
- curSec = dtNow.Second;
- }
- }
-
- Action dAction = () =>
- {
- if (curMonth != oldMonth)
- {
- oldMonth = curMonth;
- days = DateTime.DaysInMonth(curYear, curMonth);
- mList3.Clear();
-
- for (int d = 1; d < days + 1; d++)
- {
- if (Language.CurrentLanguage == "Chinese")
- {
- mList3.Add(d.ToString() + "鏃�");
- }
- else
- {
- mList3.Add(d.ToString());
- }
- }
-
- if (setTimeType != "DoorLockTime")
- {
- mUIPickerView.setNPicker(mList2, mList3, null);
- mUIPickerView.setCurrentItems(curMonth - 1, curDay - 1, 0);
- }
- else
- {
- mUIPickerView.setNPicker(mList1, mList2, mList3);
- mUIPickerView.setCurrentItems(9, curMonth - 1, curDay - 1);
- }
- }
- };
- mUIPickerView.OnSelectChangeEvent += (y, m, d) =>
- {
- if (setTimeType != "DoorLockTime")
- {
- curYear = dtNow.Year;
- curMonth = y + 1;
- curDay = m + 1;
- }
- else
- {
- curYear = y + 2009;
- curMonth = m + 1;
- curDay = d + 1;
- }
- dAction();
- };
- }
- if (curIndex == 1)
- {
- //鏃堕棿
- if (setTimeType != "DoorLockTime")
- {
- this.btnBottomTitle.TextID = R.MyInternationalizationString.Time;
- }
- else
- {
- this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentTime;
- }
-
- mUIPickerView.Y = Application.GetRealWidth(245);
- var mList1 = new List<string>();
- var mList2 = new List<string>();
- for (int h = 0; h < 24; h++)
- {
- if (h < 10)
- {
- mList1.Add("0" + h.ToString());
- }
- else
- {
- mList1.Add(h.ToString());
- }
- }
- for (int m = 0; m < 60; m++)
- {
- if (m < 10)
- {
- mList2.Add("0" + m.ToString());
- }
- else
- {
- mList2.Add(m.ToString());
- }
- }
- mUIPickerView.setNPicker(mList1, mList2, null);
- mUIPickerView.setCurrentItems(dtNow.Hour, dtNow.Minute, 0);
- if (CurentDoorLockTime != null)
- {
- curYear = CurentDoorLockTime.Year;
- curMonth = CurentDoorLockTime.Month;
- curDay = CurentDoorLockTime.Day;
- }
- else
- {
- curYear = dtNow.Year;
- curMonth = dtNow.Month;
- curDay = dtNow.Day;
- }
- curHour = dtNow.Hour;
- curMin = dtNow.Minute;
- curSec = dtNow.Second;
- mUIPickerView.OnSelectChangeEvent += (h, m, s) =>
- {
- curHour = h;
- curMin = m;
- curSec = dtNow.Second;
- };
-
- if (setTimeType == "ValidTime")
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour = curHour;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute = curMin;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateSecond = curSec;
- }
- else
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour = curHour;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute = curMin;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateSecond = curSec;
- }
-
- if (setTimeType != "DoorLockTime")
- {
- var btnOk = new Button
- {
- X = Application.GetRealWidth(919),
- Y = Application.GetRealHeight(40),
- Height = Application.GetRealHeight(58),
- Width = Application.GetRealWidth(101),
- Text = Language.StringByID(R.MyInternationalizationString.Complete),
- TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
- TextSize = 14,
- };
- this.bottomRadiusFrameLayout.AddChidren(btnOk);
- btnOk.MouseUpEventHandler += (sender1, e1) =>
- {
- if (setTimeType == "ValidTime")
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour = curHour;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute = curMin;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateSecond = curSec;
- }
- else
- {
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour = curHour;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute = curMin;
- Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateSecond = curSec;
- }
- if (timeSetAction != null)
- {
- timeSetAction();
- }
- this.shadowRadiusFrameLayout.RemoveFromParent();
- MidFrameLayoutContent();
- };
- }
- }
+ ClickHandle(curIndex, dtNow);
};
rowLayout.MouseDownEventHandler += hander;
btnDateTime.MouseDownEventHandler += hander;
@@ -640,54 +344,17 @@
{
this.shadowRadiusFrameLayout.RemoveFromParent();
};
- btnFinish.MouseUpEventHandler += (sender1, e1) =>
+ btnFinish.MouseUpEventHandler += (sender1, e1) =>
{
if (setTimeType == "DoorLockTime")
- {
- System.Threading.Tasks.Task.Run(async () => {
- try
- {
- var curDateTime = new DateTime(curYear, curMonth, curDay, curHour, curMin, curSec);
- var setTimestamp = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetUnixTimeStamp(curDateTime);
- Application.RunOnMainThread(() => {
- CommonPage.Loading.Start("");
- });
- var rectifyResult = await doorLock.RectifyDoorLockTimeAsync(int.Parse(setTimestamp));
- if (rectifyResult != null && rectifyResult.setWritableValueResponData != null)
- {
- Application.RunOnMainThread(() => {
- if (rectifyResult.setWritableValueResponData.Status == 0)
- {
- doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock);
- System.Threading.Thread.Sleep(1000);
- this.shadowRadiusFrameLayout.RemoveFromParent();
- }
- else
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
- }
- });
- }
- else
- {
- Application.RunOnMainThread(() => {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
- });
- }
- }
- catch { }
- finally
- {
- Application.RunOnMainThread(() => { CommonPage.Loading.Hide(); });
- }
- });
+ {
+ DoorLockTimeFinishHandle();
}
};
this.shadowRadiusFrameLayout.MouseUpEventHandler += (sender1, e1) =>
{
this.shadowRadiusFrameLayout.RemoveFromParent();
};
-
if (setTimeType == "DoorLockTime")
{
if (CurentDoorLockTime != null && CurentDoorLockTime.Year != 1)
@@ -697,30 +364,548 @@
}
}
}
+ #endregion
- #region 鎺ュ彛瀹炵幇
+ #region 鏃跺尯
/// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
+ /// 娣诲姞銆愰棬閿佹椂闂淬�戣锛堥棬閿佷笓鐢級
/// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
+ private void AddDoorLocksTimeRow(FrameLayout zoneFrameLayout)
{
+ //闂ㄩ攣鏃堕棿
+ var rowLayout = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(150),
+ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+ };
+ zoneFrameLayout.AddChidren(rowLayout);
+
+ //褰撳墠鏃跺尯
+ var btnCurZone = new Button()
+ {
+ Width = Application.GetRealWidth(560),
+ Height = Application.GetRealHeight(58),
+ X = Application.GetRealWidth(58),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextSize = 12,
+ Y = Application.GetRealHeight(46),
+ Text = Language.StringByID(R.MyInternationalizationString.CurZone),
+ };
+ rowLayout.AddChidren(btnCurZone);
+
+ //鍝釜鏃跺尯
+ var textZone = new Button()
+ {
+ Width = Application.GetRealWidth(333),
+ Height = Application.GetRealHeight(58),
+ X = Application.GetRealWidth(689),
+ Y = Application.GetRealHeight(46),
+ TextAlignment = TextAlignment.CenterRight,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray4,
+ TextSize = 14,
+ };
+ rowLayout.AddChidren(textZone);
+ textZone.Text = zoneData();
+ textZone.MouseDownEventHandler += (sender, e) =>
+ {
+ GetSpecificZoneNowDate();
+ };
+
+ var btnLine = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(965),
+ Height = 1,
+ X = Application.GetRealWidth(58),
+ Y = Application.GetRealHeight(150),
+ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
+ };
+ zoneFrameLayout.AddChidren(btnLine);
+ }
+
+ /// <summary>
+ /// 鏃跺尯鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ private string zoneData()
+ {
+ string zoneText = "";
+ var gwZone = caculateTimeZone(Common.Config.Instance.Home.Longitude);
+ if (gwZone.Contains('+'))
+ {
+ zoneText = Language.StringByID(R.MyInternationalizationString.East);
+ }
+ else
+ {
+ zoneText = Language.StringByID(R.MyInternationalizationString.West);
+ }
+ var num = ToNum(int.Parse(gwZone));
+ return zoneText += num + Language.StringByID(R.MyInternationalizationString.CurZoneText);
+ }
+
+ /// <summary>
+ /// 鑾峰彇鏃跺尯
+ /// <para>currentLon:"+"涓轰笢鍖猴紝鈥�-鈥濅负瑗垮尯</para>
+ /// </summary>
+ 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>
+ /// 杞崲鏁板瓧
+ /// </summary>
+ private string ToNum(int x)
+ {
+ var numString = new string[] { "闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�", "鍗�", "鍗佷竴", "鍗佷簩" };
+ var strChnNamesList = new List<string>(numString);
+ return strChnNamesList[x];
+ }
+
+ //濡備綍鏄剧ず鏃跺尯鎵�鍦ㄧ殑鏃堕棿
+ 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
+
+ #region 闂ㄩ攣鏃堕棿
+ /// <summary>
+ /// 璇诲彇闂ㄩ攣鏃堕棿
+ /// </summary>
+ private void ReadDoorlockTime()
+ {
+ CommonPage.Loading.Start("");
+ // 鍙湁閲嶆柊鍚姩鏃朵細鎱紝鐒跺悗鍏朵粬鏃跺埢閮芥槸鏈夊�肩殑
+ new System.Threading.Thread(() =>
+ {
+ while (this.Parent != null)
+ {
+ if (DateTime.Now > waitGetDoorLockTime)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
+ CommonPage.Loading.Hide();
+ });
+ }
+ //璇婚棬閿佹椂闂�
+ //绛夊緟10绉掞紝娌℃湁鏀跺埌鎻愮ず瓒呮椂閫�鍑�
+ waitGetDoorLockTime = DateTime.Now.AddSeconds(+5);
+ doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock);
+ System.Threading.Thread.Sleep(5 * 1000);
+ }
+ })
+ { IsBackground = true }.Start();
+ }
+
+ /// <summary>
+ /// 闂ㄩ攣鏃堕棿纭鎸夐挳澶勭悊
+ /// </summary>
+ private void DoorLockTimeFinishHandle()
+ {
+ System.Threading.Tasks.Task.Run(async () =>
+ {
+ try
+ {
+ var curDateTime = new DateTime(curYear, curMonth, curDay, curHour, curMin, curSec);
+ var setTimestamp = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetUnixTimeStamp(curDateTime);
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Start("");
+ });
+ var rectifyResult = await doorLock.RectifyDoorLockTimeAsync(int.Parse(setTimestamp));
+ if (rectifyResult != null && rectifyResult.setWritableValueResponData != null)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ if (rectifyResult.setWritableValueResponData.Status == 0)
+ {
+ doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock);
+ System.Threading.Thread.Sleep(1000);
+ this.shadowRadiusFrameLayout.RemoveFromParent();
+ }
+ else
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
+ }
+ });
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
+ });
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Hide(); });
+ }
+ });
}
+ #endregion
+
+ #region 鍏叡浜嬩欢澶勭悊
/// <summary>
- /// Changeds the IL ogic status.
+ /// 浜嬩欢澶勭悊
/// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
+ private void ClickHandle(int curIndex, DateTime dtNow)
{
+ this.midFrameLayout.AddChidren(this.shadowRadiusFrameLayout);
+ this.bottomRadiusFrameLayout.RemoveAll();
+ this.BottomRadiusFrameLayout(this);
+ var mUIPickerView = new UIPickerView()
+ {
+ X = Application.GetRealWidth(0),
+ Height = Application.GetRealHeight(440),
+ };
+ this.bottomRadiusFrameLayout.AddChidren(mUIPickerView);
+
+ if (curIndex == 0)
+ {
+ //鏃ユ湡
+ if (setTimeType != "DoorLockTime")
+ {
+ this.btnBottomTitle.TextID = R.MyInternationalizationString.Date;
+ }
+ else
+ {
+ this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentDate;
+ }
+
+ mUIPickerView.Y = Application.GetRealWidth(245);
+ var mList1 = new List<string>();
+ var mList2 = new List<string>();
+ var mList3 = new List<string>();
+ var oldMonth = dtNow.Month;
+
+ int year = dtNow.Year + 1;
+ int days = DateTime.DaysInMonth(dtNow.Year, dtNow.Month);
+
+ for (int y = dtNow.Year - 9; y < dtNow.Year + 1; y++)
+ {
+ mList1.Add(y.ToString());
+ }
+ for (int m = 1; m < 13; m++)
+ {
+ if (Language.CurrentLanguage == "Chinese")
+ {
+ mList2.Add(m.ToString() + "鏈�");
+ }
+ else
+ {
+ mList2.Add(m.ToString());
+ }
+ }
+ for (int d = 1; d < days + 1; d++)
+ {
+ if (Language.CurrentLanguage == "Chinese")
+ {
+ mList3.Add(d.ToString() + "鏃�");
+ }
+ else
+ {
+ mList3.Add(d.ToString());
+ }
+ }
+
+ if (setTimeType != "DoorLockTime")
+ {
+ mUIPickerView.setNPicker(mList2, mList3, null);
+ mUIPickerView.setCurrentItems(dtNow.Month - 1, dtNow.Day - 1, 0);
+ curMonth = dtNow.Month;
+ curDay = dtNow.Day;
+
+ if (setTimeType == "ValidTime")
+ {
+ DoorLockCommonInfo.ValidDateYear = dtNow.Year;
+ DoorLockCommonInfo.ValidDateMonth = curMonth;
+ DoorLockCommonInfo.ValidDateDay = curDay;
+ }
+ else
+ {
+ DoorLockCommonInfo.InValidDateYear = dtNow.Year;
+ DoorLockCommonInfo.InValidDateMonth = curMonth;
+ DoorLockCommonInfo.InValidDateDay = curDay;
+ }
+ var btnOk = new Button
+ {
+ X = Application.GetRealWidth(919),
+ Y = Application.GetRealHeight(40),
+ Height = Application.GetRealHeight(58),
+ Width = Application.GetRealWidth(101),
+ Text = Language.StringByID(R.MyInternationalizationString.Complete),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
+ TextSize = 14,
+ };
+ this.bottomRadiusFrameLayout.AddChidren(btnOk);
+ btnOk.MouseUpEventHandler += (sender1, e1) =>
+ {
+ if (setTimeType == "ValidTime")
+ {
+ DoorLockCommonInfo.ValidDateYear = dtNow.Year;
+ DoorLockCommonInfo.ValidDateMonth = curMonth;
+ DoorLockCommonInfo.ValidDateDay = curDay;
+ }
+ else
+ {
+ DoorLockCommonInfo.InValidDateYear = dtNow.Year;
+ DoorLockCommonInfo.InValidDateMonth = curMonth;
+ DoorLockCommonInfo.InValidDateDay = curDay;
+ }
+ if (timeSetAction != null)
+ {
+ timeSetAction();
+ }
+ this.shadowRadiusFrameLayout.RemoveFromParent();
+ MidFrameLayoutContent();
+ };
+ }
+ else
+ {
+ mUIPickerView.setNPicker(mList1, mList2, mList3);
+ mUIPickerView.setCurrentItems(9, dtNow.Month - 1, dtNow.Day - 1);
+ curYear = dtNow.Year;
+ curMonth = dtNow.Month;
+ curDay = dtNow.Day;
+ if (CurentDoorLockTime != null)
+ {
+ curHour = CurentDoorLockTime.Hour;
+ curMin = CurentDoorLockTime.Minute;
+ curSec = CurentDoorLockTime.Second;
+ }
+ else
+ {
+ curHour = dtNow.Hour;
+ curMin = dtNow.Minute;
+ curSec = dtNow.Second;
+ }
+ }
+
+ Action dAction = () =>
+ {
+ if (curMonth != oldMonth)
+ {
+ oldMonth = curMonth;
+ days = DateTime.DaysInMonth(curYear, curMonth);
+ mList3.Clear();
+
+ for (int d = 1; d < days + 1; d++)
+ {
+ if (Language.CurrentLanguage == "Chinese")
+ {
+ mList3.Add(d.ToString() + "鏃�");
+ }
+ else
+ {
+ mList3.Add(d.ToString());
+ }
+ }
+
+ if (setTimeType != "DoorLockTime")
+ {
+ mUIPickerView.setNPicker(mList2, mList3, null);
+ mUIPickerView.setCurrentItems(curMonth - 1, curDay - 1, 0);
+ }
+ else
+ {
+ mUIPickerView.setNPicker(mList1, mList2, mList3);
+ mUIPickerView.setCurrentItems(9, curMonth - 1, curDay - 1);
+ }
+ }
+ };
+ mUIPickerView.OnSelectChangeEvent += (y, m, d) =>
+ {
+ if (setTimeType != "DoorLockTime")
+ {
+ curYear = dtNow.Year;
+ curMonth = y + 1;
+ curDay = m + 1;
+ }
+ else
+ {
+ curYear = y + 2009;
+ curMonth = m + 1;
+ curDay = d + 1;
+ }
+ dAction();
+ };
+ }
+ if (curIndex == 1)
+ {
+ //鏃堕棿
+ if (setTimeType != "DoorLockTime")
+ {
+ this.btnBottomTitle.TextID = R.MyInternationalizationString.Time;
+ }
+ else
+ {
+ this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentTime;
+ }
+
+ mUIPickerView.Y = Application.GetRealWidth(245);
+ var mList1 = new List<string>();
+ var mList2 = new List<string>();
+ for (int h = 0; h < 24; h++)
+ {
+ if (h < 10)
+ {
+ mList1.Add("0" + h.ToString());
+ }
+ else
+ {
+ mList1.Add(h.ToString());
+ }
+ }
+ for (int m = 0; m < 60; m++)
+ {
+ if (m < 10)
+ {
+ mList2.Add("0" + m.ToString());
+ }
+ else
+ {
+ mList2.Add(m.ToString());
+ }
+ }
+ mUIPickerView.setNPicker(mList1, mList2, null);
+ mUIPickerView.setCurrentItems(dtNow.Hour, dtNow.Minute, 0);
+ if (CurentDoorLockTime != null)
+ {
+ curYear = CurentDoorLockTime.Year;
+ curMonth = CurentDoorLockTime.Month;
+ curDay = CurentDoorLockTime.Day;
+ }
+ else
+ {
+ curYear = dtNow.Year;
+ curMonth = dtNow.Month;
+ curDay = dtNow.Day;
+ }
+ curHour = dtNow.Hour;
+ curMin = dtNow.Minute;
+ curSec = dtNow.Second;
+ mUIPickerView.OnSelectChangeEvent += (h, m, s) =>
+ {
+ curHour = h;
+ curMin = m;
+ curSec = dtNow.Second;
+ };
+
+ if (setTimeType == "ValidTime")
+ {
+ DoorLockCommonInfo.ValidDateHour = curHour;
+ DoorLockCommonInfo.ValidDateMinute = curMin;
+ DoorLockCommonInfo.ValidDateSecond = curSec;
+ }
+ else
+ {
+ DoorLockCommonInfo.InValidDateHour = curHour;
+ DoorLockCommonInfo.InValidDateMinute = curMin;
+ DoorLockCommonInfo.InValidDateSecond = curSec;
+ }
+
+ if (setTimeType != "DoorLockTime")
+ {
+ var btnOk = new Button
+ {
+ X = Application.GetRealWidth(919),
+ Y = Application.GetRealHeight(40),
+ Height = Application.GetRealHeight(58),
+ Width = Application.GetRealWidth(101),
+ Text = Language.StringByID(R.MyInternationalizationString.Complete),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
+ TextSize = 14,
+ };
+ this.bottomRadiusFrameLayout.AddChidren(btnOk);
+ btnOk.MouseUpEventHandler += (sender1, e1) =>
+ {
+ if (setTimeType == "ValidTime")
+ {
+ DoorLockCommonInfo.ValidDateHour = curHour;
+ DoorLockCommonInfo.ValidDateMinute = curMin;
+ DoorLockCommonInfo.ValidDateSecond = curSec;
+ }
+ else
+ {
+ DoorLockCommonInfo.InValidDateHour = curHour;
+ DoorLockCommonInfo.InValidDateMinute = curMin;
+ DoorLockCommonInfo.InValidDateSecond = curSec;
+ }
+ if (timeSetAction != null)
+ {
+ timeSetAction();
+ }
+ this.shadowRadiusFrameLayout.RemoveFromParent();
+ MidFrameLayoutContent();
+ };
+ }
+ }
}
+ #endregion
+
+ #region 绉婚櫎鏂规硶
/// <summary>
- /// Changeds the IS cene status.
+ /// 閲嶅啓绉婚櫎鏂规硶
/// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
+ public override void RemoveFromParent()
{
+ ZbGateway.StatusList.Remove(this);
+ base.RemoveFromParent();
}
#endregion
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
index a4368dc..5be1370 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -807,16 +807,5 @@
ZbGateway.StatusList.Remove(this);
base.RemoveFromParent();
}
-
- public void Changed(CommonDevice common)
- {
- }
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
-
- public void ChangedISceneStatus(Scene scene)
- {
- }
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
index 8c997e0..b09c539 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
@@ -4,7 +4,7 @@
using ZigBee.Device;
namespace Shared.Phone.UserCenter.DoorLock
{
- public class UndistributeDoorlockUserPage : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class UndistributeDoorlockUserPage : DoorLockCommonLayout
{
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -815,38 +815,5 @@
RefreshList();
}
}
- #region 鎺ュ彛瀹炵幇
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
index dd33da8..ac08e64 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -1,4 +1,6 @@
锘縰sing System;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
using Shared.Common;
using ZigBee.Device;
@@ -6,6 +8,7 @@
{
public class UserDoorLockPage : DoorLockCommonLayout, ZigBee.Common.IStatus
{
+ #region 鐣岄潰
/// <summary>
/// 鏋勯�犲嚱鏁�
/// </summary>
@@ -17,22 +20,50 @@
currentRoom = room;
deviceUI = doorLock;
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
- ZigBee.Device.ZbGateway.StatusList.Add(this);
+ ZbGateway.StatusList.Add(this);
}
#region 鍙橀噺鐢虫槑
/// <summary>
+ /// IsDrawerLockMode
+ /// </summary>
+ public bool IsDrawerLockMode;
+ /// <summary>
/// 褰撳墠闂ㄩ攣
/// </summary>
ZigBee.Device.DoorLock doorLock;
/// <summary>
- /// 搴曢儴甯冨眬
+ /// 闊抽噺鏁版嵁
/// </summary>
- FrameLayout bottomFrameLayout;
+ ZigBee.Device.DoorLock.VolumeResponseData volumeData = null;
+ /// <summary>
+ /// 绛夊緟鑾峰彇鐢甸噺鐨勭瓑寰呮椂闂�
+ /// </summary>
+ DateTime waitGetDoorLockPower = DateTime.MaxValue;
+ /// <summary>
+ /// 閫昏緫涓槸鍚︽湁甯稿紑妯″紡
+ /// </summary>
+ private bool HaveLogicNormallyOpenMode = false;
+ /// <summary>
+ /// 褰撳墠鐢甸噺
+ /// </summary>
+ bool canVolume = false;
+ /// <summary>
+ /// 淇濈暀涓婁竴娆¢煶閲�
+ /// </summary>
+ bool canOpenNormallyMode = false;
+ /// <summary>
+ /// 褰撳墠鐢甸噺
+ /// </summary>
+ int currentPower = 0;
+ /// <summary>
+ /// 淇濈暀涓婁竴娆¢煶閲�
+ /// </summary>
+ int oldVolume = -1;
/// <summary>
/// 褰撳墠鎴块棿
/// </summary>
- Shared.Common.Room currentRoom;
+ Room currentRoom;
/// <summary>
/// 璁惧UI瀵硅薄
/// </summary>
@@ -45,23 +76,109 @@
/// 涓儴甯冨眬涓棬閿佸悕绉版樉绀�
/// </summary>
Button btnDoorLockTitle;
+ /// <summary>
+ /// 鍒嗕韩
+ /// </summary>
+ Button btnShare;
+ /// <summary>
+ /// 璁剧疆
+ /// </summary>
+ Button btnFuncSet;
+ /// <summary>
+ /// 璁剧疆FrameLayout
+ /// </summary>
+ FrameLayout btnFuncSetFrameLayout;
+ /// <summary>
+ /// 鐐瑰嚮寮�甯冨眬
+ /// </summary>
+ private FrameLayout openFrameLayout;
+ /// <summary>
+ /// 鐐瑰嚮鍏冲竷灞�
+ /// </summary>
+ private FrameLayout closeFrameLayout;
+ /// <summary>
+ /// 鎵撳紑鍥剧墖
+ /// </summary>
+ Button btnDoorOpenPic;
+ /// <summary>
+ /// 鎼滆棌UI
+ /// </summary>
+ FrameLayout btnCollectFrameLayout;
+ /// <summary>
+ /// 鎼滆棌
+ /// </summary>
+ Button btnCollect;
+ /// <summary>
+ /// 璁板綍UI
+ /// </summary>
+ FrameLayout btnRecordFrameLayout;
+ /// <summary>
+ /// 璁板綍鎸夐挳
+ /// </summary>
+ Button btnRecord;
+ /// <summary>
+ /// 褰撳墠鐘舵��
+ /// </summary>
+ Button btnStatus;
+ /// <summary>
+ /// 褰撳墠鐢甸噺鏂囨湰
+ /// </summary>
+ Button btnCurrentPowerText;
+ /// <summary>
+ /// 杩涘害鎸夐挳
+ /// </summary>
+ Button progressButton;
+ /// <summary>
+ /// 杩涘害
+ /// </summary>
+ DiyImageVerticalSeekBar diyImageVerticalSeekBar;
+ /// <summary>
+ /// 杩涘害鏂囨湰
+ /// </summary>
+ Button progressText;
+ /// <summary>
+ /// 闂ㄩ攣鍏冲浘鐗�
+ /// </summary>
+ Button btnDoorClosePic;
+ /// <summary>
+ /// 闂ㄩ攣寮�/鍏冲浘鐗�
+ /// </summary>
+ Button btnDoorLockPic;
+ /// <summary>
+ /// 鐢甸噺
+ /// </summary>
+ Button btnPower;
+ /// <summary>
+ /// 甯稿紑
+ /// </summary>
+ Button btnNormallyOpen;
+ /// <summary>
+ /// 闊抽噺
+ /// </summary>
+ Button btnVolume;
+ /// <summary>
+ /// 甯稿紑FrameLayout
+ /// </summary>
+ FrameLayout btnNormallyOpenFrameLayout;
+ /// <summary>
+ /// 闊抽噺FrameLayout
+ /// </summary>
+ FrameLayout btnVolumeFrameLayout;
+ /// <summary>
+ /// 聽褰撳墠闊抽噺
+ /// </summary>
+ int currentVolume = -1;
#endregion
/// <summary>
/// UI鏄剧ず
/// </summary>
public void Show()
- {
- this.TopFrameLayout(this, "");
- EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
- {
- RemoveFromParent();
- };
- this.btnBack.MouseUpEventHandler += eHandlerBack;
- this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
-
+ {
+ this.TopFrameLayout(this, "");
this.MidFrameLayout(this);
- var btnShare = new Button
+
+ btnShare = new Button
{
X = Application.GetRealWidth(850 - 116),
Height = Application.GetRealHeight(69),
@@ -69,7 +186,7 @@
};
this.titleFrameLayout.AddChidren(btnShare);
- var btnFuncSetFrameLayout = new FrameLayout
+ btnFuncSetFrameLayout = new FrameLayout
{
X = Application.GetRealWidth(850 - 116),
Height = Application.GetRealHeight(69),
@@ -77,7 +194,7 @@
};
this.titleFrameLayout.AddChidren(btnFuncSetFrameLayout);
- var btnFuncSet = new Button
+ btnFuncSet = new Button
{
X = Application.GetRealWidth(103),
Height = Application.GetRealHeight(69),
@@ -85,34 +202,22 @@
UnSelectedImagePath = "DoorLock/SettingIcon.png",
};
btnFuncSetFrameLayout.AddChidren(btnFuncSet);
- EventHandler<MouseEventArgs> btnFuncSetHander = (sender, e) =>
+
+ MidFrameLayoutUI();
+
+ ClickHandle();
+
+ if (doorLock.IsOnline == 1)
{
- var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- functionSetting.Show();
- functionSetting.devicNameAction += (deviceRename) =>
- {
- if (!string.IsNullOrEmpty(deviceRename))
- {
- btnDoorLockTitle.Text = deviceRename;
- //鏀规埧闂�
- HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
- deviceUI.ReSave();
- }
- };
- };
- btnFuncSetFrameLayout.MouseDownEventHandler += btnFuncSetHander;
- btnFuncSet.MouseDownEventHandler += btnFuncSetHander;
-
- MidFrameLayoutContent();
+ ReadDoorLockUserInfo();
+ }
}
+
/// <summary>
/// 涓儴甯冨眬
/// </summary>
- public void MidFrameLayoutContent()
+ public void MidFrameLayoutUI()
{
- #region UI
var midTopFrameLayout = new FrameLayout()
{
X = Application.GetRealWidth(58),
@@ -124,6 +229,7 @@
};
this.midFrameLayout.AddChidren(midTopFrameLayout);
+ //闂ㄩ攣鏍囬
btnDoorLockTitle = new Button()
{
Width = Application.GetRealWidth(250),
@@ -136,18 +242,16 @@
IsBold = true,
};
midTopFrameLayout.AddChidren(btnDoorLockTitle);
- //鑾峰彇Mac鍚嶅瓧
- btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
- var btnRecordFrameLayout = new FrameLayout()
+ //璁板綍
+ btnRecordFrameLayout = new FrameLayout()
{
- Width = Application.GetRealWidth(69+15+46),
- Height = Application.GetRealHeight(69+46 * 2),
- X = Application.GetRealWidth(752-46),
- };
+ Width = Application.GetRealWidth(69 + 15 + 46),
+ Height = Application.GetRealHeight(69 + 46 * 2),
+ X = Application.GetRealWidth(752 - 46),
+ };
midTopFrameLayout.AddChidren(btnRecordFrameLayout);
-
- var btnRecord = new Button()
+ btnRecord = new Button()
{
Width = Application.GetRealWidth(69),
Height = Application.GetRealHeight(69),
@@ -156,23 +260,16 @@
UnSelectedImagePath = "DoorLock/RecordIcon.png",
};
btnRecordFrameLayout.AddChidren(btnRecord);
- EventHandler<MouseEventArgs> handerRecord = (sender, e) =>
- {
- //鍘嗗彶璁板綍 ---- stan
- var form = new DeviceDoorLock.DoorLockHistoryLogForm();
- form.AddForm(this.doorLock.DeviceAddr);
- };
- btnRecordFrameLayout.MouseDownEventHandler += handerRecord;
- btnRecord.MouseDownEventHandler += handerRecord;
- var btnCollectFrameLayout = new FrameLayout()
- {
- Width = Application.GetRealWidth(69+15+46),
- Height = Application.GetRealHeight(69+46*2),
- X = Application.GetRealWidth(850-15),
- };
- midTopFrameLayout.AddChidren(btnCollectFrameLayout);
- var btnCollect = new Button()
+ //鎼滆棌UI
+ btnCollectFrameLayout = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(69 + 15 + 46),
+ Height = Application.GetRealHeight(69 + 46 * 2),
+ X = Application.GetRealWidth(850 - 15),
+ };
+ midTopFrameLayout.AddChidren(btnCollectFrameLayout);
+ btnCollect = new Button()
{
Width = Application.GetRealWidth(69),
Height = Application.GetRealHeight(69),
@@ -182,55 +279,36 @@
SelectedImagePath = "Item/CollectionSelected.png"
};
btnCollectFrameLayout.AddChidren(btnCollect);
- if (HdlRoomLogic.Current.IsCollectInRoom(deviceUI) == false)
- {
- btnCollect.IsSelected = false;
- }
- else
- {
- btnCollect.IsSelected = true;
- }
- EventHandler < MouseEventArgs > handerCollect = (sender, e) =>
+
+ //褰撳墠鐘舵��
+ btnStatus = new Button()
{
- btnCollect.IsSelected = !btnCollect.IsSelected;
- if (btnCollect.IsSelected)
- {
- HdlRoomLogic.Current.AddLoveDevice(deviceUI);//鏀惰棌
- }
- else
- {
- HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);//鍙栨秷鏀惰棌
- }
- };
- btnCollectFrameLayout.MouseDownEventHandler += handerCollect;
- btnCollect.MouseDownEventHandler += handerCollect;
- var btnCurrentText = new Button()
- {
- Width = Application.GetRealWidth(100),
+ Width = Application.GetRealWidth(132 + 351),
Height = Application.GetRealHeight(40),
- X = Application.GetRealWidth(415),
Y = Application.GetRealHeight(118),
- Text = Language.StringByID(R.MyInternationalizationString.Current),
+ Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.CLose),
TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
TextSize = 10,
- TextAlignment = TextAlignment.CenterLeft,
- };
- midTopFrameLayout.AddChidren(btnCurrentText);
-
- var btnStatus = new Button()
- {
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(40),
- X = btnCurrentText.Right,
- Y = Application.GetRealHeight(118),
- TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
- Text = Language.StringByID(R.MyInternationalizationString.CLose),
- TextSize = 10,
- TextAlignment = TextAlignment.CenterLeft,
+ TextAlignment = TextAlignment.CenterRight,
};
midTopFrameLayout.AddChidren(btnStatus);
- var btnDoorLockPic = new Button()
+ //褰撳墠鐢甸噺
+ btnCurrentPowerText = new Button()
+ {
+ Width = Application.GetRealWidth(133 + 348),
+ Height = Application.GetRealHeight(40),
+ X = btnStatus.Right,
+ Y = Application.GetRealHeight(118),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+ Text = Language.StringByID(R.MyInternationalizationString.DoorLockPower) + "%",
+ TextSize = 10,
+ TextAlignment = TextAlignment.CenterLeft,
+ };
+ midTopFrameLayout.AddChidren(btnCurrentPowerText);
+
+ //闂ㄩ攣寮�/鍏冲浘鐗�
+ btnDoorLockPic = new Button()
{
Width = Application.GetRealWidth(383),
Height = Application.GetRealHeight(343),
@@ -241,6 +319,7 @@
};
midTopFrameLayout.AddChidren(btnDoorLockPic);
+ #region 寮�/鍏崇偣鍑诲竷灞�
var btnFrameLayout = new FrameLayout()
{
Width = Application.GetRealWidth(420 - 46),
@@ -251,7 +330,7 @@
};
midTopFrameLayout.AddChidren(btnFrameLayout);
- var openFrameLayout = new FrameLayout()
+ openFrameLayout = new FrameLayout()
{
Width = Application.GetRealWidth(420),//639-35
Height = Application.GetRealHeight(446 / 2),
@@ -259,7 +338,7 @@
};
btnFrameLayout.AddChidren(openFrameLayout);
- var closeFrameLayout = new FrameLayout()
+ closeFrameLayout = new FrameLayout()
{
Width = Application.GetRealWidth(420),//639-35
Height = Application.GetRealHeight(446 / 2),
@@ -278,18 +357,17 @@
};
btnFrameLayout.AddChidren(progressFrameLayout);
- var progressButton = new Button()
+ progressButton = new Button()
{
- Width = Application.GetRealWidth(81),//639-35
- Height = Application.GetRealHeight(89),
+ Width = Application.GetRealWidth(84),//639-35
+ Height = Application.GetRealHeight(93),
X = Application.GetRealWidth(58),
Y = Application.GetRealHeight(347),
UnSelectedImagePath = "DoorLock/UnLockButton.png",
- SelectedImagePath = "DoorLock/UnLockButton.png",
};
btnFrameLayout.AddChidren(progressButton);
- var btnDoorOpenPic = new Button()
+ btnDoorOpenPic = new Button()
{
Width = Application.GetRealWidth(81),
Height = Application.GetRealHeight(81),
@@ -299,7 +377,7 @@
};
openFrameLayout.AddChidren(btnDoorOpenPic);
- var btnDoorClosePic = new Button()
+ btnDoorClosePic = new Button()
{
Width = Application.GetRealWidth(81),
Height = Application.GetRealHeight(81),
@@ -308,7 +386,60 @@
UnSelectedImagePath = "DoorLock/DoorLockClose.png",
};
closeFrameLayout.AddChidren(btnDoorClosePic);
+ #endregion
+ //鐢甸噺
+ btnPower = new Button()
+ {
+ Width = Application.GetRealWidth(81),
+ Height = Application.GetRealHeight(81),
+ X = Application.GetRealWidth(253),
+ Y = Application.GetRealHeight(994),
+ UnSelectedImagePath = "DoorLock/PowerOffline.png",
+ };
+ midTopFrameLayout.AddChidren(btnPower);
+
+ //闊抽噺
+ btnVolumeFrameLayout = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(81 + 80),
+ Height = Application.GetRealHeight(81 + 80),
+ X = Application.GetRealWidth(444 - 40),
+ Y = Application.GetRealHeight(994 - 40),
+ };
+ midTopFrameLayout.AddChidren(btnVolumeFrameLayout);
+ btnVolume = new Button()
+ {
+ Width = Application.GetRealWidth(81),
+ Height = Application.GetRealHeight(81),
+ X = Application.GetRealWidth(40),
+ Y = Application.GetRealHeight(40),
+ UnSelectedImagePath = "DoorLock/VolumeIcon.png",
+ SelectedImagePath = "DoorLock/VolumeIconOn.png",
+ };
+ btnVolumeFrameLayout.AddChidren(btnVolume);
+
+ //甯稿紑
+ btnNormallyOpenFrameLayout = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(81 + 80),
+ Height = Application.GetRealHeight(81 + 80),
+ X = Application.GetRealWidth(631 - 40),
+ Y = Application.GetRealHeight(994 - 40),
+ };
+ midTopFrameLayout.AddChidren(btnNormallyOpenFrameLayout);
+ btnNormallyOpen = new Button()
+ {
+ Width = Application.GetRealWidth(81),
+ Height = Application.GetRealHeight(81),
+ X = Application.GetRealWidth(40),
+ Y = Application.GetRealHeight(40),
+ UnSelectedImagePath = "DoorLock/NormallyOpen.png",
+ SelectedImagePath = "DoorLock/NormallyOpenOn.png",
+ };
+ btnNormallyOpenFrameLayout.AddChidren(btnNormallyOpen);
+
+ #region 鑳屾櫙鍦嗚璁剧疆
var btnCurrentTopFrameLayout = new FrameLayout()
{
Height = Application.GetRealHeight(50),
@@ -327,7 +458,9 @@
Radius = 6,
};
midTopFrameLayout.AddChidren(btnCurrentFrameLayout);
+ #endregion
+ #region 褰撳墠鎴块棿
var btnCurrentRoomPic = new Button()
{
Width = Application.GetRealWidth(81),
@@ -350,109 +483,775 @@
TextAlignment = TextAlignment.CenterLeft,
};
btnCurrentFrameLayout.AddChidren(btnCurrentRoomName);
- #endregion
+ #endregion
+ }
- #region 鏁版嵁澶勭悊
+ #region 闊抽噺寮圭獥
+ /// <summary>
+ /// 杩涘害鏉�
+ /// </summary>
+ private void VolumeDialog(Button progressText, DiyImageVerticalSeekBar diyImageVerticalSeekBar)
+ {
+ var dialog = new Dialog { };
+ dialog.Show();
+ var flMain = new FrameLayout { BackgroundColor = 0x00000000 };
+ dialog.AddChidren(flMain);
+ flMain.MouseUpEventHandler += (sender11, e11) =>
+ {
+ dialog.Close();
+
+ //璁剧疆闊抽噺
+ if (currentVolume != oldVolume)
+ {
+ SetVolume(currentVolume);
+ }
+ };
+
+ var progressBackground = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(271),
+ Height = Application.GetRealHeight(700),
+ X = Application.GetRealWidth(403),
+ Y = Application.GetRealHeight(582),
+ BackgroundImagePath = "DoorLock/ProgressBackground.png",
+ };
+ flMain.AddChidren(progressBackground);
+
+ progressText = new Button()
+ {
+ Height = Application.GetRealHeight(58),
+ Y = Application.GetRealHeight(89),
+ TextColor = ZigbeeColor.Current.XMGray2,
+ TextAlignment = TextAlignment.Center,
+ Text = currentVolume.ToString(),
+ };
+
+ diyImageVerticalSeekBar = new DiyImageVerticalSeekBar()
+ {
+ Width = Application.GetRealWidth(271),
+ Height = Application.GetRealHeight(447 + 63),
+ Y = Application.GetRealHeight(155),
+ IsProgressTextShow = false,//鏄剧ず鐧惧垎姣�
+ ProgressBarColor = ZigbeeColor.Current.XMProgressBarColor,//閫変腑杩涘害鏉¢鑹�
+ SeekBarBackgroundColor = ZigbeeColor.Current.XMSeekBarBackgroundColor,//閫変腑杩涘害鏉¢鑹�
+ ThumbImagePath = "DoorLock/UnLockButton.png",//杩涘害鏉℃寜閽浘鏍�
+ ThumbImageHeight = Application.GetRealHeight(81),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
+ ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+ ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏�
+ SeekBarViewHeight = Application.GetRealHeight(17),//杩涘害鏉$殑瀹藉害
+ Progress = (currentVolume * (Convert.ToInt32(((float)100 / 15) * 100))) / 100,
+ };
+ progressBackground.AddChidren(progressText);
+ progressBackground.AddChidren(diyImageVerticalSeekBar);
+ diyImageVerticalSeekBar.OnProgressChangedEvent += (sender, e) =>
+ {
+ int curVolume = -1;
+ if (e == 0)
+ {
+ curVolume = 0;
+ }
+ else if (e == 100)
+ {
+ curVolume = 14;
+ }
+ else
+ {
+ int comandValue = e;
+ int comandValueTemp = (comandValue * 100) / (Convert.ToInt32(((float)100 / 15) * 100));
+ curVolume = comandValueTemp;
+ }
+ currentVolume = curVolume;
+ progressText.Text = curVolume.ToString();
+ };
+ }
+
+ #endregion
+ #endregion
+
+ #region 澶勭悊鎺ュ彛鏁版嵁
+ /// <summary>
+ /// 澶勭悊鍙樺寲浜嬩欢
+ /// </summary>
+ /// <param name="common"></param>
+ /// <param name="typeTag"></param>
+ public void DeviceInfoChange(CommonDevice tempDevice, string typeTag)
+ {
+ //鏈烘寮�閿佷笂鎶ャ�傚鐞嗗父寮�鐘舵�侊紝寮�鍏崇姸鎬�
+ if (typeTag == "DoorLockProgrammingEventNotificationCommand" && tempDevice != null)
+ {
+ var tempDoor = (ZigBee.Device.DoorLock)tempDevice;
+ if (tempDoor.doorLockOperatingEventNotificationCommand != null)
+ {
+ Application.RunOnMainThread(() => { NomallyOpenModeInvalidDialog(true); });
+ }
+ }
+
+ if (typeTag == "DeviceStatusReport" && tempDevice != null)
+ {
+ if (tempDevice != null)
+ {
+ if (tempDevice.DeviceEpoint == doorLock.DeviceEpoint
+ && tempDevice.DeviceAddr == doorLock.DeviceAddr)
+ {
+ if (tempDevice.DeviceStatusReport != null && tempDevice.DeviceStatusReport.AttriBute != null)
+ {
+ var dataReport = tempDevice.DeviceStatusReport.AttriBute[0];
+ if (tempDevice.DeviceStatusReport.CluterID == 1 && dataReport.AttributeId == 33)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ currentPower = dataReport.AttriButeData;
+ waitGetDoorLockPower = DateTime.MaxValue;
+ UpdatePower();
+ });
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨暟鎹�
+ /// </summary>
+ void ReadDoorLockUserInfo()
+ {
+ System.Threading.Tasks.Task.Run(async () =>
+ {
+ try
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Start("");
+ });
+ //鏄惁鏀寔甯稿紑
+ canOpenNormallyMode = DoorLockCommonInfo.CanNormallyOpen(doorLock);
+ //鏄惁鏀寔闊抽噺
+ canVolume = DoorLockCommonInfo.CanVolume(doorLock);
+ //璇诲彇闂ㄩ攣鐢甸噺锛氱皣ID锛�1 灞炴�D 33
+ doorLock.ReadAttri(Cluster_ID.Power, AttriButeId.DoorLockPower);
+ //涓婃姤鐢甸噺绛�1绉�
+ System.Threading.Thread.Sleep(1000);
+ //鑾峰彇闂ㄩ攣甯稿紑妯″紡
+ await DoorLockCommonInfo.GetNormallyOpenMode(doorLock);
+ //璇诲彇闊抽噺
+ ReadVolume();
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ UpdateNomallyOpenStatus();
+ CommonPage.Loading.Hide();
+ });
+ }
+ });
+ }
+
+ #endregion
+
+ #region 鍏叡浜嬩欢澶勭悊
+ /// <summary>
+ /// 浜嬩欢澶勭悊
+ /// </summary>
+ public void ClickHandle()
+ {
+ //闂ㄩ攣鏍囬
+ btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
+
+ //杩斿洖
+ EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
+ {
+ RemoveFromParent();
+ };
+ this.btnBack.MouseUpEventHandler += eHandlerBack;
+ this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
+
+ //璁剧疆
+ EventHandler<MouseEventArgs> btnFuncSetHander = (sender, e) =>
+ {
+ var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ functionSetting.Show();
+ functionSetting.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
+ HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
+ deviceUI.ReSave();
+ }
+ };
+ };
+ btnFuncSetFrameLayout.MouseDownEventHandler += btnFuncSetHander;
+ btnFuncSet.MouseDownEventHandler += btnFuncSetHander;
+
+ //鎼滆棌鐘舵��
+ if (HdlRoomLogic.Current.IsCollectInRoom(deviceUI) == false)
+ {
+ btnCollect.IsSelected = false;
+ }
+ else
+ {
+ btnCollect.IsSelected = true;
+ }
+
+ //鍘嗗彶璁板綍鐐瑰嚮浜嬩欢
+ EventHandler<MouseEventArgs> handerRecord = (sender, e) =>
+ {
+ //鍘嗗彶璁板綍 ---- stan
+ var form = new DeviceDoorLock.DoorLockHistoryLogForm();
+ form.AddForm(this.doorLock.DeviceAddr);
+ };
+ btnRecordFrameLayout.MouseDownEventHandler += handerRecord;
+ btnRecord.MouseDownEventHandler += handerRecord;
+
+ //鏀惰棌鐐瑰嚮浜嬩欢
+ EventHandler<MouseEventArgs> handerCollect = (sender, e) =>
+ {
+ btnCollect.IsSelected = !btnCollect.IsSelected;
+ if (btnCollect.IsSelected)
+ {
+ HdlRoomLogic.Current.AddLoveDevice(deviceUI);//鏀惰棌
+ //Test
+ HaveLogicNormallyOpenMode = true;
+ }
+ else
+ {
+ HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);//鍙栨秷鏀惰棌
+ //Test
+ HaveLogicNormallyOpenMode = false;
+ }
+ };
+ btnCollectFrameLayout.MouseDownEventHandler += handerCollect;
+ btnCollect.MouseDownEventHandler += handerCollect;
+
+ //寮�閿佷簨浠�
EventHandler<MouseEventArgs> hander1 = async (sender, e) =>
{
- openFrameLayout.Enable = false;
- btnDoorOpenPic.Enable = false;
+ if (DoorLockCommonInfo.IsDoorLockNormallyMode == true)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.CurrentNormallyOpenMode);
+ this.ShowTipMsg(msg0);
+ }
+ else
+ {
+ OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus);
+ }
+ };
+ openFrameLayout.MouseUpEventHandler += hander1;
+ btnDoorOpenPic.MouseUpEventHandler += hander1;
+
+ //鍏抽攣浜嬩欢
+ EventHandler<MouseEventArgs> hander2 = (sender, e) =>
+ {
+ if (DoorLockCommonInfo.IsDoorLockNormallyMode == true)
+ {
+ NomallyOpenModeInvalidDialog();
+ }
+ else
+ {
+ btnDoorLockPic.IsSelected = false;
+ progressButton.Y = Application.GetRealHeight(347);
+ }
+ };
+ closeFrameLayout.MouseUpEventHandler += hander2;
+ btnDoorClosePic.MouseUpEventHandler += hander2;
+
+ //闊抽噺鐐瑰嚮浜嬩欢
+ EventHandler<MouseEventArgs> handerVolume = (sender, e) =>
+ {
+ if (canVolume)
+ {
+ VolumeDialog(progressText, diyImageVerticalSeekBar);
+ }
+ else
+ {
+ var volumeMsg = Language.StringByID(R.MyInternationalizationString.NoSupport);
+ this.ShowTipMsg(volumeMsg);
+ }
+ };
+ btnVolumeFrameLayout.MouseDownEventHandler += handerVolume;
+ btnVolume.MouseDownEventHandler += handerVolume;
+
+
+ //甯稿紑妯″紡鐐瑰嚮浜嬩欢
+ EventHandler<MouseEventArgs> handerNormallyOpen = (sender, e) =>
+ {
+ if (canOpenNormallyMode)
+ {
+ btnNormallyOpen.IsSelected = !btnNormallyOpen.IsSelected;
+ NomallyOpenDialog();
+ }
+ else
+ {
+ var volumeMsg = Language.StringByID(R.MyInternationalizationString.NoSupport);
+ this.ShowTipMsg(volumeMsg);
+ }
+ };
+ btnNormallyOpenFrameLayout.MouseUpEventHandler += handerNormallyOpen;
+ btnNormallyOpen.MouseUpEventHandler += handerNormallyOpen;
+ }
+ #endregion
+
+ #region 鐢甸噺鏄剧ず
+ /// <summary>
+ /// 鐢甸噺鏇存柊
+ /// </summary>
+ private void UpdatePower()
+ {
+ btnCurrentPowerText.Text = Language.StringByID(R.MyInternationalizationString.DoorLockPower) + currentPower + "%";
+ if (currentPower <= 20 && currentPower >= 0)
+ {
+ btnPower.UnSelectedImagePath = "DoorLock/LowPower.png";
+ }
+ else if (currentPower <= 40 && currentPower > 20)
+ {
+ btnPower.UnSelectedImagePath = "DoorLock/Power40.png";
+ }
+ else if (currentPower <= 60 && currentPower > 40 || currentPower == 60)
+ {
+ btnPower.UnSelectedImagePath = "DoorLock/Power60.png";
+ }
+ else if (currentPower <= 80 && currentPower >= 60)
+ {
+ btnPower.UnSelectedImagePath = "DoorLock/Power80.png";
+ }
+ else if (currentPower <= 100 && currentPower >= 80)
+ {
+ btnPower.UnSelectedImagePath = "DoorLock/Power100.png";
+ }
+ else
+ {
+ btnPower.UnSelectedImagePath = "DoorLock/PowerOffline.png";
+ }
+ }
+ #endregion
+
+ #region 闊抽噺
+ /// <summary>
+ /// 璇诲彇闊抽噺
+ /// </summary>
+ private async void ReadVolume()
+ {
+ //鑾峰彇闂ㄩ攣闊抽噺
+ if (!canVolume)
+ {
+ return;
+ }
+ var resultRes = await doorLock.GetVolumeAsync();
+
+ if (resultRes == null || resultRes.volumeResponseData == null)
+ {
+ var listDevice = new List<CommonDevice> { };
+ listDevice.Add(doorLock);
+ var devTemp = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
+ if (devTemp.ConcreteType == DeviceConcreteType.IntelligentLocks_Sone)
+ {
+ var volumeMsg = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+ this.ShowTipMsg(volumeMsg);
+ }
+ }
+ else
+ {
+ volumeData = resultRes.volumeResponseData;
+ Application.RunOnMainThread(() =>
+ {
+ UpdateVolume();
+ });
+ }
+ }
+ /// <summary>
+ /// 鏇存柊闊抽噺
+ /// </summary>
+ private void UpdateVolume()
+ {
+ if (volumeData != null)
+ {
+ int curVol = 0;
+ btnVolume.IsSelected = true;
+ if (volumeData.command == "eb")
+ {
+ curVol = 0;
+ }
+ else
+ {
+ curVol = volumeData.value;
+ }
+ oldVolume = currentVolume = curVol;
+ }
+ }
+
+ /// <summary>
+ /// 璁剧疆闊抽噺
+ /// </summary>
+ private void SetVolume(int volume)
+ {
+ System.Threading.Tasks.Task.Run(async () =>
+ {
+ try
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Start("");
+ });
+ var resultRes = await doorLock.SetVolumeAsync(volume);
+ if (resultRes == null || resultRes.defaultControlResponseData == null)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var volumeMsg = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+ this.ShowTipMsg(volumeMsg);
+ currentVolume = oldVolume;
+ CommonPage.Loading.Hide();
+
+ });
+ return;
+ }
+ if (resultRes.defaultControlResponseData.status != 0)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var volumeMsg = Language.StringByID(R.MyInternationalizationString.SetVolumeFailed);
+ this.ShowTipMsg(volumeMsg);
+ currentVolume = oldVolume;
+ CommonPage.Loading.Hide();
+ });
+ return;
+ }
+ Application.RunOnMainThread(() =>
+ {
+ var volumeMsg = Language.StringByID(R.MyInternationalizationString.SetVolumeSuccess);
+ this.ShowTipMsg(volumeMsg);
+ oldVolume = currentVolume;
+ CommonPage.Loading.Hide();
+ });
+ }
+ catch (Exception ex)
+ {
+ var mes = ex.Message;
+ }
+ });
+ }
+ #endregion
+
+ #region 甯稿紑妯″紡
+ /// <summary>
+ /// 甯稿紑妯″紡澶勭悊
+ /// </summary>
+ private async void NomallyOpenDialog()
+ {
+ if (btnNormallyOpen.IsSelected)
+ {
if (UserCenterResourse.UserInfo.AuthorityNo != 1)
{
- var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid);
- if (result == false)
+ this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NoAccess));
+ return;
+ }
+
+ if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
+ {
+ SystemSecondAuthentication();
+ return;
+ }
+
+ action = () =>
+ {
+ string msg = Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n");
+ var confirm = Language.StringByID(R.MyInternationalizationString.Confrim);
+ var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.Confirm, msg, confirm);
+ alert.Show();
+ alert.CancelClickEvent += () =>
{
- var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid);
- if (result1 == true)
+ btnNormallyOpen.IsSelected = false;
+ };
+ alert.ConfirmClickEvent += async () =>
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
+ var result = await doorLock.SetNormallyOpenModeFuncAsync(true);
+ if (result == null || result.defaultControlResponseData == null)
{
- RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus, btnDoorLockTitle);
- devicNameSecAction += (deviceRename) =>
- {
- if (!string.IsNullOrEmpty(deviceRename))
- {
- btnDoorLockTitle.Text = deviceRename;
- //鏀规埧闂�
- HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
- deviceUI.ReSave();
- }
- };
- openFrameLayout.Enable = true;
- btnDoorOpenPic.Enable = true;
+ string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+ this.ShowTipMsg(msg0);
+ btnNormallyOpen.IsSelected = false;
+ return;
+ }
+ if (result.defaultControlResponseData.status != 0)
+ {
+ string msg1 = Language.StringByID(R.MyInternationalizationString.OpenNormallyOpenModeFailed);
+ this.ShowTipMsg(msg1);
+ btnNormallyOpen.IsSelected = false;
+ return;
}
else
{
- this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NoAccess));
- openFrameLayout.Enable = true;
- btnDoorOpenPic.Enable = true;
+ DoorLockCommonInfo.IsDoorLockNormallyMode = true;
+ UpdateNomallyOpenStatus();
+ CommonPage.Loading.Hide();
+
+ //甯稿紑妯″紡寮�鍚彁绀�
+ string msgNomallyModeIsTurnOn = Language.StringByID(R.MyInternationalizationString.NomallyModeIsTurnOn);
+ var doorLockInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockInValidSetting);
+ var alertNomallyModeIsTurnOn = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.DoorLockLogic, msgNomallyModeIsTurnOn, doorLockInValidSetting);
+ alertNomallyModeIsTurnOn.Show();
+ alertNomallyModeIsTurnOn.LogicClickEvent += () =>
+ {
+ //鑷姩鍖�
+ };
+ alertNomallyModeIsTurnOn.InvalidClickEvent += async () =>
+ {
+ NomallyOpenModeInvalidTimeDialog();
+ };
}
+ };
+ };
+ HdlCheckLogic.Current.CheckSecondarySecurity(action);
+ }
+ else
+ {
+ NomallyOpenModeInvalidDialog();
+ }
+ }
+
+ /// <summary>
+ /// 甯稿紑妯″紡澶辨晥澶勭悊
+ /// </summary>
+ public void NomallyOpenModeInvalidDialog(bool IsFromReport = false)
+ {
+ 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);
+ if (HaveLogicNormallyOpenMode)
+ {
+ //鏈夐�昏緫璁剧疆鐨勫脊绐�
+ alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.CancelNomallyOpenModeWithLogic, msg, confirm);
+ }
+ alert.Show();
+ alert.CancelClickEvent += async () =>
+ {
+ //淇濇寔甯稿紑
+ if (IsFromReport)
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
+ var result = await doorLock.SetNormallyOpenModeFuncAsync(true);
+ if (result == null || result.defaultControlResponseData == null)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+ this.ShowTipMsg(msg0);
+ btnNormallyOpen.IsSelected = false;
+ DoorLockCommonInfo.IsDoorLockNormallyMode = false;
+ return;
+ }
+ if (result.defaultControlResponseData.status != 0)
+ {
+ string msg1 = Language.StringByID(R.MyInternationalizationString.OpenNormallyOpenModeFailed);
+ this.ShowTipMsg(msg1);
+ btnNormallyOpen.IsSelected = false;
+ DoorLockCommonInfo.IsDoorLockNormallyMode = false;
+ return;
+ }
+ else
+ {
+ DoorLockCommonInfo.IsDoorLockNormallyMode = true;
+ btnNormallyOpen.IsSelected = true;
+ UpdateNomallyOpenStatus();
+ CommonPage.Loading.Hide();
+ }
+ }
+ else
+ {
+ btnNormallyOpen.IsSelected = true;
+ }
+ };
+ alert.ConfirmClickEvent += async () =>
+ {
+ //纭鍙栨秷甯稿紑
+ if (IsFromReport)
+ {
+ DoorLockCommonInfo.IsDoorLockNormallyMode = false;
+ btnNormallyOpen.IsSelected = false;
+ UpdateNomallyOpenStatus();
+ }
+ else
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
+ var result = await doorLock.SetNormallyOpenModeFuncAsync(false);
+ if (result == null || result.defaultControlResponseData == null)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+ this.ShowTipMsg(msg0);
+ btnNormallyOpen.IsSelected = true;
+ return;
+ }
+ if (result.defaultControlResponseData.status != 0)
+ {
+ string msg1 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeFailed);
+ this.ShowTipMsg(msg1);
+ btnNormallyOpen.IsSelected = true;
+ return;
}
else
{
- this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AccountIsFreezed));
+ DoorLockCommonInfo.IsDoorLockNormallyMode = false;
+ UpdateNomallyOpenStatus();
+ string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess);
+ this.ShowTipMsg(msg2);
+ }
+ }
+ };
+ }
+
+ ///// <summary>
+ /// 甯稿紑妯″紡澶辨晥鏃堕棿澶勭悊
+ /// </summary>
+ private void NomallyOpenModeInvalidTimeDialog()
+ {
+ //澶辨晥璁剧疆
+ string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime);
+ var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim);
+ var alertTimeInValidSetting = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim);
+ alertTimeInValidSetting.Show();
+ alertTimeInValidSetting.CancelClickEvent += () =>
+ {
+ btnNormallyOpen.IsSelected = true;
+ };
+ alertTimeInValidSetting.InvalidTimeAction += (obj) =>
+ {
+ Regex rg = new Regex("^[0-9]+$");
+ if (!rg.IsMatch(obj))
+ {
+ //蹇呴』鏄暟瀛�
+ string msg0 = Language.StringByID(R.MyInternationalizationString.NormallyOpenModeInvalidTimeTip);
+ this.ShowTipMsg(msg0);
+
+ string msgTimeInValidSetting2 = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime);
+ var timeConfrim2 = Language.StringByID(R.MyInternationalizationString.Confrim);
+ var alertTimeInValidSetting2 = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting2, timeConfrim2);
+ alertTimeInValidSetting2.Show();
+ return;
+ }
+ var temp = int.Parse(obj);
+ DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp;
+ btnNormallyOpen.IsSelected = true;
+ };
+ }
+ /// <summary>
+ /// 甯稿紑妯″紡鐘舵�佹洿鏂�
+ /// </summary>
+ private void UpdateNomallyOpenStatus()
+ {
+ if (!canOpenNormallyMode)
+ {
+ btnNormallyOpen.UnSelectedImagePath = "DoorLock/NormallyOpenOffline.png";
+ btnNormallyOpen.Enable = false;
+ return;
+ }
+ if (DoorLockCommonInfo.IsDoorLockNormallyMode == true)
+ {
+ btnNormallyOpen.IsSelected = true;
+ btnDoorLockPic.IsSelected = true;
+ progressButton.Y = Application.GetRealHeight(10);
+ btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.DoorLockOpen);
+
+ }
+ else if (DoorLockCommonInfo.IsDoorLockNormallyMode == false)
+ {
+ btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.CLose);
+ btnDoorLockPic.IsSelected = false;
+ btnNormallyOpen.IsSelected = false;
+ progressButton.Y = Application.GetRealHeight(347);
+ }
+ else
+ {
+ btnNormallyOpen.UnSelectedImagePath = "DoorLock/NormallyOpenOffline.png";
+ btnNormallyOpen.Enable = false;
+ string msg = Language.StringByID(R.MyInternationalizationString.GetNormallyOpenModeFailed);
+ this.ShowTipMsg(msg);
+ }
+ }
+ #endregion
+
+ #region 寮�閿佸鐞�
+ /// <summary>
+ /// 寮�閿佸鐞�
+ /// </summary>
+ /// <param name="progressButton">杩涘害鎸夐挳</param>
+ /// <param name="btnDoorLockPic">闂ㄩ攣鍥剧墖</param>
+ /// <param name="btnStatus">鐘舵�佹樉绀�</param>
+ async void OpenDoorLockHandle(Button progressButton, Button btnDoorLockPic, Button btnStatus)
+ {
+ openFrameLayout.Enable = false;
+ btnDoorOpenPic.Enable = false;
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ var result = await Shared.Phone.UserCenter.DoorLock.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);
+ if (result1 == true)
+ {
+ RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus, btnDoorLockTitle);
+ devicNameSecAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
+ HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
+ deviceUI.ReSave();
+ }
+ };
+ openFrameLayout.Enable = true;
+ btnDoorOpenPic.Enable = true;
+ }
+ else
+ {
+ this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NoAccess));
openFrameLayout.Enable = true;
btnDoorOpenPic.Enable = true;
}
}
else
{
- RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus, btnDoorLockTitle);
- devicNameSecAction += (deviceRename) =>
- {
- if (!string.IsNullOrEmpty(deviceRename))
- {
- btnDoorLockTitle.Text = deviceRename;
- //鏀规埧闂�
- HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
- deviceUI.ReSave();
- }
- };
+ this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AccountIsFreezed));
openFrameLayout.Enable = true;
btnDoorOpenPic.Enable = true;
}
- };
- openFrameLayout.MouseUpEventHandler += hander1;
- btnDoorOpenPic.MouseUpEventHandler += hander1;
- EventHandler<MouseEventArgs> hander2 = (sender, e) =>
+ }
+ else
{
- btnDoorLockPic.IsSelected = false;
- progressButton.Y = Application.GetRealHeight(347);
- };
- closeFrameLayout.MouseUpEventHandler += hander2;
- btnDoorClosePic.MouseUpEventHandler += hander2;
- #endregion
+ RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus, btnDoorLockTitle);
+ devicNameSecAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
+ HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
+ deviceUI.ReSave();
+ }
+ };
+ openFrameLayout.Enable = true;
+ btnDoorOpenPic.Enable = true;
+ }
}
+ #endregion
- #region 鎺ュ彛瀹炵幇
+ #region 绉婚櫎鏂规硶
/// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
+ /// 閲嶅啓绉婚櫎鏂规硶
/// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
+ public override void RemoveFromParent()
{
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
+ if (IsDrawerLockMode)
+ {
+ CommonPage.Instance.IsDrawerLockMode = false;
+ }
+ ZbGateway.StatusList.Remove(this);
+ base.RemoveFromParent();
}
#endregion
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
index f7b5d99..25bdf6f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
@@ -9,18 +9,8 @@
/// <summary>
/// 闂ㄩ攣绠$悊
/// </summary>
- public class UserManagement : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class UserManagement : DoorLockCommonLayout
{
- /// <summary>
- /// 鎸夐敭妯″紡鎺ユ敹
- /// </summary>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- Shared.Application.RunOnMainThread(() =>
- {
- });
- }
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="doorLock"></param>
@@ -271,18 +261,6 @@
RowView.MouseUpEventHandler += eHandler;
btnText.MouseUpEventHandler += eHandler;
}
- }
-
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
-
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
-
- public void ChangedISceneStatus(Scene scene)
- {
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs
index 121c63b..12bdbff 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs
@@ -37,7 +37,7 @@
/// </summary>
public virtual void ShowFrom()
{
- Phone.Device.Room.RoomManagement.Instance.CanClick = false;
+ Phone.MainPage.ListRoomViewFrom.Instance.CanClick = false;
UserView.UserPage.Instance.AddChidren(this);
this.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor;
@@ -68,9 +68,9 @@
roomPageView.Height = Application.GetRealHeight(478);
this.AddChidren(roomPageView);
//绐佸嚭杈硅窛
- roomPageView.TCBJ = Application.GetRealWidth(112);
+ roomPageView.TCBJ = Application.GetRealWidth(124);
//涓や釜page涔嬮棿鐨勯棿璺�
- roomPageView.JMBJ = Application.GetRealWidth(69);
+ roomPageView.JMBJ = Application.GetRealWidth(58);
//瀹㈠巺
var room1 = new Common.Room();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideForm2.cs b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideForm2.cs
index 5b4b6d0..2242d3b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideForm2.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideForm2.cs
@@ -54,7 +54,7 @@
var btnKnwon = this.AddIKnwonButton();
btnKnwon.ButtonClickEvent += (sender, e) =>
{
- Phone.Device.Room.RoomManagement.Instance.CanClick = true;
+ Phone.MainPage.ListRoomViewFrom.Instance.CanClick = true;
this.RemoveFromParent();
};
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
index 8734356..16c2cb3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
@@ -263,7 +263,7 @@
public override void CloseFormBefore()
{
Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest = null;
- UserCenterResourse.HideOption.CheckCanReceiveGateway = 1;
+ UserCenterResourse.HideOption.CheckCanReceiveGateway = 0;
base.CloseFormBefore();
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs
index f54a9bf..c55a48d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs
@@ -62,15 +62,16 @@
btnArea.TextColor = UserCenterColor.Current.TextGrayColor3;
btnArea.Gravity = Gravity.CenterVertical;
frame.AddChidren(btnArea);
- btnArea.ButtonClickEvent += (sender, e) =>
- {
- var form = new AreaCodeSelectForm();
- form.AddForm();
- form.FinishSelectEvent += (code) =>
- {
- btnArea.Text = "+" + code;
- };
- };
+ //鐩墠鍙拡瀵�+86
+ //btnArea.ButtonClickEvent += (sender, e) =>
+ //{
+ // var form = new AreaCodeSelectForm();
+ // form.AddForm();
+ // form.FinishSelectEvent += (code) =>
+ // {
+ // btnArea.Text = "+" + code;
+ // };
+ //};
//杈撳叆妗�
var txtValue = new TextInputControl(Application.GetRealWidth(510), frame.Height - ControlCommonResourse.BottomLineHeight, false);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
index 051c3dc..9036ecd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
@@ -244,21 +244,20 @@
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
- if (result == false)
+ HdlThreadLogic.Current.RunMain(() =>
{
- contr.SetErrorMsg(string.Empty);
- }
- else
- {
- UserCenterResourse.AccountOption.GestureAuthentication = psw;
- UserCenterResourse.AccountOption.Save();
-
- HdlThreadLogic.Current.RunMain(() =>
+ if (result == false)
{
+ contr.SetErrorMsg(string.Empty);
+ }
+ else
+ {
+ UserCenterResourse.AccountOption.GestureAuthentication = psw;
+ UserCenterResourse.AccountOption.Save();
//鐣岄潰鍏抽棴
this.CloseForm();
- });
- }
+ }
+ });
});
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
index 1a8fa11..c2f91ae 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
@@ -228,21 +228,20 @@
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
- if (result == false)
+ HdlThreadLogic.Current.RunMain(() =>
{
- contr.SetErrorMsg(string.Empty);
- }
- else
- {
- UserCenterResourse.AccountOption.PswAuthentication = psw;
- UserCenterResourse.AccountOption.Save();
-
- HdlThreadLogic.Current.RunMain(() =>
+ if (result == false)
{
+ contr.SetErrorMsg(string.Empty);
+ }
+ else
+ {
+ UserCenterResourse.AccountOption.PswAuthentication = psw;
+ UserCenterResourse.AccountOption.Save();
//鐣岄潰鍏抽棴
this.CloseForm();
- });
- }
+ }
+ });
});
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
index 8cb0a34..9b85a1e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
@@ -54,21 +54,42 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ //鍔犱竴涓櫧鑹茶儗鏅�
+ var frameBack1 = new FrameLayout();
+ frameBack1.Height = Application.GetRealHeight(450);
+ frameBack1.Y = Application.GetRealHeight(196);
+ frameBack1.BackgroundColor = UserCenterColor.Current.White;
+ frameBack1.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+ bodyFrameLayout.AddChidren(frameBack1);
+
+ //鍒濆鍖栦俊鎭甯�
+ var tableContr = new InformationEditorControl();
+ this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 613, 1175);
+
+ //鎴块棿鍥剧墖搴曢儴闃村奖
+ var btnShadow = new PicViewControl(994, 588);
+ btnShadow.Y = Application.GetRealHeight(58);
+ btnShadow.Gravity = Gravity.CenterHorizontal;
+ btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
+ bodyFrameLayout.AddChidren(btnShadow);
//鎴块棿鍥剧墖
var btnPic = new ImageView();
btnPic.Y = Application.GetRealHeight(60);
- btnPic.Width = Application.GetMinRealAverage(887);
- btnPic.Height = Application.GetMinRealAverage(444);
+ btnPic.Width = Application.GetMinRealAverage(965);
+ btnPic.Height = Application.GetMinRealAverage(544);
btnPic.Radius = (uint)Application.GetRealHeight(17);
btnPic.Gravity = Gravity.CenterHorizontal;
btnPic.ImagePath = "RoomIcon/0.JPG";
bodyFrameLayout.AddChidren(btnPic);
- var btnShadow = new PicViewControl(916, 487);
- btnShadow.Y = btnPic.Y;
- btnShadow.Gravity = Gravity.CenterHorizontal;
- btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
- bodyFrameLayout.AddChidren(btnShadow);
- btnShadow.MouseUpEventHandler += (sender, e) =>
+ //鍥剧墖閬僵
+ var btnZhezhao = new FrameLayout();
+ btnZhezhao.Width = btnPic.Width;
+ btnZhezhao.Height = btnPic.Height;
+ btnZhezhao.Y = btnPic.Y;
+ btnZhezhao.Gravity = Gravity.CenterHorizontal;
+ btnZhezhao.Radius = btnPic.Radius;
+ bodyFrameLayout.AddChidren(btnZhezhao);
+ btnZhezhao.MouseUpEventHandler += (sender, e) =>
{
//鎴块棿鍥剧墖閫夋嫨
this.RoomPictrueSelect(btnPic);
@@ -79,10 +100,6 @@
newRoom.BackgroundImage = btnPic.ImagePath;
newRoom.Humidity = -1000;
newRoom.Temperatrue = -1000;
-
- //鍒濆鍖栨甯�
- var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 562, 1175);
//娣诲姞鍏ㄩ儴鑿滃崟
this.AddAllMenuRow(tableContr, btnPic);
@@ -180,6 +197,14 @@
}
newRoom.FloorId = this.floorKeys;
+ if (newRoom.Humidity == -1000)
+ {
+ newRoom.Humidity = 0;
+ }
+ if (newRoom.Temperatrue == -1000)
+ {
+ newRoom.Temperatrue = 0;
+ }
HdlRoomLogic.Current.AddRoom(newRoom);
this.FinishEditorEvent?.Invoke();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
index 05ce2f0..a849299 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -69,11 +69,29 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ //鍔犱竴涓櫧鑹茶儗鏅�
+ var frameBack1 = new FrameLayout();
+ frameBack1.Height = Application.GetRealHeight(450);
+ frameBack1.Y = Application.GetRealHeight(196);
+ frameBack1.BackgroundColor = UserCenterColor.Current.White;
+ frameBack1.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+ bodyFrameLayout.AddChidren(frameBack1);
+
+ //鍒濆鍖栦俊鎭甯�
+ var tableContr = new InformationEditorControl();
+ this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 613, 1175);
+
+ //鎴块棿鍥剧墖搴曢儴闃村奖
+ var btnShadow = new PicViewControl(994, 588);
+ btnShadow.Y = Application.GetRealHeight(58);
+ btnShadow.Gravity = Gravity.CenterHorizontal;
+ btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
+ bodyFrameLayout.AddChidren(btnShadow);
//鎴块棿鍥剧墖
var btnPic = new ImageView();
btnPic.Y = Application.GetRealHeight(60);
- btnPic.Width = Application.GetMinRealAverage(887);
- btnPic.Height = Application.GetMinRealAverage(444);
+ btnPic.Width = Application.GetMinRealAverage(965);
+ btnPic.Height = Application.GetMinRealAverage(544);
btnPic.Radius = (uint)Application.GetRealHeight(17);
btnPic.Gravity = Gravity.CenterHorizontal;
if (this.editorRoom.BackgroundImageType == 0)
@@ -85,20 +103,23 @@
btnPic.ImageBytes = Common.Global.ReadFileByHomeId(this.editorRoom.BackgroundImage);
}
bodyFrameLayout.AddChidren(btnPic);
- var btnShadow = new PicViewControl(916, 487);
- btnShadow.Y = btnPic.Y;
- btnShadow.Gravity = Gravity.CenterHorizontal;
- btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
- bodyFrameLayout.AddChidren(btnShadow);
- btnShadow.ButtonClickEvent += (sender, e) =>
+ //鍥剧墖閬僵
+ var btnZhezhao = new FrameLayout();
+ btnZhezhao.Width = btnPic.Width;
+ btnZhezhao.Height = btnPic.Height;
+ btnZhezhao.Y = btnPic.Y;
+ btnZhezhao.Gravity = Gravity.CenterHorizontal;
+ btnZhezhao.Radius = btnPic.Radius;
+ bodyFrameLayout.AddChidren(btnZhezhao);
+ //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+ if (this.editorRoom.IsSharedRoom == false)
{
- //鎴块棿鍥剧墖閫夋嫨
- this.RoomPictrueSelect(btnPic);
- };
-
- //鍒濆鍖栨甯�
- var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 562, 1175);
+ btnZhezhao.MouseUpEventHandler += (sender, e) =>
+ {
+ //鎴块棿鍥剧墖閫夋嫨
+ this.RoomPictrueSelect(btnPic);
+ };
+ }
//娣诲姞鍏ㄩ儴鑿滃崟
this.AddAllMenuRow(tableContr, btnPic);
@@ -132,11 +153,15 @@
btnBelone.AddRightArrow();
//搴曠嚎
btnBelone.AddBottomLine();
- btnBelone.ButtonClickEvent += (sender, e) =>
+ //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+ if (this.editorRoom.IsSharedRoom == false)
{
- //妤煎眰閫夋嫨
- this.ShowSelectFloor(btnBelone);
- };
+ btnBelone.ButtonClickEvent += (sender, e) =>
+ {
+ //妤煎眰閫夋嫨
+ this.ShowSelectFloor(btnBelone);
+ };
+ }
}
//銆愭俯搴︺��
@@ -148,11 +173,15 @@
var btnTemper = rowTemperature.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
//搴曠嚎
rowTemperature.AddBottomLine();
- rowTemperature.ButtonClickEvent += (sender, e) =>
+ //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+ if (this.editorRoom.IsSharedRoom == false)
{
- //鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛�
- this.ShowTemperatrueDevice(btnTemper);
- };
+ rowTemperature.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛�
+ this.ShowTemperatrueDevice(btnTemper);
+ };
+ }
if (string.IsNullOrEmpty(cloneRoom.TemperatrueDevice) == false)
{
//鑾峰彇娓╁害
@@ -168,11 +197,15 @@
var btnHumi = rowHumidity.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
//搴曠嚎
rowHumidity.AddBottomLine();
- rowHumidity.ButtonClickEvent += (sender, e) =>
+ //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+ if (this.editorRoom.IsSharedRoom == false)
{
- //鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛�
- this.ShowHumidityDevice(btnHumi);
- };
+ rowHumidity.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛�
+ this.ShowHumidityDevice(btnHumi);
+ };
+ }
if (string.IsNullOrEmpty(cloneRoom.HumidityDevice) == false)
{
//鑾峰彇婀垮害
@@ -182,6 +215,13 @@
//鍒濆鍖栨甯冨畬鎴�
tableContr.FinishInitControl(bodyFrameLayout, this.listview);
tableContr = null;
+
+ //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+ if (this.editorRoom.IsSharedRoom == true)
+ {
+ return;
+ }
+
//淇濆瓨
var btnFinish = new BottomClickButton();
btnFinish.TextID = R.MyInternationalizationString.uSave;
@@ -220,17 +260,34 @@
}
}
+ bool changedFloor = editorRoom.FloorId != cloneRoom.FloorId;
editorRoom.FloorId = cloneRoom.FloorId;
editorRoom.Name = cloneRoom.Name;
editorRoom.HumidityDevice = cloneRoom.HumidityDevice;
- editorRoom.Humidity = cloneRoom.Humidity;
+ if (cloneRoom.Humidity != -1000)
+ {
+ editorRoom.Humidity = cloneRoom.Humidity;
+ }
editorRoom.TemperatrueDevice = cloneRoom.TemperatrueDevice;
- editorRoom.Temperatrue = cloneRoom.Temperatrue;
+ if (cloneRoom.Temperatrue != -1000)
+ {
+ editorRoom.Temperatrue = cloneRoom.Temperatrue;
+ }
editorRoom.BackgroundImage = cloneRoom.BackgroundImage;
editorRoom.BackgroundImageType = cloneRoom.BackgroundImageType;
editorRoom.Save();
FinishEditorEvent?.Invoke(this.editorRoom.Name);
+ if (changedFloor == false)
+ {
+ //鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎸囧畾鎴块棿鐨勪俊鎭�
+ MainPage.ListRoomViewFrom.Instance.RefreshRoomInfo(this.editorRoom);
+ }
+ else
+ {
+ //鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎴块棿鍒楄〃淇℃伅
+ MainPage.ListRoomViewFrom.Instance.RefreshListRoom();
+ }
this.CloseForm();
};
}
@@ -520,7 +577,7 @@
this.cloneRoom.BackgroundImageType = 1;
imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
System.IO.File.Delete(imagePath);
- }, "HdlPic", 2, 1);
+ }, "HdlPic", 16, 9);
});
//鎴戠殑鐩稿唽
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.MyAblums), () =>
@@ -537,7 +594,7 @@
imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
System.IO.File.Delete(imagePath);
- }, "HdlPic", 2, 1);
+ }, "HdlPic", 16, 9);
});
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index 93cc3e8..30cd414 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -194,7 +194,7 @@
frame.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uCreatFloor), "Item/CreatFloor.png", "Item/CreatFloorSelected.png", () =>
{
//鍒涘缓妤煎眰
- this.CreatOrEditorFloor(null, string.Empty, string.Empty);
+ this.CreatOrEditorFloor(null, null, string.Empty, string.Empty);
});
//鍒涘缓鎴块棿
frame.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uCreatRoom), "Item/RoomIcon.png", "Item/RoomIconSelected.png", () =>
@@ -212,7 +212,7 @@
else if (AppResidenceMode == 1)
{
//鍒涘缓妤煎眰
- this.CreatOrEditorFloor(null, string.Empty, string.Empty);
+ this.CreatOrEditorFloor(null, null, string.Empty, string.Empty);
}
//鏃犳ゼ灞傛ā寮�
else if (AppResidenceMode == 2)
@@ -335,7 +335,7 @@
btnChanged.ButtonClickEvent += (sender, e) =>
{
//鍒涘缓鎴栬�呯紪杈戞ゼ灞�
- this.CreatOrEditorFloor(btnFloor, keys, floorName);
+ this.CreatOrEditorFloor(frameRow, btnFloor, keys, floorName);
};
//鍒犻櫎
@@ -409,7 +409,7 @@
/// <param name="btnFloor"></param>
/// <param name="keys"></param>
/// <param name="floorName"></param>
- private void CreatOrEditorFloor(NormalViewControl btnFloor, string keys, string floorName)
+ private void CreatOrEditorFloor(RowLayoutControl frameRow, NormalViewControl btnFloor, string keys, string floorName)
{
//鐢熸垚涓�涓脊绐楃敾闈�
var dialogForm = new DialogInputControl();
@@ -441,6 +441,8 @@
}
//鐢婚潰鍏抽棴
dialogForm.CloseDialog();
+ //杩樺師宸﹀彸鑿滃崟
+ frameRow?.HideMenu();
if (floorName != textValue)
{
//缂栬緫鎴栬�呭垱寤烘ゼ灞傚悕绉�
@@ -450,6 +452,10 @@
}
Common.Config.Instance.Home.FloorDics[keys] = textValue;
Common.Config.Instance.Home.Save();
+ if (Common.Config.Instance.Home.CurrentFloorId == string.Empty)
+ {
+ Common.Config.Instance.Home.CurrentFloorId = keys;
+ }
if (btnFloor != null)
{
btnFloor.Text = textValue;
@@ -560,6 +566,8 @@
var btnEditor = frameRow.AddEditorControl();
btnEditor.ButtonClickEvent += (sender, e) =>
{
+ //鍏抽棴宸﹀彸鑿滃崟
+ frameRow.HideMenu();
var form = new EditorRoomInforForm();
form.AddForm(room);
form.FinishEditorEvent += (roomName) =>
@@ -707,7 +715,7 @@
//閿欒:缃戝叧瀵硅薄涓㈠け
continue;
}
- var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude);
+ var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude, ShowErrorMode.YES);
if (result == false)
{
//鍏抽棴杩涘害鏉�
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs
index e09e8f8..7ae5aec 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetExistSettionForm.cs
@@ -134,7 +134,7 @@
btnEditor.ButtonClickEvent += (sender, e) =>
{
//缂栬緫鎶ヨ鐩爣
- this.EditorAlarmTarget(btnStatu, data);
+ this.EditorAlarmTarget(row, btnStatu, data);
};
}
@@ -231,7 +231,7 @@
/// </summary>
/// <param name="btnStatu"></param>
/// <param name="resObj"></param>
- private void EditorAlarmTarget(NormalViewControl btnStatu, Safeguard.CatActionResponseObj resObj)
+ private void EditorAlarmTarget(DeviceRoomControl deviceRow, NormalViewControl btnStatu, Safeguard.CatActionResponseObj resObj)
{
var device = Common.LocalDevice.Current.GetDevice(resObj.DeviceAddr, resObj.Epoint);
if (device.Type == DeviceType.DimmableLight//璋冨厜鍣�
@@ -241,6 +241,8 @@
form.AddForm(device, resObj.TaskList);
form.FinishSelectEvent += (statuText, listInfo) =>
{
+ //杩樺師宸﹀彸鑿滃崟
+ deviceRow?.HideMenu();
btnStatu.Text = statuText;
//淇濆瓨缂栬緫鐨勬姤璀︾洰鏍�
this.SaveEditorAlarmTarget(resObj, listInfo);
@@ -252,6 +254,8 @@
form.AddForm(device, resObj.TaskList);
form.FinishSelectEvent += (statuText, listInfo) =>
{
+ //杩樺師宸﹀彸鑿滃崟
+ deviceRow?.HideMenu();
btnStatu.Text = statuText;
//淇濆瓨缂栬緫鐨勬姤璀︾洰鏍�
this.SaveEditorAlarmTarget(resObj, listInfo);
@@ -264,6 +268,8 @@
form.AddForm(device, resObj.TaskList);
form.FinishSelectEvent += (statuText, listInfo) =>
{
+ //杩樺師宸﹀彸鑿滃崟
+ deviceRow?.HideMenu();
btnStatu.Text = statuText;
//淇濆瓨缂栬緫鐨勬姤璀︾洰鏍�
this.SaveEditorAlarmTarget(resObj, listInfo);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
index 8a14e1a..8fa4707 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
@@ -84,15 +84,16 @@
btnArea.TextAlignment = TextAlignment.Center;
btnArea.TextColor = UserCenterColor.Current.TextGrayColor1;
frameBack.AddChidren(btnArea);
- btnArea.ButtonClickEvent += (sender, e) =>
- {
- var form = new AreaCodeSelectForm();
- form.AddForm();
- form.FinishSelectEvent += (code) =>
- {
- btnArea.Text = "+" + code;
- };
- };
+ //鐩墠鍙拡瀵�+86
+ //btnArea.ButtonClickEvent += (sender, e) =>
+ //{
+ // var form = new AreaCodeSelectForm();
+ // form.AddForm();
+ // form.FinishSelectEvent += (code) =>
+ // {
+ // btnArea.Text = "+" + code;
+ // };
+ //};
//鐢佃瘽杈撳叆妗�
var txtPhone = new TextInputControl(Application.GetRealWidth(634), btnArea.Height, false);
txtPhone.X = btnArea.Right + Application.GetRealWidth(35);
diff --git a/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs b/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs
index db26b57..86aa5a4 100755
--- a/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs
@@ -11,17 +11,16 @@
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
Tag = "Login";
}
+
/// <summary>
/// show
/// </summary>
public void Show()
{
- var sceneBtn = new ImageView()
- {
- Width=Application.GetMinRealAverage(1080),
- Height=Application.GetMinRealAverage(1920),
- ImagePath="Logo/2.jpg"
- };
+ var sceneBtn = new ImageView();
+ sceneBtn.Width = this.Width;
+ sceneBtn.Height = this.Height;
+ sceneBtn.ImagePath = "Logo/2.jpg";
AddChidren(sceneBtn);
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
index e6aea15..cd1a3ce 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
@@ -1,8 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
-using System.Timers;
using Shared.Common;
-using Shared.Phone.Device.AC;
using Shared.Phone.Device.CommonForm;
using Shared.Phone.Device.DeviceLogic;
using Shared.Phone.UserCenter;
@@ -188,9 +186,9 @@
roomPageView.Height = Application.GetRealHeight(478);
this.AddChidren(roomPageView);
//绐佸嚭杈硅窛
- roomPageView.TCBJ = Application.GetRealWidth(112);
+ roomPageView.TCBJ = Application.GetRealWidth(124);
//涓や釜page涔嬮棿鐨勯棿璺�
- roomPageView.JMBJ = Application.GetRealWidth(69);
+ roomPageView.JMBJ = Application.GetRealWidth(58);
//褰撳墠鎴块棿
var rList = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
@@ -200,10 +198,6 @@
roomPageView.AddChidren(roomView);
roomView.Init(room);
roomView.HideName(true);
- roomView.action += () =>
- {
- this.ShowForm();
- };
}
//璁剧疆鎴块棿鐨勫垵濮嬮�夋嫨
var curIndex = rList.FindIndex((obj) => obj.Id == HdlRoomLogic.Current.CurrentRoom.Id);
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
index ab9c4c5..8df13b5 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
@@ -1,8 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
using Shared.Common;
-using ZigBee.Device;
-using Shared.Phone.Device.AC;
using System.Text;
namespace Shared.Phone.UserView
@@ -10,7 +8,7 @@
/// <summary>
/// User page.
/// </summary>
- public class UserPage : FrameLayout, ZigBee.Common.IStatus
+ public class UserPage : FrameLayout
{
#region 鈼� 鍙橀噺_______________________
/// <summary>
@@ -43,306 +41,6 @@
private static readonly int tabBarEnumName_Y = 98;
#endregion
- #region 鈼� 鎺ュ彛____________________________
-
- /// <summary>
- /// 璇ユ帴鍙e皢寮冪敤 !!!!!!
- /// 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- var myDevice = LocalDevice.Current.GetDevice(common.DeviceAddr, common.DeviceEpoint);
- if (myDevice == null)
- {
- return;
- }
- //璁惧涓婃姤鐘舵�佷腑 褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (typeTag == "DeviceStatusReport")
- {
- try
- {
- if (common.DeviceStatusReport.AttriBute == null || common.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- switch (myDevice.Type)
- {
- case DeviceType.OnOffOutput:
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var onOffOutputLight = (ToggleLight)myDevice;
- onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
- onOffOutputLight.OnOffStatus = onOffOutputLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- onOffOutputLight.LastDateTime = DateTime.Now;
- }
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (common.DeviceStatusReport.CluterID == 3)
- {
- myDevice.IsOnline = 1;
- myDevice.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.AirSwitch:
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var airSwitch = (AirSwitch)myDevice;
- airSwitch.DeviceStatusReport = common.DeviceStatusReport;
- airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData;
- airSwitch.LastDateTime = DateTime.Now;
- }
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (common.DeviceStatusReport.CluterID == 3)
- {
- myDevice.IsOnline = 1;
- myDevice.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.WindowCoveringDevice:
- if (common.DeviceStatusReport.CluterID == 258)
- {
- var rollershade = (Rollershade)myDevice;
- rollershade.DeviceStatusReport = common.DeviceStatusReport;
- var attriButeList = rollershade.DeviceStatusReport.AttriBute;
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- rollershade.WcdType = attriButeList[0].AttriButeData;
- rollershade.LastDateTime = DateTime.Now;
- break;
- }
- }
- if (common.DeviceStatusReport.CluterID == 3)
- {
- myDevice.IsOnline = 1;
- myDevice.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.Thermostat:
- //AC鍔熻兘
- if (common.DeviceStatusReport.CluterID == 513)
- {
- var ac = (AC)myDevice;
- ac.DeviceStatusReport = common.DeviceStatusReport;
- var attriButeList = ac.DeviceStatusReport.AttriBute;
- foreach (var attList in attriButeList)
- {
- //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
- var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
- switch (attList.AttributeId)
- {
- case 0:
- ac.currentLocalTemperature = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 17:
- ac.currentCoolingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 18:
- ac.currentHeatingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentAutoSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 28:
- ac.currentSystemMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4097:
- ac.CleanStatu = attList.AttriButeData == 42;
- break;
- }
- }
- }
-
- if (common.DeviceStatusReport.CluterID == 514)
- {
- var ac = (AC)myDevice;
- var attriButeList = common.DeviceStatusReport.AttriBute;
- ac.DeviceStatusReport = common.DeviceStatusReport;
- foreach (var attList in attriButeList)
- {
- switch (attList.AttributeId)
- {
- case 0:
- ac.currentFanMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentFanSwingMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- }
- }
- }
-
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (common.DeviceStatusReport.CluterID == 3)
- {
- myDevice.IsOnline = 1;
- myDevice.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.DimmableLight:
- //璋冨厜鐏姛鑳�
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var dimmableLight = (DimmableLight)myDevice;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- dimmableLight.LastDateTime = DateTime.Now;
- }
- //浜害
- if (common.DeviceStatusReport.CluterID == 8)
- {
- var dimmableLight = (DimmableLight)myDevice;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- dimmableLight.Level = attriButeList[0].AttriButeData;
- dimmableLight.LastDateTime = DateTime.Now;
- break;
- }
- }
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (common.DeviceStatusReport.CluterID == 3)
- {
- myDevice.IsOnline = 1;
- myDevice.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.TemperatureSensor:
- //娓╁害
- if (common.DeviceStatusReport.CluterID == 1026)
- {
- var tempera = (TemperatureSensor)myDevice;
- foreach (var data in common.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- tempera.Temperatrue = 0;
- }
- else if (data.AttriButeData > 32767)
- {
- //璐熸暟(鐗规畩澶勭悊)
- string strValue = (data.AttriButeData - 65536).ToString();
- //灏忔暟鐐归渶瑕佷竴浣�
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- }
- }
- }
- //婀垮害
- if (common.DeviceStatusReport.CluterID == 1029)
- {
- var tempera = (TemperatureSensor)myDevice;
- foreach (var data in common.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- tempera.Humidity = 0;
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- tempera.LastDateTime = DateTime.Now;
- }
- }
- }
- }
- break;
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- }
- //璁惧鍦ㄧ嚎鐘舵�佷笂鎶�
- else if (typeTag == "OnlineStatusChange")
- {
- myDevice.IsOnline = common.IsOnline;
- //璁板綍鍥炲鏃堕棿
- myDevice.LastDateTime = DateTime.Now;
- }
- else if (typeTag == "IASInfoReport")
- {
- try
- {
- switch (myDevice.Type)
- {
- case DeviceType.IASZone:
- var iAS = (IASZone)myDevice;
- iAS.iASInfo = (common as IASZone).iASInfo;
- iAS.LastDateTime = DateTime.Now;
- break;
- }
- }
- catch { }
- }
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
- }
- #endregion
-
/// <summary>
/// 鐢ㄦ埛鐣岄潰
/// </summary>
@@ -365,7 +63,6 @@
public UserPage()
{
BackgroundColor = Shared.Common.ZigbeeColor.Current.MainColor;
- ZbGateway.StatusList.Add(this);
Shared.Application.LocationAction += (lon, lat) =>
{
Login.AccountLogic.Instance.ReceiveAppLatAndLon(lon.ToString(), lat.ToString());
@@ -508,10 +205,25 @@
SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
Gravity = Gravity.CenterHorizontal,
TextSize = 10
- };
+ };
#endregion
+
+ #region 寮哄埗鏄剧ず鑷姩鍖栫晫闈�
+ /// <summary>
+ /// 寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈�
+ /// </summary>
+ public void ShowCategoryAutoListForm()
+ {
+ //鍏抽棴鍏ㄩ儴鐣岄潰,鐩村埌涓婚〉涓烘
+ UserCenter.UserCenterLogic.CloseAllOpenForm();
+ //寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈�
+ UserCenter.UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2;
+ BottomEventHandler(Instance.categoryIMG, null);
+ }
+ #endregion
+
EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) =>
{
if (sender == Instance.homePageIMG || sender == Instance.homePageName)
@@ -533,7 +245,7 @@
Instance.settingName.IsSelected = false;
Instance.settingIMG.IsSelected = false;
- var home = new MainPage.UserHomeView2();
+ var home = new MainPage.HomeMainPageForm();
Instance.BodyView.AddChidren(home);
home.ShowForm();
@@ -558,9 +270,9 @@
Instance.settingName.IsSelected = false;
Instance.settingIMG.IsSelected = false;
- var category = new Phone.Device.Category.Category { };
+ var category = new Category.CategoryMainForm { };
Instance.BodyView.AddChidren(category);
- category.Show();
+ category.ShowForm();
}
else if (sender == Instance.settingIMG || sender == Instance.settingName)
{
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
index 30ae20b..89ec837 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
@@ -145,7 +145,11 @@
FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(broadcastIpAddress, 7624), broadBytes);
}
}
- catch { }
+ catch
+ {
+ //鍏抽棴Socket,涓嬫鍙戦�佷細鑷姩杩炴帴
+ FindGateWaySocket.Stop();
+ }
System.Threading.Thread.Sleep(500);
}
})
@@ -277,7 +281,11 @@
}
}
}
- catch { }
+ catch
+ {
+ //鍏抽棴Socket,涓嬫鍙戦�佷細鑷姩杩炴帴
+ FindGateWaySocket.Stop();
+ }
}
#endregion
}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/IStatus.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/IStatus.cs
index 4b5ed3c..60131a7 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Common/IStatus.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/IStatus.cs
@@ -9,10 +9,6 @@
{
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// </summary>
- void Changed(Device.CommonDevice common);
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
/// <para>typeTag锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
/// <para>typeTag锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
/// <para>typeTag锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
@@ -20,17 +16,6 @@
/// <para>typeTag锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
/// </summary>
void DeviceInfoChange(Device.CommonDevice common, string typeTag);
-
- /// <summary>
- /// 閫昏緫淇℃伅鏇存柊鎺ュ彛
- /// </summary>
- void ChangedILogicStatus(ZigBee.Device.Logic logic);
-
- /// <summary>
- /// 鍦烘櫙淇℃伅鏇存柊鎺ュ彛
- /// </summary>
- void ChangedISceneStatus(ZigBee.Device.Scene scene);
-
}
}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
index 713effb..1528024 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -10,6 +10,11 @@
{
[Newtonsoft.Json.JsonIgnore]
public DateTime LastDateTime = DateTime.MinValue;
+ /// <summary>
+ /// 鏄惁宸茬粡璇诲彇浜嗚澶囩姸鎬�(姝ゅ睘鎬ф槸缁欎富椤典娇鐢ㄧ殑)
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public bool HadReadDeviceStatu = false;
/// <summary>
/// 璋冭瘯鏃舵墦寮�鎵撳嵃淇℃伅锛宼rue:鎵撳嵃锛宖alse:涓嶆墦鍗�
@@ -1151,198 +1156,8 @@
if (topic == gatewayID + "/" + "DeviceRenameRespon")
{
- var deviceID = jobject.Value<int>("Device_ID");
- switch ((DeviceType)(deviceID))
- {
- case DeviceType.OnOffOutput:
- var toggleLight = new ToggleLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- toggleLight.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.DeviceRenameResponseData>(jobject["Data"].ToString());
-
- if (toggleLight.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = toggleLight.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var infoToggleLight = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr && obj.DeviceEpoint == toggleLight.DeviceEpoint);
- if (infoToggleLight != null)
- {
- infoToggleLight.DeviceEpointName = toggleLight.renameDeviceData.DeviceName;
- }
- }
- break;
- case DeviceType.AirSwitch:
- var airSwitch = new AirSwitch() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- airSwitch.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch.DeviceRenameResponseData>(jobject["Data"].ToString());
-
- if (airSwitch.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = airSwitch.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var infoAirSwitch = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == airSwitch.DeviceID && obj.DeviceAddr == airSwitch.DeviceAddr && obj.DeviceEpoint == airSwitch.DeviceEpoint);
- if (infoAirSwitch != null)
- {
- infoAirSwitch.DeviceEpointName = airSwitch.renameDeviceData.DeviceName;
- //infoAirSwitch.ReSave();
- }
- }
- break;
- case DeviceType.OnOffSwitch:
- var panelObj = new Panel() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- panelObj.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.DeviceRenameResponseData>(jobject["Data"].ToString());
- if (panelObj.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = panelObj.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var infoPanel = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == panelObj.DeviceID && obj.DeviceAddr == panelObj.DeviceAddr && obj.DeviceEpoint == panelObj.DeviceEpoint);
- if (infoPanel != null)
- {
- infoPanel.DeviceEpointName = panelObj.renameDeviceData.DeviceName;
- //infoPanel.ReSave();
- }
- }
- break;
- case DeviceType.WindowCoveringDevice:
- var windowCovering = new Rollershade() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- windowCovering.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.DeviceRenameResponseData>(jobject["Data"].ToString());
- if (windowCovering.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = windowCovering.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}");
- var wc = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == windowCovering.DeviceID && obj.DeviceAddr == windowCovering.DeviceAddr && obj.DeviceEpoint == windowCovering.DeviceEpoint);
- if (wc != null)
- {
- wc.DeviceEpointName = windowCovering.renameDeviceData.DeviceName;
- }
- }
-
- break;
- case DeviceType.IASZone:
- var ias = new IASZone() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- ias.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.DeviceRenameResponseData>(jobject["Data"].ToString());
- if (ias.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = ias.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}");
-
- var zone = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr && obj.DeviceEpoint == ias.DeviceEpoint);
- if (zone != null)
- {
- zone.DeviceEpointName = ias.renameDeviceData.DeviceName;
- }
- }
- break;
- case DeviceType.DimmableLight:
- var dimmableLight = new DimmableLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- dimmableLight.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.DeviceRenameResponseData>(jobject["Data"].ToString());
-
- if (dimmableLight.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = dimmableLight.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr && obj.DeviceEpoint == dimmableLight.DeviceEpoint);
- if (info != null)
- {
- info.DeviceEpointName = dimmableLight.renameDeviceData.DeviceName;
- }
- }
- break;
- case DeviceType.Repeater:
- var repeater = new Repeater() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- repeater.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<Repeater.DeviceRenameResponseData>(jobject["Data"].ToString());
-
- if (repeater.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = repeater.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == repeater.DeviceID && obj.DeviceAddr == repeater.DeviceAddr && obj.DeviceEpoint == repeater.DeviceEpoint);
- if (info != null)
- {
- info.DeviceEpointName = repeater.renameDeviceData.DeviceName;
- }
- }
- break;
- case DeviceType.Thermostat:
- var ac = new AC() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- ac.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<AC.DeviceRenameResponseData>(jobject["Data"].ToString());
- if (ac.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = ac.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ac.DeviceID && obj.DeviceAddr == ac.DeviceAddr && obj.DeviceEpoint == ac.DeviceEpoint);
- if (info != null)
- {
- info.DeviceEpointName = ac.renameDeviceData.DeviceName;
- }
- }
- break;
- case DeviceType.Transverter:
- var transverter = new Transverter() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- transverter.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter.DeviceRenameResponseData>(jobject["Data"].ToString());
- if (transverter.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = transverter.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == transverter.DeviceID && obj.DeviceAddr == transverter.DeviceAddr && obj.DeviceEpoint == transverter.DeviceEpoint);
- if (info != null)
- {
- info.DeviceEpointName = transverter.renameDeviceData.DeviceName;
- }
- }
- break;
- case DeviceType.DoorLock:
- var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- doorLock.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock.DeviceRenameResponseData>(jobject["Data"].ToString());
- if (doorLock.renameDeviceData == null)
- {
- d = new DeviceRenameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new DeviceRenameAllData { deviceRenameData = doorLock.renameDeviceData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == doorLock.DeviceID && obj.DeviceAddr == doorLock.DeviceAddr && obj.DeviceEpoint == doorLock.DeviceEpoint);
- if (info != null)
- {
- info.DeviceEpointName = doorLock.renameDeviceData.DeviceName;
- }
- }
- break;
- }
+ var receiptData = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceRenameResponseData>(jobject["Data"].ToString());
+ d = new DeviceRenameAllData { deviceRenameData = receiptData };
}
};
Gateway.Actions += action;
@@ -1835,210 +1650,6 @@
{
d = new RemoveDeviceResponseAllData { removeDeviceResponseData = gatewayTemp.removeDeviceResponseData };
System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- try
- {
- if (gatewayTemp.removeDeviceResponseData.Result == 0)
- {
- foreach (var delD in gatewayTemp.removeDeviceResponseData.DeviceList)
- {
- var deviceID = delD.Device_ID;
- switch ((DeviceType)(deviceID))
- {
- case DeviceType.OnOffOutput:
- var toggleLight = new ToggleLight() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- toggleLight.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (toggleLight.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (toggleLight.removeDeviceResponseData.Result == 0)
- {
- var infoToggleLight = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr && obj.DeviceEpoint == toggleLight.DeviceEpoint);
- if (infoToggleLight != null)
- {
- Gateway.DeviceList.Remove(infoToggleLight);
- }
- }
- }
- break;
- case DeviceType.AirSwitch:
- var airSwitch = new AirSwitch() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- airSwitch.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (airSwitch.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (airSwitch.removeDeviceResponseData.Result == 0)
- {
- var infoAirSwitch = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == airSwitch.DeviceID && obj.DeviceAddr == airSwitch.DeviceAddr && obj.DeviceEpoint == airSwitch.DeviceEpoint);
- if (infoAirSwitch != null)
- {
- Gateway.DeviceList.Remove(infoAirSwitch);
- }
- }
- }
- break;
- case DeviceType.OnOffSwitch:
- var panelObj = new Panel() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- panelObj.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (panelObj.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (panelObj.removeDeviceResponseData.Result == 0)
- {
- var infoPanel = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == panelObj.DeviceID && obj.DeviceAddr == panelObj.DeviceAddr && obj.DeviceEpoint == panelObj.DeviceEpoint);
- if (infoPanel != null)
- {
- Gateway.DeviceList.Remove(infoPanel);
- }
- }
- }
- break;
- case DeviceType.WindowCoveringDevice:
- var rollershade = new Rollershade() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- rollershade.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (rollershade.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (rollershade.removeDeviceResponseData.Result == 0)
- {
- var infoRoller = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == rollershade.DeviceID && obj.DeviceAddr == rollershade.DeviceAddr && obj.DeviceEpoint == rollershade.DeviceEpoint);
- if (infoRoller != null)
- {
- Gateway.DeviceList.Remove(infoRoller);
- }
- }
- }
- break;
- case DeviceType.IASZone:
- var ias = new IASZone() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- ias.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (ias.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (ias.removeDeviceResponseData.Result == 0)
- {
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr && obj.DeviceEpoint == ias.DeviceEpoint);
- if (info != null)
- {
- Gateway.DeviceList.Remove(info);
- }
- }
- }
- break;
- case DeviceType.DimmableLight:
- var dimmableLight = new DimmableLight() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- dimmableLight.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (dimmableLight.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (dimmableLight.removeDeviceResponseData.Result == 0)
- {
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr && obj.DeviceEpoint == dimmableLight.DeviceEpoint);
- if (info != null)
- {
- Gateway.DeviceList.Remove(info);
- }
- }
- }
- break;
- case DeviceType.Repeater:
- var repeater = new Repeater() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- repeater.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<Repeater.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (repeater.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (repeater.removeDeviceResponseData.Result == 0)
- {
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == repeater.DeviceID && obj.DeviceAddr == repeater.DeviceAddr && obj.DeviceEpoint == repeater.DeviceEpoint);
- if (info != null)
- {
- Gateway.DeviceList.Remove(info);
- }
- }
- }
- break;
- case DeviceType.Thermostat:
- var ac = new AC() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- ac.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AC.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (ac.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (ac.removeDeviceResponseData.Result == 0)
- {
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ac.DeviceID && obj.DeviceAddr == ac.DeviceAddr && obj.DeviceEpoint == ac.DeviceEpoint);
- if (info != null)
- {
- Gateway.DeviceList.Remove(info);
- }
- }
- }
- break;
- case DeviceType.Transverter:
- var transverter = new Transverter() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- transverter.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (transverter.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (transverter.removeDeviceResponseData.Result == 0)
- {
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == transverter.DeviceID && obj.DeviceAddr == transverter.DeviceAddr && obj.DeviceEpoint == transverter.DeviceEpoint);
- if (info != null)
- {
- Gateway.DeviceList.Remove(info);
- }
- }
- }
- break;
- case DeviceType.DoorLock:
- var doorLock = new DoorLock() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- doorLock.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock.RemoveDeviceResponseData>(jobject["Data"].ToString());
- if (doorLock.removeDeviceResponseData == null)
- {
- return;
- }
- else
- {
- if (doorLock.removeDeviceResponseData.Result == 0)
- {
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == doorLock.DeviceID && obj.DeviceAddr == doorLock.DeviceAddr && obj.DeviceEpoint == doorLock.DeviceEpoint);
- if (info != null)
- {
- Gateway.DeviceList.Remove(info);
- }
- }
- }
- break;
- }
- }
- }
- }
- catch { }
}
}
};
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
index 0dd69e0..1fc9f8f 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
@@ -1401,8 +1401,8 @@
/// <summary>
/// 鐘舵�佸��
/// <para>榛樿鍝嶅簲缁撴灉锛�
- ///<para>0 鍒犻櫎鎴愬姛</para>
- ///<para>1 鍒犻櫎澶辫触</para>
+ ///<para>0 鎴愬姛</para>
+ ///<para>1 澶辫触</para>
///<para>2 鐢ㄦ埛涓嶅瓨鍦�</para>
///<para>32 鍐荤粨鎴愬姛</para>
///<para>34 鍐荤粨澶辫触</para>
@@ -1789,7 +1789,7 @@
#region 涓存椂瀵嗙爜鍙戦�佹暟鎹�
///<summary >
- ///杩滅▼寮�閿�
+ ///涓存椂瀵嗙爜
///<para>inputPassword: 杈撳叆瀵嗙爜/para>
/// </summary>
public async System.Threading.Tasks.Task<TempPasswordResponseAllData> TempPasswordAsync(string inputPassword, System.DateTime startTime, System.DateTime endTime, string fixedPassword = "190605")
@@ -2340,6 +2340,597 @@
}
#endregion
+ #region 闊抽噺
+ ///<summary >
+ ///鑾峰彇闊抽噺
+ /// </summary>
+ public async System.Threading.Tasks.Task<VolumeResponseAllData> GetVolumeAsync()
+ {
+ VolumeResponseAllData result = null;
+ if (Gateway == null)
+ {
+ result = new VolumeResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+ return result;
+ }
+ return await System.Threading.Tasks.Task.Run(async () =>
+ {
+ Action<string, string> action = (topic, message) =>
+ {
+ var gatewayID = topic.Split('/')[0];
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
+
+ if (topic == gatewayID + "/" + "Error_Respon")
+ {
+ var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
+
+ if (temp == null)
+ {
+ result = new VolumeResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+ }
+
+ else
+ {
+ result = new VolumeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+ }
+ }
+ if (topic == gatewayID + "/" + "ZbDataPassthrough")
+ {
+ var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+ gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+ if (gatewayTemp.clientDataPassthroughResponseData == null)
+ {
+ result = new VolumeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+ }
+ else
+ {
+ if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+ {
+ var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+ if (data.Length == 14)
+ {
+ var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+ if (command == "0456")
+ {
+ var tempD = new VolumeResponseData();
+ tempD.command = data[10].ToString() + data[11].ToString();
+ tempD.value = Convert.ToInt32(data[13].ToString(), 16);
+ result = new VolumeResponseAllData { volumeResponseData = tempD };
+ DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0456_{ topic}");
+ }
+ }
+ }
+ }
+ }
+ };
+
+ Gateway.Actions += action;
+ DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+ try
+ {
+ var passData = VolumeData(-1);
+ var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+ var data = new JObject { { "PassData", passData } };
+ jObject.Add("Data", data);
+ Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+ }
+ catch { }
+
+ var dateTime = DateTime.Now;
+ while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+ {
+ await System.Threading.Tasks.Task.Delay(10);
+ if (result != null && result.volumeResponseData != null)
+ {
+ break;
+ }
+ }
+ if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+ {
+ result = new VolumeResponseAllData
+ { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+ }
+ Gateway.Actions -= action;
+ DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+ return result;
+ });
+ }
+
+ ///<summary >
+ ///闊抽噺
+ ///<para>鍛戒护鍊�: comandValue</para>
+ ///<para>comandValue: 0 闈欓煶</para>
+ ///<para>comandValue:1 鏈�灏忛煶閲�</para>
+ ///<para>comandValue:2~13 闊抽噺 </para>
+ ///<para>comandValue:14 鏈�澶ч煶閲�</para>
+ /// </summary>
+ public async System.Threading.Tasks.Task<DefaultControlResponseAllData> SetVolumeAsync(int comandValue)
+ {
+ DefaultControlResponseAllData result = null;
+ if (Gateway == null)
+ {
+ result = new DefaultControlResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+ return result;
+ }
+ return await System.Threading.Tasks.Task.Run(async () =>
+ {
+ Action<string, string> action = (topic, message) =>
+ {
+ var gatewayID = topic.Split('/')[0];
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
+
+ if (topic == gatewayID + "/" + "Error_Respon")
+ {
+ var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
+
+ if (temp == null)
+ {
+ result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+ }
+
+ else
+ {
+ result = new DefaultControlResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+ }
+ }
+ if (topic == gatewayID + "/" + "ZbDataPassthrough")
+ {
+ var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+ gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+ if (gatewayTemp.clientDataPassthroughResponseData == null)
+ {
+ result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+ }
+ else
+ {
+ if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+ {
+ var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+ if (data.Length == 16)
+ {
+ var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+ if (command == "0002")
+ {
+ var tempD = new DefaultControlResponseData();
+ tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
+ tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+ if (tempD.command == "0455")
+ {
+ result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
+ DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0456_{ topic}");
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ Gateway.Actions += action;
+ DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+ try
+ {
+ var passData = VolumeData(comandValue);
+ var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+ var data = new JObject { { "PassData", passData } };
+ jObject.Add("Data", data);
+ Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+ }
+ catch { }
+
+ var dateTime = DateTime.Now;
+ while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+ {
+ await System.Threading.Tasks.Task.Delay(10);
+ if (result != null && result.defaultControlResponseData != null)
+ {
+ break;
+ }
+ }
+ if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+ {
+ result = new DefaultControlResponseAllData
+ { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+ }
+ Gateway.Actions -= action;
+ DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+ return result;
+ });
+ }
+
+ /// <summary>
+ /// 闊抽噺鍙戦�佹暟鎹�
+ ///<para>comandValue: 0 闈欓煶</para>
+ ///<para>comandValue:1 鏈�灏忛煶閲�</para>
+ ///<para>comandValue:2~13 闊抽噺 </para>
+ ///<para>comandValue:14 鏈�澶ч煶閲�</para>
+ /// </summary>
+ public string VolumeData(int comandValue)
+ {
+ string data = "";
+ string dataLength = "05";
+ string dataComand1 = "55";
+ string dataComand2 = "04";
+ string dataSerialNum = "01";
+ string addDataLength = "01";
+ string cValue = "";
+ try
+ {
+ if (comandValue >= 1)
+ {
+ //comandValue = comandValue * 100;
+ //float v = (float)100 / 15;
+ //int vv = Convert.ToInt32(v * 100);
+ //var comandValueTemp = comandValue / vv;
+ //if (comandValueTemp == 0)
+ //{
+ // comandValueTemp = 1;
+ //}
+ cValue = Convert.ToString(comandValue, 16).ToUpper();
+ cValue = "F" + cValue;
+ }
+ else
+ {
+ switch (comandValue)
+ {
+ case -1:
+ cValue = "AA";
+ break;
+ case 0:
+ cValue = "EB";
+ break;
+ }
+ }
+ data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+ cValue;
+ }
+ catch (Exception ex)
+ {
+ var mess = ex.Message;
+ };
+ return data;
+ }
+
+ /// <summary>
+ /// 闊抽噺鍥炲鏁版嵁
+ /// </summary>
+ public VolumeResponseAllData volumeResponseAllData;
+ [System.Serializable]
+ public class VolumeResponseAllData
+ {
+ /// <summary>
+ /// 閿欒淇℃伅
+ /// </summary>
+ public string errorMessageBase;
+ /// <summary>
+ /// 缃戝叧淇℃伅閿欒鍙嶉
+ /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+ /// </summary>
+ public ErrorResponData errorResponData;
+ /// <summary>
+ /// 闊抽噺鍥炲鏁版嵁
+ /// </summary>
+ public VolumeResponseData volumeResponseData;
+ }
+
+ /// <summary>
+ /// 闊抽噺鍥炲鏁版嵁
+ /// </summary>
+ [System.Serializable]
+ public class VolumeResponseData
+ {
+ /// <summary>
+ ///鍛戒护
+ ///<para>0x00 鎺ユ敹鎴愬姛</para>
+ ///<para>0xea 璇煶妯″紡</para>
+ ///<para>0xeb 闈欓煶妯″紡</para>
+ /// </summary>
+ public string command = "";
+ /// <summary>
+ /// 闊抽噺鍊�
+ /// <para>0xf1~0xfe 1-14闊抽噺</para>
+ /// <para>0 鏃犻煶閲忓��</para>
+ /// </summary>
+ public int value = -1;
+ }
+ #endregion
+
+ #region 甯稿紑妯″紡聽聽聽 聽聽聽聽聽
+ /// <summary>
+ /// 璇诲彇甯稿紑妯″紡
+ /// </summary>
+ /// <returns></returns>
+ public async System.Threading.Tasks.Task<OpenModeResponseAllData> ReadNormallyOpenModeFuncAsync()
+ {
+ OpenModeResponseAllData result = null;
+ if (Gateway == null)
+ {
+ result = new OpenModeResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+ return result;
+ }
+ return await System.Threading.Tasks.Task.Run(async () =>
+ {
+ Action<string, string> action = (topic, message) =>
+ {
+ var gatewayID = topic.Split('/')[0];
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
+
+ if (topic == gatewayID + "/" + "Error_Respon")
+ {
+ var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
+
+ if (temp == null)
+ {
+ result = new OpenModeResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+ }
+
+ else
+ {
+ result = new OpenModeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+ }
+ }
+ if (topic == gatewayID + "/" + "ZbDataPassthrough")
+ {
+ var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+ gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+ if (gatewayTemp.clientDataPassthroughResponseData == null)
+ {
+ result = new OpenModeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+ }
+ else
+ {
+ if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+ {
+ var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+ if (data.Length == 12)
+ {
+ var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+ if (command == "0458")
+ {
+ result = new OpenModeResponseAllData();
+ result.command = data[10].ToString() + data[11].ToString();
+ DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0457_{ topic}");
+ }
+ }
+ }
+ }
+ }
+ };
+
+ Gateway.Actions += action;
+ DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+ try
+ {
+ var passData = OpenModeData(SwitchMode.Obtain);
+ var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+ var data = new JObject { { "PassData", passData } };
+ jObject.Add("Data", data);
+ Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+ }
+ catch { }
+
+ var dateTime = DateTime.Now;
+ while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+ {
+ await System.Threading.Tasks.Task.Delay(10);
+ if (result != null)
+ {
+ break;
+ }
+ }
+ if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+ {
+ result = new OpenModeResponseAllData
+ { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+ }
+ Gateway.Actions -= action;
+ DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+ return result;
+ });
+ }
+
+ /// <summary>
+ /// 璁剧疆甯稿紑妯″紡
+ /// </summary>
+ /// <param name="IsNormallyOpenMode">鏄惁鎵撳紑甯稿紑妯″紡锛歵rue锛氭墦寮� false锛氬叧闂�</param>
+ /// <returns></returns>
+ public async System.Threading.Tasks.Task<DefaultControlResponseAllData> SetNormallyOpenModeFuncAsync(bool IsNormallyOpenMode)
+ {
+ DefaultControlResponseAllData result = null;
+ if (Gateway == null)
+ {
+ result = new DefaultControlResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+ return result;
+ }
+ return await System.Threading.Tasks.Task.Run(async () =>
+ {
+ Action<string, string> action = (topic, message) =>
+ {
+ var gatewayID = topic.Split('/')[0];
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
+
+ if (topic == gatewayID + "/" + "Error_Respon")
+ {
+ var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
+
+ if (temp == null)
+ {
+ result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+ }
+
+ else
+ {
+ result = new DefaultControlResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+ }
+ }
+ if (topic == gatewayID + "/" + "ZbDataPassthrough")
+ {
+ var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+ gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+ if (gatewayTemp.clientDataPassthroughResponseData == null)
+ {
+ result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+ }
+ else
+ {
+ if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+ {
+ var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+ if (data.Length == 16)
+ {
+ var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+ if (command == "0002")
+ {
+ var tempD = new DefaultControlResponseData();
+ tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
+ tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+ if (tempD.command == "0457")
+ {
+ result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
+ DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0457_{ topic}");
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ Gateway.Actions += action;
+ DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+ try
+ {
+ var passData = "";
+ if (IsNormallyOpenMode)
+ {
+ passData = OpenModeData(SwitchMode.NormallyOpen);
+ }
+ else
+ {
+ passData = OpenModeData(SwitchMode.NormallyClose);
+ }
+ var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+ var data = new JObject { { "PassData", passData } };
+ jObject.Add("Data", data);
+ Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+ }
+ catch { }
+
+ var dateTime = DateTime.Now;
+ while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+ {
+ await System.Threading.Tasks.Task.Delay(10);
+ if (result != null && result.defaultControlResponseData != null)
+ {
+ break;
+ }
+ }
+ if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+ {
+ result = new DefaultControlResponseAllData
+ { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+ }
+ Gateway.Actions -= action;
+ DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+ return result;
+ });
+ }
+
+ /// <summary>
+ /// 甯稿紑妯″紡聽鍙戦�佹暟鎹�
+ /// </summary>
+ public string OpenModeData(SwitchMode switchMode)
+ {
+ string data = "";
+ string dataLength = "05";
+ string dataComand1 = "57";
+ string dataComand2 = "04";
+ string dataSerialNum = "01";
+ string addDataLength = "01";
+ string cValue = "";
+ try
+ {
+ switch (switchMode)
+ {
+ case SwitchMode.Obtain:
+ cValue = "10";
+ break;
+ case SwitchMode.NormallyOpen:
+ cValue = "12";
+ break;
+ case SwitchMode.NormallyClose:
+ cValue = "13";
+ break;
+ }
+ data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+ cValue;
+ }
+ catch (Exception ex)
+ {
+ var mess = ex.Message;
+ };
+ return data;
+ }
+
+ /// <summary>
+ /// 甯稿紑妯″紡聽鍥炲鏁版嵁
+ /// </summary>
+ public OpenModeResponseAllData openModeResponseAllData;
+ [System.Serializable]
+ public class OpenModeResponseAllData
+ {
+ /// <summary>
+ /// 閿欒淇℃伅
+ /// </summary>
+ public string errorMessageBase;
+ /// <summary>
+ /// 缃戝叧淇℃伅閿欒鍙嶉
+ /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+ /// </summary>
+ public ErrorResponData errorResponData;
+ /// <summary>
+ /// 0x10 甯稿紑宸插紑鍚�
+ /// <para>0x11 甯稿紑宸插叧闂�</para>
+ /// </summary>
+ public string command;
+ }
+
+
+ /// <summary>
+ /// 寮�鍏虫ā寮�
+ /// </summary>
+ public enum SwitchMode
+ {
+ /// <summary>
+ /// 0x10 鏌ヨ甯稿紑鐘舵��
+ /// </summary>
+ Obtain = 0x10,
+ /// <summary>
+ /// 0x12 寮�鍚父寮�
+ /// </summary>
+ NormallyOpen = 0x12,
+ /// <summary>
+ /// 0x13 鍏抽棴甯稿紑
+ /// </summary>
+ NormallyClose = 0x13
+ }
+ #endregion
+
#endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs
index 13d11fe..7943391 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs
@@ -10,6 +10,10 @@
/// </summary>
Basic = 0,
/// <summary>
+ /// 鏌ヨ鐢甸噺
+ /// </summary>
+ Power = 1,
+ /// <summary>
/// 璁惧璇嗗埆鍔熻兘
/// </summary>
Identify = 3,
@@ -303,6 +307,11 @@
/// 纭欢鐗堟湰
/// </summary>
mgHWversion = 65024,
+
+ /// <summary>
+ /// 闂ㄩ攣鐢甸噺
+ /// </summary>
+ DoorLockPower = 33,
}
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Logic.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Logic.cs
deleted file mode 100755
index fe7ef5e..0000000
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Logic.cs
+++ /dev/null
@@ -1,3770 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-using Newtonsoft.Json.Linq;
-
-namespace ZigBee.Device
-{
- [System.Serializable]
- public class Logic
- {
- /// <summary>
- /// 褰撳墠涓荤綉鍏矷D
- /// </summary>
- public string GateWayId;
-
- /// <summary>
- /// 鍏ョ綉璁惧淇℃伅
- /// </summary>
- public int DataID;
-
- /// <summary>
- /// 缃戝叧鍙嶉鐨勬椂闂存埑
- /// </summary>
- public int Time;
-
- [System.Serializable]
- public class LogicBase
- {
- /// <summary>
- /// 閫昏緫id锛岄�昏緫鐨勫敮涓�鏍囪瘑銆傚鏋滆閫昏緫宸茬粡瀛樺湪锛屽垯灏嗗師鏉ラ�昏緫瑕嗙洊銆�
- ///<para>鑻ュ拷鐣ヨ瀛楁鎴栬瀛楁涓�0锛氱綉鍏宠嚜鍔ㄤ负璇ラ�昏緫鍒嗛厤涓�涓湭琚娇鐢ㄧ殑id銆�</para>
- /// </summary>
- public int LogicId;
- }
-
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- ErrorResponData errResponData;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- [System.Serializable]
- public class ErrorResponData
- {
- /// <summary>
- /// Error鍙傛暟鍚箟
- ///<para>1锛氱綉鍏虫棤娉曡В鏋愬懡浠ゆ暟鎹��</para>
- ///<para>2锛氬崗璋冨櫒姝e湪鍗囩骇鎴栧浠�/鎭㈠鏁版嵁
- ///<para>3锛氭搷浣滆澶�/缁�/鍦烘櫙涓嶅瓨鍦�</para>
- ///<para>4锛氬叾浠栭敊璇�</para>
- ///<para>5锛氭暟鎹紶杈撻敊璇紙鍦ㄦ煇娆″鎴风鍚戠綉鍏冲彂閫佹暟鎹殑杩囩▼涓紝缃戝叧鍦ㄥ悎鐞嗘椂闂磋寖鍥村唴鎺ユ敹瀹㈡埛绔暟鎹笉瀹屾暣瀵艰嚧璇ラ敊璇彂鐢熴�傚瀹㈡埛绔悜缃戝叧涓�娆″彂閫�100涓瓧鑺傜殑鏁版嵁锛屼絾缃戝叧绛夊緟鎺ユ敹浜嗕竴绉掑彧鎺ユ敹浜�80涓瓧鑺傘�傚彂鐢熻閿欒锛岀綉鍏冲皢涓诲姩鍏抽棴瀹㈡埛绔繛鎺ワ級</para>
- /// </summary>
- public int Error;
- }
-
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉鐨勫唴瀹�
- /// </summary>
- static string ErrorMess(int err)
- {
- string message = "";
- switch (err)
- {
- case 1:
- message = " 缃戝叧鏃犳硶瑙f瀽鍛戒护鏁版嵁銆�";
- break;
- case 2:
- message = " 鍗忚皟鍣ㄦ鍦ㄥ崌绾ф垨澶囦唤 / 鎭㈠鏁版嵁銆�";
- break;
- case 3:
- message = "鎿嶄綔璁惧 / 缁� / 鍦烘櫙涓嶅瓨鍦�";
- break;
- case 4:
- message = " 鍏朵粬閿欒";
- break;
- case 5:
- message = " 鏁版嵁浼犺緭閿欒锛堝湪鏌愭瀹㈡埛绔悜缃戝叧鍙戦�佹暟鎹殑杩囩▼涓紝缃戝叧鍦ㄥ悎鐞嗘椂闂磋寖鍥村唴鎺ユ敹瀹㈡埛绔暟鎹笉瀹屾暣瀵艰嚧璇ラ敊璇彂鐢熴�傚瀹㈡埛绔悜缃戝叧涓�娆″彂閫�100涓瓧鑺傜殑鏁版嵁锛屼絾缃戝叧绛夊緟鎺ユ敹浜嗕竴绉掑彧鎺ユ敹浜�80涓瓧鑺傘�傚彂鐢熻閿欒锛岀綉鍏冲皢涓诲姩鍏抽棴瀹㈡埛绔繛鎺ワ級";
- break;
- default:
- break;
- }
- return message;
- }
-
- #region 褰撳墠娌℃湁涓荤綉鍏筹紝鏃犳硶杩涜閫昏緫鎿嶄綔
- /// <summary>
- ///褰撳墠娌℃湁涓荤綉鍏筹紝鏃犳硶杩涜閫昏緫鎿嶄綔
- /// </summary>
- public GetLogicErrorData getLogicError;
- /// <summary>
- ///褰撳墠娌℃湁涓荤綉鍏筹紝鏃犳硶杩涜閫昏緫鎿嶄綔
- /// </summary>
- [System.Serializable]
- public class GetLogicErrorData
- {
- /// <summary>
- /// 1锛氱綉鍏充笉鏄富缃戝叧锛屾棤娉曡繘琛岃鎿嶄綔銆�
- /// </summary>
- public int Error;
- }
- #endregion
-
- #region 鍦ㄤ粠缃戝叧涓彂鍦烘櫙鐨勫懡浠ょ殑鍙嶉
- /// <summary>
- ///鍦ㄤ粠缃戝叧涓彂鍦烘櫙鐨勫懡浠ょ殑鍙嶉
- /// </summary>
- public SceneErrorRespon sceneErrorRespon;
- /// <summary>
- ///鍦ㄤ粠缃戝叧涓彂鍦烘櫙鐨勫懡浠ょ殑鍙嶉
- /// </summary>
- [System.Serializable]
- public class SceneErrorRespon
- {
- /// <summary>
- /// 闈炰富缃戝叧涓嶈兘浣跨敤鍦烘櫙鎸囦护銆�
- /// </summary>
- public int Data_ID;
-
- }
- #endregion
-
- #region 娣诲姞鎴栦慨鏀归�昏緫.
- /// <summary>
- /// 娣诲姞鎴栦慨鏀归�昏緫
- /// </summary>
- public static async System.Threading.Tasks.Task<AddLogicResponseAllData> AddLogicAsync(AddLogicData addLogicData)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- AddLogicResponseAllData allData =null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new AddLogicResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
-
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new AddLogicResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new AddLogicResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/AddLogic_Respon")
- {
- try
- {
- var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempTimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<TimeAttributeObj>(jobject["Data"]["TimeAttribute"].ToString());
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetLogicInfoResponseBaseData>(jobject["Data"].ToString());
- if (tempData != null)
- {
- var conditions = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["Conditions"].ToString());
- allData = new AddLogicResponseAllData { };
- var tempD = new GetLogicInfoResponseData { };
- for (int m = 0; conditions != null && m < conditions.Count; m++)
- {
- var condition = conditions[m];
- switch (condition["Type"].ToString())
- {
- case "0":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.TimeConditionsInfo>(condition.ToString()));
- break;
- case "1":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.DeviceConditionsInfo>(condition.ToString()));
- break;
- case "2":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.LogicConditionsInfo>(condition.ToString()));
- break;
- case "3":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.CounterConditionsInfo>(condition.ToString()));
- break;
- case "4":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.CountdownConditionsInfo>(condition.ToString()));
- break;
- case "5":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.TimeBucketConditionsInfo>(condition.ToString()));
- break;
- }
- }
- if (tempTimeAttribute != null) { tempD.TimeAttribute = tempTimeAttribute; }
- if (tempData.LogicName != null) { tempD.LogicName = tempData.LogicName; }
- if (tempData.Actions != null) { tempD.Actions = tempData.Actions; }
- tempD.LogicId = tempData.LogicId;
- tempD.IsEnable = tempData.IsEnable;
- tempD.Relationship = tempData.Relationship;
- tempD.Result = tempData.Result;
- allData.getLogicInfoResponseData = tempD;
-
- var info = ZbGateway.LogicList.Find((Logic.GetLogicInfoResponseData obj) => obj.LogicId == tempData.LogicId);
- if (info == null)
- {
- ZbGateway.LogicList.Add(allData.getLogicInfoResponseData);
- }
- else
- {
- info.LogicName = tempD.LogicName;
- info.Result = tempD.Result;
- info.Relationship = tempD.Relationship;
- info.IsEnable = tempD.IsEnable;
- info.Conditions = tempD.Conditions;
- info.Actions = tempD.Actions;
- info.TimeAttribute = tempD.TimeAttribute;
- }
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- catch(Exception ex){
- var mess = ex.Message;
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/AddLogic_Actions 鍚姩" + System.DateTime.Now.ToString());
-
- try
- {
- if (addLogicData != null)
- {
- var bytes = new byte[32];
- var reamarkGwBytes = System.Text.Encoding.UTF8.GetBytes(addLogicData.LogicName);
- System.Array.Copy(reamarkGwBytes, 0, bytes, 0, 32 < reamarkGwBytes.Length ? 32 : reamarkGwBytes.Length);
- addLogicData.LogicName = System.Text.Encoding.UTF8.GetString(bytes);
-
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2000 } };
- var data = new JObject { };
-
- var conditionsList = new JArray { };
- foreach (var conInfo in addLogicData.Conditions)
- {
- switch (conInfo.Type)
- {
- case 0:
- var timeConditionsObj = conInfo as TimeConditionsInfo;
- var tInfo = new JObject
- {
- ["Type"] = timeConditionsObj.Type,
- ["IsValid"] = timeConditionsObj.IsValid,
- ["DateType"] = timeConditionsObj.DateType,
- ["StartHour"] = timeConditionsObj.StartHour,
- ["StartMin"] = timeConditionsObj.StartMin,
- ["AdjustTime"] = timeConditionsObj.AdjustTime,
- ["RemindTime"] = timeConditionsObj.RemindTime,
- ["EnDelay"] = timeConditionsObj.EnDelay,
- ["DelayTime"] = timeConditionsObj.DelayTime
- };
- conditionsList.Add(tInfo);
- break;
- case 1:
- var deviceConditionsObj = conInfo as DeviceConditionsInfo;
- var dInfo = new JObject
- {
- ["Type"] = deviceConditionsObj.Type,
- ["IsValid"] = deviceConditionsObj.IsValid,
- ["MacAddr"] = deviceConditionsObj.MacAddr,
- ["Epoint"] = deviceConditionsObj.Epoint,
- ["Cluster_ID"] = deviceConditionsObj.Cluster_ID,
- ["AttriButeId"] = deviceConditionsObj.AttriButeId,
- ["AttriButeData1"] = deviceConditionsObj.AttriButeData1,
- ["AttriButeData2"] = deviceConditionsObj.AttriButeData2,
- ["Range"] = deviceConditionsObj.Range,
- };
- conditionsList.Add(dInfo);
- break;
- case 2:
- var logicConditionsObj = conInfo as LogicConditionsInfo;
- var lInfo = new JObject
- {
- ["Type"] = logicConditionsObj.Type,
- ["IsValid"] = logicConditionsObj.IsValid,
- ["Condition_LogicId"] = logicConditionsObj.Condition_LogicId,
- };
- conditionsList.Add(lInfo);
- break;
- case 3:
- var cConditionsObj = conInfo as CounterConditionsInfo;
- var cInfo = new JObject
- {
- ["Type"] = cConditionsObj.Type,
- ["IsValid"] = cConditionsObj.IsValid,
- ["MacAddr"] = cConditionsObj.MacAddr,
- ["Epoint"] = cConditionsObj.Epoint,
- ["Cluster_ID"] = cConditionsObj.Cluster_ID,
- ["AttriButeId"] = cConditionsObj.AttriButeId,
- ["AttriButeData1"] = cConditionsObj.AttriButeData1,
- ["AttriButeData2"] = cConditionsObj.AttriButeData2,
- ["Range"] = cConditionsObj.Range,
- ["Number"] = cConditionsObj.Number,
- ["Time"] = cConditionsObj.Time,
- ["Cycle"] = cConditionsObj.Cycle,
- };
- conditionsList.Add(cInfo);
- break;
- case 4:
- var cdConditionsObj = conInfo as CountdownConditionsInfo;
- var cdInfo = new JObject
- {
- ["Type"] = cdConditionsObj.Type,
- ["IsValid"] = cdConditionsObj.IsValid,
- ["Time"] = cdConditionsObj.Time,
- };
- conditionsList.Add(cdInfo);
- break;
- case 5:
- var tbConditionsObj = conInfo as TimeBucketConditionsInfo;
- var tbInfo = new JObject
- {
- ["Type"] = tbConditionsObj.Type,
- ["IsValid"] = tbConditionsObj.IsValid,
- ["StartHour"] = tbConditionsObj.StartHour,
- ["StartMin"] = tbConditionsObj.StartMin,
- ["StopHour"] = tbConditionsObj.StopHour,
- ["StopMin"] = tbConditionsObj.StopMin,
- };
- conditionsList.Add(tbInfo);
- break;
- case 6:
- var sConditionsObj = conInfo as SecurityConditionsInfo;
- var sInfo = new JObject
- {
- ["Type"] = sConditionsObj.Type,
- ["IsValid"] = sConditionsObj.IsValid,
- ["EnOrWithdrawMode"] = sConditionsObj.EnOrWithdrawMode,
- ["ModeId"] = sConditionsObj.ModeId,
- };
- conditionsList.Add(sInfo);
- break;
- }
- }
-
- var actionsList = new JArray { };
- foreach (var actInfo in addLogicData.Actions)
- {
- switch (actInfo.LinkType)
- {
- case 0:
- var taskList = new JArray { };
- foreach (var taskInfo in actInfo.TaskList)
- {
- var info = new JObject{
- { "TaskType", taskInfo.TaskType},
- { "Data1", taskInfo.Data1},
- { "Data2",taskInfo.Data2}
- };
- taskList.Add(info);
- }
- var tInfo = new JObject
- {
- ["LinkType"] = actInfo.LinkType,
- ["DeviceAddr"] = actInfo.DeviceAddr,
- ["Epoint"] = actInfo.Epoint,
- ["Time"] = actInfo.Time,
- ["taskList"] = taskList,
-
- };
- actionsList.Add(tInfo);
- break;
- case 2:
- var dInfo = new JObject
- {
- ["LinkType"] = actInfo.LinkType,
- ["DeviceAddr"] = int.Parse(actInfo.DeviceAddr),
- ["ConditionId"] = actInfo.ConditionId,
- ["EnableCondition"] = actInfo.EnableCondition,
- };
- actionsList.Add(dInfo);
- break;
- case 4:
- var lInfo = new JObject
- {
- ["LinkType"] = actInfo.LinkType,
- ["EnableLogic"] = actInfo.EnableLogic,
- };
- actionsList.Add(lInfo);
- break;
- case 5:
- var cInfo = new JObject
- {
- ["LinkType"] = actInfo.LinkType,
- ["DeviceAddr"] = int.Parse(actInfo.DeviceAddr),
- ["ConditionId"] = actInfo.ConditionId,
- ["EnableCondition"] = actInfo.EnableCondition,
- };
- actionsList.Add(cInfo);
- break;
- case 6:
- var cdInfo = new JObject
- {
- ["LinkType"] = actInfo.LinkType,
- ["SecuritySetting"] = actInfo.SecuritySetting,
- ["SecurityModeId"] = actInfo.SecurityModeId,
- ["CheckIASStatus"] = actInfo.CheckIASStatus,
- ["IsDelayStart"] = actInfo.IsDelayStart,
- ["Password"] = actInfo.Password,
- };
- actionsList.Add(cdInfo);
- break;
- }
- }
-
- var selectMonthList = new JArray { };
- foreach (var sm in addLogicData.TimeAttribute.SelectMonDate)
- {
- var aad = sm;
- selectMonthList.Add(sm);
- }
- var dataAttribute = new JObject
- {
- { "Calendar",addLogicData.TimeAttribute.Calendar},
- { "Repeat", addLogicData.TimeAttribute.Repeat} ,
- { "WeekDay", addLogicData.TimeAttribute.WeekDay} ,
- { "SetYear",addLogicData.TimeAttribute.SetYear} ,
- { "MonthDate", addLogicData.TimeAttribute.MonthDate} ,
- { "SelectMonDate", selectMonthList }
- };
- data = new JObject {
- { "LogicId",addLogicData.LogicId},
- { "IsEnable", addLogicData.IsEnable} ,
- { "LogicName", addLogicData.LogicName} ,
- { "Relationship",addLogicData.Relationship} ,
- { "TimeAttribute", dataAttribute} ,
- { "Conditions", conditionsList },
- { "Actions", actionsList }
- };
- jObject.Add("Data", data);
- ZbGateway.MainGateWay?.Send("Logic/AddLogic", jObject.ToString());
- }
- }
- catch { }
-
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new AddLogicResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/AddLogic_Actions 閫�鍑�" + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- /// 娣诲姞鎴栦慨鏀归�昏緫鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public AddLogicResponseAllData addLogicResponseAllData;
- /// <summary>
- /// 娣诲姞鎴栦慨鏀归�昏緫鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- [System.Serializable]
- public class AddLogicResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 娣诲姞鎴栦慨鏀归�昏緫鐨勬暟鎹�
- /// </summary>
- public GetLogicInfoResponseData getLogicInfoResponseData;
- }
-
- /// <summary>
- /// 娣诲姞鎴栦慨鏀归�昏緫杩斿洖鐨勬暟鎹�
- /// </summary>
- //public AddLogicResposeData addLogicResposeData;
- ///// <summary>
- ///// 娣诲姞鎴栦慨鏀归�昏緫杩斿洖鐨勬暟鎹�
- ///// </summary>
- //[System.Serializable]
- //public class AddLogicResposeData : LogicBase
- //{
- // /// <summary>
- // /// 璇ラ�昏緫鏄惁琚娇鑳姐��
- // ///<para>0锛氱鐢ㄨ閫昏緫</para>
- // ///<para>1锛氫娇鑳借閫昏緫</para>
- // ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵��</para>
- // ///<para>3锛氬彧澶辫兘涓�娆°�傝Е鍙戝悗锛屼笉鎵ц閫昏緫鍔ㄤ綔锛岃瀛楁鑷姩缃负1锛岀瓑寰呬笅娆¤Е鍙戙��</para>
- // /// </summary>
- // public int IsEnable;
-
- // /// <summary>
- // /// 閫昏緫鍚嶇О
- // /// </summary>
- // public string LogicName;
-
- // /// <summary>
- // ///閫昏緫鍏崇郴銆�
- // ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- // ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- // /// </summary>
- // public int Relationship;
-
- // /// <summary>
- // /// 閫昏緫鏉′欢鍒楄〃
- // /// </summary>
- // public List<ConditionBase> Conditions = new List<ConditionBase>();
-
- // /// <summary>
- // /// 鏉′欢婊¤冻鍚庢墽琛岀殑鍔ㄤ綔鍒楄〃
- // /// </summary>
- // public List<ActionsInfo> Actions = new List<ActionsInfo>();
- //}
-
- /// <summary>
- /// 娣诲姞鎴栦慨鏀归�昏緫鐨勬暟鎹�
- /// </summary>
- public AddLogicData addLogicData;
- /// <summary>
- /// 娣诲姞鎴栦慨鏀归�昏緫鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class AddLogicData : LogicBase
- {
- /// <summary>
- /// 閫昏緫鍚嶇О
- /// </summary>
- public string LogicName = "";
-
- /// <summary>
- /// 璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵��</para>
- ///<para>3锛氬彧澶辫兘涓�娆°�傝Е鍙戝悗锛屼笉鎵ц閫昏緫鍔ㄤ綔锛岃瀛楁鑷姩缃负1锛岀瓑寰呬笅娆¤Е鍙戙��</para>
- /// </summary>
- public int IsEnable = 1;
-
- /// <summary>
- ///閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public int Relationship;
-
- /// <summary>
- ///閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public TimeAttributeObj TimeAttribute=new TimeAttributeObj();
-
- /// <summary>
- /// 閫昏緫鏉′欢鍒楄〃
- /// </summary>
- public List<ConditionBase> Conditions = new List<ConditionBase>();
-
- /// <summary>
- /// 鏉′欢婊¤冻鍚庢墽琛岀殑鍔ㄤ綔鍒楄〃
- /// </summary>
- public List<ActionsInfo> Actions = new List<ActionsInfo>();
- }
-
- /// <summary>
- /// 鎻忚堪閫昏緫鏃堕棿灞炴��
- /// </summary>
- [System.Serializable]
- public class TimeAttributeObj
- {
- /// <summary>
- ///鏉′欢绫诲瀷
- ///0锛氶槼鍘� 1锛氬啘鍘�
- /// </summary>
- public int Calendar;
-
- /// <summary>
- /// 鏃堕棿閲嶅鎬э細鐢ㄤ簬闄愬埗閫昏緫鐨勬墽琛屾椂闂�
- ///<para>0锛氫竴娆℃�э紝鍙墽琛屼竴娆★紝鎵ц鍚嶪sEnable鍊肩疆0</para>
- ///<para>1锛氫粖骞村唴鎵ц</para>
- ///<para>2锛氭瘡澶╂墽琛�</para>
- ///<para>3锛氭瘡鏈堟墽琛�</para>
- ///<para>4锛氭瘡骞存墽琛�</para>
- ///<para>5锛氬懆閲嶅銆�</para>
- /// </summary>
- public int Repeat;
-
- /// <summary>
- /// 鍛ㄥ伐浣滄ā寮忥紙鍙垨杩愮畻锛夛紝褰揜epeat=5鏃舵湁鏁堬紝Repeat涓哄叾浠栧�兼椂鍙拷鐣ヨ瀛楁銆�
- ///<para>0x01 鍛ㄤ竴鎵ц</para>
- ///<para>0x02 鍛ㄤ簩鎵ц</para>
- ///<para>0x04 鍛ㄤ笁鎵ц</para>
- ///<para>0x08 鍛ㄥ洓鎵ц</para>
- ///<para>0x10 鍛ㄤ簲鎵ц</para>
- ///<para>0x20 鍛ㄥ叚鎵ц</para>
- ///<para>0x40 鍛ㄦ棩鎵ц</para>
- ///<para>0x7F 姣忓ぉ鎵ц</para>
- ///<para>鏁板�煎彲杩涜鎴栬繍绠楋紝濡傚懆涓�銆佸懆涓夈�佸懆浜旀墽琛岋紝鍒欎负WeekDay=锛�0x01 || 0x04 || 0x10锛�= 0x15 鍗冲崄杩涘埗 21銆�</para>
- /// </summary>
- /// <value>The week day.</value>
- public int WeekDay;
-
- /// <summary>
- ///褰揜epeat = 1鏃讹紝璇ュ弬鏁版墠鏈夋晥銆傝〃绀烘煇涓勾浠藉唴鎵嶆墽琛屻�傚SetYear = 2020锛屽垯琛ㄧず璇ユ潯浠�2020鍐呮墠浼氳鎵ц銆傚鏋滆瀛楁琚拷鐣ユ垨璁惧畾涓� 0 锛岀綉鍏冲皢鑷姩濉叆浠婂勾鐨勫勾浠戒綔涓烘墽琛屽勾浠姐��
- ///鍙拷鐣ワ紝榛樿涓鸿瀹氭潯浠舵椂鐨勫勾浠姐��
- /// </summary>
- public int SetYear;
-
- /// <summary>
- ///鏉′欢绫诲瀷
- ///閲嶅绫诲瀷涓烘瘡鏈堟墽琛屾椂閫夋嫨鐨勬棩鏈熴��32浣嶆暣鍨嬶紝bit鍊肩0浣嶅埌绗�30浣嶅垎鍒唬琛ㄦ瘡鏈堢殑1鍙峰埌31鍙凤紝浣嶅�间负1鍒欒〃绀鸿鏃ユ湡鍙墽琛岄�昏緫锛屼綅鍊间负0鍒欒鏃ユ湡涓嶅彲鎵ц閫昏緫銆傚锛孧onthDate=91锛屽垯浜岃繘鍒跺�间负锛�1011011 锛屽彲鐭it0=1锛屾墍浠�1鍙峰彲鎵ц銆侭it1=1锛屾墍浠�2鍙峰彲鎵ц銆侭it2=0锛�3鍙蜂笉鍙墽琛屻�侭it3鍜宐it4涓�1鎵�浠�4銆�5鍙峰彲鎵ц銆侭it5涓�0锛�6鍙蜂笉鍙墽琛屻�侭it6涓�1锛�7鍙峰彲鎵ц銆傚鏋滈�夋嫨鏌愭鏃ユ湡鎵ц锛屽彲灏嗚繖娈垫棩鏈熷彿鏁板搴旂殑bit鍊煎叏缃�1銆傚鏋�3鍙峰埌7鍙锋墽琛岋紝鍒欎负浜岃繘鍒�1111100锛屽嵆MonthDate = 124銆傚綋Repeat =3鏃舵湁鏁堛�俁epeat涓嶄负3鏃讹紝鍙拷鐣ヨ鍙傛暟銆�
- /// </summary>
- public int MonthDate;
-
- /// <summary>
- ///閲嶅绫诲瀷涓轰粖骞村唴鎵ц鎴栨瘡骞存墽琛屾椂閫夋嫨鎵ц鐨勬湀浠姐��
- /// 閫夋嫨鎵ц鐨勬湀浠�
- ///<para>0x01锛�1鏈堟墽琛岋紱0x02锛�2鏈堟墽琛岋紱</para>
- ///<para>0x04锛�3鏈堟墽琛岋紱0x08锛�4鏈堟墽琛�</para>
- ///<para>0x10锛�5鏈堟墽琛岋紱0x20锛�6鏈堟墽琛�</para>
- ///<para>0x40锛�7鏈堟墽琛岋紱0x80锛�9鏈堟墽琛�</para>
- ///<para>0x100: 10鏈堟墽琛岋紱0x200: 11鏈堟墽琛�</para>
- ///<para>0x400: 12鏈堟墽琛岋紱</para>
- ///<para>鏁板�煎彲杩涜鎴栬繍绠楋紝濡備竴鏈堛�佷笁鏈堛�佷簲鏈堟墽琛岋紝鍒欎负SelectMonth =锛�0x01 | 0x04 | 0x10锛�= 0x15 鍗冲崄杩涘埗 21銆�</para>
- ///<para>褰揜epeat = 1鎴�4鏃舵湁鏁堛�俁epeat涓哄叾浠栧�兼椂鍙拷鐣ヨ瀛楁銆�</para>
- /// </summary>
- public int SelectMonth;
-
- /// <summary>
- ///閲嶅绫诲瀷涓轰粖骞村唴鎵ц鎴栨瘡骞存墽琛屾椂閫夋嫨鎵ц鐨勬棩鏈熴��
- ///SelectMonDate[0] 鍒癝electMonDate[11]鍒嗗埆琛ㄧず1鏈堜唤鍒�12鏈堜唤閫夋嫨鐨勫彿鏁帮紝绫诲瀷涓�32浣嶆暣鏁帮紝鏁板�肩殑鍚箟鍜孧onthDate鐩稿悓銆�
- ///<para>褰揜epeat = 1鎴�4鏃舵湁鏁堛�俁epeat涓哄叾浠栧�兼椂鍙拷鐣ヨ瀛楁銆�</para>
- ///</summary>
- /// <summary>
- /// 閫昏緫鏉′欢鍒楄〃
- /// </summary>
- public List<int> SelectMonDate = new List<int>();
- }
-
- [System.Serializable]
- public class ConditionBase
- {
- /// <summary>
- ///鏉′欢绫诲瀷
- ///<para>0锛氭椂闂寸偣鏉′欢锛屽湪鏌愪釜鏃堕棿鍙戠敓</para>
- ///<para>1锛氳澶囩姸鎬佸彉鍖栨潯浠�</para>
- ///<para>2锛氬叾浠栭�昏緫鏉′欢</para>
- ///<para>3锛氳鏁板櫒鏉′欢</para>
- ///<para>4锛氬�掕鏃�</para>
- ///<para>5锛氭椂闂存鏉′欢</para>
- ///<para>6锛氬畨闃叉潯浠�</para>
- /// </summary>
- public int Type;
-
- /// <summary>
- /// 璇ユ潯浠舵槸鍚︿綔涓哄垽鏂�昏緫渚濇嵁銆傚綋鏉′欢鏃犳晥鏃讹紝鍒欏拷鐣ヨ鏉′欢銆備竴涓�昏緫搴旇鑷冲皯鏈変竴涓湁鏁堟潯浠剁敤浜庡垽鏂�昏緫鏄惁鎴愮珛锛屽綋涓�涓�昏緫鎵�鏈夋潯浠舵棤鏁堟椂锛岃閫昏緫灏嗘案杩滀笉浼氱敓鏁堛��
- ///<para>0锛氭棤鏁堬紙蹇界暐鏉′欢锛夈��</para>
- ///<para>1锛氭湁鏁堬紙鍚敤鏉′欢锛夈��</para>
- ///<para>2锛氫娇鑳戒竴娆★紙鏉′欢鎴愮珛涓�娆″悗灏嗚绂佺敤锛孖sValid鑷姩缃负0锛夈��</para>
- ///<para>3锛氬け鑳戒竴娆★紙鏉′欢绗竴娆℃垚绔嬩細琚拷鐣ワ紝瑙﹀彂涓嶄簡閫昏緫锛岀劧鍚嶪sValid鑷姩缃�1銆備互鍚庢潯浠跺啀鎴愮珛灏嗕笉浼氳蹇界暐锛�</para>
- /// </summary>
- public int IsValid = 1;
- /// <summary>
- /// 鏉′欢ID锛�(褰撴柊澧炴垨淇敼閫昏緫鏉′欢鏃讹紝璇ュ瓧娈垫棤鏁堬級锛�
- /// </summary>
- public int ConditionId ;
-
- }
- #endregion
-
- #region 淇敼閫昏緫淇℃伅.
- ///<summary >
- /// 淇敼閫昏緫淇℃伅
- /// </summary>
- public static async System.Threading.Tasks.Task<ReviseAttributeResponseAllData> ReviseAttributeAsync(ReviseAttributeData reviseAttributeData)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- ReviseAttributeResponseAllData allData =null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new ReviseAttributeResponseAllData{ errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new ReviseAttributeResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new ReviseAttributeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
-
- if (topic == gatewayID + "/" + "Logic/ReviseAttribute_Respon")
- {
- try
- {
- var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempTimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<TimeAttributeObj>(jobject["Data"]["TimeAttribute"].ToString());
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<ReviseAttributeResponseBaseData>(jobject["Data"].ToString());
-
- if (tempData != null)
- {
- allData = new ReviseAttributeResponseAllData { };
- var tempD = new ReviseAttributeResponseData { };
-
- if (tempTimeAttribute != null) { tempD.TimeAttribute = tempTimeAttribute; }
- if (tempData.LogicName != null) { tempD.LogicName = tempData.LogicName; }
- tempD.LogicId = tempData.LogicId;
- tempD.IsEnable = tempData.IsEnable;
- tempD.Relationship = tempData.Relationship;
- tempD.Result = tempData.Result;
- allData.reviseAttributeResponseData = tempD;
-
- var info = ZbGateway.LogicList.Find((Logic.GetLogicInfoResponseData obj) => obj.LogicId == tempData.LogicId);
- if (info != null)
- {
- info.LogicName = tempD.LogicName;
- info.Result = tempD.Result;
- info.Relationship = tempD.Relationship;
- info.IsEnable = tempD.IsEnable;
- info.TimeAttribute = tempD.TimeAttribute;
- }
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }else{
- allData = new ReviseAttributeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- }
- catch (Exception ex)
- {
- var mess = ex.Message;
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/ReviseAttribute_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- if (reviseAttributeData != null)
- {
- if(reviseAttributeData.LogicName!=null){
- var bytes = new byte[32];
- var reamarkGwBytes = System.Text.Encoding.UTF8.GetBytes(reviseAttributeData.LogicName);
- System.Array.Copy(reamarkGwBytes, 0, bytes, 0, 32 < reamarkGwBytes.Length ? 32 : reamarkGwBytes.Length);
- reviseAttributeData.LogicName = System.Text.Encoding.UTF8.GetString(bytes);
- }
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2001 } };
- var data = new JObject { };
-
- var selectMonthList = new JArray { };
- if(reviseAttributeData.TimeAttribute!=null&& reviseAttributeData.TimeAttribute.SelectMonDate != null)
- {
- foreach (var sm in reviseAttributeData.TimeAttribute.SelectMonDate)
- {
- var aad = sm;
- selectMonthList.Add(sm);
- }
- }
-
- var dataAttribute = new JObject
- {
- { "Calendar",reviseAttributeData.TimeAttribute.Calendar},
- { "Repeat", reviseAttributeData.TimeAttribute.Repeat} ,
- { "WeekDay", reviseAttributeData.TimeAttribute.WeekDay} ,
- { "SetYear",reviseAttributeData.TimeAttribute.SetYear} ,
- { "MonthDate", reviseAttributeData.TimeAttribute.MonthDate} ,
- { "SelectMonDate", selectMonthList }
- };
-
- data = new JObject {
- { "LogicId",reviseAttributeData.LogicId},
- { "IsEnable", reviseAttributeData.IsEnable} ,
- { "LogicName", reviseAttributeData.LogicName} ,
- { "Relationship",reviseAttributeData.Relationship},
- { "TimeAttribute", dataAttribute}
- };
- jObject.Add("Data", data);
- ZbGateway.MainGateWay?.Send(("Logic/ReviseAttribute"), jObject.ToString());
- }
- } catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new ReviseAttributeResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/ReviseAttribute_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///淇敼閫昏緫灞炴�у洖澶嶇殑鎵�鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public ReviseAttributeResponseAllData reviseAttributeResponseAllData;
- ///<summary >
- /// 淇敼閫昏緫灞炴�у洖澶嶇殑鎵�鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class ReviseAttributeResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 淇敼閫昏緫灞炴��
- /// </summary>
- public ReviseAttributeResponseData reviseAttributeResponseData;
- }
-
- ///<summary >
- /// 淇敼閫昏緫灞炴�у洖澶嶇殑鏁版嵁
- /// </summary>
- public ReviseAttributeResponseData reviseAttributeResponseData;
- ///<summary >
- /// 淇敼閫昏緫灞炴�у洖澶嶇殑鏁版嵁
- /// </summary>
- [System.Serializable]
- public class ReviseAttributeResponseData : LogicBase
- {
- /// <summary>
- /// 淇敼缁撴灉锛�
- ///<para>0锛氭垚鍔�</para>
- ///<para>1锛氬け璐ワ紝閫昏緫涓嶅瓨鍦�</para>
- /// </summary>
- public int Result;
-
- /// <summary>
- /// 璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵��</para>
- /// </summary>
- public int IsEnable;
- /// <summary>
- /// 閫昏緫鍚嶇О
- /// </summary>
- public string LogicName;
- /// <summary>
- /// 閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public int Relationship;
-
- /// <summary>
- /// 閫昏緫鍚嶇О
- /// </summary>
- public TimeAttributeObj TimeAttribute=new TimeAttributeObj();
- }
-
- [System.Serializable]
- public class ReviseAttributeResponseBaseData : LogicBase
- {
- /// <summary>
- /// 淇敼缁撴灉锛�
- ///<para>0锛氭垚鍔�</para>
- ///<para>1锛氬け璐ワ紝閫昏緫涓嶅瓨鍦�</para>
- /// </summary>
- public int Result;
-
- /// <summary>
- /// 璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵��</para>
- /// </summary>
- public int IsEnable;
- /// <summary>
- /// 閫昏緫鍚嶇О
- /// </summary>
- public string LogicName;
- /// <summary>
- /// 閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public int Relationship;
- }
-
- ///<summary >
- /// 淇敼閫昏緫灞炴�х殑鏁版嵁
- /// </summary>
- public ReviseAttributeData reviseAttributeData;
- ///<summary >
- /// 淇敼閫昏緫灞炴�у洖澶嶇殑鏁版嵁
- /// </summary>
- [System.Serializable]
- public class ReviseAttributeData : LogicBase
- {
- /// <summary>
- /// 璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵��</para>
- ///<para>3锛氬彧澶辫兘涓�娆°�傝Е鍙戝悗锛屼笉鎵ц閫昏緫鍔ㄤ綔锛岃瀛楁鑷姩缃负1锛岀瓑寰呬笅娆¤Е鍙戙��</para>
- ///<para>涓嶄慨鏀硅灞炴�ф椂锛� 鍙拷鐣ヨ瀛楁</para>
- /// </summary>
- public int IsEnable;
- /// <summary>
- /// 閫昏緫鍚嶇О
- /// </summary>
- public string LogicName;
- /// <summary>
- /// 閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- ///<para>涓嶄慨鏀硅灞炴�ф椂锛屽彲蹇界暐璇ュ瓧娈�</para>
- /// </summary>
- public int Relationship;
-
- /// <summary>
- /// 鎻忚堪閫昏緫鏃堕棿灞炴��
- ///鍜屸��1銆佹坊鍔犳垨淇敼閫昏緫鈥濈殑TimeAttribute瀛楁鏍煎紡鐩稿悓銆�
- ///<para>涓嶄慨鏀硅灞炴�ф椂锛屽彲蹇界暐璇ュ瓧娈�</para>
- /// </summary>
- public TimeAttributeObj TimeAttribute=new TimeAttributeObj();
- }
- #endregion
-
- #region 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅.
- ///<summary >
- /// 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅
- /// </summary>
- public static async System.Threading.Tasks.Task<GetLogicInfoResponseAllData> GetLogicInfoAsync(int logicId)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- GetLogicInfoResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new GetLogicInfoResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new GetLogicInfoResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new GetLogicInfoResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/GetLogicInfo_Respon")
- {
- try
- {
- var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempTimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<TimeAttributeObj>(jobject["Data"]["TimeAttribute"].ToString());
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetLogicInfoResponseBaseData>(jobject["Data"].ToString());
- if (tempData != null)
- {
- var conditions = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["Conditions"].ToString());
- allData = new GetLogicInfoResponseAllData { };
- var tempD = new GetLogicInfoResponseData { };
- for (int m = 0; conditions != null && m < conditions.Count; m++)
- {
- var condition = conditions[m];
- var ads = condition["Type"].ToString();
- switch (condition["Type"].ToString())
- {
- case "0":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.TimeConditionsInfo>(condition.ToString()));
- break;
- case "1":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.DeviceConditionsInfo>(condition.ToString()));
- break;
- case "2":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.LogicConditionsInfo>(condition.ToString()));
- break;
- case "3":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.CounterConditionsInfo>(condition.ToString()));
- break;
- case "4":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.CountdownConditionsInfo>(condition.ToString()));
- break;
- case "5":
- tempD.Conditions.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.TimeBucketConditionsInfo>(condition.ToString()));
- break;
- }
- }
- if (tempTimeAttribute != null) { tempD.TimeAttribute = tempTimeAttribute; }
- if (tempData.LogicName != null) { tempD.LogicName = tempData.LogicName; }
- if (tempData.Actions != null) { tempD.Actions = tempData.Actions; }
- tempD.LogicId = tempData.LogicId;
- tempD.IsEnable = tempData.IsEnable;
- tempD.Relationship = tempData.Relationship;
- tempD.Result = tempData.Result;
- allData.getLogicInfoResponseData = tempD;
- var info = ZbGateway.LogicList.Find((Logic.GetLogicInfoResponseData obj) => obj.LogicId == tempData.LogicId);
- if (info == null)
- {
- ZbGateway.LogicList.Add(allData.getLogicInfoResponseData);
- }
- else
- {
- info.LogicName = tempD.LogicName;
- info.Result = tempD.Result;
- info.Relationship = tempD.Relationship;
- info.IsEnable = tempD.IsEnable;
- info.Conditions = tempD.Conditions;
- info.Actions = tempD.Actions;
- info.TimeAttribute = tempD.TimeAttribute;
- }
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- catch (Exception ex)
- {
- var mess = ex.Message;
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/GetLogicInfo_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2002 } };
- var data = new JObject {
- { "LogicId",logicId}
- };
- jObject.Add("Data", data);
- ZbGateway.MainGateWay?.Send(("Logic/GetLogicInfo"), jObject.ToString());
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 4000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null&& allData?.getLogicInfoResponseData!=null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 4000)
- {
- allData = new GetLogicInfoResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/GetLogicInfo_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鐨勬墍鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public GetLogicInfoResponseAllData getLogicInfoResponseAllData;
- ///<summary >
- /// 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬墍鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class GetLogicInfoResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬暟鎹�
- /// </summary>
- public GetLogicInfoResponseData getLogicInfoResponseData;
- }
-
- ///<summary >
- ///閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬暟鎹�
- /// </summary>
- public GetLogicInfoResponseData getLogicInfoResponseData;
- ///<summary >
- /// 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class GetLogicInfoResponseData : LogicBase
- {
- /// <summary>
- ///0锛氳幏鍙栨垚鍔�
- ///<para>1锛氳閫昏緫涓嶅瓨鍦ㄣ��</para>
- ///<para>浠ヤ笅鎵�鏈夊瓧娈靛彧鏈夊湪Result 涓�1鏃跺瓨鍦�</para>
- /// </summary>
- public int Result;
-
- /// <summary>
- ///璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵�併��</para>
- /// </summary>
- public int IsEnable;
-
- /// <summary>
- ///閫昏緫鍚嶇О
- /// </summary>
- public string LogicName;
-
- /// <summary>
- ///閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public int Relationship;
-
- /// <summary>
- ///閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public TimeAttributeObj TimeAttribute = new TimeAttributeObj();
-
- /// <summary>
- /// 閫昏緫鏉′欢鍒楄〃
- /// </summary>
- public List<ConditionBase> Conditions = new List<ConditionBase>();
-
- /// <summary>
- /// 鏉′欢婊¤冻鍚庢墽琛岀殑鍔ㄤ綔鍒楄〃
- /// </summary>
- public List<ActionsInfo> Actions = new List<ActionsInfo>();
- }
-
- [System.Serializable]
- public class GetLogicInfoResponseBaseData : LogicBase
- {
- /// <summary>
- ///0锛氳幏鍙栨垚鍔�
- ///<para>1锛氳閫昏緫涓嶅瓨鍦ㄣ��</para>
- ///<para>浠ヤ笅鎵�鏈夊瓧娈靛彧鏈夊湪Result 涓�1鏃跺瓨鍦�</para>
- /// </summary>
- public int Result;
-
- /// <summary>
- ///璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵�併��</para>
- /// </summary>
- public int IsEnable;
-
- /// <summary>
- ///閫昏緫鍚嶇О
- /// </summary>
- public string LogicName;
-
- /// <summary>
- ///閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public int Relationship;
-
- /// <summary>
- /// 閫昏緫鏉′欢鍒楄〃
- /// </summary>
- public List<ConditionBase> Conditions = new List<ConditionBase>();
-
- /// <summary>
- /// 鏉′欢婊¤冻鍚庢墽琛岀殑鍔ㄤ綔鍒楄〃
- /// </summary>
- public List<ActionsInfo> Actions = new List<ActionsInfo>();
- }
- #endregion
-
- #region 鑾峰彇閫昏緫鍒楄〃.
- ///<summary >
- /// 鑾峰彇閫昏緫鍒楄〃
- /// 锛堝綋鏁伴噺寰堝鏃讹紝鍙兘绗竴娆¤幏鍙栧け璐ワ紝瑕佸埌閲嶆柊鑾峰彇锛�
- /// </summary>
- public static async System.Threading.Tasks.Task<GetLogicListResponseAllData> GetLogicListAsync()
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- GetLogicListResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new GetLogicListResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new GetLogicListResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new GetLogicListResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/GetLogicList_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempBindList = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["LogicList"].ToString());
-
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetLogicListResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new GetLogicListResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new GetLogicListResponseAllData { getLogicListResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/GetLogicList_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2004 } };
- ZbGateway.MainGateWay?.Send(("Logic/GetLogicList"), jObject.ToString());
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 4000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 4000)
- {
- allData = new GetLogicListResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/GetLogicList_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鐨勬墍鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public GetLogicListResponseAllData getLogicListResponseAllData;
- ///<summary >
- /// 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬墍鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class GetLogicListResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬暟鎹�
- /// </summary>
- public GetLogicListResponseData getLogicListResponseData;
- }
-
- ///<summary >
- ///閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬暟鎹�
- /// </summary>
- public GetLogicListResponseData getLogicListResponseData;
- ///<summary >
- /// 閫氳繃閫昏緫id鑾峰彇閫昏緫淇℃伅鍥炲鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class GetLogicListResponseData : LogicBase
- {
- /// <summary>
- /// 閫昏緫鏉′欢鍒楄〃
- /// </summary>
- public List<LogicListData> LogicList = new List<LogicListData>();
-
- }
-
- /// <summary>
- /// 閫昏緫鍒楄〃鍏蜂綋鏁版嵁
- /// </summary>
- [System.Serializable]
- public class LogicListData : LogicBase
- {
-
- /// <summary>
- /// 閫昏緫鍚嶇О
- /// </summary>
- public string LogicName;
-
- /// <summary>
- /// 璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵��</para>
- /// </summary>
- public int IsEnable;
-
- /// <summary>
- ///閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public int Relationship;
-
- }
- #endregion
-
- #region 鏂板鎴栦慨鏀归�昏緫鏉′欢.
- ///<summary >
- /// 鏂板鎴栦慨鏀归�昏緫鏉′欢
- /// <para>ChangeConditionData涓璽ype鏈夋晥锛屾鏃禖onditionObj涓殑type鏃犳晥</para>
- /// </summary>
- public static async System.Threading.Tasks.Task<ChangeConditionResponseAllData> ChangeConditionAsync(ChangeConditionData changeConditionData)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- ChangeConditionResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new ChangeConditionResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new ChangeConditionResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new ChangeConditionResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/ChangeCondition_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<ChangeConditionResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new ChangeConditionResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- switch (tempData.Type)
- {
- case 0:
- var timeObj = new ZigBee.Device.Logic.TimeConditionsInfo();
- timeObj.IsValid = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsValid"].ToString());
- timeObj.DateType = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["DateType"].ToString());
- timeObj.StartHour = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["StartHour"].ToString());
- timeObj.StartMin = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["StartMin"].ToString());
- timeObj.AdjustTime = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["AdjustTime"].ToString());
- timeObj.RemindTime = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["RemindTime"].ToString());
- timeObj.EnDelay = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["EnDelay"].ToString());
- timeObj.DelayTime = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["DelayTime"].ToString());
- tempData.conditionObj = timeObj;
- break;
- case 1:
- var devObj = new ZigBee.Device.Logic.DeviceConditionsInfo();
- devObj.IsValid = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsValid"].ToString());
- devObj.Epoint = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Epoint"].ToString());
- devObj.Cluster_ID = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Cluster_ID"].ToString());
- devObj.AttriButeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["AttriButeId"].ToString());
- devObj.AttriButeData1 = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["AttriButeData1"].ToString());
- devObj.AttriButeData2 = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["AttriButeData2"].ToString());
- devObj.Range = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Range"].ToString());
- var tempAddrObj =Newtonsoft.Json.JsonConvert.DeserializeObject<MacAddrData>(jobject["Data"].ToString());
- if(tempAddrObj.MacAddr != null)
- {
- devObj.MacAddr = tempAddrObj.MacAddr;
- }
- tempData.conditionObj = devObj;
- break;
- case 2:
- var logicObj = new ZigBee.Device.Logic.LogicConditionsInfo ();
- logicObj.IsValid = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsValid"].ToString());
- logicObj.Condition_LogicId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Condition_LogicId"].ToString());
- tempData.conditionObj = logicObj;
- break;
- case 3:
- var countObj = new ZigBee.Device.Logic.CounterConditionsInfo();
- countObj.IsValid = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsValid"].ToString());
- countObj.Epoint = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Epoint"].ToString());
- countObj.Cluster_ID = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Cluster_ID"].ToString());
- countObj.AttriButeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["AttriButeId"].ToString());
- countObj.AttriButeData1 = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["AttriButeData1"].ToString());
- countObj.AttriButeData2 = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["AttriButeData2"].ToString());
- countObj.Range = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Range"].ToString());
- countObj.Number = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Number"].ToString());
- countObj.Time = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Time"].ToString());
- countObj.Cycle = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Cycle"].ToString());
- var tempAddrObj2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MacAddrData>(jobject["Data"].ToString());
- if (tempAddrObj2.MacAddr != null)
- {
- countObj.MacAddr = tempAddrObj2.MacAddr;
- }
- tempData.conditionObj = countObj;
- break;
- case 4:
- var cdObj = new ZigBee.Device.Logic.CountdownConditionsInfo();
- cdObj.IsValid = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsValid"].ToString());
- cdObj.Time = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Time"].ToString());
- tempData.conditionObj = cdObj;
- break;
- case 5:
- var tbObj = new ZigBee.Device.Logic.TimeBucketConditionsInfo();
- tbObj.IsValid = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsValid"].ToString());
- tbObj.StartHour = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["StartHour"].ToString());
- tbObj.StartMin = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["StartMin"].ToString());
- tbObj.StopHour = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["StopHour"].ToString());
- tbObj.StopMin = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["StopMin"].ToString());
- tempData.conditionObj = tbObj;
- break;
- case 6:
- var securitybObj = new ZigBee.Device.Logic.SecurityConditionsInfo();
- securitybObj.IsValid = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsValid"].ToString());
- securitybObj.EnOrWithdrawMode = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["EnOrWithdrawMode"].ToString());
- securitybObj.ModeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString());
- tempData.conditionObj = securitybObj;
- break;
- }
- allData = new ChangeConditionResponseAllData { changeConditionResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/GetLogicList_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- if(changeConditionData!=null){
- var dataPublish = new Dictionary<string, object> { };
- switch (changeConditionData.Type)
- {
- case 0:
- var timeConditionsObj = changeConditionData.conditionObj as TimeConditionsInfo;
- var dataPublish1 = new Dictionary<string, object>
- {
- ["LogicId"] = changeConditionData.LogicId,
- ["ConditionId"] = changeConditionData.ConditionId,
- ["Type"] = changeConditionData.Type,
- ["IsValid"] = timeConditionsObj.IsValid,
- ["DateType"] = timeConditionsObj.DateType,
- ["StartHour"] = timeConditionsObj.StartHour,
- ["StartMin"] = timeConditionsObj.StartMin,
- ["AdjustTime"] = timeConditionsObj.AdjustTime,
- ["RemindTime"] = timeConditionsObj.RemindTime,
- ["EnDelay"] = timeConditionsObj.EnDelay,
- ["DelayTime"] = timeConditionsObj.DelayTime
- };
- dataPublish = dataPublish1;
- break;
- case 1:
- var deviceConditionsObj = changeConditionData.conditionObj as DeviceConditionsInfo;
- var dataPublish2 = new Dictionary<string, object>
- {
- ["LogicId"] = changeConditionData.LogicId,
- ["ConditionId"] = changeConditionData.ConditionId,
- ["Type"] = changeConditionData.Type,
- ["IsValid"] = deviceConditionsObj.IsValid,
- ["MacAddr"] = deviceConditionsObj.MacAddr,
- ["Epoint"] = deviceConditionsObj.Epoint,
- ["Cluster_ID"] = deviceConditionsObj.Cluster_ID,
- ["AttriButeId"] = deviceConditionsObj.AttriButeId,
- ["AttriButeData1"] = deviceConditionsObj.AttriButeData1,
- ["AttriButeData2"] = deviceConditionsObj.AttriButeData2,
- ["Range"] = deviceConditionsObj.Range,
- };
- dataPublish = dataPublish2;
- break;
- case 2:
- var logicConditionsObj = changeConditionData.conditionObj as LogicConditionsInfo;
- var dataPublish3 = new Dictionary<string, object>
- {
- ["LogicId"] = changeConditionData.LogicId,
- ["ConditionId"] = changeConditionData.ConditionId,
- ["Type"] = changeConditionData.Type,
- ["IsValid"] = logicConditionsObj.IsValid,
- ["Condition_LogicId"] = logicConditionsObj.Condition_LogicId,
- };
- dataPublish = dataPublish3;
- break;
- case 3:
- var cConditionsObj = changeConditionData.conditionObj as CounterConditionsInfo;
- var dataPublish4 = new Dictionary<string, object>
- {
- ["LogicId"] = changeConditionData.LogicId,
- ["ConditionId"] = changeConditionData.ConditionId,
- ["Type"] = changeConditionData.Type,
- ["IsValid"] = cConditionsObj.IsValid,
- ["MacAddr"] = cConditionsObj.MacAddr,
- ["Epoint"] = cConditionsObj.Epoint,
- ["Cluster_ID"] = cConditionsObj.Cluster_ID,
- ["AttriButeId"] = cConditionsObj.AttriButeId,
- ["AttriButeData1"] = cConditionsObj.AttriButeData1,
- ["AttriButeData2"] = cConditionsObj.AttriButeData2,
- ["Range"] = cConditionsObj.Range,
- ["Number"] = cConditionsObj.Number,
- ["Time"] = cConditionsObj.Time,
- ["Cycle"] = cConditionsObj.Cycle,
- };
- dataPublish = dataPublish4;
- break;
- case 4:
- var cdConditionsObj = changeConditionData.conditionObj as CountdownConditionsInfo;
- var dataPublish5 = new Dictionary<string, object>
- {
- ["LogicId"] = changeConditionData.LogicId,
- ["ConditionId"] = changeConditionData.ConditionId,
- ["Type"] = changeConditionData.Type,
- ["IsValid"] = cdConditionsObj.IsValid,
- ["Time"] = cdConditionsObj.Time,
- };
- dataPublish = dataPublish5;
- break;
- case 5:
- var tbConditionsObj = changeConditionData.conditionObj as TimeBucketConditionsInfo;
- var dataPublish6 = new Dictionary<string, object>
- {
- ["LogicId"] = changeConditionData.LogicId,
- ["ConditionId"] = changeConditionData.ConditionId,
- ["Type"] = changeConditionData.Type,
- ["IsValid"] = tbConditionsObj.IsValid,
- ["StartHour"] = tbConditionsObj.StartHour,
- ["StartMin"] = tbConditionsObj.StartMin,
- ["StopHour"] = tbConditionsObj.StopHour,
- ["StopMin"] = tbConditionsObj.StopMin,
- };
- dataPublish = dataPublish6;
- break;
- case 6:
- var sConditionsObj = changeConditionData.conditionObj as SecurityConditionsInfo;
- var dataPublish7 = new Dictionary<string, object>
- {
- ["LogicId"] = changeConditionData.LogicId,
- ["ConditionId"] = changeConditionData.ConditionId,
- ["Type"] = changeConditionData.Type,
- ["IsValid"] = sConditionsObj.IsValid,
- ["EnOrWithdrawMode"] = sConditionsObj.EnOrWithdrawMode,
- ["ModeId"] = sConditionsObj.ModeId,
- };
- dataPublish = dataPublish7;
- break;
- }
- ZbGateway.MainGateWay?.Send("Logic/ChangeCondition", Device.Cluster_ID.Gateway, Command.LogicChangeCondition, Newtonsoft.Json.Linq.JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(dataPublish)));
- }
- }catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new ChangeConditionResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/GetLogicList_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///鏂板鎴栦慨鏀归�昏緫鏉′欢鎵�鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public ChangeConditionResponseAllData changeConditionResponseAllData;
- ///<summary >
- /// 鏂板鎴栦慨鏀归�昏緫鏉′欢鍥炲鐨勬墍鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class ChangeConditionResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 鏂板鎴栦慨鏀归�昏緫鏉′欢鍥炲鐨勬暟鎹�
- /// </summary>
- public ChangeConditionResponseData changeConditionResponseData;
- }
-
- [System.Serializable]
- public class MacAddrData
- {
- /// <summary>
- /// 鐗╃悊鍦板潃
- /// </summary>
- public string MacAddr;
-
- }
-
- ///<summary >
- ///鏂板鎴栦慨鏀归�昏緫鏉′欢鍥炲鐨勬暟鎹�
- /// </summary>
- public ChangeConditionResponseData changeConditionResponseData;
- ///<summary >
- /// 閫氭柊澧炴垨淇敼閫昏緫鏉′欢鍥炲鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class ChangeConditionResponseData : LogicBase
- {
- /// <summary>
- /// 鏉′欢id(褰撴柊澧炴垨淇敼閫昏緫鏉′欢鏃讹紝璇ュ瓧娈垫湁鏁堬級
- /// </summary>
- public int ConditionId;
- /// <summary>
- /// 璇ユ潯浠舵槸鍚︿綔涓哄垽鏂�昏緫渚濇嵁銆傚綋鏉′欢鏃犳晥鏃讹紝鍒欏拷鐣ヨ鏉′欢銆備竴涓�昏緫搴旇鑷冲皯鏈変竴涓湁鏁堟潯浠剁敤浜庡垽鏂�昏緫鏄惁鎴愮珛锛屽綋涓�涓�昏緫鎵�鏈夋潯浠舵棤鏁堟椂锛岃閫昏緫灏嗘案杩滀笉浼氱敓鏁堛��
- ///<para>0锛氭棤鏁堬紙蹇界暐鏉′欢锛夈��</para>
- ///<para>1锛氭湁鏁堬紙鍚敤鏉′欢锛夈��</para>
- ///<para>2锛氫娇鑳戒竴娆★紙鏉′欢鎴愮珛涓�娆″悗灏嗚绂佺敤锛孖sValid鑷姩缃负0锛夈��</para>
- ///<para>3锛氬け鑳戒竴娆★紙鏉′欢绗竴娆℃垚绔嬩細琚拷鐣ワ紝瑙﹀彂涓嶄簡閫昏緫锛岀劧鍚嶪sValid鑷姩缃�1銆備互鍚庢潯浠跺啀鎴愮珛灏嗕笉浼氳蹇界暐锛�</para>
- /// </summary>
- public int IsValid;
- /// <summary>
- ///鏉′欢绫诲瀷
- ///<para>0锛氭椂闂寸偣鏉′欢锛屽湪鏌愪釜鏃堕棿鍙戠敓</para>
- ///<para>1锛氳澶囩姸鎬佸彉鍖栨潯浠�</para>
- ///<para>2锛氬叾浠栭�昏緫鏉′欢</para>
- ///<para>3锛氳鏁板櫒鏉′欢</para>
- ///<para>4锛氬�掕鏃�</para>
- ///<para>5锛氭椂闂存鏉′欢</para>
- /// </summary>
- public int Type;
-
- /// <summary>
- /// conditionObj:鏉′欢瀵硅薄
- /// </summary>
- public ConditionBase conditionObj;
- }
-
- /// <summary>
- /// 鏂板鎴栦慨鏀归�昏緫鏉′欢鐨勬暟鎹�
- /// </summary>
- public ChangeConditionData changeConditionData;
- /// <summary>
- /// 鏂板鎴栦慨鏀归�昏緫鏉′欢鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class ChangeConditionData : LogicBase
- {
- /// <summary>
- ///(娉ㄦ剰蹇呴渶濉啓锛夋潯浠剁被鍨�;(娌″~鍐欐暟鎹彲鑳戒笉鍥炲锛�
- ///<para>0锛氭椂闂寸偣鏉′欢锛屽湪鏌愪釜鏃堕棿鍙戠敓</para>
- ///<para>1锛氳澶囩姸鎬佸彉鍖栨潯浠�</para>
- ///<para>2锛氬叾浠栭�昏緫鏉′欢</para>
- ///<para>3锛氳鏁板櫒鏉′欢</para>
- ///<para>4锛氬�掕鏃�</para>
- ///<para>5锛氭椂闂存鏉′欢</para>
- ///<para>6锛氬畨闃叉潯浠�</para>
- /// </summary>
- public int Type;
- /// <summary>
- /// 鏉′欢id
- /// 鏂板鏃禖onditionId=0锛屼慨鏀规椂浼犲叆瀵瑰簲鐨凜onditionId
- /// </summary>
- public int ConditionId;
- /// <summary>
- /// conditionObj:鏉′欢瀵硅薄
- /// </summary>
- public ConditionBase conditionObj;
- }
- #endregion
-
- #region 鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢.
- ///<summary >
- /// 鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢
- /// </summary>
- public static async System.Threading.Tasks.Task<SetConditionResponseAllData> SetConditionAsync(SetConditionData setConditionData)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- SetConditionResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new SetConditionResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new SetConditionResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new SetConditionResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/SetCondition_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetConditionResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new SetConditionResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new SetConditionResponseAllData { setConditionResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/SetCondition_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- if(setConditionData !=null){
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2006 } };
-
- var data = new JObject {
- { "LogicId",setConditionData.LogicId},
- { "ConditionId", setConditionData.ConditionId} ,
- { "Operation", setConditionData.Operation }
- };
- jObject.Add("Data", data);
- ZbGateway.MainGateWay?.Send(("Logic/SetCondition"), jObject.ToString());
- }
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new SetConditionResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/SetCondition_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢鐨勬墍鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public SetConditionResponseAllData setConditionResponseAllData;
- ///<summary >
- /// 鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢鍥炲鐨勬墍鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class SetConditionResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢鍥炲鐨勬暟鎹�
- /// </summary>
- public SetConditionResponseData setConditionResponseData;
- }
-
- /// <summary>
- ///鑾峰彇鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢鐨勬暟鎹�
- /// </summary>
- public SetConditionResponseData setConditionResponseData;
- /// <summary>
- ///鑾峰彇鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class SetConditionResponseData : LogicBase
- {
- /// <summary>
- /// 0锛氭垚鍔�
- ///<para>1锛氬け璐ワ紝閫昏緫鎴栨潯浠朵笉瀛樺湪</para>
- /// </summary>
- public int Result;
-
- /// <summary>
- /// 鏉′欢id
- /// </summary>
- public int ConditionId;
- /// <summary>
- /// 0锛氬拷鐣ユ潯浠讹紝灏嗘潯浠禝sVaild缃�0銆�
- ///<para>1锛氬惎鐢ㄦ潯浠讹紝灏嗘潯浠禝sVaild缃�1銆�</para>
- ///<para>2锛氫娇鑳戒竴娆★紝灏嗘潯浠禝sVaild缃�2锛堟潯浠舵垚绔嬩竴娆″悗灏嗚绂佺敤锛孖sValid鑷姩缃负0锛夈��</para>
- ///<para>3锛氬け鑳戒竴娆★紝灏嗘潯浠禝sVaild缃�3锛堟潯浠剁涓�娆℃垚绔嬩細琚拷鐣ワ紝瑙﹀彂涓嶄簡閫昏緫锛岀劧鍚嶪sValid鑷姩缃�1銆備互鍚庢潯浠跺啀鎴愮珛灏嗕笉浼氳蹇界暐锛�</para>
- ///<para>4锛氬垹闄ゆ潯浠躲��</para>
- /// </summary>
- public int Operation;
- }
-
- /// <summary>
- ///璁剧疆鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢鐨勬暟鎹�
- /// </summary>
- public SetConditionData setConditionData;
- /// <summary>
- ///璁剧疆鍒犻櫎/鍚敤/绂佺敤閫昏緫鏉′欢鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class SetConditionData : LogicBase
- {
- /// <summary>
- /// 鏉′欢id
- /// </summary>
- public int ConditionId;
- /// <summary>
- /// 0锛氬拷鐣ユ潯浠讹紝灏嗘潯浠禝sVaild缃�0銆�
- ///<para>1锛氬惎鐢ㄦ潯浠讹紝灏嗘潯浠禝sVaild缃�1銆�</para>
- ///<para>2锛氫娇鑳戒竴娆★紝灏嗘潯浠禝sVaild缃�2锛堟潯浠舵垚绔嬩竴娆″悗灏嗚绂佺敤锛孖sValid鑷姩缃负0锛夈��</para>
- ///<para>3锛氬け鑳戒竴娆★紝灏嗘潯浠禝sVaild缃�3锛堟潯浠剁涓�娆℃垚绔嬩細琚拷鐣ワ紝瑙﹀彂涓嶄簡閫昏緫锛岀劧鍚嶪sValid鑷姩缃�1銆備互鍚庢潯浠跺啀鎴愮珛灏嗕笉浼氳蹇界暐锛�</para>
- ///<para>4锛氬垹闄ゆ潯浠躲��</para>
- /// </summary>
- public int Operation = 1;
- }
- #endregion
-
- #region 淇敼鎴栨柊澧炲姩浣滀换鍔�.
- ///<summary >
- /// 淇敼鎴栨柊澧炲姩浣滀换鍔�
- /// </summary>
- public static async System.Threading.Tasks.Task<ChangeActionResponseAllData> ChangeActionAsync(ChangeActionData actionData)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- ChangeActionResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new ChangeActionResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new ChangeActionResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new ChangeActionResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/ChangeAction_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<ChangeActionResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new ChangeActionResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new ChangeActionResponseAllData { changeActionResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/ChangeAction_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- if (actionData != null)
- {
- var dataPublish = new Dictionary<string, object> { };
- switch (actionData.LinkType)
- {
- case 0:
- var dataPublish0 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["LinkType"] = actionData.LinkType,
- ["DeviceAddr"] = actionData.DeviceAddr,
- ["Epoint"] = actionData.Epoint,
- ["TaskList"] = actionData.TaskList,
- ["Time"] = actionData.Time,
- };
- dataPublish = dataPublish0;
- break;
- case 2:
- int sceneID = int.Parse(actionData.DeviceAddr);
- var dataPublish2 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["LinkType"] = actionData.LinkType,
- ["DeviceAddr"] = sceneID,
- ["Epoint"] = actionData.Epoint,
- };
- dataPublish = dataPublish2;
- break;
- case 4:
- int conID = int.Parse(actionData.DeviceAddr);
- var dataPublish4 = new Dictionary<string, object> //{ };
- {
- ["LogicId"] = actionData.LogicId,
- ["LinkType"] = actionData.LinkType,
- ["DeviceAddr"] = conID,
- ["EnableLogic"] = actionData.EnableLogic,
- };
- dataPublish = dataPublish4;
- break;
- case 5:
- int logID = int.Parse(actionData.DeviceAddr);
- var dataPublish5 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["LinkType"] = actionData.LinkType,
- ["DeviceAddr"] = logID,
- ["ConditionId"] = actionData.ConditionId,
- ["EnableCondition"] = actionData.EnableCondition,
- };
- dataPublish = dataPublish5;
- break;
- case 6:
- int sID = int.Parse(actionData.DeviceAddr);
- var dataPublish6 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["LinkType"] = actionData.LinkType,
- ["SecuritySetting"] = actionData.SecuritySetting,
- ["SecurityModeId"] = actionData.SecurityModeId,
- ["CheckIASStatus"] = actionData.CheckIASStatus,
- ["IsDelayStart"] = actionData.IsDelayStart,
- ["Password"] = actionData.Password
- };
- dataPublish = dataPublish6;
- break;
- }
- ZbGateway.MainGateWay?.Send("Logic/ChangeAction", Device.Cluster_ID.Gateway, Command.LogicChangeAction, Newtonsoft.Json.Linq.JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(dataPublish)));
-
- }
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new ChangeActionResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/ChangeAction_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///淇敼鎴栨柊澧炲姩浣滀换鍔$殑鎵�鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public ChangeActionResponseAllData changeActionResponseAllData;
- ///<summary >
- /// 淇敼鎴栨柊澧炲姩浣滀换鍔″洖澶嶇殑鎵�鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class ChangeActionResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 淇敼鎴栨柊澧炲姩浣滀换鍔″洖澶嶇殑鏁版嵁
- /// </summary>
- public ChangeActionResponseData changeActionResponseData;
- }
-
- /// <summary>
- ///淇敼鎴栨柊澧炲姩浣滀换鍔″洖澶嶇殑鏁版嵁
- /// </summary>
- public ChangeActionResponseData changeActionResponseData;
- /// <summary>
- ///鑾峰彇淇敼鎴栨柊澧炲姩浣滀换鍔$殑鏁版嵁
- /// </summary>
- [System.Serializable]
- public class ChangeActionResponseData : LogicBase
- {
- /// <summary>
- /// 0锛氭垚鍔�
- ///<para>1锛氬け璐ワ紝閫昏緫涓嶅瓨鍦�</para>
- ///<para>2锛氬け璐ワ紝鑱斿姩璁惧涓嶅瓨鍦�</para>
- ///<para>3锛氬け璐ワ紝鑱斿姩鐨勫叾浠栭�昏緫涓嶅瓨鍦ㄣ��</para>
- ///<para>5锛氭搷浣滅殑閫昏緫鐨勬潯浠朵笉瀛樺湪</para>
- ///<para>6锛氬竷闃叉挙闃茬敤鎴峰瘑鐮侀敊璇�</para>
- ///<para>7锛氬畨闃叉ā寮忎笉瀛樺湪</para>
- /// </summary>
- public int Result;
- /// <summary>
- /// 娣诲姞鐨勮仈鍔ㄨ澶囩被鍨�
- ///<para>0锛氳仈鍔ㄨ澶囦负zigbee鑺傜偣璁惧</para>
- ///<para>2锛氳仈鍔ㄨ澶囦负鍦烘櫙锛堟仮澶嶅満鏅級</para>
- ///<para>4锛氫娇鑳藉け鑳藉叾浠栭�昏緫</para>
- ///<para>5锛氱鐢ㄦ垨鍚敤閫昏緫鏉′欢</para>
- ///<para>6锛氬畨闃叉ā寮忔搷浣�</para>
- /// </summary>
- public int LinkType;
- /// <summary>
- /// 鑱斿姩璁惧鐨勫湴鍧�锛�
- ///<para>璁惧mac鍦板潃锛堝瓧绗︼級锛孡inkType=0銆�</para>
- ///<para>瀵瑰満鏅搷浣滐紝鍗虫仮澶嶅満鏅� 涓哄満鏅痠d锛堟暟鍊硷級锛孡inkType涓�2銆�</para>
- ///<para>瀵瑰叾浠栭�昏緫鎿嶄綔 涓洪�昏緫id锛堟暟鍊硷級锛孡inkType=4 銆丩inkType= 5銆�</para>
- /// </summary>
- public string DeviceAddr;
- /// <summary>
- ///鑱斿姩璁惧鐨勭鍙e彿锛�
- ///<para>鍜宮ac鍦板潃鍏卞悓鏍囪瘑鍞竴鐨剒igbee璁惧 鏁板�艰寖鍥�0-255</para>
- ///<para>鍦烘櫙鍜岀粍璁句负null锛屾垨蹇界暐璇ュ瓧娈�</para>
- /// </summary>
- public int Epoint;
- /// <summary>
- ///閫昏緫浣胯兘銆佸け鑳姐��
- ///<para>褰揕inkType = 4鏃跺瓨鍦�</para>
- ///<para>0锛氬け鑳介�昏緫銆�</para>
- ///<para>1锛氫娇鑳介�昏緫銆�</para>
- ///<para>2锛氬彧浣胯兘涓�娆�</para>
- ///<para>3锛氬彧澶辫兘涓�娆�</para>
- /// </summary>
- public int EnableLogic;
- /// <summary>
- /// 鎿嶄綔鐨勯�昏緫鏉′欢id
- /// </summary>
- public int ConditionId;
- /// <summary>
- /// 鏄惁绂佺敤閫昏緫鏉′欢
- ///<para>褰揕inkType=5鏃跺瓨鍦�</para>
- ///<para>0 绂佺敤鏉′欢锛堝皢閫昏緫鏉′欢鐨処sValid瀛楁缃�0锛�</para>
- ///<para>1 鍚敤鏉′欢锛堝皢閫昏緫鏉′欢鐨処sValid瀛楁缃�1锛�</para>
- ///<para>2锛氫娇鑳戒竴娆★紙鏉′欢鎴愮珛涓�娆″悗灏嗚绂佺敤锛孖sValid鑷姩缃负0锛夈��</para>
- ///<para>3锛氬け鑳戒竴娆★紙鏉′欢绗竴娆℃垚绔嬩細琚拷鐣ワ紝瑙﹀彂涓嶄簡閫昏緫锛岀劧鍚嶪sValid鑷姩缃�1銆備互鍚庢潯浠跺啀鎴愮珛灏嗕笉浼氳蹇界暐锛�</para>
- /// </summary>
- public int EnableCondition;
- /// <summary>
- ///寤舵椂鎵ц鏃堕棿銆傚崟浣嶏紙绉掞級鑼冨洿锛�0-65535銆�
- ///<para>閫昏緫鎴愮珛鍚庯紝寤惰繜澶氫箙鎵ц璁惧鍔ㄤ綔鎸囦护銆�</para>
- ///<para>褰揕inkType=0鏃跺瓨鍦ㄣ�傝瀛楁鍙拷鐣ワ紝榛樿涓�0锛屽嵆閫昏緫鎴愮珛鍚庣珛鍗虫墽琛岃澶囧姩浣溿��</para>
- /// </summary>
- public int Time;
- /// <summary>
- /// 鑱斿姩浠诲姟鍒楄〃锛岃仈鍔ㄧ殑鑺傜偣璁惧鎵ц鐨勫姩浣滄寚浠ゃ��
- ///<para>褰揕inkType=0鏃跺瓨鍦ㄣ��</para>
- ///<para>鍜屾湰绔犵1灏忚妭鐨勬坊鍔犳垨淇敼閫昏緫鍛戒护鐨凾askList鏁扮粍鏍煎紡鐩稿悓</para>
- /// </summary>
- public List<TaskListInfo> TaskList = new List<TaskListInfo> { };
-
- ///<summary>
- ///瀵瑰畨闃叉ā寮忔搷浣�
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氭挙闃�</para>
- ///<para>1锛氭案涔呭竷闃诧紝鐩村埌鎾ら槻</para>
- ///<para>2锛氬竷闃诧紝浣嗕娇鑳戒竴娆★紝瑙﹀彂涓�娆″悗灏嗘挙闃层��</para>
- ///<para>3锛氬竷闃诧紝浣嗗け鑳戒竴娆★紝绗竴娆¤婵�娲讳笉璀﹀憡涓嶈Е鍙戝姩浣溿��</para>
- ///<para>瑙﹀彂鍔ㄤ綔鏃讹紝濡傛灉绯荤粺褰撳墠娌℃湁甯冮槻锛屽垯鎾ら槻澶辫触銆傚凡缁忓瓨鍦ㄥ竷闃叉ā寮忥紝灏嗗竷闃插け璐ワ紙闇�鍏堝褰撳墠甯冮槻妯″紡杩涜鎾ら槻锛�</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int SecuritySetting;
-
- ///<summary>
- ///瀹夐槻妯″紡id銆備负0鏃讹紝鍒欏褰撳墠鍦ㄥ竷闃茬殑瀹夐槻妯″紡杩涜鎿嶄綔銆�
- /// </summary>
- /// <value>The epoint.</value>
- public int SecurityModeId;
-
- ///<summary>
- ///妫�鏌ラ槻鍖鸿澶囨渶杩戜笂鎶ョ殑瀹夐槻淇℃伅鐘舵�佽繘琛屽竷闃�
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氫笉妫�鏌�</para>
- ///<para>1锛氭鏌�</para>
- ///<para>鍙己鐪侊紝榛樿涓�0</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int CheckIASStatus;
-
- ///<summary>
- ///鏄惁寤舵椂鍚姩銆傚竷闃插悗寤舵椂涓�娈垫椂闂存寮忓惎鍔ㄩ槻鍖猴紝杩欐鏃堕棿鍙互璁╀汉鍛樻挙绂婚槻鍖哄尯鍩熴��
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氫笉寤舵椂</para>
- ///<para>1锛氬欢鏃跺惎鍔�</para>
- ///<para>鍙己鐪侊紝榛樿涓�0</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int IsDelayStart;
- }
- /// <summary>
- ///璁剧疆闇�瑕佷慨鏀规垨鏂板鍔ㄤ綔浠诲姟鐨勬暟鎹�
- /// </summary>
- public ChangeActionData changeActionData;
- /// <summary>
- ///璁剧疆闇�瑕佷慨鏀规垨鏂板鍔ㄤ綔浠诲姟鐨勬暟鎹�
- /// LogicId锛�
- /// </summary>
- [System.Serializable]
- public class ChangeActionData : LogicBase
- {
- /// <summary>
- /// 娣诲姞鐨勮仈鍔ㄨ澶囩被鍨�
- ///<para>0锛氳仈鍔ㄨ澶囦负zigbee鑺傜偣璁惧</para>
- ///<para>2锛氳仈鍔ㄨ澶囦负鍦烘櫙锛堟仮澶嶅満鏅級</para>
- ///<para>4锛氫娇鑳藉け鑳藉叾浠栭�昏緫</para>
- ///<para>5锛氱鐢ㄦ垨鍚敤閫昏緫鏉′欢</para>
- ///<para> 6锛氬畨闃叉ā寮忔搷浣�</para>
- /// </summary>
- public int LinkType;
- /// <summary>
- /// 鑱斿姩璁惧鐨勫湴鍧�锛�
- /// <para>璁惧mac鍦板潃锛堝瓧绗︼級锛孡inkType=0銆�</para>
- ///<para>瀵瑰満鏅搷浣滐紝鍗虫仮澶嶅満鏅� 涓哄満鏅痠d锛堟暟鍊硷級锛孡inkType涓�2銆�</para>
- ///<para>瀵瑰叾浠栭�昏緫鎿嶄綔 涓洪�昏緫id锛堟暟鍊硷級锛孡inkType=4 銆丩inkType= 5銆�</para>
- /// </summary>
- public string DeviceAddr;
- /// <summary>
- /// 鑱斿姩璁惧鐨勭鍙e彿锛歀inkType=0鏃跺瓨鍦�
- ///<para>鍜宮ac鍦板潃鍏卞悓鏍囪瘑鍞竴鐨剒igbee璁惧 鏁板�艰寖鍥�0-255</para>
- ///<para>鍦烘櫙鍜岀粍璁句负null锛屾垨蹇界暐璇ュ瓧娈�</para>
- /// </summary>
- public int Epoint;
- /// <summary>
- /// 閫昏緫浣胯兘銆佸け鑳姐�侺inkType=4鏃跺瓨鍦�
- ///<para>0锛氬け鑳介�昏緫銆�</para>
- ///<para>1锛氫娇鑳介�昏緫銆�</para>
- ///<para>2锛氬彧浣胯兘涓�娆�</para>
- ///<para>3锛氬彧澶辫兘涓�娆�</para>
- /// </summary>
- public int EnableLogic;
- /// <summary>
- /// 鎿嶄綔鐨勯�昏緫鏉′欢id锛孡inkType=5鏃跺瓨鍦�
- /// </summary>
- public int ConditionId;
- /// <summary>
- /// 鏄惁绂佺敤閫昏緫鏉′欢锛孡inkType=5鏃跺瓨鍦�
- ///<para>0 绂佺敤鏉′欢锛堝皢閫昏緫鏉′欢鐨処sValid瀛楁缃�0锛�</para>
- ///<para>1 鍚敤鏉′欢锛堝皢閫昏緫鏉′欢鐨処sValid瀛楁缃�1锛�</para>
- ///<para>2锛氫娇鑳戒竴娆★紙鏉′欢鎴愮珛涓�娆″悗灏嗚绂佺敤锛孖sValid鑷姩缃负0锛夈��</para>
- ///<para>3锛氬け鑳戒竴娆★紙鏉′欢绗竴娆℃垚绔嬩細琚拷鐣ワ紝瑙﹀彂涓嶄簡閫昏緫锛岀劧鍚嶪sValid鑷姩缃�1銆備互鍚庢潯浠跺啀鎴愮珛灏嗕笉浼氳蹇界暐锛�</para>
- /// </summary>
- public int EnableCondition;
- /// <summary>
- ///寤舵椂鎵ц鏃堕棿銆侺inkType=0鏃跺瓨鍦�
- ///<para>褰揕inkType=0鏃讹紝璇ュ瓧娈典篃鍙拷鐣ワ紝榛樿涓�0锛屽嵆閫昏緫鎴愮珛鍚庣珛鍗虫墽琛岃澶囧姩浣溿��</para>
- ///<para>鍗曚綅锛堢锛夎寖鍥达細0-65535銆�</para>
- ///<para>閫昏緫鎴愮珛鍚庯紝寤惰繜澶氫箙鎵ц璁惧鍔ㄤ綔鎸囦护銆�</para>
- /// </summary>
- public int Time;
- /// <summary>
- ///鑱斿姩浠诲姟鍒楄〃锛孡inkType=0鏃跺瓨鍦�
- ///<para>鑱斿姩鐨勮妭鐐硅澶囨墽琛岀殑鍔ㄤ綔鎸囦护銆�</para>
- ///<para>鍜屾湰绔犵1灏忚妭鐨勬坊鍔犳垨淇敼閫昏緫鍛戒护鐨凾askList鏁扮粍鏍煎紡鐩稿悓</para>
- /// </summary>
- public List<TaskListInfo> TaskList = new List<TaskListInfo> { };
- ///<summary>
- ///瀵瑰畨闃叉ā寮忔搷浣�
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氭挙闃�</para>
- ///<para>1锛氭案涔呭竷闃诧紝鐩村埌鎾ら槻</para>
- ///<para>2锛氬竷闃诧紝浣嗕娇鑳戒竴娆★紝瑙﹀彂涓�娆″悗灏嗘挙闃层��</para>
- ///<para>3锛氬竷闃诧紝浣嗗け鑳戒竴娆★紝绗竴娆¤婵�娲讳笉璀﹀憡涓嶈Е鍙戝姩浣溿��</para>
- ///<para>瑙﹀彂鍔ㄤ綔鏃讹紝濡傛灉绯荤粺褰撳墠娌℃湁甯冮槻锛屽垯鎾ら槻澶辫触銆傚凡缁忓瓨鍦ㄥ竷闃叉ā寮忥紝灏嗗竷闃插け璐ワ紙闇�鍏堝褰撳墠甯冮槻妯″紡杩涜鎾ら槻锛�</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int SecuritySetting;
-
- ///<summary>
- ///瀹夐槻妯″紡id銆備负0鏃讹紝鍒欏褰撳墠鍦ㄥ竷闃茬殑瀹夐槻妯″紡杩涜鎿嶄綔銆�
- /// </summary>
- /// <value>The epoint.</value>
- public int SecurityModeId;
-
- ///<summary>
- ///妫�鏌ラ槻鍖鸿澶囨渶杩戜笂鎶ョ殑瀹夐槻淇℃伅鐘舵�佽繘琛屽竷闃�
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氫笉妫�鏌�</para>
- ///<para>1锛氭鏌�</para>
- ///<para>鍙己鐪侊紝榛樿涓�0</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int CheckIASStatus;
-
- ///<summary>
- ///鏄惁寤舵椂鍚姩銆傚竷闃插悗寤舵椂涓�娈垫椂闂存寮忓惎鍔ㄩ槻鍖猴紝杩欐鏃堕棿鍙互璁╀汉鍛樻挙绂婚槻鍖哄尯鍩熴��
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氫笉寤舵椂</para>
- ///<para>1锛氬欢鏃跺惎鍔�</para>
- ///<para>鍙己鐪侊紝榛樿涓�0</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int IsDelayStart;
-
- ///<summary>
- ///甯冮槻鎾ら槻鐢ㄦ埛瀵嗙爜锛屽鏋滃瘑鐮侀敊璇皢鍔犲叆澶辫触
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>鏁版嵁鍥炲鏃讹紝璇ュ瓧娈典笉瀛樺湪</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int Password;
- }
- #endregion
-
- #region 鍒犻櫎鍔ㄤ綔.
- ///<summary >
- /// 鍒犻櫎鍔ㄤ綔
- /// </summary>
- public static async System.Threading.Tasks.Task<DelActionResponseAllData> DelActionAsync(DelActionData actionData)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- DelActionResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new DelActionResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new DelActionResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new DelActionResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/DelAction_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelActionResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new DelActionResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new DelActionResponseAllData { delActionResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/DelAction_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- if (actionData != null)
- {
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2008 } };
-
- var dataPublish = new Dictionary<string, object> { };
- switch (actionData.Type)
- {
- case 0:
- var dataPublish0 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["Type"] = actionData.Type,
- ["DeviceAddr"] = actionData.DeviceAddr,
- ["Epoint"] = actionData.Epoint,
- };
- dataPublish = dataPublish0;
- break;
- case 2:
- int sceneID = int.Parse(actionData.DeviceAddr);
- var dataPublish2 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["Type"] = actionData.Type,
- ["DeviceAddr"] = sceneID,
- ["Epoint"] = actionData.Epoint,
- };
- dataPublish = dataPublish2;
- break;
- case 4:
- int conID = int.Parse(actionData.DeviceAddr);
- var dataPublish4 = new Dictionary<string, object> //{ };
- {
- ["LogicId"] = actionData.LogicId,
- ["Type"] = actionData.Type,
- ["DeviceAddr"] = conID,
- };
- dataPublish = dataPublish4;
- break;
- case 5:
- int logID = int.Parse(actionData.DeviceAddr);
- var dataPublish5 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["Type"] = actionData.Type,
- ["DeviceAddr"] = logID,
- ["ConditionId"] = actionData.ConditionId,
- };
- dataPublish = dataPublish5;
- break;
- case 6:
- int sID = int.Parse(actionData.DeviceAddr);
- var dataPublish6 = new Dictionary<string, object>
- {
- ["LogicId"] = actionData.LogicId,
- ["Type"] = actionData.Type,
- ["SecurityModeId"] = actionData.SecurityModeId,
- };
- dataPublish = dataPublish6;
- break;
- }
- ZbGateway.MainGateWay?.Send("Logic/ChangeAction", Device.Cluster_ID.Gateway, Command.LogicDelAction, Newtonsoft.Json.Linq.JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(dataPublish)));
- }
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new DelActionResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/DelAction_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///鍒犻櫎鍔ㄤ綔鐨勬墍鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public DelActionResponseAllData delActionResponseAllData;
- ///<summary >
- /// 鍒犻櫎鍔ㄤ綔鍥炲鐨勬墍鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class DelActionResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 鍒犻櫎鍔ㄤ綔鍥炲鐨勬暟鎹�
- /// </summary>
- public DelActionResponseData delActionResponseData;
- }
-
- /// <summary>
- ///鍒犻櫎鍔ㄤ綔鐨勬暟鎹�
- /// </summary>
- public DelActionResponseData delActionResponseData;
- /// <summary>
- ///鍒犻櫎鍔ㄤ綔鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class DelActionResponseData : LogicBase
- {
- /// <summary>
- /// 0锛氭垚鍔�
- ///<para>1锛氬け璐ワ紝閫昏緫鎴栧姩浣滆澶囦笉瀛樺湪</para>
- /// </summary>
- public int Result;
- /// <summary>
- /// 鍒犻櫎鐨勮仈鍔ㄨ澶囩殑绫诲瀷锛�
- ///<para>0锛氳仈鍔ㄨ澶囦负zigbee鑺傜偣璁惧</para>
- ///<para>2锛氳仈鍔ㄨ澶囦负鍦烘櫙锛堟仮澶嶅満鏅級</para>
- ///<para>4锛氫娇鑳藉け鑳藉叾浠栭�昏緫</para>
- ///<para>5锛氱鐢ㄦ垨鍚敤閫昏緫鏉′欢</para>
- ///<para>6锛氬畨闃叉ā寮忔搷浣�</para>
- /// </summary>
- public int Type;
- /// <summary>
- /// 鑱斿姩璁惧鐨勫湴鍧�锛�
- ///<para>瀵硅澶囨搷浣� 涓鸿澶噈ac鍦板潃锛堝瓧绗︼級锛孴ype涓�0</para>
- ///<para>瀵圭粍鎿嶄綔 涓虹粍id锛堟暟鍊硷級锛孴ype涓�2</para>
- ///<para>瀵瑰満鏅搷浣� 涓哄満鏅痠d锛堟暟鍊硷級锛孴ype涓�2</para>
- ///<para>瀵归�昏緫鎿嶄綔 涓洪�昏緫id锛堟暟鍊硷級锛孴ype涓�4鎴�5</para>
- /// </summary>
- public string DeviceAddr;
- ///<summary>
- ///鑱斿姩璁惧鐨勭鍙e彿锛�
- ///<para>鍜宮ac鍦板潃鍏卞悓鏍囪瘑鍞竴鐨剒igbee璁惧 鏁板�艰寖鍥�0-255</para>
- ///<para>鍦烘櫙鍜岀粍銆侀�昏緫蹇界暐璇ュ瓧娈�</para>
- /// </summary>
- public int Epoint;
- /// <summary>
- ///鍏朵粬閫昏緫鐨勬潯浠秈d锛屽綋Type涓�5鏃跺瓨鍦�
- /// </summary>
- public int ConditionId;
- /// <summary>
- ///瀹夐槻妯″紡id銆備负0鏃讹紝鍒欏褰撳墠鍦ㄥ竷闃茬殑瀹夐槻妯″紡杩涜鎿嶄綔銆傦紙褰揟ype = 6鏃跺瓨鍦級
- /// </summary>
- public int SecurityModeId;
- }
-
- /// <summary>
- ///鍒犻櫎鍔ㄤ綔鐨勬暟鎹�
- /// </summary>
- public DelActionData delActionData;
- /// <summary>
- ///鍒犻櫎鍔ㄤ綔鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class DelActionData : LogicBase
- {
- /// <summary>
- /// 鍒犻櫎鐨勮仈鍔ㄨ澶囩殑绫诲瀷锛�
- ///<para>0锛氳仈鍔ㄨ澶囦负zigbee鑺傜偣璁惧</para>
- ///<para>2锛氳仈鍔ㄨ澶囦负鍦烘櫙锛堟仮澶嶅満鏅級</para>
- ///<para>4锛氫娇鑳藉け鑳藉叾浠栭�昏緫</para>
- ///<para>5锛氱鐢ㄦ垨鍚敤閫昏緫鏉′欢</para>
- ///<para>6锛氬畨闃叉ā寮忔搷浣�</para>
- /// </summary>
- public int Type;
- /// <summary>
- /// 鑱斿姩璁惧鐨勫湴鍧�锛�
- ///<para>瀵硅澶囨搷浣� 涓鸿澶噈ac鍦板潃锛堝瓧绗︼級锛孴ype涓�0</para>
- ///<para>瀵圭粍鎿嶄綔 涓虹粍id锛堟暟鍊硷級锛孴ype涓�1</para>
- ///<para>瀵瑰満鏅搷浣� 涓哄満鏅痠d锛堟暟鍊硷級锛孴ype涓�2</para>
- ///<para>瀵归�昏緫鎿嶄綔 涓洪�昏緫id锛堟暟鍊硷級锛孴ype涓�3</para>
- /// </summary>
- public string DeviceAddr;
- /// <summary>
- /// <para>Type涓�0鏃舵墠瀛樺湪锛屾鏃跺繀闇�濉啓鍙傛暟</para>
- /// <para>鑱斿姩璁惧鐨勭鍙e彿</para>
- ///<para>鍜宮ac鍦板潃鍏卞悓鏍囪瘑鍞竴鐨剒igbee璁惧 鏁板�艰寖鍥�0-255</para>
- ///<para>鍦烘櫙鍜岀粍銆侀�昏緫蹇界暐璇ュ瓧娈�</para>
- /// </summary>
- public int Epoint;
- /// <summary>
- /// <para>Type涓�5鏃舵墠瀛樺湪锛屾鏃跺繀闇�濉啓鍙傛暟</para>
- /// 鎿嶄綔鐨勯�昏緫鏉′欢id锛孴ype涓�5鏃跺瓨鍦�
- /// </summary>
- public int ConditionId;
- /// <summary>
- /// <para>Type涓�6鏃舵墠瀛樺湪锛屾鏃跺繀闇�濉啓鍙傛暟</para>
- /// 瀹夐槻妯″紡id銆備负0鏃讹紝鍒欏褰撳墠鍦ㄥ竷闃茬殑瀹夐槻妯″紡杩涜鎿嶄綔銆�
- /// </summary>
- public int SecurityModeId;
- }
- #endregion
-
- #region 鍒犻櫎閫昏緫.
- ///<summary >
- /// 鍒犻櫎閫昏緫
- /// </summary>
- public static async System.Threading.Tasks.Task<DelLogicResponseAllData> DelLogicAsync(int logicId)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- DelLogicResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new DelLogicResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new DelLogicResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new DelLogicResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/DelLogic_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelLogicResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new DelLogicResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new DelLogicResponseAllData { delLogicResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/DelLogic_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2009 } };
- var data = new JObject {
- { "LogicId",logicId}
- };
- jObject.Add("Data", data);
- ZbGateway.MainGateWay?.Send(("Logic/DelLogic"), jObject.ToString());
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new DelLogicResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/DelLogic_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- ///鍒犻櫎閫昏緫鐨勬墍鏈夋暟鎹�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- public DelLogicResponseAllData delLogicResponseAllData;
- ///<summary >
- /// 鍒犻櫎閫昏緫鐨勬墍鏈夋暟鎹�
- /// </summary>
- [System.Serializable]
- public class DelLogicResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 鍒犻櫎閫昏緫鍥炲鐨勬暟鎹�
- /// </summary>
- public DelLogicResponseData delLogicResponseData;
- }
-
- /// <summary>
- ///鍒犻櫎閫昏緫鐨勬暟鎹�
- /// </summary>
- public DelLogicResponseData delLogicResponseData;
- /// <summary>
- ///鍒犻櫎閫昏緫鐨勬暟鎹�
- /// </summary>
- [System.Serializable]
- public class DelLogicResponseData : LogicBase
- {
- /// <summary>
- ///0锛氭垚鍔�
- ///<para>1锛氬け璐ワ紝閫昏緫涓嶅瓨鍦�</para>
- /// </summary>
- public int Result;
- }
-
- #endregion
-
- #region 鏃堕棿鐐规潯浠舵帹杩熸墽琛�
- /// <summary>
- ///鑾峰彇鏃堕棿鐐规潯浠舵帹杩熸墽琛岀殑鏁版嵁
- /// </summary>
- public TimingWillArriveData timingWillArriveData;
- /// <summary>
- ///鑾峰彇鏃堕棿鐐规潯浠舵帹杩熸墽琛岀殑鏁版嵁
- /// </summary>
- [System.Serializable]
- public class TimingWillArriveData : LogicBase
- {
- /// <summary>
- /// 鏉′欢id
- /// </summary>
- public int ConditionId;
-
- /// <summary>
- ///鏉′欢绫诲瀷
- ///0锛氶槼鍘� 1锛氬啘鍘�
- /// </summary>
- public int Calendar;
- /// <summary>
- ///鏃堕棿鐐圭被鍨嬶細
- ///<para>0锛氭甯告椂闂寸偣锛堜粠Datetime杩欎釜鏃堕棿鐐瑰紑濮嬫墽琛岋級</para>
- ///<para>1锛氭棩鍑烘椂闂达紙浠嶥ateTime涔嬪悗绗竴娆℃棩鍑烘椂闂村紑濮嬫墽琛岋級</para>
- ///<para>2锛氭棩钀芥椂闂达紙浠嶥ateTime涔嬪悗绗竴娆℃棩钀芥椂闂村紑濮嬫墽琛岋級</para>
- ///<para>3锛氭鍗堟椂闂达紙浠嶥ateTime涔嬪悗绗竴娆′腑鍗堟椂闂村紑濮嬫墽琛岋級</para>
- /// </summary>
- public int DateType;
-
- /// <summary>
- ///琛ㄧず瑙﹀彂鍔ㄤ綔鐨勫紑濮嬫椂闂� 鏍煎紡涓虹敱utc鏃堕棿杞崲鎴愮殑Unix鏃堕棿鎴炽�傚鍖椾含鏃堕棿2018骞�7鏈�9鏃� 17:50:00锛屽垯杞崲鏃堕棿鎴冲悗涓�1531129800銆傝鏃堕棿鐐逛篃鏄瘡鏈堟瘡骞撮噸澶嶇殑鍒ゆ柇渚濇嵁銆�
- /// </summary>
- public int Datetime;
- /// <summary>
- /// 褰揟ype涓�0鏃讹紝璇ュ瓧娈垫墠瀛樺湪
- ///<para>閲嶅绫诲瀷</para>
- ///<para>1锛氭瘡灏忔椂鎵ц锛堟寜涓婇潰渚嬪瓙锛屼粠鍖椾含鏃堕棿2018/7/9 17:50:00寮�濮嬫瘡灏忔椂鎵ц涓�娆★級</para>
- ///<para>2锛氭瘡澶╂墽琛岋紙鎸変笂闈緥瀛愶紝浠庡寳浜椂闂�2018/7/9 17:50:00寮�濮嬫瘡澶�17:50:00鎵ц涓�娆★級</para>
- ///<para>3锛氭瘡鏈堟墽琛岋紙鎸変笂闈緥瀛愶紝浠庡寳浜椂闂�2018/7/9 17:50:00寮�濮嬫瘡鏈�9鏃�17:50:00鎵ц涓�娆°�傚鏋滀负鍐滃巻鍒欐槸姣忔湀鍐滃巻浜屽崄鍏墽琛岋級</para>
- ///<para>4锛氭瘡骞存墽琛岋紙鎸変笂闈緥瀛愶紝浠庡寳浜椂闂�2018/7/9 17:50:00寮�濮嬫瘡骞�7鏈�9鏃�17:50:00鎵ц涓�娆°�傚鏋滀负鍐滃巻锛屽垯鏄瘡骞村啘鍘嗕簲鏈堜簩鍗佸叚17:50:00鎵ц锛�</para>
- ///<para>5锛氬懆閲嶅銆傦紙鍛ㄤ竴鍒板懆涓冨彲閫夋墽琛岋級 </para>
- /// </summary>
- public int Repeat;
- /// <summary>
- /// 鍛ㄥ伐浣滄ā寮忥紙鍙垨杩愮畻锛�
- ///<para>0x01 鍛ㄤ竴鎵ц</para>
- ///<para>0x02 鍛ㄤ簩鎵ц</para>
- ///<para>0x04 鍛ㄤ笁鎵ц</para>
- ///<para>0x08 鍛ㄥ洓鎵ц</para>
- ///<para>0x10 鍛ㄤ簲鎵ц</para>
- ///<para>0x20 鍛ㄥ叚鎵ц</para>
- ///<para>0x40 鍛ㄦ棩鎵ц</para>
- ///<para>0x7F 姣忓ぉ鎵ц</para>
- ///<para>鏁板�煎彲杩涜鎴栬繍绠楋紝濡傚懆涓�銆佸懆涓夈�佸懆浜旀墽琛岋紝鍒欎负WeekDay=锛�0x01 || 0x04 || 0x10锛�= 0x15 鍗冲崄杩涘埗 21銆�</para>
- /// </summary>
- /// <value>The week day.</value>
- public int WeekDay;
- /// <summary>
- ///鎻愬墠鎻愰啋鏃堕棿銆傦紙鍗曚綅绉掞級鑼冨洿锛�0-65535
- ///<para>瀹氭椂鏉′欢灏嗚瑙﹀彂鐨勫墠RemindTime绉掞紝缃戝叧灏嗛�氱煡瀹㈡埛绔畾鏃舵椂闂村皢鑷筹紝鍙兘浼氭墽琛岄�昏緫鍔ㄤ綔锛堝鏋滆閫昏緫杩橀渶瑕佹弧瓒冲叾浠栨潯浠讹紝鍒欏埌杈惧畾鏃舵椂闂存椂锛屽叾浠栨潯浠舵病鏈夋弧瓒冲皢涓嶄細鎵ц閫昏緫鍔ㄤ綔锛夈�傚湪杩欐鏃堕棿鍐咃紝瀹㈡埛绔彲鍙戦�佹寚浠よ瀹氭椂鎺ㄨ繜鎵ц銆傛渶缁堢殑瀹氭椂鏃堕棿灏嗘槸鍘熸潵瀹氭椂鏃堕棿+鎺ㄨ繜鐨勬椂闂淬��</para>
- ///<para>濡傛灉涓�0锛屽垯涓嶆彁閱掋�傚埌杈炬彁鍓嶆彁閱掓椂锛屽皢鍙戦�佺11灏忚妭鐨勬彁閱掗�氱煡銆�</para>
- /// </summary>
- public int RemindTime;
- /// <summary>
- ///鏄惁鍏佽鎺ㄨ繜
- ///<para>0锛氫笉鍏佽</para>
- ///<para>1锛氬厑璁�</para>
- ///</summary>
- public int EnDelay;
- /// <summary>
- ///鎺ㄨ繜鏃堕棿锛堝崟浣嶏細绉掞級鑼冨洿锛�0-65535
- ///<para>鎺ㄨ繜鏃堕棿濡傛灉灏忎簬鎻愬墠鎻愰啋鏃堕棿锛屽垯鍦ㄦ帹杩熷墠鐨勫畾鏃舵椂闂村埌杈炬椂鎻愰啋銆�</para>
- ///</summary>
- public int DelayTime;
- /// <summary>
- ///鏈瀹氭椂鏉′欢瑙﹀彂鐨剈tc鏃堕棿
- ///</summary>
- public int TriggerTime;
- }
-
- #endregion
-
- //#region 鎺ㄨ繜瀹氭椂鏉′欢
- ///// <summary>
- ///// 璁剧疆鎺ㄨ繜瀹氭椂鏉′欢鎴愮珛鐨勬暟鎹�
- /////<para>濡傛灉瑕佹帹杩熷畾鏃舵潯浠舵垚绔嬶紝鍙湪鎻愰啋鍚庡埌杈捐Е鍙戠殑鏃堕棿鐐瑰墠鍙戦�佷互涓嬫帹杩熸寚浠ゃ�傚鏋滄帹杩熸垚鍔燂紝鏃堕棿鏉′欢灏嗗湪鍘熻瑙﹀彂鐨勬椂闂寸偣涓婃帹杩烡elayTime瑙﹀彂鏉′欢銆�</para>
- ///// </summary>
- //public GetLogicTimeDelayTriggerData getLogicTimeDelayTrigger;
- ///// <summary>
- ///// 璁剧疆鎺ㄨ繜瀹氭椂鏉′欢鎴愮珛鐨勬暟鎹�
- /////<para>濡傛灉瑕佹帹杩熷畾鏃舵潯浠舵垚绔嬶紝鍙湪鎻愰啋鍚庡埌杈捐Е鍙戠殑鏃堕棿鐐瑰墠鍙戦�佷互涓嬫帹杩熸寚浠ゃ�傚鏋滄帹杩熸垚鍔燂紝鏃堕棿鏉′欢灏嗗湪鍘熻瑙﹀彂鐨勬椂闂寸偣涓婃帹杩烡elayTime瑙﹀彂鏉′欢銆�</para>
- ///// </summary>
- //[System.Serializable]
- //public class GetLogicTimeDelayTriggerData : LogicBase
- //{
- // /// <summary>
- // /// 0锛氭垚鍔�
- // ///<para>1锛氬け璐ワ紝閫昏緫鎴栨潯浠朵笉瀛樺湪</para>
- // ///<para>2锛氬け璐ワ紝鏉′欢涓嶆槸瀹氭椂鏉′欢銆�</para>
- // ///<para>3锛氬け璐ワ紝鏉′欢涓嶅厑璁告帹杩�</para>
- // ///<para>4锛氬け璐ワ紝娌℃湁鍦ㄦ彁閱掑悗鍒拌揪瑙﹀彂鐨勬椂闂寸偣鍓嶅彂閫併��</para>
- // /// </summary>
- // public int Result;
-
- // /// <summary>
- // ///鏉′欢id
- // /// </summary>
- // public int ConditionId;
- // /// <summary>
- // ///鎺ㄨ繜鍚庡畾鏃舵潯浠惰Е鍙戠殑utc鏃堕棿
- // /// </summary>
- // public int TriggerTime;
-
- //}
-
- ///// <summary>
- ///// 鎺ㄨ繜瀹氭椂鏉′欢鎴愮珛锛屽彂甯冨埌缃戝叧
- ///// <para>濡傛灉瑕佹帹杩熷畾鏃舵潯浠舵垚绔嬶紝鍙湪鎻愰啋鍚庡埌杈捐Е鍙戠殑鏃堕棿鐐瑰墠鍙戦�佷互涓嬫帹杩熸寚浠ゃ�傚鏋滄帹杩熸垚鍔燂紝鏃堕棿鏉′欢灏嗗湪鍘熻瑙﹀彂鐨勬椂闂寸偣涓婃帹杩烡elayTime瑙﹀彂鏉′欢銆�</para>
- ///// <para>logicId 閫昏緫id锛岄�昏緫鐨勫敮涓�鏍囪瘑</para>
- ///// <para>conditionId 鏉′欢id</para>
- ///// </summary>
- //public void LogicTimeDelayTriggerPublish(int logicId, int conditionId)
- //{
- // var dataPublish = new Dictionary<string, object> { ["LogicId"] = logicId, ["ConditionId"] = conditionId };
- // ZbGateway.MainGateWay?.Send("Logic/TimingWillArrive", Device.Cluster_ID.Gateway, Command.LogicTimeDelayTrigger, Newtonsoft.Json.Linq.JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(dataPublish)));
- //}
- //#endregion
-
- #region 閫昏緫琚皟鐢ㄥ弽棣�.
- ///<summary >
- ///閫昏緫鎺у埗
- /// </summary>
- public static async System.Threading.Tasks.Task<ExecuteRespoAllData> ControlLogicAsync(int logicId)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- ExecuteRespoAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new ExecuteRespoAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new ExecuteRespoAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new ExecuteRespoAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/TestActions_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<ExecuteResponse>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new ExecuteRespoAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new ExecuteRespoAllData { logicExecuteRespo = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/TestActions_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2012 } };
- var data = new JObject {
- { "LogicId",logicId}
- };
- jObject.Add("Data", data);
- ZbGateway.MainGateWay?.Send(("Logic/TestActions"), jObject.ToString());
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new ExecuteRespoAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/TestActions_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- /// 璋冪敤鍦烘櫙,缃戝叧鍙嶉淇℃伅
- /// <para>杩斿洖Result 0锛氳皟鐢ㄥけ璐�</para>
- ///<para>Result 1锛氳皟鐢ㄦ垚鍔�<para>
- /// </summary>
- public ExecuteRespoAllData executeRespoAllData;
- /// <summary>
- /// 璋冪敤閫昏緫,缃戝叧鍙嶉淇℃伅
- /// </summary>
- [System.Serializable]
- public class ExecuteRespoAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 璋冪敤閫昏緫
- /// </summary>
- public ExecuteResponse logicExecuteRespo;
- }
-
- /// <summary>
- ///璋冪敤閫昏緫
- /// </summary>
- public ExecuteResponse logicExecuteRespo;
- /// <summary>
- ///璋冪敤閫昏緫
- /// </summary>
- [System.Serializable]
- public class ExecuteResponse : LogicBase
- {
- /// <summary>
- /// 0锛氭垚鍔�
- ///<para>1锛氬け璐ワ紝閫昏緫涓嶅瓨鍦�</para>
- /// </summary>
- public int Result;
- }
-
- #endregion
-
- #region 璁惧畾缃戝叧鎵�鍦ㄥ湴缁忕含搴�.
- /// <summary>
- /// 璁惧畾缃戝叧鎵�鍦ㄥ湴缁忕含搴�
- /// <param name="longitude">Longitude:缁忓害銆傚崟浣嶏細0.01掳銆� 涓滅粡涓烘鏁帮紝瑗跨粡涓鸿礋鏁般�傚锛氳タ缁�172.53掳W锛屽簲濉叆-17253</param>
- /// <param name="latitude">Latitude:缁村害銆傚崟浣嶏細0.01掳銆傚寳绾害涓烘鏁帮紝鍗楃含搴︿负璐熸暟銆傚锛氬崡绾害锛屽鍗楃含90.25掳S 锛屽簲璇ュ~鍏�-9025銆�</param>
- /// </summary>
- public static async System.Threading.Tasks.Task<SetSiteResponseAllData> SetSiteAsync(int longitude,int latitude)
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- SetSiteResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new SetSiteResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new SetSiteResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new SetSiteResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/SetSite_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetSiteResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new SetSiteResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new SetSiteResponseAllData { setSiteResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/SetSite_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2013 } };
- var data = new JObject {
- { "Longitude",longitude},
- { "Latitude",latitude}
- };
- jObject.Add("Data", data);
- ZbGateway.MainGateWay?.Send(("Logic/SetSite"), jObject.ToString());
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new SetSiteResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/SetSite_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- /// 璁惧畾缃戝叧鎵�鍦ㄥ湴缁忕含搴�,缃戝叧鍙嶉淇℃伅
- /// <para>杩斿洖Result 0锛氳皟鐢ㄥけ璐�</para>
- ///<para>Result 1锛氳皟鐢ㄦ垚鍔�<para>
- /// </summary>
- public SetSiteResponseAllData setSiteResponseAllData;
- /// <summary>
- /// 璁惧畾缃戝叧鎵�鍦ㄥ湴缁忕含搴�,缃戝叧鍙嶉淇℃伅
- /// </summary>
- [System.Serializable]
- public class SetSiteResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 璁惧畾缃戝叧鎵�鍦ㄥ湴缁忕含搴�
- /// </summary>
- public SetSiteResponseData setSiteResponseData;
- }
-
- /// <summary>
- ///璁惧畾缃戝叧鎵�鍦ㄥ湴缁忕含搴�
- /// </summary>
- public SetSiteResponseData setSiteResponseData;
- /// <summary>
- ///璁惧畾缃戝叧鎵�鍦ㄥ湴缁忕含搴�
- /// </summary>
- [System.Serializable]
- public class SetSiteResponseData
- {
- /// <summary>
- ///0锛氭垚鍔�
- /// </summary>
- public int Result;
- /// <summary>
- ///缁忓害銆傚崟浣嶏細0.01掳銆� 涓滅粡涓烘鏁帮紝瑗跨粡涓鸿礋鏁般�傚锛氳タ缁�172.53掳W锛屽簲濉叆-17253
- /// </summary>
- public int Longitude;
- /// <summary>
- ///缁村害銆傚崟浣嶏細0.01掳銆傚寳绾害涓烘鏁帮紝鍗楃含搴︿负璐熸暟銆傚锛氬崡绾害锛屽鍗楃含90.25掳S 锛屽簲璇ュ~鍏�-9025銆�
- /// </summary>
- public int Latitude;
- }
- #endregion
-
- #region 璇诲彇缃戝叧褰撳墠璁惧畾鐨勭粡绾害淇℃伅.
- ///<summary >
- ///璇诲彇缃戝叧褰撳墠璁惧畾鐨勭粡绾害淇℃伅
- /// <para></para>
- /// </summary>
- public static async System.Threading.Tasks.Task<ReadSiteResponseAllData> ReadSiteAsync()
- {
- return await System.Threading.Tasks.Task.Run(async () =>
- {
- ReadSiteResponseAllData allData = null;
- if (ZbGateway.MainGateWay == null)
- {
- allData = new ReadSiteResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" };
- return allData;
- }
- Action<string, string> action = (topic, message) =>
- {
- var gatewayID = topic.Split('/')[0];
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- if (topic == gatewayID + "/" + "Error_Respon")
- {
- var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
- var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
-
- if (temp == null)
- {
- allData = new ReadSiteResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
- }
- else
- {
- allData = new ReadSiteResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
- }
- }
-
- if (topic == gatewayID + "/" + "Logic/ReadSite_Respon")
- {
- var logic = new Logic() { DataID = jobject.Value<int>("DataID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId };
- var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<ReadSiteResponseData>(jobject["Data"].ToString());
- if (tempData == null)
- {
- allData = new ReadSiteResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- allData = new ReadSiteResponseAllData { readSiteResponseData = tempData };
- System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- }
- }
- };
- ZbGateway.MainGateWay.Actions += action;
- System.Console.WriteLine("Logic/ReadSite_Actions 鍚姩" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- try
- {
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2014 } };
- ZbGateway.MainGateWay?.Send(("Logic/ReadSite"), jObject.ToString());
- }
- catch { }
-
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalMilliseconds < 2000)
- {
- await System.Threading.Tasks.Task.Delay(10);
- if (allData != null)
- {
- break;
- }
- }
- if ((DateTime.Now - dateTime).TotalMilliseconds > 2000)
- {
- allData = new ReadSiteResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
-
- }
- ZbGateway.MainGateWay.Actions -= action;
- System.Console.WriteLine("Logic/ReadSite_Actions 閫�鍑�" + "_" + ZbGateway.MainGateWay.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
-
- return allData;
- });
- }
-
- /// <summary>
- /// 璇诲彇缃戝叧褰撳墠璁惧畾鐨勭粡绾害淇℃伅,缃戝叧鍙嶉淇℃伅
- /// <para>杩斿洖Result 0锛氳皟鐢ㄥけ璐�</para>
- ///<para>Result 1锛氳皟鐢ㄦ垚鍔�<para>
- /// </summary>
- public ReadSiteResponseAllData readSiteResponseAllData;
- /// <summary>
- /// 璇诲彇缃戝叧褰撳墠璁惧畾鐨勭粡绾害淇℃伅,缃戝叧鍙嶉淇℃伅
- /// </summary>
- [System.Serializable]
- public class ReadSiteResponseAllData
- {
- /// <summary>
- /// 閿欒淇℃伅
- /// </summary>
- public string errorMessageBase;
- /// <summary>
- /// 缃戝叧淇℃伅閿欒鍙嶉
- /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- /// </summary>
- public ErrorResponData errorResponData;
- /// <summary>
- /// 璇诲彇缃戝叧褰撳墠璁惧畾鐨勭粡绾害淇℃伅
- /// </summary>
- public ReadSiteResponseData readSiteResponseData;
- }
-
- /// <summary>
- ///璇诲彇缃戝叧褰撳墠璁惧畾鐨勭粡绾害淇℃伅
- /// </summary>
- public ReadSiteResponseData readSiteResponseData;
- /// <summary>
- ///璇诲彇缃戝叧褰撳墠璁惧畾鐨勭粡绾害淇℃伅
- /// </summary>
- [System.Serializable]
- public class ReadSiteResponseData
- {
- /// <summary>
- ///缁忓害銆傚崟浣嶏細0.01掳銆� 涓滅粡涓烘鏁帮紝瑗跨粡涓鸿礋鏁般�傚锛氳タ缁�172.53掳W锛屽簲濉叆-17253
- /// </summary>
- public int Longitude;
- /// <summary>
- ///缁村害銆傚崟浣嶏細0.01掳銆傚寳绾害涓烘鏁帮紝鍗楃含搴︿负璐熸暟銆傚锛氬崡绾害锛屽鍗楃含90.25掳S 锛屽簲璇ュ~鍏�-9025銆�
- /// </summary>
- public int Latitude;
- }
- #endregion
-
- #region 鏉′欢鏁版嵁瀵硅薄
- /// <summary>
- /// 鍏朵粬閫昏緫鏉′欢鏁版嵁
- /// </summary>
- [System.Serializable]
- public class LogicConditionsInfo : ConditionBase
- {
- /// <summary>
- ///浣滄潯浠剁殑鍏朵粬閫昏緫id銆�
- /// </summary>
- public int Condition_LogicId;
- }
-
- /// <summary>
- /// 璁℃暟鍣ㄦ潯浠舵暟鎹�
- /// </summary>
- [System.Serializable]
- public class CounterConditionsInfo : ConditionBase
- {
- /// <summary>
- /// 璁惧mac鍦板潃
- /// </summary>
- public string MacAddr;
-
- /// <summary>
- /// 褰揟ype涓�1鏃讹紝璇ュ瓧娈垫墠瀛樺湪
- ///<para>璁惧绔彛鍙凤紝璇ョ鍙e~鍏ョ殑鏄敤浜庝笂鎶luster_ID鍜孉ttriButeId灞炴�у�肩殑绔彛鍙枫��</para>
- ///<para>鐗规畩璁惧锛�
- ///濡傛灉涓篽dl鍔熻兘鎸夐敭鍒欏~鍏ユ寜閿彿锛堟寜閿搴旂殑绔彛鍙凤級</para>
- /// </summary>
- public int Epoint;
-
- /// <summary>
- ///褰揟ype涓�1 鏃讹紝璇ュ瓧娈垫墠瀛樺湪
- ///<para>瑙﹀彂鑱斿姩鐨勫睘鎬х姸鎬佹墍鍦–luster 濡傚紑鍏矯luster 6 </para>
- ///<para>鐗规畩璁惧锛�</para>
- ///<para>1銆佸鏋滀负hdl鍔熻兘鎸夐敭鍒欏~64528銆�</para>
- ///<para>2銆佸鏋滀负IAS瀹夐槻璁惧鍒欏~鍏�1280銆�</para>
- ///<para>3銆佸鏋滀负闂ㄩ攣鎿嶄綔浜嬩欢锛屽垯濉叆64529銆�</para>
- /// </summary>
- public int Cluster_ID;
-
- /// <summary>
- ///褰揟ype涓�1 鏃讹紝璇ュ瓧娈垫墠瀛樺湪
- /// <para>瑙﹀彂鑱斿姩鐨勫睘鎬� 濡侰luster = 6鏃� AttriButeId = 0涓哄紑鍏冲睘鎬�</para>
- ///<para>鐗规畩璁惧锛�</para>
- ///<para>濡傛灉涓篽dl鍔熻兘鎸夐敭鍒欎负鎸夐敭瑙﹀彂鏃朵笂鎶ヨЕ鍙戜俊鎭殑鎸夐敭鍙风被鍨嬨��</para>
- ///<para>濡傛灉涓篒AS瀹夐槻璁惧鍒欏~鍏�1281銆�</para>
- ///<para>濡傛灉涓洪棬閿佹搷浣滀簨浠跺垯濉叆闂ㄩ攣鎿嶄綔浜嬩欢鐨凮perationEventSoure鍒楄〃鍊�</para>
- /// </summary>
- public int AttriButeId;
-
-
- /// <summary>
- /// 灞炴�х姸鎬佷复鐣屽��1
- ///<para>鐗规畩璁惧锛�</para>
- ///<para>濡傛灉涓篽dl鍔熻兘鎸夐敭锛屽垯涓轰笅鍒楁寜閿ā寮忥細1锛氱偣鍑� 2锛氬墠鐐瑰嚮 4锛氬悗鍗曞嚮 8锛氫粎鍙屽嚮 16锛氬墠鍙屽嚮 32锛氬悗鍙屽嚮 64锛氫粎闀挎寜 128锛氬墠闀挎寜 256锛氬悗闀挎寜 512锛氶暱鎸夐噴鏀俱��</para>
- ///<para>濡傛灉涓篒AS瀹夐槻璁惧鍒欎负IAS瀹夐槻璁惧淇℃伅涓婃姤鏁版嵁涓殑ZoneStatus銆�</para>
- ///<para>濡傛灉涓洪棬閿佹搷浣滀簨浠跺垯濉叆闂ㄩ攣鎿嶄綔浜嬩欢鐨凮peration Event Code鍊�</para>
- /// </summary>
- public int AttriButeData1;
-
- /// <summary>
- /// 灞炴�х姸鎬佷复鐣屽��2 锛堝弬鑰傾ttriButeData1璇存槑锛�
- /// </summary>
- public int AttriButeData2;
-
- /// <summary>
- /// 0 : 澶т簬AttriButeData1鏃惰鏁颁竴娆�
- ///<para>1 锛氱瓑浜嶢ttriButeData1鏃惰鏁颁竴娆�</para>
- ///<para>2锛氬皬浜嶢ttriButeData1鏃惰鏁颁竴娆�</para>
- ///<para>3锛氬ぇ浜嶢ttriButeData1涓斿皬浜嶢ttriButeData2璁℃暟涓�娆�</para>
- ///<para>4锛氬皬浜嶢ttriButeData1鎴栧ぇ浜嶢ttriButeData2璁℃暟涓�娆�</para>
- ///<para>5锛氫笌AttriButeData1杩涜涓庤繍绠楃粨鏋滀笉涓�0鏃惰鏁颁竴娆°��</para>
- ///<para>6锛氬拰涓婁竴娆′笂鎶ョ殑AttriButeData鍊间笉鍚屾椂璁℃暟涓�娆� </para>
- /// </summary>
- public int Range;
-
- /// <summary>
- ///鍒拌揪澶氬皯娆¤Е鍙戦�昏緫
- /// </summary>
- public int Number;
-
- /// <summary>
- ///鏃堕棿鑼冨洿銆傚崟浣嶏細绉�
- ///<para>澶氬皯绉掑唴鍒拌揪澶氬皯娆¤Е鍙戙��</para>
- ///<para>濡傛灉鏃堕棿鍒拌揪鍚庯紝杩樹笉杈惧埌娆℃暟鍒欏皢娆℃暟娓呴浂銆傞噸鏂板紑濮嬪�掕鏃跺強璁℃暟銆�</para>
- /// </summary>
- public int Time;
-
- /// <summary>
- ///鍙己鐪侊紝榛樿涓� 0銆�
- ///<para>鏄惁寰幆鎵ц銆傚涓�娆¤瀹氭椂闂村唴鏄惁杈惧埌瑙﹀彂娆℃暟鐨勭粨鏋滃鐞嗐��</para>
- ///<para>0锛氬惊鐜墽琛屻�傚綋瓒呮椂鎴栬瀹氭椂闂村唴杈惧埌娆℃暟鍚庯紝娓呴浂娆℃暟锛岄噸鏂拌鏃讹紝缁х画涓嬩竴娆¤鏁般��</para>
- ///<para>1锛氭煇娆¤秴鏃堕��鍑恒�傚鏋滆揪鍒版鏁板垯娓呴浂璁℃暟閲嶆柊璁℃椂锛岀户缁笅涓�娆¤鏁般�傚鏋滆秴鏃跺垯閫�鍑鸿鏁般�傚苟灏咺sVail璁剧疆涓�0銆�</para>
- ///<para>2锛氳鏁颁竴娆¢��鍑恒�傚埌杈捐瀹氭椂闂村悗锛屾棤璁烘槸鍚﹁揪鍒版鏁帮紝閮藉皢閫�鍑恒�傚苟灏咺sVail缃�0銆�</para>
- ///</summary>
- public int Cycle;
- }
-
- /// <summary>
- /// 鍊掕鏃舵潯浠舵暟鎹�
- /// </summary>
- [System.Serializable]
- public class CountdownConditionsInfo : ConditionBase
- {
- /// <summary>
- ///鍊掕鏃跺灏戠瑙﹀彂銆傚崟浣� 绉掋��
- ///<para>鍊掕鏃跺彧鐢熸晥涓�娆★紝姣忔鍊掕鏃跺畬鎴愬悗鑷姩灏咺sValid缃�0銆傚鎴风鍙�氳繃绗�6灏忚妭鍛戒护浣胯兘璇ュ�掕鏃舵潯浠讹紝灏咺sValid缃�1锛屽嵆鍙啀娆′娇鐢ㄨ鍊掕鏃躲��</para>
- /// </summary>
- public int Time;
- }
-
- /// <summary>
- /// 鏃堕棿娈垫潯浠舵潯浠舵暟鎹�
- /// </summary>
- [System.Serializable]
- public class TimeBucketConditionsInfo : ConditionBase
- {
- /// <summary>
- ///瑙﹀彂鍔ㄤ綔寮�濮嬫椂闂达紝灏忔椂銆�
- /// </summary>
- public int StartHour;
-
- /// <summary>
- ///瑙﹀彂鍔ㄤ綔寮�濮嬫椂闂达紝鍒嗛挓
- /// </summary>
- public int StartMin;
-
- /// <summary>
- ///瑙﹀彂鍔ㄤ綔缁撴潫鏃堕棿锛屽皬鏃�
- /// </summary>
- public int StopHour;
-
- /// <summary>
- ///瑙﹀彂鏃堕棿缁撴潫鏃堕棿锛屽垎閽�
- /// </summary>
- public int StopMin;
-
- }
-
- /// <summary>
- /// 瀹夐槻鏉′欢鏁版嵁
- /// </summary>
- [System.Serializable]
- public class SecurityConditionsInfo : ConditionBase
- {
- /// <summary>
- ///0锛氬竷闃叉垚鍔熺灛闂磋Е鍙戞潯浠舵垚绔嬨��
- ///<para>1锛氭挙闃叉垚鍔熺灛闂磋Е鍙戞潯浠舵垚绔嬨��</para>
- /// </summary>
- public int EnOrWithdrawMode;
-
- /// <summary>
- ///瀹夐槻妯″紡id銆傚鏋滀负0锛屽垯涓轰换鎰忓畨闃叉ā寮忓竷闃叉垨鎾ら槻鎴愬姛鍚庤Е鍙戞潯浠�
- /// </summary>
- public int ModeId;
-
- }
-
- /// <summary>
- /// 鎵ц鍔ㄤ綔鏁版嵁
- /// </summary>
- [System.Serializable]
- public class ActionsInfo
- {
- /// <summary>
- /// 娣诲姞鐨勮仈鍔ㄨ澶囩被鍨�
- ///<para>0锛氳仈鍔ㄨ澶囦负zigbee鑺傜偣璁惧</para>
- ///<para>2锛氳仈鍔ㄨ澶囦负鍦烘櫙锛堟仮澶嶅満鏅級</para>
- ///<para>4锛氫娇鑳藉け鑳藉叾浠栭�昏緫</para>
- ///<para>5锛氱鐢ㄦ垨鍚敤閫昏緫鏉′欢</para>
- ///<para>6锛氬瀹夐槻妯″紡杩涜甯冩挙闃�</para>
- /// </summary>
- /// <value>The type of the link.</value>
- public int LinkType;
-
- /// <summary>
- /// 鑱斿姩璁惧鐨勫湴鍧�锛�
- ///<para>璁惧mac鍦板潃锛堝瓧绗︼級锛孡inkType=0銆�</para>
- ///<para>瀵瑰満鏅搷浣滐紝鍗虫仮澶嶅満鏅� 涓哄満鏅痠d锛堟暟鍊硷級锛孡inkType涓�2銆�</para>
- ///<para>瀵瑰叾浠栭�昏緫鎿嶄綔 涓洪�昏緫id锛堟暟鍊硷級锛孡inkType涓�4 銆丩inkType涓� 5銆�</para>
- /// </summary>
- /// <value>The device address.</value>
- public string DeviceAddr;
- /// <summary>
- /// 鑱斿姩璁惧鐨勭鍙e彿锛�
- ///<para>鍜宮ac鍦板潃鍏卞悓鏍囪瘑鍞竴鐨剒igbee璁惧 鏁板�艰寖鍥�0-255</para>
- ///<para>褰揕inkType=0鏃跺瓨鍦�</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int Epoint;
-
- /// <summary>
- /// 閫昏緫浣胯兘銆佸け鑳姐��
- ///<para>褰揕inkType = 4鏃跺瓨鍦�</para>
- ///<para>0锛氬け鑳介�昏緫銆�</para>
- ///<para>1锛氫娇鑳介�昏緫銆�</para>
- ///<para>2锛氬彧浣胯兘涓�娆�</para>
- ///<para>3锛氬彧澶辫兘涓�娆�</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int EnableLogic;
-
- /// <summary>
- /// 鎿嶄綔鐨勯�昏緫鏉′欢id銆�
- ///<para>褰揕inkType=5鏃跺瓨鍦�</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int ConditionId;
-
- /// <summary>
- /// 鏄惁绂佺敤閫昏緫鏉′欢
- ///<para>褰揕inkType=5鏃跺瓨鍦�</para>
- ///<para>0 绂佺敤鏉′欢锛堝皢閫昏緫鏉′欢鐨処sValid瀛楁缃�0锛�</para>
- ///<para>1 鍚敤鏉′欢锛堝皢閫昏緫鏉′欢鐨処sValid瀛楁缃�1锛�</para>
- ///<para>2锛氫娇鑳戒竴娆★紙鏉′欢鎴愮珛涓�娆″悗灏嗚绂佺敤锛孖sValid鑷姩缃负0锛夈��</para>
- ///<para>3锛氬け鑳戒竴娆★紙鏉′欢绗竴娆℃垚绔嬩細琚拷鐣ワ紝瑙﹀彂涓嶄簡閫昏緫锛岀劧鍚嶪sValid鑷姩缃�1銆備互鍚庢潯浠跺啀鎴愮珛灏嗕笉浼氳蹇界暐锛�</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int EnableCondition;
-
- /// <summary>
- /// 寤舵椂鎵ц鏃堕棿銆傚崟浣嶏紙绉掞級鑼冨洿锛�0-65535銆�
- ///<para>閫昏緫鎴愮珛鍚庯紝寤惰繜澶氫箙鎵ц璁惧鍔ㄤ綔鎸囦护銆�</para>
- ///<para>褰揕inkType=0鏃跺瓨鍦ㄣ�傝瀛楁鍙拷鐣ワ紝榛樿涓�0锛屽嵆閫昏緫鎴愮珛鍚庣珛鍗虫墽琛岃澶囧姩浣溿��</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int Time;
-
- /// <summary>
- /// 璁惧鍒楄〃
- /// <para>褰揕inkType=0鏃跺瓨鍦�</para>
- /// </summary>
- public List<TaskListInfo> TaskList = new List<TaskListInfo>();
-
- ///<summary>
- ///瀵瑰畨闃叉ā寮忔搷浣�
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氭挙闃�</para>
- ///<para>1锛氭案涔呭竷闃诧紝鐩村埌鎾ら槻</para>
- ///<para>2锛氬竷闃诧紝浣嗕娇鑳戒竴娆★紝瑙﹀彂涓�娆″悗灏嗘挙闃层��</para>
- ///<para>3锛氬竷闃诧紝浣嗗け鑳戒竴娆★紝绗竴娆¤婵�娲讳笉璀﹀憡涓嶈Е鍙戝姩浣溿��</para>
- ///<para>瑙﹀彂鍔ㄤ綔鏃讹紝濡傛灉绯荤粺褰撳墠娌℃湁甯冮槻锛屽垯鎾ら槻澶辫触銆傚凡缁忓瓨鍦ㄥ竷闃叉ā寮忥紝灏嗗竷闃插け璐ワ紙闇�鍏堝褰撳墠甯冮槻妯″紡杩涜鎾ら槻锛�</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int SecuritySetting;
-
- ///<summary>
- ///瀹夐槻妯″紡id銆備负0鏃讹紝鍒欏褰撳墠鍦ㄥ竷闃茬殑瀹夐槻妯″紡杩涜鎿嶄綔銆�
- /// </summary>
- /// <value>The epoint.</value>
- public int SecurityModeId;
-
- ///<summary>
- ///妫�鏌ラ槻鍖鸿澶囨渶杩戜笂鎶ョ殑瀹夐槻淇℃伅鐘舵�佽繘琛屽竷闃�
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氫笉妫�鏌�</para>
- ///<para>1锛氭鏌�</para>
- ///<para>鍙己鐪侊紝榛樿涓�0</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int CheckIASStatus;
-
- ///<summary>
- ///鏄惁寤舵椂鍚姩銆傚竷闃插悗寤舵椂涓�娈垫椂闂存寮忓惎鍔ㄩ槻鍖猴紝杩欐鏃堕棿鍙互璁╀汉鍛樻挙绂婚槻鍖哄尯鍩熴��
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>0锛氫笉寤舵椂</para>
- ///<para>1锛氬欢鏃跺惎鍔�</para>
- ///<para>鍙己鐪侊紝榛樿涓�0</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int IsDelayStart;
-
- ///<summary>
- ///甯冮槻鎾ら槻鐢ㄦ埛瀵嗙爜锛屽鏋滃瘑鐮侀敊璇皢鍔犲叆澶辫触
- ///<para>褰揕inkType = 6鏃跺瓨鍦�</para>
- ///<para>鏁版嵁鍥炲鏃讹紝璇ュ瓧娈典笉瀛樺湪</para>
- /// </summary>
- /// <value>The epoint.</value>
- public int Password;
-
- }
-
- /// <summary>
- /// 鏃堕棿鏉′欢鏁版嵁
- /// </summary>
- [System.Serializable]
- public class TimeConditionsInfo : ConditionBase
- {
- /// <summary>
- ///鏃堕棿鐐圭被鍨嬶細
- ///<para>0锛氭甯告椂闂寸偣锛堢敱StartHour鍜孲tartMin璁惧畾锛�</para>
- ///<para>1锛氭棩鍑烘椂闂� </para>
- ///<para>2锛氭棩钀芥椂闂� </para>
- ///<para>3锛氭鍗堟椂闂� </para>
- /// </summary>
- public int DateType;
-
- /// <summary>
- ///瑙﹀彂鍔ㄤ綔鏃堕棿锛岋紙0-23锛夊皬鏃躲��
- ///<para>褰揇ateType = 0鏃讹紝璇ュ弬鏁版墠鏈夋晥銆�</para>
- /// </summary>
- public int StartHour;
-
- /// <summary>
- ///瑙﹀彂鍔ㄤ綔鏃堕棿锛岋紙0-59锛夊垎閽熴��
- ///<para>褰揇ateType = 0 鏃讹紝璇ュ弬鏁版墠鏈夋晥銆�</para>
- /// </summary>
- public int StartMin;
-
- /// <summary>
- ///鎻愬墠鎴栨帹鍚庡灏戝垎閽熸墽琛屻�傦紙鍗曚綅锛氬垎閽燂級
- ///<para>鑼冨洿锛�-127鍒�127銆傛鏁颁负鎺ㄥ悗锛岃礋鍊间负鎻愬墠銆�</para>
- ///<para>濡傛棩钀藉墠30鍒嗛挓鎵ц锛屽垯灏嗚鍊艰瀹氫负-30銆�</para>
- ///<para>褰揇ateType涓嶄负0鏃讹紝璇ュ弬鏁版墠鏈夋晥銆�</para>
- /// </summary>
- public int AdjustTime;
-
- /// <summary>
- ///鎻愬墠鎻愰啋鏃堕棿銆傦紙鍗曚綅绉掞級鑼冨洿锛�0-65535
- ///<para>瀹氭椂鏉′欢灏嗚瑙﹀彂鐨勫墠RemindTime绉掞紝缃戝叧灏嗛�氱煡瀹㈡埛绔畾鏃舵椂闂村皢鑷筹紝鍙兘浼氭墽琛岄�昏緫鍔ㄤ綔锛堝鏋滆閫昏緫杩橀渶瑕佹弧瓒冲叾浠栨潯浠讹紝鍒欏埌杈惧畾鏃舵椂闂存椂锛屽叾浠栨潯浠舵病鏈夋弧瓒冲皢涓嶄細鎵ц閫昏緫鍔ㄤ綔锛夈�傚湪杩欐鏃堕棿鍐咃紝瀹㈡埛绔彲鍙戦�佹寚浠よ瀹氭椂鎺ㄨ繜鎵ц銆傛渶缁堢殑瀹氭椂鏃堕棿灏嗘槸鍘熸潵瀹氭椂鏃堕棿+鎺ㄨ繜鐨勬椂闂淬��</para>
- ///<para>濡傛灉涓�0锛屽垯涓嶆彁閱掋�傚埌杈炬彁鍓嶆彁閱掓椂锛屽皢鍙戦�佺11灏忚妭鐨勬彁閱掗�氱煡銆�</para>
- /// </summary>
- public int RemindTime;
-
- /// <summary>
- ///鏄惁鍏佽鎺ㄨ繜
- ///<para>0锛氫笉鍏佽</para>
- ///<para>1锛氬厑璁�</para>
- ///</summary>
- public int EnDelay;
-
- /// <summary>
- ///鎺ㄨ繜鏃堕棿锛堝崟浣嶏細绉掞級鑼冨洿锛�0-65535
- ///<para>鎺ㄨ繜鏃堕棿濡傛灉灏忎簬鎻愬墠鎻愰啋鏃堕棿锛屽垯鍦ㄦ帹杩熷墠鐨勫畾鏃舵椂闂村埌杈炬椂鎻愰啋銆傚彲缂虹渷 锛岄粯璁や负0銆�</para>
- ///</summary>
- public int DelayTime;
- }
-
- /// <summary>
- /// 璁惧鏉′欢鏁版嵁
- /// </summary>
- [System.Serializable]
- public class DeviceConditionsInfo : ConditionBase
- {
- /// <summary>
- ///璁惧mac鍦板潃(褰揟ype涓�1鏃讹紝璇ュ瓧娈垫墠瀛樺湪)
- /// </summary>
- public string MacAddr;
- /// <summary>
- /// 璁惧绔彛鍙凤紝(褰揟ype涓�1鏃讹紝璇ュ瓧娈垫墠瀛樺湪)
- /// <para>璇ョ鍙e~鍏ョ殑鏄敤浜庝笂鎶luster_ID鍜孉ttriButeId灞炴�у�肩殑绔彛鍙枫�傦級</para>
- /// <para>鐗规畩璁惧锛�
- /// 濡傛灉涓篽dl鍔熻兘鎸夐敭鍒欏~鍏ユ寜閿彿锛堟寜閿搴旂殑绔彛鍙凤級</para>
- /// </summary>
- public int Epoint;
- /// <summary>
- /// 瑙﹀彂鑱斿姩鐨勫睘鎬х姸鎬佹墍鍦–luster 濡傚紑鍏矯luster 6.(褰揟ype涓�1鏃讹紝璇ュ瓧娈垫墠瀛樺湪)
- ///<para>鐗规畩璁惧锛�</para>
- ///<para>1銆佸鏋滀负hdl鍔熻兘鎸夐敭鍒欏~64528銆�</para>
- ///<para>2銆佸鏋滀负IAS瀹夐槻璁惧鍒欏~鍏�1280銆�</para>
- ///<para>3銆佸鏋滀负闂ㄩ攣鎿嶄綔浜嬩欢锛屽垯濉叆64529.</para>
- /// <para>4銆佸鏋滀负闅忓績璐存寜閿甇n/Off鍛戒护鍙嶉锛屽垯濉叆1282</para>
- /// </summary>
- public int Cluster_ID;
- /// <summary>
- ///瑙﹀彂鑱斿姩鐨勫睘鎬� 濡侰luster=6鏃� AttriButeId=0涓哄紑鍏冲睘鎬�.(褰揟ype涓�1鏃讹紝璇ュ瓧娈垫墠瀛樺湪)
- ///<para>鐗规畩璁惧锛�</para>
- ///<para>1.濡傛灉涓篽dl鍔熻兘鎸夐敭鍒欎负鎸夐敭瑙﹀彂鏃朵笂鎶ヨЕ鍙戜俊鎭殑鎸夐敭鍙风被鍨嬨��</para>
- ///<para>2.濡傛灉涓篒AS瀹夐槻璁惧鍒欏~鍏�1281銆�</para>
- ///<para>3.濡傛灉涓洪棬閿佹搷浣滀簨浠跺垯濉叆闂ㄩ攣鎿嶄綔浜嬩欢鐨凮perationEventSoure鍒楄〃鍊硷紝鍙傝�冪鍏珷鑺�3闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡</para>
- ///<para>4.濡傛灉涓洪殢蹇冭创On/Off鍛戒护鍙嶉锛屽垯濉叆1283銆�</para>
- /// </summary>
- public int AttriButeId;
- /// <summary>
- ///灞炴�х姸鎬佷复鐣屽��1 (褰揟ype涓�1 鏃讹紝璇ュ瓧娈垫墠瀛樺湪)
- /// <para>鐗规畩璁惧锛�</para>
- ///<para>濡傛灉涓篽dl鍔熻兘鎸夐敭锛屽垯涓轰笅鍒楁寜閿ā寮忥細</para>
- ///<para>1锛氱偣鍑� 2锛氬墠鐐瑰嚮 4锛氬悗鍗曞嚮 8锛氫粎鍙屽嚮</para>
- ///<para>16锛氬墠鍙屽嚮 32锛氬悗鍙屽嚮 64锛氫粎闀挎寜 </para>
- ///<para>128锛氬墠闀挎寜 256锛氬悗闀挎寜 512锛氶暱鎸夐噴鏀俱��</para>
- ///<para>2.濡傛灉涓篒AS瀹夐槻璁惧鍒欎负IAS瀹夐槻璁惧淇℃伅涓婃姤鏁版嵁涓殑ZoneStatus銆�</para>
- ///<para>3.濡傛灉涓洪棬閿佹搷浣滀簨浠跺垯濉叆闂ㄩ攣鎿嶄綔浜嬩欢鐨凮peration Event Code鍊硷紝鍙傝�冪鍏珷鑺�3闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡</para>
- ///<para>4銆佸鏋滀负闅忓績璐碠n/Off鍒欏~鍏� 0銆傚綋鎺ユ敹鍒伴殢蹇冭创璁惧On/Off鍛戒护鍙嶉灏嗚Е鍙戦�昏緫</para>
- /// </summary>
- public int AttriButeData1;
- /// <summary>
- ///灞炴�х姸鎬佷复鐣屽��2 銆�(褰揟ype涓�1 鏃讹紝璇ュ瓧娈垫墠瀛樺湪)
- ///<para>鐗规畩璁惧锛氾紙瑙丄ttriButeData1璇存槑锛�</para>
- /// </summary>
- public int AttriButeData2;
- /// <summary>
- ///褰揟ype涓�1 鏃讹紝璇ュ瓧娈垫墠瀛樺湪
- ///<para>涓婃姤鐨勮澶囧睘鎬х姸鎬佸�糀ttriButeData锛堝弬鑰冭澶囩姸鎬佹煡璇㈢珷鑺傦級涓庤瀹氱殑涓寸晫鍊兼瘮杈冦��</para>
- ///<para>0 : 涓婃姤鐨勮澶囧睘鎬х姸鎬佸�煎ぇ浜嶢ttriButeData1鏃惰Е鍙戝姩浣�</para>
- ///<para>1锛氫笂鎶ョ殑璁惧灞炴�х姸鎬佸�肩瓑浜嶢ttriButeData1鏃惰Е鍙戝姩浣�</para>
- ///<para>2锛氫笂鎶ョ殑璁惧灞炴�х姸鎬佸�煎皬浜嶢ttriButeData1鏃惰Е鍙戝姩浣�</para>
- ///<para>3锛氫笂鎶ョ殑璁惧灞炴�х姸鎬佸�煎ぇ浜嶢ttriButeData1涓斿皬浜嶢ttriButeData2鏃惰Е鍙戝姩浣�</para>
- ///<para>4锛氫笂鎶ョ殑璁惧灞炴�х姸鎬佸�煎皬浜嶢ttriButeData1鎴栧ぇ浜嶢ttriButeData2鏃惰Е鍙戝姩浣�</para>
- ///<para>5锛氫笂鎶ョ殑璁惧灞炴�х姸鎬佸�煎拰AttriButeData1杩涜涓庤繍绠楃粨鏋滀笉涓�0鏃惰Е鍙戝姩浣溿�傦紙鏂逛究鐢ㄤ簬瀹夐槻璁惧淇℃伅涓婃姤锛�</para>
- ///<para>鐗规畩璁惧锛氬鏋滀负闅忓績璐碠n/Off鍒欏~鍏� 0銆傚綋鎺ユ敹鍒伴殢蹇冭创璁惧On/Off鍛戒护鍙嶉灏嗚Е鍙戦�昏緫銆�</para>
- /// </summary>
- public int Range;
- }
-
- /// <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;
- }
-
- /// <summary>
- ///鏉′欢绫诲瀷
- ///<para>0锛氭椂闂寸偣鏉′欢锛屽湪鏌愪釜鏃堕棿鍙戠敓</para>
- ///<para>1锛氳澶囩姸鎬佸彉鍖栨潯浠�</para>
- ///<para>2锛氬叾浠栭�昏緫鏉′欢</para>
- ///<para>3锛氳鏁板櫒鏉′欢</para>
- ///<para>4锛氬�掕鏃�</para>
- ///<para>5锛氭椂闂存鏉′欢</para>
- /// </summary>
- public enum ConditionType
- {
- /// <summary>
- ///鏃堕棿鐐规潯浠讹紝鍦ㄦ煇涓椂闂村彂鐢�
- /// </summary>
- Time = 0,
- /// <summary>
- ///璁惧鐘舵�佸彉鍖栨潯浠�
- /// </summary>
- Device = 1,
- /// <summary>
- ///鍏朵粬閫昏緫鏉′欢
- /// </summary>
- Logic = 2,
- /// <summary>
- ///璁℃暟鍣ㄦ潯浠�
- /// </summary>
- Counter = 3,
- /// <summary>
- ///鍊掕鏃�
- /// </summary>
- CountDown = 4,
- /// <summary>
- ///鏉′欢绫诲瀷
- ///鏃堕棿娈垫潯浠�
- /// </summary>
- TimeBucket = 5,
- }
- #endregion
-
- //public static string LogistFile = "LogistFile";
-
- //public void SaveLogicObj(string logicFilePath)
- //{
- // Shared.IO.FileUtils.WriteFileByBytes(logicFilePath, Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)));
- //}
-
- ///// <summary>
- ///// 鏍规嵁閫昏緫璺緞鎭㈠閫昏緫瀵硅薄
- ///// logicFilePath鍛藉悕锛�"Logic" + LogicId;
- ///// </summary>
- //public static Logic GetLogicByFilePath(string logicFilePath)
- //{
- // try
- // {
- // return Newtonsoft.Json.JsonConvert.DeserializeObject<Logic>(System.Text.Encoding.UTF8.GetString(Shared.IO.FileUtils.ReadFile(logicFilePath)));
- // }
- // catch
- // {
- // return new Logic();
- // }
- //}
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs
index df7711c..2cb7298 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs
@@ -1549,6 +1549,141 @@
}
#endregion
+ #region 閰嶇疆鎺ヨ繎浼犳劅
+ ///<summary >
+ /// 閰嶇疆鎺ヨ繎浼犳劅
+ /// <para>sensorEnable:浼犳劅鍣ㄤ娇鑳�</para>
+ /// </summary>
+ public async System.Threading.Tasks.Task<ResponseAllData> SetProximitySensor(bool sensorEnable)
+ {
+ ResponseAllData result = null;
+ if (Gateway == null)
+ {
+ result = new ResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+ return result;
+ }
+ return await System.Threading.Tasks.Task.Run(async () =>
+ {
+ Action<string, string> action = (topic, message) =>
+ {
+ var gatewayID = topic.Split('/')[0];
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
+
+ if (topic == gatewayID + "/" + "Error_Respon")
+ {
+ var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
+
+ if (temp == null)
+ {
+ result = new ResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+ }
+
+ else
+ {
+ result = new ResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+ }
+ }
+
+ if (topic == gatewayID + "/" + "ZbDataPassthrough")
+ {
+ var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+ gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+ if (gatewayTemp.clientDataPassthroughResponseData == null)
+ {
+ result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+ }
+ else
+ {
+ if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+ {
+ var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+ if (data.Length == 16)
+ {
+ var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+ if (command == "0002")
+ {
+ var tempD = new ResponseData();
+ tempD.command = Convert.ToInt32(data[10].ToString() + data[11].ToString() + data[12].ToString() + data[13].ToString(), 16);
+ tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+ result = new ResponseAllData { responseData = tempD };
+ System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0500_{ topic}");
+ }
+ }
+ }
+ }
+ }
+ };
+
+ Gateway.Actions += action;
+ System.Console.WriteLine("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+ try
+ {
+ var passData = SetProximitySensorData(sensorEnable);
+ var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+ var data = new JObject { { "PassData", passData } };
+ jObject.Add("Data", data);
+ Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+ }
+ catch { }
+
+ var dateTime = DateTime.Now;
+ while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+ {
+ await System.Threading.Tasks.Task.Delay(10);
+ if (result != null)
+ {
+ break;
+ }
+ }
+ if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
+ {
+ result = new ResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+ }
+ Gateway.Actions -= action;
+ System.Console.WriteLine("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+ return result;
+ });
+ }
+
+ /// <summary>
+ /// 閰嶇疆鎺ヨ繎浼犳劅
+ /// [璇ユ潯鍗忚鍙﹀2涓弬鏁癠I鍜岃澶囬兘涓嶉渶瑕侊紝璁惧閮藉悓浜嬭姹備紶鎰熷櫒璺濈鍜屼紶鎰熷櫒瑙﹀彂寤惰繜鏃堕棿閮介粯璁ゆ槸FFFF]
+ /// </summary>
+ /// <param name="sensorEnable">浼犳劅鍣ㄤ娇鑳� 0-disable 1-enable</param>
+ /// <returns></returns>
+ string SetProximitySensorData(bool sensorEnable)
+ {
+ string data = "";
+ string dataLength = "09";
+ string dataComand1 = "00";
+ string dataComand2 = "05";
+ string dataSerialNum = "01";
+ string addDataLength = "05";
+ string sEnable = "";
+ try
+ {
+ if (sensorEnable)
+ {
+ sEnable = "01";
+ }
+ else
+ {
+ sEnable = "00";
+ }
+
+ data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+ sEnable + "FFFFFFFF";
+ }
+ catch { };
+
+ return data;
+ }
+ #endregion
+
#region 鑾峰彇鎸夐敭鎸囩ず鐏紑鍏抽鑹�.
///<summary >
///鑾峰彇鎸夐敭鎸囩ず鐏紑鍏抽鑹�.
@@ -2132,6 +2267,186 @@
}
#endregion
+ #region 鑾峰彇鎺ヨ繎浼犳劅閰嶇疆
+ ///<summary >
+ ///鑾峰彇鎺ヨ繎浼犳劅閰嶇疆
+ /// </summary>
+ public async System.Threading.Tasks.Task<PanelProximitySensorResponInfo> GetProximitySensorAsync(string reserve = "01")
+ {
+ PanelProximitySensorResponInfo result = null;
+ if (Gateway == null)
+ {
+ result = new PanelProximitySensorResponInfo { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+ return result;
+ }
+ return await System.Threading.Tasks.Task.Run(async () =>
+ {
+ Action<string, string> action = (topic, message) =>
+ {
+ var gatewayID = topic.Split('/')[0];
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
+
+ if (topic == gatewayID + "/" + "Error_Respon")
+ {
+ var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
+
+ if (temp == null)
+ {
+ result = new PanelProximitySensorResponInfo { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+ }
+
+ else
+ {
+ result = new PanelProximitySensorResponInfo { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+ }
+ }
+
+ if (topic == gatewayID + "/" + "ZbDataPassthrough")
+ {
+ var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+ gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+ if (gatewayTemp.clientDataPassthroughResponseData == null)
+ {
+ result = new PanelProximitySensorResponInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+ }
+ else
+ {
+ if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+ {
+ var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+ if (data.Length == 20)
+ {
+ var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+ if (command == "0502")
+ {
+ var tempR = new PanelProximitySensorInfo();
+ if (data[10].ToString() + data[11].ToString() == "01")
+ {
+ tempR.enable = true;
+ }
+ else
+ {
+ tempR.enable = false;
+ }
+ tempR.sensorDistance = Convert.ToInt32(data[14].ToString() + data[15].ToString() + data[12].ToString() + data[13].ToString(), 16);
+ tempR.sensorDelayTime = Convert.ToInt32(data[18].ToString() + data[19].ToString() + data[16].ToString() + data[17].ToString(), 16);
+ panelProximitySensorInfo = tempR;
+ result = new PanelProximitySensorResponInfo { panelProximitySensorInfo = tempR };
+ System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0408_{ topic}");
+ }
+ }
+ }
+ }
+ }
+ };
+
+ Gateway.Actions += action;
+ System.Console.WriteLine("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+ try
+ {
+ var passData = SendProiximitySensorData(reserve);
+ var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+ var data = new JObject { { "PassData", passData } };
+ jObject.Add("Data", data);
+ Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+ }
+ catch { }
+
+ var dateTime = DateTime.Now;
+ while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime)
+ {
+ await System.Threading.Tasks.Task.Delay(10);
+ if (result != null)
+ {
+ break;
+ }
+ }
+ if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)// WaitReceiveDataTime)
+ {
+ result = new PanelProximitySensorResponInfo { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+ }
+ Gateway.Actions -= action;
+ System.Console.WriteLine("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+ return result;
+ });
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎺ヨ繎浼犳劅閰嶇疆鏁版嵁
+ /// </summary>
+ string SendProiximitySensorData(string reserve)
+ {
+ string data = "";
+ string dataLength = "05";
+ string dataComand1 = "01";
+ string dataComand2 = "05";
+ string dataSerialNum = "01";
+ string addDataLength = "01";
+ string reserveData = reserve;
+
+ try
+ {
+ data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+ reserveData;
+ }
+ catch { };
+
+ return data;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎺ヨ繎浼犳劅閰嶇疆鏁版嵁鍥炲
+ /// </summary>
+ [System.Serializable]
+ public class PanelProximitySensorResponInfo
+ {
+ /// <summary>
+ /// 閿欒淇℃伅
+ /// </summary>
+ public string errorMessageBase;
+ /// <summary>
+ /// 缃戝叧淇℃伅閿欒鍙嶉
+ /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+ /// </summary>
+ public ErrorResponData errorResponData;
+ /// <summary>
+ /// <para>鑾峰彇鎺ヨ繎浼犳劅閰嶇疆鏁版嵁</para>
+ /// </summary>
+ public PanelProximitySensorInfo panelProximitySensorInfo;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎺ヨ繎浼犳劅閰嶇疆
+ /// </summary>
+ public PanelProximitySensorInfo panelProximitySensorInfo;
+ /// <summary>
+ /// 鑾峰彇鎺ヨ繎浼犳劅閰嶇疆鏁版嵁
+ /// </summary>
+ [System.Serializable]
+ public class PanelProximitySensorInfo
+ {
+ /// <summary>
+ /// 浼犳劅鍣ㄤ娇鑳�
+ ///false-disable true-enable
+ /// </summary>
+ public bool enable;
+
+ /// <summary>
+ ///浼犳劅鍣ㄨ窛绂�
+ /// </summary>
+ public int sensorDistance = -1;
+
+ /// <summary>
+ /// 浼犳劅鍣ㄨЕ鍙戝欢杩熸椂闂�
+ /// </summary>
+ public int sensorDelayTime = -1;
+ }
+ #endregion
+
#region 閰嶇疆鎸夐敭鎸囩ず鐏潯鐪犵粍鍒嗭紙鏆傛椂涓嶅仛锛�
///<summary >
///鑾峰彇鎸夐敭鎸囩ず鐏潯鐪犵粍
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
index b85b2c0..990a261 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -162,12 +162,6 @@
public List<Scene.GetSceneDeviceListInfo> SceneDeviceList = new List<Scene.GetSceneDeviceListInfo>();
/// <summary>
- /// 缃戝叧涓�昏緫鍒楄〃
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public static List<Logic.GetLogicInfoResponseData> LogicList = new List<Logic.GetLogicInfoResponseData>();
-
- /// <summary>
/// 缃戝叧涓環dl绉佹湁鎸夐敭缁戝畾鍒楄〃
/// </summary>
[Newtonsoft.Json.JsonIgnore]
@@ -3054,22 +3048,6 @@
public static readonly System.Collections.Generic.List<IStatus> StatusList = new System.Collections.Generic.List<IStatus>();
/// <summary>
- /// 璁惧鐘舵�佹洿鏂�
- /// </summary>
- /// <param name="commonDevice">Common device.</param>
- public static void UpdateDeviceStatus(CommonDevice commonDevice)
- {
- if (commonDevice == null)
- {
- return;
- }
- for (int i = 0; i < StatusList.Count; i++)
- {
- StatusList[i].Changed(commonDevice);
- }
- }
-
- /// <summary>
/// 璁惧淇℃伅鍙樺寲
/// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
/// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
@@ -3495,6 +3473,9 @@
AllowRemoteCtrl = false;
return;
}
+ //铏界劧涓嶇煡閬撳鎸や笅绾块偅涓�鍧楁湁娌℃湁鐢�,涓嶈繃鍏堣繖涔堝紕
+ await System.Threading.Tasks.Task.Delay(1500);
+
var responseData = jobject["ResponseData"];
if (responseData != null)
{
@@ -4013,8 +3994,7 @@
DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡");
gwa.ReportAction("DeviceInComingRespon", tempDevice.getNewDeviceInfo);
}
- UpdateDeviceInfo(tempDevice, "DeviceInComingRespon");
- UpdateDeviceStatus(gwa);
+ UpdateDeviceInfo(tempDevice, "DeviceInComingRespon");
}
#endregion
#region 璁惧鍦ㄧ嚎鐘舵�佹洿鏂板弽棣�
@@ -4032,7 +4012,6 @@
if (infoTempDevice == null)
{
gwa.DeviceList.Add(tempDevice);
- UpdateDeviceStatus(tempDevice);
UpdateDeviceInfo(tempDevice, "OnlineStatusChange");
}
else
@@ -4042,7 +4021,6 @@
infoTempDevice.DeviceInfo.IsOnline = infoTempDevice.IsOnline;
}
UpdateDeviceInfo(infoTempDevice, "OnlineStatusChange");
- UpdateDeviceStatus(infoTempDevice);
}
}
#endregion
@@ -4068,7 +4046,6 @@
}
else
{
- UpdateDeviceStatus(tempDevice);
UpdateDeviceInfo(tempDevice, "RemoveDeviceRespon");
if (tempDevice.removeDeviceResponseData.Result == 0)
{
@@ -4096,7 +4073,6 @@
var tempDevice = new CommonDevice { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId };
tempDevice.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceStatusReportData>(jobject["Data"].ToString());
- UpdateDeviceStatus(tempDevice);
UpdateDeviceInfo(tempDevice, "DeviceStatusReport");
}
#endregion
@@ -4118,7 +4094,6 @@
DebugPrintLog("DoorLockProgrammingEventNotificationCommand宸茬粡閫氱煡");
gwa.ReportAction("DoorLockProgrammingEventNotificationCommand", doorLock);
}
- UpdateDeviceStatus(doorLock);
UpdateDeviceInfo(doorLock, "DoorLockProgrammingEventNotificationCommand");
break;
}
@@ -4142,7 +4117,6 @@
DebugPrintLog("DoorLockProgrammingEventNotificationCommand宸茬粡閫氱煡");
gwa.ReportAction("DoorLockProgrammingEventNotificationCommand", doorLock);
}
- UpdateDeviceStatus(doorLock);
UpdateDeviceInfo(doorLock, "DoorLockProgrammingEventNotificationCommand");
break;
}
@@ -4164,8 +4138,6 @@
//ias.Save();
gwa.ReportAction("IASInfoReport", ias.iASInfo);
}
-
- UpdateDeviceStatus(ias);
UpdateDeviceInfo(ias, "IASInfoReport");
break;
}
@@ -4280,37 +4252,37 @@
#region 閫昏緫琚皟鐢ㄥ弽棣�
else if (topic == gatewayID + "/" + "Logic/Execute_Respon")
{
- var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
- logic.logicExecuteRespo = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.ExecuteResponse>(jobject["Data"].ToString());
+ //var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ //logic.logicExecuteRespo = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.ExecuteResponse>(jobject["Data"].ToString());
- if (logic.logicExecuteRespo == null)
- {
- return;
- }
- //涓婃姤绫诲瀷閫氱煡
- if (gwa.ReportAction != null)
- {
- DebugPrintLog("LogicExecuteReport宸茬粡閫氱煡");
- gwa.ReportAction("LogicExecuteReport", logic.logicExecuteRespo);
- }
+ //if (logic.logicExecuteRespo == null)
+ //{
+ // return;
+ //}
+ ////涓婃姤绫诲瀷閫氱煡
+ //if (gwa.ReportAction != null)
+ //{
+ // DebugPrintLog("LogicExecuteReport宸茬粡閫氱煡");
+ // gwa.ReportAction("LogicExecuteReport", logic.logicExecuteRespo);
+ //}
}
#endregion
#region 鏃堕棿鐐规潯浠舵帹杩熸墽琛�
else if (topic == gatewayID + "/" + "Logic/TimingWillArrive")
{
- var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
- logic.timingWillArriveData = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.TimingWillArriveData>(jobject["Data"].ToString());
+ //var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ //logic.timingWillArriveData = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.TimingWillArriveData>(jobject["Data"].ToString());
- if (logic.timingWillArriveData == null)
- {
- return;
- }
- //涓婃姤绫诲瀷閫氱煡
- if (gwa.ReportAction != null)
- {
- DebugPrintLog("TimingWillArrive宸茬粡閫氱煡");
- gwa.ReportAction("TimingWillArrive", logic.timingWillArriveData);
- }
+ //if (logic.timingWillArriveData == null)
+ //{
+ // return;
+ //}
+ ////涓婃姤绫诲瀷閫氱煡
+ //if (gwa.ReportAction != null)
+ //{
+ // DebugPrintLog("TimingWillArrive宸茬粡閫氱煡");
+ // gwa.ReportAction("TimingWillArrive", logic.timingWillArriveData);
+ //}
}
#endregion
#region 妯″紡瀹夐槻鍔ㄤ綔琚渶缁堟縺娲绘椂鍙戦�佹姤璀︿俊鎭�
diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs
index c859024..a7e6bdc 100755
--- a/ZigbeeApp/Shared/R.cs
+++ b/ZigbeeApp/Shared/R.cs
@@ -316,28 +316,152 @@
public readonly static int DistributeSuccess = 229;
public readonly static int SureToUnFreeze = 230;
- public readonly static int RemindSetting = 548;
- public readonly static int AddNewUser = 650;
- public readonly static int Headshot = 551;
- public readonly static int Edited = 552;
- public readonly static int UneditFingerprint = 553;
- public readonly static int UneditPassword = 554;
- public readonly static int UneditProximityCard = 555;
- public readonly static int EditScence = 556;
- public readonly static int UnEditedScene = 557;
- public readonly static int NewName = 558;
- public readonly static int OldName = 559;
- public readonly static int SystemSetting = 560;
- public readonly static int PasswordList = 561;
- public readonly static int UserRemark = 562;
- public readonly static int UserTempPassword = 563;
- public readonly static int ProximityCard = 564;
- public readonly static int MaxValicCount = 668;
- public readonly static int ValidCount = 670;
- public readonly static int AllRecord = 639;
- public readonly static int ReFresh = 681;
- public static readonly int AccountRegisterSuccess = 691;
+ /// <summary>
+ /// 鎺ヨ繎鎰熷簲
+ /// </summary>
+ public const int ProximitySensors = 231;
+ /// <summary>
+ /// 鎺ヨ繎鎰熷簲鍔熻兘璁剧疆缃け璐�
+ /// </summary>
+ public const int SetPannelProximityFail = 232;
+ /// <summary>
+ /// 鑾峰彇鎺ヨ繎鎰熷簲鍔熻兘澶辫触
+ /// </summary>
+ public const int GetPanelProximityFail = 233;
+ /// <summary>
+ /// 闀滃儚ID涓�2310鐨勮澶囩殑榛樿鍚嶅瓧锛氭柟鎮︽柊椋庡皬妯″潡
+ /// </summary>
+ public const int DeviceModelId2310 = 234;
+ /// <summary>
+ /// 闀滃儚ID涓�2310鐨勮澶囩殑榛樿鍚嶅瓧锛氭柟鎮︽柊椋庡皬妯″潡
+ /// </summary>
+ public const int AddFreshAirPanelMsg = 235;
+ /// <summary>
+ ///缁胯壊鎸囩ず鐏棯鐑�
+ /// </summary>
+ public const int GreenLightLighting = 236;
+ /// <summary>
+ /// 鎸囩ず鐏�
+ /// </summary>
+ public const int IndicatorLight = 237;
+ /// <summary>
+ /// 闀挎寜5绉掞紙鎸夐敭锛�
+ /// </summary>
+ public const int LongPressFiveSecond = 238;
+ /// <summary>
+ /// 闀挎寜
+ /// </summary>
+ public const int AddFreshAirModulPanelMsg = 239;
+ /// <summary>
+ /// 闀滃儚ID涓�2802鐨勮澶囩殑榛樿鍚嶅瓧锛歋-one
+ /// </summary>
+ public const int uDeviceModelId2802 = 240;
+ /// <summary>
+ /// 璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵
+ /// </summary>
+ public const int SetDoorLockNomallyOpen = 241;
+ /// <summary>
+ /// 鐢甸噺
+ /// </summary>
+ public const int DoorLockPower = 242;
+ /// <summary>
+ /// 甯稿紑妯″紡宸插紑鍚�
+ /// </summary>
+ public const int NomallyModeIsTurnOn = 243;
+ /// <summary>
+ /// 澶辨晥璁剧疆
+ /// </summary>
+ public const int DoorLockInValidSetting = 244;
+ /// <summary>
+ /// 鑷姩鍖�
+ /// </summary>
+ public const int DoorLockLogic = 245;
+ /// <summary>
+ /// 闂ㄩ攣濮嬬粓鎵撳紑{0}灏忔椂
+ /// </summary>
+ public const int DoorLockOpenAllTheTime = 246;
+ /// <summary>
+ /// 褰撳墠鏃跺尯
+ /// </summary>
+ public const int DoorLockCurrentZone = 247;
+ /// <summary>
+ /// 鍙栨秷甯稿紑
+ /// </summary>
+ public const int CancelNomallyMode = 248;
+ /// <summary>
+ /// 鎮ㄧ殑甯稿紑妯″紡灏嗚鍙栨秷
+ /// </summary>
+ public const int NomallyModeIsCanceled = 249;
+ /// <summary>
+ /// 淇濇寔甯稿紑
+ /// </summary>
+ public const int KeepNomallyMode = 250;
+ /// <summary>
+ /// 纭鍙栨秷
+ /// </summary>
+ public const int SureCancel = 251;
+ /// <summary>
+ /// (鏈鎿嶄綔浠呬负鍗曟鍙栨秷锛岃嫢闇�瑕佸仠姝㈡墽琛寋0}鑷姩鍖栵紝璇烽�夋嫨鍒嗙被-鑷姩鍖栬繘琛岃缃�)
+ /// </summary>
+ public const int XingTip = 252;
+
+ /// <summary>
+ /// 鑾峰彇闂ㄩ攣甯稿紑妯″紡澶辫触
+ /// </summary>
+ public const int GetNormallyOpenModeFailed = 253;
+ /// <summary>
+ /// 鎵撳紑闂ㄩ攣甯稿紑妯″紡鎴愬姛
+ /// </summary>
+ public const int OpenNormallyOpenModeSuccess = 254;
+ /// <summary>
+ /// 鎵撳紑闂ㄩ攣甯稿紑妯″紡澶辫触
+ /// </summary>
+ public const int OpenNormallyOpenModeFailed = 255;
+ /// <summary>
+ /// 鍏抽棴闂ㄩ攣甯稿紑妯″紡鎴愬姛
+ /// </summary>
+ public const int CloseNormallyOpenModeSuccess = 256;
+ /// <summary>
+ /// 鍏抽棴闂ㄩ攣甯稿紑妯″紡澶辫触
+ /// </summary>
+ public const int CloseNormallyOpenModeFailed = 257;
+ /// <summary>
+ /// 闂ㄩ攣宸茬粡寮�鍚�
+ /// </summary>
+ public const int CurrentNormallyOpenMode = 258;
+ /// <summary>
+ /// 澶辨晥鏃堕棿涓嶅悎娉曪紝璇烽噸鍐欒缃�
+ /// </summary>
+ public const int NormallyOpenModeInvalidTimeTip = 259;
+ /// <summary>
+ /// 闊抽噺璁剧疆澶辫触
+ /// </summary>
+ public const int SetVolumeFailed = 260;
+ /// <summary>
+ /// 闊抽噺璁剧疆鎴愬姛
+ /// </summary>
+ public const int SetVolumeSuccess = 261;
+ /// <summary>
+ /// 褰撳墠鏃跺尯聽
+ /// </summary>
+ public const int CurZone = 262;
+ /// <summary>
+ /// 鍖郝�
+ /// </summary>
+ public const int CurZoneText = 263;
+ /// <summary>
+ /// 涓溌�
+ /// </summary>
+ public const int East = 264;
+ /// <summary>
+ /// 瑗柯�
+ /// </summary>
+ public const int West = 265;
+ /// <summary>
+ /// 褰撳墠璁惧涓嶆敮鎸佽鍔熻兘
+ /// </summary>
+ public const int NoSupport = 266;
public readonly static int cancel = 5097;
public readonly static int confrim = 5098;
@@ -592,6 +716,7 @@
public readonly static int automationaddtext = 5377;
public readonly static int tiptextnull = 5378;
public readonly static int tiplocktextnull = 5379;
+ public readonly static int openmode = 5380;
#region 鐧诲綍娉ㄥ唽
/// <summary>
@@ -5331,7 +5456,10 @@
/// 鎵撳紑
/// </summary>
public const int uOpen1 = 16073;
-
+ /// <summary>
+ /// 鏃ョ珛绌鸿皟妯″潡
+ /// </summary>
+ public const int uHitachiAirConditioningModule = 16074;
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
@@ -5559,6 +5687,10 @@
/// 鏂规偊鐜闈㈡澘 -> 鎸変綇闈㈡澘鍔熻兘(function)鎸夐敭锛屾墍鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔�
/// </summary>
public const int uAddFangyueEnvironmentPanelMsg = 21021;
+ /// <summary>
+ /// 绐楀笜闈㈡澘 -> 闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔�
+ /// </summary>
+ public const int uAddCurtaunPanelMsg = 21022;
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勭炕璇戝悕瀛�,浠�30000寮�濮嬧槄鈽呪槄鈽�
@@ -5706,6 +5838,10 @@
/// 闀滃儚ID涓�226鐨勮澶囩殑榛樿鍚嶅瓧锛氱畝绾�2璺獥甯橀潰鏉�
/// </summary>
public const int uDeviceModelId226 = 30035;
+ /// <summary>
+ /// 闀滃儚ID涓�256鐨勮澶囩殑榛樿鍚嶅瓧锛氭柟鎮�/2璺獥甯橀潰鏉�-Z
+ /// </summary>
+ public const int uDeviceModelId256 = 30036;
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems
index d944014..e5a60a2 100755
--- a/ZigbeeApp/Shared/Shared.projitems
+++ b/ZigbeeApp/Shared/Shared.projitems
@@ -19,6 +19,16 @@
<Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\ResultPack.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\UserLoginLocalRegionRes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Pad\MainPage.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" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceAirSwitchRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceColorLightRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceCurtainRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceDoorLockRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceRelayRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceSensorRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceTemperatureRowControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\CurrentDeviceState.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\AddDeviceView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\Addview.cs" />
@@ -27,7 +37,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\IfString.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\mFunView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SaveView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SelectedButton.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SelectedDeviceView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TopView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TypeView.cs" />
@@ -98,7 +107,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\Cycle.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DelayTime.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DeviceTarget.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\AddAction.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\AddCondition.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockLogicCommunalPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockLogicList.cs" />
@@ -119,7 +127,10 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomHumiditySetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomShareSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomTemperatureSetting.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\UnallocatedRoom.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceDryContactCardControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceFunctionUnallocatedControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceSelectUnallocatedControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\UnallocatedRoomForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\Base\DeviceCardCommon.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceAcCardControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceAirSwitchCardControl.cs" />
@@ -129,9 +140,10 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceRelayCardControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceSensorCardControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceTemperatureCardControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\ListRoomCardControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\SafetyShortcutControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\SceneCardControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\UserHomeView2.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\HomeMainPageForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Abount\AbountForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Abount\SLAForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\AccountOption.cs" />
@@ -186,9 +198,12 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\CommonForm\DirectionCommonForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\CurtainAutoOpenDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\CurtainSiphonateDirectionForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelCurtainDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelFangyueEightButtonDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelFangyueEnvironmentDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelFangyueFourButtonDirectionForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelFangyueFreshAirDirectionForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelFangyueFreshAirModulDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelFangyueTwoButtonDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\RepeaterZigbeeDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorCarbonMonoxideDirectionForm.cs" />
@@ -198,10 +213,13 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorPirDirectionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorTemperatureHumidityForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorWaterDirectionForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelBackLighWithSensorForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueButtonSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueEnvironmentButtonSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueEnvironmentLightSettionForm.cs" />
<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\PanelFangyueFunctionSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\PirSensor\PirSensorDimmingModeForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\PirSensor\PirSensorTargetSelectForm.cs" />
@@ -215,6 +233,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\FunctionSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\MasterManagementPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\MemberFrozenPage.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\ShowDoorLockMsgControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\TemporaryPassword.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\TimeSettignPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UndistributeDoorlockUserPage.cs" />
@@ -430,7 +449,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Common\SendDataToServer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserView\UserHomeView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\Room.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomManagement.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ListRoomViewFrom.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\AddRoomSelectPicByLocal.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\ProgressBar.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\SearchEditText.cs" />
@@ -469,7 +488,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\HDLbutton.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\IASZone.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\LigthtBase.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Logic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\LogicBase.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\OTADevice.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Panel.cs" />
--
Gitblit v1.8.0