From c6b35c3138b944830b5336bf610f918154dd47c7 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期六, 12 十月 2019 15:45:10 +0800 Subject: [PATCH] 合并门锁,完成住宅管理 --- ZigbeeApp/GateWay.Droid/Assets/Phone/Room/Room_Rectangle.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 392 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 38 ZigbeeApp/Shared/Phone/UserCenter/Safety/AddDeviceAlarmTargetListForm.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Safety/LightAlarmSettionForm.cs | 4 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint207.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockBlankPic.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/Room_Rectangle.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 20 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SettingIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRight.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Password.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs | 5 ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs | 738 --- ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Account.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs | 413 + ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/MemberIcon.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/ItemSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs | 15 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r22.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs | 23 ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 1510 +++--- ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockFailed.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r18.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFingerprintTipPic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs | 13 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectFloor_Left.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectHouse.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Room/HomeBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r4.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected1.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CollectionSelected1.png | 0 ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs | 69 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TemPasswordVisiable.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Device/ColorLight.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r11.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8IconSelected.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground1.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Account/PhoneEmail_White.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Switch.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs | 317 + ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Home.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/SubAccountManagementPage.cs | 10 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r8.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView_Name.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r15.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/House.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCard.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Safety/CurtainAlarmSettionForm.cs | 4 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_DrySelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs | 3 ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Setting.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockButton.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Switch.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewEmailForm.cs | 5 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RoomPic.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DateIcon.png | 0 ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 82 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Logo/Logo.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs | 114 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_MiddleSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs | 30 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs | 828 +++ ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCardOn.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r7.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Sensor.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/FloorSelected.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_AutoSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r3.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DelIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r19.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorlockDialog.cs | 99 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Time.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19IconSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlJiguangMsgPushLogic.cs | 6 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardViewSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/3.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/DoorlockPicture.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs | 14 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Auto.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/PhoneEmail_White.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/CancelIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RightIcon.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView_Name.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/VirtualFrame.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r10.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindDown.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/Floor.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs | 191 ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/HomeSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Add.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2Selected.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Switch.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r20.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockListPage.cs | 189 ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/2.png | 0 ZigbeeApp/Shared/R.cs | 23 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockUserPic.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10IconSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs | 15 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs | 8 ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindLeft.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r2.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/HistoryRecordPage.cs | 703 +++ ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SwitchOn.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Switch.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_CoolSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Code.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs | 152 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 439 ++ ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockPicture.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardViewSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs | 230 + ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomDeviceListForm.cs | 111 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cat.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Room.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs | 32 ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindEmptyPic.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/CategorySelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FingerprintOn.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnselectedIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UndistributeIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/HomeBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockIcon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs | 443 ++ ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r14.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs | 71 ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs | 6 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_loginBG.png | 0 ZigbeeApp/Shared/Common/Room.cs | 33 ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Light.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r16.png | 0 ZigbeeApp/GateWay.Droid/Assets/Language.ini | 19 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/BottomShadow.png | 0 ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlManualBackUpForm.cs | 12 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneCard.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SideslipPic.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r6.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFailedPic.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/ShareIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r24.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs | 442 ++ ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockOpen.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Safety/SwitchAlarmSettionForm.cs | 4 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Room.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs | 5 ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Sensor.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_HeightSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs | 4 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLight.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/4.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/HouseSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/RemotelyUnlock.cs | 162 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4Icon.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/SwitchOn.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/SelectDeviceForm.cs | 198 ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs | 15 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedFanModeBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cancle.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_LowSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/SettingSelected.png | 0 ZigbeeApp/Shared/Common/ZigbeeColor.cs | 103 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/HidePwd.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedModeBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Reduce.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_FanSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Floor.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Left.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodOn.png | 0 ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs | 4 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoBindGW.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/VisitorIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DistributeUnlockIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17Icon.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionViewBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DooorLockPicOpen.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RemoteUnlockIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrCloseSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/ChangeSuccess.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockSideslipIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockSuccess.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Group.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/1.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs | 2 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Drop_Down.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r21.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 36 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionViewBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SelectedIcon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs | 302 + ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SceneCard.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_Category.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorTemperature.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs | 37 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBGSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1Icon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberManagement.cs | 138 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs | 29 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 319 + ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r13.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/EntrySuccessIcon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/CommonFormBase.cs | 8 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneFunctionBG.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Category.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/ItemSelected.png | 0 ZigbeeApp/Shared/Shared.projitems | 29 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FavoriteIcon.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Time.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_HeatSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Path.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddPasswordTicPic.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r5.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CancelIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Language.ini | 479 + ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs | 286 + ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrClose.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Socket1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/ResidenceIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/PasswordOn.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs | 928 ++++ ZigbeeApp/GateWay.Ios/Resources/Phone/Account/UnhidePwd.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r17.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockUserMangement.cs | 130 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/RealDevice/CommonDevice.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs | 38 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2Icon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodFailedTip.cs | 311 + ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Light.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11IconSelected.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_GW.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_White.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs | 15 ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldEmailForm.cs | 5 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TypeIcon.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs | 175 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethod.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockPicClose.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Low.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardView.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardView.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r23.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs | 196 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Password.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RecordIcon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r0.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoFunction.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockClose.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Height.png | 0 ZigbeeApp/Shared/Phone/ZigBee/Device/TemperatureSensor.cs | 12 ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/AddFailedPic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs | 4 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Middle.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14IconSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs | 12 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r12.png | 0 ZigbeeApp/Shared/Common/Device.cs | 601 ++ ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected1.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6IconSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 73 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3IconSelected.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12Icon.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9IconSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs | 71 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs | 3 /dev/null | 10 ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcCardTipPic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 208 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 8 ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindAdd.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorHumidity.png | 0 ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r9.png | 0 327 files changed, 10,898 insertions(+), 1,943 deletions(-) diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini index 5db47c2..2969b1f 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini +++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini @@ -121,7 +121,7 @@ 116=瀵嗙爜閿欒 117=鍓╀綑 118=娆℃満浼� -119=杩滅▼寮�閿佹垚鍔燂紝璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮忋�� +119=杩滅▼寮�閿佺粦瀹氭垚鍔燂紝璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮忋�� 120=褰撳墠鏃ユ湡 121=褰撳墠鏃跺埢 122=闂ㄩ攣鏃堕棿 @@ -174,7 +174,20 @@ 168=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞鏂板満鏅悧锛� 169=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞寮�鍏冲悧锛� 170=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞璋冨厜鍚楋紵 -171=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞閬槼鍚楋紵 +171=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞閬槼鍚楋紵 +172=IC鍗� +173=瀵嗙爜 +174=鎸囩汗 +175=淇敼澶辫触 +176=璇ョ敤鎴峰彧鑳藉湪璁惧绔垹闄� +177=鏈垎閰� +178=楠岃瘉棰戠箒锛岃30绉掑悗鍐嶈瘯 +179=鎿嶄綔澶辫触 +180=杩滅▼寮�閿佺粦瀹氭垚鍔� +181=璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮� +182=宸插叧闂� +183=姝e湪寮�閿� +184=宸叉墦寮� 548=鎻愰啋璁剧疆 550=鏂板鐢ㄦ埛 @@ -1517,6 +1530,8 @@ 15769=婀垮害 15770=璇疯緭鍏ユ埧闂村悕绉� 15771=缂栬緫鎴块棿 +15772=鑾峰彇涓�... +15773=瀛樺湪闈炴硶瀛楃銆寋0}銆� ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Account/PhoneEmail_White.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Account/PhoneEmail_White.png new file mode 100755 index 0000000..14f8595 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Account/PhoneEmail_White.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorDimmableLight.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorDimmableLight.png deleted file mode 100755 index 5f7e024..0000000 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorDimmableLight.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLight.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLight.png new file mode 100755 index 0000000..ad8aa4b --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLight.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Light.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Light.png new file mode 100755 index 0000000..ad8aa4b --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Light.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Sensor.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Sensor.png index ad9e3b4..3378eb3 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Sensor.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Sensor.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1.png new file mode 100755 index 0000000..651eb85 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Socket1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Switch.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Switch.png new file mode 100755 index 0000000..5e8f7c0 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/Switch.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/AddFailedPic.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/AddFailedPic.png new file mode 100755 index 0000000..aa37ea7 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/AddFailedPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/DoorlockPicture.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/DoorlockPicture.png new file mode 100755 index 0000000..98a63e5 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/DoorlockPicture.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Switch.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Switch.png new file mode 100755 index 0000000..3257b9d --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/Switch.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/SwitchOn.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/SwitchOn.png new file mode 100755 index 0000000..12ec341 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/SwitchOn.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon.png new file mode 100755 index 0000000..d811b52 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon1.png deleted file mode 100755 index ad53b87..0000000 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon2.png deleted file mode 100755 index ad53b87..0000000 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/DoorLock/UndistributeIcon2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection.png index 6db1698..c9a2216 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection1.png new file mode 100755 index 0000000..b4a9280 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Collection1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CollectionSelected1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CollectionSelected1.png new file mode 100755 index 0000000..736f6b6 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CollectionSelected1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardView.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardView.png new file mode 100755 index 0000000..0544d02 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardView.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardViewSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardViewSelected.png new file mode 100755 index 0000000..514aa16 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionCardViewSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionViewBG.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionViewBG.png new file mode 100755 index 0000000..7146bd1 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/FunctionViewBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Tick.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/ItemSelected.png similarity index 100% rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Tick.png rename to ZigbeeApp/GateWay.Droid/Assets/Phone/Item/ItemSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Room.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Room.png new file mode 100755 index 0000000..29ca85f --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Room.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SceneCard.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SceneCard.png new file mode 100755 index 0000000..e969de5 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SceneCard.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch1.png new file mode 100755 index 0000000..b2ffd07 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected1.png new file mode 100755 index 0000000..ebd4ee1 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Time.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Time.png new file mode 100755 index 0000000..12858c0 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Time.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/HomeBG.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/HomeBG.png new file mode 100755 index 0000000..cd4994b --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/HomeBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView.png new file mode 100755 index 0000000..1bcf913 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView_Name.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView_Name.png new file mode 100755 index 0000000..7ec7f26 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/RoomCardView_Name.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/Room_Rectangle.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/Room_Rectangle.png new file mode 100755 index 0000000..17ea24b --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Room/Room_Rectangle.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj index 4de6488..d5962f1 100755 --- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj +++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj @@ -86,6 +86,9 @@ <Reference Include="MQTTnet.Core, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\packages\MQTTnet.2.4.0\lib\netstandard1.3\MQTTnet.Core.dll</HintPath> </Reference> + <Reference Include="Shared.Droid.GDMapKit"> + <HintPath>..\Shared\DLL\Shared.Droid.GDMapKit.dll</HintPath> + </Reference> <Reference Include="Shared.Droid.PickerView"> <HintPath>..\Shared\DLL\Shared.Droid.PickerView.dll</HintPath> </Reference> @@ -261,7 +264,7 @@ <AndroidAsset Include="Assets\Phone\Device\ButtonPanelOne.png" /> <AndroidAsset Include="Assets\Phone\Device\ButtonPanelThree.png" /> <AndroidAsset Include="Assets\Phone\Device\ButtonPanelTwo.png" /> - <AndroidAsset Include="Assets\Phone\Device\ColorDimmableLight.png" /> + <AndroidAsset Include="Assets\Phone\Device\ColorLight.png" /> <AndroidAsset Include="Assets\Phone\Device\Converter.png" /> <AndroidAsset Include="Assets\Phone\Device\ConverterZb485.png" /> <AndroidAsset Include="Assets\Phone\Device\Curtain.png" /> @@ -417,7 +420,7 @@ <AndroidAsset Include="Assets\Phone\Item\SwitchSelected.png" /> </ItemGroup> <ItemGroup> - <AndroidAsset Include="Assets\Phone\Item\Tick.png" /> + <AndroidAsset Include="Assets\Phone\Item\ItemSelected.png" /> </ItemGroup> <ItemGroup> <AndroidAsset Include="Assets\Phone\Item\Timer.png" /> @@ -715,12 +718,6 @@ </ItemGroup> <ItemGroup> <AndroidAsset Include="Assets\Phone\DoorLock\TypeIcon.png" /> - </ItemGroup> - <ItemGroup> - <AndroidAsset Include="Assets\Phone\DoorLock\UndistributeIcon1.png" /> - </ItemGroup> - <ItemGroup> - <AndroidAsset Include="Assets\Phone\DoorLock\UndistributeIcon2.png" /> </ItemGroup> <ItemGroup> <AndroidAsset Include="Assets\Phone\DoorLock\UnLockBlankPic.png" /> @@ -1133,6 +1130,75 @@ <ItemGroup> <AndroidAsset Include="Assets\Phone\RealDevice\CommonDevice.png" /> </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Account\PhoneEmail_White.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\Collection1.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\CollectionSelected1.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\FunctionCardView.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\FunctionCardViewSelected.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\FunctionViewBG.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\Room.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\SceneCard.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\Switch1.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\SwitchSelected1.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Item\Time.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Room\HomeBG.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Room\Room_Rectangle.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Room\RoomCardView.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Room\RoomCardView_Name.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\Light.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\Socket1.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\Switch.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\DoorLock\AddFailedPic.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\DoorLock\DoorlockPicture.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\DoorLock\Switch.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\DoorLock\SwitchOn.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\DoorLock\UndistributeIcon.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.Ios/Resources/Language.ini b/ZigbeeApp/GateWay.Ios/Resources/Language.ini index 9b14170..2969b1f 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Language.ini +++ b/ZigbeeApp/GateWay.Ios/Resources/Language.ini @@ -9,17 +9,17 @@ 3=涓汉涓績 4=鎸夐敭閰嶇疆 5=娣诲姞缁戝畾鐩爣 -6=寮�鍏�:寮� -7=寮�鍏�:鍏� -8=寮�鍏�:鍒囨崲 -9=浜害:璋冨ぇ -10=浜害:璋冨皬 -11=浜害:鍒囨崲 -12=绐楀笜:寮� -13=绐楀笜:鍏� -14=绐楀笜:鍋� -15=绐楀笜:涓婂崌鍋� -16=绐楀笜:涓嬮檷鍋� +6=寮� +7=鍏� +8=寮�/鍏� +9=浜害:鎸夌瓑绾ц皟澶� +10=浜害:鎸夌瓑绾ц皟灏� +11=浜害:鎸夌瓑绾у垏鎹� +12=寮� +13=鍏� +14=鍋� +15=寮�/鍋� +16=鍏�/鍋� 17=璇烽�夋嫨妯″紡 18=鏈懡鍚� 19=妯″紡绫诲瀷 @@ -46,47 +46,282 @@ 41=鍦烘櫙瑙﹀彂 42=绌鸿皟 43=鍦烘櫙妯″紡宸茬粡瀛樺湪鐩爣锛岃鍒犻櫎鍚庢墠鑳芥坊鍔犳柊鐩爣 - -44=闂ㄩ攣 -45=杩滅▼寮�閿� -46=鐢ㄦ埛绠$悊 -47=寮�閿佽褰� -48=鎻愰啋璁剧疆 -49=涓存椂瀵嗙爜 -50=鏂板鐢ㄦ埛 -51=澶村儚 -52=宸茬紪杈� -53=鎸囩汗鍒楄〃 -54=鏈紪杈戝瘑鐮� -55=鏈紪杈戞劅搴斿崱 -56=鍦烘櫙缂栬緫 -57=鏈紪杈戝満鏅� -58=鏂板悕瀛� -59=鍘熷悕瀛� -60=绯荤粺璁剧疆 -61=瀵嗙爜鍒楄〃 -62=淇敼澶囨敞 -63=涓存椂瀵嗙爜 -64=鎰熷簲鍗� -65=澶囨敞涓虹┖ -66=楠岃瘉鎴愬姛 -67=楠岃瘉棰戠箒锛岃5绉掑悗閲嶆柊鎿嶄綔 -68=鏈夋晥娆℃暟涓嶈秴杩�15娆� -69=鏈夋晥鏃舵: -70=鏈夋晥娆℃暟: -71=鏈夋晥鏃堕棿涓嶈秴杩�65532鍒嗛挓 -72= 娆� -73=璇ヤ复鏃跺瘑鐮佹湁鏁�2娆� -74=鐢熸垚涓存椂瀵嗙爜 -75=鏃� 鏈� +44=鍔熻兘璁剧疆 +45=闅忔満瀵嗙爜 +46=鏈� +47=鏃� +48=淇℃伅缂栬緫 +49=鐢熸晥鏃堕棿 +50=澶辨晥鏃堕棿 +51=浣跨敤娆℃暟 +52=鐐瑰嚮鐢熸垚 +53=绠$悊瀵嗙爜淇℃伅 +54=鏆傛棤瀵嗙爜淇℃伅 +55=璇风偣鍑诲彸涓婅娣诲姞 +56=褰曞叆寮�閿佷俊鎭� +57=褰曞叆瀵嗙爜 +58=褰曞叆鎸囩汗 +59=褰曞叆IC鍗� +60=鐐规寜闂ㄩ攣閿洏澶� +61=璇峰湪闂ㄩ攣閿洏澶� +62=濡傛棤鍝嶅簲锛岃鏍稿鏄惁鎸夐棬閿佹搷浣滄楠よ繘琛� +63=灏嗘墜鎸囨斁鍦ㄦ寚绾瑰尯鍩熶笂 +64=璇峰湪闂ㄩ攣鎸囩汗鍖哄煙 +65=灏咺C鍗℃斁鍦ㄦ劅搴斿尯鍩熶笂 +66=璇峰皢IC鍗℃斁鍦ㄦ劅搴斿尯鍩熶笂 +67=褰曞叆鐘舵�� +68=瀵嗙爜褰曞叆鎴愬姛 +69=瀵嗙爜澶囨敞锛� +70=閰嶅瀹㈡埛 +71=鏃� +72=鎴愬憳绠$悊 +73=鎸囩汗褰曞叆鎴愬姛 +74=IC鍗″綍鍏ユ垚鍔� +75=鎸囩汗澶囨敞锛� 76=鍒囨崲妯″紡浼氭竻闄ゆ寜閿腑鎵�鏈夌殑鐩爣锛岀‘瀹氳鍒囨崲鍚� - - -112=淇℃伅鏇存敼 +77=鍐荤粨鐢ㄦ埛 +78=鍘嗗彶璁板綍 +79=鎵�鏈夋垚鍛� +80=寮�閿佹柟寮� +81=寮�閿佹垚鍔� +82=鏈変汉璁块棶 +83=鎸囩汗寮�閿� +84=瀵嗙爜寮�閿� +85=涓存椂瀵嗙爜寮�閿� +86=IC鍗″紑閿� +87=鎵�鏈夋棩鏈� +88=鏅鸿兘闂ㄩ攣 +89=褰撳墠 +90=娓呴櫎瀵嗙爜 +91=浜害锛氭墦寮� +92=浜害锛氬叧闂� +93=浜害锛氬垏鎹� +94=IC鍗″娉細 +95=鎵�鏈夋柟寮� +96=绫诲瀷绛涢�� +97=鍘讳慨鏀� +98=纭畾瑕佹竻闄ゅ瘑鐮侊紵 +99=鏃跺埢 +100=鏃ユ湡 +101=鎸囩汗寮�閿佹垚鍔� +102=鎸囩汗寮�閿佸け璐� +103=瀵嗙爜寮�閿佹垚鍔� +104=瀵嗙爜寮�閿佸け璐� +105=IC鍗″紑閿佹垚鍔� +106=IC鍗″紑閿佸け璐� +107=鏈変汉璁块棶 +108=娓呯┖璁板綍 +109=寮�濮嬫棩鏈� +110=缁撴潫鏃ユ湡 +111=鎵�鏈� +112=鍏朵粬 113=鎻愮ず +114=缁戝畾闂ㄩ攣 +115=璇疯緭鍏ュ紑閿佸瘑鐮� +116=瀵嗙爜閿欒 +117=鍓╀綑 +118=娆℃満浼� +119=杩滅▼寮�閿佺粦瀹氭垚鍔燂紝璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮忋�� +120=褰撳墠鏃ユ湡 +121=褰撳墠鏃跺埢 +122=闂ㄩ攣鏃堕棿 +123=鏈垎閰嶅紑閿佹柟寮� +124=閰嶅鐢ㄦ埛 +125=瀵嗙爜鍒嗛厤鎴愬姛 +126=鐢ㄦ埛绠$悊 +127=鑱斿姩浜嬩欢 +128=鏂板寮�閿佹柟寮� +129=鏂板瀵嗙爜 +130=鏂板鎸囩汗 +131=鏂板IC鍗� +132=瀵嗙爜褰曞叆澶辫触 +133=瑙e喅鏂规硶 +134=1銆佽妫�鏌ラ棬閿佺數姹犳槸鍚﹁�楀敖 +135=2銆佽妫�鏌ラ棬閿佷笌缃戝叧鏄惁澶勪簬杩炴帴鐘舵�� +136=3銆佽妫�鏌ラ棬閿佹槸鍚﹀瓨鍦ㄦ晠闅� +137=閲嶈瘯 +138=鎸囩汗褰曞叆澶辫触 +139=IC鍗″綍鍏ュけ璐� +140=瀹屾垚 +141=纭畾瑕佸垹闄よ寮�閿佹柟寮� +142=涓存椂寮�閿佹潈闄� +143=寮�閿佽姹� +144=纭畾瑕佹墦寮�闂ㄩ攣锛� +145=Touch ID 寮�閿� +146=瀵嗙爜閿欒锛岃閲嶆柊杈撳叆 +147=鎵嬪娍寮�閿� +148=璇风粦瀹氳繙绋嬪紑閿佺殑闂ㄩ攣 +149=鍘昏缃� +150=璇峰墠寰�涓汉涓績 +151=璁剧疆浜屾瀹夊叏楠岃瘉鏂瑰紡 +152=寮�鍚繙绋嬪紑閿侀獙璇� +153=闂ㄩ攣 +154=杩滅▼寮�閿� +155=涓存椂瀵嗙爜 -155=璇锋鏌ョ綉缁� -191=璐︽埛娉ㄥ唽鎴愬姛 +156=鏆傛棤鍙帶鐩爣 +157=娣诲姞鍦烘櫙 +158=娣诲姞寮�鍏� +159=娣诲姞鐏厜 +160=娣诲姞閬槼 +161=閫夋嫨鎸夐敭妯″紡 +162=鐭寜璋冧寒锛岄暱鎸夎皟浜紝鏉炬墜鍋� +163=鐭寜璋冩殫锛岄暱鎸夎皟鏆楋紝鏉炬墜鍋� +164=鐭寜寮�锛岄暱鎸夎皟浜紝鏉炬墜鍋� +165=鐭寜鍏筹紝闀挎寜璋冩殫锛屾澗鎵嬪仠 +166=寮�/鍏筹紝闀挎寜璋冧寒/鏆楋紝鏉炬墜鍋� +167=鎸夐敭妯″紡 +168=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞鏂板満鏅悧锛� +169=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞寮�鍏冲悧锛� +170=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞璋冨厜鍚楋紵 +171=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞閬槼鍚楋紵 +172=IC鍗� +173=瀵嗙爜 +174=鎸囩汗 +175=淇敼澶辫触 +176=璇ョ敤鎴峰彧鑳藉湪璁惧绔垹闄� +177=鏈垎閰� +178=楠岃瘉棰戠箒锛岃30绉掑悗鍐嶈瘯 +179=鎿嶄綔澶辫触 +180=杩滅▼寮�閿佺粦瀹氭垚鍔� +181=璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮� +182=宸插叧闂� +183=姝e湪寮�閿� +184=宸叉墦寮� + +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=鏈煡瀵嗙爜 + + 5097=鍙栨秷 5098=纭 @@ -298,14 +533,88 @@ 5304=鏄惁瑕佸垹闄�? -10000=鍠滅埍 -10003=璇锋眰鏈嶅姟鍣ㄥけ璐� -10005=OK -10006=璐﹀彿鎴栬�呭瘑鐮佷笉鑳戒负绌� -10007=璐﹀彿宸茬粡娉ㄥ唽 -10008=閭鏍煎紡涓嶆纭� -10009=瀵嗙爜闀垮害灏忎簬鍏� -10010=涓ゆ瀵嗙爜杈撳叆涓嶄竴鑷� + + +10000=HDL Home + +10100=鎵嬫満鍙� +10101=閭 +10102=璇疯緭鍏ユ墜鏈哄彿 +10103=璇疯緭鍏ヤ笉灏戜簬6浣嶇殑瀵嗙爜 +10104=鐧诲綍 +10105=楠岃瘉鐮佺櫥褰� +10106=娉ㄥ唽鐢ㄦ埛 +10107=璇疯緭鍏ラ偖绠� +10108=鎼滅储 +10109=纭畾 +10110=璐﹀彿鐧诲綍 +10111=鍙戦�侀獙璇佺爜 +10112=鍚庨噸鍙� +10113=璇峰啀娆¤緭鍏ュ瘑鐮� +10114=鍙戦�侀獙璇佺爜鎴愬姛锛岃娉ㄦ剰鏌ユ敹 +10115=纭畾 +10116=璇ヨ处鍙峰凡娉ㄥ唽锛屽彲鐩存帴鐧诲綍 +10117=鎻愪緵鐨勫弬鏁伴敊璇� +10118=涓ゆ瀵嗙爜涓嶄竴鑷� +10119=楠岃瘉鐮侀敊璇� +10120=璇锋眰鏈嶅姟鍣ㄥけ璐� +10121=鎭枩娉ㄥ唽鎴愬姛锛� +10122=鍗冲皢鑷姩鐧诲綍 +10123=蹇樿瀵嗙爜 +10124=纭閲嶇疆 +10125=淇敼鎴愬姛 +10126=浣犵殑瀵嗙爜淇敼鎴愬姛锛岃閲嶆柊鐧诲綍 + +11000=鍔熻兘 +11001=鍦烘櫙 +11002=鑷姩鍖� + +11010=娌℃湁鍔熻兘 {\r\n} 璇峰湪涓汉涓績涓�--璁惧绠$悊澶勬坊鍔� +11011=缂栬緫 +11012=璁剧疆鍔熻兘 +11013=淇℃伅缂栬緫 +11014=鍔熻兘鍚嶇О +11015=鎵�灞炲尯鍩� +11016=鎵�灞炴ā鍧� +11017=鏈煡 +11018=鍒嗕韩 +11019=鍒嗕韩鐨� +11020=閫夋嫨鍥炬爣 +11021=淇濆瓨 +11022=鎻愮ず +11023=鍙栨秷 +11024=娌℃湁鍦烘櫙 {\r\n} 璇风偣鍑诲彸涓婅娣诲姞 +11025=璁剧疆 +11026=瀹氭椂 +11027=纭畾鍒犻櫎鍚楋紵 +11028=娣诲姞鍦烘櫙 +11029=鍦烘櫙鍚嶇О +11030=璇疯緭鍏ュ満鏅悕绉� +11031=娣诲姞鎵ц鐩爣 +11032=閫夋嫨鍖哄煙 +11033=閫夋嫨鍦烘櫙鍥剧墖 + + +13100=鎴块棿鍒楄〃 +13101=閫夋嫨妤煎眰 +13102=閫夋嫨浣忓畢 +13103=鏂扮敤鎴风櫥褰曪紝璇峰厛缁戝畾缃戝叧 +13104=娣诲姞鏅鸿兘缃戝叧 +13105=缂栬緫鎴块棿 +13106=鎴块棿鍚嶇О +13107=鎵�灞炴ゼ灞� +13108=娓╁害 +13109=婀垮害 +13110=褰撳墠 +13111=寮� +13112=鍏� +13113=涓嶅紑鍚� +13114=绉� +13115=鍒嗛挓 +13116=灏忔椂 + + + 10011=瀵嗙爜涓嶈兘涓虹┖锛� 10012=璇峰幓閭婵�娲昏处鍙� @@ -317,6 +626,8 @@ 10018=楠岃瘉鐮侀敊璇� 10019=璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤 10020=璇峰幓閭纭淇敼瀵嗙爜 + + 10021=閭欢鍙戦�佸け璐ワ紝璇烽噸璇� 10022=璇ヨ处鍙锋棤鏉冮檺 @@ -341,7 +652,7 @@ 11007=閭娉ㄥ唽 11008=宸叉湁璐﹀彿锛熺櫥褰� 11009=璇疯緭鍏ユ墜鏈哄彿 -11010=璇峰啀娆$‘璁ゅ瘑鐮� + 11011=璇疯緭鍏ラ獙璇佺爜 11012=鍙戦�侀獙璇佺爜 11013=鎻愮ず @@ -392,11 +703,15 @@ 11058=娣诲姞璁惧鎴愬姛 11059=鍏抽棴 11060=璁惧 -11061=杩樻病娣诲姞鍔熻兘 + 11062=纭畾鍒犻櫎璇ユ埧闂村悧锛� 11063=纭畾鍒犻櫎鍚楋紵 11064=杩樻病娣诲姞鍦烘櫙 11065=鑷姩鍖� + + + + @@ -504,8 +819,8 @@ 12109=涓户鍣� 12500=褰撳墠鎴块棿娌℃湁璁惧鍙互娣诲姞鍒板満鏅� -12501=寰�涓婄Щ鍔ㄩ檺浣� -12502=寰�涓嬬Щ鍔ㄩ檺浣� +12501=寰�涓婄Щ鍔� +12502=寰�涓嬬Щ鍔� @@ -703,7 +1018,7 @@ 15197=纭畾瑕佺Щ闄よ瀹跺涵鎴愬憳鍚楋紵 15198=鍒锋柊 15199=鏈垎閰嶅尯鍩� -15200=娣诲姞浣忓畢 +15200=鍒涘缓浣忓畢 15201=缂栬緫浣忓畢 15202=璇疯緭鍏ヤ綇瀹呭悕绉� 15203=涓嶈兘鍒犻櫎鏈�鍚庡敮涓�鐨勪綇瀹� @@ -1182,6 +1497,41 @@ 15736=浠呭鏈満鏈夋晥 15737=瀵嗙爜楠岃瘉 15738=鎵嬪娍楠岃瘉 +15739=浜屾瀹夊叏楠岃瘉灏嗙敤浜庝笅鍒楁搷浣� +15740=绠$悊鍛樻巿鏉� +15741=鎺堟潈鎴愬憳鎴愪负绠$悊鍛� +15742=閫氳繃APP寮�鍚棬閿� +15743=瀹夐槻璁剧疆 +15744=閰嶇疆闃插尯 +15745=寮�鍚寚绾归獙璇佸け璐ワ紒璇峰墠寰�鎵嬫満{0}璁剧疆寮�鍚寚绾瑰紑閿侀獙璇� +15746=灏員ouch ID鐢ㄤ簬銆孼igBee銆峽0}鏇存敼瀹夐槻璁剧疆鍜屽紑鍚棬閿佹椂浣跨敤 +15747=杩滅▼寮�閿佸紑鍚け璐ワ紝璇峰厛璁剧疆{0}浜屾瀹夊叏楠岃瘉鏂瑰紡 +15748=璇峰啀娆$‘璁ゅ瘑鐮� +15749=淇敼瀵嗙爜锛岃杈撳叆鏂板瘑鐮� +15750=纭瀵嗙爜閿欒锛岃閲嶆柊璁剧疆 +15751=娌℃湁璁剧疆瀵嗙爜楠岃瘉 +15752=褰撳墠浣忓畢 +15753=鍒囨崲 +15754=鏇存敼 +15755=鏇存敼鍚嶇О +15756=纭鍒囨崲褰撳墠浣忓畢鍒般�寋0}銆�? +15757=妤煎眰 +15758=鍒涘缓妤煎眰 +15759=璇疯緭鍏ユゼ灞傚悕绉� +15760=妤煎眰鍚嶇О宸茬粡瀛樺湪 +15761=纭鍒犻櫎妤煎眰鍙婂叾鎵�鏈夋埧闂�? +15762=鍒犻櫎浣忓畢 +15763=纭鍒犻櫎浣忓畢鍙婃墍鏈夋ゼ灞傘�佹埧闂�? +15764=纭鍒犻櫎鎴块棿? +15765=鍒涘缓鎴块棿 +15766=鎴块棿鍚嶇О +15767=鎵�灞炴ゼ灞� +15768=娓╁害 +15769=婀垮害 +15770=璇疯緭鍏ユ埧闂村悕绉� +15771=缂栬緫鎴块棿 +15772=鑾峰彇涓�... +15773=瀛樺湪闈炴硶瀛楃銆寋0}銆� ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� @@ -1271,4 +1621,7 @@ 40007=涓户鍣� 40008=鏅鸿兘绌烘皵寮�鍏� 40009=杞崲鍣� -40010=褰╃伅 \ No newline at end of file +40010=褰╃伅 +40011=娓╂箍搴︿紶鎰熷櫒 +40012=娓╁害浼犳劅鍣� +40013=婀垮害浼犳劅鍣� \ No newline at end of file diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Add.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Add.png new file mode 100755 index 0000000..c596b06 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Add.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Height.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Height.png new file mode 100755 index 0000000..6b09160 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Height.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_HeightSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_HeightSelected.png new file mode 100755 index 0000000..dd66ddc --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_HeightSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Low.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Low.png new file mode 100755 index 0000000..a7ae468 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Low.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_LowSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_LowSelected.png new file mode 100755 index 0000000..a585d48 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_LowSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Middle.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Middle.png new file mode 100755 index 0000000..5d5529d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_Middle.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_MiddleSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_MiddleSelected.png new file mode 100755 index 0000000..96d4996 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Fan_MiddleSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Group.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Group.png new file mode 100755 index 0000000..2a6f496 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Group.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Auto.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Auto.png new file mode 100755 index 0000000..4a17ddf --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Auto.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_AutoSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_AutoSelected.png new file mode 100755 index 0000000..9a59143 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_AutoSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool.png new file mode 100755 index 0000000..e04029d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_CoolSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_CoolSelected.png new file mode 100755 index 0000000..d711092 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_CoolSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry.png new file mode 100755 index 0000000..cd3fb43 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_DrySelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_DrySelected.png new file mode 100755 index 0000000..bd97d12 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_DrySelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan.png new file mode 100755 index 0000000..3b73991 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_FanSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_FanSelected.png new file mode 100755 index 0000000..bea1abe --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_FanSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat.png new file mode 100755 index 0000000..4dd5e84 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_HeatSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_HeatSelected.png new file mode 100755 index 0000000..b5a6bec --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_HeatSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrClose.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrClose.png new file mode 100755 index 0000000..39f3349 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrClose.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrCloseSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrCloseSelected.png new file mode 100755 index 0000000..c5a8f2e --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/OpenOrCloseSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Path.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Path.png new file mode 100755 index 0000000..a6fa10d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Path.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Reduce.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Reduce.png new file mode 100755 index 0000000..65025e5 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Reduce.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedFanModeBG.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedFanModeBG.png new file mode 100755 index 0000000..a38f491 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedFanModeBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedModeBG.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedModeBG.png new file mode 100755 index 0000000..5331bb2 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/SelectedModeBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Account.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Account.png new file mode 100755 index 0000000..3bdf8ff --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Account.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cancle.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cancle.png new file mode 100755 index 0000000..12cf4e6 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cancle.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cat.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cat.png new file mode 100755 index 0000000..6102e6d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Cat.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/ChangeSuccess.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/ChangeSuccess.png new file mode 100755 index 0000000..3ca69c5 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/ChangeSuccess.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Code.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Code.png new file mode 100755 index 0000000..8cc4084 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Code.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/HidePwd.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/HidePwd.png new file mode 100755 index 0000000..151240e --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/HidePwd.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_White.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_White.png new file mode 100755 index 0000000..c3e55ce --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_White.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_loginBG.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_loginBG.png new file mode 100755 index 0000000..8ae797d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Logo_loginBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Password.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Password.png new file mode 100755 index 0000000..188d771 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/Password.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/PhoneEmail_White.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/PhoneEmail_White.png new file mode 100755 index 0000000..14f8595 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/PhoneEmail_White.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/UnhidePwd.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/UnhidePwd.png new file mode 100755 index 0000000..83c9817 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Account/UnhidePwd.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindAdd.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindAdd.png new file mode 100755 index 0000000..fd17653 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindAdd.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindDown.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindDown.png new file mode 100755 index 0000000..7e53f26 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindDown.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindEmptyPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindEmptyPic.png new file mode 100755 index 0000000..7eac49c --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindEmptyPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindLeft.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindLeft.png new file mode 100755 index 0000000..ffbe7c4 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindLeft.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRight.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRight.png new file mode 100755 index 0000000..589f57f --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRight.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/ColorDimmableLight.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/ColorDimmableLight.png deleted file mode 100755 index 5f7e024..0000000 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/ColorDimmableLight.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/ColorLight.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/ColorLight.png new file mode 100755 index 0000000..ad8aa4b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/ColorLight.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Light.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Light.png new file mode 100755 index 0000000..ad8aa4b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Light.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Sensor.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Sensor.png index ad9e3b4..3378eb3 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Sensor.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Sensor.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorHumidity.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorHumidity.png new file mode 100755 index 0000000..6a57353 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorHumidity.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorTemperature.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorTemperature.png new file mode 100755 index 0000000..dc6aba3 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/SensorTemperature.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Socket1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Socket1.png new file mode 100755 index 0000000..651eb85 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Socket1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Switch.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Switch.png new file mode 100755 index 0000000..5e8f7c0 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/Switch.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFailedPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFailedPic.png new file mode 100755 index 0000000..aa37ea7 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFailedPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFingerprintTipPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFingerprintTipPic.png new file mode 100755 index 0000000..7f809fc --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddFingerprintTipPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcCardTipPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcCardTipPic.png new file mode 100755 index 0000000..c89a0b4 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcCardTipPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcon.png new file mode 100755 index 0000000..07f1000 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddPasswordTicPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddPasswordTicPic.png new file mode 100755 index 0000000..7a666a4 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AddPasswordTicPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethod.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethod.png new file mode 100755 index 0000000..c9688e1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethod.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodIcon.png new file mode 100755 index 0000000..7e53f26 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodOn.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodOn.png new file mode 100755 index 0000000..30cc925 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/AllMethodOn.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/CancelIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/CancelIcon.png new file mode 100755 index 0000000..abfc2c0 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/CancelIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DateIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DateIcon.png new file mode 100755 index 0000000..221bbb1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DateIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DelIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DelIcon.png new file mode 100755 index 0000000..5f45ebf --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DelIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DistributeUnlockIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DistributeUnlockIcon.png new file mode 100755 index 0000000..5692b8e --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DistributeUnlockIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DooorLockPicOpen.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DooorLockPicOpen.png new file mode 100755 index 0000000..7469d40 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DooorLockPicOpen.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockClose.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockClose.png new file mode 100755 index 0000000..668b646 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockClose.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockOpen.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockOpen.png new file mode 100755 index 0000000..b2b7c5d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockOpen.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockPicClose.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockPicClose.png new file mode 100755 index 0000000..f6b64d5 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockPicClose.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockUserPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockUserPic.png new file mode 100755 index 0000000..3a162ec --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorLockUserPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockIcon.png new file mode 100755 index 0000000..25a2697 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockPicture.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockPicture.png new file mode 100755 index 0000000..98a63e5 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/DoorlockPicture.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/EntrySuccessIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/EntrySuccessIcon.png new file mode 100755 index 0000000..33d0daf --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/EntrySuccessIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FavoriteIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FavoriteIcon.png new file mode 100755 index 0000000..2e5fcba --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FavoriteIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint.png new file mode 100755 index 0000000..e55a6e7 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint207.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint207.png new file mode 100755 index 0000000..9ee41f5 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Fingerprint207.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FingerprintOn.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FingerprintOn.png new file mode 100755 index 0000000..d8cdf86 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/FingerprintOn.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Left.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Left.png new file mode 100755 index 0000000..3a08fd1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Left.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/MemberIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/MemberIcon.png new file mode 100755 index 0000000..dce2ae3 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/MemberIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Password.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Password.png new file mode 100755 index 0000000..f104971 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Password.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/PasswordOn.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/PasswordOn.png new file mode 100755 index 0000000..f2473d3 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/PasswordOn.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RecordIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RecordIcon.png new file mode 100755 index 0000000..cb56164 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RecordIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RemoteUnlockIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RemoteUnlockIcon.png new file mode 100755 index 0000000..7193bd2 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RemoteUnlockIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RightIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RightIcon.png new file mode 100755 index 0000000..533e49d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RightIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RoomPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RoomPic.png new file mode 100755 index 0000000..95783ee --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/RoomPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Tick.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SelectedIcon.png similarity index 100% copy from ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Tick.png copy to ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SelectedIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SettingIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SettingIcon.png new file mode 100755 index 0000000..104a3b7 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SettingIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/ShareIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/ShareIcon.png new file mode 100755 index 0000000..acb7f18 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/ShareIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SideslipPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SideslipPic.png new file mode 100755 index 0000000..69068be --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SideslipPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Switch.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Switch.png new file mode 100755 index 0000000..3257b9d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/Switch.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SwitchOn.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SwitchOn.png new file mode 100755 index 0000000..12ec341 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/SwitchOn.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TemPasswordVisiable.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TemPasswordVisiable.png new file mode 100755 index 0000000..e73cdbb --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TemPasswordVisiable.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground.png new file mode 100755 index 0000000..af7e525 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground1.png new file mode 100755 index 0000000..2df2784 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TempPasswordBackground1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TypeIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TypeIcon.png new file mode 100755 index 0000000..40c4dbc --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/TypeIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockBlankPic.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockBlankPic.png new file mode 100755 index 0000000..c735817 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockBlankPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockButton.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockButton.png new file mode 100755 index 0000000..b58ff56 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockButton.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockSideslipIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockSideslipIcon.png new file mode 100755 index 0000000..95b81bc --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnLockSideslipIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UndistributeIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UndistributeIcon.png new file mode 100755 index 0000000..d811b52 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UndistributeIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockFailed.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockFailed.png new file mode 100755 index 0000000..ef9c6ce --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockFailed.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockSuccess.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockSuccess.png new file mode 100755 index 0000000..ddd27f9 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnlockSuccess.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnselectedIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnselectedIcon.png new file mode 100755 index 0000000..b12f7c8 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/UnselectedIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/VisitorIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/VisitorIcon.png new file mode 100755 index 0000000..f1d57cf --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/VisitorIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCard.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCard.png new file mode 100755 index 0000000..176544d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCard.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCardOn.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCardOn.png new file mode 100755 index 0000000..770da1a --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/DoorLock/proximityCardOn.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/Floor.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/Floor.png new file mode 100755 index 0000000..4cba57b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/Floor.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/FloorSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/FloorSelected.png new file mode 100755 index 0000000..73c8ef7 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Floor/FloorSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10Icon.png new file mode 100755 index 0000000..31b4257 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10IconSelected.png new file mode 100755 index 0000000..8430524 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/10IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11Icon.png new file mode 100755 index 0000000..0c0b4ee --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11IconSelected.png new file mode 100755 index 0000000..2d565dc --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/11IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12Icon.png new file mode 100755 index 0000000..841ed27 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12IconSelected.png new file mode 100755 index 0000000..f0abca5 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/12IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13Icon.png new file mode 100755 index 0000000..f2b75da --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13IconSelected.png new file mode 100755 index 0000000..2228105 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/13IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14Icon.png new file mode 100755 index 0000000..94450ff --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14IconSelected.png new file mode 100755 index 0000000..e2bd3c4 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/14IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15Icon.png new file mode 100755 index 0000000..a749360 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15IconSelected.png new file mode 100755 index 0000000..4faa3e1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/15IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16Icon.png new file mode 100755 index 0000000..e652a11 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16IconSelected.png new file mode 100755 index 0000000..01699e8 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/16IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17Icon.png new file mode 100755 index 0000000..b20c8b8 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17IconSelected.png new file mode 100755 index 0000000..5dcb7f2 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/17IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18Icon.png new file mode 100755 index 0000000..39a1287 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18IconSelected.png new file mode 100755 index 0000000..4ea13da --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/18IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19Icon.png new file mode 100755 index 0000000..c6dad69 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19IconSelected.png new file mode 100755 index 0000000..208edca --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/19IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1Icon.png new file mode 100755 index 0000000..28ac0a9 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1IconSelected.png new file mode 100755 index 0000000..ac6ce6c --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/1IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20Icon.png new file mode 100755 index 0000000..d18c088 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20IconSelected.png new file mode 100755 index 0000000..e9d54d9 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/20IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2Icon.png new file mode 100755 index 0000000..59a5ad9 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png new file mode 100755 index 0000000..2228105 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3Icon.png new file mode 100755 index 0000000..e19bb68 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3IconSelected.png new file mode 100755 index 0000000..9be55b9 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/3IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4Icon.png new file mode 100755 index 0000000..7d4c142 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4IconSelected.png new file mode 100755 index 0000000..bd02961 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/4IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5Icon.png new file mode 100755 index 0000000..aa55690 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5IconSelected.png new file mode 100755 index 0000000..3f9b64a --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/5IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6Icon.png new file mode 100755 index 0000000..92c63e4 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6IconSelected.png new file mode 100755 index 0000000..b48c0fd --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/6IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7Icon.png new file mode 100755 index 0000000..48a6e27 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7IconSelected.png new file mode 100755 index 0000000..2a26207 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/7IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8Icon.png new file mode 100755 index 0000000..4a3bbef --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8IconSelected.png new file mode 100755 index 0000000..d11557c --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/8IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9Icon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9Icon.png new file mode 100755 index 0000000..f178284 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9Icon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9IconSelected.png new file mode 100755 index 0000000..f095bfb --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/9IconSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add.png index d5e7020..f0015f4 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_Category.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_Category.png new file mode 100755 index 0000000..5f4ee2b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_Category.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_GW.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_GW.png new file mode 100755 index 0000000..bb9f0ce --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Add_GW.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/BottomShadow.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/BottomShadow.png new file mode 100755 index 0000000..324b82b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/BottomShadow.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CancelIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CancelIcon.png index 7a253f3..cd0c3c0 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CancelIcon.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CancelIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBG.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBG.png new file mode 100755 index 0000000..7536d05 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBGSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBGSelected.png new file mode 100755 index 0000000..99f144c --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Category_FunctionBGSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection.png new file mode 100755 index 0000000..c9a2216 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection1.png new file mode 100755 index 0000000..b4a9280 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Collection1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected.png new file mode 100755 index 0000000..a824a59 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected1.png new file mode 100755 index 0000000..736f6b6 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CollectionSelected1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Drop_Down.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Drop_Down.png new file mode 100755 index 0000000..f63c83d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Drop_Down.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Floor.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Floor.png new file mode 100755 index 0000000..ca17beb --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Floor.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardView.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardView.png new file mode 100755 index 0000000..0544d02 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardView.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardViewSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardViewSelected.png new file mode 100755 index 0000000..514aa16 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionCardViewSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionViewBG.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionViewBG.png new file mode 100755 index 0000000..7146bd1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/FunctionViewBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/House.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/House.png new file mode 100755 index 0000000..672e29e --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/House.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/HouseSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/HouseSelected.png new file mode 100755 index 0000000..17166f3 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/HouseSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Tick.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/ItemSelected.png similarity index 100% rename from ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Tick.png rename to ZigbeeApp/GateWay.Ios/Resources/Phone/Item/ItemSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoBindGW.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoBindGW.png new file mode 100755 index 0000000..88471d6 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoBindGW.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoFunction.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoFunction.png new file mode 100755 index 0000000..a753c6e --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/NoFunction.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/ResidenceIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/ResidenceIcon.png new file mode 100755 index 0000000..4a04aff --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/ResidenceIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Room.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Room.png new file mode 100755 index 0000000..29ca85f --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Room.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png new file mode 100755 index 0000000..c107a1e --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneCard.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneCard.png new file mode 100755 index 0000000..e969de5 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneCard.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneFunctionBG.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneFunctionBG.png new file mode 100755 index 0000000..1e84a9f --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SceneFunctionBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectFloor_Left.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectFloor_Left.png new file mode 100755 index 0000000..423eaa1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectFloor_Left.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectHouse.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectHouse.png new file mode 100755 index 0000000..044b782 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SelectHouse.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch.png index 7193bd2..39f3349 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch1.png new file mode 100755 index 0000000..b2ffd07 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2.png new file mode 100755 index 0000000..7193bd2 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2Selected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2Selected.png new file mode 100755 index 0000000..04e4419 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Switch2Selected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected.png index 04e4419..c5a8f2e 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected1.png new file mode 100755 index 0000000..ebd4ee1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/SwitchSelected1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Time.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Time.png new file mode 100755 index 0000000..12858c0 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/Time.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/VirtualFrame.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/VirtualFrame.png new file mode 100755 index 0000000..70c76a3 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/VirtualFrame.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Logo/Logo.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Logo/Logo.png new file mode 100755 index 0000000..232eeea --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Logo/Logo.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Category.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Category.png index b97b8bc..c2b849e 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Category.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Category.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/CategorySelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/CategorySelected.png index 5d3db54..af4059d 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/CategorySelected.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/CategorySelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Home.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Home.png index 775ac06..c50a0ab 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Home.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Home.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/HomeSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/HomeSelected.png index 15999ad..b4f3f86 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/HomeSelected.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/HomeSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Setting.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Setting.png index 3f4e259..ceb5bd0 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Setting.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/Setting.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/SettingSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/SettingSelected.png index f9fd0c3..5c87920 100755 --- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/SettingSelected.png +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Navigation/SettingSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/RealDevice/CommonDevice.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/RealDevice/CommonDevice.png new file mode 100755 index 0000000..c812167 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/RealDevice/CommonDevice.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/HomeBG.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/HomeBG.png new file mode 100755 index 0000000..cd4994b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/HomeBG.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView.png new file mode 100755 index 0000000..1bcf913 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView_Name.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView_Name.png new file mode 100755 index 0000000..7ec7f26 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/RoomCardView_Name.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/Room_Rectangle.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/Room_Rectangle.png new file mode 100755 index 0000000..17ea24b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/Room_Rectangle.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r0.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r0.png new file mode 100755 index 0000000..48934fc --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r0.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r1.png new file mode 100755 index 0000000..a2de21f --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r10.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r10.png new file mode 100755 index 0000000..d413f1a --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r10.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r11.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r11.png new file mode 100755 index 0000000..4dbf445 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r11.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r12.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r12.png new file mode 100755 index 0000000..462e0c8 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r12.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r13.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r13.png new file mode 100755 index 0000000..9bdc9aa --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r13.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r14.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r14.png new file mode 100755 index 0000000..dbfdb30 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r14.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r15.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r15.png new file mode 100755 index 0000000..0b447de --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r15.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r16.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r16.png new file mode 100755 index 0000000..de1c4ed --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r16.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r17.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r17.png new file mode 100755 index 0000000..a541cd1 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r17.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r18.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r18.png new file mode 100755 index 0000000..f7cffea --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r18.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r19.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r19.png new file mode 100755 index 0000000..de439f4 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r19.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r2.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r2.png new file mode 100755 index 0000000..8d6c085 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r2.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r20.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r20.png new file mode 100755 index 0000000..c3fa6b9 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r20.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r21.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r21.png new file mode 100755 index 0000000..7a93d5b --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r21.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r22.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r22.png new file mode 100755 index 0000000..25f6057 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r22.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r23.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r23.png new file mode 100755 index 0000000..7e3e441 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r23.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r24.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r24.png new file mode 100755 index 0000000..af9d1d8 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r24.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r3.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r3.png new file mode 100755 index 0000000..5386ba8 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r3.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r4.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r4.png new file mode 100755 index 0000000..32fabae --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r4.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r5.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r5.png new file mode 100755 index 0000000..346bde6 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r5.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r6.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r6.png new file mode 100755 index 0000000..d16c81c --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r6.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r7.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r7.png new file mode 100755 index 0000000..cccf7ac --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r7.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r8.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r8.png new file mode 100755 index 0000000..24ea738 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r8.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r9.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r9.png new file mode 100755 index 0000000..53a4c4d --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Room/r9.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/1.png new file mode 100755 index 0000000..bde3463 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/2.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/2.png new file mode 100755 index 0000000..e40bf4f --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/2.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/3.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/3.png new file mode 100755 index 0000000..928aa7c --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/3.png Binary files differ diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/4.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/4.png new file mode 100755 index 0000000..f495627 --- /dev/null +++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/SceneIcon/4.png Binary files differ diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs index 7b123ae..8f0dc65 100755 --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -44,9 +44,13 @@ get { var list = new List<CommonDevice>(); - foreach (var device in dicAllDevice.Values) + foreach (var listMac in this.dicDeviceSort.Values) { - list.Add(device); + foreach (var strMac in listMac) + { + var listTemp = this.GetDevicesByMac(strMac); + list.AddRange(listTemp); + } } return list; } @@ -81,13 +85,13 @@ /// </summary> private Dictionary<string, HashSet<int>> dicDeviceEpoint = new Dictionary<string, HashSet<int>>(); /// <summary> + /// 璁惧Mac椤哄簭 + /// </summary> + private Dictionary<string, List<string>> dicDeviceSort = null; + /// <summary> /// 璁惧鏂囦欢鐨勫墠缂�鍚嶅瓧 /// </summary> public const string deviceFirstName = "Device_"; - /// <summary> - /// 閿� - /// </summary> - private object objLock = new object(); #endregion @@ -99,7 +103,7 @@ public void ReFreshByLocal() { this.dicAllDevice.Clear(); - this.dicDeviceEpoint.Clear(); + this.dicDeviceEpoint.Clear(); //鍒濆鍖朢鏂囦欢閲岄潰璁惧榛樿鍚嶅瓧鐨処D this.InitDeviceDefultNameIDList(); @@ -171,7 +175,9 @@ } } //鎴愬憳韬唤鐨勬椂鍊�,鍒犻櫎鎺夐潪娉曠殑缃戝叧鏂囦欢 - this.DeleteGatewayFileByMemberModel(); + this.DeleteGatewayFileByMemberModel(); + //鍒濆鍖栬澶囬『搴� + this.InitDeviceSort(); } /// <summary> @@ -184,11 +190,15 @@ return; } var listId = new HashSet<string>(); - foreach (var device in this.dicAllDevice.Values) + + lock (dicAllDevice) { - if (listId.Contains(device.CurrentGateWayId) == false) + foreach (var device in this.dicAllDevice.Values) { - listId.Add(device.CurrentGateWayId); + if (listId.Contains(device.CurrentGateWayId) == false) + { + listId.Add(device.CurrentGateWayId); + } } } var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); @@ -217,7 +227,7 @@ { //浠庣綉鍏宠幏鍙栧叏閮ㄧ殑璁惧 List<CommonDevice> listDevice = new List<CommonDevice>(); - List<CommonDevice> list = await this.GetDeviceListFromGateway(zbGateway, deviceComingAction); + List<CommonDevice> list = await this.GetDeviceListFromGateway(zbGateway, true, deviceComingAction); if (list == null) { @@ -302,6 +312,16 @@ /// <param name="device">璁惧瀵硅薄(杩欎釜涓滆タ鏈夊彲鑳戒細琚洿鏀�)</param> public void AddDeviceToMemory(ref CommonDevice device) { + if (dicDeviceSort.ContainsKey(device.CurrentGateWayId) == false) + { + dicDeviceSort[device.CurrentGateWayId] = new List<string>(); + } + if (dicDeviceSort[device.CurrentGateWayId].Contains(device.DeviceAddr) == false) + { + //淇濆瓨椤哄簭 + dicDeviceSort[device.CurrentGateWayId].Add(device.DeviceAddr); + UserCenterLogic.SaveFileContent(UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile), dicDeviceSort); + } string mainKeys = this.GetDeviceMainKeys(device); //濡傛灉瀹冩槸鍗囩骇鐨勯《绔鐐�,鍒欎笉鑳借瀹冨姞鍏ュ埌缂撳瓨锛屼絾鏄彲浠ヨ浠栫敓鎴愭枃浠� if (device is OTADevice) @@ -329,17 +349,20 @@ return; } - if (this.dicAllDevice.ContainsKey(mainKeys) == true) + lock (dicAllDevice) { - //浜ゆ崲灞炴�� - var tempDevice = this.dicAllDevice[mainKeys]; - //灏咲eviceInfo鐨勫睘鎬ц缃埌涓诲睘鎬т腑 - this.SetDeviceInfoToMain(tempDevice, device); - device = tempDevice; - } - else - { - this.dicAllDevice[mainKeys] = device; + if (this.dicAllDevice.ContainsKey(mainKeys) == true) + { + //浜ゆ崲灞炴�� + var tempDevice = this.dicAllDevice[mainKeys]; + //灏咲eviceInfo鐨勫睘鎬ц缃埌涓诲睘鎬т腑 + this.SetDeviceInfoToMain(tempDevice, device); + device = tempDevice; + } + else + { + this.dicAllDevice[mainKeys] = device; + } } //璁惧鍥炶矾鏀堕泦 @@ -456,16 +479,19 @@ /// <param name="device"></param> private void BackupDeviceAfterReName(CommonDevice device) { - string mainKeys = this.GetDeviceMainKeys(device); - if (this.dicAllDevice.ContainsKey(mainKeys) == false) + lock (dicAllDevice) { - return; - } - this.dicAllDevice[mainKeys] = device; - device.ReSave(); + string mainKeys = this.GetDeviceMainKeys(device); + if (this.dicAllDevice.ContainsKey(mainKeys) == false) + { + return; + } + this.dicAllDevice[mainKeys] = device; + device.ReSave(); - //娣诲姞鑷姩澶囦唤 - HdlAutoBackupLogic.AddOrEditorFile(device.FilePath); + //娣诲姞鑷姩澶囦唤 + HdlAutoBackupLogic.AddOrEditorFile(device.FilePath); + } } #endregion @@ -495,6 +521,13 @@ this.ShowErrorMsg(msg); return false; } + if (dicDeviceSort.ContainsKey(listdevice[0].CurrentGateWayId) == true && + dicDeviceSort[listdevice[0].CurrentGateWayId].Contains(info.DeviceAddr) == true) + { + //淇濆瓨椤哄簭 + dicDeviceSort[listdevice[0].CurrentGateWayId].Remove(info.DeviceAddr); + UserCenterLogic.SaveFileContent(UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile), dicDeviceSort); + } //鍒犻櫎鏂囦欢 foreach (CommonDevice device in listdevice) @@ -513,9 +546,12 @@ { //鍒犻櫎缂撳瓨 string mainKeys = this.GetDeviceMainKeys(device); - if (this.dicAllDevice.ContainsKey(mainKeys) == true) + lock (dicAllDevice) { - this.dicAllDevice.Remove(mainKeys); + if (this.dicAllDevice.ContainsKey(mainKeys) == true) + { + this.dicAllDevice.Remove(mainKeys); + } } //鍒犻櫎璁惧鏂囦欢 @@ -645,13 +681,34 @@ public List<CommonDevice> GetDeviceByGatewayID(string gwId) { List<CommonDevice> list = new List<CommonDevice>(); - //鍚勭綉鍏崇殑鎵�鏈夎澶� - foreach (CommonDevice device in this.dicAllDevice.Values) + lock (dicAllDevice) { - if (gwId == device.CurrentGateWayId) + List<string> listSort = null; + if (dicDeviceSort.ContainsKey(gwId) == false) { - list.Add(device); + dicDeviceSort[gwId] = new List<string>(); } + listSort = dicDeviceSort[gwId]; + + //鍚勭綉鍏崇殑鎵�鏈夎澶� + foreach (CommonDevice device in this.dicAllDevice.Values) + { + if (gwId == device.CurrentGateWayId) + { + if (listSort.Contains(device.DeviceAddr) == false) + { + listSort.Add(device.DeviceAddr); + } + } + } + //鎺掑簭 + foreach (var strMac in listSort) + { + var listTemp = this.GetDevicesByMac(strMac); + list.AddRange(listTemp); + } + //淇濆瓨椤哄簭 + UserCenterLogic.SaveFileContent(UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile), dicDeviceSort); } return list; @@ -664,9 +721,12 @@ /// <returns></returns> public CommonDevice GetDevice(string mainKeys) { - if (this.dicAllDevice.ContainsKey(mainKeys) == true) + lock (dicAllDevice) { - return this.dicAllDevice[mainKeys]; + if (this.dicAllDevice.ContainsKey(mainKeys) == true) + { + return this.dicAllDevice[mainKeys]; + } } return null; } @@ -1293,7 +1353,7 @@ { info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId9; info.BeloneType = DeviceBeloneType.A褰╃伅; - info.ConcreteType = DeviceConcreteType.ColorDimmableLight; + info.ConcreteType = DeviceConcreteType.ColorLight; } //8绌鸿皟 else if (dicType.ContainsKey(DeviceType.Thermostat) == true) @@ -1454,94 +1514,72 @@ #region 鈻� 璁惧鎺掑簭___________________________ /// <summary> + /// 鍒濆鍖栬澶囬『搴� + /// </summary> + private void InitDeviceSort() + { + //璇诲彇璁惧椤哄簭 + this.dicDeviceSort = new Dictionary<string, List<string>>(); + string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DeviceSortFile); + var strData = UserCenterLogic.LoadFileContent(fullName); + if (strData != null) + { + this.dicDeviceSort = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(strData); + } + foreach (var device in dicAllDevice.Values) + { + if (dicDeviceSort.ContainsKey(device.CurrentGateWayId) == false) + { + dicDeviceSort[device.CurrentGateWayId] = new List<string>(); + } + if (dicDeviceSort[device.CurrentGateWayId].Contains(device.DeviceAddr) == false) + { + //鏂版坊鍔犵殑璁惧 + dicDeviceSort[device.CurrentGateWayId].Add(device.DeviceAddr); + } + } + foreach (var keys in dicDeviceSort.Keys) + { + var list = dicDeviceSort[keys]; + for (int i = 0; i < list.Count; i++) + { + if (this.dicDeviceEpoint.ContainsKey(list[i]) == false) + { + //杩欎釜涓滆タ鑾悕鐨勪笉瑙佷簡锛熷拰璁惧鍒楄〃鍖归厤涓嶄笂? + list.RemoveAt(i); + i--; + } + } + } + + //淇濆瓨椤哄簭 + UserCenterLogic.SaveFileContent(fullName, dicDeviceEpoint); + } + + /// <summary> /// 璁惧鎺掑簭 /// </summary> - /// <param name="listDevice">璁惧瀵硅薄</param> + /// <param name="listDevice">闇�瑕佹帓搴忕殑璁惧鍒楄〃</param> /// <returns></returns> - public List<CommonDevice> SortDeviceList(List<CommonDevice> listDevice) + public List<CommonDevice> SortDevice(List<CommonDevice> listDevice) { - List<CommonDevice> listSort = new List<CommonDevice>(); - var list = this.SortDeviceListByRule(listDevice); - listSort.AddRange(list); - - return listSort; - } - - /// <summary> - /// - /// </summary> - /// <param name="listDevice">璁惧瀵硅薄</param> - /// <returns></returns> - private List<CommonDevice> SortDeviceListByRule(List<CommonDevice> listDevice) - { - //璁惧鎺掑簭鐨勮鍒�(Keys锛氳澶囩被鍨�(DeviceType) value锛氬瓨鏀捐澶囩殑瀹瑰櫒) - var dic = this.GetDeviceSortRule(); - foreach (CommonDevice device in listDevice) + var dic = new Dictionary<string, CommonDevice>(); + for (int i = 0; i < listDevice.Count; i++) { - if (device is IASZone) + dic[(this.GetDeviceMainKeys(listDevice[i]))] = listDevice[i]; + } + var list = new List<CommonDevice>(); + foreach (var listSort in this.dicDeviceSort.Values) + { + for (int i = 0; i < listSort.Count; i++) { - //浼犳劅鍣ㄦ湁寰堝绉� - var strType = ((IASZone)device).DeviceInfo.DeviceType.ToString(); - if (dic.ContainsKey(strType) == false || dic[strType] == null) + if (dic.ContainsKey(listSort[i]) == true) { - dic[strType] = new List<CommonDevice>(); + list.Add(dic[listSort[i]]); } - dic[strType].Add(device); - continue; - } - string checkKeys = device.Type.ToString(); - if (dic.ContainsKey(checkKeys) == false || dic[checkKeys] == null) - { - dic[checkKeys] = new List<CommonDevice>(); - } - dic[checkKeys].Add(device); - } - - List<CommonDevice> lstSort = new List<CommonDevice>(); - foreach (var list in dic.Values) - { - if (list != null && list.Count > 0) - { - lstSort.AddRange(list); } } - return lstSort; - } - - /// <summary> - /// 鑾峰彇璁惧鎺掑簭鐨勮鍒�(Keys锛氳澶囩被鍨�(DeviceType) value锛氬瓨鏀捐澶囩殑瀹瑰櫒) - /// </summary> - /// <returns></returns> - private Dictionary<string, List<CommonDevice>> GetDeviceSortRule() - { - var dic = new Dictionary<string, List<CommonDevice>>(); - //鎺у埗闈㈡澘 - dic[DeviceType.OnOffSwitch.ToString()] = null; - //鍗峰笜 - dic[DeviceType.WindowCoveringDevice.ToString()] = null; - //璋冨厜鐏� - dic[DeviceType.ColorDimmableLight.ToString()] = null; - //缁х數鍣� - dic[DeviceType.OnOffOutput.ToString()] = null; - //绌烘皵寮�鍏� - dic[DeviceType.AirSwitch.ToString()] = null; - //闂ㄧ獥纾佷紶鎰熷櫒 - dic["21"] = null; - dic["22"] = null; - //姘存蹈浼犳劅鍣� - dic["42"] = null; - //鐑熼浘浼犳劅鍣� - dic["40"] = null; - //绱ф�ユ寜閽� - dic["44"] = null; - //鐕冩皵浼犳劅鍣� - dic["43"] = null; - //杩愬姩浼犳劅鍣� - dic["13"] = null; - //閽ュ寵鎵� - dic["277"] = null; - - return dic; + return list; } #endregion @@ -1647,14 +1685,40 @@ #region 鈻� 鑾峰彇璁惧鍒楄〃鐨勬帴鍙________________ /// <summary> - /// 浠庣綉鍏抽噸鏂拌幏鍙栬澶囧垪琛�(鈽呪槄鈽呪槄鈽呪槄鈽呮帴鏀跺埌璁惧鏃剁殑浜嬩欢,璁惧瀵硅薄涓簄ull鏃�,浠h〃鎺ユ敹瀹屾垚鈽呪槄鈽呪槄鈽呪槄鈽�) + /// 浠庣綉鍏抽噸鏂拌幏鍙栬澶囧垪琛�(鈽呪槄鈽呪槄鈽呪槄鈽呮帴鏀跺埌璁惧鏃剁殑浜嬩欢鈽呪槄鈽呪槄鈽呪槄鈽�) /// </summary> /// <param name="zbGateway">缃戝叧瀵硅薄</param> - /// <param name="deviceComingAction">鎺ユ敹鍒拌澶囨椂鐨勪簨浠�,璁惧瀵硅薄涓簄ull鏃�,浠h〃鎺ユ敹瀹屾垚</param> + /// <param name="ignoreTime">鏄惁鏃犺鏃堕棿,true:姣忔璋冪敤閮藉幓缃戝叧鑾峰彇,false:3鍒嗛挓鍐呰繑鍥炵殑鏄湰鍦扮殑璁惧</param> + /// <param name="deviceComingAction">鎺ユ敹鍒拌澶囨椂鐨勪簨浠�</param> /// <param name="mode">鏄惁鏄剧ず閿欒</param> /// <returns></returns> - public async Task<List<CommonDevice>> GetDeviceListFromGateway(ZbGateway zbGateway, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES) + public async Task<List<CommonDevice>> GetDeviceListFromGateway(ZbGateway zbGateway, bool ignoreTime, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES) { + if (ignoreTime == false) + { + if ((DateTime.Now - zbGateway.LastDateTime).TotalMilliseconds < 3 * 60 * 1000) + { + //涓嶆棤瑙嗘椂闂�,杩斿洖鏈湴璁惧鍒楄〃 + var listTemp = this.GetDeviceByGatewayID(HdlGatewayLogic.Current.GetGatewayId(zbGateway)); + if (deviceComingAction != null) + { + for (int i = 0; i < listTemp.Count; i++) + { + try + { + //鍥炶皟鍑芥暟 + deviceComingAction.Invoke(listTemp[i]); + } + //Log鍑哄姏 + catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); } + } + } + deviceComingAction = null; + return listTemp; + } + } + zbGateway.LastDateTime = DateTime.Now; + //濡傛灉鍒囨崲鍒颁簡鍒殑鐣岄潰锛屽垯涓嶆樉绀洪敊璇俊鎭� string nowFormId = UserCenterResourse.NowActionFormID; @@ -1711,8 +1775,13 @@ var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, zbGateway); if (device != null) { - //鍥炶皟鍑芥暟 - deviceComingAction?.Invoke(device); + try + { + //鍥炶皟鍑芥暟 + deviceComingAction?.Invoke(device); + } + //Log鍑哄姏 + catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); } listDevice.Add(device); } @@ -1769,8 +1838,7 @@ } } - //鍥炶皟鍑芥暟(鎺ユ敹瀹屾垚) - deviceComingAction?.Invoke(null); + //鍥炶皟鍑芥暟(鎺ユ敹瀹屾垚) deviceComingAction = null; return listDevice; @@ -1837,6 +1905,7 @@ mainDevice.DriveCode = device.DeviceInfo.DriveCode; mainDevice.IasDeviceType = device.DeviceInfo.DeviceType; mainDevice.Profile = device.DeviceInfo.Profile; + mainDevice.Type = device.Type; //鍥轰欢鐗堟湰 mainDevice.ImgVersion = device.DeviceInfo.ImgVersion; @@ -1857,9 +1926,9 @@ mainDevice.OutClusterList.AddRange(device.DeviceInfo.OutClusterList); mainDevice.AttributeStatus.Clear(); mainDevice.AttributeStatus.AddRange(device.DeviceInfo.AttributeStatus); - + //濡傛灉鏄俯搴︿紶鎰熷櫒 - if (mainDevice is TemperatureSensor) + if (mainDevice.Type == DeviceType.TemperatureSensor) { //杈撳嚭鏃� 1026:娓╁害浼犳劅鍣� 1029:婀垮害浼犳劅鍣� foreach (var data in mainDevice.OutClusterList) @@ -1872,6 +1941,24 @@ { ((TemperatureSensor)mainDevice).SensorDiv = 1; } + } + } + //濡傛灉鏄皟鍏夊櫒 + else if (mainDevice.Type == DeviceType.DimmableLight ) + { + mainDevice.DfunctionType = DeviceFunctionType.A鐏厜; + if (mainDevice.IsCustomizeImage == false) + { + mainDevice.IconPath = "Device/Light.png"; + } + } + //濡傛灉鏄僵鐏殑璇� + else if ( mainDevice.Type == DeviceType.ColorDimmableLight) + { + mainDevice.DfunctionType = DeviceFunctionType.A鐏厜; + if (mainDevice.IsCustomizeImage == false) + { + mainDevice.IconPath = "Device/ColorLight.png"; } } } @@ -1998,4 +2085,266 @@ #endregion } + + #region 鈻� 鑷畾涔夎澶囩被鍨媉________________________ + + /// <summary> + /// <para>浠呴檺搴曞眰浣跨敤锛氳澶囩殑鍏蜂綋銆愯澶囩被鍨嬨��,鑷畾涔変笌妯″潡id鍏宠仈鐨勬灇涓�(鍊间负LocalDevice閲岄潰dicDeviceModelIdEnum鎵�鎸囧畾鐨勫��)</para> + /// <para>鍙橀噺鍚嶅彲浠ヤ綔涓恒�愯澶囩被鍨嬨�戝浘鐗�,杩欎釜鍊兼槸鐬庡啓鐨�,娌′粈涔堢壒娈婃剰涔�</para> + /// </summary> + public enum DeviceConcreteType + { + //瀹氫箟瑙勫垯锛氥�愯澶囩被鍨嬨�戝浘鐗囧悕瀛�=LocalDevice閲岄潰dicDeviceModelIdEnum鎵�鎸囧畾鐨勫�� + + /// <summary> + /// 鏈煡璁惧 + /// </summary> + UnKownDevice = -1, + + //=========鈽呪槄绐楀笜绫�(100-199)鈽呪槄========= + /// <summary> + /// 绐楀笜 + /// </summary> + Curtain = -100, + /// <summary> + /// 鏅鸿兘寮�鍚堝笜鐢垫満 闀滃儚id锛�100 + /// </summary> + Curtain_AutoOpen = 100, + /// <summary> + /// 鏅鸿兘绠$姸鐢垫満 闀滃儚id锛�101 + /// </summary> + Curtain_Siphonate = 101, + + //=========鈽呪槄鎸夐敭闈㈡澘绫�(200-1199)鈽呪槄========= + /// <summary> + /// 鎸夐敭闈㈡澘 + /// </summary> + ButtonPanel = -200, + /// <summary> + /// 4鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�4璺户鐢靛櫒搴曞骇) 闀滃儚id锛�200 + /// </summary> + ButtonPanel_Four = 200, + /// <summary> + /// 3鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�3璺户鐢靛櫒搴曞骇) 闀滃儚id锛�201 + /// </summary> + ButtonPanel_Three = 201, + /// <summary> + /// 2鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�2璺户鐢靛櫒搴曞骇) 闀滃儚id锛�202 + /// </summary> + ButtonPanel_Two = 202, + /// <summary> + /// 12鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�1璺户鐢靛櫒搴曞骇) 闀滃儚id锛�203 + /// </summary> + ButtonPanel_Twelve = 203, + /// <summary> + /// 4鎸夐敭澶氬姛鑳借Е鎽搁潰鏉匡紙鍙甫鐢垫簮搴曞骇锛� 闀滃儚id锛�210 + /// </summary> + ButtonPanel_FourNotPower = 210, + + //=========鈽呪槄PIR浼犳劅鍣ㄧ被(1200-1299)鈽呪槄========= + /// <summary> + /// 浼犳劅鍣� + /// </summary> + Sensor = -1200, + /// <summary> + /// pir浼犳劅鍣�220 闀滃儚id锛�1200 + /// </summary> + Sensor_Pir = 1200, + + //=========鈽呪槄瀹夐槻绫讳紶鎰熷櫒绫�(1300-2299)鈽呪槄========= + /// <summary> + /// 鐕冩皵浼犳劅鍣� + /// </summary> + Sensor_CarbonMonoxide = 1300, + /// <summary> + /// 闂ㄧ獥浼犳劅鍣� + /// </summary> + Sensor_DoorWindow = 1301, + /// <summary> + /// 鐑熼浘浼犳劅鍣� + /// </summary> + Sensor_Fire = 1302, + /// <summary> + /// 绾㈠浼犳劅鍣� + /// </summary> + Sensor_Infrared = 1303, + /// <summary> + /// 姘翠镜浼犳劅鍣� + /// </summary> + Sensor_Water = 1304, + /// <summary> + /// 绱ф�ユ寜閽� + /// </summary> + Sensor_EmergencyButton = 1305, + /// <summary> + /// 杩愬姩浼犳劅鍣� + /// </summary> + Sensor_Motion = -1306, + /// <summary> + /// 閽ュ寵鎵� + /// </summary> + Sensor_Keyfob = -1307, + /// <summary> + /// 娓╂箍搴︿紶鎰熷櫒 + /// </summary> + Sensor_TemperatrueHumidity = -1308, + /// <summary> + /// 娓╁害浼犳劅鍣� + /// </summary> + Sensor_Temperatrue = -1309, + /// <summary> + /// 婀垮害浼犳劅鍣� + /// </summary> + Sensor_Humidity = -1310, + + //=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄========= + /// <summary> + /// 缁х數鍣� + /// </summary> + Relay = -2300, + /// <summary> + /// 涓夎矾缁х數鍣� 闀滃儚id锛�2300 + /// </summary> + Relay_ThreeLoad = 2300, + + //=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄========= + /// <summary> + /// 璋冨厜鍣� + /// </summary> + DimmableLight = -2500, + /// <summary> + /// 1璺皟鍏夊櫒灏忔ā鍧� + /// </summary> + DimmableLight_OneLoad = 2500, + + //=========鈽呪槄鏅鸿兘闂ㄩ攣绫�(2800-????)鈽呪槄========= + /// <summary> + /// 鏅鸿兘闂ㄩ攣 + /// </summary> + IntelligentLocks = -2800, + /// <summary> + /// H06C + /// </summary> + IntelligentLocks_H06C = 2800, + + //=========鈽呪槄褰╃伅绫�(????-????)鈽呪槄========= + /// <summary> + /// 褰╃伅 + /// </summary> + ColorLight = -10, + + //=========鈽呪槄绌鸿皟(3600-3899)鈽呪槄========= + /// <summary> + /// 绌鸿皟 + /// </summary> + AirConditioner = -3600, + /// <summary> + /// zigbee绌鸿皟缃戝叧妯″潡 + /// </summary> + AirConditioner_ZbGateway = 3600, + + //=========鈽呪槄涓户鍣�(3900-3999)鈽呪槄========= + /// <summary> + /// 涓户鍣� + /// </summary> + Repeater = -3900, + /// <summary> + /// zigbee涓户鍣� 闀滃儚id锛�3900 + /// </summary> + Repeater_Zigbee = 3900, + + //=========鈽呪槄绌烘皵寮�鍏崇被(4100-????)鈽呪槄========= + /// <summary> + /// 鏅鸿兘绌烘皵寮�鍏� + /// </summary> + AirSwitch = -4100, + /// <summary> + /// 寰柇浜戞帶鍒跺櫒 闀滃儚id锛�4100 + /// </summary> + AirSwitch_CloudContr = 4100, + + //=========鈽呪槄杞崲鍣ㄧ被(4200-4699)鈽呪槄========= + /// <summary> + /// 杞崲鍣� + /// </summary> + Converter = -4200, + /// <summary> + /// zigbee杞�485鍗忚杞崲鍣� + /// </summary> + Converter_Zb485 = 4200, + /// <summary> + /// zigbee杞琤uspro鍗忚杞崲鍣� + /// </summary> + Converter_ZbBuspro = 4201, + } + + /// <summary> + /// <para>浠呴檺搴曞眰浣跨敤锛氳澶囨墍灞炵殑銆愯澶囩绫汇��,鑷畾涔変笌妯″潡id鍏宠仈鐨勬灇涓�(鍊间负LocalDevice閲岄潰dicDeviceModelIdEnum鎵�鎸囧畾鐨勫��)</para> + /// <para>杩欎釜鍊兼槸鐬庡啓鐨�,娌′粈涔堢壒娈婃剰涔�</para> + /// </summary> + public enum DeviceBeloneType + { + /// <summary> + /// 鏈煡璁惧 + /// </summary> + A鏈煡璁惧 = 0, + /// <summary> + /// 绐楀笜(100-199) + /// </summary> + A绐楀笜 = 100, + /// <summary> + /// 鎸夐敭闈㈡澘(200-1199) + /// </summary> + A鎸夐敭闈㈡澘 = 200, + /// <summary> + /// 浼犳劅鍣�(1200-2299) + /// </summary> + A浼犳劅鍣� = 1200, + /// <summary> + /// 缁х數鍣�(2300-2499) + /// </summary> + A缁х數鍣� = 2300, + /// <summary> + /// 璋冨厜鍣�(2500-2799) + /// </summary> + A璋冨厜鍣� = 2500, + /// <summary> + /// 鏅鸿兘闂ㄩ攣(2800-????) + /// </summary> + A鏅鸿兘闂ㄩ攣 = 2800, + /// <summary> + /// 绌鸿皟(3600-3899) + /// </summary> + A绌鸿皟 = 3600, + /// <summary> + /// 涓户鍣�(3900-3999) + /// </summary> + A涓户鍣� = 3900, + /// <summary> + /// 绌烘皵寮�鍏�(4100-4199) + /// </summary> + A绌烘皵寮�鍏� = 4100, + /// <summary> + /// 杞崲鍣�(4200-4699) + /// </summary> + A杞崲鍣� = 4200, + /// <summary> + /// 褰╃伅 + /// </summary> + A褰╃伅 = 9, + /// <summary> + /// 娓╂箍搴︿紶鎰熷櫒 + /// </summary> + A娓╂箍搴︿紶鎰熷櫒 = 10, + /// <summary> + /// 娓╁害浼犳劅鍣� + /// </summary> + A娓╁害浼犳劅鍣� = 11, + /// <summary> + /// 婀垮害浼犳劅鍣� + /// </summary> + A婀垮害浼犳劅鍣� = 12 + } + + #endregion } diff --git a/ZigbeeApp/Shared/Common/Room.cs b/ZigbeeApp/Shared/Common/Room.cs index c7ef0ed..282f05b 100755 --- a/ZigbeeApp/Shared/Common/Room.cs +++ b/ZigbeeApp/Shared/Common/Room.cs @@ -67,6 +67,15 @@ /// </summary> public Dictionary<string, string> FloorList = new Dictionary<string, string> { }; + /// <summary> + /// 娓╁害浼犳劅鍣�(璁惧涓婚敭) + /// </summary> + public string TemperatrueDevice = string.Empty; + /// <summary> + /// 婀垮害浼犳劅鍣�(璁惧涓婚敭) + /// </summary> + public string HumidityDevice = string.Empty; + /// <summary> /// 褰撳墠閫夋嫨鐨勬埧闂� /// </summary> @@ -809,6 +818,28 @@ } } + /// <summary> + /// 鑾峰彇褰撳墠鎴块棿涓嬬殑鍏ㄩ儴璁惧 + /// </summary> + /// <returns></returns> + public List<CommonDevice> GetRoomListDevice() + { + var listDevice = new List<CommonDevice>(); + foreach (var device in this.DeviceUIList) + { + if (device == null || device.CommonDevice == null) + { + continue; + } + listDevice.Add(device.CommonDevice); + } + if (listDevice.Count == 0) + { + return listDevice; + } + return Common.LocalDevice.Current.SortDevice(listDevice); + } + #endregion #region 鈼� 娣诲姞鍦烘櫙_________________________ @@ -1282,6 +1313,8 @@ //鍏嬮殕灞炴�� newRoom.Id = this.Id; newRoom.FloorId = this.FloorId; + newRoom.TemperatrueDevice = this.TemperatrueDevice; + newRoom.HumidityDevice = this.HumidityDevice; newRoom.Name = this.Name; newRoom.BackgroundImage = this.BackgroundImage; newRoom.BackgroundImageType = this.BackgroundImageType; diff --git a/ZigbeeApp/Shared/Common/ZigbeeColor.cs b/ZigbeeApp/Shared/Common/ZigbeeColor.cs index 9cc4ae4..cd8dc23 100755 --- a/ZigbeeApp/Shared/Common/ZigbeeColor.cs +++ b/ZigbeeApp/Shared/Common/ZigbeeColor.cs @@ -25,76 +25,25 @@ public uint ButtonColor = 0xffEAEAEA; public uint SelectedColor = 0xFF00AAF0; public uint DelRowLayout = 0xffff0000; - - //浠ヤ笅鏄祴璇曢鑹诧紝姝e紡鏃堕渶瑕佸幓鎺� - public uint MainPageBackgroucnd = 0xff00ff00; - public uint TitleLayout = 0xff6b6b6b; - public uint TitleText = 0xFFf2f2f2; - public uint ViewColor = 0xFF3c3c3c; - public uint TopLayout = 0xff6b6b6b; - public uint UnderTopLayout = 0xFFb6b6b6; - public uint MiddleLayout = 0xFFc9c9c9; - public uint BottomLayout = 0xFF8a8a8a; public uint TextBlack = 0xFF1F1F1F; - public uint TextWhite = 0xFF1F1F1F; - public uint PlaceholderTextColor = 0xFF505050; - public uint RowLine = 0xFF9d9d9d; - public uint RowLayout = 0xffa1a1a1; - public uint ButtonBackGround = 0xff9fba4e; - public uint SelectedButtonBackGround = 0xff00ff00; - - public uint BorderColor = 0xFF505050; - - public uint Transparent = 0xFF0000ff; - public uint TitileView = 0xFF0f0f0f; - public uint PanelSettingTargetNotInLocalColor = 0xCCF8E725; - public uint Black50Transparent = 0x73000000; - public uint White20Transparent = 0x35FFFFFF; - - public uint SubtitleView = 0xFF505050; - public uint TextColor1 = 0xFFFFFFFF; - public uint newDeviceBG = 0x801DB585; - public uint LostDeviceBG = 0x80E26464; - public uint UserMenuItemButton = 0xFF000000; - public uint LineColor = 0xFF0f0f0f; - public uint LightDialogTextColor = 0xFFE6E6E6; - public uint ThumbColor = 0xFFFFFFFF; - public uint LineColor2 = 0xFF5F5F5F; - public uint ButtonColor1 = 0xFF505050; - public uint SysTitleView = 0xFF0f0f0f; - public uint SysSubtitleView = 0xFF2d2d2d; - public uint SysEditBox = 0xFF505050; - public uint SysPanelBox = 0xFF505050; - public uint SysPanleDevicesBox = 0xFF3c3c3c; - public uint SensorContentView = 0xFF505050; - public uint TextColor2 = 0xFFFFFFFF; - public uint DialogTextColor = 0xFFFFFFFF; - public uint SceneDialogColor = 0xFF505050; - public uint SceneDialogTitleColor = 0xFF0f0f0f; - public uint DelColor = 0xFFFF0000; - public uint SensorLevel0 = 0xFFFFFFFF; - public uint SensorLevel1 = 0xFF6cc0fb; - public uint SensorLevel2 = 0xFF6aeaa9; - public uint SensorLevel3 = 0xFFff9a50; - public uint SensorLevel4 = 0xFFff5757; - public uint AddTipButtonColor = 0xFF000000; - public uint MusicTopFrameLayout = 0xFF1F1F1F; - public uint MusicVerticalScrolViewLayout = 0xff2F2F2F; - public uint MusicPalyerView = 0xFF181818; - public uint MusicTextColor = 0xFFFFFFFF; - public uint MusicArtistTextColor = 0x80ffffff; - public uint MusicLineColor = 0xFF181818; - public uint MusicEditTextBackgroundColor = 0xFF4D4D4D; - public uint MusicEditTextPlaceholderTextColor = 0x80ffffff; - public uint MusicMiddleBackgroundColor = 0xFF121212; - public uint MusicEditBorderColor = 0x00000000; - public uint MusicTipBackgroundColor = 0xffcccccc; - public uint MusicTipTextColor = 0xff000000; - public uint MusicselecteButtonColcor = 0xff525252; - public uint MusicDialogBackgroundColor = 0xFF484848; - public uint HorizontalSeekBarThumbColor = 0xFFFFFFFF; - public uint TimeVerticalScrolViewLayout = 0xff121212; + public uint XMTopFrameLayout = 0xfff9f9f9; + public uint XMTopTitleText = 0xff333333; + public uint XMMidFrameLayout = 0xfff5f6fa; + public uint XMWhite = 0xffffffff; + public uint XMBlack = 0xff000000; + public uint XMGray1 = 0xff232323; + public uint XMGray2 = 0xff666666; + public uint XMGray3 = 0xff999999; + public uint XMOrange = 0xfffc744b; + public uint XMVerticalSeekBar = 0xffececec; + public uint XMDel = 0xffF75858; + public uint XMUnSelect = 0x4d232323; + public uint XMBorder = 0xff676767; + //闃村奖 + public uint XMTitleLine = 0x40000000; + public uint XMInVisibleLine = 0x00000000; + public uint XMRowLine = 0x66CCCCCC; #endregion @@ -336,23 +285,5 @@ public uint LogicTimeViewColor= 0xFFFFFFFF; public uint LogicTimeViewSaveButton = 0xFF121212; #endregion - - public uint XMTopFrameLayout = 0xfff9f9f9; - public uint XMTopTitleText = 0xff333333; - public uint XMMidFrameLayout = 0xfff5f6fa; - public uint XMWhite = 0xffffffff; - public uint XMBlack = 0xff000000; - public uint XMGray1 = 0xff232323; - public uint XMGray2 = 0xff666666; - public uint XMGray3 = 0xff999999; - public uint XMOrange = 0xfffc744b; - public uint XMVerticalSeekBar = 0xffececec; - public uint XMDel = 0xffF75858; - public uint XMUnSelect = 0x4d232323; - - //闃村奖 - public uint XMTitleLine = 0x40000000; - public uint XMInVisibleLine = 0x00000000; - public uint XMRowLine = 0x66CCCCCC; } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/DeviceTypePictrueImageEnum.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/DeviceTypePictrueImageEnum.cs deleted file mode 100755 index 8d08705..0000000 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/DeviceTypePictrueImageEnum.cs +++ /dev/null @@ -1,264 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; - -namespace Shared.Phone.UserCenter -{ - /// <summary> - /// <para>浠呴檺搴曞眰浣跨敤锛氳澶囩殑鍏蜂綋銆愯澶囩被鍨嬨��,鑷畾涔変笌妯″潡id鍏宠仈鐨勬灇涓�(鍊间负LocalDevice閲岄潰dicDeviceModelIdEnum鎵�鎸囧畾鐨勫��)</para> - /// <para>鍙橀噺鍚嶅彲浠ヤ綔涓恒�愯澶囩被鍨嬨�戝浘鐗�,杩欎釜鍊兼槸鐬庡啓鐨�,娌′粈涔堢壒娈婃剰涔�</para> - /// </summary> - public enum DeviceConcreteType - { - //瀹氫箟瑙勫垯锛氥�愯澶囩被鍨嬨�戝浘鐗囧悕瀛�=LocalDevice閲岄潰dicDeviceModelIdEnum鎵�鎸囧畾鐨勫�� - - /// <summary> - /// 鏈煡璁惧 - /// </summary> - UnKownDevice = -1, - - //=========鈽呪槄绐楀笜绫�(100-199)鈽呪槄========= - /// <summary> - /// 绐楀笜 - /// </summary> - Curtain = -100, - /// <summary> - /// 鏅鸿兘寮�鍚堝笜鐢垫満 闀滃儚id锛�100 - /// </summary> - Curtain_AutoOpen = 100, - /// <summary> - /// 鏅鸿兘绠$姸鐢垫満 闀滃儚id锛�101 - /// </summary> - Curtain_Siphonate = 101, - - //=========鈽呪槄鎸夐敭闈㈡澘绫�(200-1199)鈽呪槄========= - /// <summary> - /// 鎸夐敭闈㈡澘 - /// </summary> - ButtonPanel = -200, - /// <summary> - /// 4鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�4璺户鐢靛櫒搴曞骇) 闀滃儚id锛�200 - /// </summary> - ButtonPanel_Four = 200, - /// <summary> - /// 3鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�3璺户鐢靛櫒搴曞骇) 闀滃儚id锛�201 - /// </summary> - ButtonPanel_Three = 201, - /// <summary> - /// 2鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�2璺户鐢靛櫒搴曞骇) 闀滃儚id锛�202 - /// </summary> - ButtonPanel_Two = 202, - /// <summary> - /// 12鎸夐敭澶氬姛鑳借Е鎽搁潰鏉�(甯�1璺户鐢靛櫒搴曞骇) 闀滃儚id锛�203 - /// </summary> - ButtonPanel_Twelve = 203, - /// <summary> - /// 4鎸夐敭澶氬姛鑳借Е鎽搁潰鏉匡紙鍙甫鐢垫簮搴曞骇锛� 闀滃儚id锛�210 - /// </summary> - ButtonPanel_FourNotPower = 210, - - //=========鈽呪槄PIR浼犳劅鍣ㄧ被(1200-1299)鈽呪槄========= - /// <summary> - /// 浼犳劅鍣� - /// </summary> - Sensor = -1200, - /// <summary> - /// pir浼犳劅鍣�220 闀滃儚id锛�1200 - /// </summary> - Sensor_Pir = 1200, - - //=========鈽呪槄瀹夐槻绫讳紶鎰熷櫒绫�(1300-2299)鈽呪槄========= - /// <summary> - /// 鐕冩皵浼犳劅鍣� - /// </summary> - Sensor_CarbonMonoxide = 1300, - /// <summary> - /// 闂ㄧ獥浼犳劅鍣� - /// </summary> - Sensor_DoorWindow = 1301, - /// <summary> - /// 鐑熼浘浼犳劅鍣� - /// </summary> - Sensor_Fire = 1302, - /// <summary> - /// 绾㈠浼犳劅鍣� - /// </summary> - Sensor_Infrared = 1303, - /// <summary> - /// 姘翠镜浼犳劅鍣� - /// </summary> - Sensor_Water = 1304, - /// <summary> - /// 绱ф�ユ寜閽� - /// </summary> - Sensor_EmergencyButton = 1305, - /// <summary> - /// 杩愬姩浼犳劅鍣� - /// </summary> - Sensor_Motion = -1306, - /// <summary> - /// 閽ュ寵鎵� - /// </summary> - Sensor_Keyfob = -1307, - /// <summary> - /// 娓╂箍搴︿紶鎰熷櫒 - /// </summary> - Sensor_TemperatrueHumidity = -1308, - /// <summary> - /// 娓╁害浼犳劅鍣� - /// </summary> - Sensor_Temperatrue = -1309, - /// <summary> - /// 婀垮害浼犳劅鍣� - /// </summary> - Sensor_Humidity = -1310, - - //=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄========= - /// <summary> - /// 缁х數鍣� - /// </summary> - Relay = -2300, - /// <summary> - /// 涓夎矾缁х數鍣� 闀滃儚id锛�2300 - /// </summary> - Relay_ThreeLoad = 2300, - - //=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄========= - /// <summary> - /// 璋冨厜鍣� - /// </summary> - DimmableLight = -2500, - /// <summary> - /// 1璺皟鍏夊櫒灏忔ā鍧� - /// </summary> - DimmableLight_OneLoad = 2500, - - //=========鈽呪槄鏅鸿兘闂ㄩ攣绫�(2800-????)鈽呪槄========= - /// <summary> - /// 鏅鸿兘闂ㄩ攣 - /// </summary> - IntelligentLocks = -2800, - /// <summary> - /// H06C - /// </summary> - IntelligentLocks_H06C = 2800, - - //=========鈽呪槄褰╃伅绫�(????-????)鈽呪槄========= - /// <summary> - /// 褰╃伅 - /// </summary> - ColorDimmableLight = -10, - - //=========鈽呪槄绌鸿皟(3600-3899)鈽呪槄========= - /// <summary> - /// 绌鸿皟 - /// </summary> - AirConditioner = -3600, - /// <summary> - /// zigbee绌鸿皟缃戝叧妯″潡 - /// </summary> - AirConditioner_ZbGateway = 3600, - - //=========鈽呪槄涓户鍣�(3900-3999)鈽呪槄========= - /// <summary> - /// 涓户鍣� - /// </summary> - Repeater = -3900, - /// <summary> - /// zigbee涓户鍣� 闀滃儚id锛�3900 - /// </summary> - Repeater_Zigbee = 3900, - - //=========鈽呪槄绌烘皵寮�鍏崇被(4100-????)鈽呪槄========= - /// <summary> - /// 鏅鸿兘绌烘皵寮�鍏� - /// </summary> - AirSwitch = -4100, - /// <summary> - /// 寰柇浜戞帶鍒跺櫒 闀滃儚id锛�4100 - /// </summary> - AirSwitch_CloudContr = 4100, - - //=========鈽呪槄杞崲鍣ㄧ被(4200-4699)鈽呪槄========= - /// <summary> - /// 杞崲鍣� - /// </summary> - Converter = -4200, - /// <summary> - /// zigbee杞�485鍗忚杞崲鍣� - /// </summary> - Converter_Zb485 = 4200, - /// <summary> - /// zigbee杞琤uspro鍗忚杞崲鍣� - /// </summary> - Converter_ZbBuspro = 4201, - } - - /// <summary> - /// <para>浠呴檺搴曞眰浣跨敤锛氳澶囨墍灞炵殑銆愯澶囩绫汇��,鑷畾涔変笌妯″潡id鍏宠仈鐨勬灇涓�(鍊间负LocalDevice閲岄潰dicDeviceModelIdEnum鎵�鎸囧畾鐨勫��)</para> - /// <para>杩欎釜鍊兼槸鐬庡啓鐨�,娌′粈涔堢壒娈婃剰涔�</para> - /// </summary> - public enum DeviceBeloneType - { - /// <summary> - /// 鏈煡璁惧 - /// </summary> - A鏈煡璁惧 = 0, - /// <summary> - /// 绐楀笜(100-199) - /// </summary> - A绐楀笜 = 100, - /// <summary> - /// 鎸夐敭闈㈡澘(200-1199) - /// </summary> - A鎸夐敭闈㈡澘 = 200, - /// <summary> - /// 浼犳劅鍣�(1200-2299) - /// </summary> - A浼犳劅鍣� = 1200, - /// <summary> - /// 缁х數鍣�(2300-2499) - /// </summary> - A缁х數鍣� = 2300, - /// <summary> - /// 璋冨厜鍣�(2500-2799) - /// </summary> - A璋冨厜鍣� = 2500, - /// <summary> - /// 鏅鸿兘闂ㄩ攣(2800-????) - /// </summary> - A鏅鸿兘闂ㄩ攣 = 2800, - /// <summary> - /// 绌鸿皟(3600-3899) - /// </summary> - A绌鸿皟 = 3600, - /// <summary> - /// 涓户鍣�(3900-3999) - /// </summary> - A涓户鍣� = 3900, - /// <summary> - /// 绌烘皵寮�鍏�(4100-4199) - /// </summary> - A绌烘皵寮�鍏� = 4100, - /// <summary> - /// 杞崲鍣�(4200-4699) - /// </summary> - A杞崲鍣� = 4200, - /// <summary> - /// 褰╃伅 - /// </summary> - A褰╃伅 = 9, - /// <summary> - /// 娓╂箍搴︿紶鎰熷櫒 - /// </summary> - A娓╂箍搴︿紶鎰熷櫒 = 10, - /// <summary> - /// 娓╁害浼犳劅鍣� - /// </summary> - A娓╁害浼犳劅鍣� = 11, - /// <summary> - /// 婀垮害浼犳劅鍣� - /// </summary> - A婀垮害浼犳劅鍣� = 12 - } -} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs index 0cbc0a2..4608454 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs @@ -28,6 +28,10 @@ return m_Current; } } + /// <summary> + /// 鏃犺閿欒(璁块棶浜戠鏃讹紝姝ゆ搷浣滃皢涓嶄細寮瑰嚭閿欒) + /// </summary> + public bool IgnoreError = false; /// <summary> /// 鍏ㄩ儴淇℃伅 @@ -496,21 +500,30 @@ /// </summary> /// <param name="requestName">鎺ュ彛</param> /// <param name="statuCode">鐘舵�佺爜</param> + /// <param name="pra">璇锋眰鍙傛暟</param> /// <returns></returns> - public string GetMsgByRequestName(string requestName, string statuCode) + public string GetMsgByRequestName(string requestName, string statuCode, object pra) { + if (IgnoreError == true) + { + //鏃犺閿欒 + return null; + } + + HdlLogLogic.Current.WriteLog(-1, "鎺ュ彛璁块棶澶辫触锛�" + UserCenterResourse.NowActionFormID + " " + requestName + " " + statuCode); + if (pra != null) + { + //搴忓垪鍖栧璞� + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(pra); + HdlLogLogic.Current.WriteLog(-1, "鍙傛暟锛�" + requestJson); + } + if (dicMsg.ContainsKey(requestName) == true && dicMsg[requestName].ContainsKey(statuCode) == true) { //鍦ㄥ唽鐨凪sg return Language.StringByID(dicMsg[requestName][statuCode]); } - string error = "ERROR:NOT_DEFINE_MSG!\r\n"; - if (requestName.Length > 5) - { - error += "*" + requestName.Substring(requestName.Length - 5, 5); - } - error += "(" + statuCode + ")"; - return error; + return "ERROR:NOT_DEFINE_MSG!"; } } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/SelectDeviceForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/SelectDeviceForm.cs deleted file mode 100755 index a74a7a7..0000000 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/SelectDeviceForm.cs +++ /dev/null @@ -1,177 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; -using ZigBee.Device; - -namespace Shared.Phone.UserCenter -{ - /// <summary> - /// 璁惧閫夋嫨鐨勭晫闈� - /// </summary> - public class SelectDeviceForm : EditorCommonForm - { - #region 鈻� 鍙橀噺澹版槑___________________________ - - /// <summary> - /// 璁惧閫夋嫨纭畾鍚庣殑鍥炶皟鍑芥暟(姝ゅ嚱鏁板湪鐐瑰嚮纭鍚庯紝浼氬厛鍏抽棴鐣岄潰鍐嶆墽琛屽洖璋冩柟娉�,涓嶢ctionSelectDeviceEx涓嶅叡瀛�) - /// </summary> - public Action<List<CommonDevice>> ActionSelectDevice = null; - /// <summary> - /// 璁惧閫夋嫨纭畾鍚庣殑鍥炶皟鍑芥暟(姝ゅ嚱鏁板湪鐐瑰嚮纭鍚庯紝涓嶄細鍏抽棴鐣岄潰,涓嶢ctionSelectDevice涓嶅叡瀛�,鍏抽棴鐣岄潰璇疯皟鐢–loseForm鍑芥暟) - /// </summary> - public Action<List<CommonDevice>> ActionSelectDeviceEx = null; - /// <summary> - /// 鍒楄〃鎺т欢 - /// </summary> - private VerticalListControl listView = null; - - #endregion - - #region 鈻� 鍒濆鍖朹____________________________ - - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - /// <param name="i_listShowDevice">闇�瑕佹樉绀鸿澶囧垪琛�(鏈変簺鐣岄潰闇�瑕佸墧闄や竴浜涗笉瑕佺殑璁惧)</param> - /// <param name="i_listSelectDevice">鎸囧畾鍝簺璁惧鐨勫垵濮嬬姸鎬佷负閫変腑鐘舵��(璁惧鐨勪富閿�)</param> - /// <param name="SelcetCancel">鍒濆閫変腑鐘舵�佺殑璁惧鑳藉惁鍙栨秷 true:鍙互 false:涓嶅厑璁�</param> - public void ShowForm(List<CommonDevice> i_listShowDevice, List<string> i_listSelectDevice, bool SelcetCancel = true) - { - //璁剧疆鏍囬淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSelectDevice)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(i_listShowDevice, i_listSelectDevice, SelcetCancel); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame(List<CommonDevice> i_listShowDevice, List<string> i_listSelectDevice, bool SelcetCancel) - { - //娓呯┖bodyFrame - this.ClearBodyFrame(); - - //瀹屾垚 - var btnfinish = new BottomClickButton(); - btnfinish.TextID = R.MyInternationalizationString.uFinish; - bodyFrameLayout.AddChidren(btnfinish); - btnfinish.ButtonClickEvent += (sender, e) => - { - List<CommonDevice> listDevice = this.GetDeviceFromRow(); - if (ActionSelectDeviceEx != null) - { - ActionSelectDeviceEx(listDevice); - return; - } - - this.CloseForm(); - if (ActionSelectDevice != null) - { - ActionSelectDevice(listDevice); - ActionSelectDevice = null; - } - }; - - listView = new VerticalListControl(29); - listView.Y = Application.GetRealHeight(-6); - listView.Height = btnfinish.Y - ControlCommonResourse.BottomButtonAndListViewSpace + Application.GetRealHeight(6); - listView.BackgroundColor = UserCenterColor.Current.White; - bodyFrameLayout.AddChidren(listView); - - //娣诲姞鎵�鏈夎澶囪 - HdlThreadLogic.Current.RunThread(() => - { - Application.RunOnMainThread(() => - { - int count = i_listShowDevice.Count - 1; - for (int i = 0; i < i_listShowDevice.Count; i++) - { - //娣诲姞鏄庣粏琛� - this.AddDeviceRow(i_listShowDevice[i], i_listSelectDevice, SelcetCancel, i != count); - } - //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� - var realHeight = i_listShowDevice.Count * listView.GetChildren(listView.ChildrenCount - 1).Height; - realHeight += listView.rowSpace; - if (realHeight < listView.Height) - { - //缂╁皬鎺т欢楂樺害 - listView.Height = realHeight; - } - }); - }); - } - - #endregion - - #region 鈻� 娣诲姞璁惧琛宊________________________ - - /// <summary> - /// 娣诲姞璁惧琛� - /// </summary> - /// <param name="device">璁惧</param> - /// <param name="i_listSelectDevice">鎸囧畾鍝簺璁惧鐨勫垵濮嬬姸鎬佷负閫変腑鐘舵��(璁惧鐨勪富閿�)</param> - /// <param name="SelcetCancel">鍒濆閫変腑鐘舵�佺殑璁惧鑳藉惁鍙栨秷 true:鍙互 false:涓嶅厑璁�</param> - /// <param name="addLine">鏄惁娣诲姞搴曠嚎</param> - private void AddDeviceRow(CommonDevice device, List<string> i_listSelectDevice, bool SelcetCancel, bool addLine) - { - var row = new DeviceSelectControl(device, listView.rowSpace / 2); - listView.AddChidren(row); - row.InitControl(); - //搴曠嚎 - if (addLine == true) - { - row.AddBottomLine(); - } - - //璁剧疆閫夋嫨鐘舵�� - string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device); - if (i_listSelectDevice.Contains(mainKeys) == true) - { - row.SelectCancel = SelcetCancel; - row.IsSelected = true; - } - } - - #endregion - - #region 鈻� 鑾峰彇閫変腑璁惧_______________________ - - /// <summary> - /// 鑾峰彇閫変腑鐨勮澶� - /// </summary> - /// <returns></returns> - private List<CommonDevice> GetDeviceFromRow() - { - List<CommonDevice> listDevice = new List<CommonDevice>(); - for (int i = 0; ; i++) - { - var row = (DeviceSelectControl)this.listView.GetChildren(i); - if (row == null) - { - break; - } - if (row.IsSelected == true) - { - listDevice.Add(row.device); - } - } - return listDevice; - } - #endregion - - #region 鈻� 鐣岄潰鍏抽棴___________________________ - - /// <summary> - /// 鐣岄潰鍏抽棴 - /// </summary> - public override void CloseForm() - { - ActionSelectDeviceEx = null; - - base.CloseForm(); - } - - #endregion - } -} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/SelectRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/SelectRoomForm.cs deleted file mode 100755 index 3532a55..0000000 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/SelectRoomForm.cs +++ /dev/null @@ -1,120 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; - -namespace Shared.Phone.UserCenter -{ - /// <summary> - /// 鎴块棿閫夋嫨鐢婚潰锛� - /// 瀹冧粠[DeviceInfoForm,AddedDeviceInfoForm]鐢婚潰鎵撳紑 - /// </summary> - public class SelectRoomForm : EditorCommonForm - { - /// <summary> - /// 鎴块棿閫夋嫨纭畾鍚庣殑鍥炶皟鍑芥暟(鎴块棿鍚�) - /// </summary> - public Action<List<string>> ActionSelectRoom = null; - /// <summary> - /// 鍒楄〃鎺т欢 - /// </summary> - private VerticalScrolViewLayout listView = null; - /// <summary> - /// 璁惧鍘熸潵鐨勬埧闂� - /// </summary> - private List<string> listRoomName = new List<string>(); - - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - /// <param name="i_listRoomName">宸茬粡閫変簡鐨勬埧闂村悕瀛�</param> - public void ShowForm(List<string> i_listRoomName) - { - this.listRoomName = i_listRoomName; - - //璁剧疆鏍囬淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSelectRoom)); - - //瀹屾垚 - //var btnfinish = new TopLayoutFinshView(); - //topFrameLayout.AddChidren(btnfinish); - //btnfinish.MouseUpEventHandler += (sender, e) => - //{ - // List<string> listName = this.GetRoomNameFromRow(); - // ActionSelectRoom?.Invoke(listName); - // ActionSelectRoom = null; - - // this.CloseForm(); - //}; - - listView = new VerticalScrolViewLayout(); - listView.Height = bodyFrameLayout.Height; - bodyFrameLayout.AddChidren(listView); - - //娣诲姞鎴块棿琛� - this.AddAllRoomRow(); - } - - /// <summary> - /// 娣诲姞鎵�鏈夋埧闂磋 - /// </summary> - private void AddAllRoomRow() - { - HdlThreadLogic.Current.RunThread(() => - { - foreach (Common.Room room in Common.Room.Lists) - { - if (room.IsSharedRoom == true && this.listRoomName.Contains(room.Name) == false) - { - //鍒嗕韩鐨勬埧闂翠笉鑳芥樉绀猴紝濡傛灉璇ヨ澶囨湰鏉ュ氨灞炰簬鍒嗕韩鐨勬埧闂达紝鍒欏彲浠ユ樉绀猴紝浣嗕笉鑳藉彇娑� - continue; - } - Application.RunOnMainThread(() => - { - this.AddRoomRow(room); - }); - } - }); - } - - /// <summary> - /// 娣诲姞鎴块棿琛� - /// </summary> - /// <param name="room">Room.</param> - private void AddRoomRow(Common.Room room) - { - //var row = new RoomSelectRow(listView, room); - - ////璁剧疆閫夋嫨鐘舵�� - //if (this.listRoomName.Contains(room.Name) == true) - //{ - // if (room.IsSharedRoom == true) - // { - // //鍒嗕韩鐨勬埧闂翠笉鍏佽鍙栨秷 - // row.SelectCancel = false; - // } - // row.IsSelected = true; - //} - } - - /// <summary> - /// 鑾峰彇閫変腑鐨勬埧闂� - /// </summary> - /// <returns></returns> - private List<string> GetRoomNameFromRow() - { - List<string> listName = new List<string>(); - for (int i = 0; ; i++) - { - //var row = (RoomSelectRow)this.listView.GetChildren(i); - //if (row == null) - //{ - // break; - //} - //if (row.IsSelected == true) - //{ - // listName.Add(row.RoomName); - //} - } - return listName; - } - } -} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs index 24756d1..080da65 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Common; +using System; using System.Collections.Generic; namespace Shared.Phone.UserCenter diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs index 4319b59..587dde4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs @@ -137,9 +137,7 @@ var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); alert.Show(); //Log鍑哄姏 - string msg = ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); - HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); } } } @@ -220,15 +218,16 @@ int byteLength = 0; for (int i = 0; i < i_text.Length; i++) { - int length = Encoding.UTF8.GetBytes(i_text[i].ToString()).Length; - if (length == 1) - { - //鑻辨枃 - byteLength += length; - continue; - } - //涓枃(鏆傛椂鐢ㄤ腑鏂囧搴�) - byteLength += Encoding.GetEncoding("gb2312").GetBytes(i_text[i].ToString()).Length; + byteLength += Encoding.UTF8.GetBytes(i_text[i].ToString()).Length; + //int length = Encoding.UTF8.GetBytes(i_text[i].ToString()).Length; + //if (length == 1) + //{ + // //鑻辨枃 + // byteLength += length; + // continue; + //} + ////涓枃(鏆傛椂鐢ㄤ腑鏂囧搴�) + //byteLength += Encoding.GetEncoding("gb2312").GetBytes(i_text[i].ToString()).Length; } int realWidth = byteLength * (int)textSize; return Application.GetRealWidth(realWidth); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs index e022650..ed3b31f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs @@ -71,7 +71,7 @@ //閫夋嫨鎺т欢 btnSelect = this.AddMostRightEmptyIcon(58, 58); btnSelect.Visible = false; - btnSelect.UnSelectedImagePath = "Item/Tick.png"; + btnSelect.UnSelectedImagePath = "Item/ItemSelected.png"; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs index 1b60ac2..a652601 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs @@ -79,6 +79,10 @@ { m_value += value; int value2 = (int)((m_value / Max) * 100); + if (value2 > 100) + { + value2 = 100; + } SetValue(value2.ToString() + "%"); } @@ -92,6 +96,10 @@ { m_value += value; int value2 = (int)((m_value / Max) * 100); + if (value2 > 100) + { + value2 = 100; + } SetValue(value2.ToString() + "% " + text); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs index 120d887..ad4ea10 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs @@ -24,6 +24,23 @@ get { return Common.LocalDevice.Current.GetDevice(mainKey); } } /// <summary> + /// 鍦ㄧ嚎鐘舵�� + /// </summary> + private bool m_isOnline = false; + /// <summary> + /// 鍦ㄧ嚎鐘舵�� + /// </summary> + public bool isOnline + { + get { return m_isOnline; } + set + { + m_isOnline = value; + //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥 + this.SetOnlineStatu(m_isOnline); + } + } + /// <summary> /// 鍥炬爣鎺т欢 /// </summary> public IconViewControl btnIcon = null; @@ -97,5 +114,25 @@ btnIcon.UnSelectedImagePath = unSelectPath; } #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥 + /// </summary> + /// <param name="isOnline"></param> + private void SetOnlineStatu(bool isOnline) + { + if (isOnline == false) + { + btnDevie.TextColor = UserCenterColor.Current.TextGrayColor1; + } + else + { + btnDevie.TextColor = UserCenterColor.Current.TextColor1; + } + } + + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs index b7c2442..0436869 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs @@ -70,14 +70,18 @@ /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout /// </summary> /// <param name="i_device">璁惧瀵硅薄</param> + /// <param name="autoSelect">褰撶偣鍑绘鎺т欢鏃�,鏄惁鑷姩璁剧疆閫夋嫨鐘舵��</param> /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> - public DeviceSelectControl(CommonDevice i_device, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) + public DeviceSelectControl(CommonDevice i_device, bool autoSelect, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) { this.MainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(i_device); - this.ButtonClickEvent += (sender, e) => + if (autoSelect == true) { - this.IsSelected = Statu == StatuMode.SELECT ? false : true; - }; + this.ButtonClickEvent += (sender, e) => + { + this.IsSelected = Statu == StatuMode.SELECT ? false : true; + }; + } } /// <summary> @@ -108,7 +112,7 @@ btnSelect = this.AddMostRightEmptyIcon(58, 58); btnSelect.Visible = false; - btnSelect.UnSelectedImagePath = "Item/Tick.png"; + btnSelect.UnSelectedImagePath = "Item/ItemSelected.png"; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs index df9a338..3d529e1 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs @@ -15,6 +15,10 @@ /// 琛屼箣闂寸殑闂磋窛 /// </summary> public int rowSpace = 0; + /// <summary> + /// 鏈�澶ч珮搴� + /// </summary> + private int maxHeight = -1; #endregion @@ -47,19 +51,37 @@ view.Height += rowSpace; } } + if (maxHeight == -1) + { + maxHeight = this.Height; + } } #endregion #region 鈻� 璋冩暣鐪熷疄楂樺害_______________________ /// <summary> + /// 杩樺師楂樺害 + /// </summary> + public void RecoverHeight() + { + if (this.maxHeight != -1) + { + this.Height = this.maxHeight; + } + } + + /// <summary> /// 璋冩暣鎺т欢鐪熷疄楂樺害(鍙拡瀵硅鎺т欢閮芥槸鐩稿悓楂樺害鐨�,楂樺害鍙細鍑忓皯,涓嶄細澧炲姞) /// </summary> /// <param name="bottomSpace">搴曢儴绌虹櫧闂磋窛(鐪熷疄鍊�)</param> - public void AdjustRealHeight(int bottomSpace) + /// <param name="addSpace">褰撶湡瀹為珮搴﹁秴杩囧師鏈夐珮搴︽椂,鏄惁娣诲姞绌虹櫧</param> + public void AdjustRealHeight(int bottomSpace, bool addSpace = true) { if (this.ChildrenCount == 0) { + //杩樺師涓烘渶澶ч珮搴� + this.Height = maxHeight; return; } //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� @@ -69,6 +91,12 @@ //缂╁皬鎺т欢楂樺害 this.Height = realHeight; } + else if (addSpace == true && bottomSpace > 0 && realHeight > this.maxHeight) + { + var frameBack = new FrameLayout(); + frameBack.Height = bottomSpace; + this.AddChidren(frameBack); + } } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs index c067539..df3a0a7 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs @@ -10,9 +10,9 @@ public class MostRightIconControl : FrameLayoutControl { /// <summary> - /// 鍥炬爣鎺т欢 + /// 鍥炬爣鎺т欢(杩笉寰楀繁锛岃繖涓笢瑗垮紑鏀惧嚭鍘�) /// </summary> - private IconControlCommon btnIcon = null; + public IconControlCommon btnIcon = null; /// <summary> /// UnSelectedImagePath /// </summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs index 7637ca0..39a74d5 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneSimpleSelectControl.cs @@ -104,7 +104,7 @@ btnSelect = this.AddMostRightEmptyIcon(58, 58); btnSelect.Visible = false; - btnSelect.UnSelectedImagePath = "Item/Tick.png"; + btnSelect.UnSelectedImagePath = "Item/ItemSelected.png"; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/CommonFormBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/CommonFormBase.cs index 0d36ad3..b64f1d2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/CommonFormBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/CommonFormBase.cs @@ -282,9 +282,7 @@ this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); //Log鍑哄姏 - string errorMsg = ex.Message + "\r\n"; - errorMsg += ex.TargetSite.ToString(); - HdlLogLogic.Current.WriteLog(-1, errorMsg); + HdlLogLogic.Current.WriteLog(ex); } action = null; }; @@ -378,9 +376,7 @@ this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); //Log鍑哄姏 - string msg = ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); - HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); return null; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/SelectDeviceForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/SelectDeviceForm.cs new file mode 100755 index 0000000..6b0e889 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/SelectDeviceForm.cs @@ -0,0 +1,198 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 璁惧閫夋嫨鐨勭晫闈� + /// </summary> + public class SelectDeviceForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 璁惧閫夋嫨纭畾鍚庣殑鍥炶皟鍑芥暟(姝ゅ嚱鏁板湪鐐瑰嚮纭鍚庯紝浼氬厛鍏抽棴鐣岄潰鍐嶆墽琛屽洖璋冩柟娉�,涓嶢ctionSelectDeviceEx涓嶅叡瀛�) + /// </summary> + public Action<List<CommonDevice>> ActionSelectDevice = null; + /// <summary> + /// 璁惧閫夋嫨纭畾鍚庣殑鍥炶皟鍑芥暟(姝ゅ嚱鏁板湪鐐瑰嚮纭鍚庯紝涓嶄細鍏抽棴鐣岄潰,涓嶢ctionSelectDevice涓嶅叡瀛�,鍏抽棴鐣岄潰璇疯皟鐢–loseForm鍑芥暟) + /// </summary> + public Action<List<CommonDevice>> ActionSelectDeviceEx = null; + /// <summary> + /// 鍒楄〃鎺т欢 + /// </summary> + private VerticalListControl listView = null; + /// <summary> + /// 鍓嶅洖閫夋嫨鐨勮 + /// </summary> + private DeviceSelectControl oldSelectRow = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_listShowDevice">闇�瑕佹樉绀鸿澶囧垪琛�(鏈変簺鐣岄潰闇�瑕佸墧闄や竴浜涗笉瑕佺殑璁惧)</param> + /// <param name="i_listSelectDevice">鎸囧畾鍝簺璁惧鐨勫垵濮嬬姸鎬佷负閫変腑鐘舵��(璁惧鐨勪富閿�)</param> + /// <param name="SelcetCancel">鍒濆閫変腑鐘舵�佺殑璁惧鑳藉惁鍙栨秷 true:鍙互 false:涓嶅厑璁�</param> + /// <param name="SelectOnlyOne">鏄惁鍙兘閫夋嫨涓�涓� true:鍙兘閫夋嫨涓�涓� false:鍙互澶氶��</param> + public void ShowForm(List<CommonDevice> i_listShowDevice, List<string> i_listSelectDevice, bool SelcetCancel = true, bool SelectOnlyOne = false) + { + //璁剧疆鏍囬淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSelectDevice)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(i_listShowDevice, i_listSelectDevice, SelcetCancel, SelectOnlyOne); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame(List<CommonDevice> i_listShowDevice, List<string> i_listSelectDevice, bool SelcetCancel, bool SelectOnlyOne) + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + listView = new VerticalListControl(29); + listView.Y = Application.GetRealHeight(-6); + listView.Height = bodyFrameLayout.Height + Application.GetRealHeight(6); + listView.BackgroundColor = UserCenterColor.Current.White; + bodyFrameLayout.AddChidren(listView); + + //娣诲姞鎵�鏈夎澶囪 + HdlThreadLogic.Current.RunMainInThread(() => + { + int count = i_listShowDevice.Count - 1; + for (int i = 0; i < i_listShowDevice.Count; i++) + { + //娣诲姞鏄庣粏琛� + this.AddDeviceRow(i_listShowDevice[i], i_listSelectDevice, SelcetCancel, SelectOnlyOne, i != count); + } + //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� + listView.AdjustRealHeight(Application.GetRealHeight(23)); + }); + + //瀹屾垚 + var btnfinish = new BottomClickButton(); + btnfinish.TextID = R.MyInternationalizationString.uFinish; + bodyFrameLayout.AddChidren(btnfinish); + btnfinish.ButtonClickEvent += (sender, e) => + { + List<CommonDevice> listDevice = this.GetListDeviceFromRow(); + if (ActionSelectDeviceEx != null) + { + ActionSelectDeviceEx(listDevice); + return; + } + + this.CloseForm(); + if (ActionSelectDevice != null) + { + ActionSelectDevice(listDevice); + ActionSelectDevice = null; + } + }; + } + + #endregion + + #region 鈻� 娣诲姞璁惧琛宊________________________ + + /// <summary> + /// 娣诲姞璁惧琛� + /// </summary> + /// <param name="device">璁惧</param> + /// <param name="i_listSelectDevice">鎸囧畾鍝簺璁惧鐨勫垵濮嬬姸鎬佷负閫変腑鐘舵��(璁惧鐨勪富閿�)</param> + /// <param name="SelcetCancel">鍒濆閫変腑鐘舵�佺殑璁惧鑳藉惁鍙栨秷 true:鍙互 false:涓嶅厑璁�</param> + /// <param name="SelectOnlyOne">鏄惁鍙兘閫夋嫨涓�涓� true:鍙兘閫夋嫨涓�涓� false:鍙互澶氶��</param> + /// <param name="addLine">鏄惁娣诲姞搴曠嚎</param> + private void AddDeviceRow(CommonDevice device, List<string> i_listSelectDevice, bool SelcetCancel, bool SelectOnlyOne, bool addLine) + { + string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device); + var row = new DeviceSelectControl(device, SelectOnlyOne == false, listView.rowSpace / 2); + row.MainKeys = mainkeys; + listView.AddChidren(row); + row.InitControl(); + //搴曠嚎 + if (addLine == true) + { + row.AddBottomLine(); + } + + //璁剧疆閫夋嫨鐘舵�� + string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device); + if (i_listSelectDevice.Contains(mainKeys) == true) + { + row.SelectCancel = SelcetCancel; + row.IsSelected = true; + if (SelectOnlyOne == true) + { + oldSelectRow = row; + } + } + if (SelectOnlyOne == true) + { + row.ButtonClickEvent += (sender, e) => + { + //鍙栧弽 + row.IsSelected = !row.IsSelected; + if (oldSelectRow != null && oldSelectRow.MainKeys != row.MainKeys) + { + oldSelectRow.IsSelected = false; + oldSelectRow = null; + } + if (row.IsSelected == true) + { + oldSelectRow = row; + } + }; + } + } + + #endregion + + #region 鈻� 鑾峰彇閫変腑璁惧_______________________ + + /// <summary> + /// 鑾峰彇閫変腑鐨勮澶� + /// </summary> + /// <returns></returns> + private List<CommonDevice> GetListDeviceFromRow() + { + List<CommonDevice> listDevice = new List<CommonDevice>(); + for (int i = 0; ; i++) + { + var row = (DeviceSelectControl)this.listView.GetChildren(i); + if (row == null) + { + break; + } + if (row.IsSelected == true) + { + listDevice.Add(row.device); + } + } + return listDevice; + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseForm() + { + ActionSelectDeviceEx = null; + + base.CloseForm(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs index 41429d1..2c9951a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs @@ -439,7 +439,7 @@ public bool SaveDoorLockAlarmInfo(Newtonsoft.Json.Linq.JObject jobject) { var device = Common.LocalDevice.Current.GetDevice(jobject.Value<string>("DeviceAddr"), jobject.Value<int>("Epoint")); - if ((device is DoorLock) == false) + if ((device is ZigBee.Device.DoorLock) == false) { //瀹冧笉鏄棬閿� return false; @@ -525,7 +525,7 @@ #endregion - #region 鈻� 闂ㄩ攣鎶ヨ鐨勪俊鎭炕璇戞枃鏈琠___________ + #region 鈻� 闂ㄩ攣鎶ヨ鐨勪俊鎭炕璇戞枃鏈琠____________ /// <summary> /// 鑾峰彇闂ㄩ攣鎶ヨ鐨勪俊鎭炕璇戞枃鏈�(杩斿洖null鍒欒〃绀烘潯浠舵湭杈炬垚) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs index 04d01da..a5ef6ca 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs @@ -35,6 +35,11 @@ } } + /// <summary> + /// Log澶囦唤鐨勫悕瀛� + /// </summary> + private string LogBackupName = "##Log##"; + #endregion #region 鈻� 鑾峰彇澶囦唤鍚嶅瓧鍒楄〃___________________ @@ -44,8 +49,9 @@ /// </summary> /// <param name="ZigbeeBackupType">0:App鎵嬪姩澶囦唤 1: App 鑷姩澶囦唤 2锛氱綉鍏虫墜鍔ㄥ浠� 3:缃戝叧鑷姩澶囦唤</param> /// <param name="ZigbeeUniqueId">缃戝叧鐨勫敮涓�Id,鑾峰彇缃戝叧澶囦唤闇�瑕�</param> + /// <param name="getLogBackup">鏄惁鑾峰彇Log澶囦唤</param> /// <returns></returns> - public async Task<List<BackupListNameInfo>> GetBackupListNameFromDB(int ZigbeeBackupType = 0, string ZigbeeUniqueId = null) + public async Task<List<BackupListNameInfo>> GetBackupListNameFromDB(int ZigbeeBackupType = 0, string ZigbeeUniqueId = null, bool getLogBackup = false) { //澶囦唤鍚嶅瓧寰堝皯鐨勫唴瀛橈紝鍙互鐩存帴涓�娆℃�у叏閮ㄥ彇瀹� var pra = new GetBackupListPra(); @@ -65,20 +71,21 @@ } var data = Newtonsoft.Json.JsonConvert.DeserializeObject<GetBackupListResult>(result); - if (ZigbeeUniqueId != null) + var list = new List<BackupListNameInfo>(); + foreach (var data2 in data.PageData) { - var list = new List<BackupListNameInfo>(); - foreach (var data2 in data.PageData) + if (ZigbeeUniqueId != null && data2.GatewayUniqueId != ZigbeeUniqueId) { - if (data2.GatewayUniqueId == ZigbeeUniqueId) - { - list.Add(data2); - } + continue; } - return list; + if (getLogBackup == false && data2.BackupName == LogBackupName) + { + //涓嶈幏鍙朙og澶囦唤 + continue; + } + list.Add(data2); } - - return data.PageData; + return list; } /// <summary> @@ -222,8 +229,9 @@ /// <param name="BackupClassId">澶囦唤涓婚敭ID</param> /// <param name="ManualBackupType">鎵嬪姩澶囦唤绫诲瀷(0:App鎵嬪姩澶囦唤,2锛氱綉鍏虫墜鍔ㄥ浠�)</param> /// <param name="upPath">鎸囧畾涓婁紶鐨勬槸鍝釜鏂囦欢澶圭殑鏂囦欢(鍏ㄨ矾寰�),涓嶆寚瀹氭椂锛屼笂浼犵殑鏄湰鍦拌矾寰勪笅鐨勬枃浠�</param> + /// <param name="setBarMaxValue">鏄惁璁剧疆杩涘害鏉$殑鏈�澶у��(杩欎釜涓滆タ涓�鑸笉鐢ㄥ姩瀹�)</param> /// <returns></returns> - public async Task<bool> UpLoadBackupFileToDB(string BackupClassId, int ManualBackupType = 0, string upPath = "") + public async Task<bool> UpLoadBackupFileToDB(string BackupClassId, int ManualBackupType = 0, string upPath = "", bool setBarMaxValue = true) { List<string> listAllFile = null; //鏂囦欢澶圭殑鍏ㄨ矾寰� @@ -261,8 +269,11 @@ } //寮�鍚繘搴︽潯 - ProgressBar.SetMaxValue(listAllFile.Count); - ProgressBar.Show(); + if (setBarMaxValue == true) + { + ProgressBar.SetMaxValue(listAllFile.Count); + ProgressBar.Show(); + } //浣犺涓轰粈涔堣繖閲屼笉鍒嗕竴涓嚱鏁板嚭鏉ワ紙鐞嗚涓婃槸鍒嗗嚱鏁板嚭鏉ョ殑锛� //鏄洜涓哄鏋滃垎鍑芥暟鐨勮瘽锛屼細鍑虹幇鍙岄噸寮傛锛屽鑷翠富绾跨▼鐨勮繘搴︽潯鐨勭櫨鍒嗘瘮姘歌繙瀹氭0% @@ -325,6 +336,14 @@ //璁剧疆杩涘害鍊� ProgressBar.SetValue(listPic.Count); } + + //涓婁紶Log澶囦唤 + if (upPath != UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory)) + { + //閲岄潰鏈変釜鍥炶皟鑷韩鐨勬柟娉�,鎵�浠ヨ繖閲屽姞涓垽鏂�,涓嶇劧浼氭寰幆 + await this.UpLoadLogBackup(); + } + //杩涘害鏉″叧闂� ProgressBar.Close(); @@ -483,6 +502,73 @@ #endregion + #region 鈻� 涓婁紶Log澶囦唤________________________ + + /// <summary> + /// 涓婁紶Log澶囦唤 + /// </summary> + /// <returns></returns> + private async Task<bool> UpLoadLogBackup() + { + string upPath = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory); + if (HdlAutoBackupLogic.GetFileFromDirectory(upPath).Count == 0) + { + //娌℃湁Log鏂囦欢 + return true; + } + + //鏃犺閿欒 + IMessageCommon.Current.IgnoreError = true; + //浠庝簯绔幏鍙栨暟鎹� + var pageData = await HdlBackupLogic.Current.GetBackupListNameFromDB(0, null, true); + if (pageData == null) + { + //鎭㈠ + IMessageCommon.Current.IgnoreError = false; + return false; + } + for (int i = 0; i < pageData.Count; i++) + { + if (pageData[i].BackupName == LogBackupName) + { + //鍒犻櫎鎺夎繖涓浠� + bool flage = await this.DeleteDbBackupData(pageData[i].Id); + if (flage == false) + { + //鎭㈠ + IMessageCommon.Current.IgnoreError = false; + return false; + } + break; + } + } + //鍒涘缓鏂扮殑澶囦唤 + string backupClassId = await HdlBackupLogic.Current.CreatNewBackupNameToDB(LogBackupName); + if (backupClassId == null) + { + //鎭㈠ + IMessageCommon.Current.IgnoreError = false; + return false; + } + //涓婁紶Log鏂囦欢 + bool result = await this.UpLoadBackupFileToDB(backupClassId, 0, upPath, false); + if (result == true) + { + try + { + //鍒犻櫎鏈湴鍏ㄩ儴Log + Global.CreateEmptyDirectory(Path.Combine(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory), true); + } + catch { } + } + //鎭㈠ + IMessageCommon.Current.IgnoreError = false; + + return result; + } + + #endregion + #region 鈻� 璇诲彇澶囦唤___________________________ /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs index 6ae148a..d56af50 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs @@ -50,7 +50,7 @@ #region 鈻� 娣诲姞浜嬩欢___________________________ /// <summary> - /// 娣诲姞鑾峰彇璁惧灞炴�х殑浜嬩欢(灞炴�т笂鎶ョ殑瀵硅薄锛歞evice.DeviceStatusReport) + /// 娣诲姞鑾峰彇璁惧灞炴�х殑浜嬩欢(鎺ㄩ�佸凡缁忓己鍒舵寚瀹氳繍琛屼簬涓荤嚎绋嬶紝灞炴�т笂鎶ョ殑瀵硅薄锛歞evice.DeviceStatusReport) /// </summary> /// <param name="mainKeys">鏍囪瘑浜嬩欢鐨勪富閿�(鍙互闅忎究濉�,涓昏鏄拡瀵瑰涓晫闈竴璧蜂娇鐢ㄧ殑鎯呭喌)</param> /// <param name="comand">鍛戒护鍖哄垎,姣斿锛欴eviceStatusReport,IASInfoReport绛夌瓑</param> @@ -145,12 +145,15 @@ //鍛戒护鍖哄垎涓�鑷存椂锛屽垯璋冪敤鍥炶皟鍑芥暟 list.Add(this.dicEvent[keys]); } - //鏈夊彲鑳藉湪鍥炶皟鍑芥暟涓Щ闄や簡浜嬩欢锛屽鑷存姤閿欙紝鎵�浠ュ厛鏀堕泦锛屽啀璋冪敤 - foreach (var action in list) + HdlThreadLogic.Current.RunMain(() => { - action(common); - } - list.Clear(); + //鏈夊彲鑳藉湪鍥炶皟鍑芥暟涓Щ闄や簡浜嬩欢锛屽鑷存姤閿欙紝鎵�浠ュ厛鏀堕泦锛屽啀璋冪敤 + foreach (var action in list) + { + action?.Invoke(common); + } + list.Clear(); + }); } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs index 1b39f3a..5565855 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs @@ -22,7 +22,7 @@ { if (topic == "AppNoLogin") { - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { //鐧诲綍瀵嗗寵宸茬粡杩囨湡,璇烽噸鏂扮櫥褰� string msg = Language.StringByID(R.MyInternationalizationString.uTokenIsOldAndLoginAgain); @@ -34,7 +34,7 @@ } else if (topic == "BeingSqueezedOffline") { - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { //姝ゅ笎鍙峰凡鍦ㄥ埆澶勭櫥褰�,鎮ㄨ杩笅绾� string msg = Language.StringByID(R.MyInternationalizationString.uHadBeenLoginAndOffLine); @@ -45,22 +45,30 @@ }); } - if (HdlGatewayLogic.Current.IsGatewayExist(gatewayId) == false) + try { - //涓嶆槸鑷繁缁戝畾鐨勭綉鍏筹紝鍒欎笉澶勭悊 - return; + if (HdlGatewayLogic.Current.IsGatewayExist(gatewayId) == false) + { + //涓嶆槸鑷繁缁戝畾鐨勭綉鍏筹紝鍒欎笉澶勭悊 + return; + } + //闂ㄩ攣涓婃姤 + if (topic == gatewayId + "/Alarms/SendAlarmInform") + { + //淇濆瓨闂ㄩ攣鎶ヨ淇℃伅鍒版湰鍦� + HdlAlarmsLogic.Current.SaveDoorLockAlarmInfo(receiveData); + + } + //閫氳繃澶栭儴鏂瑰紡甯冮槻鎾ら槻鎴愬姛鏃舵姤鍛� + else if (topic == gatewayId + "/Security/EnOrWithdrawSucceedReport") + { + SecurityEnOrWithdrawSucceedReport(receiveData); + } } - //闂ㄩ攣涓婃姤 - if (topic == gatewayId + "/Alarms/SendAlarmInform") - { - //淇濆瓨闂ㄩ攣鎶ヨ淇℃伅鍒版湰鍦� - HdlAlarmsLogic.Current.SaveDoorLockAlarmInfo(receiveData); - - } - //閫氳繃澶栭儴鏂瑰紡甯冮槻鎾ら槻鎴愬姛鏃舵姤鍛� - else if (topic == gatewayId + "/Security/EnOrWithdrawSucceedReport") + catch (Exception ex) { - SecurityEnOrWithdrawSucceedReport(receiveData); + //Log鍑哄姏 + HdlLogLogic.Current.WriteLog(ex); } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlJiguangMsgPushLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlJiguangMsgPushLogic.cs index d6d0fac..af8a585 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlJiguangMsgPushLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlJiguangMsgPushLogic.cs @@ -44,15 +44,15 @@ { if (extras.Contains("Offline") == true) { - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { //姝ゅ笎鍙峰凡鍦ㄥ埆澶勭櫥褰�,鎮ㄨ杩笅绾� string msg = Language.StringByID(R.MyInternationalizationString.uHadBeenLoginAndOffLine); var contr = new ShowMsgControl(ShowMsgType.Tip, msg); contr.Show(); + //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 + UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false); }); - //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 - UserCenterLogic.ReLoginAgain(UserCenterResourse.UserInfo.Account, false); return; } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs index 3f2e723..eba7f4b 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs @@ -42,6 +42,18 @@ /// <summary> /// Log鍑哄姏 /// </summary> + /// <param name="ex"></param> + public void WriteLog(Exception ex) + { + //Log鍑哄姏 + string msg = ex.Message + "\r\n"; + msg += ex.StackTrace; + this.WriteLog(-1, msg); + } + + /// <summary> + /// Log鍑哄姏 + /// </summary> /// <param name="div">1:鏅�歀og,-1:鑷村懡閿欒Log</param> /// <param name="strLog">Log鍐呭</param> public void WriteLog(int div, string strLog) @@ -57,8 +69,7 @@ string fileName = this.GetLogFile(div); string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory, fileName); - strLog = "[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + strLog; - strLog = UserCenterLogic.EncryptPassword("1|Oli]7p", strLog); + strLog = "[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + strLog + "\r\n"; var sw = new System.IO.StreamWriter(fullName, true, Encoding.UTF8); sw.WriteLine(strLog); sw.Close(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs index b7e2b4e..267595d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs @@ -56,10 +56,9 @@ alert.Show(); }); //Log鍑哄姏 - string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]\r\n"; - msg += ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); + string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]"; HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); } }) { IsBackground = true }.Start(); @@ -87,10 +86,9 @@ var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); alert.Show(); //Log鍑哄姏 - string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]\r\n"; - msg += ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); + string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]"; HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); } }); @@ -98,6 +96,34 @@ { IsBackground = true }.Start(); } + /// <summary> + /// 鎵ц杩愯浜庝富绾跨▼(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏) + /// </summary> + public void RunMain(Action action) + { + Application.RunOnMainThread(() => + { + //璁板綍璧峰綋鍓嶇晫闈紝铏界劧浼间箮娌″暐鐢� + string nowFormId = UserCenterResourse.NowActionFormID; + try + { + action.Invoke(); + action = null; + } + catch (Exception ex) + { + //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け + var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); + alert.Show(); + + //Log鍑哄姏 + string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]"; + HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); + } + }); + } + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs index cb79387..a6b048b 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs @@ -47,7 +47,7 @@ } var revertObj = JsonConvert.DeserializeObject<ResponsePack>(Encoding.UTF8.GetString(byteData)); //妫�娴嬫槸鍚﹀瓨鍦ㄩ敊璇俊鎭� - return CheckNotEorrorMsg(revertObj, RequestName, listNotShowError); + return CheckNotEorrorMsg(revertObj, RequestName, listNotShowError, obj); } /// <summary> @@ -114,7 +114,7 @@ } var revertObj = JsonConvert.DeserializeObject<ResponsePack>(Encoding.UTF8.GetString(byteData)); //妫�娴嬮敊璇� - bool notError = CheckNotEorrorMsg(revertObj, RequestName, listNotShowError); + bool notError = CheckNotEorrorMsg(revertObj, RequestName, listNotShowError, obj); if (notError == false) { return null; @@ -165,7 +165,7 @@ var data = JsonConvert.DeserializeObject<ResponsePack>(data2); if (data != null && string.IsNullOrEmpty(data.StateCode) == false) { - bool notError = CheckNotEorrorMsg(data, RequestName, listNotShowError); + bool notError = CheckNotEorrorMsg(data, RequestName, listNotShowError, obj); if (notError == false) { return null; @@ -256,7 +256,8 @@ /// <param name="revertObj">浠庢帴鍙f帴鏀跺埌鐨勬暟鎹�</param> /// <param name="RequestName">璇锋眰鎺ュ彛</param> /// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�)</param> - public static bool CheckNotEorrorMsg(ResponsePack revertObj, string RequestName, List<string> listNotShowError = null) + /// <param name="pra">璇锋眰鐨勫弬鏁�</param> + public static bool CheckNotEorrorMsg(ResponsePack revertObj, string RequestName, List<string> listNotShowError = null, object pra = null) { if (revertObj == null) { @@ -284,14 +285,17 @@ //濡傛灉鐢ㄦ埛宸茬粡閫�鍑轰簡鐧婚檰,鍒欎笉澶勭悊 return; } - string msg = IMessageCommon.Current.GetMsgByRequestName(RequestName, revertObj.StateCode); - var control = new ShowMsgControl(ShowMsgType.Tip, msg); - control.Show(); - - //鏃犳晥鐧诲綍Token - if (revertObj.StateCode == "NoLogin") + string msg = IMessageCommon.Current.GetMsgByRequestName(RequestName, revertObj.StateCode, pra); + if (msg != null) { - UserCenterLogic.ReLoginAgain(Config.Instance.Account, false); + var control = new ShowMsgControl(ShowMsgType.Tip, msg); + control.Show(); + + //鏃犳晥鐧诲綍Token + if (revertObj.StateCode == "NoLogin") + { + UserCenterLogic.ReLoginAgain(Config.Instance.Account, false); + } } }); @@ -395,33 +399,26 @@ UserCenterResourse.NowActionFormID = UserCenterResourse.listActionFormId[index]; if (UserCenterResourse.DicActionForm.ContainsKey(UserCenterResourse.NowActionFormID) == true) { - var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID]; - if (Myform != null) + try { - try + var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID]; + //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢 + int value = Myform.FormActionAgainEvent(); + if (value == 1) { - //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢 - 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.uUnknownErrorAndDataLost)); - alert.Show(); - //Log鍑哄姏 - string msg = ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); - HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 琚縺娲�"); } } - //閲婃斁杩欎釜鍙橀噺 - Myform = null; + catch (Exception ex) + { + //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け + var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); + alert.Show(); + + //Log鍑哄姏 + HdlLogLogic.Current.WriteLog(ex); + } } } else if (actionForm != null && actionForm is UserView.UserPage) @@ -433,9 +430,9 @@ UserCenterResourse.NowActionFormID = UserCenterResourse.listActionFormId[index]; if (UserCenterResourse.DicActionForm.ContainsKey(UserCenterResourse.NowActionFormID) == true) { - var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID]; try { + var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID]; //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢 int value = Myform.FormActionAgainEvent(); if (value == 1) @@ -451,12 +448,8 @@ alert.Show(); //Log鍑哄姏 - string msg = ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); - HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); } - //閲婃斁杩欎釜鍙橀噺 - Myform = null; } } } @@ -636,7 +629,7 @@ //閫氱煡浜戠锛屽凡缁忛��鍑虹櫥闄� var result = await CommonPage.Instance.RequestHttpsZigbeeBytesResultAsync("ZigbeeUsers/SignOut", null, "GET"); } - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { //鍏抽棴鎵�鏈夋墦寮�浜嗙殑鐣岄潰 CloseAllOpenForm(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs index 9b5bf4d..5ef4428 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs @@ -99,6 +99,10 @@ /// </summary> public const string RoomSortFile = "b1b9f1a50064016f62dea3f160703de2"; /// <summary> + /// 淇濆瓨璁惧椤哄簭鐨勩�愭枃浠躲�� + /// </summary> + public const string DeviceSortFile = "9887fffbee29c2566351e3ef2ddea279"; + /// <summary> /// 淇濆瓨Log鐨勩�愭枃浠跺す銆� /// </summary> public const string LogDirectory = "820c65b54b6f3f2a"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs index 513b50d..c6b48bf 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Common; +using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; @@ -209,18 +210,6 @@ this.AddBindRow(listRelayInfo7); //娣诲姞鑳屽厜鐏 this.AddBackLightRow(); - - //鍊熺敤Y杞村潗鏍� - var btnTemp = new BottomClickButton(); - var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount; - if (bodyFrameLayout.Height - btnTemp.Yaxis + realHeight > listview.Height) - { - //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩 - var frameTemp = new FrameLayout(); - frameTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(115); - listview.AddChidren(frameTemp); - } - btnTemp = null; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs index 6bccb26..15b929a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs @@ -36,6 +36,10 @@ /// 璁惧闇�瑕佷繚瀛樼殑璁惧鍚嶅瓧 /// </summary> private Dictionary<int, string> dicDeviceSaveName = new Dictionary<int, string>(); + /// <summary> + /// 璁惧闇�瑕佷繚瀛樼殑璁惧鍔熻兘 + /// </summary> + private Dictionary<int, DeviceFunctionType> dicDeviceFuncType = new Dictionary<int, DeviceFunctionType>(); #endregion @@ -110,6 +114,34 @@ } } } + foreach (var epoint in dicDeviceFuncType.Keys) + { + var device = Common.LocalDevice.Current.GetDevice(deviceMac, epoint); + if (device == null) + { + continue; + } + //璁剧疆鍔熻兘绫诲瀷 + device.DfunctionType = dicDeviceFuncType[epoint]; + if (device.IsCustomizeImage == true) + { + continue; + } + //閲嶆柊璁剧疆鍥剧墖 + if (device.DfunctionType == DeviceFunctionType.A寮�鍏�) + { + device.IconPath = "Device/Switch.png"; + } + else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇) + { + device.IconPath = "Device/Socket1.png"; + } + else if (device.DfunctionType == DeviceFunctionType.A鐏厜) + { + device.IconPath = "Device/Light.png"; + } + device.ReSave(); + } this.CloseProgressBar(); //鍏抽棴鑷韩 this.CloseForm(); @@ -171,18 +203,6 @@ //娣诲姞鍔熻兘绫诲瀷琛� this.AddFunctionTypeRow(); - - //鍊熺敤Y杞村潗鏍� - var btnTemp = new BottomClickButton(); - var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount; - if (bodyFrameLayout.Height - btnTemp.Yaxis + realHeight > listview.Height) - { - //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩 - var frameTemp = new FrameLayout(); - frameTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(115); - listview.AddChidren(frameTemp); - } - btnTemp = null; } #endregion @@ -252,32 +272,31 @@ { //鍔熻兘绫诲瀷 string caption = Language.StringByID(R.MyInternationalizationString.uFunctionType); + var DfunctionType = nowSelectDevice.DfunctionType; + if (this.dicDeviceFuncType.ContainsKey(nowSelectDevice.DeviceEpoint) == true) + { + DfunctionType = this.dicDeviceFuncType[nowSelectDevice.DeviceEpoint]; + } //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛� int nowSelectNo = 1; string strType = string.Empty; - if (nowSelectDevice.DfunctionType == DeviceFunctionType.A鐏厜) + if (DfunctionType == DeviceFunctionType.A鐏厜) { strType = Language.StringByID(R.MyInternationalizationString.uLight); nowSelectNo = 1; } - else if (nowSelectDevice.DfunctionType == DeviceFunctionType.A寮�鍏�) + else if (DfunctionType == DeviceFunctionType.A寮�鍏�) { strType = Language.StringByID(R.MyInternationalizationString.uSwitch); nowSelectNo = 0; } - else if (nowSelectDevice.DfunctionType == DeviceFunctionType.A鎻掑骇) + else if (DfunctionType == DeviceFunctionType.A鎻掑骇) { strType = Language.StringByID(R.MyInternationalizationString.uSocket1); nowSelectNo = 2; } - else - { - //榛樿鐏厜 - strType = Language.StringByID(R.MyInternationalizationString.uLight); - nowSelectDevice.DfunctionType = DeviceFunctionType.A鐏厜; - nowSelectDevice.ReSave(); - } + var btnFunction = new FrameCaptionViewControl(caption, strType, listview.rowSpace / 2); btnFunction.UseClickStatu = false; listview.AddChidren(btnFunction); @@ -307,19 +326,19 @@ { btnFunction.Text = listText[selectNo]; nowSelectNo = selectNo; + //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨� if (selectNo == 0) { - nowSelectDevice.DfunctionType = DeviceFunctionType.A寮�鍏�; + dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A寮�鍏�; } else if (selectNo == 1) { - nowSelectDevice.DfunctionType = DeviceFunctionType.A鐏厜; + dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A鐏厜; } else { - nowSelectDevice.DfunctionType = DeviceFunctionType.A鎻掑骇; + dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A鎻掑骇; } - nowSelectDevice.ReSave(); }; }; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs index f86a187..6d2082c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs @@ -303,7 +303,10 @@ private void AddDeviceDetailRow(FrameListControl frame, CommonDevice device) { var rowInfo = this.dicRowInfo[device.DeviceAddr]; - rowInfo.dicDetailRow = new Dictionary<string, DeviceRoomControl>(); + if (rowInfo.dicDetailRow == null) + { + rowInfo.dicDetailRow = new Dictionary<string, DeviceRoomControl>(); + } //琛屾帶浠� var rowDevice = new DeviceRoomControl(device, frame.rowSpace / 2); @@ -314,6 +317,8 @@ rowDevice.frameTable.AddBottomLine(); //鍙崇澶� rowDevice.frameTable.AddRightArrow(); + //鍦ㄧ嚎鐘舵�� + rowDevice.isOnline = device.IsOnline == 1; //淇濆瓨鎺т欢 string maikey = Common.LocalDevice.Current.GetDeviceMainKeys(device); @@ -521,28 +526,28 @@ { //杩欓噷涓昏鍙槸鑾峰彇鍦ㄧ嚎鐘舵�� var zbway = HdlGatewayLogic.Current.GetLocalGateway(gwId); - var result = await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, this.ReceiveDeviceStatuPush); + var result = await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO); }); } /// <summary> - /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ�侊紙缃戝叧鍦ㄧ嚎鎺ㄩ�佸嵆鍦ㄧ嚎锛� + /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ�� /// </summary> /// <param name="device"></param> private void ReceiveDeviceStatuPush(CommonDevice device) { lock (dicRowInfo) { - if (device == null || this.Parent == null) + if (this.Parent == null) { return; } - DeviceObjectControl row = null; + DeviceObjRowInfo rowInfo = null; if (this.dicRowInfo.ContainsKey(device.DeviceAddr) == true) { - row = this.dicRowInfo[device.DeviceAddr].MenuRow; + rowInfo = this.dicRowInfo[device.DeviceAddr]; } - if (row == null) + if (rowInfo == null || rowInfo.MenuRow == null) { return; } @@ -561,11 +566,18 @@ localDevice.ReSave(); } - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { - if (row != null) + if (rowInfo != null) { - row.isOnline = device.IsOnline == 1; + rowInfo.MenuRow.isOnline = device.IsOnline == 1; + if (rowInfo.dicDetailRow != null) + { + foreach (var detailRow in rowInfo.dicDetailRow.Values) + { + detailRow.isOnline = rowInfo.MenuRow.isOnline; + } + } } }); } @@ -707,11 +719,9 @@ /// <param name="listDevice"></param> private void MargeAllDeviceByMac(List<CommonDevice> listDevice) { - //璁惧鎺掑簭 - List<CommonDevice> listSort = Common.LocalDevice.Current.SortDeviceList(listDevice); //鏍规嵁Mac鍏ㄩ儴鍒嗙粍 var dic = new Dictionary<string, List<CommonDevice>>(); - foreach (CommonDevice device in listSort) + foreach (CommonDevice device in listDevice) { if (device == null || device.DeviceAddr == null) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs index 81a41e2..c6654c0 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -250,8 +250,13 @@ btnRow.AddRightArrow(); //搴曠嚎 btnRow.AddBottomLine(); + var doorLock = this.listNewDevice[0] as ZigBee.Device.DoorLock; btnRow.ButtonClickEvent += (sender, e) => { + var userManagement = new Shared.Phone.UserCenter.DoorLock.UserManagement(doorLock); + Shared.Phone.UserView.HomePage.Instance.AddChidren(userManagement); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + userManagement.Show(); }; } } @@ -278,10 +283,23 @@ var btnswitch = btnRow.AddMostRightSwitchIcon(); //搴曠嚎 btnRow.AddBottomLine(); + if (string.IsNullOrEmpty(ZigBee.Device.DoorLock.RemoteUnlockPassword) == false) + { + btnswitch.IsSelected = true; + } + var doorLock= (ZigBee.Device.DoorLock)listNewDevice[0]; btnswitch.ButtonClickEvent += (sender, e) => { - btnswitch.IsSelected = !btnswitch.IsSelected; + if (btnswitch.IsSelected == true) + { + btnswitch.IsSelected = false; + ZigBee.Device.DoorLock.RemoteUnlockPassword = string.Empty; + return; + } + var frame = new DoorLock.DoorLockCommonLayout(); + frame.RemotePasswordDialog((ZigBee.Device.DoorLock)listNewDevice[0], btnswitch.btnIcon); + frame = null; }; } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs index d4c903f..d942395 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs @@ -180,18 +180,6 @@ this.AddBindRow(); //娣诲姞鑳屽厜鐏 this.AddBackLightRow(); - - //鍊熺敤Y杞村潗鏍� - var btnTemp = new BottomClickButton(); - var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount; - if (bodyFrameLayout.Height - btnTemp.Yaxis + realHeight > listview.Height) - { - //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩 - var frameTemp = new FrameLayout(); - frameTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(115); - listview.AddChidren(frameTemp); - } - btnTemp = null; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs index 19e6442..422cf86 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs @@ -36,6 +36,10 @@ /// 璁惧闇�瑕佷繚瀛樼殑璁惧鍚嶅瓧 /// </summary> private Dictionary<int, string> dicDeviceSaveName = new Dictionary<int, string>(); + /// <summary> + /// 璁惧闇�瑕佷繚瀛樼殑璁惧鍔熻兘 + /// </summary> + private Dictionary<int, DeviceFunctionType> dicDeviceFuncType = new Dictionary<int, DeviceFunctionType>(); #endregion @@ -110,6 +114,34 @@ } } } + foreach (var epoint in dicDeviceFuncType.Keys) + { + var device = Common.LocalDevice.Current.GetDevice(deviceMac, epoint); + if (device == null) + { + continue; + } + //璁剧疆鍔熻兘绫诲瀷 + device.DfunctionType = dicDeviceFuncType[epoint]; + if (device.IsCustomizeImage == true) + { + continue; + } + //閲嶆柊璁剧疆鍥剧墖 + if (device.DfunctionType == DeviceFunctionType.A寮�鍏�) + { + device.IconPath = "Device/Switch.png"; + } + else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇) + { + device.IconPath = "Device/Socket1.png"; + } + else if (device.DfunctionType == DeviceFunctionType.A鐏厜) + { + device.IconPath = "Device/Light.png"; + } + device.ReSave(); + } this.CloseProgressBar(); //鍏抽棴鑷韩 this.CloseForm(); @@ -171,18 +203,6 @@ //娣诲姞鍔熻兘绫诲瀷琛� this.AddFunctionTypeRow(); - - //鍊熺敤Y杞村潗鏍� - var btnTemp = new BottomClickButton(); - var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount; - if (bodyFrameLayout.Height - btnTemp.Yaxis + realHeight > listview.Height) - { - //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩 - var frameTemp = new FrameLayout(); - frameTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(115); - listview.AddChidren(frameTemp); - } - btnTemp = null; } #endregion @@ -252,32 +272,31 @@ { //鍔熻兘绫诲瀷 string caption = Language.StringByID(R.MyInternationalizationString.uFunctionType); + var DfunctionType = nowSelectDevice.DfunctionType; + if (this.dicDeviceFuncType.ContainsKey(nowSelectDevice.DeviceEpoint) == true) + { + DfunctionType = this.dicDeviceFuncType[nowSelectDevice.DeviceEpoint]; + } //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛� int nowSelectNo = 1; string strType = string.Empty; - if (nowSelectDevice.DfunctionType == DeviceFunctionType.A鐏厜) + if (DfunctionType == DeviceFunctionType.A鐏厜) { strType = Language.StringByID(R.MyInternationalizationString.uLight); nowSelectNo = 1; } - else if (nowSelectDevice.DfunctionType == DeviceFunctionType.A寮�鍏�) + else if (DfunctionType == DeviceFunctionType.A寮�鍏�) { strType = Language.StringByID(R.MyInternationalizationString.uSwitch); nowSelectNo = 0; } - else if (nowSelectDevice.DfunctionType == DeviceFunctionType.A鎻掑骇) + else if (DfunctionType == DeviceFunctionType.A鎻掑骇) { strType = Language.StringByID(R.MyInternationalizationString.uSocket1); nowSelectNo = 2; } - else - { - //榛樿鐏厜 - strType = Language.StringByID(R.MyInternationalizationString.uLight); - nowSelectDevice.DfunctionType = DeviceFunctionType.A鐏厜; - nowSelectDevice.ReSave(); - } + var btnFunction = new FrameCaptionViewControl(caption, strType, listview.rowSpace / 2); btnFunction.UseClickStatu = false; listview.AddChidren(btnFunction); @@ -307,19 +326,19 @@ { btnFunction.Text = listText[selectNo]; nowSelectNo = selectNo; + //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨� if (selectNo == 0) { - nowSelectDevice.DfunctionType = DeviceFunctionType.A寮�鍏�; + dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A寮�鍏�; } else if (selectNo == 1) { - nowSelectDevice.DfunctionType = DeviceFunctionType.A鐏厜; + dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A鐏厜; } else { - nowSelectDevice.DfunctionType = DeviceFunctionType.A鎻掑骇; + dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A鎻掑骇; } - nowSelectDevice.ReSave(); }; }; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs new file mode 100755 index 0000000..69ed5cb --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs @@ -0,0 +1,175 @@ +锘縰sing System; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class AddUnLockMethod : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public AddUnLockMethod(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj) + { + this.doorLock = doorLock; + this.curAccountObj = accountObj; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + Shared.Phone.UserCenter.MemberInfoRes curAccountObj; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.AddNewUnlockMethod)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var bodyView = new VerticalScrolViewLayout() + { + }; + this.midFrameLayout.AddChidren(bodyView); + + for (int i = 0; i < 3; i++) + { + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(161), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, + }; + bodyView.AddChidren(RowView); + + var btnText = new Button() + { + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(300), + TextAlignment = TextAlignment.CenterLeft, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterVertical, + }; + RowView.AddChidren(btnText); + + var btnRightFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(110), + Width = Application.GetRealWidth(110), + X = Application.CurrentWidth - Application.GetRealWidth(150), + Y = Application.GetRealHeight(25), + }; + RowView.AddChidren(btnRightFrameLayout); + + var btnRight = new Button() + { + Height = Application.GetRealHeight(60), + Width = Application.GetRealWidth(60), + UnSelectedImagePath = "DoorLock/RightIcon.png", + Gravity = Gravity.Center, + }; + btnRightFrameLayout.AddChidren(btnRight); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + if (i == 0) + { + btnText.TextID = R.MyInternationalizationString.AddPassword; + } + else if (i == 1) + { + btnText.TextID = R.MyInternationalizationString.AddFingerprint; + } + else if (i == 2) + { + btnText.TextID = R.MyInternationalizationString.AddIcCard; + line2.Visible = false; + } + + int currentIndex = i; + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + if (currentIndex == 0) + { + var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "password"); + Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + addUnLockMethodTip.Show(); + } + else if (currentIndex == 1) + { + var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "fingerprint"); + Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + addUnLockMethodTip.Show(); + } + else if (currentIndex == 2) + { + var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "proximity"); + Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + addUnLockMethodTip.Show(); + } + }; + btnRight.MouseUpEventHandler += eHandler; + RowView.MouseUpEventHandler += eHandler; + 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/AddUnLockMethodFailedTip.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodFailedTip.cs new file mode 100755 index 0000000..7f19f0c --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodFailedTip.cs @@ -0,0 +1,311 @@ +锘縰sing System; +using Newtonsoft.Json.Linq; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class AddUnLockMethodFailedTip : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public AddUnLockMethodFailedTip(ZigBee.Device.DoorLock doorLock, string entryType) + { + this.doorLock = doorLock; + this.currentType = entryType; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + string currentType = string.Empty; + Action<string, string> action;//鎺ユ敹閫氱煡 + DateTime waitTime;//绛夊緟鎺ユ敹褰曞叆鐢ㄦ埛鎴愬姛鐨勬椂闂� + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + string currentTitle = ""; + if (currentType == "password") + { + currentTitle = Language.StringByID(R.MyInternationalizationString.AddPassword); + } + else if (currentType == "fingerprint") + { + currentTitle = Language.StringByID(R.MyInternationalizationString.AddFingerprint); + } + else + { + currentTitle = Language.StringByID(R.MyInternationalizationString.AddIcCard); + } + this.TopFrameLayout(this, currentTitle); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null) + { + doorLock.Gateway.GwResDataAction -= action; + } + + this.RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var topMidFrameLayout = new FrameLayout + { + X = Application.GetRealWidth(104), + Y = Application.GetRealHeight(112), + Height = Application.GetRealHeight(873), + Width = Application.GetRealWidth(876), + }; + this.midFrameLayout.AddChidren(topMidFrameLayout); + + var btnPicTip1 = new Button + { + X = Application.GetRealWidth(446), + Y = Application.GetRealHeight(330), + Height = Application.GetRealHeight(81 / 2), + Width = Application.GetRealWidth(407), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 10, + TextAlignment = TextAlignment.CenterLeft, + }; + topMidFrameLayout.AddChidren(btnPicTip1); + + var btnPicTip2 = new Button + { + X = Application.GetRealWidth(446), + Y = btnPicTip1.Bottom, + Height = Application.GetRealHeight(81 / 2), + Width = Application.GetRealWidth(207), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 10, + TextAlignment = TextAlignment.CenterLeft, + }; + topMidFrameLayout.AddChidren(btnPicTip2); + + var btnPicTip3 = new Button + { + X = Application.GetRealWidth(294), + Y = Application.GetRealHeight(1089), + Height = Application.GetRealHeight(173 / 2), + Width = Application.GetRealWidth(488), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterHorizontal, + TextSize = 14, + }; + this.midFrameLayout.AddChidren(btnPicTip3); + + var btnPicTip4 = new Button + { + X = Application.GetRealWidth(397), + Y = btnPicTip3.Bottom, + Width = Application.GetRealWidth(288), + Height = Application.GetRealHeight(173 / 2), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterHorizontal, + TextSize = 14, + }; + this.midFrameLayout.AddChidren(btnPicTip4); + + var btnPicTip5 = new Button + { + X = Application.GetRealWidth(202), + Y = Application.GetRealHeight(1388), + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(674), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterHorizontal, + TextSize = 12, + }; + this.midFrameLayout.AddChidren(btnPicTip5); + + var nextBtn = new Button + { + X = Application.GetRealWidth(86), + Y = Application.GetRealHeight(1472), + Height = Application.GetRealHeight(127), + Width = Application.GetRealWidth(907), + Text = Language.StringByID(R.MyInternationalizationString.NextStep), + TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + Gravity = Gravity.CenterHorizontal, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Radius = 10, + TextSize = 20, + Visible = false, + }; + this.midFrameLayout.AddChidren(nextBtn); + + if (currentType == "password") + { + topMidFrameLayout.BackgroundImagePath = "DoorLock/AddPasswordTicPic.png"; + btnPicTip1.Width = Application.GetRealWidth(307); + btnPicTip1.X = Application.GetRealWidth(500); + btnPicTip1.Y = Application.GetRealHeight(350); + btnPicTip2.X = Application.GetRealWidth(543); + btnPicTip2.Y = btnPicTip1.Bottom + Application.GetRealHeight(10); + btnPicTip2.Width = Application.GetRealWidth(207); + btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryPasswordTip1); + btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryPassword); + btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryPasswordTip2); + btnPicTip4.Text = btnPicTip2.Text; + btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip); + } + else if (currentType == "fingerprint") + { + topMidFrameLayout.BackgroundImagePath = "DoorLock/AddFingerprintTipPic.png"; + btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprintTip1); + btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprint); + btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprintTip2); + btnPicTip4.Text = btnPicTip2.Text; + btnPicTip1.X = Application.GetRealWidth(486); + btnPicTip1.Y = Application.GetRealHeight(320); + btnPicTip2.X = Application.GetRealWidth(543); + btnPicTip2.Width = Application.GetRealWidth(207); + btnPicTip1.X = Application.GetRealWidth(450); + btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip); + } + else + { + topMidFrameLayout.BackgroundImagePath = "DoorLock/AddIcCardTipPic.png"; + btnPicTip3.Width = Application.GetRealWidth(495); + btnPicTip1.X = Application.GetRealWidth(440); + btnPicTip1.Y = Application.GetRealHeight(313); + btnPicTip2.X = Application.GetRealWidth(538); + btnPicTip2.Width = Application.GetRealWidth(207); + btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityTip1); + btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityCard); + btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityTip2); + btnPicTip4.Text = btnPicTip2.Text; + btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip); + } + + action = (topic, data) => + { + var gatewayID = topic.Split('/')[0]; + var jObjectdata = JObject.Parse(data); + if (jObjectdata == null) + { + return; + } + if (topic == $"{gatewayID}/DoorLock/DoorLockOperatingEventNotificationCommand") + { + var OperatingEventNotificationDatad = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockOperatingEventNotificationCommand>(jObjectdata["Data"].ToString()); + if (OperatingEventNotificationDatad != null) + { + doorLock.doorLockOperatingEventNotificationCommand = OperatingEventNotificationDatad; + } + } + if (topic == $"{gatewayID}/DoorLock/DoorLockProgrammingEventNotificationCommand") + { + var ProgrammingEventNotificationData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockProgrammingEventNotificationCommand>(jObjectdata["Data"].ToString()); + if (ProgrammingEventNotificationData != null) + { + Application.RunOnMainThread(() => + { + nextBtn.Visible = true; + }); + doorLock.doorLockProgrammingEventNotificationCommand = ProgrammingEventNotificationData; + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = ProgrammingEventNotificationData.UserID; + localDoorLockObj.UnlockType = ProgrammingEventNotificationData.ProgramEventSoure; + var entryTime = ZigBee.Device.DoorLock.GetLocalTime(ProgrammingEventNotificationData.ZigbeeLocalTime, false); + localDoorLockObj.EntryTime = entryTime; + doorLock.localDoorLockUserList.Add(ProgrammingEventNotificationData.UserID, localDoorLockObj); + } + } + }; + + if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null) + { + doorLock.Gateway.GwResDataAction += action; + } + + nextBtn.MouseDownEventHandler += (sende, e) => + { + waitTime = DateTime.Now; + doorLock.doorLockProgrammingEventNotificationCommand = null; + new System.Threading.Thread(async () => + { + while ((DateTime.Now - waitTime).TotalMilliseconds < 5000) + { + await System.Threading.Tasks.Task.Delay(10); + if (doorLock.doorLockProgrammingEventNotificationCommand != null) + { + //var entryStatusPage = new Shared.Phone.UserCenter.DoorLock.EntryStatusPage(doorLock,accountObj, currentType); + //Shared.Phone.UserView.HomePage.Instance.AddChidren(entryStatusPage); + //Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + //entryStatusPage.Show(); + //this.RemoveFromParent(); + break; + } + } + + if ((DateTime.Now - waitTime).TotalMilliseconds > 5000) + { + var addUnLockMethodFailedTip = new Shared.Phone.UserCenter.DoorLock.AddUnLockMethodFailedTip(doorLock, currentType); + Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodFailedTip); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + addUnLockMethodFailedTip.Show(); + this.RemoveFromParent(); + } + }) + { IsBackground = true }.Start(); + }; + + btnPicTip1.MouseDownEventHandler += (sende, e) => + { + nextBtn.Visible = true; + }; + } + + + #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 new file mode 100755 index 0000000..86e098e --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs @@ -0,0 +1,286 @@ +锘縰sing System; +using Newtonsoft.Json.Linq; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class AddUnLockMethodTip : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public AddUnLockMethodTip(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj, string entryType) + { + this.doorLock = doorLock; + this.curAccountObj = accountObj; + this.currentType = entryType; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + Shared.Phone.UserCenter.MemberInfoRes curAccountObj; + string currentType = string.Empty; + Action<string, string> action;//鎺ユ敹閫氱煡 + + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + string currentTitle = ""; + if (currentType == "password") + { + currentTitle = Language.StringByID(R.MyInternationalizationString.AddPassword); + } + else if (currentType == "fingerprint") + { + currentTitle = Language.StringByID(R.MyInternationalizationString.AddFingerprint); + } + else + { + currentTitle = Language.StringByID(R.MyInternationalizationString.AddIcCard); + } + this.TopFrameLayout(this, currentTitle); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null) + { + doorLock.Gateway.GwResDataAction -= action; + } + + this.RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var topMidFrameLayout = new FrameLayout + { + X = Application.GetRealWidth(104), + Y = Application.GetRealHeight(112), + Height = Application.GetRealHeight(873), + Width = Application.GetRealWidth(876), + }; + this.midFrameLayout.AddChidren(topMidFrameLayout); + + var btnPicTip1 = new Button + { + X = Application.GetRealWidth(446), + Y = Application.GetRealHeight(330), + Height = Application.GetRealHeight(81 / 2), + Width = Application.GetRealWidth(407), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 10, + TextAlignment = TextAlignment.CenterLeft, + }; + topMidFrameLayout.AddChidren(btnPicTip1); + + var btnPicTip2 = new Button + { + X = Application.GetRealWidth(446), + Y = btnPicTip1.Bottom, + Height = Application.GetRealHeight(81 / 2), + Width = Application.GetRealWidth(207), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 10, + TextAlignment = TextAlignment.CenterLeft, + }; + topMidFrameLayout.AddChidren(btnPicTip2); + + var btnPicTip3 = new Button + { + X = Application.GetRealWidth(294), + Y = Application.GetRealHeight(1089), + Height = Application.GetRealHeight(173 / 2), + Width = Application.GetRealWidth(488), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterHorizontal, + TextSize = 14, + }; + this.midFrameLayout.AddChidren(btnPicTip3); + + var btnPicTip4 = new Button + { + X = Application.GetRealWidth(397), + Y = btnPicTip3.Bottom, + Width = Application.GetRealWidth(288), + Height = Application.GetRealHeight(173 / 2), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterHorizontal, + TextSize = 14, + }; + this.midFrameLayout.AddChidren(btnPicTip4); + + var btnPicTip5 = new Button + { + X = Application.GetRealWidth(202), + Y = Application.GetRealHeight(1388), + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(674), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterHorizontal, + TextSize = 12, + }; + this.midFrameLayout.AddChidren(btnPicTip5); + + var nextBtn = new Button + { + X = Application.GetRealWidth(86), + Y = Application.GetRealHeight(1472), + Height = Application.GetRealHeight(127), + Width = Application.GetRealWidth(907), + Text = Language.StringByID(R.MyInternationalizationString.NextStep), + TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + Gravity = Gravity.CenterHorizontal, + Radius = 10, + TextSize = 20, + Enable = false, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect, + }; + this.midFrameLayout.AddChidren(nextBtn); + + if (currentType == "password") + { + topMidFrameLayout.BackgroundImagePath = "DoorLock/AddPasswordTicPic.png"; + btnPicTip1.Width = Application.GetRealWidth(307); + btnPicTip1.X = Application.GetRealWidth(500); + btnPicTip1.Y = Application.GetRealHeight(350); + btnPicTip2.X = Application.GetRealWidth(543); + btnPicTip2.Y = btnPicTip1.Bottom + Application.GetRealHeight(10); + btnPicTip2.Width = Application.GetRealWidth(207); + btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryPasswordTip1); + btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryPassword); + btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryPasswordTip2); + btnPicTip4.Text = btnPicTip2.Text; + btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip); + } + else if (currentType == "fingerprint") + { + topMidFrameLayout.BackgroundImagePath = "DoorLock/AddFingerprintTipPic.png"; + btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprintTip1); + btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprint); + btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprintTip2); + btnPicTip4.Text = btnPicTip2.Text; + btnPicTip1.X = Application.GetRealWidth(486); + btnPicTip1.Y = Application.GetRealHeight(320); + btnPicTip2.X = Application.GetRealWidth(543); + btnPicTip2.Width = Application.GetRealWidth(207); + btnPicTip1.X = Application.GetRealWidth(450); + btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip); + } + else + { + topMidFrameLayout.BackgroundImagePath = "DoorLock/AddIcCardTipPic.png"; + btnPicTip3.Width = Application.GetRealWidth(495); + btnPicTip1.X = Application.GetRealWidth(440); + btnPicTip1.Y = Application.GetRealHeight(313); + btnPicTip2.X = Application.GetRealWidth(538); + btnPicTip2.Width = Application.GetRealWidth(207); + btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityTip1); + btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityCard); + btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityTip2); + btnPicTip4.Text = btnPicTip2.Text; + btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip); + } + + action = (topic, data) => + { + var gatewayID = topic.Split('/')[0]; + var jObjectdata = JObject.Parse(data); + if (jObjectdata == null) + { + return; + } + if (topic == $"{gatewayID}/DoorLock/DoorLockOperatingEventNotificationCommand") + { + var OperatingEventNotificationDatad = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockOperatingEventNotificationCommand>(jObjectdata["Data"].ToString()); + if (OperatingEventNotificationDatad != null) + { + doorLock.doorLockOperatingEventNotificationCommand = OperatingEventNotificationDatad; + } + } + if (topic == $"{gatewayID}/DoorLock/DoorLockProgrammingEventNotificationCommand") + { + var ProgrammingEventNotificationData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockProgrammingEventNotificationCommand>(jObjectdata["Data"].ToString()); + if (ProgrammingEventNotificationData != null) + { + doorLock.doorLockProgrammingEventNotificationCommand = ProgrammingEventNotificationData; + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = ProgrammingEventNotificationData.UserID; + localDoorLockObj.UnlockType = ProgrammingEventNotificationData.ProgramEventSoure; + var entryTime = ZigBee.Device.DoorLock.GetLocalTime(ProgrammingEventNotificationData.ZigbeeLocalTime, false); + localDoorLockObj.EntryTime = entryTime; + if (!doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj.UserID)) + { + doorLock.localDoorLockUserList.Add(ProgrammingEventNotificationData.UserID, localDoorLockObj); + } + Application.RunOnMainThread(() => + { + nextBtn.Enable = true; + nextBtn.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; + }); + } + } + }; + + if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null) + { + doorLock.Gateway.GwResDataAction += action; + } + + nextBtn.MouseDownEventHandler += (sende, e) => + { + var entryStatusPage = new Shared.Phone.UserCenter.DoorLock.EntryStatusPage(doorLock, curAccountObj, currentType); + Shared.Phone.UserView.HomePage.Instance.AddChidren(entryStatusPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + entryStatusPage.Show(); + this.RemoveFromParent(); + }; + } + + + #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 new file mode 100755 index 0000000..43f56ba --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs @@ -0,0 +1,439 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class DoorLockCommonInfo : ZigBee.Device.DoorLock + { + public DoorLockCommonInfo() + { + } + + public class DoorLockFingerprintInfo + { + /// <summary> + /// 鎸囩汗澶囨敞 + /// </summary> + public string fingerprintRemark = string.Empty; + /// <summary> + /// 鎸囩汗鍥剧墖 + /// </summary> + public string fingerprintImage = string.Empty; + } + + /// <summary> + /// 鎵�鏈夋柟寮忛�夋嫨 + /// </summary> + public void SideslipFramelayout(ZigBee.Device.DoorLock doorLock) + { + //var dialog = new Dialog + //{ + //}; + //dialog.Show(); + + //var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; + //dialog.AddChidren(flMain); + //flMain.MouseUpEventHandler += (sender11, e11) => + //{ + // dialog.Close(); + //}; + + //var sidelipFrameLayout = new FrameLayout() + //{ + // Height = Application.GetRealHeight(625), + // Width = Application.GetRealWidth(449), + // Y = Application.GetRealHeight(115 + 160), + // X = Application.GetRealWidth(596), + // BackgroundImagePath = "DoorLock/SideslipPic.png", + //}; + //flMain.AddChidren(sidelipFrameLayout); + + //var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout() + //{ + // Height = Application.GetRealHeight(600), + // Y = Application.GetRealHeight(28), + //}; + //sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout); + //Button oldbutton = null; + //Button oldbuttonText = null; + //for (var i = 0; i < 4; i++) + //{ + // var rowFrameLayout = new RowLayout() + // { + // Height = Application.GetRealHeight(150), + // }; + // sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); + + // var btnAllMethod = new Button() + // { + // Width = Application.GetRealWidth(81), + // Height = Application.GetRealHeight(81), + // X = Application.GetRealWidth(81), + // Y = Application.GetRealHeight(55), + // }; + // rowFrameLayout.AddChidren(btnAllMethod); + + // var btnMethodText = new Button() + // { + // Width = Application.GetRealWidth(311), + // Height = Application.GetRealHeight(58), + // X = Application.GetRealWidth(173), + // Y = Application.GetRealHeight(69), + // TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + // TextSize = 14, + // TextAlignment = TextAlignment.CenterLeft, + // }; + // rowFrameLayout.AddChidren(btnMethodText); + + // EventHandler<MouseEventArgs> hander = (sender, e) => + // { + // if (!btnAllMethod.IsSelected) + // { + // if (oldbutton != null) + // { + // oldbutton.IsSelected = false; + // } + // if (oldbuttonText != null) + // { + // oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; + // } + // oldbutton = btnAllMethod; + // oldbuttonText = btnMethodText; + // doorLock.currentUserDisplayMethod = btnMethodText.Text; + // btnAllMethod.IsSelected = true; + // oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + + // // 绫诲瀷鍖哄垎 + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod)) + // { + // RefreshList(); + // } + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock)) + // { + // DisplayByType(0); + // } + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock)) + // { + // DisplayByType(15); + // } + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock)) + // { + // DisplayByType(3); + // } + // } + // dialog.Close(); + // }; + // rowFrameLayout.MouseUpEventHandler += hander; + // btnAllMethod.MouseUpEventHandler += hander; + // btnMethodText.MouseUpEventHandler += hander; + + // switch (i) + // { + // case 0: + // btnAllMethod.UnSelectedImagePath = "DoorLock/AllMethod.png"; + // btnAllMethod.SelectedImagePath = "DoorLock/AllMethodOn.png"; + // btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.AllMethod); + // break; + // case 1: + // btnAllMethod.UnSelectedImagePath = "DoorLock/Password.png"; + // btnAllMethod.SelectedImagePath = "DoorLock/PasswordOn.png"; + // btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock); + // break; + // case 2: + // btnAllMethod.UnSelectedImagePath = "DoorLock/Fingerprint.png"; + // btnAllMethod.SelectedImagePath = "DoorLock/FingerprintOn.png"; + // btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock); + // break; + // case 3: + // btnAllMethod.UnSelectedImagePath = "DoorLock/proximityCard.png"; + // btnAllMethod.SelectedImagePath = "DoorLock/proximityCardOn.png"; + // btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock); + // break; + // } + + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0) + // { + // btnAllMethod.IsSelected = true; + // btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + // oldbutton = btnAllMethod; + // oldbuttonText = btnMethodText; + // } + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1) + // { + // btnAllMethod.IsSelected = true; + // btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + // oldbutton = btnAllMethod; + // oldbuttonText = btnMethodText; + // } + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2) + // { + // btnAllMethod.IsSelected = true; + // btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + // oldbutton = btnAllMethod; + // oldbuttonText = btnMethodText; + // } + // if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3) + // { + // btnAllMethod.IsSelected = true; + // btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + // oldbutton = btnAllMethod; + // oldbuttonText = btnMethodText; + // } + //} + } + + /// <summary> + /// 閫氳繃绫诲瀷绛涢�夋樉绀� + /// </summary> + public void DisplayByType(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes curAccountObj, int unlockMethod, VerticalScrolViewLayout bodyView, Button entryStatusPic, Button btnPicTip, Button btnPicTip1) + { + //bodyView.RemoveAll(); + //var curAccountDoorLockUserList = new Dictionary<int, ZigBee.Device.DoorLock.LocaDoorLockObj>(); + + //foreach (var curUserId in doorLock.localDoorLockUserList.Keys) + //{ + // var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; + + // if (curDoorLockUser.ConnectedAccount == "" || curDoorLockUser.ConnectedAccount != curAccountObj.SubAccountDistributedMark) + // { + // continue; + // } + // else + // { + // curAccountDoorLockUserList.Add(curDoorLockUser.UserID, curDoorLockUser); + // } + //} + + //if (curAccountDoorLockUserList.Count == 0) + //{ + // entryStatusPic.Visible = true; + // btnPicTip.Visible = true; + // btnPicTip1.Visible = true; + //} + //else + //{ + // entryStatusPic.Visible = false; + // btnPicTip.Visible = false; + // btnPicTip1.Visible = false; + //} + + //foreach (var curUserId in curAccountDoorLockUserList.Keys) + //{ + // var curDoorLockUser = curAccountDoorLockUserList[curUserId]; + // if (curDoorLockUser.UnlockType != unlockMethod) + // { + // continue; + // } + // #region UI + // var rowFrameLayout = new RowLayout() + // { + // Height = Application.GetRealHeight(173), + // X = Application.GetRealWidth(58), + // Width = Application.GetRealWidth(965), + // LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + // }; + // bodyView.AddChidren(rowFrameLayout); + + // var btnPicFrameLayout = new FrameLayout() + // { + // Width = Application.GetRealWidth(81), + // Height = Application.GetRealHeight(81), + // X = Application.GetRealWidth(40), + // Y = Application.GetRealHeight(49), + // }; + // rowFrameLayout.AddChidren(btnPicFrameLayout); + + // var btnPic = new Button() + // { + // Width = Application.GetRealWidth(84), + // Height = Application.GetRealHeight(84), + // UnSelectedImagePath = "DoorLock/DoorLockUserPic.png", + // }; + // btnPicFrameLayout.AddChidren(btnPic); + + // var btnDoorlockUser = new EditText() + // { + // Width = Application.GetRealWidth(1080 - 173), + // Height = Application.GetRealHeight(60), + // X = Application.GetRealWidth(173), + // Y = Application.GetRealHeight(35), + // TextSize = 14, + // PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + // TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + // TextAlignment = TextAlignment.CenterLeft, + // }; + // rowFrameLayout.AddChidren(btnDoorlockUser); + + // var btnMember = new Button() + // { + // Width = Application.GetRealWidth(1080 - 173), + // Height = Application.GetRealHeight(49), + // X = Application.GetRealWidth(173), + // Y = Application.GetRealHeight(95), + // TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + // TextSize = 14, + // TextAlignment = TextAlignment.CenterLeft, + // }; + // rowFrameLayout.AddChidren(btnMember); + + // var btnDel = new Button() + // { + // Width = Application.GetRealWidth(1080 - 173), + // Height = Application.GetRealHeight(49), + // X = Application.GetRealWidth(173), + // Y = Application.GetRealHeight(95), + // Text = Language.StringByID(R.MyInternationalizationString.Delete), + // TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + // TextSize = 12, + // TextAlignment = TextAlignment.Center, + // BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel, + // }; + // rowFrameLayout.AddRightView(btnDel); + // #endregion + // #region 鏁版嵁澶勭悊 + // switch (curDoorLockUser.UnlockType) + // { + // case 0: + // if (curDoorLockUser.UserName != "") + // { + // btnDoorlockUser.Text = curDoorLockUser.UserName; + // } + // else + // { + // btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; + // } + // break; + // case 3: + // if (curDoorLockUser.UserName != "") + // { + // btnDoorlockUser.Text = curDoorLockUser.UserName; + // } + // else + // { + // btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; + // } + // break; + // case 15: + // if (curDoorLockUser.UserName != "") + // { + // btnDoorlockUser.Text = curDoorLockUser.UserName; + // } + // else + // { + // btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; + // } + // break; + // } + + // if (curAccountObj.UserName == "") + // { + // btnMember.Text = curAccountObj.Account; + // } + // else + // { + // btnMember.Text = curAccountObj.UserName; + // } + + // Action<Shared.View> action = async (obj) => + // { + // var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData(); + // refreshDoorLockData.CloudAccountId = curAccountObj.SubAccountDistributedMark; + // if (doorLock.DeviceAddr != null) + // { + // refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + // } + // refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType; + // refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + // refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; + // refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text; + // var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/UpdateDoorLock", refreshDoorLockData); + // if (result.StateCode == "Success") + // { + // if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + // { + // doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + // var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + // localDoorLockObj.UserID = curDoorLockUser.UserID; + // localDoorLockObj.UnlockType = curDoorLockUser.UnlockType; + // localDoorLockObj.EntryTime = curDoorLockUser.EntryTime; + // localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks; + // localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark; + // doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj); + // RefreshList(); + // } + // } + // else + // { + // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + // } + // }; + // btnDoorlockUser.EditorEnterAction += action; + + // btnDel.MouseUpEventHandler += (sender, e) => + // { + // var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod), + // Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim)); + // alert.Show(); + // alert.ResultEventHandler += async (sender1, e1) => + // { + // if (e1) + // { + // var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser); + // var resultData = await doorLock.DefaultControlAsync(passData); + // if (resultData != null && resultData.responseData != null) + // { + // if (resultData.responseData.status == 0) + // { + // var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData(); + // if (doorLock.DeviceAddr != null) + // { + // deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + // } + // deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + // deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; + // deleteDoorLockData.DelDoorLockDelType = 2; + // var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/DelDoorLock", deleteDoorLockData); + // if (result.StateCode == "Success") + // { + // if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + // { + // doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + // var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + // localDoorLockObj.UserID = curDoorLockUser.UserID; + + // //new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveSuccess), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); + // doorLock.localDoorLockUserList.Remove(curUserId); + // RefreshList(); + // } + // } + // else + // { + // if (curDoorLockUser.UserID < 10) + // { + + // } + // else + // { + // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + // } + // } + // } + // else + // { + // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); + // } + + // } + // else + // { + // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); + // } + // } + // }; + // }; + // #endregion + //} + } + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs new file mode 100755 index 0000000..aa8a2a9 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs @@ -0,0 +1,392 @@ +锘縰sing System; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class DoorLockCommonLayout : FrameLayout + { + public DoorLockCommonLayout() + { + + } + #region 鈼� 鍙橀噺鐢虫槑__________________________ + public FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout }; + public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1921 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout }; + public FrameLayout bottomRadiusFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(100), + Y = Application.GetRealHeight(930), + Radius = 17, + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + public FrameLayout titleFrameLayout = new FrameLayout + { + Y = Application.GetRealHeight(92), + Height = Application.GetRealHeight(69), + }; + + /// <summary> + /// 鏍囬杩斿洖甯冨眬 + /// </summary> + public FrameLayout btnBackFrameLayout = new FrameLayout + { + X = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(58), + }; + + /// <summary> + /// 鏍囬杩斿洖鎸夐敭 + /// </summary> + public Button btnBack = new Button + { + Height = Application.GetRealHeight(51), + Width = Application.GetRealWidth(30), + UnSelectedImagePath = "DoorLock/Left.png", + }; + + /// <summary> + /// 鏍囬涓嬬嚎 + /// </summary> + public Button btnTitleLine = new Button + { + Y = Application.GetRealHeight(181), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine, + }; + + /// <summary> + /// 寮圭獥鍙栨秷鎸夐敭 + /// </summary> + public Button dialogBtnCancel = new Button + { + Width = Application.GetRealWidth(397), + Height = Application.GetRealHeight(127), + Y = Application.GetRealHeight(380), + TextID = R.MyInternationalizationString.Cancel, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout, + }; + + + #endregion + + /// <summary> + /// 闂ㄩ攣椤堕儴甯冨眬 + /// </summary> + /// <param name="frameLayout"></param> + public void TopFrameLayout(FrameLayout frameLayout, string titleText) + { + this.AddChidren(topFrameLayout); + topFrameLayout.AddChidren(titleFrameLayout); + topFrameLayout.AddChidren(btnTitleLine); + var title = new Button() + { + TextAlignment = TextAlignment.CenterLeft, + Text = titleText, + TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, + X = Application.GetRealWidth(161), + Width = Application.GetRealWidth(1080 - 161), + Height = Application.GetRealWidth(69), + TextSize = 17, + }; + titleFrameLayout.AddChidren(title); + titleFrameLayout.AddChidren(btnBackFrameLayout); + btnBackFrameLayout.AddChidren(btnBack); + } + /// <summary> + /// 闂ㄩ攣涓儴甯冨眬 + /// </summary> + /// <param name="frameLayout"></param> + public void MidFrameLayout(FrameLayout frameLayout) + { + //midFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBackgroundColor; + midFrameLayout.Y = topFrameLayout.Bottom; + this.AddChidren(midFrameLayout); + } + + /// <summary> + /// 闂ㄩ攣搴曢儴甯冨眬 + /// </summary> + /// <param name="frameLayout"></param> + public void BottomFrameLayout(FrameLayout frameLayout) + { + var bottomFrameLayout1 = new FrameLayout() + { + Height = Application.GetRealHeight(806 - 50), + Y = Application.GetRealHeight(930 + 48), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(bottomFrameLayout1); + } + + /// <summary> + /// 杩滅▼鎺у埗鏉冮檺澶勭悊 + /// </summary> + /// <param name="btnNext"></param> + public void RemotePasswordDialog(ZigBee.Device.DoorLock doorLock, Button btnNext) + { + var dialog = new Dialog { }; + var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.BindDoorLock)); + doorDialog.Show(); + doorDialog.dialogMidFraFrameLayout.Width = Application.GetRealWidth(677); + doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(69); + doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(58); + doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(213); + doorDialog.dialogMidFraFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBorder; + + var editInputPassword = new EditText() + { + Width = Application.GetRealWidth(672), + Height = Application.GetRealHeight(63), + X = Application.GetRealWidth(3), + Y = Application.GetRealHeight(3), + TextSize = 14, + PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + PlaceholderText = Language.StringByID(R.MyInternationalizationString.InputUnlockPasswrd), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, + }; + doorDialog.dialogMidFraFrameLayout.AddChidren(editInputPassword); + + doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) => + { + btnNext.IsSelected = false; + dialog.Close(); + }; + DateTime oldTime = DateTime.MaxValue; + doorDialog.dialogBtnConfirm.MouseUpEventHandler += async (sender1, e1) => + { + Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); + if (DateTime.Now < ZigBee.Device.DoorLock.minValue) + { + CommonPage.Loading.Hide(); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AfterThirtySeconds), Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(editInputPassword); + return; + } + + if (DateTime.Now >= oldTime && ZigBee.Device.DoorLock.RemoteUnlockCount == 0) + { + ZigBee.Device.DoorLock.RemoteUnlockCount = 3; + oldTime = DateTime.MaxValue; + } + + if (ZigBee.Device.DoorLock.RemoteUnlockCount <= 0) + { + ZigBee.Device.DoorLock.minValue = DateTime.Now.AddSeconds(+20); + oldTime = ZigBee.Device.DoorLock.minValue; + CommonPage.Loading.Hide(); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AfterThirtySeconds), Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(editInputPassword); + return; + } + + if (editInputPassword.Text.Length != 6) + { + ZigBee.Device.DoorLock.RemoteUnlockCount--; + string tipText = Language.StringByID(R.MyInternationalizationString.PasswordError) + "," + Language.StringByID(R.MyInternationalizationString.Surplus) + ZigBee.Device.DoorLock.RemoteUnlockCount.ToString() + Language.StringByID(R.MyInternationalizationString.Opportunity); + CommonPage.Loading.Hide(); + new Tip() { MaxWidth = 150, Text = tipText, Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(editInputPassword); + return; + } + + var verifyResult = await doorLock.VerifyPasswordAsync(editInputPassword.Text); + if (verifyResult != null && verifyResult.result == 0) + { + System.Threading.Thread.Sleep(500); + ZigBee.Device.DoorLock.RemoteUnlockPassword = editInputPassword.Text; + ZigBee.Device.DoorLock.minValue = DateTime.MinValue; + ZigBee.Device.DoorLock.RemoteUnlockCount = 3; + oldTime = DateTime.MaxValue; + CommonPage.Loading.Hide(); + dialog.Close(); + btnNext.IsSelected = true; + + if (!UserCenterResourse.Option.DoorUnLockByRemote) + { + var dialog2 = new Dialog { }; + var doorDialog2 = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog2, Language.StringByID(R.MyInternationalizationString.Tip)); + doorDialog2.Show(); + doorDialog2.dialogMidFraFrameLayout.Width = Application.GetRealWidth(674); + doorDialog2.dialogMidFraFrameLayout.Height = Application.GetRealHeight(115); + doorDialog2.dialogMidFraFrameLayout.X = Application.GetRealWidth(60); + doorDialog2.dialogMidFraFrameLayout.Y = Application.GetRealHeight(167); + doorDialog2.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.GoSetting); + var midText1 = new Button() + { + Width = Application.GetRealWidth(674), + Height = Application.GetRealHeight(115 / 2), + TextSize = 14, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.Center, + TextID = R.MyInternationalizationString.RemoteUnlockBindSucessTip1, + }; + doorDialog2.dialogMidFraFrameLayout.AddChidren(midText1); + var midText2 = new Button() + { + Width = Application.GetRealWidth(674), + Height = Application.GetRealHeight(115 / 2), + Y = Application.GetRealHeight(115 / 2), + TextSize = 14, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.Center, + TextID = R.MyInternationalizationString.RemoteUnlockBindSucessTip2, + }; + doorDialog2.dialogMidFraFrameLayout.AddChidren(midText2); + + doorDialog2.dialogBtnCancel.MouseUpEventHandler += (sender2, e2) => + { + dialog2.Close(); + }; + doorDialog2.dialogBtnConfirm.MouseUpEventHandler += async (sender2, e2) => + { + var form = new UserCenter.UserMain.SecondAuthenticationForm(); + form.AddForm(); + dialog2.Close(); + }; + } + } + else + { + ZigBee.Device.DoorLock.RemoteUnlockCount--; + string tipText = Language.StringByID(R.MyInternationalizationString.OperrateFailed) + "," + Language.StringByID(R.MyInternationalizationString.Surplus) + ZigBee.Device.DoorLock.RemoteUnlockCount.ToString() + Language.StringByID(R.MyInternationalizationString.Opportunity); + CommonPage.Loading.Hide(); + new Tip() { MaxWidth = 150, Text = tipText, Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show((View)sender1); + return; + } + }; + } + + /// <summary> + /// + /// </summary> + /// <param name="doorLock">闂ㄩ攣璁惧</param> + /// <param name="action">浜屾楠岃瘉鐨勭粨鏋滄垚鍔熷悗鐨勯�氱煡</param> + /// <param name="progressButton">闂ㄩ攣寮�鎴栧叧鏃惰繘搴︽樉绀�</param> + /// <param name="btnDoorLockPic">闂ㄩ攣鍥剧墖寮�/鍏虫樉绀�</param> + public void RemoteUnlockRequest(ZigBee.Device.DoorLock doorLock, Action action, Button progressButton, Button btnDoorLockPic, Button btnStatus) + { + if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") + { + var dialog = new Dialog { }; + var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.Tip)); + doorDialog.Show(); + doorDialog.dialogMidFraFrameLayout.Width = Application.GetRealWidth(415); + doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58); + doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(190); + doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202); + doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); + doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.BindRemoteUnlockDoorlock); + doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); + doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.GoSetting); + doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) => + { + dialog.Close(); + }; + doorDialog.dialogBtnConfirm.MouseUpEventHandler += (sender1, e1) => + { + var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock); + Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + userDoorLockPage.Show(); + dialog.Close(); + }; + return; + } + + if (!UserCenterResourse.Option.DoorUnLockByRemote) + { + var dialog2 = new Dialog { }; + var doorDialog2 = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog2, Language.StringByID(R.MyInternationalizationString.Tip)); + doorDialog2.Show(); + doorDialog2.dialogMidFraFrameLayout.Width = Application.GetRealWidth(674); + doorDialog2.dialogMidFraFrameLayout.Height = Application.GetRealHeight(115); + doorDialog2.dialogMidFraFrameLayout.X = Application.GetRealWidth(60); + doorDialog2.dialogMidFraFrameLayout.Y = Application.GetRealHeight(167); + doorDialog2.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.GoSetting); + var midText1 = new Button() + { + Width = Application.GetRealWidth(674), + Height = Application.GetRealHeight(115 / 2), + TextSize = 14, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.Center, + TextID = R.MyInternationalizationString.GoPersonalCenter, + }; + doorDialog2.dialogMidFraFrameLayout.AddChidren(midText1); + var midText2 = new Button() + { + Width = Application.GetRealWidth(674), + Height = Application.GetRealHeight(115 / 2), + Y = Application.GetRealHeight(115 / 2), + TextSize = 14, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.Center, + TextID = R.MyInternationalizationString.OpenRemoteVerification, + }; + doorDialog2.dialogMidFraFrameLayout.AddChidren(midText2); + + doorDialog2.dialogBtnCancel.MouseUpEventHandler += (sender2, e2) => + { + dialog2.Close(); + }; + doorDialog2.dialogBtnConfirm.MouseUpEventHandler += async (sender2, e2) => + { + var form = new UserCenter.UserMain.SecondAuthenticationForm(); + form.AddForm(); + dialog2.Close(); + }; + return; + } + + var dialog3 = new Dialog { }; + var doorDialog3 = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog3, Language.StringByID(R.MyInternationalizationString.UnlockRequest)); + doorDialog3.Show(); + doorDialog3.dialogMidFraFrameLayout.Width = Application.GetRealWidth(415); + doorDialog3.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58); + doorDialog3.dialogMidFraFrameLayout.X = Application.GetRealWidth(228); + doorDialog3.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202); + doorDialog3.dialogMidFraFrameLayout.AddChidren(doorDialog3.dialogMidText); + doorDialog3.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.SureToOpenDoorLock); + doorDialog3.dialogMidFraFrameLayout.AddChidren(doorDialog3.dialogMidText); + doorDialog3.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.Confrim); + doorDialog3.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) => + { + dialog3.Close(); + }; + doorDialog3.dialogBtnConfirm.MouseUpEventHandler += (sender1, e1) => + { + action = async () => + { + //杩滅▼寮�閿� + progressButton.Y = Application.GetRealHeight(10); + btnDoorLockPic.IsSelected = true; + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Opening); + Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); + var remoteControlResult = await doorLock.RemoteControlAsync(ZigBee.Device.DoorLock.RemoteUnlockPassword); + + if (remoteControlResult != null && remoteControlResult.responseData != null && remoteControlResult.responseData.status == 0) + { + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Opening); + System.Threading.Thread.Sleep(2000); + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.DoorLockOpen); + System.Threading.Thread.Sleep(3000); + progressButton.Y = Application.GetRealHeight(347); + btnDoorLockPic.IsSelected = false; + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose); + CommonPage.Loading.Hide(); + } + else + { + progressButton.Y = Application.GetRealHeight(347); + btnDoorLockPic.IsSelected = false; + CommonPage.Loading.Hide(); + } + }; + HdlCheckLogic.Current.CheckSecondarySecurity(action); + dialog3.Close(); + }; + } + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockListPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockListPage.cs new file mode 100755 index 0000000..7dc7039 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockListPage.cs @@ -0,0 +1,189 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class DoorLockListPage : FrameLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鎸夐敭妯″紡鎺ユ敹 + /// </summary> + /// <param name="common">Common.</param> + public void Changed(CommonDevice common) + { + //if (common.Type != ZigBee.Device.DeviceType.OnOffSwitch) + //{ + // return; + //} + + Shared.Application.RunOnMainThread(() => + { + //var dev = common as Panel; + }); + } + + #region 鍙橀噺澹版槑 + /// <summary> + /// 鍒楄〃鎺т欢 + /// </summary> + private VerticalScrolViewLayout listView = null; + /// <summary> + /// 闂ㄩ攣璁惧鍒楄〃 + /// </summary> + private List<ZigBee.Device.CommonDevice> localDoorLocklist = new List<ZigBee.Device.CommonDevice>(); + #endregion + + /// <summary> + /// 鐣岄潰鍔犺浇 + /// </summary> + public void Show() + { + #region topFrameLayout 锛堝彧鏈塙I锛屾棤鏁版嵁澶勭悊锛� + var topFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(220), + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor, + }; + this.AddChidren(topFrameLayout); + + var titleFrameLayout = new FrameLayout() + { + Y = Application.GetRealHeight(80), + Height = Application.GetRealHeight(140), + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor, + }; + topFrameLayout.AddChidren(titleFrameLayout); + + var title = new Button() + { + TextAlignment = TextAlignment.Center, + Text = Language.StringByID(R.MyInternationalizationString.DoorLock), + TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor, + Width = Application.GetRealWidth(1080 - 500), + Gravity = Gravity.CenterHorizontal, + }; + titleFrameLayout.AddChidren(title); + var back = new Button() + { + X = Application.GetRealWidth(50), + Height = Application.GetRealHeight(100), + Width = Application.GetRealWidth(100), + UnSelectedImagePath = "Item/Back.png", + SelectedImagePath = "Item/BackOn.png", + Gravity = Gravity.CenterVertical, + }; + titleFrameLayout.AddChidren(back); + #endregion + + #region midFrameLayout + var midFrameLayout = new FrameLayout() + { + Width = LayoutParams.MatchParent, + Height = Application.GetRealHeight(1920 - 220), + Y = topFrameLayout.Bottom, + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBackgroundColor, + }; + this.AddChidren(midFrameLayout); + + listView = new VerticalScrolViewLayout(); + midFrameLayout.AddChidren(listView); + #endregion + + #region 鏁版嵁淇℃伅澶勭悊 + listView.RemoveAll(); + localDoorLocklist.Clear(); + + //foreach (var dev in Shared.Common.LocalDevice.Current.listAllDevice) + //{ + // if(dev.Type ==ZigBee.Device.DeviceType.DoorLock) + // { + // localDoorLocklist.Add(dev); + // } + //} + + //娴嬭瘯浠g爜 + for (int i = 0; i < 3; i++) + { + var tempDoorLock = new ZigBee.Device.DoorLock(); + localDoorLocklist.Add(tempDoorLock); + } + + foreach (var doorLock in localDoorLocklist) + { + this.AddDoorLockRow(doorLock); + } + #endregion + } + + /// <summary> + /// 娣诲姞璁惧鐨勮彍鍗曡 + /// </summary> + /// <param name="listDevice">璁惧瀵硅薄</param> + private void AddDoorLockRow(ZigBee.Device.CommonDevice doorLock) + { + var doorLockView = new RowLayout() + { + Height = Application.GetRealHeight(180), + }; + listView.AddChidren(doorLockView); + + var btnPoint = new Button() + { + Width = Application.GetRealWidth(10), + Height = Application.GetRealHeight(10), + X = Application.GetRealWidth(40), + Gravity = Gravity.CenterVertical, + //UnSelectedImagePath = "Item/Point.png", + //SelectedImagePath = "Item/Point.png", + }; + doorLockView.AddChidren(btnPoint); + + var tempDeviceName = new Button() + { + Width = Application.GetRealWidth(340), + X = btnPoint.Right + Application.GetRealWidth(20), + TextAlignment = TextAlignment.CenterLeft, + Text = "闂ㄩ攣1", + TextColor = 0xff000000, + Tag = doorLock, + }; + doorLockView.AddChidren(tempDeviceName); + + var btnRight = new Button() + { + Height = Application.GetRealHeight(110), + Width = Application.GetRealWidth(110), + UnSelectedImagePath = "Item/Next.png", + SelectedImagePath = "Item/Down.png", + Gravity = Gravity.CenterVertical, + X = Application.CurrentWidth - Application.GetRealWidth(150), + }; + doorLockView.AddChidren(btnRight); + + EventHandler<MouseEventArgs> openDoorLockControlPageEvent = (button, mouseEventArgs) => + { + //var doorLockManagement = new Shared.Phone.UserCenter.DoorLock.DoorLockManagement(); + //Shared.Phone.UserView.HomePage.Instance.AddChidren(doorLockManagement); + //Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + //doorLockManagement.Show(); + }; + doorLockView.MouseUpEventHandler += openDoorLockControlPageEvent; + tempDeviceName.MouseUpEventHandler += openDoorLockControlPageEvent; + btnRight.MouseUpEventHandler += openDoorLockControlPageEvent; + } + + public void DeviceInfoChange(CommonDevice common, string typeTag) + { + } + + public void ChangedILogicStatus(ZigBee.Device.Logic logic) + { + } + + public void ChangedISceneStatus(Scene scene) + { + } + } +} \ No newline at end of file diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockUserMangement.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockUserMangement.cs new file mode 100755 index 0000000..97e4c56 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockUserMangement.cs @@ -0,0 +1,130 @@ +锘縰sing System; +namespace Shared.Phone.UserCenter.DoorLock +{ + public class DoorLockUserMangement : DoorLockCommonLayout + { + + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public DoorLockUserMangement(ZigBee.Device.DoorLock doorLock) + { + this.doorLock = doorLock; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.UserManagement)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + public void MidFrameLayoutContent() + { + var bodyView = new VerticalScrolViewLayout() + { + }; + this.midFrameLayout.AddChidren(bodyView); + + for (int i = 0; i < 3; i++) + { + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(110), + }; + bodyView.AddChidren(RowView); + + var btnIcon = new Button() + { + Width = Application.GetRealHeight(13), + Height = Application.GetRealHeight(13), + X = Application.GetRealWidth(40), + UnSelectedImagePath = "Item/Point.png", + SelectedImagePath = "Item/PointSelected.png", + Gravity = Gravity.CenterVertical, + }; + RowView.AddChidren(btnIcon); + + var UnEditedItem = new Button() + { + X = btnIcon.Right + Application.GetRealWidth(20), + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(110), + TextAlignment = TextAlignment.CenterLeft, + }; + RowView.AddChidren(UnEditedItem); + if (i == 0) + { + UnEditedItem.TextID = R.MyInternationalizationString.UneditFingerprint; + } + else if (i == 1) + { + UnEditedItem.TextID = R.MyInternationalizationString.PasswordList; + } + else if (i == 2) + { + UnEditedItem.TextID = R.MyInternationalizationString.ProximityCard; + } + + var btnRight = new Button() + { + Width = Application.GetRealWidth(28), + Height = Application.GetRealHeight(40), + X = UnEditedItem.Right + Application.GetRealWidth(200), + UnSelectedImagePath = "Item/Right.png", + SelectedImagePath = "Item/RightSelected.png", + Gravity = Gravity.CenterVertical, + }; + RowView.AddChidren(btnRight); + + var line2 = new Button() + { + Y = RowView.Height - 1, + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + int currentIndex = i; + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + if (currentIndex == 0) + { + //new FingerPrint(tempDoorLock).Show(); + } + else if (currentIndex == 1) + { + //PasswordList passwordListView = new PasswordList(tempDoorLock); + //UserMiddle.DevicePageView.AddChidren(passwordListView); + //passwordListView.ShowUserPasswordPrint(); + //UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1; + } + else if (currentIndex == 2) + { + //new ProximityCard(tempDoorLock).Show(); + } + }; + btnRight.MouseUpEventHandler += eHandler; + btnIcon.MouseUpEventHandler += eHandler; + RowView.MouseUpEventHandler += eHandler; + UnEditedItem.MouseUpEventHandler += eHandler; + } + } + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorlockDialog.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorlockDialog.cs new file mode 100755 index 0000000..9d870a5 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorlockDialog.cs @@ -0,0 +1,99 @@ +锘縰sing System; +using Android.Icu.Lang; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class DoorlockDialog : FrameLayout + { + public DoorlockDialog(Dialog dialog, string title) + { + this.dialog = dialog; + this.title = title; + } + public string title = string.Empty; + public Dialog dialog; + + /// <summary> + /// 寮圭獥鍙栨秷鎸夐敭 + /// </summary> + public Button dialogBtnCancel = new Button + { + Width = Application.GetRealWidth(397), + Height = Application.GetRealHeight(127), + Y = Application.GetRealHeight(380), + TextID = R.MyInternationalizationString.Cancel, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout, + }; + + /// <summary> + /// 寮圭獥纭鎸夐敭 + /// </summary> + public Button dialogBtnConfirm = new Button + { + Width = Application.GetRealWidth(398), + Height = Application.GetRealHeight(128), + X = Application.GetRealWidth(397), + Y = Application.GetRealHeight(380), + TextID = R.MyInternationalizationString.confrim, + TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, + }; + + /// <summary> + /// 寮圭獥涓儴甯冨眬 + /// </summary> + public FrameLayout dialogMidFraFrameLayout = new FrameLayout + { + Width = Application.GetRealWidth(415), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(190), + Y = Application.GetRealHeight(202), + }; + + /// <summary> + /// 寮圭獥涓儴鏂囨湰 + /// </summary> + public Button dialogMidText = new Button + { + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + + public void Show() + { + dialog.Show(); + + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; + dialog.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + dialog.Close(); + }; + + var dialogFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(380 + 127), + Width = Application.GetRealWidth(792), + Y = Application.GetRealHeight(691 - 184), + X = Application.GetRealWidth(144), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(dialogFrameLayout); + + var dialogTitle = new Button() + { + Width = Application.GetRealWidth(492), + Height = Application.GetRealHeight(63), + X = Application.GetRealWidth(150), + Y = Application.GetRealHeight(69), + Text = title, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + }; + dialogFrameLayout.AddChidren(dialogTitle); + + dialogFrameLayout.AddChidren(dialogMidFraFrameLayout); + dialogFrameLayout.AddChidren(dialogBtnConfirm); + dialogFrameLayout.AddChidren(dialogBtnCancel); + } + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs new file mode 100755 index 0000000..ed813a1 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs @@ -0,0 +1,442 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using Shared.Common; +using Shared.Phone.UserCenter.Device; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class EntryStatusPage : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public EntryStatusPage(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj, string entryType) + { + this.doorLock = doorLock; + this.curAccountObj = accountObj; + this.currentType = entryType; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + Shared.Phone.UserCenter.MemberInfoRes curAccountObj; + string currentType = string.Empty; + FrameLayout bottomFrameLayout; + + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.AddNewUnlockMethod)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var entryStatusPic = new Button + { + X = Application.GetRealWidth(297), + Y = Application.GetRealHeight(268), + Height = Application.GetRealHeight(363), + Width = Application.GetRealWidth(452), + UnSelectedImagePath = "DoorLock/EntrySuccessIcon.png", + }; + this.midFrameLayout.AddChidren(entryStatusPic); + + var btnPicTip = new Button + { + X = Application.GetRealWidth(372), + Y = Application.GetRealHeight(634), + Height = Application.GetRealHeight(81), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterHorizontal, + TextSize = 20, + }; + this.midFrameLayout.AddChidren(btnPicTip); + + if (currentType == "password") + { + btnPicTip.Text = Language.StringByID(R.MyInternationalizationString.EntryPasswordSuccess); + } + else if (currentType == "fingerprint") + { + btnPicTip.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprintSuccess); + } + else + { + btnPicTip.Text = Language.StringByID(R.MyInternationalizationString.EntryProximitySuccess); + } + + BottomFrameLayoutContent(); + } + + public void BottomFrameLayoutContent() + { + bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(737), + Y = Application.GetRealHeight(999), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(bottomFrameLayout); + + var passwordRemarkFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = Application.GetRealHeight(127), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(81), + }; + bottomFrameLayout.AddChidren(passwordRemarkFrameLayout); + + var btnPasswordRemark = new Button() + { + Width = Application.GetRealWidth(222), + Height = Application.GetRealHeight(58), + Y = Application.GetRealHeight(35), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, + }; + passwordRemarkFrameLayout.AddChidren(btnPasswordRemark); + + var btnPasswordRemarkContent = new EditText() + { + Width = Application.GetRealWidth(965 - 222), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(223), + Y = Application.GetRealHeight(35), + TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, + PlaceholderTextColor = ZigbeeColor.Current.XMGray3, + TextColor = ZigbeeColor.Current.XMBlack + }; + passwordRemarkFrameLayout.AddChidren(btnPasswordRemarkContent); + + var btnLine = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = Application.GetRealHeight(5), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(81 + 127), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + bottomFrameLayout.AddChidren(btnLine); + + var personRemarkRemarkFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = Application.GetRealHeight(127), + X = Application.GetRealWidth(58), + Y = btnLine.Bottom + Application.GetRealHeight(2), + }; + bottomFrameLayout.AddChidren(personRemarkRemarkFrameLayout); + + var btnMatchPersonRemark = new Button() + { + Width = Application.GetRealWidth(222), + Height = Application.GetRealHeight(58), + Y = Application.GetRealHeight(35), + Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, + }; + personRemarkRemarkFrameLayout.AddChidren(btnMatchPersonRemark); + + var btnMatchPersonContent = new Button() + { + Width = Application.GetRealWidth(965 - 222), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(223), + Y = Application.GetRealHeight(35), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, + Text = curAccountObj.UserName, + }; + personRemarkRemarkFrameLayout.AddChidren(btnMatchPersonContent); + + var completeBtn = new Button + { + X = Application.GetRealWidth(86), + Y = Application.GetRealHeight(472), + Height = Application.GetRealHeight(127), + Width = Application.GetRealWidth(907), + Text = Language.StringByID(R.MyInternationalizationString.DoorLockComplete), + TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + Gravity = Gravity.CenterHorizontal, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Radius = 10, + TextSize = 16, + }; + bottomFrameLayout.AddChidren(completeBtn); + + if (currentType == "password") + { + btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.PasswordRemark); + btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.Password) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID; + } + else if (currentType == "fingerprint") + { + btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.FingerprintRemark); + btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID; + } + else + { + btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.ProximityRemark); + btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.ProximityCard) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID; + } + + completeBtn.MouseDownEventHandler += async (sender, e) => + { + completeBtn.Enable = false; + var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData(); + addLockInfo.CloudAccountId = curAccountObj.SubAccountDistributedMark; + if (doorLock.DeviceAddr != null) + { + addLockInfo.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + addLockInfo.OpenLockMode = doorLock.doorLockProgrammingEventNotificationCommand.ProgramEventSoure; + addLockInfo.DoorLockLocalUserId = doorLock.doorLockProgrammingEventNotificationCommand.UserID.ToString(); + var entryTime = ZigBee.Device.DoorLock.GetLocalTime(doorLock.doorLockProgrammingEventNotificationCommand.ZigbeeLocalTime, false); + addLockInfo.EntryTime = entryTime; + if (btnPasswordRemarkContent.Text != "") + { + addLockInfo.UserIdRemarks = btnPasswordRemarkContent.Text; + } + else + { + addLockInfo.UserIdRemarks = btnPasswordRemarkContent.PlaceholderText; + } + try + { + var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/AddDoorLock", addLockInfo); + if (result.StateCode == "Success") + { + if (doorLock.localDoorLockUserList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID)) + { + doorLock.localDoorLockUserList.Remove(doorLock.doorLockProgrammingEventNotificationCommand.UserID); + + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = doorLock.doorLockProgrammingEventNotificationCommand.UserID; + localDoorLockObj.UnlockType = addLockInfo.OpenLockMode; + localDoorLockObj.EntryTime = addLockInfo.EntryTime; + localDoorLockObj.UserName = addLockInfo.UserIdRemarks; + localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark; + doorLock.localDoorLockUserList.Add(doorLock.doorLockProgrammingEventNotificationCommand.UserID, localDoorLockObj); + + completeBtn.Enable = true; + this.RemoveFromParent(); + + for (int i = UserView.HomePage.Instance.ChildrenCount - 1; i >= 0; i--) + { + var form = UserView.HomePage.Instance.GetChildren(i); + + if (form is UnLockMethod) + { + ((UnLockMethod)form).RefreshList(); + break; + } + else + { + form.RemoveFromParent(); + } + } + } + } + else + { + completeBtn.Enable = true; + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent); + } + } + catch { } + }; + } + + public void MatchUsersFrameLayout() + { + var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; + this.midFrameLayout.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + BottomFrameLayoutContent(); + }; + bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(100), + Y = Application.GetRealHeight(930), + Radius = 17, + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout); + + var bottomFrameLayout1 = new FrameLayout() + { + Height = Application.GetRealHeight(806 - 50), + Y = Application.GetRealHeight(930 + 48), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout1); + + var bottomFrameLayout2 = new FrameLayout() + { + Height = Application.GetRealHeight(806), + Y = Application.GetRealHeight(930), + }; + flMain.AddChidren(bottomFrameLayout2); + + var matchUsersFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(138), + }; + bottomFrameLayout2.AddChidren(matchUsersFrameLayout); + + var btnCancel = new Button + { + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(40), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(101), + Text = Language.StringByID(R.MyInternationalizationString.Cancel), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnCancel); + + var btnMatchUser = new Button + { + X = Application.GetRealWidth(446), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(63), + Width = Application.GetRealWidth(284), + Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 16, + }; + matchUsersFrameLayout.AddChidren(btnMatchUser); + + var btnFinish = 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.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnFinish); + + var btnTopLine = new FrameLayout() + { + Height = Application.GetRealHeight(5), + Y = Application.GetRealHeight(138), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + bottomFrameLayout2.AddChidren(btnTopLine); + + var matchUserHorizontalScrolViewLayout = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(207), + Height = Application.GetRealHeight(806 - 207), + }; + bottomFrameLayout2.AddChidren(matchUserHorizontalScrolViewLayout); + + for (var i = 0; i < 4; i++) + { + var rowFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(127), + }; + matchUserHorizontalScrolViewLayout.AddChidren(rowFrameLayout); + + var btnUserName = new Button() + { + Width = Application.GetRealWidth(743), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(37), + Text = "Krafty", + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnUserName); + + var btnChoose = new Button() + { + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(861 + 81), + Y = Application.GetRealHeight(35), + BackgroundColor = ZigbeeColor.Current.XMOrange, + }; + rowFrameLayout.AddChidren(btnChoose); + + var btnLine = new FrameLayout() + { + Width = Application.GetRealWidth(919), + Height = Application.GetRealHeight(5), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(122), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + rowFrameLayout.AddChidren(btnLine); + } + } + + #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 new file mode 100755 index 0000000..9548ee7 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs @@ -0,0 +1,317 @@ +锘縰sing System; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class FunctionSetting : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public FunctionSetting(ZigBee.Device.DoorLock doorLock) + { + this.doorLock = doorLock; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + ZigBee.Device.ZbGateway.StatusList.Add(this); + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.FunctionSetting)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + + } + + public void MidFrameLayoutContent() + { + + var MidTopFrameLayout = new FrameLayout() + { + X = Application.GetRealWidth(449), + Y = Application.GetRealHeight(58), + Width = Application.GetRealWidth(184), + Height = Application.GetRealHeight(184), + BackgroundImagePath = "DoorLock/DoorlockPicture.png", + }; + this.midFrameLayout.AddChidren(MidTopFrameLayout); + BottomFrameLayout(); + } + + public void BottomFrameLayout() + { + #region UI + var bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(100), + Y = Application.GetRealHeight(418), + Radius = 17, + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(bottomFrameLayout); + + var bottomFrameLayout1 = new FrameLayout() + { + Height = Application.GetRealHeight(1319 - 50), + Y = Application.GetRealHeight(418 + 48), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(bottomFrameLayout1); + + var bottomFrameLayout2 = new FrameLayout() + { + Height = Application.GetRealHeight(1319), + Y = Application.GetRealHeight(418), + }; + this.midFrameLayout.AddChidren(bottomFrameLayout2); + + var informationEdit = new Button() + { + Height = Application.GetRealHeight(60), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(81), + Text = Language.StringByID(R.MyInternationalizationString.InformationEdit), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + }; + bottomFrameLayout2.AddChidren(informationEdit); + + for (int i = 0; i < 7; i++) + { + var btnName = new Button() + { + Width = Application.GetRealWidth(233), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(58), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + }; + bottomFrameLayout2.AddChidren(btnName); + + var btnNextFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(104), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(861 + 58), + }; + bottomFrameLayout2.AddChidren(btnNextFrameLayout); + + var btnNext = new Button() + { + Width = Application.GetRealWidth(60), + Height = Application.GetRealHeight(60), + }; + btnNextFrameLayout.AddChidren(btnNext); + + var btnLine = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = Application.GetRealHeight(5), + X = Application.GetRealWidth(58), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + Visible = false, + }; + bottomFrameLayout2.AddChidren(btnLine); + + if (i == 0) + { + btnName.Y = Application.GetRealHeight(204); + btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceName) + ":"; + + btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); + btnNextFrameLayout.Y = btnName.Y; + btnNextFrameLayout.X = btnName.Right; + + btnNext.TextAlignment = TextAlignment.CenterLeft; + btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + btnNext.Text = "鏅鸿兘闂ㄩ攣"; + + btnLine.Visible = true; + btnLine.Y = Application.GetRealHeight(308); + } + else if (i == 1) + { + btnName.Y = Application.GetRealHeight(343); + btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongZone) + ":"; + + var btnArea = new Button() + { + Width = Application.GetRealWidth(789 - 109 - 58), + Height = Application.GetRealHeight(58), + X = btnName.Right, + Y = btnName.Y, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Text = "涓�妤硷紝瀹㈠巺", + TextAlignment = TextAlignment.CenterLeft, + }; + bottomFrameLayout2.AddChidren(btnArea); + + btnNextFrameLayout.Y = btnName.Y; + btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; + + btnLine.Visible = true; + btnLine.Y = Application.GetRealHeight(446); + + btnNext.MouseDownEventHandler += (sender, e) => + { + + }; + } + else if (i == 2) + { + btnName.Y = Application.GetRealHeight(481); + btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongModel) + ":"; + btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); + btnNextFrameLayout.Y = btnName.Y; + btnNextFrameLayout.X = btnName.Right; + + btnNext.TextAlignment = TextAlignment.CenterLeft; + btnNext.Height = Application.GetRealHeight(58); + btnNext.Text = "HDL-Doorlock"; + btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + + btnLine.Visible = true; + btnLine.Y = Application.GetRealHeight(1025 - 449); + } + else if (i == 3) + { + btnName.Y = Application.GetRealHeight(585 + 35); + btnName.Text = Language.StringByID(R.MyInternationalizationString.TemporaryPassword); + + btnNextFrameLayout.Y = btnName.Y; + btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; + + btnLine.Visible = true; + btnLine.Y = Application.GetRealHeight(619 + 58 + 35); + } + else if (i == 4) + { + btnName.Y = Application.GetRealHeight(723 + 35); + btnName.Text = Language.StringByID(R.MyInternationalizationString.RemotelyUnlock); + + btnNextFrameLayout.Y = btnName.Y; + btnNext.Width = Application.GetRealWidth(104); + btnNext.Height = Application.GetRealHeight(63); + btnNext.UnSelectedImagePath = "DoorLock/Switch.png"; + btnNext.SelectedImagePath = "DoorLock/SwitchOn.png"; + + btnLine.Visible = true; + btnLine.Y = Application.GetRealHeight(723 + 127); + + if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") + { + btnNext.IsSelected = false; + } + else + { + btnNext.IsSelected = true; + } + + EventHandler<MouseEventArgs> eHandlerRemotelyUnlock = (sender, e) => + { + btnNext.IsSelected = !btnNext.IsSelected; + if (btnNext.IsSelected) + { + if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") + { + RemotePasswordDialog(doorLock, btnNext); + } + } + return; + }; + btnNext.MouseDownEventHandler += eHandlerRemotelyUnlock; + btnName.MouseDownEventHandler += eHandlerRemotelyUnlock; + btnNextFrameLayout.MouseDownEventHandler += eHandlerRemotelyUnlock; + } + else if (i == 5) + { + btnName.Y = Application.GetRealHeight(861 + 35); + btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime); + + btnNextFrameLayout.Y = btnName.Y; + btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; + + btnLine.Visible = true; + btnLine.Y = Application.GetRealHeight(861 + 127); + EventHandler<MouseEventArgs> eHandlerDoorLockTime = (sender, e) => + { + var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "InValidTime"); + Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + tempPage.Show(); + }; + btnNext.MouseDownEventHandler += eHandlerDoorLockTime; + btnName.MouseDownEventHandler += eHandlerDoorLockTime; + btnNextFrameLayout.MouseDownEventHandler += eHandlerDoorLockTime; + } + else if (i == 6) + { + btnName.Y = Application.GetRealHeight(999 + 35); + btnName.Text = Language.StringByID(R.MyInternationalizationString.Shared); + + btnNextFrameLayout.Y = btnName.Y; + btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; + + btnLine.Visible = true; + btnLine.Y = Application.GetRealHeight(999 + 127); + } + #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/HistoryRecordPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/HistoryRecordPage.cs new file mode 100755 index 0000000..b544093 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/HistoryRecordPage.cs @@ -0,0 +1,703 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class HistoryRecordPage : DoorLockCommonLayout, ZigBee.Common.IStatus + { + public HistoryRecordPage(ZigBee.Device.DoorLock doorLock) + { + this.doorLock = doorLock; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + ZigBee.Device.ZbGateway.StatusList.Add(this); + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + FrameLayout bottomFrameLayout; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.HistoryRecord)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + var btnClearAll = new Button + { + X = Application.GetRealWidth(953), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + //UnSelectedImagePath = "Item/Back.png", + //SelectedImagePath = "Item/BackOn.png", + BackgroundColor = ZigbeeColor.Current.XMOrange, + }; + this.titleFrameLayout.AddChidren(btnClearAll); + btnClearAll.MouseDownEventHandler += (sender, e) => + { + + }; + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var midTopFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(115), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout, + }; + this.midFrameLayout.AddChidren(midTopFrameLayout); + + #region UI + var btnAllMember = new Button() + { + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(141), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.Center, + Text = Language.StringByID(R.MyInternationalizationString.AllMember), + TextSize = 12, + }; + midTopFrameLayout.AddChidren(btnAllMember); + + var btnAllMemberPic = new Button() + { + X = Application.GetRealWidth(222), + Y = Application.GetRealHeight(23), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, + }; + midTopFrameLayout.AddChidren(btnAllMemberPic); + + var btnLockMethod = new Button() + { + X = Application.GetRealWidth(348), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(141), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.Center, + Text = Language.StringByID(R.MyInternationalizationString.LockMethod), + TextSize = 12, + }; + midTopFrameLayout.AddChidren(btnLockMethod); + + var btnLockMethodPic = new Button() + { + X = Application.GetRealWidth(490), + Y = Application.GetRealHeight(23), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, + }; + midTopFrameLayout.AddChidren(btnLockMethodPic); + + var btnDate = new Button() + { + X = Application.GetRealWidth(746), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(207), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.Center, + Text = Language.StringByID(R.MyInternationalizationString.AllDate), + TextSize = 12, + }; + midTopFrameLayout.AddChidren(btnDate); + + var btnDatePic = new Button() + { + X = Application.GetRealWidth(953), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, + }; + midTopFrameLayout.AddChidren(btnDatePic); + #endregion + + #region 浜嬩欢澶勭悊 + btnAllMemberPic.MouseUpEventHandler += (sender, e) => + { + MatchUsersFrameLayout(); + }; + btnLockMethodPic.MouseUpEventHandler += (sender, e) => + { + LockMethodFrameLayout(); + }; + btnDatePic.MouseUpEventHandler += (sender, e) => + { + LockDateFrameLayout(); + }; + #endregion + + HistoryRecordList(); + } + + public void HistoryRecordList() + { + var bodyView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(118), + }; + this.midFrameLayout.AddChidren(bodyView); + + for (int i = 0; i < 3; i++) + { + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(161), + }; + bodyView.AddChidren(RowView); + + var btnPic = new Button() + { + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(46), + Height = Application.GetRealHeight(81), + Width = Application.GetRealWidth(81), + //UnSelectedImagePath = "Item/Next.png", + //SelectedImagePath = "Item/Down.png", + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, + }; + RowView.AddChidren(btnPic); + + var btnMemberName = new Button() + { + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(35), + Width = Application.GetRealWidth(276), + Height = Application.GetRealHeight(60), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, + Text = "Krafty", + }; + RowView.AddChidren(btnMemberName); + + var btnRight = new Button() + { + X = Application.GetRealWidth(645), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(377), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.CenterRight, + TextSize = 14, + Text = "11:00:00", + }; + RowView.AddChidren(btnRight); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + int currentIndex = i; + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + //var doorLock = new ZigBee.Device.DoorLock(); + //var memberFrozenPage = new Shared.Phone.UserCenter.DoorLock.MemberFrozenPage(doorLock); + //Shared.Phone.UserView.HomePage.Instance.AddChidren(memberFrozenPage); + //Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + //memberFrozenPage.Show(); + }; + btnRight.MouseUpEventHandler += eHandler; + RowView.MouseUpEventHandler += eHandler; + } + } + + public void MatchUsersFrameLayout() + { + var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; + this.midFrameLayout.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + HistoryRecordList(); + }; + bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(100), + Y = Application.GetRealHeight(930), + Radius = 17, + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout); + + var bottomFrameLayout1 = new FrameLayout() + { + Height = Application.GetRealHeight(806 - 50), + Y = Application.GetRealHeight(930 + 48), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout1); + + var bottomFrameLayout2 = new FrameLayout() + { + Height = Application.GetRealHeight(806), + Y = Application.GetRealHeight(930), + }; + flMain.AddChidren(bottomFrameLayout2); + + var matchUsersFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(138), + }; + bottomFrameLayout2.AddChidren(matchUsersFrameLayout); + + var btnCancel = new Button + { + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(40), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(101), + Text = Language.StringByID(R.MyInternationalizationString.Cancel), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnCancel); + + var btnMatchUser = new Button + { + X = Application.GetRealWidth(446), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(63), + Width = Application.GetRealWidth(284), + Text = Language.StringByID(R.MyInternationalizationString.uMember), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 16, + }; + matchUsersFrameLayout.AddChidren(btnMatchUser); + + var btnFinish = 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.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnFinish); + + var btnTopLine = new FrameLayout() + { + Height = Application.GetRealHeight(5), + Y = Application.GetRealHeight(138), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + bottomFrameLayout2.AddChidren(btnTopLine); + + var allUsersFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(207), + Y = Application.GetRealHeight(138 + 5), + }; + bottomFrameLayout2.AddChidren(allUsersFrameLayout); + + var btnAllMember = new Button + { + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(69), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(625), + Text = Language.StringByID(R.MyInternationalizationString.AllMember), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + allUsersFrameLayout.AddChidren(btnAllMember); + + var btnAllChoose = new Button + { + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(861 + 81), + Y = Application.GetRealHeight(69), + BackgroundColor = ZigbeeColor.Current.XMOrange, + }; + allUsersFrameLayout.AddChidren(btnAllChoose); + + var btnMidLine = new FrameLayout() + { + Height = Application.GetRealHeight(5), + Y = Application.GetRealHeight(207 + 127), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + bottomFrameLayout2.AddChidren(btnMidLine); + + var matchUserHorizontalScrolViewLayout = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(207 + 127 + 5), + Height = Application.GetRealHeight(806 - 207 - 127), + }; + bottomFrameLayout2.AddChidren(matchUserHorizontalScrolViewLayout); + + for (var i = 0; i < 3; i++) + { + var rowFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(127), + }; + matchUserHorizontalScrolViewLayout.AddChidren(rowFrameLayout); + + var btnUserName = new Button() + { + Width = Application.GetRealWidth(743), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(37), + Text = "Krafty", + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnUserName); + + var btnChoose = new Button() + { + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(861 + 81), + Y = Application.GetRealHeight(35), + BackgroundColor = ZigbeeColor.Current.XMOrange, + }; + rowFrameLayout.AddChidren(btnChoose); + + var btnLine = new FrameLayout() + { + Width = Application.GetRealWidth(919), + Height = Application.GetRealHeight(5), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(122), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + rowFrameLayout.AddChidren(btnLine); + } + } + + public void LockMethodFrameLayout() + { + var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; + this.midFrameLayout.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + HistoryRecordList(); + }; + bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(100), + Y = Application.GetRealHeight(930), + Radius = 17, + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout); + + var bottomFrameLayout1 = new FrameLayout() + { + Height = Application.GetRealHeight(806 - 50), + Y = Application.GetRealHeight(930 + 48), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout1); + + var bottomFrameLayout2 = new FrameLayout() + { + Height = Application.GetRealHeight(806), + Y = Application.GetRealHeight(930), + }; + flMain.AddChidren(bottomFrameLayout2); + + var matchUsersFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(138), + }; + bottomFrameLayout2.AddChidren(matchUsersFrameLayout); + + var btnCancel = new Button + { + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(40), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(101), + Text = Language.StringByID(R.MyInternationalizationString.Cancel), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnCancel); + + var btnMatchUser = new Button + { + X = Application.GetRealWidth(446), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(63), + Width = Application.GetRealWidth(284), + Text = Language.StringByID(R.MyInternationalizationString.LockMethod), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 16, + }; + matchUsersFrameLayout.AddChidren(btnMatchUser); + + var btnFinish = 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.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnFinish); + + var btnTopLine = new FrameLayout() + { + Height = Application.GetRealHeight(5), + Y = Application.GetRealHeight(138), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + bottomFrameLayout2.AddChidren(btnTopLine); + + var matchUserHorizontalScrolViewLayout = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(207), + Height = Application.GetRealHeight(806 - 207), + }; + bottomFrameLayout2.AddChidren(matchUserHorizontalScrolViewLayout); + + for (var i = 0; i < 4; i++) + { + var rowFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(127), + }; + matchUserHorizontalScrolViewLayout.AddChidren(rowFrameLayout); + + var btnUserName = new Button() + { + Width = Application.GetRealWidth(743), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(37), + TextSize = 14, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnUserName); + + var btnChoose = new Button() + { + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(861 + 81), + Y = Application.GetRealHeight(35), + BackgroundColor = ZigbeeColor.Current.XMOrange, + }; + rowFrameLayout.AddChidren(btnChoose); + + var btnLine = new FrameLayout() + { + Width = Application.GetRealWidth(919), + Height = Application.GetRealHeight(5), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(122), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + rowFrameLayout.AddChidren(btnLine); + + switch (i) + { + case 0: + btnUserName.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock); + break; + case 1: + btnUserName.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock); + break; + case 2: + btnUserName.Text = Language.StringByID(R.MyInternationalizationString.TempPasswordUnlock); + break; + case 3: + btnUserName.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock); + break; + } + } + } + + public void LockDateFrameLayout() + { + var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; + this.midFrameLayout.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + HistoryRecordList(); + }; + bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(100), + Y = Application.GetRealHeight(930), + Radius = 17, + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout); + + var bottomFrameLayout1 = new FrameLayout() + { + Height = Application.GetRealHeight(806 - 50), + Y = Application.GetRealHeight(930 + 48), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout1); + + var bottomFrameLayout2 = new FrameLayout() + { + Height = Application.GetRealHeight(806), + Y = Application.GetRealHeight(930), + }; + flMain.AddChidren(bottomFrameLayout2); + + var matchUsersFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(138), + }; + bottomFrameLayout2.AddChidren(matchUsersFrameLayout); + + var btnCancel = new Button + { + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(40), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(101), + Text = Language.StringByID(R.MyInternationalizationString.Cancel), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnCancel); + + var btnMatchUser = new Button + { + X = Application.GetRealWidth(446), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(63), + Width = Application.GetRealWidth(284), + Text = Language.StringByID(R.MyInternationalizationString.date), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 16, + }; + matchUsersFrameLayout.AddChidren(btnMatchUser); + + var btnFinish = 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.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnFinish); + + var btnTopLine = new FrameLayout() + { + Height = Application.GetRealHeight(5), + Y = Application.GetRealHeight(138), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + bottomFrameLayout2.AddChidren(btnTopLine); + + var dateFrameLayout = new FrameLayout() + { + Y = Application.GetRealHeight(138 + 5), + Height = Application.GetRealHeight(668) + }; + bottomFrameLayout2.AddChidren(dateFrameLayout); + + var timeview = new DateView + { + }; + dateFrameLayout.AddChidren(timeview); + + var btnSave = new Button + { + Y = Application.GetRealHeight(1920 - 800), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(150), + Text = "瀹屾垚", + TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton, + X = Application.GetRealWidth(1080 - 200), + }; + dateFrameLayout.AddChidren(btnSave); + } + /// <summary> + /// 閲嶅啓绉婚櫎鏂规硶 + /// </summary> + public override void RemoveFromParent() + { + ZbGateway.StatusList.Remove(this); + base.RemoveFromParent(); + } + + #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 new file mode 100755 index 0000000..da55c58 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs @@ -0,0 +1,152 @@ +锘縰sing System; +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DoorLock +{ + public class MasterManagementPage : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public MasterManagementPage(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj) + { + this.doorLock = doorLock; + this.accountObj = accountObj; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + Shared.Phone.UserCenter.MemberInfoRes accountObj; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, accountObj.Account); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var bodyView = new VerticalScrolViewLayout() + { + }; + this.midFrameLayout.AddChidren(bodyView); + + for (int i = 0; i < 2; i++) + { + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(161), + }; + bodyView.AddChidren(RowView); + + var btnMemberName = new Button() + { + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(58), + Width = Application.GetRealWidth(743), + Height = Application.GetRealHeight(58), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, + }; + RowView.AddChidren(btnMemberName); + + var btnRight = new Button() + { + X = Application.GetRealWidth(58 + 899), + Y = Application.GetRealHeight(58), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(58), + UnSelectedImagePath = "Item/Next.png", + SelectedImagePath = "Item/Down.png", + }; + RowView.AddChidren(btnRight); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + int currentIndex = i; + if (i == 0) + { + btnMemberName.Text = Language.StringByID(R.MyInternationalizationString.LockMethod); + } + else + { + btnMemberName.Text = Language.StringByID(R.MyInternationalizationString.LinkageEvent); + } + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + if (currentIndex == 0) + { + var unLockMethod = new Shared.Phone.UserCenter.DoorLock.UnLockMethod(doorLock, accountObj); + Shared.Phone.UserView.HomePage.Instance.AddChidren(unLockMethod); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + unLockMethod.Show(); + } + else + { + + } + }; + btnRight.MouseUpEventHandler += eHandler; + RowView.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 new file mode 100755 index 0000000..b7687de --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs @@ -0,0 +1,191 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using Shared.Phone.UserCenter.Device; +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DoorLock +{ + public class MemberFrozenPage : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public MemberFrozenPage(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj) + { + this.doorLock = doorLock; + this.accountObj = accountObj; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + Shared.Phone.UserCenter.MemberInfoRes accountObj; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + string accountTitle = ""; + if (accountObj.UserName != null) + { + accountTitle = accountObj.UserName; + } + else + { + accountTitle = accountObj.Account; + } + this.TopFrameLayout(this, accountTitle); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var bodyView = new VerticalScrolViewLayout() + { + }; + this.midFrameLayout.AddChidren(bodyView); + + for (int i = 0; i < 3; i++) + { + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(127 + 20), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout, + }; + bodyView.AddChidren(RowView); + + var btnText = new Button() + { + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.CenterLeft, + TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, + Gravity = Gravity.CenterVertical, + TextSize = 14, + }; + RowView.AddChidren(btnText); + + var btnRightFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(204), + X = Application.GetRealWidth(919 - 58), + Y = Application.GetRealHeight(25), + }; + RowView.AddChidren(btnRightFrameLayout); + + var btnRight = new Button() + { + Height = Application.GetRealHeight(60), + Width = Application.GetRealWidth(60), + X = Application.GetRealWidth(72), + Y = Application.GetRealHeight(32), + UnSelectedImagePath = "DoorLock/RightIcon.png", + }; + btnRightFrameLayout.AddChidren(btnRight); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(962), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + if (i == 0) + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.LockMethod); + } + else if (i == 1) + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.FrozenUser); + btnRight.X = Application.GetRealWidth(50); + btnRight.Y = Application.GetRealHeight(32); + btnRight.Height = Application.GetRealHeight(63); + btnRight.Width = Application.GetRealWidth(104); + btnRight.UnSelectedImagePath = "DoorLock/Switch.png"; + btnRight.SelectedImagePath = "DoorLock/SwitchOn.png"; + } + else if (i == 2) + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.TempUnlockPermission); + btnRight.X = Application.GetRealWidth(50); + btnRight.Y = Application.GetRealHeight(32); + btnRight.Height = Application.GetRealHeight(63); + btnRight.Width = Application.GetRealWidth(104); + btnRight.UnSelectedImagePath = "DoorLock/Switch.png"; + btnRight.SelectedImagePath = "DoorLock/SwitchOn.png"; + line2.Visible = false; + } + + int currentIndex = i; + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + if (currentIndex == 0) + { + var unLockMethod = new Shared.Phone.UserCenter.DoorLock.UnLockMethod(doorLock, accountObj); + Shared.Phone.UserView.HomePage.Instance.AddChidren(unLockMethod); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + unLockMethod.Show(); + } + else if (currentIndex == 1) + { + //閫昏緫 + } + }; + btnRightFrameLayout.MouseUpEventHandler += eHandler; + btnRight.MouseUpEventHandler += eHandler; + RowView.MouseUpEventHandler += eHandler; + 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/MemberManagement.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberManagement.cs new file mode 100755 index 0000000..01aec14 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberManagement.cs @@ -0,0 +1,138 @@ +锘縰sing System; +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DoorLock +{ + public class MemberManagement : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public MemberManagement(ZigBee.Device.DoorLock doorLock) + { + this.doorLock = doorLock; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.MemberManagement)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var bodyView = new VerticalScrolViewLayout() + { + }; + this.midFrameLayout.AddChidren(bodyView); + + for (int i = 0; i < 3; i++) + { + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(161), + }; + bodyView.AddChidren(RowView); + + var btnMemberName = new Button() + { + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(58), + Width = Application.GetRealWidth(743), + Height = Application.GetRealHeight(58), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, + Text = "Krafty", + }; + RowView.AddChidren(btnMemberName); + + var btnRight = new Button() + { + X = Application.GetRealWidth(58 + 899), + Y = Application.GetRealHeight(58), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(58), + UnSelectedImagePath = "Item/Next.png", + SelectedImagePath = "Item/Down.png", + }; + RowView.AddChidren(btnRight); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + int currentIndex = i; + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + //var doorLock = new ZigBee.Device.DoorLock(); + //var memberFrozenPage = new Shared.Phone.UserCenter.DoorLock.MemberFrozenPage(doorLock); + //Shared.Phone.UserView.HomePage.Instance.AddChidren(memberFrozenPage); + //Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + //memberFrozenPage.Show(); + }; + btnRight.MouseUpEventHandler += eHandler; + RowView.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/RemotelyUnlock.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/RemotelyUnlock.cs new file mode 100755 index 0000000..29f09b9 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/RemotelyUnlock.cs @@ -0,0 +1,162 @@ +锘縰sing System; +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DoorLock +{ + public class RemotelyUnlock : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public RemotelyUnlock(ZigBee.Device.DoorLock doorLock) + { + this.doorLock = doorLock; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + ZigBee.Device.ZbGateway.StatusList.Add(this); + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.RemotelyUnlock)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var passwordText = new EditText() + { + Y = Application.GetRealHeight(140), + Width = Application.GetRealWidth(480 * 2), + Height = Application.GetRealHeight(70), + Gravity = Gravity.CenterHorizontal, + //PlaceholderText = Language.StringByID(R.MyInternationalizationString.InputSixPassword), + TextAlignment = TextAlignment.Center, + TextColor = 0xff000000, + //UnSelectedImagePath = "Register/Register_Password_kuang.png", + //PlaceholderTextColor = SkinStyle.Current.PlaceholderTextColor, + Radius = (uint)Application.GetRealHeight(0), + //SecureTextEntry = true, + TextSize = 15, + BackgroundColor = 0xff00ff00, + }; + this.midFrameLayout.AddChidren(passwordText); + + var btnTip = new Button() + { + Height = Application.GetRealHeight(60), + Width = Application.GetRealWidth(60), + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(200), + Enable = false, + Visible = false, + }; + + this.midFrameLayout.AddChidren(btnTip); + var btnLock = new Button() + { + Height = Application.GetRealHeight(500), + Width = Application.GetRealWidth(501), + //UnSelectedImagePath = "DoorLockPic/door_lock_close.png", + //SelectedImagePath = "DoorLockPic/door_lock_open.png", + BackgroundColor = 0xff00ffff, + SelectedBackgroundColor = 0xff00ff00, + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(370), + Enable = false, + }; + this.midFrameLayout.AddChidren(btnLock); + btnLock.MouseUpEventHandler += (sender, e) => + { + btnLock.IsSelected = !btnLock.IsSelected; + }; + + passwordText.Text = getDynamicPassword(); + var delayTime = DateTime.Now.AddSeconds(+300);//5鍒嗛挓鍐呮湁鏁� + new System.Threading.Thread(() => + { + while (true) + { + if (DateTime.Now >= delayTime) + { + Application.RunOnMainThread(() => + { + passwordText.Text = "瀵嗙爜澶辨晥"; + }); + } + } + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 閲嶅啓绉婚櫎鏂规硶 + /// </summary> + public override void RemoveFromParent() + { + ZbGateway.StatusList.Remove(this); + base.RemoveFromParent(); + } + + /// <summary> + /// 鐢熸垚6浣嶅姩鎬佸瘑鐮� + /// </summary> + /// <returns></returns> + string getDynamicPassword() + { + var password = ""; + password = new Random().Next(100000, 999999).ToString(); + return password; + } + + #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/SubAccountManagementPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/SubAccountManagementPage.cs new file mode 100755 index 0000000..6fd76b1 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/SubAccountManagementPage.cs @@ -0,0 +1,10 @@ +锘縰sing System; +namespace Shared.Phone.UserCenter.DoorLock +{ + public class SubAccountManagementPage + { + public SubAccountManagementPage() + { + } + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs new file mode 100755 index 0000000..6f7e2f3 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs @@ -0,0 +1,413 @@ +锘縰sing System; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class TemporaryPassword : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public TemporaryPassword(ZigBee.Device.DoorLock doorLock) + { + this.doorLock = doorLock; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + ZigBee.Device.ZbGateway.StatusList.Add(this); + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + public System.Collections.Generic.List<Button> pawButtonList = new System.Collections.Generic.List<Button> { };//涓存椂瀵嗙爜涓殑6浣嶆暟瀛� + Button passwordText; //涓存椂瀵嗙爜 + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.TemporaryPassword)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + + } + + /// <summary> + /// 璇婚棬閿佷复鏃跺瘑鐮佷俊鎭� + /// </summary> + /// <param name="door_lock">Door lock.</param> + void readStatus() + { + System.Threading.Tasks.Task.Run(() => + { + + }); + } + + public void MidFrameLayoutContent() + { + var MidTopFrameLayout = new FrameLayout() + { + X = Application.GetRealWidth(196), + Y = Application.GetRealHeight(276), + Width = Application.GetRealWidth(668), + Height = Application.GetRealHeight(527), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(MidTopFrameLayout); + + var topPic = new Button() + { + Height = Application.GetRealHeight(184), + Width = Application.GetRealWidth(184), + X = Application.GetRealWidth(449), + Y = Application.GetRealHeight(58), + TextAlignment = TextAlignment.Center, + Text = Language.StringByID(R.MyInternationalizationString.RandomPasword), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray1, + }; + this.midFrameLayout.AddChidren(topPic); + + var randomPassword = new EditText() + { + Y = Application.GetRealHeight(153), + Height = Application.GetRealHeight(84), + TextAlignment = TextAlignment.Center, + TextColor = Shared.Common.ZigbeeColor.Current.XMOrange, + TextSize = 24, + Text = GetTempPassword(), + }; + MidTopFrameLayout.AddChidren(randomPassword); + + var validTime = new Button() + { + Height = Application.GetRealHeight(55), + Width = Application.GetRealWidth(115), + X = Application.GetRealWidth(78), + Y = Application.GetRealHeight(386), + Text = "12:00", + TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + }; + MidTopFrameLayout.AddChidren(validTime); + + var validTimeDate = new Button() + { + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(135), + X = Application.GetRealWidth(69), + Y = Application.GetRealHeight(441), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, + Text = "8" + Language.StringByID(R.MyInternationalizationString.Month) + "1" + Language.StringByID(R.MyInternationalizationString.Day), + }; + MidTopFrameLayout.AddChidren(validTimeDate); + + var inValidTime = new Button() + { + Height = Application.GetRealHeight(55), + Width = Application.GetRealWidth(115), + X = Application.GetRealWidth(492), + Y = Application.GetRealHeight(386), + Text = "10:00", + TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + }; + MidTopFrameLayout.AddChidren(inValidTime); + + var inValidTimeDate = new Button() + { + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(135), + X = Application.GetRealWidth(484), + Y = Application.GetRealHeight(441), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, + TextAlignment = TextAlignment.CenterLeft, + Text = "8" + Language.StringByID(R.MyInternationalizationString.Month) + "2" + Language.StringByID(R.MyInternationalizationString.Day), + }; + MidTopFrameLayout.AddChidren(inValidTimeDate); + + //var inputCountText = new EditText() + //{ + // Width = Application.GetRealWidth(780), + // Height = Application.GetRealHeight(100), + // X = Application.GetRealWidth(80), + // Y = validCountText.Bottom + Application.GetRealHeight(10), + // PlaceholderText = doorLock.tempPasswordObj.times.ToString(), + // PlaceholderTextColor = 0xffc1c1c1, + // TextAlignment = TextAlignment.Center, + // //UnSelectedImagePah = "Register/Register_Kuang.png", + // BackgroundColor = 0xff00ff00, + //}; + //this.midFrameLayout.AddChidren(inputCountText); + + //var unitCount = new Button() + //{ + // Height = Application.GetRealHeight(50), + // Width = Application.GetRealWidth(100), + // X = inputCountText.Right + Application.GetRealWidth(2), + // Y = Application.GetRealHeight(490), + // Text = Language.StringByID(R.MyInternationalizationString.Ci), + // TextAlignment = TextAlignment.CenterLeft, + // TextSize = 12, + // TextColor = 0xff000000, + //}; + //this.midFrameLayout.AddChidren(unitCount); + + //var remindPic2 = new Button() + //{ + // Height = Application.GetRealHeight(40), + // Width = Application.GetRealWidth(40), + // X = Application.GetRealWidth(80), + // Y = inputCountText.Bottom + Application.GetRealHeight(18), + // //UnSelectedImagePath = "DoorLockPic/door_lock_alert.png", + // BackgroundColor = 0xff0000ff, + //}; + //this.midFrameLayout.AddChidren(remindPic2); + + //var maxValidCount = new Button() + //{ + // Width = Application.GetRealWidth(550), + // Height = Application.GetRealHeight(80), + // X = remindPic2.Right + Application.GetRealWidth(8), + // Y = inputCountText.Bottom, + // Text = Language.StringByID(R.MyInternationalizationString.MaxValicCount), + // TextAlignment = TextAlignment.CenterLeft, + // TextSize = 10, + // TextColor = 0xff000000, + //}; + //this.midFrameLayout.AddChidren(maxValidCount); + + //var remindFrameLayout = new FrameLayout() + //{ + // Height = Application.GetRealHeight(350), + // Y = remindPic2.Bottom + Application.GetRealHeight(90), + // BackgroundColor = 0xff00ffff, + //}; + //this.midFrameLayout.AddChidren(remindFrameLayout); + + //var TempPasswordText = new Button() + //{ + // X = Application.GetRealWidth(80), + // Y = Application.GetRealHeight(10), + // Width = Application.GetRealWidth(300), + // Height = Application.GetRealHeight(80), + // TextAlignment = TextAlignment.CenterLeft, + // Text = Language.StringByID(R.MyInternationalizationString.DynamicTempPassword), + // TextColor = 0xffff0000, + //}; + //remindFrameLayout.AddChidren(TempPasswordText); + + //for (int i = 0; i < 6; i++) + //{ + // passwordText = new Button() + // { + // Height = Application.GetRealHeight(150), + // Width = Application.GetRealWidth(80), + // TextAlignment = TextAlignment.Center, + // Y = TempPasswordText.Bottom + Application.GetRealHeight(10), + // TextSize = 28, + // BackgroundColor = 0xff0000ff, + // }; + // remindFrameLayout.AddChidren(passwordText); + // if (i == 0) + // { + // passwordText.X = Application.GetRealWidth(90); + // } + // else + // { + // passwordText.X = (i + 1) * Application.GetRealWidth(90) + (i + 1) * Application.GetRealWidth(10); + // } + // if (i == 1 || i == 3 || i == 5) + // { + // passwordText.BackgroundColor = 0xff00ff00; + // } + // pawButtonList.Add(passwordText); + //} + + BottomFrameLayoutContent(); + } + + public void BottomFrameLayoutContent() + { + var bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(1025), + Y = Application.GetRealHeight(896), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(bottomFrameLayout); + + var informationEdit = new Button() + { + Height = Application.GetRealHeight(60), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(81), + Text = Language.StringByID(R.MyInternationalizationString.InformationEdit), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + }; + bottomFrameLayout.AddChidren(informationEdit); + for (int i = 0; i < 3; i++) + { + var btnValidTime = new Button() + { + Width = Application.GetRealWidth(743), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(58), + Text = Language.StringByID(R.MyInternationalizationString.ValidTime), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + }; + bottomFrameLayout.AddChidren(btnValidTime); + + var btnNext = new Button() + { + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(956), + Y = Application.GetRealHeight(204), + BackgroundColor = ZigbeeColor.Current.XMOrange, + }; + bottomFrameLayout.AddChidren(btnNext); + + var btnLine = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = Application.GetRealHeight(5), + X = Application.GetRealWidth(58), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + bottomFrameLayout.AddChidren(btnLine); + + if (i == 0) + { + btnValidTime.Y = Application.GetRealHeight(204); + btnValidTime.Text = Language.StringByID(R.MyInternationalizationString.ValidTime); + btnNext.Y = btnValidTime.Y; + btnLine.Y = Application.GetRealHeight(308); + btnNext.MouseDownEventHandler += (sender, e) => + { + var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "ValidTime"); + Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + tempPage.Show(); + }; + } + else if (i == 1) + { + btnValidTime.Y = Application.GetRealHeight(343); + btnValidTime.Text = Language.StringByID(R.MyInternationalizationString.InValidTime); + btnNext.Y = btnValidTime.Y; + btnLine.Y = Application.GetRealHeight(446); + btnNext.MouseDownEventHandler += (sender, e) => + { + var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "InValidTime"); + Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + tempPage.Show(); + }; + } + else if (i == 2) + { + btnValidTime.Y = Application.GetRealHeight(481); + btnValidTime.Text = Language.StringByID(R.MyInternationalizationString.ClearTempPassword); + btnNext.Y = btnValidTime.Y; + btnLine.Y = Application.GetRealHeight(1025 - 449); + } + } + + + //var bottomLine = new Button() + //{ + // Height = Application.GetRealHeight(1), + // BackgroundColor = 0xff000000, + //}; + //bottomFrameLayout.AddChidren(bottomLine); + + //var generateTempPassword = new Button() + //{ + // Y = bottomLine.Bottom, + // Height = Application.GetRealHeight(180), + // TextID = R.MyInternationalizationString.GenerateTemporaryPassword, + // TextSize = 15, + // BackgroundColor = 0xFF121212, + // SelectedBackgroundColor = 0xFFFC5806, + //}; + //bottomFrameLayout.AddChidren(generateTempPassword); + //string tempPaw = ""; + //generateTempPassword.MouseUpEventHandler += (sender, e) => + //{ + // tempPaw = GetTempPassword(); + // for (int i = 0; i < tempPaw.Length; i++) + // { + // for (int j = 0; j < pawButtonList.Count; j++) + // { + // if (i == j) + // { + // pawButtonList[j].Text = tempPaw[i].ToString(); + // } + // } + // } + //}; + } + + /// <summary> + /// 鐢熸垚6浣嶄复鏃跺瘑鐮� + /// </summary> + /// <returns></returns> + public string GetTempPassword() + { + string password = ""; + password = new Random().Next(100000, 999999).ToString(); + return password; + } + + #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 new file mode 100755 index 0000000..cbcbdf3 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs @@ -0,0 +1,230 @@ +锘縰sing System; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class TimeSettignPage : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public TimeSettignPage(ZigBee.Device.DoorLock doorLock, string timeType) + { + this.doorLock = doorLock; + setTimeType = timeType; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + ZigBee.Device.ZbGateway.StatusList.Add(this); + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + string setTimeType = ""; + Action<string> dateAction; //鏃ユ湡閫氱煡 + Action<string> timeAction; //鏃堕棿閫氱煡 + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + if (setTimeType == "ValidTime") + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.ValidTime)); + } + else + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.InValidTime)); + + } + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + var MidTopFrameLayout = new FrameLayout() + { + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(MidTopFrameLayout); + + for (int i = 0; i < 2; i++) + { + var btnDateTime = new Button() + { + Width = Application.GetRealWidth(743 - 300), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(58), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + }; + MidTopFrameLayout.AddChidren(btnDateTime); + + var textDisplay = new Button() + { + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(580), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextAlignment = TextAlignment.CenterRight, + TextSize = 12, + }; + MidTopFrameLayout.AddChidren(textDisplay); + + var btnNext = new Button() + { + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(956), + Y = Application.GetRealHeight(204), + //BackgroundColor = ZigbeeColor.Current.XMOrange, + UnSelectedImagePath = "Item/Next.png", + SelectedImagePath = "Item/Down.png", + }; + MidTopFrameLayout.AddChidren(btnNext); + + var btnLine = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = Application.GetRealHeight(5), + X = Application.GetRealWidth(58), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + + }; + MidTopFrameLayout.AddChidren(btnLine); + + if (i == 0) + { + btnDateTime.Y = Application.GetRealHeight(50); + btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Date); + btnLine.Y = Application.GetRealHeight(23 + 127); + textDisplay.Text = "8鏈�6鏃�"; + textDisplay.Y = btnNext.Y = btnDateTime.Y; + + EventHandler<MouseEventArgs> stattimeclick = (sender1, e1) => + { + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; + this.midFrameLayout.AddChidren(flMain); + + flMain.MouseUpEventHandler += (sender11, e11) => + { + flMain.RemoveFromParent(); + }; + + var timeview = new DateView + { + Y = Application.GetRealHeight(1920 - 800), + Height = Application.GetRealHeight(800), + BackgroundColor = ZigbeeColor.Current.LogicTimeViewColor, + Width = Application.GetRealWidth(1080), + }; + flMain.AddChidren(timeview); + + var btnSave = new Button + { + Y = Application.GetRealHeight(1920 - 800), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(150), + Text = "瀹屾垚", + TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton, + X = Application.GetRealWidth(1080 - 200), + }; + flMain.AddChidren(btnSave); + }; + btnNext.MouseDownEventHandler += stattimeclick; + } + else if (i == 1) + { + btnDateTime.Y = Application.GetRealHeight(200); + btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Time); + btnLine.Y = Application.GetRealHeight(40 + 127 + 127); + textDisplay.Text = "12 : 00"; + textDisplay.Y = btnNext.Y = btnDateTime.Y; + + EventHandler<MouseEventArgs> endtimeclick = (sender, e) => + { + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; + this.midFrameLayout.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + flMain.RemoveFromParent(); + }; + + var timeview = new TimeView() + { + Y = Application.GetRealHeight(1920 - 800), + Height = Application.GetRealHeight(800), + BackgroundColor = ZigbeeColor.Current.LogicTimeViewColor, + Width = Application.GetRealWidth(1080), + }; + flMain.AddChidren(timeview); + + var btnSave = new Button + { + Y = Application.GetRealHeight(1920 - 800), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(150), + Text = "瀹屾垚", + TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton, + X = Application.GetRealWidth(1080 - 200), + }; + flMain.AddChidren(btnSave); + + btnSave.MouseUpEventHandler += (sender2, e2) => + { + flMain.RemoveFromParent(); + }; + }; + + btnNext.MouseDownEventHandler += endtimeclick; + } + } + } + + #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/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs new file mode 100755 index 0000000..b5accd6 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs @@ -0,0 +1,928 @@ +锘縰sing System; +using System.Collections.Generic; +using System.ComponentModel; +using Shared.Common; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class UnLockMethod : DoorLockCommonLayout + { + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public UnLockMethod(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj) + { + this.doorLock = doorLock; + this.curAccountObj = accountObj; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + VerticalScrolViewLayout bodyView; + Button currentMethod;// 褰撳墠閫夋嫨鐨勬柟寮� + Shared.Phone.UserCenter.MemberInfoRes curAccountObj; + Button entryStatusPic; + Button btnPicTip; + Button btnPicTip1; + bool isSecondDel; + #endregion + + /// <summary> + /// 鑾峰彇鏈�鏂颁俊鎭� + /// </summary> + void ReadDoorLockUserInfo() + { + System.Threading.Tasks.Task.Run(async () => + { + Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); + try + { + // 璇诲彇璁惧涓殑淇℃伅 + var getDoorLockInfo = await doorLock.GetDoorlockUserInfoAsync(); + if (getDoorLockInfo != null && getDoorLockInfo.doorLockUserDetailData != null) + { + var dataList = getDoorLockInfo.doorLockUserDetailData.UserObjList; + foreach (var doorData in dataList) + { + var localDoorLockObj1 = new ZigBee.Device.DoorLock.LocaDoorLockObj() + { + UserID = doorData.UserId, + UnlockType = doorData.UserType + }; + if ((doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj1.UserID)) == false) + { + doorLock.localDoorLockUserList.Add(localDoorLockObj1.UserID, localDoorLockObj1); + } + } + } + + // 璇诲彇浜戠闂ㄩ攣璁惧涓殑淇℃伅 + var localDoorLockObj = new ZigBee.Device.DoorLock.GetDoorLockData() { }; + localDoorLockObj.CloudAccountId = curAccountObj.SubAccountDistributedMark; + if (doorLock.DeviceAddr != null) + { + localDoorLockObj.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + + var getDoorLockInfoList = await ZigBee.Device.DoorLock.GetDoorLockInfoFromServer("App/GetDoorLockPager", localDoorLockObj); + + if (getDoorLockInfoList != null) + { + foreach (var curDoorLockUser in getDoorLockInfoList.PageData) + { + if (doorLock.localDoorLockUserList.ContainsKey(int.Parse(curDoorLockUser.DoorLockLocalUserId))) + { + doorLock.localDoorLockUserList.Remove(int.Parse(curDoorLockUser.DoorLockLocalUserId)); + } + var doorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + doorLockObj.UserID = int.Parse(curDoorLockUser.DoorLockLocalUserId); + doorLockObj.UnlockType = curDoorLockUser.OpenLockMode; + doorLockObj.PrimaryId = curDoorLockUser.Id; + doorLockObj.EntryTime = curDoorLockUser.EntryTime; + doorLockObj.UserName = curDoorLockUser.UserIdRemarks; + doorLockObj.ConnectedAccount = curDoorLockUser.CloudAccountId; + doorLock.localDoorLockUserList.Add(int.Parse(curDoorLockUser.DoorLockLocalUserId), doorLockObj); + } + } + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + RefreshList(); + CommonPage.Loading.Hide(); + }); + } + }); + } + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + ReadDoorLockUserInfo(); + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.LockMethod)); + this.btnTitleLine.Visible = false; + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + var btnAddFrameLayout = new FrameLayout + { + X = Application.GetRealWidth(953), + Height = Application.GetRealHeight(72), + Width = Application.GetRealWidth(72), + }; + this.titleFrameLayout.AddChidren(btnAddFrameLayout); + + var btnAdd = new Button + { + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + UnSelectedImagePath = "DoorLock/AddIcon.png", + }; + btnAddFrameLayout.AddChidren(btnAdd); + btnAdd.MouseDownEventHandler += (sender, e) => + { + var addUnLockMethod = new Shared.Phone.UserCenter.DoorLock.AddUnLockMethod(doorLock, curAccountObj); + Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethod); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + addUnLockMethod.Show(); + }; + + MidFrameLayoutContent(); + } + //涓儴甯冨眬 + void MidFrameLayoutContent() + { + var midTopFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(115), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout, + }; + this.midFrameLayout.AddChidren(midTopFrameLayout); + + var btnAllMethod = new Button() + { + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(141 + 100), + Y = Application.GetRealHeight(35), + X = Application.GetRealWidth(812 - 100), + TextAlignment = TextAlignment.Center, + Text = Language.StringByID(R.MyInternationalizationString.LockMethod), + TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, + TextSize = 12, + }; + midTopFrameLayout.AddChidren(btnAllMethod); + + var btnNext = new Button() + { + X = Application.GetRealWidth(953), + Y = Application.GetRealHeight(20), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + UnSelectedImagePath = "DoorLock/UnLockSideslipIcon.png", + SelectedImagePath = "DoorLock/UnLockSideslipIcon.png", + }; + midTopFrameLayout.AddChidren(btnNext); + + entryStatusPic = new Button + { + X = Application.GetRealWidth(164), + Y = Application.GetRealHeight(492), + Height = Application.GetRealHeight(435), + Width = Application.GetRealWidth(757), + Visible = false, + UnSelectedImagePath = "DoorLock/UnLockBlankPic.png", + }; + this.midFrameLayout.AddChidren(entryStatusPic); + + btnPicTip = new Button + { + X = Application.GetRealWidth(397), + Y = Application.GetRealHeight(1143 - 184), + Height = Application.GetRealHeight(98 / 2), + Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + Gravity = Gravity.CenterHorizontal, + Visible = false, + }; + this.midFrameLayout.AddChidren(btnPicTip); + + btnPicTip1 = new Button + { + X = Application.GetRealWidth(397), + Y = btnPicTip.Bottom, + Height = Application.GetRealHeight(98 / 2), + Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation1), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + Gravity = Gravity.CenterHorizontal, + Visible = false, + }; + this.midFrameLayout.AddChidren(btnPicTip1); + + var btnLine = new Button + { + Y = midTopFrameLayout.Bottom, + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine, + }; + this.midFrameLayout.AddChidren(btnLine); + + bodyView = new VerticalScrolViewLayout() + { + Y = btnLine.Bottom, + }; + this.midFrameLayout.AddChidren(bodyView); + + btnNext.MouseUpEventHandler += (sender, e) => + { + SideslipFramelayout(); + }; + + RefreshList(); + } + + /// <summary> + /// 鍒锋柊鍒楄〃 + /// </summary> + /// <param name="gateway"></param> + /// <param name="key"></param> + public void RefreshList() + { + bodyView.RemoveAll(); + var curAccountDoorLockUserList = new Dictionary<int, ZigBee.Device.DoorLock.LocaDoorLockObj>(); + + foreach (var curUserId in doorLock.localDoorLockUserList.Keys) + { + var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; + + if (curDoorLockUser.ConnectedAccount == "" || curDoorLockUser.ConnectedAccount != curAccountObj.SubAccountDistributedMark) + { + continue; + } + else + { + curAccountDoorLockUserList.Add(curDoorLockUser.UserID, curDoorLockUser); + } + } + + if (curAccountDoorLockUserList.Count == 0) + { + entryStatusPic.Visible = true; + btnPicTip.Visible = true; + btnPicTip1.Visible = true; + } + else + { + entryStatusPic.Visible = false; + btnPicTip.Visible = false; + btnPicTip1.Visible = false; + } + + foreach (var curUserId in curAccountDoorLockUserList.Keys) + { + var curDoorLockUser = curAccountDoorLockUserList[curUserId]; + #region UI + var rowFrameLayout = new RowLayout() + { + Height = Application.GetRealHeight(173), + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + bodyView.AddChidren(rowFrameLayout); + + var btnPicFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(40), + Y = Application.GetRealHeight(49), + }; + rowFrameLayout.AddChidren(btnPicFrameLayout); + + var btnPic = new Button() + { + Width = Application.GetRealWidth(84), + Height = Application.GetRealHeight(84), + UnSelectedImagePath = "DoorLock/DoorLockUserPic.png", + }; + btnPicFrameLayout.AddChidren(btnPic); + + var btnDoorlockUser = new EditText() + { + Width = Application.GetRealWidth(1080 - 173), + Height = Application.GetRealHeight(60), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(35), + TextSize = 14, + PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnDoorlockUser); + + var btnMember = new Button() + { + Width = Application.GetRealWidth(1080 - 173), + Height = Application.GetRealHeight(49), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(95), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnMember); + + var btnDel = new Button() + { + Width = Application.GetRealWidth(1080 - 173), + Height = Application.GetRealHeight(49), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(95), + Text = Language.StringByID(R.MyInternationalizationString.Delete), + TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + TextSize = 12, + TextAlignment = TextAlignment.Center, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel, + }; + rowFrameLayout.AddRightView(btnDel); + #endregion + #region 鏁版嵁澶勭悊 + switch (curDoorLockUser.UnlockType) + { + case 0: + if (curDoorLockUser.UserName != "") + { + btnDoorlockUser.Text = curDoorLockUser.UserName; + } + else + { + btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; + } + break; + case 3: + if (curDoorLockUser.UserName != "") + { + btnDoorlockUser.Text = curDoorLockUser.UserName; + } + else + { + btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; + } + break; + case 15: + if (curDoorLockUser.UserName != "") + { + btnDoorlockUser.Text = curDoorLockUser.UserName; + } + else + { + btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; + } + break; + } + + if (curAccountObj.UserName == "") + { + btnMember.Text = curAccountObj.Account; + } + else + { + btnMember.Text = curAccountObj.UserName; + } + + Action<Shared.View> action = async (obj) => + { + var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData(); + refreshDoorLockData.CloudAccountId = curAccountObj.SubAccountDistributedMark; + if (doorLock.DeviceAddr != null) + { + refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType; + refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; + refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text; + var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/UpdateDoorLock", refreshDoorLockData); + if (result.StateCode == "Success") + { + if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + { + doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = curDoorLockUser.UserID; + localDoorLockObj.UnlockType = curDoorLockUser.UnlockType; + localDoorLockObj.EntryTime = curDoorLockUser.EntryTime; + localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks; + localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark; + doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj); + RefreshList(); + } + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + } + }; + btnDoorlockUser.EditorEnterAction += action; + + btnDel.MouseUpEventHandler += (sender, e) => + { + var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod), + Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim)); + alert.Show(); + alert.ResultEventHandler += async (sender1, e1) => + { + if (e1) + { + var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser); + var resultData = await doorLock.DefaultControlAsync(passData); + if (resultData != null && resultData.defaultControlResponseData != null) + { + if (resultData.defaultControlResponseData.status == 0) + { + var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData(); + if (doorLock.DeviceAddr != null) + { + deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; + deleteDoorLockData.DelDoorLockDelType = 2; + var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/DelDoorLock", deleteDoorLockData); + if (result.StateCode == "Success") + { + isSecondDel = false; + if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + { + doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = curDoorLockUser.UserID; + doorLock.localDoorLockUserList.Remove(curUserId); + RefreshList(); + } + } + else + { + isSecondDel = true; + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + } + } + else + { + if (isSecondDel) + { + var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData(); + if (doorLock.DeviceAddr != null) + { + deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; + deleteDoorLockData.DelDoorLockDelType = 2; + var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/DelDoorLock", deleteDoorLockData); + if (result.StateCode == "Success") + { + isSecondDel = false; + if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + { + doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = curDoorLockUser.UserID; + doorLock.localDoorLockUserList.Remove(curUserId); + RefreshList(); + } + } + else + { + isSecondDel = true; + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + } + } + else + { + if (curDoorLockUser.UserID < 10) + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + } + } + } + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); + } + } + }; + }; + #endregion + } + } + + // 渚ц竟瀵艰埅鏍� + void SideslipFramelayout() + { + var dialog = new Dialog + { + }; + dialog.Show(); + + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; + dialog.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + dialog.Close(); + }; + + var sidelipFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(625), + Width = Application.GetRealWidth(449), + Y = Application.GetRealHeight(115 + 160), + X = Application.GetRealWidth(596), + BackgroundImagePath = "DoorLock/SideslipPic.png", + }; + flMain.AddChidren(sidelipFrameLayout); + + var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout() + { + Height = Application.GetRealHeight(600), + Y = Application.GetRealHeight(28), + }; + sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout); + Button oldbutton = null; + Button oldbuttonText = null; + for (var i = 0; i < 4; i++) + { + var rowFrameLayout = new RowLayout() + { + Height = Application.GetRealHeight(150), + }; + sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); + + var btnAllMethod = new Button() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(55), + }; + rowFrameLayout.AddChidren(btnAllMethod); + + var btnMethodText = new Button() + { + Width = Application.GetRealWidth(311), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(69), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnMethodText); + + EventHandler<MouseEventArgs> hander = (sender, e) => + { + if (!btnAllMethod.IsSelected) + { + if (oldbutton != null) + { + oldbutton.IsSelected = false; + } + if (oldbuttonText != null) + { + oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; + } + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + doorLock.currentUserDisplayMethod = btnMethodText.Text; + btnAllMethod.IsSelected = true; + oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + + // 绫诲瀷鍖哄垎 + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod)) + { + RefreshList(); + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock)) + { + DisplayByType(0); + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock)) + { + DisplayByType(15); + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock)) + { + DisplayByType(3); + } + } + dialog.Close(); + }; + rowFrameLayout.MouseUpEventHandler += hander; + btnAllMethod.MouseUpEventHandler += hander; + btnMethodText.MouseUpEventHandler += hander; + + switch (i) + { + case 0: + btnAllMethod.UnSelectedImagePath = "DoorLock/AllMethod.png"; + btnAllMethod.SelectedImagePath = "DoorLock/AllMethodOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.AllMethod); + break; + case 1: + btnAllMethod.UnSelectedImagePath = "DoorLock/Password.png"; + btnAllMethod.SelectedImagePath = "DoorLock/PasswordOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock); + break; + case 2: + btnAllMethod.UnSelectedImagePath = "DoorLock/Fingerprint.png"; + btnAllMethod.SelectedImagePath = "DoorLock/FingerprintOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock); + break; + case 3: + btnAllMethod.UnSelectedImagePath = "DoorLock/proximityCard.png"; + btnAllMethod.SelectedImagePath = "DoorLock/proximityCardOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock); + break; + } + + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + } + } + + /// <summary> + /// 閫氳繃绫诲瀷绛涢�夋樉绀� + /// </summary> + public void DisplayByType(int unlockMethod) + { + bodyView.RemoveAll(); + var curAccountDoorLockUserList = new Dictionary<int, ZigBee.Device.DoorLock.LocaDoorLockObj>(); + + foreach (var curUserId in doorLock.localDoorLockUserList.Keys) + { + var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; + + if (curDoorLockUser.ConnectedAccount == "" || curDoorLockUser.ConnectedAccount != curAccountObj.SubAccountDistributedMark) + { + continue; + } + else + { + curAccountDoorLockUserList.Add(curDoorLockUser.UserID, curDoorLockUser); + } + } + + if (curAccountDoorLockUserList.Count == 0) + { + entryStatusPic.Visible = true; + btnPicTip.Visible = true; + btnPicTip1.Visible = true; + } + else + { + entryStatusPic.Visible = false; + btnPicTip.Visible = false; + btnPicTip1.Visible = false; + } + + foreach (var curUserId in curAccountDoorLockUserList.Keys) + { + var curDoorLockUser = curAccountDoorLockUserList[curUserId]; + if (curDoorLockUser.UnlockType != unlockMethod) + { + continue; + } + #region UI + var rowFrameLayout = new RowLayout() + { + Height = Application.GetRealHeight(173), + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + bodyView.AddChidren(rowFrameLayout); + + var btnPicFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(40), + Y = Application.GetRealHeight(49), + }; + rowFrameLayout.AddChidren(btnPicFrameLayout); + + var btnPic = new Button() + { + Width = Application.GetRealWidth(84), + Height = Application.GetRealHeight(84), + UnSelectedImagePath = "DoorLock/DoorLockUserPic.png", + }; + btnPicFrameLayout.AddChidren(btnPic); + + var btnDoorlockUser = new EditText() + { + Width = Application.GetRealWidth(1080 - 173), + Height = Application.GetRealHeight(60), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(35), + TextSize = 14, + PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnDoorlockUser); + + var btnMember = new Button() + { + Width = Application.GetRealWidth(1080 - 173), + Height = Application.GetRealHeight(49), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(95), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnMember); + + var btnDel = new Button() + { + Width = Application.GetRealWidth(1080 - 173), + Height = Application.GetRealHeight(49), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(95), + Text = Language.StringByID(R.MyInternationalizationString.Delete), + TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + TextSize = 12, + TextAlignment = TextAlignment.Center, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel, + }; + rowFrameLayout.AddRightView(btnDel); + #endregion + #region 鏁版嵁澶勭悊 + switch (curDoorLockUser.UnlockType) + { + case 0: + if (curDoorLockUser.UserName != "") + { + btnDoorlockUser.Text = curDoorLockUser.UserName; + } + else + { + btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; + } + break; + case 3: + if (curDoorLockUser.UserName != "") + { + btnDoorlockUser.Text = curDoorLockUser.UserName; + } + else + { + btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; + } + break; + case 15: + if (curDoorLockUser.UserName != "") + { + btnDoorlockUser.Text = curDoorLockUser.UserName; + } + else + { + btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; + } + break; + } + + if (curAccountObj.UserName == "") + { + btnMember.Text = curAccountObj.Account; + } + else + { + btnMember.Text = curAccountObj.UserName; + } + + Action<Shared.View> action = async (obj) => + { + var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData(); + refreshDoorLockData.CloudAccountId = curAccountObj.SubAccountDistributedMark; + if (doorLock.DeviceAddr != null) + { + refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType; + refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; + refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text; + var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/UpdateDoorLock", refreshDoorLockData); + if (result.StateCode == "Success") + { + if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + { + doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = curDoorLockUser.UserID; + localDoorLockObj.UnlockType = curDoorLockUser.UnlockType; + localDoorLockObj.EntryTime = curDoorLockUser.EntryTime; + localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks; + localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark; + doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj); + RefreshList(); + } + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + } + }; + btnDoorlockUser.EditorEnterAction += action; + + btnDel.MouseUpEventHandler += (sender, e) => + { + var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod), + Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim)); + alert.Show(); + alert.ResultEventHandler += async (sender1, e1) => + { + if (e1) + { + var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser); + var resultData = await doorLock.DefaultControlAsync(passData); + if (resultData != null && resultData.defaultControlResponseData != null) + { + if (resultData.defaultControlResponseData.status == 0) + { + var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData(); + if (doorLock.DeviceAddr != null) + { + deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; + deleteDoorLockData.DelDoorLockDelType = 2; + var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/DelDoorLock", deleteDoorLockData); + if (result.StateCode == "Success") + { + if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + { + doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = curDoorLockUser.UserID; + + //new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveSuccess), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); + doorLock.localDoorLockUserList.Remove(curUserId); + RefreshList(); + } + } + else + { + if (curDoorLockUser.UserID < 10) + { + + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser); + } + } + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); + } + + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); + } + } + }; + }; + #endregion + } + } + + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs new file mode 100755 index 0000000..180c7d7 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs @@ -0,0 +1,828 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DoorLock +{ + public class UndistributeDoorlockUserPage : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public UndistributeDoorlockUserPage(ZigBee.Device.DoorLock doorLock, List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList) + { + this.doorLock = doorLock; + this.localAccountList = localAccountList; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + FrameLayout bottomFrameLayout; + string currentType = string.Empty; + List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList; + VerticalScrolViewLayout bodyView; + #endregion + + void ReadDoorLockUserInfo() + { + System.Threading.Tasks.Task.Run(async () => + { + Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); + try + { + var getDoorLockInfo = await doorLock.GetDoorlockUserInfoAsync(); + if (getDoorLockInfo != null && getDoorLockInfo.doorLockUserDetailData != null) + { + var dataList = getDoorLockInfo.doorLockUserDetailData.UserObjList; + foreach (var doorData in dataList) + { + var localDoorLockObj1 = new ZigBee.Device.DoorLock.LocaDoorLockObj() + { + UserID = doorData.UserId, + UnlockType = doorData.UserType + }; + if ((doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj1.UserID)) == false) + { + doorLock.localDoorLockUserList.Add(localDoorLockObj1.UserID, localDoorLockObj1); + } + } + + // 璇诲彇浜戠闂ㄩ攣璁惧涓殑淇℃伅 + var localDoorLockObj = new ZigBee.Device.DoorLock.GetDoorLockData() { }; + + foreach (var curAccountObj in doorLock.localAllAccountList) + { + localDoorLockObj.CloudAccountId = curAccountObj.SubAccountDistributedMark; + if (doorLock.DeviceAddr != null) + { + localDoorLockObj.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + + var getDoorLockInfoList = await ZigBee.Device.DoorLock.GetDoorLockInfoFromServer("App/GetDoorLockPager", localDoorLockObj); + if (getDoorLockInfoList != null) + { + foreach (var curDoorLockUser in getDoorLockInfoList.PageData) + { + if (doorLock.localDoorLockUserList.ContainsKey(int.Parse(curDoorLockUser.DoorLockLocalUserId))) + { + doorLock.localDoorLockUserList.Remove(int.Parse(curDoorLockUser.DoorLockLocalUserId)); + } + var doorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + doorLockObj.UserID = int.Parse(curDoorLockUser.DoorLockLocalUserId); + doorLockObj.UnlockType = curDoorLockUser.OpenLockMode; + doorLockObj.PrimaryId = curDoorLockUser.Id; + doorLockObj.EntryTime = curDoorLockUser.EntryTime; + doorLockObj.UserName = curDoorLockUser.UserIdRemarks; + doorLockObj.ConnectedAccount = curDoorLockUser.CloudAccountId; + doorLock.localDoorLockUserList.Add(int.Parse(curDoorLockUser.DoorLockLocalUserId), doorLockObj); + } + } + } + } + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + RefreshList(); + CommonPage.Loading.Hide(); + }); + } + }); + } + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.UndistributedUnlockMethod)); + this.btnTitleLine.Visible = false; + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + MidFrameLayoutContent(); + ReadDoorLockUserInfo(); + } + + public void RefreshList() + { + bodyView.RemoveAll(); + foreach (var curUserId in doorLock.localDoorLockUserList.Keys) + { + var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; + if (curDoorLockUser.ConnectedAccount != "") + { + continue; + } + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(161), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, + }; + bodyView.AddChidren(RowView); + + var btnDistributeUnlockIconFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(84), + Width = Application.GetRealWidth(84), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(43), + }; + RowView.AddChidren(btnDistributeUnlockIconFrameLayout); + + var btnDistributeUnlockIcon = new Button() + { + Height = Application.GetRealHeight(84), + Width = Application.GetRealWidth(84), + UnSelectedImagePath = "DoorLock/DistributeUnlockIcon.png", + }; + btnDistributeUnlockIconFrameLayout.AddChidren(btnDistributeUnlockIcon); + + var btnText = new Button() + { + X = Application.GetRealWidth(176), + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(300), + TextAlignment = TextAlignment.CenterLeft, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterVertical, + }; + RowView.AddChidren(btnText); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + #region 鏁版嵁澶勭悊 + switch (curDoorLockUser.UnlockType) + { + case 0: + if (curDoorLockUser.UserName != "") + { + btnText.Text = curDoorLockUser.UserName; + } + else + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; + } + break; + case 3: + if (curDoorLockUser.UserName != "") + { + btnText.Text = curDoorLockUser.UserName; + } + else + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; + } + break; + case 15: + if (curDoorLockUser.UserName != "") + { + btnText.Text = curDoorLockUser.UserName; + } + else + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; + } + break; + } + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + MatchUsersFrameLayout(curDoorLockUser); + }; + btnDistributeUnlockIcon.MouseUpEventHandler += eHandler; + btnDistributeUnlockIconFrameLayout.MouseUpEventHandler += eHandler; + RowView.MouseUpEventHandler += eHandler; + btnText.MouseUpEventHandler += eHandler; + #endregion + } + } + + public void MidFrameLayoutContent() + { + var midTopFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(115), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout, + }; + this.midFrameLayout.AddChidren(midTopFrameLayout); + + var btnAllMethod = new Button() + { + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(141 + 100), + Y = Application.GetRealHeight(35), + X = Application.GetRealWidth(812 - 100), + TextAlignment = TextAlignment.Center, + Text = Language.StringByID(R.MyInternationalizationString.LockMethod), + TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, + TextSize = 12, + }; + midTopFrameLayout.AddChidren(btnAllMethod); + + var btnNext = new Button() + { + X = Application.GetRealWidth(953), + Y = Application.GetRealHeight(20), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + UnSelectedImagePath = "DoorLock/UnLockSideslipIcon.png", + SelectedImagePath = "DoorLock/UnLockSideslipIcon.png", + }; + midTopFrameLayout.AddChidren(btnNext); + btnNext.MouseUpEventHandler += (sender, e) => + { + SideslipFramelayout(); + }; + + bodyView = new VerticalScrolViewLayout() + { + Y = midTopFrameLayout.Bottom, + }; + this.midFrameLayout.AddChidren(bodyView); + + RefreshList(); + } + + //鏈湴璐︽埛 + public void MatchUsersFrameLayout(ZigBee.Device.DoorLock.LocaDoorLockObj curDoorLockUser) + { + #region UI + var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; + this.midFrameLayout.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + }; + bottomFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(100), + Y = Application.GetRealHeight(930), + Radius = 17, + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout); + + var bottomFrameLayout1 = new FrameLayout() + { + Height = Application.GetRealHeight(806 - 50), + Y = Application.GetRealHeight(930 + 48), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + flMain.AddChidren(bottomFrameLayout1); + + var bottomFrameLayout2 = new FrameLayout() + { + Height = Application.GetRealHeight(806), + Y = Application.GetRealHeight(930), + }; + flMain.AddChidren(bottomFrameLayout2); + + var matchUsersFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(138), + }; + bottomFrameLayout2.AddChidren(matchUsersFrameLayout); + + var btnCancel = new Button + { + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(40), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(101), + Text = Language.StringByID(R.MyInternationalizationString.Cancel), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnCancel); + + var btnMatchUser = new Button + { + X = Application.GetRealWidth(446), + Y = Application.GetRealHeight(35), + Height = Application.GetRealHeight(63), + Width = Application.GetRealWidth(284), + Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 16, + }; + matchUsersFrameLayout.AddChidren(btnMatchUser); + + var btnFinish = 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.XMGray3, + TextSize = 14, + }; + matchUsersFrameLayout.AddChidren(btnFinish); + + var btnTopLine = new FrameLayout() + { + Height = Application.GetRealHeight(5), + Y = Application.GetRealHeight(138), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + bottomFrameLayout2.AddChidren(btnTopLine); + + var matchUserHorizontalScrolViewLayout = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(207), + Height = Application.GetRealHeight(806 - 207), + }; + bottomFrameLayout2.AddChidren(matchUserHorizontalScrolViewLayout); + + Button oldbuttonChoose = null; + Button oldUserName = null; + string curAccountId = string.Empty; + for (int i = 0; i < localAccountList.Count; i++) + { + var currentAccount = localAccountList[i]; + var rowFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(127), + }; + matchUserHorizontalScrolViewLayout.AddChidren(rowFrameLayout); + + var btnUserName = new Button() + { + Width = Application.GetRealWidth(743), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(37), + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + }; + rowFrameLayout.AddChidren(btnUserName); + + var btnChoose = new Button() + { + Width = Application.GetRealWidth(60), + Height = Application.GetRealHeight(60), + X = Application.GetRealWidth(861 + 81), + Y = Application.GetRealHeight(35), + SelectedImagePath = "DoorLock/SelectedIcon.png", + Visible = false, + }; + rowFrameLayout.AddChidren(btnChoose); + + var btnLine = new FrameLayout() + { + Y = rowFrameLayout.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + rowFrameLayout.AddChidren(btnLine); + #endregion + #region 鏁版嵁澶勭悊 + int currentIndex = i; + if (currentIndex == localAccountList.Count - 1) + { + btnLine.Visible = false; + } + + if (currentAccount.UserName != "" && currentAccount.UserName != null) + { + btnUserName.Text = currentAccount.UserName; + } + else + { + btnUserName.Text = currentAccount.Account; + } + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + if (!btnChoose.IsSelected) + { + if (oldbuttonChoose != null) + { + oldbuttonChoose.IsSelected = false; + oldbuttonChoose.Visible = false; + } + + if (oldUserName != null) + { + oldbuttonChoose.IsSelected = false; + oldUserName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; + } + oldbuttonChoose = btnChoose; + oldUserName = btnUserName; + oldbuttonChoose.IsSelected = true; + oldbuttonChoose.Visible = true; + oldUserName.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + curAccountId = currentAccount.SubAccountDistributedMark; + } + }; + btnChoose.MouseUpEventHandler += eHandler; + rowFrameLayout.MouseUpEventHandler += eHandler; + btnUserName.MouseUpEventHandler += eHandler; + + } + #endregion + btnCancel.MouseUpEventHandler += (sender, e) => + { + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + }; + + btnFinish.MouseUpEventHandler += async (sender, e) => + { + if (curAccountId == "") + { + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + } + else + { + var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData(); + addLockInfo.CloudAccountId = curAccountId; + if (doorLock.DeviceAddr != null) + { + addLockInfo.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + addLockInfo.OpenLockMode = curDoorLockUser.UnlockType; + addLockInfo.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); + + switch (curDoorLockUser.UnlockType) + { + case 0: + if (curDoorLockUser.UserName != "") + { + addLockInfo.UserIdRemarks = curDoorLockUser.UserName; + } + else + { + addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; + } + break; + case 3: + if (curDoorLockUser.UserName != "") + { + addLockInfo.UserIdRemarks = curDoorLockUser.UserName; + } + else + { + addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; + } + break; + case 15: + if (curDoorLockUser.UserName != "") + { + addLockInfo.UserIdRemarks = curDoorLockUser.UserName; + } + else + { + addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; + } + break; + } + + addLockInfo.EntryTime = curDoorLockUser.EntryTime; + var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/AddDoorLock", addLockInfo); + if (result.StateCode == "Success") + { + if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) + { + doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); + var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + localDoorLockObj.UserID = curDoorLockUser.UserID; + localDoorLockObj.UnlockType = curDoorLockUser.UnlockType; + localDoorLockObj.EntryTime = curDoorLockUser.EntryTime; + localDoorLockObj.UserName = curDoorLockUser.UserName; + localDoorLockObj.ConnectedAccount = curAccountId; + doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj); + RefreshList(); + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + } + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + flMain.RemoveFromParent(); + bottomFrameLayout.RemoveAll(); + } + } + }; + } + + // 渚ц竟瀵艰埅鏍� + void SideslipFramelayout() + { + var dialog = new Dialog + { + }; + dialog.Show(); + + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; + dialog.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + dialog.Close(); + }; + + var sidelipFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(625), + Width = Application.GetRealWidth(449), + Y = Application.GetRealHeight(115 + 160), + X = Application.GetRealWidth(596), + BackgroundImagePath = "DoorLock/SideslipPic.png", + }; + flMain.AddChidren(sidelipFrameLayout); + + var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout() + { + Height = Application.GetRealHeight(600), + Y = Application.GetRealHeight(28), + }; + sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout); + Button oldbutton = null; + Button oldbuttonText = null; + for (var i = 0; i < 4; i++) + { + var rowFrameLayout = new RowLayout() + { + Height = Application.GetRealHeight(150), + }; + sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); + + var btnAllMethod = new Button() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(55), + }; + rowFrameLayout.AddChidren(btnAllMethod); + + var btnMethodText = new Button() + { + Width = Application.GetRealWidth(311), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(69), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + rowFrameLayout.AddChidren(btnMethodText); + + EventHandler<MouseEventArgs> hander = (sender, e) => + { + if (!btnAllMethod.IsSelected) + { + if (oldbutton != null) + { + oldbutton.IsSelected = false; + } + if (oldbuttonText != null) + { + oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; + } + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + doorLock.currentUserDisplayMethod = btnMethodText.Text; + btnAllMethod.IsSelected = true; + oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + + // 绫诲瀷鍖哄垎 + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod)) + { + RefreshList(); + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock)) + { + DisplayByType(0); + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock)) + { + DisplayByType(15); + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock)) + { + DisplayByType(3); + } + } + dialog.Close(); + }; + rowFrameLayout.MouseUpEventHandler += hander; + btnAllMethod.MouseUpEventHandler += hander; + btnMethodText.MouseUpEventHandler += hander; + + switch (i) + { + case 0: + btnAllMethod.UnSelectedImagePath = "DoorLock/AllMethod.png"; + btnAllMethod.SelectedImagePath = "DoorLock/AllMethodOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.AllMethod); + break; + case 1: + btnAllMethod.UnSelectedImagePath = "DoorLock/Password.png"; + btnAllMethod.SelectedImagePath = "DoorLock/PasswordOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock); + break; + case 2: + btnAllMethod.UnSelectedImagePath = "DoorLock/Fingerprint.png"; + btnAllMethod.SelectedImagePath = "DoorLock/FingerprintOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock); + break; + case 3: + btnAllMethod.UnSelectedImagePath = "DoorLock/proximityCard.png"; + btnAllMethod.SelectedImagePath = "DoorLock/proximityCardOn.png"; + btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock); + break; + } + + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3) + { + btnAllMethod.IsSelected = true; + btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbutton = btnAllMethod; + oldbuttonText = btnMethodText; + } + } + } + + // 閫氳繃绫诲瀷绛涢�夋樉绀� + void DisplayByType(int unlockMethod) + { + bodyView.RemoveAll(); + foreach (var curUserId in doorLock.localDoorLockUserList.Keys) + { + var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; + if (curDoorLockUser.ConnectedAccount != "" || curDoorLockUser.UnlockType != unlockMethod) + { + continue; + } + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(161), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, + }; + bodyView.AddChidren(RowView); + + var btnDistributeUnlockIconFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(84), + Width = Application.GetRealWidth(84), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(43), + }; + RowView.AddChidren(btnDistributeUnlockIconFrameLayout); + + var btnDistributeUnlockIcon = new Button() + { + Height = Application.GetRealHeight(84), + Width = Application.GetRealWidth(84), + UnSelectedImagePath = "DoorLock/DistributeUnlockIcon.png", + }; + btnDistributeUnlockIconFrameLayout.AddChidren(btnDistributeUnlockIcon); + + var btnText = new Button() + { + X = Application.GetRealWidth(176), + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(300), + TextAlignment = TextAlignment.CenterLeft, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + Gravity = Gravity.CenterVertical, + }; + RowView.AddChidren(btnText); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + + #region 鏁版嵁澶勭悊 + switch (curDoorLockUser.UnlockType) + { + case 0: + if (curDoorLockUser.UserName != "") + { + btnText.Text = curDoorLockUser.UserName; + } + else + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; + } + break; + case 3: + if (curDoorLockUser.UserName != "") + { + btnText.Text = curDoorLockUser.UserName; + } + else + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; + } + break; + case 15: + if (curDoorLockUser.UserName != "") + { + btnText.Text = curDoorLockUser.UserName; + } + else + { + btnText.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; + } + break; + } + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + MatchUsersFrameLayout(curDoorLockUser); + }; + btnDistributeUnlockIcon.MouseUpEventHandler += eHandler; + btnDistributeUnlockIconFrameLayout.MouseUpEventHandler += eHandler; + RowView.MouseUpEventHandler += eHandler; + btnText.MouseUpEventHandler += eHandler; + #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/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs new file mode 100755 index 0000000..3754458 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs @@ -0,0 +1,319 @@ +锘縰sing System; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + public class UserDoorLockPage : DoorLockCommonLayout, ZigBee.Common.IStatus + { + public UserDoorLockPage(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj) + { + this.doorLock = doorLock; + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; + ZigBee.Device.ZbGateway.StatusList.Add(this); + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + FrameLayout bottomFrameLayout; + Action action; + #endregion + + /// <summary> + /// UI鏄剧ず + /// </summary> + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.DoorLock)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + var btnShare = new Button + { + X = Application.GetRealWidth(850), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + UnSelectedImagePath = "DoorLock/ShareIcon.png", + }; + this.titleFrameLayout.AddChidren(btnShare); + + var btnFuncSet = new Button + { + X = Application.GetRealWidth(953), + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + UnSelectedImagePath = "DoorLock/SettingIcon.png", + }; + this.titleFrameLayout.AddChidren(btnFuncSet); + btnFuncSet.MouseDownEventHandler += (sender, e) => + { + var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock); + Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + userDoorLockPage.Show(); + }; + + btnShare.MouseDownEventHandler += (sender, e) => + { + var doorLock = new ZigBee.Device.DoorLock(); + var memberManagement = new Shared.Phone.UserCenter.DoorLock.MemberManagement(doorLock); + Shared.Phone.UserView.HomePage.Instance.AddChidren(memberManagement); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + memberManagement.Show(); + }; + + MidFrameLayoutContent(); + } + + public void MidFrameLayoutContent() + { + #region UI + var midTopFrameLayout = new FrameLayout() + { + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(115), + Height = Application.GetRealHeight(1238), + Width = Application.GetRealWidth(965), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, + }; + this.midFrameLayout.AddChidren(midTopFrameLayout); + + var btnDoorLockTitle = new Button() + { + Width = Application.GetRealWidth(250), + Height = Application.GetRealHeight(60), + X = Application.GetRealWidth(372), + Y = Application.GetRealHeight(46), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + Text = Language.StringByID(R.MyInternationalizationString.SmartDoorLock), + TextSize = 15, + TextAlignment = TextAlignment.Center, + }; + midTopFrameLayout.AddChidren(btnDoorLockTitle); + + var btnRecord = new Button() + { + Width = Application.GetRealWidth(69), + Height = Application.GetRealHeight(69), + X = Application.GetRealWidth(752), + Y = Application.GetRealHeight(46), + UnSelectedImagePath = "DoorLock/RecordIcon.png", + }; + midTopFrameLayout.AddChidren(btnRecord); + btnRecord.MouseDownEventHandler += (sender, e) => + { + var doorLock = new ZigBee.Device.DoorLock(); + var doorLockRecord = new Shared.Phone.UserCenter.DoorLock.HistoryRecordPage(doorLock); + Shared.Phone.UserView.HomePage.Instance.AddChidren(doorLockRecord); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + doorLockRecord.Show(); + }; + + var btnCollect = new Button() + { + Width = Application.GetRealWidth(69), + Height = Application.GetRealHeight(69), + X = Application.GetRealWidth(850), + Y = Application.GetRealHeight(46), + UnSelectedImagePath = "DoorLock/FavoriteIcon.png", + }; + midTopFrameLayout.AddChidren(btnCollect); + btnCollect.MouseDownEventHandler += (sender, e) => + { + }; + + var btnCurrentText = new Button() + { + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(40), + X = Application.GetRealWidth(415), + Y = Application.GetRealHeight(118), + Text = Language.StringByID(R.MyInternationalizationString.Current), + 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, + }; + midTopFrameLayout.AddChidren(btnStatus); + + var btnDoorLockPic = new Button() + { + Width = Application.GetRealWidth(383), + Height = Application.GetRealHeight(343), + X = Application.GetRealWidth(161), + Y = Application.GetRealHeight(415), + UnSelectedImagePath = "DoorLock/DoorLockPicClose.png", + SelectedImagePath = "DoorLock/DooorLockPicOpen.png", + }; + midTopFrameLayout.AddChidren(btnDoorLockPic); + + var btnFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(420 - 46),//639-35 + Height = Application.GetRealHeight(446), + X = btnDoorLockPic.Right, + Y = Application.GetRealHeight(354), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + midTopFrameLayout.AddChidren(btnFrameLayout); + + var openFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(420),//639-35 + Height = Application.GetRealHeight(446 / 2), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + btnFrameLayout.AddChidren(openFrameLayout); + + var closeFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(420),//639-35 + Height = Application.GetRealHeight(446 / 2), + Y = Application.GetRealHeight(446 / 2), + BackgroundColor = ZigbeeColor.Current.XMWhite, + }; + btnFrameLayout.AddChidren(closeFrameLayout); + + var progressFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(9),//639-35 + Height = Application.GetRealHeight(446), + X = Application.GetRealWidth(95), + Y = Application.GetRealHeight(0), + BackgroundColor = ZigbeeColor.Current.XMVerticalSeekBar, + }; + btnFrameLayout.AddChidren(progressFrameLayout); + + var progressButton = new Button() + { + Width = Application.GetRealWidth(81),//639-35 + Height = Application.GetRealHeight(89), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(347), + UnSelectedImagePath = "DoorLock/UnLockButton.png", + SelectedImagePath = "DoorLock/UnLockButton.png", + }; + btnFrameLayout.AddChidren(progressButton); + + var btnDoorOpenPic = new Button() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(164), + Y = Application.GetRealHeight(6), + UnSelectedImagePath = "DoorLock/DoorLockOpen.png", + }; + openFrameLayout.AddChidren(btnDoorOpenPic); + + var btnDoorClosePic = new Button() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(164), + Y = Application.GetRealHeight(117), + UnSelectedImagePath = "DoorLock/DoorLockClose.png", + }; + closeFrameLayout.AddChidren(btnDoorClosePic); + + var btnCurrentFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = Application.GetRealHeight(138), + Y = Application.GetRealHeight(1100), + BackgroundColor = ZigbeeColor.Current.XMBlack, + }; + midTopFrameLayout.AddChidren(btnCurrentFrameLayout); + + var btnCurrentRoomPic = new Button() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(29), + UnSelectedImagePath = "DoorLock/RoomPic.png", + }; + btnCurrentFrameLayout.AddChidren(btnCurrentRoomPic); + + var btnCurrentRoomName = new Button() + { + Width = Application.GetRealWidth(172), + Height = Application.GetRealHeight(49), + X = Application.GetRealWidth(150), + Y = Application.GetRealHeight(46), + Text = "瀹㈠巺", + TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + TextSize = 12, + TextAlignment = TextAlignment.CenterLeft, + }; + btnCurrentFrameLayout.AddChidren(btnCurrentRoomName); + #endregion + + EventHandler<MouseEventArgs> hander1 = async (sender, e) => + { + RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus); + }; + openFrameLayout.MouseUpEventHandler += hander1; + btnDoorOpenPic.MouseUpEventHandler += hander1; + EventHandler<MouseEventArgs> hander2 = (sender, e) => + { + //new Tip() { MaxWidth = 150, Text = "涓嶆敮鎸佽繙绋嬪叧閿�", Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(openFrameLayout); + btnDoorLockPic.IsSelected = false; + progressButton.Y = Application.GetRealHeight(347); + }; + closeFrameLayout.MouseUpEventHandler += hander2; + btnDoorClosePic.MouseUpEventHandler += hander2; + } + + #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/UserManagement.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs new file mode 100755 index 0000000..0b5d4d8 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs @@ -0,0 +1,302 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using Shared.Phone.UserCenter.Device; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.DoorLock +{ + /// <summary> + /// 闂ㄩ攣绠$悊 + /// </summary> + public class UserManagement : DoorLockCommonLayout, ZigBee.Common.IStatus + { + /// <summary> + /// 鎸夐敭妯″紡鎺ユ敹 + /// </summary> + /// <param name="common">Common.</param> + public void Changed(CommonDevice common) + { + //if (common.Type != ZigBee.Device.DeviceType.OnOffSwitch) + //{ + // return; + //} + + Shared.Application.RunOnMainThread(() => + { + //var dev = common as Panel; + }); + } + //浠庨棬閿佽淇℃伅 + void ReadDoorLockDeviceUserInfo() + { + System.Threading.Tasks.Task.Run(async () => + { + Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); + try + { + var getDoorLockInfo = await doorLock.GetDoorlockUserInfoAsync(); + if (getDoorLockInfo != null && getDoorLockInfo.doorLockUserDetailData != null) + { + var dataList = getDoorLockInfo.doorLockUserDetailData.UserObjList; + foreach (var doorData in dataList) + { + var localDoorLockObj1 = new ZigBee.Device.DoorLock.LocaDoorLockObj() + { + UserID = doorData.UserId, + UnlockType = doorData.UserType + }; + if ((doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj1.UserID)) == false) + { + doorLock.localDoorLockUserList.Add(localDoorLockObj1.UserID, localDoorLockObj1); + } + } + } + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + CommonPage.Loading.Hide(); + }); + } + }); + } + //浠庢湇鍔″櫒璇讳俊鎭� + void ReadDoorLockServerUserInfo(Shared.Phone.UserCenter.MemberInfoRes curAccountObj) + { + System.Threading.Tasks.Task.Run(async () => + { + Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); + try + { + // 璇诲彇浜戠闂ㄩ攣璁惧涓殑淇℃伅 + var localDoorLockObj = new ZigBee.Device.DoorLock.GetDoorLockData() { }; + + localDoorLockObj.CloudAccountId = curAccountObj.SubAccountDistributedMark; + if (doorLock.DeviceAddr != null) + { + localDoorLockObj.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + } + + var getDoorLockInfoList = await ZigBee.Device.DoorLock.GetDoorLockInfoFromServer("App/GetDoorLockPager", localDoorLockObj); + if (getDoorLockInfoList != null) + { + foreach (var curDoorLockUser in getDoorLockInfoList.PageData) + { + if (doorLock.localDoorLockUserList.ContainsKey(int.Parse(curDoorLockUser.DoorLockLocalUserId))) + { + doorLock.localDoorLockUserList.Remove(int.Parse(curDoorLockUser.DoorLockLocalUserId)); + } + var doorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; + doorLockObj.UserID = int.Parse(curDoorLockUser.DoorLockLocalUserId); + doorLockObj.UnlockType = curDoorLockUser.OpenLockMode; + doorLockObj.PrimaryId = curDoorLockUser.Id; + doorLockObj.EntryTime = curDoorLockUser.EntryTime; + doorLockObj.UserName = curDoorLockUser.UserIdRemarks; + doorLockObj.ConnectedAccount = curDoorLockUser.CloudAccountId; + doorLock.localDoorLockUserList.Add(int.Parse(curDoorLockUser.DoorLockLocalUserId), doorLockObj); + } + } + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + CommonPage.Loading.Hide(); + }); + } + }); + } + + + /// 鏋勯�犲嚱鏁� + /// </summary> + /// <param name="doorLock"></param> + public UserManagement(ZigBee.Device.DoorLock doorLock) + { + this.doorLock = doorLock; + } + + #region 鈼� 鍙橀噺鐢虫槑__________________________ + ZigBee.Device.DoorLock doorLock; + List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { }; + #endregion + + public void Show() + { + this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.UserManagement)); + + EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => + { + RemoveFromParent(); + }; + this.btnBack.MouseUpEventHandler += eHandlerBack; + this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; + this.MidFrameLayout(this); + + var btnAddFrameLayout = new FrameLayout + { + X = Application.GetRealWidth(829), + Height = Application.GetRealHeight(72), + Width = Application.GetRealWidth(190), + }; + this.titleFrameLayout.AddChidren(btnAddFrameLayout); + + var btnUndistributeIcon = new Button + { + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + UnSelectedImagePath = "DoorLock/UndistributeIcon.png", + }; + btnAddFrameLayout.AddChidren(btnUndistributeIcon); + + var btnUndistributeText = new Button + { + Height = Application.GetRealHeight(72), + Width = Application.GetRealWidth(121), + TextID = R.MyInternationalizationString.Undistributed, + TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, + X = btnUndistributeIcon.Right, + TextAlignment = TextAlignment.CenterLeft, + }; + btnAddFrameLayout.AddChidren(btnUndistributeText); + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + var undistributeDoorlockUserPage = new Shared.Phone.UserCenter.DoorLock.UndistributeDoorlockUserPage(doorLock, localAccountList); + Shared.Phone.UserView.HomePage.Instance.AddChidren(undistributeDoorlockUserPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + undistributeDoorlockUserPage.Show(); + }; + btnAddFrameLayout.MouseDownEventHandler += eHandler; + btnUndistributeText.MouseDownEventHandler += eHandler; + btnUndistributeIcon.MouseDownEventHandler += eHandler; + + MidFrameLayoutContent(); + } + + async void MidFrameLayoutContent() + { + var SubAccounList = await ZigBee.Device.DoorLock.GetSubAccountByDistributedMark(); + var masterAccount = new Shared.Phone.UserCenter.MemberInfoRes(); + masterAccount.Account = Shared.Common.Config.Instance.Account; + masterAccount.AccountType = Shared.Common.Config.Instance.AccountType; + masterAccount.SubAccountDistributedMark = Shared.Common.Config.Instance.Guid; + masterAccount.UserName = UserCenterResourse.UserInfo.UserName; + localAccountList.Add(masterAccount); + localAccountList.AddRange(SubAccounList); + var bodyView = new VerticalScrolViewLayout() + { + }; + this.midFrameLayout.AddChidren(bodyView); + + doorLock.localAllAccountList = localAccountList; + for (int i = 0; i < localAccountList.Count; i++) + { + var currentAccount = localAccountList[i]; + var RowView = new FrameLayout() + { + Height = Application.GetRealHeight(161), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout, + }; + bodyView.AddChidren(RowView); + + var btnText = new Button() + { + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.CenterLeft, + TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, + Gravity = Gravity.CenterVertical, + TextSize = 14, + }; + RowView.AddChidren(btnText); + + var btnRightFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(110), + Width = Application.GetRealWidth(110), + X = Application.CurrentWidth - Application.GetRealWidth(150), + Y = Application.GetRealHeight(25), + }; + RowView.AddChidren(btnRightFrameLayout); + + var btnRight = new Button() + { + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(58), + UnSelectedImagePath = "DoorLock/RightIcon.png", + Gravity = Gravity.Center, + }; + btnRightFrameLayout.AddChidren(btnRight); + + var line2 = new Button() + { + Y = RowView.Height - 1, + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(965), + Height = 1, + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + RowView.AddChidren(line2); + int currentIndex = i; + if (currentIndex == localAccountList.Count - 1) + { + line2.Visible = false; + } + + if (currentAccount.UserName != null) + { + btnText.Text = currentAccount.UserName; + } + else + { + btnText.Text = currentAccount.Account; + } + + EventHandler<MouseEventArgs> eHandler = (sender, e) => + { + if (currentIndex == 0) + { + var masterManagementPage = new Shared.Phone.UserCenter.DoorLock.MasterManagementPage(doorLock, currentAccount); + Shared.Phone.UserView.HomePage.Instance.AddChidren(masterManagementPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + masterManagementPage.Show(); + } + else if (currentIndex == 1) + { + var userDoorLockPage = new UserDoorLockPage(doorLock, currentAccount); + Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + userDoorLockPage.Show(); + } + else + { + var memberFrozenPage = new Shared.Phone.UserCenter.DoorLock.MemberFrozenPage(doorLock, currentAccount); + Shared.Phone.UserView.HomePage.Instance.AddChidren(memberFrozenPage); + Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; + memberFrozenPage.Show(); + } + }; + btnRight.MouseUpEventHandler += eHandler; + 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/HdlBackup/HdlManualBackUpForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlManualBackUpForm.cs index 47fbae8..fa6d90c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlManualBackUpForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlManualBackUpForm.cs @@ -440,6 +440,18 @@ this.ShowMassage(ShowMsgType.Error, msg); return false; } + if (backName.Contains("##") == true) + { + //瀛樺湪闈炴硶瀛楃銆�##銆� + string msg = Language.StringByID(R.MyInternationalizationString.uErrorFieldIsEsixt); + if (msg.Contains("{0}") == true) + { + msg = string.Format(msg, "##"); + } + this.ShowMassage(ShowMsgType.Error, msg); + return false; + } + return true; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs index a50a04e..38c4032 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs @@ -132,11 +132,17 @@ btnMenberTile.TextSize = 15; bodyFrameLayout.AddChidren(btnMenberTile); + var frameBack = new FrameLayout(); + frameBack.Y = btnMenberTile.Bottom + Application.GetRealHeight(23); + frameBack.Height = Application.GetRealHeight(11); + frameBack.BackgroundColor = UserCenterColor.Current.White; + bodyFrameLayout.AddChidren(frameBack); + //娣诲姞鍙互鍚戜笅婊氬姩鐨勬帶浠� listView = new VerticalListControl(12); - listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(567); + listView.Height = bodyFrameLayout.Height - frameBack.Bottom; listView.BackgroundColor = UserCenterColor.Current.White; - listView.Y = Application.GetRealHeight(567); + listView.Y = frameBack.Bottom; bodyFrameLayout.AddChidren(listView); //鍒濆鍖栨垚鍛樺垪琛� @@ -223,18 +229,8 @@ //娣诲姞鎴愬憳琛� this.AddRowLayout(listNewInfo[i], i != count); } - if (listNewInfo.Count == 0) - { - return; - } //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� - var realHeight = listNewInfo.Count * listView.GetChildren(listView.ChildrenCount - 1).Height; - realHeight += Application.GetRealHeight(23) - listView.rowSpace + Application.GetRealHeight(23); - if (realHeight < listView.Height) - { - //缂╁皬鎺т欢楂樺害 - listView.Height = realHeight; - } + listView.AdjustRealHeight(Application.GetRealHeight(23)); } #endregion @@ -248,16 +244,6 @@ /// <param name="addLine">addLine</param> private void AddRowLayout(MemberInfoRes info, bool addLine) { - if (listView.ChildrenCount == 0) - { - //濉炰竴涓┖鐧界殑杩涘幓鍗犵┖闂� - var rowTemp = new FrameRowControl(); - rowTemp.UseClickStatu = false; - rowTemp.Height = Application.GetRealHeight(23) - listView.rowSpace; - rowTemp.MainKeys = string.Empty; - listView.AddChidren(rowTemp); - } - var rowlayout = new FrameRowControl(listView.rowSpace / 2); rowlayout.Height = Application.GetRealHeight(138); rowlayout.MainKeys = info.Account; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewEmailForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewEmailForm.cs index ae24813..c1cb455 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewEmailForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewEmailForm.cs @@ -164,8 +164,8 @@ btnNext.CanClick = false; //?s鍚庨噸鍙� string repeat = Language.StringByID(R.MyInternationalizationString.RepeatSend1); - //鏈夋晥鏃堕棿300绉� - int waitime = 300; + //鏈夋晥鏃堕棿60绉� + int waitime = 60; btnNext.Text = waitime + "s" + repeat; HdlThreadLogic.Current.RunThread(() => @@ -176,7 +176,6 @@ System.Threading.Thread.Sleep(1000); if (waitime == 0) { - this.canCheckCode = false; Application.RunOnMainThread(() => { if (btnNext != null) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs index f85afd8..c45e6c8 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckNewPhoneForm.cs @@ -184,8 +184,8 @@ btnNext.CanClick = false; //?s鍚庨噸鍙� string repeat = Language.StringByID(R.MyInternationalizationString.RepeatSend1); - //鏈夋晥鏃堕棿300绉� - int waitime = 300; + //鏈夋晥鏃堕棿60绉� + int waitime = 60; btnNext.Text = waitime + "s" + repeat; HdlThreadLogic.Current.RunThread(() => @@ -196,7 +196,6 @@ System.Threading.Thread.Sleep(1000); if (waitime == 0) { - this.canCheckCode = false; Application.RunOnMainThread(() => { if (btnNext != null) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldEmailForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldEmailForm.cs index b642833..70b6f2e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldEmailForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldEmailForm.cs @@ -133,8 +133,8 @@ btnNext.CanClick = false; //?s鍚庨噸鍙� string repeat = Language.StringByID(R.MyInternationalizationString.RepeatSend1); - //鏈夋晥鏃堕棿300绉� - int waitime = 300; + //鏈夋晥鏃堕棿60绉� + int waitime = 60; btnNext.Text = waitime + "s" + repeat; HdlThreadLogic.Current.RunThread(() => @@ -145,7 +145,6 @@ System.Threading.Thread.Sleep(1000); if (waitime == 0) { - this.canCheckCode = false; Application.RunOnMainThread(() => { if (btnNext != null) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs index 4763aba..91b2726 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs @@ -146,8 +146,8 @@ btnNext.CanClick = false; //?s鍚庨噸鍙� string repeat = Language.StringByID(R.MyInternationalizationString.RepeatSend1); - //鏈夋晥鏃堕棿300绉� - int waitime = 300; + //鏈夋晥鏃堕棿60绉� + int waitime = 60; btnNext.Text = waitime + "s" + repeat; HdlThreadLogic.Current.RunThread(() => @@ -158,7 +158,6 @@ System.Threading.Thread.Sleep(1000); if (waitime == 0) { - this.canCheckCode = false; Application.RunOnMainThread(() => { if (btnNext != null) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs index bd256dd..df60c3a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs @@ -110,6 +110,8 @@ rowTemperature.AddBottomLine(); rowTemperature.ButtonClickEvent += (sender, e) => { + //鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛� + this.ShowTemperatrueDevice(btnTemper); }; //銆愭箍搴︺�� @@ -123,6 +125,8 @@ rowHumidity.AddBottomLine(); rowHumidity.ButtonClickEvent += (sender, e) => { + //鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛� + this.ShowHumidityDevice(btnHumi); }; //鍒濆鍖栨甯冨畬鎴� @@ -191,6 +195,198 @@ #endregion + #region 鈻� 娓╁害浼犳劅鍣ㄧ浉鍏砡____________________ + + /// <summary> + /// 鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛� + /// </summary> + /// <param name="btnTemper"></param> + private void ShowTemperatrueDevice(NormalViewControl btnTemper) + { + var listDevice = new List<ZigBee.Device.CommonDevice>(); + foreach (var device in Common.LocalDevice.Current.listAllDevice) + { + //鑾峰彇娓╁害浼犳劅鍣� + if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1) + { + listDevice.Add(device); + } + } + var listSelect = new List<string>() { newRoom.TemperatrueDevice }; + var form = new SelectDeviceForm(); + form.AddForm(listDevice, listSelect, true, true); + form.ActionSelectDevice += (list) => + { + if (list.Count == 0) + { + newRoom.TemperatrueDevice = string.Empty; + btnTemper.Text = Language.StringByID(R.MyInternationalizationString.uNothing); + return; + } + newRoom.TemperatrueDevice = Common.LocalDevice.Current.GetDeviceMainKeys(list[0]); + //鑾峰彇娓╁害鍊� + this.GetTemperatrueValue(btnTemper, newRoom.TemperatrueDevice); + }; + } + + /// <summary> + /// 鑾峰彇娓╁害鍊� + /// </summary> + /// <param name="btnHumi"></param> + /// <param name="deviceKey"></param> + private void GetTemperatrueValue(NormalViewControl btnTemper, string deviceKey) + { + var device = Common.LocalDevice.Current.GetDevice(deviceKey); + if (device == null) + { + return; + } + //鑾峰彇涓�... + btnTemper.Text = Language.StringByID(R.MyInternationalizationString.uGetting); + + HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice"); + HdlDeviceAttributeLogic.Current.AddAttributeEvent("TemperatrueDevice", "DeviceStatusReport", (Action<ZigBee.Device.CommonDevice>)((report) => + { + string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report); + if (newRoom.TemperatrueDevice != mainKeys || btnTemper == null) + { + return; + } + //绉婚櫎鎺変簨浠� + HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice"); + + foreach (var data in report.DeviceStatusReport.AttriBute) + { + if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + { + if (data.AttriButeData == 0) + { + //0鈩� + btnTemper.Text = "0.0鈩�"; + } + else if (data.AttriButeData > 32767) + { + //璐熸暟(鐗规畩澶勭悊) + string strValue = (data.AttriButeData - 65536).ToString(); + //灏忔暟鐐归渶瑕佷竴浣� + strValue = strValue.Substring(0, strValue.Length - 1); + btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + } + else + { + //灏忔暟鐐归渶瑕佷竴浣� + string strValue = data.AttriButeData.ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + } + } + } + })); + //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护 + ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); + } + + #endregion + + #region 鈻� 婀垮害浼犳劅鍣ㄧ浉鍏砡____________________ + + /// <summary> + /// 鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛� + /// </summary> + /// <param name="btnHumi"></param> + private void ShowHumidityDevice(NormalViewControl btnHumi) + { + var listDevice = new List<ZigBee.Device.CommonDevice>(); + foreach (var device in Common.LocalDevice.Current.listAllDevice) + { + //鑾峰彇婀垮害浼犳劅鍣� + if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 2) + { + listDevice.Add(device); + } + } + var listSelect = new List<string>() { newRoom.HumidityDevice }; + var form = new SelectDeviceForm(); + form.AddForm(listDevice, listSelect, true, true); + form.ActionSelectDevice += (list) => + { + if (list.Count == 0) + { + newRoom.HumidityDevice = string.Empty; + btnHumi.Text = Language.StringByID(R.MyInternationalizationString.uNothing); + return; + } + newRoom.HumidityDevice = Common.LocalDevice.Current.GetDeviceMainKeys(list[0]); + //鑾峰彇婀垮害鍊� + this.GetHumidityValue(btnHumi, newRoom.HumidityDevice); + }; + } + + /// <summary> + /// 鑾峰彇婀垮害鍊� + /// </summary> + /// <param name="btnHumi"></param> + /// <param name="deviceKey"></param> + private void GetHumidityValue(NormalViewControl btnHumi, string deviceKey) + { + var device = Common.LocalDevice.Current.GetDevice(deviceKey); + if (device == null) + { + return; + } + //鑾峰彇涓�... + btnHumi.Text = Language.StringByID(R.MyInternationalizationString.uGetting); + + HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice"); + HdlDeviceAttributeLogic.Current.AddAttributeEvent("HumidityDevice", "DeviceStatusReport", (report) => + { + string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report); + if (newRoom.HumidityDevice != mainKeys || btnHumi == null) + { + return; + } + //绉婚櫎鎺変簨浠� + HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice"); + foreach (var data in report.DeviceStatusReport.AttriBute) + { + if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + { + if (data.AttriButeData == 0) + { + //0 + btnHumi.Text = "0.0%"; + } + else + { + //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟) + string strValue = data.AttriButeData.ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + btnHumi.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; + } + } + } + }); + //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护 + ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseForm() + { + HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice"); + HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice"); + + base.CloseForm(); + } + + #endregion + #region 鈻� 涓�鑸柟娉昣__________________________ /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs index 37409c4..d4b328f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs @@ -107,7 +107,14 @@ rowTemperature.AddBottomLine(); rowTemperature.ButtonClickEvent += (sender, e) => { + //鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛� + this.ShowTemperatrueDevice(btnTemper); }; + if (string.IsNullOrEmpty(cloneRoom.TemperatrueDevice) == false) + { + //鑾峰彇娓╁害 + this.GetTemperatrueValue(btnTemper, cloneRoom.TemperatrueDevice); + } //銆愭箍搴︺�� var rowHumidity = new FrameRowControl(this.listview.rowSpace / 2); @@ -120,7 +127,14 @@ rowHumidity.AddBottomLine(); rowHumidity.ButtonClickEvent += (sender, e) => { + //鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛� + this.ShowHumidityDevice(btnHumi); }; + if (string.IsNullOrEmpty(cloneRoom.HumidityDevice) == false) + { + //鑾峰彇婀垮害 + this.GetHumidityValue(btnHumi, cloneRoom.HumidityDevice); + } //鍒濆鍖栨甯冨畬鎴� tableContr.FinishInitControl(bodyFrameLayout, this.listview); @@ -180,6 +194,198 @@ #endregion + #region 鈻� 娓╁害浼犳劅鍣ㄧ浉鍏砡____________________ + + /// <summary> + /// 鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛� + /// </summary> + /// <param name="btnTemper"></param> + private void ShowTemperatrueDevice(NormalViewControl btnTemper) + { + var listDevice = new List<ZigBee.Device.CommonDevice>(); + foreach (var device in Common.LocalDevice.Current.listAllDevice) + { + //鑾峰彇娓╁害浼犳劅鍣� + if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1) + { + listDevice.Add(device); + } + } + var listSelect = new List<string>() { cloneRoom.TemperatrueDevice }; + var form = new SelectDeviceForm(); + form.AddForm(listDevice, listSelect, true, true); + form.ActionSelectDevice += (list) => + { + if (list.Count == 0) + { + cloneRoom.TemperatrueDevice = string.Empty; + btnTemper.Text = Language.StringByID(R.MyInternationalizationString.uNothing); + return; + } + cloneRoom.TemperatrueDevice = Common.LocalDevice.Current.GetDeviceMainKeys(list[0]); + //鑾峰彇娓╁害鍊� + this.GetTemperatrueValue(btnTemper, cloneRoom.TemperatrueDevice); + }; + } + + /// <summary> + /// 鑾峰彇娓╁害鍊� + /// </summary> + /// <param name="btnHumi"></param> + /// <param name="deviceKey"></param> + private void GetTemperatrueValue(NormalViewControl btnTemper, string deviceKey) + { + var device = Common.LocalDevice.Current.GetDevice(deviceKey); + if (device == null) + { + return; + } + //鑾峰彇涓�... + btnTemper.Text = Language.StringByID(R.MyInternationalizationString.uGetting); + + HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice"); + HdlDeviceAttributeLogic.Current.AddAttributeEvent("TemperatrueDevice", "DeviceStatusReport", (Action<ZigBee.Device.CommonDevice>)((report) => + { + string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report); + if (cloneRoom.TemperatrueDevice != mainKeys || btnTemper == null) + { + return; + } + //绉婚櫎鎺変簨浠� + HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice"); + + foreach (var data in report.DeviceStatusReport.AttriBute) + { + if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + { + if (data.AttriButeData == 0) + { + //0鈩� + btnTemper.Text = "0.0鈩�"; + } + else if (data.AttriButeData > 32767) + { + //璐熸暟(鐗规畩澶勭悊) + string strValue = (data.AttriButeData - 65536).ToString(); + //灏忔暟鐐归渶瑕佷竴浣� + strValue = strValue.Substring(0, strValue.Length - 1); + btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + } + else + { + //灏忔暟鐐归渶瑕佷竴浣� + string strValue = data.AttriButeData.ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + } + } + } + })); + //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护 + ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); + } + + #endregion + + #region 鈻� 婀垮害浼犳劅鍣ㄧ浉鍏砡____________________ + + /// <summary> + /// 鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛� + /// </summary> + /// <param name="btnHumi"></param> + private void ShowHumidityDevice(NormalViewControl btnHumi) + { + var listDevice = new List<ZigBee.Device.CommonDevice>(); + foreach (var device in Common.LocalDevice.Current.listAllDevice) + { + //鑾峰彇婀垮害浼犳劅鍣� + if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 2) + { + listDevice.Add(device); + } + } + var listSelect = new List<string>() { cloneRoom.HumidityDevice }; + var form = new SelectDeviceForm(); + form.AddForm(listDevice, listSelect, true, true); + form.ActionSelectDevice += (list) => + { + if (list.Count == 0) + { + cloneRoom.HumidityDevice = string.Empty; + btnHumi.Text = Language.StringByID(R.MyInternationalizationString.uNothing); + return; + } + cloneRoom.HumidityDevice = Common.LocalDevice.Current.GetDeviceMainKeys(list[0]); + //鑾峰彇婀垮害鍊� + this.GetHumidityValue(btnHumi, cloneRoom.HumidityDevice); + }; + } + + /// <summary> + /// 鑾峰彇婀垮害鍊� + /// </summary> + /// <param name="btnHumi"></param> + /// <param name="deviceKey"></param> + private void GetHumidityValue(NormalViewControl btnHumi, string deviceKey) + { + var device = Common.LocalDevice.Current.GetDevice(deviceKey); + if (device == null) + { + return; + } + //鑾峰彇涓�... + btnHumi.Text = Language.StringByID(R.MyInternationalizationString.uGetting); + + HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice"); + HdlDeviceAttributeLogic.Current.AddAttributeEvent("HumidityDevice", "DeviceStatusReport", (report) => + { + string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report); + if (cloneRoom.HumidityDevice != mainKeys || btnHumi == null) + { + return; + } + //绉婚櫎鎺変簨浠� + HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice"); + foreach (var data in report.DeviceStatusReport.AttriBute) + { + if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + { + if (data.AttriButeData == 0) + { + //0 + btnHumi.Text = "0.0%"; + } + else + { + //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟) + string strValue = data.AttriButeData.ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + btnHumi.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; + } + } + } + }); + //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护 + ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseForm() + { + HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice"); + HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice"); + + base.CloseForm(); + } + + #endregion + #region 鈻� 涓�鑸柟娉昣__________________________ /// <summary> @@ -207,6 +413,8 @@ editorRoom.FloorId = cloneRoom.FloorId; editorRoom.Name = cloneRoom.Name; + editorRoom.HumidityDevice = cloneRoom.HumidityDevice; + editorRoom.TemperatrueDevice = cloneRoom.TemperatrueDevice; editorRoom.BackgroundImage = cloneRoom.BackgroundImage; editorRoom.BackgroundImageType = cloneRoom.BackgroundImageType; cloneRoom = null; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs index 724b35e..4c66ad9 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs @@ -20,10 +20,6 @@ /// </summary> private string floorKeys = string.Empty; /// <summary> - /// 鍏ㄩ儴鐨勯『搴� - /// </summary> - private Dictionary<string, List<string>> dicAllSort = new Dictionary<string, List<string>>(); - /// <summary> /// 鎴块棿椤哄簭 /// </summary> private List<string> listRoomSort = new List<string>(); @@ -127,7 +123,8 @@ } frameRow.frameTable.ButtonClickEvent += (sender, e) => { - + var form = new LookRoomSettionForm(); + form.AddForm(room); }; if (room.IsSharedRoom == true) @@ -169,6 +166,12 @@ Common.Room.CurrentRoom = Common.Room.Lists[0]; } Common.Room.CurrentRoom.Remove(room.FileName); + //璋冩暣楂樺害 + frameRow.RemoveFromParent(); + listView.AdjustRealHeight(Application.GetRealHeight(23)); + //淇濆瓨椤哄簭 + this.listRoomSort.Remove(room.Id); + Common.Room.CurrentRoom.SaveRoomSort(floorKeys, this.listRoomSort); }); }; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomDeviceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomDeviceListForm.cs new file mode 100755 index 0000000..c848958 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomDeviceListForm.cs @@ -0,0 +1,111 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.Residence +{ + /// <summary> + /// 鎴块棿璁惧涓�瑙堢晫闈� + /// </summary> + public class LookRoomDeviceListForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="titleName">鏍囬</param> + /// <param name="detailTile">鏄庣粏鏍囬</param> + /// <param name="listDevice">璁惧鍒楄〃(涓婚敭)</param> + public void ShowForm(string titleName, string detailTile, List<string> listDevice) + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(titleName); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(detailTile, listDevice); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame(string detailTile, List<string> listDevice) + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + var frameTitle = new FrameLayout(); + frameTitle.BackgroundColor = UserCenterColor.Current.White; + frameTitle.Height = Application.GetRealHeight(115); + bodyFrameLayout.AddChidren(frameTitle); + var btnTitle = new NormalViewControl(800, 60, true); + btnTitle.Y = Application.GetRealHeight(49); + btnTitle.X = ControlCommonResourse.XXLeft; + btnTitle.TextSize = 15; + btnTitle.TextColor = UserCenterColor.Current.TextColor2; + btnTitle.Text = detailTile; + frameTitle.AddChidren(btnTitle); + + var listView = new VerticalListControl(23); + listView.Y = frameTitle.Bottom; + listView.Height = bodyFrameLayout.Height - frameTitle.Height; + listView.BackgroundColor = UserCenterColor.Current.White; + bodyFrameLayout.AddChidren(listView); + + HdlThreadLogic.Current.RunMainInThread(() => + { + for (int i = 0; i < listDevice.Count; i++) + { + //鑾峰彇璁惧 + var device = Common.LocalDevice.Current.GetDevice(listDevice[i]); + if (device == null) + { + continue; + } + //娣诲姞璁惧琛� + this.AddDeviceRow(listView, device, i != listDevice.Count - 1); + } + listView.AdjustRealHeight(Application.GetRealHeight(23)); + }); + } + + #endregion + + #region 鈻� 娣诲姞璁惧琛宊________________________ + + /// <summary> + /// 娣诲姞璁惧琛� + /// </summary> + /// <param name="listView"></param> + /// <param name="device"></param> + /// <param name="addLine"></param> + private void AddDeviceRow(VerticalListControl listView, CommonDevice device, bool addLine) + { + var frameRow = new FrameRowControl(listView.rowSpace / 2); + frameRow.UseClickStatu = false; + listView.AddChidren(frameRow); + //鍥炬爣 + var btnIcon = frameRow.AddLeftIcon(81); + Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device); + //璁惧鍚嶅瓧 + var btnName = frameRow.AddLeftCaption(Common.LocalDevice.Current.GetDeviceEpointName(device), 700); + btnName.TextSize = 15; + if (device.IsOnline == 0) + { + btnName.TextColor = UserCenterColor.Current.TextGrayColor1; + } + //搴曠嚎 + if (addLine == true) + { + frameRow.AddBottomLine(); + } + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs new file mode 100755 index 0000000..184c54c --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs @@ -0,0 +1,443 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.Residence +{ + /// <summary> + /// 鏌ョ湅鎴块棿閰嶇疆鐨勭晫闈� + /// </summary> + public class LookRoomSettionForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鏌ョ湅鐨勬埧闂村璞� + /// </summary> + private Common.Room lookRoom = null; + /// <summary> + /// 褰撳墠閫夋嫨鐨勫垎鏀紝1锛氬満鏅� 2锛氬姛鑳� + /// </summary> + private int nowSelectIndex = 1; + /// <summary> + /// 妗屽竷鎺т欢 + /// </summary> + private FrameLayout frameTable = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_room">鏌ョ湅鐨勬埧闂村璞�</param> + public void ShowForm(Common.Room i_room) + { + this.lookRoom = i_room; + + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(lookRoom.Name); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + //鍒濆鍖栧垎鏀帶浠� + this.InitSwitchControl(); + + //鍒濆鍖栨甯冩帶浠� + this.frameTable = new FrameLayout(); + frameTable.Y = Application.GetRealHeight(187); + frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(187); + bodyFrameLayout.AddChidren(frameTable); + + //鏄剧ず鍦烘櫙鍒楄〃 + this.ShowSceneList(); + } + + /// <summary> + /// 鍒濆鍖栧垎鏀帶浠� + /// </summary> + private void InitSwitchControl() + { + var btnTemp = new NormalViewControl(10, 10, false); + btnTemp.TextID = R.MyInternationalizationString.uScence; + + //鍦烘櫙妗�(鐐瑰嚮鑼冨洿鏈夌偣灏忥紝闇�瑕佹墿澶у畠鐨勭偣鍑昏寖鍥�) + var frameScene = new FrameLayoutControl(); + frameScene.UseClickStatu = false; + frameScene.Height = Application.GetRealHeight(90); + frameScene.Width = btnTemp.GetRealWidthByText(16); + frameScene.X = ControlCommonResourse.XXLeft; + frameScene.Y = Application.GetRealHeight(40); + bodyFrameLayout.AddChidren(frameScene); + //鍦烘櫙 + var btnScene = new NormalViewControl(frameScene.Width, Application.GetRealHeight(63), false); + btnScene.Text = btnTemp.Text; + btnScene.TextSize = 16; + btnScene.TextColor = UserCenterColor.Current.TextColor2; + frameScene.AddChidren(btnScene, ChidrenBindMode.BindEventOnly); + //搴曠嚎 + var btnSceneLine = new NormalViewControl(40, 10, true); + btnSceneLine.Y = btnScene.Bottom + Application.GetRealHeight(14); + btnSceneLine.X = btnScene.X + btnScene.Width / 2 - Application.GetRealWidth(40) / 2; + btnSceneLine.Radius = (uint)Application.GetRealHeight(10) / 2; + btnSceneLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor; + frameScene.AddChidren(btnSceneLine, ChidrenBindMode.BindEventOnly); + + btnTemp.TextID = R.MyInternationalizationString.uFunction; + //鍔熻兘妗�(鐐瑰嚮鑼冨洿鏈夌偣灏忥紝闇�瑕佹墿澶у畠鐨勭偣鍑昏寖鍥�) + var frameFunc = new FrameLayoutControl(); + frameFunc.UseClickStatu = false; + frameFunc.Height = Application.GetRealHeight(90); + frameFunc.Width = btnTemp.GetRealWidthByText(16); + frameFunc.X = frameScene.Right + Application.GetRealWidth(58); + frameFunc.Y = Application.GetRealHeight(40); + bodyFrameLayout.AddChidren(frameFunc); + //鍔熻兘 + var btnFunc = new NormalViewControl(frameFunc.Width, Application.GetRealHeight(63), false); + btnFunc.Text = btnTemp.Text; + btnFunc.TextColor = UserCenterColor.Current.TextGrayColor3; + frameFunc.AddChidren(btnFunc, ChidrenBindMode.BindEventOnly); + //搴曠嚎 + var btnFuncLine = new NormalViewControl(40, 10, true); + btnFuncLine.Y = btnFunc.Bottom + Application.GetRealHeight(14); + btnFuncLine.X = btnFunc.X + btnFunc.Width / 2 - Application.GetRealWidth(40) / 2; + btnFuncLine.Radius = (uint)Application.GetRealHeight(10) / 2; + btnFuncLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor; + frameFunc.AddChidren(btnFuncLine, ChidrenBindMode.BindEventOnly); + btnFuncLine.Visible = false; + + frameScene.ButtonClickEvent += (sender, e) => + { + //鍦烘櫙鍒嗘敮閫夋嫨 + if (this.nowSelectIndex == 1) + { + return; + } + this.nowSelectIndex = 1; + + btnScene.TextSize = 16; + btnScene.TextColor = UserCenterColor.Current.TextColor2; + btnFunc.TextSize = 14; + btnFunc.TextColor = UserCenterColor.Current.TextGrayColor3; + btnSceneLine.Visible = true; + btnFuncLine.Visible = false; + + //鏄剧ず鍦烘櫙鍒楄〃 + this.ShowSceneList(); + }; + + frameFunc.ButtonClickEvent += (sender, e) => + { + //鍔熻兘鍒嗘敮閫夋嫨 + if (this.nowSelectIndex == 2) + { + return; + } + this.nowSelectIndex = 2; + + btnScene.TextSize = 14; + btnScene.TextColor = UserCenterColor.Current.TextGrayColor3; + btnFunc.TextSize = 16; + btnFunc.TextColor = UserCenterColor.Current.TextColor2; + btnFuncLine.Visible = true; + btnSceneLine.Visible = false; + + //鏄剧ず鍔熻兘鍒楄〃 + this.ShowFunctionList(); + }; + } + + #endregion + + #region 鈻� 鍦烘櫙鏄剧ず___________________________ + + /// <summary> + /// 鏄剧ず鍦烘櫙鍒楄〃 + /// </summary> + private void ShowSceneList() + { + //娓呯┖妗屽竷 + this.frameTable.RemoveAll(); + + var listView = new VerticalFrameControl(29); + listView.Height = frameTable.Height; + frameTable.AddChidren(listView); + + HdlThreadLogic.Current.RunMainInThread(() => + { + if (this.frameTable == null) + { + return; + } + foreach (var data in lookRoom.SceneUIList) + { + var frameContr = new FrameLayout(); + frameContr.Height = Application.GetRealHeight(470); + listView.AddChidrenFrame(frameContr); + //鍦烘櫙鍥剧墖 + var btnPic = new PicViewControl(878, 470, true); + btnPic.Gravity = Gravity.CenterHorizontal; + btnPic.UnSelectedImagePath = data.IconPath; + frameContr.AddChidren(btnPic); + } + }); + } + + #endregion + + #region 鈻� 鍔熻兘鏄剧ず___________________________ + + /// <summary> + /// 鏄剧ず鍔熻兘鍒楄〃 + /// </summary> + private void ShowFunctionList() + { + //娓呯┖妗屽竷 + this.frameTable.RemoveAll(); + + var frameBack = new FrameLayout(); + frameBack.X = ControlCommonResourse.XXLeft; + frameBack.BackgroundColor = UserCenterColor.Current.White; + frameBack.Width = bodyFrameLayout.Width; + frameBack.Height = Application.GetRealHeight(1650); + frameBack.Radius = (uint)Application.GetMinRealAverage(20); + frameTable.AddChidren(frameBack); + + var listView = new VerticalListControl(23); + listView.Y = Application.GetRealHeight(23); + listView.Height = Application.GetRealHeight(1549 - 23); + frameBack.AddChidren(listView); + + HdlThreadLogic.Current.RunMainInThread(() => + { + if (listView == null) + { + return; + } + //鑾峰彇鍒嗙粍鍚庣殑璁惧鍒楄〃 + var dicGroupDevice = this.GetAllGroupDevice(); + var dicData = new Dictionary<string, DeviceRowInfo>(); + var listGwId = new List<string>(); + foreach (var textId in dicGroupDevice.Keys) + { + //娣诲姞璁惧琛� + this.AddDeviceRow(dicGroupDevice[textId], textId, listView); + foreach (var deviceKey in dicGroupDevice[textId].listDeviceKeys) + { + var device = Common.LocalDevice.Current.GetDevice(deviceKey); + if (listGwId.Contains(device.CurrentGateWayId) == false) + { + //缃戝叧ID + listGwId.Add(device.CurrentGateWayId); + } + //浠ュ洖璺綔涓虹储寮曞幓鎸囧畾瀵硅薄 + dicData[deviceKey] = dicGroupDevice[textId]; + } + } + listView.AdjustRealHeight(Application.GetRealHeight(23)); + //寮�鍚澶囧湪绾跨洃娴� + this.StartCheckDeviceOnline(listView, listGwId, dicData); + }); + } + + #endregion + + #region 鈻� 娣诲姞璁惧琛宊________________________ + + /// <summary> + /// 娣诲姞璁惧琛� + /// </summary> + /// <param name="rowInfo"></param> + /// <param name="TextId"></param> + /// <param name="listView"></param> + private void AddDeviceRow(DeviceRowInfo rowInfo, int TextId, VerticalListControl listView) + { + var frameRow = new FrameRowControl(listView.rowSpace / 2); + frameRow.LeftOffset = Application.GetRealWidth(46) - ControlCommonResourse.XXLeft; + frameRow.RightOffset = -ControlCommonResourse.XXLeft; + listView.AddChidren(frameRow); + //鍥炬爣 + var btnIcon = frameRow.AddLeftIcon(81); + btnIcon.UnSelectedImagePath = rowInfo.IconPath; + //鍚嶇О + var btnView = frameRow.AddLeftCaption(string.Empty, 600); + btnView.TextID = TextId; + btnView.TextSize = 15; + //鍙崇澶� + frameRow.AddRightArrow(); + //鍦ㄧ嚎鏁� + var btnOnline = frameRow.AddMostRightView(rowInfo.OnlineCount + "/" + rowInfo.listDeviceKeys.Count, 300); + rowInfo.btnOnline = btnOnline; + //搴曠嚎 + frameRow.AddBottomLine(); + frameRow.ButtonClickEvent += (sender, e) => + { + var form = new LookRoomDeviceListForm(); + form.AddForm(lookRoom.Name, Language.StringByID(TextId), rowInfo.listDeviceKeys); + }; + } + + #endregion + + #region 鈻� 鏁村悎璁惧___________________________ + + /// <summary> + /// 鑾峰彇鍒嗙粍鍚庣殑璁惧 + /// </summary> + /// <returns></returns> + private Dictionary<int, DeviceRowInfo> GetAllGroupDevice() + { + //鍏ㄩ儴鐨勮澶� + var listDevice = lookRoom.GetRoomListDevice(); + var dic = new Dictionary<int, DeviceRowInfo>(); + foreach (var device in listDevice) + { + var typeInfo = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device }); + if (device.Type == DeviceType.IASZone) + { + //杩欎釜寮哄埗涓轰紶鎰熷櫒 + typeInfo.BeloneTextId = R.MyInternationalizationString.uDeviceBelongId1200; + typeInfo.ConcreteType = Common.DeviceConcreteType.Sensor; + } + if (device.Type == DeviceType.OnOffOutput) + { + string iconPath = string.Empty; + //缁х數鍣ㄧ殑鏃跺��,闇�瑕佺壒娈婂鐞� + if (device.DfunctionType == DeviceFunctionType.A寮�鍏�) + { + typeInfo.BeloneTextId = R.MyInternationalizationString.uSwitch; + iconPath = "Device/Switch.png"; + } + else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇) + { + typeInfo.BeloneTextId = R.MyInternationalizationString.uSocket1; + iconPath = "Device/Socket1.png"; + } + else if (device.DfunctionType == DeviceFunctionType.A鐏厜) + { + typeInfo.BeloneTextId = R.MyInternationalizationString.uLight; + iconPath = "Device/Light.png"; + } + else + { + //缁х數鍣� + typeInfo.BeloneTextId = R.MyInternationalizationString.uDeviceBelongId2300; + iconPath = "Device/Relay.png"; + } + if (dic.ContainsKey(typeInfo.BeloneTextId) == false) + { + dic[typeInfo.BeloneTextId] = new DeviceRowInfo(); + dic[typeInfo.BeloneTextId].IconPath = iconPath; + } + } + else + { + if (dic.ContainsKey(typeInfo.BeloneTextId) == false) + { + dic[typeInfo.BeloneTextId] = new DeviceRowInfo(); + string path1 = string.Empty; + string path2 = string.Empty; + Common.LocalDevice.Current.GetDeviceBeloneIcon(typeInfo.ConcreteType, ref path1, ref path2); + dic[typeInfo.BeloneTextId].IconPath = path1; + } + } + dic[typeInfo.BeloneTextId].listDeviceKeys.Add(Common.LocalDevice.Current.GetDeviceMainKeys(device)); + } + return dic; + } + + #endregion + + #region 鈻� 璁惧鍦ㄧ嚎___________________________ + + /// <summary> + /// 寮�鍚澶囧湪绾跨洃娴� + /// </summary> + /// <param name="listView">鍒ゆ柇閫�鍑烘椂浣跨敤</param> + /// <param name="listGwId">缃戝叧ID</param> + /// <param name="dicData">浠ュ洖璺綔涓虹储寮曞幓鎸囧畾瀵硅薄</param> + private void StartCheckDeviceOnline(VerticalListControl listView, List<string> listGwId, Dictionary<string, DeviceRowInfo> dicData) + { + HdlThreadLogic.Current.RunThread(async () => + { + for (int i = 0; i < listGwId.Count; i++) + { + if (listView == null) + { + return; + } + //杩欓噷涓昏鍙槸鑾峰彇鍦ㄧ嚎鐘舵�� + var zbway = HdlGatewayLogic.Current.GetLocalGateway(listGwId[i]); + var result = await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, (device) => + { + string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device); + if (listView.Parent == null) + { + return; + } + if (listView == null || dicData.ContainsKey(mainkeys) == false) + { + return; + } + var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys); + if (localDevice != null && localDevice.IsOnline != device.IsOnline) + { + //鍦ㄧ嚎鐘舵�佷竴鏍风殑璇濓紝涓嶉渶瑕佸埛鏂� + localDevice.IsOnline = device.IsOnline; + localDevice.ReSave(); + } + if (device.IsOnline == 1) + { + HdlThreadLogic.Current.RunMain(() => + { + dicData[mainkeys].OnlineCount += 1; + dicData[mainkeys].btnOnline.Text = dicData[mainkeys].OnlineCount + "/" + dicData[mainkeys].listDeviceKeys.Count; + }); + } + }, ShowErrorMode.NO); + } + }); + } + + #endregion + + #region 鈻� 缁撴瀯浣揰____________________________ + + /// <summary> + /// 璁惧琛屼俊鎭� + /// </summary> + private class DeviceRowInfo + { + /// <summary> + /// 鍥炬爣 + /// </summary> + public string IconPath = string.Empty; + /// <summary> + /// 璁惧鍥炶矾涓婚敭 + /// </summary> + public List<string> listDeviceKeys = new List<string>(); + /// <summary> + /// 璁惧鍦ㄧ嚎鏁� + /// </summary> + public int OnlineCount = 0; + /// <summary> + /// 鍦ㄧ嚎鎺т欢 + /// </summary> + public NormalViewControl btnOnline = null; + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs index c6f851d..9ff8a6a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs @@ -462,7 +462,10 @@ { if (Config.Instance.HomeFilePathList.Contains($"House_{keys}.json") == false) { + //淇濆瓨椤哄簭 listResidenceSort.Remove(keys); + Room.CurrentRoom.SaveFloorSort(listResidenceSort); + this.listView.RemoveAll(); //鏁版嵁宸茬粡鍙樻洿 HdlThreadLogic.Current.RunThread(() => diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/TemperatrueHumiditySensorSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/TemperatrueHumiditySensorSelectForm.cs deleted file mode 100755 index 0b26480..0000000 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/TemperatrueHumiditySensorSelectForm.cs +++ /dev/null @@ -1,10 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; - -namespace Shared.Phone.UserCenter.Residence -{ - public class TemperatrueHumiditySensorSelectForm : EditorCommonForm - { - } -} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddDeviceAlarmTargetListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddDeviceAlarmTargetListForm.cs index 8913330..99b47a6 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddDeviceAlarmTargetListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddDeviceAlarmTargetListForm.cs @@ -235,7 +235,7 @@ #endregion - #region 鈻� 淇濆瓨閫夋嫨鐨勮澶嘷______________________ + #region 鈻� 淇濆瓨閫夋嫨鐨勮澶嘷____________________ /// <summary> /// 淇濆瓨閫夋嫨鐨勮澶� @@ -281,7 +281,7 @@ #endregion - #region 鈻� 缁撴瀯浣揰______________________________ + #region 鈻� 缁撴瀯浣揰____________________________ /// <summary> /// 鎶ヨ鐩爣鏁版嵁 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CurtainAlarmSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CurtainAlarmSettionForm.cs index a4cadca..e100eba 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CurtainAlarmSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CurtainAlarmSettionForm.cs @@ -92,7 +92,7 @@ { btnOpenStatu.Visible = false; } - btnOpenStatu.UnSelectedImagePath = "Item/Tick.png"; + btnOpenStatu.UnSelectedImagePath = "Item/ItemSelected.png"; //搴曠嚎 btnOpenRow.AddBottomLine(); @@ -112,7 +112,7 @@ { btnCloseStatu.Visible = false; } - btnCloseStatu.UnSelectedImagePath = "Item/Tick.png"; + btnCloseStatu.UnSelectedImagePath = "Item/ItemSelected.png"; //搴曠嚎 btnCloseRow.AddBottomLine(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/LightAlarmSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/LightAlarmSettionForm.cs index d06cd1e..f6faa52 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/LightAlarmSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/LightAlarmSettionForm.cs @@ -92,7 +92,7 @@ { btnOpenStatu.Visible = false; } - btnOpenStatu.UnSelectedImagePath = "Item/Tick.png"; + btnOpenStatu.UnSelectedImagePath = "Item/ItemSelected.png"; //搴曠嚎 btnOpenRow.AddBottomLine(); @@ -112,7 +112,7 @@ { btnCloseStatu.Visible = false; } - btnCloseStatu.UnSelectedImagePath = "Item/Tick.png"; + btnCloseStatu.UnSelectedImagePath = "Item/ItemSelected.png"; //搴曠嚎 btnCloseRow.AddBottomLine(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs index 2c46711..25ee7ff 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs @@ -474,18 +474,18 @@ //鐣岄潰鍏抽棴 return; } - await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, this.ReceiveDeviceStatuPush, ShowErrorMode.NO); + await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO); } }); } /// <summary> - /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ��(涓嶈蹇樿鏈�鍚庡畠浼氭帹閫佷竴涓狽ull鐨勪笢瑗胯繃鏉�) + /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ�� /// </summary> /// <param name="device"></param> private void ReceiveDeviceStatuPush(CommonDevice device) { - if (this.Parent == null || device == null) + if (this.Parent == null) { //鐣岄潰鍏抽棴 return; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SwitchAlarmSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SwitchAlarmSettionForm.cs index c1dd88e..cec0d8f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SwitchAlarmSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SwitchAlarmSettionForm.cs @@ -85,7 +85,7 @@ { btnOpenStatu.Visible = false; } - btnOpenStatu.UnSelectedImagePath = "Item/Tick.png"; + btnOpenStatu.UnSelectedImagePath = "Item/ItemSelected.png"; //搴曠嚎 btnOpenRow.AddBottomLine(); @@ -104,7 +104,7 @@ { btnCloseStatu.Visible = false; } - btnCloseStatu.UnSelectedImagePath = "Item/Tick.png"; + btnCloseStatu.UnSelectedImagePath = "Item/ItemSelected.png"; //寮� btnOpenRow.ButtonClickEvent += (sender, e) => diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs index 3c400c1..50321cc 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs @@ -3,6 +3,7 @@ using System.Net; using System.Net.Sockets; using System.Text; + using Shared.Common; using ZigBee.Device; using static ZigBee.Device.ZbGateway; @@ -11,7 +12,7 @@ { public static class Application { - static bool isInited; + public static bool isInited; static bool isEncry; /// <summary> /// 鏄惁姝e湪鎼滅储缃戝叧 @@ -29,10 +30,11 @@ return; } isInited = true; + new System.Threading.Thread(async () => { var gateWayList = new List<ZbGateway> { }; - var searchCount = 2; + var searchCount = 0; var oldHomeID = string.Empty; var broadBytes = new byte[44];// byteHomeId[0] ,//H broadBytes[0] = 0xfe; @@ -89,32 +91,44 @@ } var broadcastIpAddress = new Shared.Net.NetWiFi().BroadcastIpAddress; - - //缃戝叧閫氳澶勭悊 - - if (0 < gateWayList.Count) + System.Console.WriteLine($"Wifi{Shared.Application.IsWifi}"); + if (Shared.Application.IsWifi) { - searchCount = 2; - gateWayList.Clear(); - var aa = GateWayList; - - //鍏抽棴杩滅▼鏈嶅姟鍣� - if (RemoteMqttClient!=null&& RemoteMqttClient.IsConnected==true) + if (0 < gateWayList.Count) { - await RemoteMqttClient?.DisconnectAsync(); - System.Console .WriteLine ($"鏀跺埌缃戝叧杩滅▼杩炴帴涓诲姩鏂紑_{System.DateTime.Now.ToString()}"); + searchCount = 4; + + //鍏抽棴杩滅▼鏈嶅姟鍣� + if (RemoteMqttClient != null && RemoteMqttClient.IsConnected == true) + { + await RemoteMqttClient?.DisconnectAsync(); + System.Console.WriteLine($"鏀跺埌缃戝叧杩滅▼杩炴帴涓诲姩鏂紑_{System.DateTime.Now.ToString()}"); + } + } + else + { + if (searchCount <= 0) + { + System.Console.WriteLine($"=====================3{System.DateTime.Now.ToString()}"); + gateWayList.Clear(); + //杩滅▼閫氳杩炴帴锛岃繛鎺ヤ簯绔湇鍔″櫒 + await StartCloudMqtt(); + } } } else - { - if (searchCount <= 0) - { - //杩滅▼閫氳杩炴帴锛岃繛鎺ヤ簯绔湇鍔″櫒 + { + if (searchCount <= 0) + { + System.Console.WriteLine($"=====================4{System.DateTime.Now.ToString()}"); + gateWayList.Clear(); + //杩滅▼閫氳杩炴帴锛岃繛鎺ヤ簯绔湇鍔″櫒 await StartCloudMqtt(); } } searchCount--; + #region 2绉掓悳绱竴娆$綉鍏� //姣�0.5绉掑箍鎾彂鐜颁竴娆$綉鍏筹紝鍏�2s int count = 4; new System.Threading.Thread(() => @@ -124,7 +138,8 @@ try { //鐐瑰鐐瑰彂閫�(鍏堝彂涓�鏉″凡鏈夌殑鐐规挱锛屽洖澶嶅嚑鐜囬珮涓�鐐癸級 - for (int i = 0; i < gateWayList.Count;i++){ + for (int i = 0; i < gateWayList.Count; i++) + { FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(System.Net.IPAddress.Parse(gateWayList[i].getGatewayBaseInfo.IpAddress), 7624), broadBytes); } //骞挎挱鍙戦�� @@ -171,7 +186,6 @@ var pubKeyLengthByte1 = bytes[49 + gwNameLength + 1 + gwIdLength + 2]; int pubKeyLength = ((pubKeyLengthByte1 & 0xff) << 8 | (pubKeyLengthByte0 & 0xff)); var pubKey = Encoding.UTF8.GetString(bytes, 49 + gwNameLength + 1 + gwIdLength + 2 + 1, pubKeyLength); - var zbGateWay = new ZbGateway { getGatewayBaseInfo = new ZbGateway.GatewayBaseInfo @@ -192,24 +206,24 @@ //缃戝叧鍖归厤褰撳墠浣忓畢涓埌缃戝叧 if (Shared.Common.Config.Instance.HomeId == homeID) { - gateWayList.Add(zbGateWay); + gateWayList.Add(zbGateWay); } //UI鐣岄潰姝e湪鎼滅储锛屼笉蹇呴厤褰撳墠浣忓畢鍒板埌缃戝叧姝ゆ椂涔熼�氳 else if (IsSearchingGateway) { - gateWayList.Add(zbGateWay); + gateWayList.Add(zbGateWay); } //缃戝叧涓埌浣忓畢ID涓虹┖姝ゆ椂涔熼�氳 else if (homeID == string.Empty) { - gateWayList.Add(zbGateWay); + gateWayList.Add(zbGateWay); } } //缃戝叧鍒楄〃瀛樺偍澶勭悊 var gateWay = GateWayList.Find(obj => obj.getGatewayBaseInfo != null && obj.getGatewayBaseInfo.gwID == zbGateWay.getGatewayBaseInfo.gwID); if (gateWay == null) { - await zbGateWay.StartLocalMqtt(ipAddress); + await zbGateWay.StartLocalMqtt(ipAddress); GateWayList.Add(zbGateWay); NewGateWayAction?.Invoke(zbGateWay); } @@ -223,7 +237,7 @@ gateWay.DisConnect("2"); GateWayList.Remove(gateWay); gateWay = zbGateWay; - await zbGateWay.StartLocalMqtt(ipAddress); + await zbGateWay.StartLocalMqtt(ipAddress); GateWayList.Add(gateWay); } else @@ -232,7 +246,7 @@ gateWay.getGatewayBaseInfo.Time = time; gateWay.getGatewayBaseInfo.GwName = gwName; gateWay.getGatewayBaseInfo.HomeId = homeID; - await gateWay.StartLocalMqtt(ipAddress); + await gateWay.StartLocalMqtt(ipAddress); } //涓荤綉鍏宠缃� @@ -259,6 +273,7 @@ var mess = ex.Message; } } +#endregion } catch (Exception ex) { @@ -305,7 +320,7 @@ { gateWayList[j].getGatewayBaseInfo.IsMainGateWay = false; } - break; + break; } } } diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs index 9eef470..7354850 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs @@ -98,6 +98,21 @@ return Config.Instance.Account; } } + /// <summary> + /// 褰撳墠闇�瑕佽繛鎺ヤ簯绔痁igbeeMqttBroker鐨勮繛鎺ョ殑瀵嗙爜 + /// </summary> + public string ConnectGuid + { + get + { + if (Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 2 + || Phone.UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3) + { + return AdminConnectZigbeeMqttBrokerName; + } + return Config.Instance.Guid; + } + } /// <summary> /// 璐︽埛鐧诲綍鎴愬姛鐨凪qttKey diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs index a1b5119..77e997b 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs @@ -212,12 +212,12 @@ else if (this.Type == DeviceType.ColorDimmableLight) { //褰╃伅 - IconPath = "Device/ColorDimmableLight.png"; + IconPath = "Device/ColorLight.png"; } else if (this.Type == DeviceType.DimmableLight) { //璋冨厜鍣� - IconPath = "Device/ColorDimmableLight.png"; + IconPath = "Device/Light.png"; } else if (this.Type == DeviceType.OnOffOutput) { @@ -293,9 +293,9 @@ /// </summary> public DeviceType Type = DeviceType.UnKown; /// <summary> - /// 璁惧鐨勫姛鑳界被鍨�(姝ょ被鍨嬬洰鍓嶅彧閽堝缁х數鍣ㄥ洖璺湁鏁�,榛樿涓虹伅鍏�) + /// 璁惧鐨勫姛鑳界被鍨�(姝ょ被鍨嬬洰鍓嶅彧閽堝缁х數鍣ㄥ洖璺湁鏁�,榛樿鏈寚瀹�) /// </summary> - public DeviceFunctionType DfunctionType = DeviceFunctionType.A鐏厜; + public DeviceFunctionType DfunctionType = DeviceFunctionType.A鏈畾涔�; /// <summary> /// MAC鍦板潃 /// </summary> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs index 6ca45a5..d273095 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs @@ -91,6 +91,10 @@ public enum DeviceFunctionType { /// <summary> + /// 娌℃湁鎸囧畾涓轰粈涔堢被鍨� + /// </summary> + A鏈畾涔� = 0, + /// <summary> /// 寮�鍏� /// </summary> A寮�鍏� = 1, diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs index df2cc00..c1bc636 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs @@ -1,7 +1,11 @@ 锘縰sing System; using System.Collections.Generic; +using System.Threading.Tasks; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Shared; +using Shared.Common; +using Shared.Common.ResponseEntity; using Shared.Phone.UserCenter; namespace ZigBee.Device @@ -13,11 +17,64 @@ this.Type = DeviceType.DoorLock; } + #region 闂ㄩ攣鏈湴鍙橀噺 + /// <summary> + /// 闂ㄩ攣鏈湴鐢ㄦ埛鍒楄〃 + /// </summary> + /// <returns></returns> + public Dictionary<int, LocaDoorLockObj> localDoorLockUserList = new Dictionary<int, LocaDoorLockObj>(); + public string currentUserDisplayMethod = string.Empty; + public List<Shared.Phone.UserCenter.MemberInfoRes> localAllAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { }; + public static int RemoteUnlockCount = 3;//杩滅▼寮�閿佹鏁伴檺鍒� + public static string RemoteUnlockPassword = string.Empty;//杩滅▼寮�閿佸瘑鐮� + public static DateTime maxValue = DateTime.MaxValue; + public static DateTime minValue = DateTime.MinValue; + + /// <summary> + /// 闂ㄩ攣缂栫▼浜嬩欢閫氱煡 + /// </summary> + [System.Serializable] + public class LocaDoorLockObj + { + /// <summary> + /// 鐢ㄦ埛id + ///闂ㄩ攣鏈湴褰曞叆鐨勫瘑鐮併�佹寚绾广�佹劅搴斿崱閮芥湁鍞竴瀵瑰簲鐨勭敤鎴稩d + /// </summary> + public int UserID; + /// <summary> + /// 寮�閿佺被鍨� + /// 甯哥敤锛� + /// 0:Keypad(閿洏/瀵嗙爜)锛�3:RFID(灏勯鍗�)锛�15:鎸囩汗 + ///涓嶅父鐢細 + /// 1:RF(Zigbee鏃犵嚎)锛�2:Manual(鎵嬪姩)锛�255:Indeterminate(涓嶇‘瀹�) + /// </summary> + public int UnlockType; + /// <summary> + /// 鍏宠仈璐︽埛鐨処D + /// </summary> + public string ConnectedAccount = string.Empty; + /// <summary> + /// 闂ㄩ攣鐢ㄦ埛鍚� + /// </summary> + public string UserName = string.Empty; + /// <summary> + /// 闂ㄩ攣褰曞叆鐨勬椂 + /// </summary> + public DateTime EntryTime = System.DateTime.MinValue; + /// <summary> + /// PrimaryId 闂ㄩ攣浜戠涓� 閿�(闈炴洿鏂板瓧娈�,浠ヤ笅鍧囦负鏇存柊瀛楁) -->閿悕 : PrimaryId榛樿鍊�: null + /// </summary> + public string PrimaryId = ""; + } + + #endregion + #region 涓庝簯绔�氳鎺ュ彛 + #region 闂ㄩ攣鏈嶅姟鍣ㄥ彂閫佸熀鏈俊鎭� /// <summary> /// 娣诲姞闂ㄩ攣 /// </summary> - public class AddDoorLockData + public class BaseDoorLockServerData { /// <summary> /// RequestVersion @@ -30,23 +87,32 @@ /// <summary> /// 浣忓畢Id -->閿悕 : HomeId /// </summary> - public string HomeId = ""; - /// <summary> - /// 浜戠甯愬彿Id -->閿悕 : CloudAccountId - /// </summary> - public string CloudAccountId = ""; + public string HomeId = Shared.Common.Config.Instance.HomeId; /// <summary> /// 闂ㄩ攣Id -->閿悕 : DoorLockId /// </summary> public string DoorLockId = ""; /// <summary> - /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�) -->閿悕 : OpenLockMode (鍙��) - /// </summary> - public int OpenLockMode = 0; - /// <summary> /// 闂ㄩ攣鏈湴鐢ㄦ埛Id -->閿悕 : DoorLockLocalUserId /// </summary> public string DoorLockLocalUserId = ""; + } + #endregion + + #region 娣诲姞闂ㄩ攣 + /// <summary> + /// 娣诲姞闂ㄩ攣 + /// </summary> + public class AddDoorLockData : BaseDoorLockServerData + { + /// <summary> + /// 浜戠甯愬彿Id -->閿悕 : CloudAccountId + /// </summary> + public string CloudAccountId = ""; + /// <summary> + /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�) -->閿悕 : OpenLockMode (鍙��) + /// </summary> + public int OpenLockMode = 0; /// <summary> /// Data 鐩稿叧鍐呭(濡�:瀵嗙爜銆佹寚绾广�両C鍗� 鐨勪簩杩涘埗) -->閿悕 : Data (鍙��) public byte[] Data = null; @@ -65,7 +131,214 @@ /// <summary> /// EntryTime 褰曞叆鏃堕棿 -->閿悕 : EntryTime(鍙��) /// </summary> + public DateTime EntryTime = System.DateTime.Now; + } + + /// <summary> + /// 娣诲姞闂ㄩ攣缁撴灉 + /// </summary> + public class AddDoorLockDataRes + { + /// <summary> + /// 鍝嶅簲鐨勭増鏈彿,涓�鑸姹備粈涔堢増鏈彿锛岃繖閲屼笌涔嬭姹傜浉鍚� + /// </summary> + public string ResponseVersion = string.Empty; + /// <summary> + /// 鍝嶅簲鐘舵�佺爜: + ///<para>(1)Success 鍒橻璋冪敤姝ゆ帴鍙f搷浣滄垚鍔焆, ResponseData鍒欎负null</para> + ///<para>(2)ParameterOrEmpty,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭�, ResponseData鍒欎负null</para> + ///(<para>3)NoLogin,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭负[鏃犳晥鐧诲綍Token!]</para> + ///<para>(4)NoRecord,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭负[褰撳墠鎻愪氦DoorLockId鍊煎湪浜戠涓嶅瓨鍦紝璇风‘璁ゅ�兼槸鍚︽纭�!]</para> + ///<para>(5)DoorLockIdNoIsYou,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭负[褰撳墠鎻愪氦DoorLockId骞朵笉灞炰簬浣犲綋鍓嶅笎鍙风殑锛岃纭鍊兼槸鍚︽纭�!]</para> + /// </summary> + public string StateCode = string.Empty; + } + #endregion + + #region 鏇存柊闂ㄩ攣 + /// <summary> + /// 鏇存柊闂ㄩ攣 + /// </summary> + public class RefreshDoorLockData : BaseDoorLockServerData + { + /// <summary> + /// PrimaryId 闂ㄩ攣浜戠涓� 閿�(闈炴洿鏂板瓧娈�,浠ヤ笅鍧囦负鏇存柊瀛楁) -->閿悕 : PrimaryId榛樿鍊�: null + /// </summary> + public string PrimaryId = ""; + /// <summary> + /// 浜戠甯愬彿Id -->閿悕 : CloudAccountId + /// </summary> + public string CloudAccountId = ""; + /// <summary> + /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�) -->閿悕 : OpenLockMode (鍙��) + /// </summary> + public int OpenLockMode = 0; + + /// <summary> + /// 浣忓畢Id (鍙��) + /// </summary> + public byte[] Data; + /// <summary> + /// 鐢ㄦ埛Id澶囨敞 + /// </summary> + public string UserIdRemarks = ""; + /// <summary> + /// 鏄惁涓虹鐞嗗憳闂ㄩ攣 + /// </summary> + public bool IsFreezeUser; + /// <summary> + /// 鏄惁涓虹鐞嗗憳闂ㄩ攣 + /// </summary> + public bool IsTempUnlockAuthority; + } + #endregion + + #region 鍒犻櫎闂ㄩ攣 + /// <summary> + /// 鍒犻櫎闂ㄩ攣 + /// </summary> + public class DeleteDoorLockData : BaseDoorLockServerData + { + /// <summary> + /// PrimaryId 闂ㄩ攣浜戠涓� 閿�(闈炴洿鏂板瓧娈�,浠ヤ笅鍧囦负鏇存柊瀛楁) -->閿悕 : PrimaryId榛樿鍊�: null + /// </summary> + public string PrimaryId = ""; + /// <summary> + /// 闂ㄩ攣Id -->閿悕 : DoorLockId (鍙��) + /// </summary> + public int DelDoorLockDelType; + } + #endregion + + #region 鑾峰彇闂ㄩ攣 + /// <summary> + /// 鑾峰彇闂ㄩ攣 + /// </summary> + public class GetDoorLockData : BaseDoorLockServerData + { + /// <summary> + /// 浜戠甯愬彿Id -->閿悕 : CloudAccountId (鍙��) + /// </summary> + public string CloudAccountId = ""; + /// <summary> + /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�) -->閿悕 : OpenLockMode (鍙��) + /// </summary> + //public int OpenLockMode = 0; + } + + [Serializable] + public class GetDoorLockDataRes + { + public List<CloudDoorLockObj> PageData = new List<CloudDoorLockObj>(); + public int PageIndex; + public int PageSize; + public int TotalCount; + public int TotalPages; + public bool HasPreviousPage; + public bool HasNextPage; + } + [Serializable] + public class CloudDoorLockObj + { + /// <summary> + /// 闂ㄩ攣Id + /// </summary> + public string DoorLockId; + /// <summary> + /// 浜戠甯愬彿Id + /// </summary> + public string CloudAccountId; + /// <summary> + /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�) + /// </summary> + public int OpenLockMode; + /// <summary> + /// 闂ㄩ攣鏈湴鐢ㄦ埛Id + /// </summary> + public string DoorLockLocalUserId; + /// <summary> + /// 浣忓畢Id + /// </summary> + public byte[] Data; + /// <summary> + /// 鐢ㄦ埛Id澶囨敞 + /// </summary> + public string UserIdRemarks; + /// <summary> + /// 鏄惁涓虹鐞嗗憳闂ㄩ攣 + /// </summary> + public bool IsAdminDoorLock; + /// <summary> + /// 鏄惁涓虹鐞嗗憳闂ㄩ攣 + /// </summary> + public bool IsFreezeUser; + /// <summary> + /// 鏄惁涓虹鐞嗗憳闂ㄩ攣 + /// </summary> + public bool IsTempUnlockAuthority; + /// <summary> + /// 褰曞叆鏃堕棿 + /// </summary> public DateTime EntryTime; + /// <summary> + /// 鏈�鍚庢洿鏂版椂闂� + /// </summary> + public string LastChangeTime; + /// <summary> + /// 銆愰棬閿佷簯绔富閿��,鐢ㄤ簬銆愭坊鍔犻棬閿佸巻鍙层�戞帴鍙d腑鐨凞oorLockId鍙傛暟鍙娿�愬垹闄ら棬閿併�戞帴鍙d腑鐨凱rimaryId鍙傛暟,娉ㄦ剰涓嶆槸缃戝叧涓殑銆愰棬閿両d + /// </summary> + public string Id; + /// <summary> + /// 鍒涘缓鏃堕棿 + /// </summary> + public DateTime CreatedOnUtc; + } + + /// <summary> + /// 鑾峰彇闂ㄩ攣缁欎簯鏈嶅姟鍣� + /// </summary> + public static async System.Threading.Tasks.Task<GetDoorLockDataRes> GetDoorLockInfoFromServer(string RequestName, GetDoorLockData getDoorLockData) + { + return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<GetDoorLockDataRes>>)(async () => + { + GetDoorLockDataRes listInfo = null; + var revertObj = await SendDoorLockToServer(RequestName, getDoorLockData); + if (revertObj != null && revertObj.ResponseData != null) + { + var result = revertObj.ResponseData.ToString(); + if (result != null) + { + listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetDoorLockDataRes>(result); + int i = 0; + } + } + return listInfo; + })); + } + #endregion + + /// <summary> + /// 鍙戦�侀棬閿佹暟鎹埌鏈嶅姟鍣紝鍙洖澶嶇姸鎬侊紝娌℃湁鏁版嵁澶勭悊 + /// </summary> + /// <returns>鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑ResponsePack</returns> + /// <param name="RequestName">璁块棶鍦板潃</param> + /// <param name="obj">涓�涓被</param> + public static async Task<ResponsePack> SendDoorLockToServer(string RequestName, object obj) + { + try + { + //搴忓垪鍖栧璞� + var requestJson = JsonConvert.SerializeObject(obj); + //璁块棶鎺ュ彛 + var result = await CommonPage.Instance.RequestHttpsZigbeeAsync(RequestName, System.Text.Encoding.UTF8.GetBytes(requestJson)); + + return result; + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + return null; + } } /// <summary> @@ -78,7 +351,7 @@ return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<Shared.Phone.UserCenter.MemberInfoRes>>>)(async () => { var pra = new Shared.Phone.UserCenter.MemberListInfoPra(); - string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", true, pra); + string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra); var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result); return listInfo; })); @@ -96,23 +369,6 @@ }); } #endregion - - #region 闂ㄩ攣鏈湴鍙橀噺 - /// <summary> - /// 闂ㄩ攣鏈湴鐢ㄦ埛鍒楄〃 - /// </summary> - /// <returns></returns> - public Dictionary<int, DoorLockProgrammingEventNotificationCommand> localDoorLockUserList = new Dictionary<int, DoorLockProgrammingEventNotificationCommand>(); - public string currentUserDisplayMethod = string.Empty; - - #endregion - - public async System.Threading.Tasks.Task GetDoorLockAllInfo() - { - FingerprintInfo fingerprint = await GetFingerprintAsync(); - var password = GetPasswordAsync(); - var proximity = GetProximityAsync(); - } #region 闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡 /// <summary> @@ -415,373 +671,6 @@ } #endregion - /* - #region 鑾峰彇闂ㄩ攣鏈湴log璁板綍 - ///<summary > - ///鑾峰彇闂ㄩ攣鏈湴log璁板綍 - ///<para>鑻ュ懡浠や腑鐨凱IN/RFID Code涓庨棬閿佷腑鐨凱IN/RFID Code鐩稿尮閰嶏紝鍒欏皢闂ㄩ攣涓婇攣</para> - ///<para>command :闂ㄩ攣璁惧璁板綍鐨勭储寮曞彿锛涘彇鍊艰寖鍥达細</para> - ///<para>1~鈥淣umber of Log Records Supported attribute鈥濓紱</para> - ///<para>鍊间负0琛ㄧず鑾峰彇璁惧鏈�杩戠殑璁板綍鏁版嵁銆�</para> - ///</summary> - public async System.Threading.Tasks.Task<LogRecordResponAllData> LogRecordAsync(int logIndex) - { - if (Gateway == null) - { - return null; - } - return await System.Threading.Tasks.Task.Run(async () => - { - LogRecordResponAllData dataRes = null; - 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) - { - dataRes = new LogRecordResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } - else - { - dataRes = new LogRecordResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - } - } - - if (topic == gatewayID + "/" + "DoorLock/DoorLockGetLogRecordResponseCommand") - { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<LogRecordResData>(jobject["Data"].ToString()); - - if (tempData == null) - { - dataRes = new LogRecordResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; - } - else - { - dataRes = new LogRecordResponAllData { logRecordResData = tempData }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); - } - } - }; - Gateway.Actions += action; - DebugPrintLog("DoorLock/DoorLockGetLogRecordResponseCommand_Actions 鍚姩" + System.DateTime.Now.ToString()); - - try - { - var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 257 }, { "Command", 4 }, { "SendMode", 2 } }; - var data = new JObject { { "LogIndex", logIndex } }; - jObject.Add("Data", data); - Gateway.Send("DoorLock/test", jObject.ToString()); - } - catch { } - var dateTime = DateTime.Now; - while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) - { - await System.Threading.Tasks.Task.Delay(10); - if (dataRes != null) - { - break; - } - } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) - { - dataRes = new LogRecordResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - } - Gateway.Actions -= action; - DebugPrintLog("DoorLock/DoorLockGetLogRecordResponseCommand_Actions 閫�鍑�" + System.DateTime.Now.ToString()); - - return dataRes; - }); - } - - ///<summary > - ///鑾峰彇闂ㄩ攣鏈湴log璁板綍 - /// </summary> - public class LogRecordResponAllData - { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; - /// <summary> - /// 鑾峰彇闂ㄩ攣鏈湴log璁板綍 - /// </summary> - public LogRecordResData logRecordResData; - } - - ///<summary > - ///鑾峰彇闂ㄩ攣鏈湴log璁板綍 - /// </summary> - public class LogRecordResData - { - /// <summary> - /// 浜嬩欢瑙﹀彂 - /// </summary> - public int OperationEventSoure; - /// <summary> - /// 浜嬩欢 - /// </summary> - public int OperationEventCode; - /// <summary> - /// 璁惧褰撳墠鏃堕棿鐨勬椂闂存埑 - /// </summary> - public int ZigbeeLocalTime; - } - #endregion - */ - - /* 鑾峰彇缃戝叧闂ㄩ攣淇℃伅锛屾殏涓嶆敮鎸� - #region 鑾峰彇鎵�鏈夐棬閿佹墍鏈夌敤鎴蜂俊鎭� - ///<summary > - ///鑾峰彇鎵�鏈夐棬閿佹墍鏈夌敤鎴蜂俊鎭� - ///</summary> - public async System.Threading.Tasks.Task<AlldoorlockUserInfoResponAllData> GetAlldoorlockUserInfoRspAsync() - { - if (Gateway == null) - { - return null; - } - return await System.Threading.Tasks.Task.Run(async () => - { - AlldoorlockUserInfoResponAllData dataRes = null; - 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) - { - dataRes = new AlldoorlockUserInfoResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } - else - { - dataRes = new AlldoorlockUserInfoResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - } - } - - if (topic == gatewayID + "/" + "Doorlock/GetAlldoorlockUserInfoRsp") - { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<AlldoorlockUserInfoResData>(jobject["Data"].ToString()); - - if (tempData == null) - { - dataRes = new AlldoorlockUserInfoResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; - } - else - { - dataRes = new AlldoorlockUserInfoResponAllData { alldoorlockUserInfoResData = tempData }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); - } - } - }; - Gateway.Actions += action; - DebugPrintLog("闂ㄩ攣Doorlock/GetAlldoorlockUserInfoRsp_Actions 鍚姩" + System.DateTime.Now.ToString()); - - try - { - var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 6100 } }; - Gateway.Send("DoorLock/test", jObject.ToString()); - } - catch { } - var dateTime = DateTime.Now; - while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) - { - await System.Threading.Tasks.Task.Delay(10); - if (dataRes != null) - { - break; - } - } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) - { - dataRes = new AlldoorlockUserInfoResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - } - Gateway.Actions -= action; - DebugPrintLog("闂ㄩ攣Doorlock/GetAlldoorlockUserInfoRsp_Actions 閫�鍑�" + System.DateTime.Now.ToString()); - - return dataRes; - }); - } - - ///<summary > - ///鑾峰彇鎵�鏈夐棬閿佹墍鏈夌敤鎴蜂俊鎭� - /// </summary> - public class AlldoorlockUserInfoResponAllData - { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; - /// <summary> - /// 鑾峰彇鎵�鏈夐棬閿佹墍鏈夌敤鎴蜂俊鎭� - /// </summary> - public AlldoorlockUserInfoResData alldoorlockUserInfoResData; - } - - ///<summary > - ///鑾峰彇鎵�鏈夐棬閿佹墍鏈夌敤鎴蜂俊鎭� - /// </summary> - public class AlldoorlockUserInfoResData - { - /// <summary> - /// 浜嬩欢瑙﹀彂 - /// </summary> - public int doorlockUserInfoRecordSum; - /// <summary> - /// 浜嬩欢 - /// </summary> - public int OperationEventCode; - /// <summary> - /// 璁惧褰撳墠鏃堕棿鐨勬椂闂存埑 - /// </summary> - public int ZigbeeLocalTime; - } - #endregion - - #region 鑾峰彇鍗曚釜闂ㄩ攣鍗曚釜鐢ㄦ埛淇℃伅 - ///<summary > - ///鑾峰彇鍗曚釜闂ㄩ攣鍗曚釜鐢ㄦ埛淇℃伅 - ///<para>userId:闂ㄩ攣鏈湴鐢ㄦ埛Id</para> - ///</summary> - public async System.Threading.Tasks.Task<UserInfoByMACEPUserIdResponAllData> GetdoorlockUserInfoByMACEPUserIdAsync(int userId) - { - if (Gateway == null) - { - return null; - } - return await System.Threading.Tasks.Task.Run(async () => - { - UserInfoByMACEPUserIdResponAllData dataRes = null; - 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) - { - dataRes = new UserInfoByMACEPUserIdResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } - else - { - dataRes = new UserInfoByMACEPUserIdResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - } - } - - if (topic == gatewayID + "/" + "Doorlock/GetdoorlockUserInfoByMACEPUserIdRsp") - { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfoByMACEPUserIdRspResData>(jobject["Data"].ToString()); - - if (tempData == null) - { - dataRes = new UserInfoByMACEPUserIdResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; - } - else - { - dataRes = new UserInfoByMACEPUserIdResponAllData { userInfoByMACEPUserIdRspResData = tempData }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); - } - } - }; - Gateway.Actions += action; - DebugPrintLog("闂ㄩ攣Doorlock/GetdoorlockUserInfoByMACEPUserIdRsp 鍚姩" + System.DateTime.Now.ToString()); - - try - { - var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 0 }, { "Command", 6102 } }; - var data = new JObject { { "UserId", userId } }; - jObject.Add("Data", data); - Gateway.Send("DoorLock/test", jObject.ToString()); - } - catch { } - var dateTime = DateTime.Now; - while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) - { - await System.Threading.Tasks.Task.Delay(10); - if (dataRes != null) - { - break; - } - } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) - { - dataRes = new UserInfoByMACEPUserIdResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - } - Gateway.Actions -= action; - DebugPrintLog("闂ㄩ攣Doorlock/GetdoorlockUserInfoByMACEPUserIdRsp 閫�鍑�" + System.DateTime.Now.ToString()); - - return dataRes; - }); - } - - ///<summary > - ///鑾峰彇鍗曚釜闂ㄩ攣鍗曚釜鐢ㄦ埛淇℃伅 - /// </summary> - public class UserInfoByMACEPUserIdResponAllData - { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; - /// <summary> - /// 鑾峰彇鍗曚釜闂ㄩ攣鍗曚釜鐢ㄦ埛淇℃伅 - /// </summary> - public UserInfoByMACEPUserIdRspResData userInfoByMACEPUserIdRspResData; - } - - ///<summary > - ///鑾峰彇鎵�鏈夐棬閿佹墍鏈夌敤鎴蜂俊鎭� - /// </summary> - public class UserInfoByMACEPUserIdRspResData - { - /// <summary> - /// 浜嬩欢瑙﹀彂 - /// </summary> - public int OperationEventSoure; - /// <summary> - /// 浜嬩欢 - /// </summary> - public int OperationEventCode; - /// <summary> - /// 璁惧褰撳墠鏃堕棿鐨勬椂闂存埑 - /// </summary> - public int ZigbeeLocalTime; - } - #endregion - */ - #region 涓存椂瀵嗙爜淇℃伅 /// <summary> /// 涓存椂瀵嗙爜鏈湴瀛樺偍瀵硅薄 @@ -804,178 +693,19 @@ } #endregion - #region 鎸囩汗淇℃伅 - public async System.Threading.Tasks.Task<FingerprintInfo> GetFingerprintAsync() - { - FingerprintInfo result = null; - return result; - } - - /// <summary> - /// 鐢ㄦ埛鎸囩汗鍒楄〃 - /// </summary> - public List<FingerprintInfo> fingerprintList = new List<FingerprintInfo>(); - - /// <summary> - /// 鐢ㄦ埛鎸囩汗鍒楄〃淇℃伅 - /// </summary> - [System.Serializable] - public class FingerprintInfo - { - /// <summary> - /// 鎸囩汗澶囨敞 - /// </summary> - public string fingerprintRemark = string.Empty; - /// <summary> - /// 鎸囩汗鍥剧墖 - /// </summary> - public string fingerprintImage = string.Empty; - /// <summary> - /// 鎸囩汗ID - /// </summary> - public int userFingerprintID; - /// <summary> - /// 鎸囩汗鐩爣鍒楄〃 - /// </summary> - public readonly List<string> sceneFingerprintTargetList = new List<string>(); - } - #endregion - - #region 瀵嗙爜淇℃伅 - public PasswordInfo GetPasswordAsync() - { - return null; - } - /// <summary> - /// 鐢ㄦ埛瀵嗙爜鍒楄〃 - /// </summary> - public List<PasswordInfo> passwordList = new List<PasswordInfo>(); - - /// <summary> - /// 鐢ㄦ埛瀵嗙爜鍒楄〃淇℃伅 - /// </summary> - [System.Serializable] - public class PasswordInfo - { - /// <summary> - /// 瀵嗙爜澶囨敞 - /// </summary> - public string passwordRemark = string.Empty; - /// <summary> - /// 瀵嗙爜鍥剧墖 - /// </summary> - public string passwordImage = string.Empty; - /// <summary> - /// 瀵嗙爜ID - /// </summary> - public int userPasswordID; - /// <summary> - /// 瀵嗙爜鐩爣鍒楄〃 - /// </summary> - public readonly List<string> scenePasswordTargetList = new List<string>(); - } - #endregion - - #region 鎰熷簲鍗′俊鎭� - public ProximityInfo GetProximityAsync() - { - return null; - } - /// <summary> - /// 鐢ㄦ埛鎰熷簲鍗″垪琛� - /// </summary> - public List<ProximityInfo> proximityList = new List<ProximityInfo>(); - - /// <summary> - /// 鐢ㄦ埛鎰熷簲鍗″垪琛ㄤ俊鎭� - /// </summary> - [System.Serializable] - public class ProximityInfo - { - /// <summary> - /// 鎰熷簲鍗″娉� - /// </summary> - public string proximityRemark = string.Empty; - /// <summary> - /// 鎰熷簲鍗″浘鐗� - /// </summary> - public string proximityImage = string.Empty; - /// <summary> - /// 鎰熷簲鍗D - /// </summary> - public int userProximityID; - /// <summary> - /// 鎰熷簲鍗$洰鏍囧垪琛� - /// </summary> - public readonly List<string> sceneProximityTargetList = new List<string>(); - } - #endregion - - #region 鍘嗗彶璁板綍 - /// <summary> - /// 鍘嗗彶璁板綍鍒楄〃 - /// </summary> - public List<HistoryRecord> historyRecordList = new List<HistoryRecord> { }; - /// <summary> - /// 闂ㄩ攣鐘舵�佸拰鎶ヨ淇℃伅 - /// </summary> - [System.Serializable] - public class HistoryRecord - { - /// <summary> - /// 闂ㄩ攣寮�閿佺被鍨嬪搴�1 2 3 6 - /// </summary> - public byte type; - - /// <summary> - /// 闂ㄩ攣寮�閿佺敤鎴稩D - /// </summary> - public int userID; - - /// <summary> - /// 骞� - /// </summary> - public string year; - - /// <summary> - /// 鏈� - /// </summary> - public string month; - - /// <summary> - /// 鏃� - /// </summary> - public string day; - - /// <summary> - /// 鏃� - /// </summary> - public string hour; - - /// <summary> - /// 鍒� - /// </summary> - public string minute; - - /// <summary> - /// 绉� - /// </summary> - public string second; - } - #endregion - #region 绉佹湁鍛戒护 - #region 鍥炲榛樿鍝嶅簲鐨勬帶鍒� + + #region 鐢ㄦ埛绠$悊鎺у埗 ///<summary > - ///榛樿鍝嶅簲鎺у埗 + ///鐢ㄦ埛绠$悊鎺у埗 /// <para>passData:閫忎紶鏁版嵁</para> /// </summary> - public async System.Threading.Tasks.Task<ResponseAllData> DefaultControlAsync(string passData) + public async System.Threading.Tasks.Task<DefaultControlResponseAllData> DefaultControlAsync(string passData) { - ResponseAllData result = null; + DefaultControlResponseAllData result = null; if (Gateway == null) { - result = new ResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" }; + result = new DefaultControlResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" }; return result; } return await System.Threading.Tasks.Task.Run(async () => @@ -992,12 +722,12 @@ if (temp == null) { - result = new ResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; } else { - result = new ResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + result = new DefaultControlResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbDataPassthrough") @@ -1007,7 +737,7 @@ if (gatewayTemp.clientDataPassthroughResponseData == null) { - result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; + result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { @@ -1019,10 +749,10 @@ var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); if (command == "0002") { - var tempD = new ResponseData(); + var tempD = new DefaultControlResponseData(); 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 }; + result = new DefaultControlResponseAllData { defaultControlResponseData = tempD }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0402_{ topic}"); } } @@ -1054,7 +784,7 @@ } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { - result = new ResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + result = new DefaultControlResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } Gateway.Actions -= action; DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); @@ -1062,9 +792,7 @@ return result; }); } - #endregion - #region 鐢ㄦ埛绠$悊鍙戦�佹暟鎹� /// <summary> /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹� /// </summary> @@ -1122,16 +850,330 @@ return data; } + + /// <summary> + /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶� + /// </summary> + public DefaultControlResponseAllData defaultControlResponseAllData; + [System.Serializable] + public class DefaultControlResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鐢ㄦ埛绠$悊鏁版嵁鍥炲 + /// </summary> + public DefaultControlResponseData defaultControlResponseData; + } + + /// <summary> + /// 鐢ㄦ埛绠$悊鏁版嵁鍥炲 + /// </summary> + [System.Serializable] + public class DefaultControlResponseData + { + /// <summary> + ///鍝嶅簲鎿嶄綔鐮侊紙0-ffff锛� + /// </summary> + public int command = -1; + /// <summary> + /// 鐘舵�佸�� + /// <para>榛樿鍝嶅簲缁撴灉锛� + ///<para>0 鍒犻櫎鎴愬姛</para> + ///<para>1 鍒犻櫎澶辫触</para> + ///<para>2 鐢ㄦ埛涓嶅瓨鍦�</para> + ///<para>32 鍐荤粨鎴愬姛</para> + ///<para>34 鍐荤粨澶辫触</para> + ///<para>33 瑙e喕鎴愬姛</para> + ///<para>35 瑙e喕澶辫触</para> + /// </summary> + public int status = -1; + } + + public enum AccessType + { + /// <summary> + /// 0x00 鍒犻櫎鍏ㄩ儴鍗曟鐢ㄦ埛 + /// </summary> + DelAllUsers = 0, + /// <summary> + /// 0x01 鍒犻櫎鎸囧畾鐢ㄦ埛(鎸夌紪鍙�) + /// </summary> + DelCurrentUser = 1, + /// <summary> + /// 0x20 鍐荤粨鎸囧畾鐢ㄦ埛 + /// </summary> + DisEnable = 2, + /// <summary> + /// 0x21 瑙e喕鎸囧畾鐢ㄦ埛 + /// </summary> + Enable = 3, + } #endregion - #region 杩滅▼鍙戦�佹暟鎹� + #region 楠岃瘉闂ㄩ攣瀵嗙爜 + ///<summary > + ///楠岃瘉闂ㄩ攣瀵嗙爜 + ///<para>inputPassword:杈撳叆鐨勯棬閿佸瘑鐮�</para> + /// </summary> + public async System.Threading.Tasks.Task<VerifyPasswordResponseAllData> VerifyPasswordAsync(string inputPassword) + { + VerifyPasswordResponseAllData result = null; + if (Gateway == null) + { + result = new VerifyPasswordResponseAllData { 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 VerifyPasswordResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + } + + else + { + result = new VerifyPasswordResponseAllData { 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 VerifyPasswordResponseAllData { 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 == "0454") + { + var result1 = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16); + result = new VerifyPasswordResponseAllData { result = result1 }; + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0402_{ topic}"); + } + } + } + } + } + }; + + Gateway.Actions += action; + DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); + + try + { + var getPw = await GetkeyPassword(); + var passData = VerifyPasswordData(inputPassword, getPw); + 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 VerifyPasswordResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + } + Gateway.Actions -= action; + DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); + + return result; + }); + } + /// <summary> + /// 楠岃瘉闂ㄩ攣瀵嗙爜 + /// </summary> + public string VerifyPasswordData(string keyPassword, int password, int fixedPassword = 0x190605) + { + string data = ""; + string dataLength = "08"; + string dataComand1 = "53"; + string dataComand2 = "04"; + string dataSerialNum = "01"; + string addDataLength = "04"; + string passwordStr = ""; + try + { + int keyPasswordInt = System.Convert.ToInt32(keyPassword, 16); + var pawStr = System.Convert.ToString((keyPasswordInt ^ password) + fixedPassword, 16); + pawStr = pawStr.PadLeft(8, '0'); + for (int i = 6; i >= 0; i = i - 2) + { + passwordStr += pawStr.Substring(i, 2); + } + data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + + passwordStr; + } + catch { }; + return data; + } + + /// <summary> + /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶� + /// </summary> + public VerifyPasswordResponseAllData verifyPasswordResponseAllData; + [System.Serializable] + public class VerifyPasswordResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鐢ㄦ埛绠$悊鏁版嵁鍥炲 + /// <para>0:鎴愬姛</para> + ///<para>1:澶辫触</para> + /// </summary> + public int result = -1; + } + #endregion + + #region 杩滅▼寮�閿� + ///<summary > + ///杩滅▼寮�閿� + ///<para>inputPassword: 杈撳叆瀵嗙爜/para> + /// </summary> + public async System.Threading.Tasks.Task<ResponseAllData> RemoteControlAsync(string inputPassword) + { + 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:0400_{ topic}"); + } + } + } + } + } + }; + + Gateway.Actions += action; + DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); + + try + { + var getPw = await GetkeyPassword(); + var passData = RemoteData(inputPassword, getPw); + 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; + DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); + + return result; + }); + } /// <summary> /// 杩滅▼鍙戦�佹暟鎹� /// </summary> - public string RemoteData(string keyPassword, string password, string fixedPassword = "190605") + string RemoteData(string keyPassword, int password, int fixedPassword = 0x190605) { string data = ""; - string dataLength = "09"; + string dataLength = "08"; string dataComand1 = "62"; string dataComand2 = "04"; string dataSerialNum = "01"; @@ -1140,13 +1182,11 @@ try { int keyPasswordInt = System.Convert.ToInt32(keyPassword, 16); - int passwordInt = System.Convert.ToInt32(password, 16); - var fixedPasswordInt = System.Convert.ToInt32(fixedPassword, 16); - var pawStr = System.Convert.ToString((keyPasswordInt ^ passwordInt) + fixedPasswordInt, 16); + var pawStr = System.Convert.ToString((keyPasswordInt ^ password) + fixedPassword, 16); pawStr = pawStr.PadLeft(8, '0'); for (int i = 6; i >= 0; i = i - 2) { - passwordStr += passwordStr.Substring(i, 2); + passwordStr += pawStr.Substring(i, 2); } data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + passwordStr; @@ -1158,13 +1198,112 @@ #endregion #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") + { + TempPasswordResponseAllData result = null; + if (Gateway == null) + { + result = new TempPasswordResponseAllData { 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 TempPasswordResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + } + + else + { + result = new TempPasswordResponseAllData { 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 TempPasswordResponseAllData { 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 TempPasswordResponseData(); + 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 TempPasswordResponseAllData { responseData = tempD }; + System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0400_{ topic}"); + } + } + } + } + } + }; + + Gateway.Actions += action; + DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); + + try + { + var getPw = await GetkeyPassword(); + var passData = TempPasswordData(inputPassword, getPw, startTime, endTime); + 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 TempPasswordResponseAllData + { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + } + Gateway.Actions -= action; + DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); + + return result; + }); + } /// <summary> /// 涓存椂瀵嗙爜鍙戦�佹暟鎹� /// </summary> - public string TempPasswordData(string keyPassword, string password, System.DateTime startTime, System.DateTime endTime, string fixedPassword = "190605") + public string TempPasswordData(string keyPassword, int password, System.DateTime startTime, System.DateTime endTime) { string data = ""; - string dataLength = "14";//鍗佽繘鍒舵槸19 + string dataLength = "10"; string dataComand1 = "63"; string dataComand2 = "04"; string dataSerialNum = "01"; @@ -1175,9 +1314,7 @@ try { int keyPasswordInt = System.Convert.ToInt32(keyPassword, 16); - int passwordInt = System.Convert.ToInt32(password, 16); - var fixedPasswordInt = System.Convert.ToInt32(fixedPassword, 16); - var pawStr = System.Convert.ToString((keyPasswordInt ^ passwordInt) + fixedPasswordInt, 16); + var pawStr = System.Convert.ToString((keyPasswordInt ^ password) + 0x190605, 16); pawStr = pawStr.PadLeft(8, '0'); for (int i = 6; i >= 0; i = i - 2) { @@ -1185,6 +1322,7 @@ } var startTimeStr = System.Convert.ToString(GetUnixTimeStamp(startTime, false), 16); var endTimeStr = System.Convert.ToString(GetUnixTimeStamp(endTime, false), 16); + for (int i = 6; i >= 0; i = i - 2) { vaildTimeStr += startTimeStr.Substring(i, 2); @@ -1197,6 +1335,49 @@ return data; } + + /// <summary> + /// 涓存椂瀵嗙爜鍥炲鏁版嵁 + /// </summary> + public TempPasswordResponseAllData keyColorDataResponseAllData; + [System.Serializable] + public class TempPasswordResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 涓存椂瀵嗙爜鍥炲鏁版嵁 + /// </summary> + public TempPasswordResponseData responseData; + } + + /// <summary> + /// 涓存椂瀵嗙爜鍥炲鏁版嵁 + /// </summary> + [System.Serializable] + public class TempPasswordResponseData + { + /// <summary> + ///鍝嶅簲鎿嶄綔鐮侊紙0-ffff锛� + /// </summary> + public int command = -1; + /// <summary> + /// 鐘舵�佸�� + /// <para>0--娉ㄥ唽鎴愬姛</para> + /// <para>1--娉ㄥ唽澶辫触</para> + /// <para>2--鐢ㄦ埛宸插瓨鍦�(閲嶅瀵嗙爜)</para> + /// <para>3-- 鐢ㄦ埛宸叉弧(+宸叉弧绫诲瀷鍥炲)</para> + /// <para>4--鏈夋晥鏃堕棿閲嶅彔</para> + /// </summary> + public int status = -1; + } #endregion #region 鑾峰彇闂ㄩ攣瀵嗛挜 @@ -1205,20 +1386,28 @@ /// <para>鑾峰彇鍔犲瘑鐨勯殢鏈哄瘑閽ワ紝杩斿洖鐨勫瘑閽ョ粡杩囦竴涓畝鍗曠殑鍔犳硶鍔犲瘑鍔犱笂0x190605锛屽洜姝よ幏鍙栫殑瀵嗛挜闇�瑕佸噺涓�0x190605</para> /// </summary> /// <returns></returns> - async System.Threading.Tasks.Task<string> GetkeyPassword() + async System.Threading.Tasks.Task<int> GetkeyPassword() { + string passwordStr = ""; var result = await GetKeyPassworAsync(); + //杩斿洖灏忕 if (result == null || result.keyPassword == null) { - return ""; + return 0; } - return result.keyPassword; + + for (int i = 6; i >= 0; i = i - 2) + { + passwordStr += result.keyPassword.Substring(i, 2); + } + var keyPasswordInt = System.Convert.ToInt32(passwordStr, 16); + return keyPasswordInt - 0x190605; } ///<summary > ///鑾峰彇闂ㄩ攣瀵嗛挜 /// </summary> - public async System.Threading.Tasks.Task<KeyPasswordInfo> GetKeyPassworAsync(int keyType = 0) + async System.Threading.Tasks.Task<KeyPasswordInfo> GetKeyPassworAsync(int keyType = 0) { KeyPasswordInfo result = null; if (Gateway == null) @@ -1263,7 +1452,7 @@ if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) { var data = gatewayTemp.clientDataPassthroughResponseData.PassData; - if (data.Length == 14) + if (data.Length == 20) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1272,7 +1461,7 @@ var kType = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16); var keyPassword = data[12].ToString() + data[13].ToString() + data[14].ToString() + data[15].ToString() + data[16].ToString() + data[17].ToString() + data[18].ToString() + data[19].ToString(); result = new KeyPasswordInfo { keyType = kType, keyPassword = keyPassword }; - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0406_{ topic}"); + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0460_{ topic}"); } } } @@ -1281,7 +1470,7 @@ }; Gateway.Actions += action; - System.Console.WriteLine("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); + DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); try { @@ -1307,7 +1496,7 @@ result = new KeyPasswordInfo { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } Gateway.Actions -= action; - System.Console.WriteLine("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); + DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); return result; }); @@ -1380,9 +1569,10 @@ ///<summary > ///璇诲彇閿佷笂淇℃伅 /// </summary> - public async System.Threading.Tasks.Task<DoorlockUserInfo> GetDoorlockUserInfoAsync(int keyType = 0) + public async System.Threading.Tasks.Task<DoorlockUserInfo> GetDoorlockUserInfoAsync() { DoorlockUserInfo result = null; + DoorLockUserDetailData doorLockUserDetailData = new DoorLockUserDetailData { }; if (Gateway == null) { result = new DoorlockUserInfo { errorMessageBase = "褰撳墠娌℃湁缃戝叧" }; @@ -1390,52 +1580,47 @@ } return await System.Threading.Tasks.Task.Run(async () => { + var dateTime = DateTime.Now; 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 DoorlockUserInfo { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } - - else - { - result = new DoorlockUserInfo { 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()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData != null) { - result = new DoorlockUserInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; - } - else - { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; - if (data.Length == 14) + var data = clientDataPassthroughResponseData.PassData; + var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); + if (command == "0452") { - var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); - - if (command == "0452") + dateTime = DateTime.Now; + int returnAllLength = 2 + 2 * Convert.ToInt32(data[0].ToString() + data[1].ToString(), 16); + int usefulLength = (returnAllLength - 16); + int tempCount = 0; + var listData = new List<string>(); + while (tempCount < usefulLength) { - //var kType = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16); - //var keyPassword = data[12].ToString() + data[13].ToString() + data[14].ToString() + data[15].ToString() + data[16].ToString() + data[17].ToString() + data[18].ToString() + data[19].ToString(); - //result = new DoorlockUserInfo { keyType = kType, keyPassword = keyPassword }; - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0451_{ topic}"); + listData.Add(data[16 + tempCount].ToString()); + tempCount++; } + for (int j = 0; j < listData.Count / 4; j++) + { + int curIndex = 4 * j; + var userInfo = new UserObj(); + userInfo.UserType = Convert.ToInt32(listData[curIndex + 2].ToString(), 16); + userInfo.UserId = Convert.ToInt32(listData[curIndex + 3].ToString() + listData[curIndex].ToString() + listData[curIndex + 1].ToString(), 16); + doorLockUserDetailData.UserObjList.Add(userInfo); + } + doorLockUserDetailData.userType = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16); + doorLockUserDetailData.totalNum = Convert.ToInt32(data[12].ToString() + data[13].ToString(), 16); + doorLockUserDetailData.currentNum = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16); + result = new DoorlockUserInfo { doorLockUserDetailData = doorLockUserDetailData }; + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0451_{ topic}"); } } } @@ -1443,11 +1628,11 @@ }; Gateway.Actions += action; - System.Console.WriteLine("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); + DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); try { - var passData = KeyPasswordData(keyType); + var passData = DoorlockUserData(); var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } }; var data = new JObject { { "PassData", passData } }; jObject.Add("Data", data); @@ -1455,21 +1640,14 @@ } catch { } - var dateTime = DateTime.Now; - while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)//WaitReceiveDataTime) + //鎺ユ敹涓�涓寘鏈�澶氱瓑5绉掞紝娌℃湁鏀跺埌灏遍��鍑� + while ((DateTime.Now - dateTime).TotalMilliseconds < 5000) { - await System.Threading.Tasks.Task.Delay(10); - if (result != null) - { - break; - } + await System.Threading.Tasks.Task.Delay(100); } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) - { - result = new DoorlockUserInfo { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - } + Gateway.Actions -= action; - System.Console.WriteLine("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); + DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); return result; }); @@ -1478,7 +1656,7 @@ /// <summary> /// 璇诲彇閿佷笂淇℃伅 /// </summary> - string DoorlockUserData(int userType) + string DoorlockUserData() { string data = ""; string dataLength = "05"; @@ -1486,24 +1664,11 @@ string dataComand2 = "04"; string dataSerialNum = "01"; string addDataLength = "01"; - string keyTypeData = ""; + string keyTypeData = "01"; try { - var tempTypeString = new System.Text.StringBuilder(); - var temp = Convert.ToString(userType, 16); - switch (temp.Length) - { - case 1: - keyTypeData = "0" + temp; - break; - case 2: - keyTypeData = temp; - break; - } - tempTypeString.Append(keyTypeData.ToString().ToUpper()); - data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + - tempTypeString; + data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + keyTypeData; } catch { }; @@ -1525,8 +1690,15 @@ /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> /// </summary> public ErrorResponData errorResponData; + /// <summary> + /// 闂ㄩ攣璁惧杩斿洖淇℃伅 + /// </summary> + public DoorLockUserDetailData doorLockUserDetailData; } + /// <summary> + /// 闂ㄩ攣璁惧杩斿洖淇℃伅 + /// </summary> public class DoorLockUserDetailData { /// <summary> @@ -1541,32 +1713,26 @@ /// 鏁版嵁鍖呭簭鍙� /// </summary> public int currentNum; - /// <summary> - /// 鐢ㄦ埛鏁版嵁 - /// </summary> - public byte userData; - } - #endregion - public enum AccessType + /// <summary> + /// 铏氭嫙椹卞姩淇℃伅 + /// </summary> + public List<UserObj> UserObjList = new List<UserObj>(); + } + + public class UserObj { /// <summary> - /// 0x00 鍒犻櫎鍏ㄩ儴鍗曟鐢ㄦ埛 + /// 闂ㄩ攣鐢ㄦ埛绫诲瀷 /// </summary> - DelAllUsers = 0, + public int UserType; + /// <summary> - /// 0x01 鍒犻櫎鎸囧畾鐢ㄦ埛(鎸夌紪鍙�) + /// 闂ㄩ攣鐢ㄦ埛Id鍙� /// </summary> - DelCurrentUser = 1, - /// <summary> - /// 0x20 鍐荤粨鎸囧畾鐢ㄦ埛 - /// </summary> - DisEnable = 2, - /// <summary> - /// 0x21 瑙e喕鎸囧畾鐢ㄦ埛 - /// </summary> - Enable = 3, + public int UserId; } + #endregion /// <summary> /// 鑾峰彇浠庢牸鏋楀▉娌绘椂闂村埌褰撳墠鏌愪竴鏃跺埢鐨勬�绘绉掓暟 @@ -1587,7 +1753,7 @@ /// <param name="unixTimeStamp">鏃堕棿鎴�</param> /// <param name="accurateToMilliseconds">绮剧‘鍒版绉�,浣涗负绉�</param> /// <returns></returns> - public static DateTime GetLocalTime(long unixTimeStamp, bool accurateToMilliseconds) + public static DateTime GetLocalTime(int unixTimeStamp, bool accurateToMilliseconds) { DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(1970, 1, 1, 8, 0, 0));//鍖椾含鎵�鍦ㄤ笢鍏尯 return (accurateToMilliseconds ? startTime.AddMilliseconds(unixTimeStamp) : startTime.AddSeconds(unixTimeStamp)).ToLocalTime(); diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/TemperatureSensor.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/TemperatureSensor.cs index ec02fdb..1e01919 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/TemperatureSensor.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/TemperatureSensor.cs @@ -18,10 +18,16 @@ /// <summary> /// 璇诲彇娓�/婀垮害 /// </summary> - public void ReadTemperature() + public void ReadTemperatureOrHumidity() { - ReadAttri(Device.Cluster_ID.TemperatureMeasurement, AttriButeId.MeasuredValue ); - ReadAttri(Device.Cluster_ID.RelativeHumidityMeasurement, AttriButeId.MeasuredValue); + if (SensorDiv == 1) + { + ReadAttri(Device.Cluster_ID.TemperatureMeasurement, AttriButeId.MeasuredValue); + } + else if (SensorDiv == 2) + { + ReadAttri(Device.Cluster_ID.RelativeHumidityMeasurement, AttriButeId.MeasuredValue); + } } } } diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs index 4ca338b..49cb86e 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs @@ -3302,7 +3302,7 @@ //杩樻湁绉嶆儏鍐垫槸鍚屼竴涓狪D 鏈夊涓澶囩敤杩欎釜id杩炴帴锛堜細瀵艰嚧涓柇锛� string clientId = Shared.Common.Config.Instance.ConnectZigbeeMqttClientId; - string username = Shared.Common.Config.Instance.ConnectZigbeeMqttBrokerName; + string username = Shared.Common.Config.Instance.ConnectGuid; string passwordRemote = Shared.Common.Config.Instance.ConnectZigbeeMqttBrokerPwd; //(1)杩炴帴鍒颁簯绔殑Mqtt瀹㈡埛绔繛鎺ュ弬鏁� var connectCloudMqttClientOptions = new MqttClientTcpOptions @@ -3385,15 +3385,16 @@ /// </summary> async System.Threading.Tasks.Task SendRemoteMsg(string topicName, byte[] message, MQTTnet.Core.Protocol.MqttQualityOfServiceLevel qosLevel = MQTTnet.Core.Protocol.MqttQualityOfServiceLevel.ExactlyOnce, bool retain = false) { - #region MD5鍔犲瘑 token - var result = System.Text.Encoding.UTF8.GetBytes(Shared.Common.Config.Instance.Password); - var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); - var output = md5.ComputeHash(result); - var md5Password = BitConverter.ToString(output).Replace("-", "").ToUpper(); - #endregion + //#region MD5鍔犲瘑 token + //var result = System.Text.Encoding.UTF8.GetBytes(Shared.Common.Config.Instance.Password); + //var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); + //var output = md5.ComputeHash(result); + //var md5Password = BitConverter.ToString(output).Replace("-", "").ToUpper(); + //#endregion //(1)鐢熸垚[鐢ㄦ埛鍚�:瀵嗙爜] - var userNameAndPwdStr = string.Concat(Shared.Common.Config.Instance.Account, RemoteOperatorConsts.CAP_NUMBER, md5Password); + var userNameAndPwdStr = string.Concat(Shared.Common.Config.Instance.Guid, RemoteOperatorConsts.CAP_NUMBER, Shared.Common.Config.Instance.MD5PWD); + DebugPrintLog($"userNameAndPwdStr锛歿userNameAndPwdStr} "); //(2)灏�(1)杞垚Base64瀛楃涓�,鐢熸垚鏍煎紡[Base64(鐢ㄦ埛鍚�:瀵嗙爜)] var userNameAndPwdStrBaseSexFour = Convert.ToBase64String(ZigBee.Common.CommonInfo.EncodingUTF8.GetBytes(userNameAndPwdStr)); @@ -3403,14 +3404,17 @@ ///[Zigbee.Buspro]App/id(甯愬彿Id)/Base64(DES[Base64(鐢ㄦ埛鍚�:瀵嗙爜):Timestamp ]/缃戝叧鍞竴Id/杞彂缁欑綉鍏崇殑涓婚/XX/XX //(4)鐢熸垚涓婃姤涓婚锛屼富棰樻ā寮忛渶瑕佷负 /ZigbeeApp/id(涓诲瓙璋冭瘯甯愬彿Id)/Base64(DES[Base64(鐢ㄦ埛鍚�:瀵嗙爜):Timestamp ]/缃戝叧鍞竴Id/topicName "000204022022" GateWayId 000204022022 - var reportTopic = string.Format("/{0}/{1}/{2}/{3}/{4}", RemoteOperatorConsts.ZIGBEE_APP_STARTS_WITH, Shared.Common.Config.Instance.Account, userNameAndPwdStrBaseSexFourAndTimestamp, this.getGatewayBaseInfo?.gwID, topicName); + var reportTopic = string.Format("/{0}/{1}/{2}/{3}/{4}", RemoteOperatorConsts.ZIGBEE_APP_STARTS_WITH, Shared.Common.Config.Instance.Guid, userNameAndPwdStrBaseSexFourAndTimestamp, this.getGatewayBaseInfo?.gwID, topicName); + var aa = System.Text.Encoding.UTF8.GetString(message); + DebugPrintLog($"AAAA鍙戦�佸埌浜戠涓婚鏄庢枃锛歿reportTopic}___BBBBB鍙戦�佸埌浜戠鍐呭鏄庢枃锛歿aa}"); - //(5)浣跨敤浣犵櫥褰曟垚鍔熸椂8浣峩ey锛岃繘琛孌ES鍔犲瘑浣犻渶瑕佷笂鎶ョ殑鏁版嵁 string topicEncStr = reportTopic; //鏂囦欢娴佷笉鐢ㄥ姞瀵� topicEncStr = ZigBee.Common.SecuritySet.AesEncrypt(System.Text.Encoding.UTF8.GetBytes(topicEncStr), Shared.Common.Config.Instance.MqttKey); topicEncStr = topicEncStr.Replace("/", "[[$-MQTT_TILT_SYMBOL_REPLACE-$]]").Replace("+", "[[$-MQTT_PLUS_SYMBOL_REPLACE-$]]"); message = System.Text.Encoding.UTF8.GetBytes(SecuritySet.AesEncrypt(message, Shared.Common.Config.Instance.MqttKey)); + var bb = System.Text.Encoding.UTF8.GetString(message); + DebugPrintLog($"CCCC鍙戦�佸埌浜戠涓婚绉樻枃锛歿topicEncStr}___DDDD鍙戦�佸埌浜戠鍐呭绉樻枃锛歿bb}"); //(6)鏋勫缓Mqtt闇�瑕佸彂甯冪殑鏁版嵁鍖�,鍙戝竷缁欎簯绔殑MqttBroker await RemoteMqttClient.PublishAsync(new MQTTnet.Core.MqttApplicationMessage(topicEncStr, message, qosLevel, retain)); @@ -3697,14 +3701,6 @@ if (gwa.GwResDataAction != null) { gwa.GwResDataAction(topic, message); - if (topic == $"{gatewayID}/DoorLock/DoorLockOperatingEventNotificationCommand") - { - Console.WriteLine($"111_DoorLockOperatingEventNotificationCommand:{message}"); - } - if (topic == $"{gatewayID}/DoorLock/DoorLockProgrammingEventNotificationCommand") - { - Console.WriteLine($"111_DoorLockProgrammingEventNotificationCommand:{message}"); - } } gwa.CurrentGateWayId = gatewayID; @@ -3829,380 +3825,43 @@ if (topic == gatewayID + "/" + "DeviceInComingRespon") { //鏂拌澶囦笂鎶ワ紝閲嶆柊鍙戣幏鍙栨墍鏈夌殑璁惧 - var deviceID = jobject.Value<int>("Device_ID"); - switch ((DeviceType)(deviceID)) - { - 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 = gwa.getGatewayBaseInfo.gwID }; - dimmableLight.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", dimmableLight.getNewDeviceInfo); - } - UpdateDeviceInfo(dimmableLight, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - break; - 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 = gwa.getGatewayBaseInfo.gwID }; - toggleLight.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", toggleLight.getNewDeviceInfo); - } - UpdateDeviceInfo(toggleLight, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - 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 = gwa.getGatewayBaseInfo.gwID }; - airSwitch.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", airSwitch.getNewDeviceInfo); - } - UpdateDeviceInfo(airSwitch, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - break; - case DeviceType.OnOffSwitch: - var panel = 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 = gwa.getGatewayBaseInfo.gwID }; - panel.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", panel.getNewDeviceInfo); - } - UpdateDeviceInfo(panel, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - break; - case DeviceType.WindowCoveringDevice: - var curtain = 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 = gwa.getGatewayBaseInfo.gwID }; - curtain.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", curtain.getNewDeviceInfo); - } - UpdateDeviceInfo(curtain, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - 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 = gwa.getGatewayBaseInfo.gwID }; - ias.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", ias.getNewDeviceInfo); - } - UpdateDeviceInfo(ias, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - 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 = gwa.getGatewayBaseInfo.gwID }; - repeater.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Repeater.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", repeater.getNewDeviceInfo); - } - UpdateDeviceInfo(repeater, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - 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 = gwa.getGatewayBaseInfo.gwID }; - ac.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<AC.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", ac.getNewDeviceInfo); - } - UpdateDeviceInfo(ac, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - 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 = gwa.getGatewayBaseInfo.gwID }; - transverter.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", transverter.getNewDeviceInfo); - } - UpdateDeviceInfo(transverter, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - 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 = gwa.getGatewayBaseInfo.gwID }; - doorLock.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", doorLock.getNewDeviceInfo); - } - UpdateDeviceInfo(doorLock, "DeviceInComingRespon"); - UpdateDeviceStatus(gwa); - break; - } + var tempDevice = new CommonDevice() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; + tempDevice.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.NewDeviceInfoData>(jobject["Data"].ToString()); + if (gwa.ReportAction != null) + { + DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); + gwa.ReportAction("DeviceInComingRespon", tempDevice.getNewDeviceInfo); + } + UpdateDeviceInfo(tempDevice, "DeviceInComingRespon"); + UpdateDeviceStatus(gwa); } #endregion #region 璁惧鍦ㄧ嚎鐘舵�佹洿鏂板弽棣� else if (topic == gatewayID + "/" + "OnlineStatusChange_Respon") { - var deviceID = jobject.Value<int>("Device_ID"); - switch ((DeviceType)(deviceID)) - { - 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 = gwa.getGatewayBaseInfo.gwID }; - dimmableLight.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", dimmableLight); - } - var lightDimmer = gwa.DeviceList.Find(obj => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr); - if (lightDimmer == null) - { - gwa.DeviceList.Add(dimmableLight); - UpdateDeviceStatus(dimmableLight); - UpdateDeviceInfo(dimmableLight, "OnlineStatusChange"); - } - else - { - if (dimmableLight.DeviceInfo != null) - { - dimmableLight.DeviceInfo.IsOnline = dimmableLight.IsOnline; - } - UpdateDeviceInfo(dimmableLight, "OnlineStatusChange"); - UpdateDeviceStatus(dimmableLight); - } - - break; - 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 = gwa.getGatewayBaseInfo.gwID }; - toggleLight.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", toggleLight); - } - var toggleInfo = gwa.DeviceList.Find(obj => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr); - if (toggleInfo == null) - { - gwa.DeviceList.Add(toggleLight); - UpdateDeviceInfo(toggleLight, "OnlineStatusChange"); - UpdateDeviceStatus(toggleLight); - } - else - { - if (toggleLight.DeviceInfo != null) - { - toggleLight.DeviceInfo.IsOnline = toggleLight.IsOnline; - } - UpdateDeviceInfo(toggleLight, "OnlineStatusChange"); - UpdateDeviceStatus(toggleLight); - } - 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 = gwa.getGatewayBaseInfo.gwID }; - airSwitch.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", airSwitch); - } - var airSwitchInfo = gwa.DeviceList.Find(obj => obj.DeviceID == airSwitch.DeviceID && obj.DeviceAddr == airSwitch.DeviceAddr); - if (airSwitchInfo == null) - { - gwa.DeviceList.Add(airSwitch); - UpdateDeviceInfo(airSwitch, "OnlineStatusChange"); - UpdateDeviceStatus(gwa); - } - else - { - if (airSwitchInfo.DeviceInfo != null) - { - airSwitchInfo.DeviceInfo.IsOnline = airSwitchInfo.IsOnline; - } - UpdateDeviceInfo(airSwitchInfo, "OnlineStatusChange"); - UpdateDeviceStatus(airSwitchInfo); - } - break; - case DeviceType.OnOffSwitch: - var panel = 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 = gwa.getGatewayBaseInfo.gwID }; - panel.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", panel); - } - var panelInfo = gwa.DeviceList.Find(obj => obj.DeviceID == panel.DeviceID && obj.DeviceAddr == panel.DeviceAddr); - if (panelInfo == null) - { - gwa.DeviceList.Add(panel); - UpdateDeviceInfo(panel, "OnlineStatusChange"); - UpdateDeviceStatus(panel); - } - else - { - if (panelInfo.DeviceInfo != null) - { - panelInfo.DeviceInfo.IsOnline = panelInfo.IsOnline; - } - UpdateDeviceInfo(panelInfo, "OnlineStatusChange"); - UpdateDeviceStatus(panelInfo); - } - break; - case DeviceType.WindowCoveringDevice: - var curtain = 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 = gwa.getGatewayBaseInfo.gwID }; - curtain.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", curtain); - } - var curtainInfo = gwa.DeviceList.Find(obj => obj.DeviceID == curtain.DeviceID && obj.DeviceAddr == curtain.DeviceAddr); - if (curtainInfo == null) - { - gwa.DeviceList.Add(curtain); - UpdateDeviceInfo(curtain, "OnlineStatusChange"); - UpdateDeviceStatus(gwa); - } - else - { - if (curtain.DeviceInfo != null) - { - curtain.DeviceInfo.IsOnline = curtain.IsOnline; - } - UpdateDeviceStatus(curtain); - UpdateDeviceInfo(curtain, "OnlineStatusChange"); - } - 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 = gwa.getGatewayBaseInfo.gwID }; - ias.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", ias); - } - var iasInfo = gwa.DeviceList.Find(obj => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr); - if (iasInfo == null) - { - gwa.DeviceList.Add(iasInfo); - UpdateDeviceInfo(iasInfo, "OnlineStatusChange"); - UpdateDeviceStatus(gwa); - } - else - { - if (iasInfo.DeviceInfo != null) - { - iasInfo.DeviceInfo.IsOnline = iasInfo.IsOnline; - } - UpdateDeviceInfo(iasInfo, "OnlineStatusChange"); - UpdateDeviceStatus(iasInfo); - } - 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 = gwa.getGatewayBaseInfo.gwID }; - repeater.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", repeater); - } - var repeaterInfo = gwa.DeviceList.Find(obj => obj.DeviceID == repeater.DeviceID && obj.DeviceAddr == repeater.DeviceAddr); - if (repeaterInfo == null) - { - gwa.DeviceList.Add(repeaterInfo); - UpdateDeviceInfo(repeaterInfo, "OnlineStatusChange"); - UpdateDeviceStatus(gwa); - } - else - { - if (repeaterInfo.DeviceInfo != null) - { - repeaterInfo.DeviceInfo.IsOnline = repeaterInfo.IsOnline; - } - UpdateDeviceInfo(repeaterInfo, "OnlineStatusChange"); - UpdateDeviceStatus(repeaterInfo); - } - 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 = gwa.getGatewayBaseInfo.gwID }; - ac.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", ac); - } - var acInfo = gwa.DeviceList.Find(obj => obj.DeviceID == ac.DeviceID && obj.DeviceAddr == ac.DeviceAddr); - if (acInfo == null) - { - gwa.DeviceList.Add(acInfo); - UpdateDeviceInfo(acInfo, "OnlineStatusChange"); - UpdateDeviceStatus(gwa); - } - else - { - if (acInfo.DeviceInfo != null) - { - acInfo.DeviceInfo.IsOnline = acInfo.IsOnline; - } - UpdateDeviceInfo(acInfo, "OnlineStatusChange"); - UpdateDeviceStatus(acInfo); - } - 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 = gwa.getGatewayBaseInfo.gwID }; - transverter.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", transverter); - } - var transverterInfo = gwa.DeviceList.Find(obj => obj.DeviceID == transverter.DeviceID && obj.DeviceAddr == transverter.DeviceAddr); - if (transverterInfo == null) - { - gwa.DeviceList.Add(transverterInfo); - UpdateDeviceInfo(transverterInfo, "OnlineStatusChange"); - UpdateDeviceStatus(gwa); - } - else - { - if (transverterInfo.DeviceInfo != null) - { - transverterInfo.DeviceInfo.IsOnline = transverterInfo.IsOnline; - } - UpdateDeviceInfo(transverterInfo, "OnlineStatusChange"); - UpdateDeviceStatus(transverterInfo); - } - 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 = gwa.getGatewayBaseInfo.gwID }; - doorLock.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", doorLock); - } - var doorLockInfo = gwa.DeviceList.Find(obj => obj.DeviceID == doorLock.DeviceID && obj.DeviceAddr == doorLock.DeviceAddr); - if (doorLockInfo == null) - { - gwa.DeviceList.Add(doorLockInfo); - UpdateDeviceInfo(doorLockInfo, "OnlineStatusChange"); - UpdateDeviceStatus(gwa); - } - else - { - if (doorLockInfo.DeviceInfo != null) - { - doorLockInfo.DeviceInfo.IsOnline = doorLockInfo.IsOnline; - } - UpdateDeviceInfo(doorLockInfo, "OnlineStatusChange"); - UpdateDeviceStatus(doorLockInfo); - } - break; + var tempDevice = new CommonDevice() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; + tempDevice.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); + + if (gwa.ReportAction != null) + { + DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); + gwa.ReportAction("OnlineStatusChange", tempDevice); + } + var infoTempDevice = gwa.DeviceList.Find(obj => obj.DeviceID == tempDevice.DeviceID && obj.DeviceAddr == tempDevice.DeviceAddr); + if (infoTempDevice == null) + { + gwa.DeviceList.Add(tempDevice); + UpdateDeviceStatus(tempDevice); + UpdateDeviceInfo(tempDevice, "OnlineStatusChange"); + } + else + { + if (infoTempDevice.DeviceInfo != null) + { + infoTempDevice.DeviceInfo.IsOnline = infoTempDevice.IsOnline; + } + UpdateDeviceInfo(infoTempDevice, "OnlineStatusChange"); + UpdateDeviceStatus(infoTempDevice); } } #endregion @@ -4220,219 +3879,24 @@ { 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 = gwa.getGatewayBaseInfo.gwID }; - toggleLight.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (toggleLight.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(toggleLight); - UpdateDeviceInfo(toggleLight, "RemoveDeviceRespon"); - if (toggleLight.removeDeviceResponseData.Result == 0) - { - var infoToggleLight = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr && obj.DeviceEpoint == toggleLight.DeviceEpoint); - if (infoToggleLight != null) - { - gwa.DeviceList.Remove(infoToggleLight); - } - } - } - break; - case DeviceType.AirSwitch: - var airSwitch = new AirSwitch() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - airSwitch.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (airSwitch.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(airSwitch); - UpdateDeviceInfo(airSwitch, "RemoveDeviceRespon"); - if (airSwitch.removeDeviceResponseData.Result == 0) - { - var infoAirSwitch = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == airSwitch.DeviceID && obj.DeviceAddr == airSwitch.DeviceAddr && obj.DeviceEpoint == airSwitch.DeviceEpoint); - if (infoAirSwitch != null) - { - gwa.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 = gwa.getGatewayBaseInfo.gwID }; - panelObj.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (panelObj.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(panelObj); - UpdateDeviceInfo(panelObj, "RemoveDeviceRespon"); - if (panelObj.removeDeviceResponseData.Result == 0) - { - var infoPanel = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == panelObj.DeviceID && obj.DeviceAddr == panelObj.DeviceAddr && obj.DeviceEpoint == panelObj.DeviceEpoint); - if (infoPanel != null) - { - gwa.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 = gwa.getGatewayBaseInfo.gwID }; - rollershade.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (rollershade.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(rollershade); - UpdateDeviceInfo(rollershade, "RemoveDeviceRespon"); - if (rollershade.removeDeviceResponseData.Result == 0) - { - var infoRoller = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == rollershade.DeviceID && obj.DeviceAddr == rollershade.DeviceAddr && obj.DeviceEpoint == rollershade.DeviceEpoint); - if (infoRoller != null) - { - gwa.DeviceList.Remove(infoRoller); - } - } - } - break; - case DeviceType.IASZone: - var ias = new IASZone() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - ias.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (ias.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(ias); - UpdateDeviceInfo(ias, "RemoveDeviceRespon"); - if (ias.removeDeviceResponseData.Result == 0) - { - var info = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr && obj.DeviceEpoint == ias.DeviceEpoint); - if (info != null) - { - gwa.DeviceList.Remove(info); - } - } - } - break; - case DeviceType.DimmableLight: - var dimmableLight = new DimmableLight() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - dimmableLight.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (dimmableLight.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(dimmableLight); - UpdateDeviceInfo(dimmableLight, "RemoveDeviceRespon"); - if (dimmableLight.removeDeviceResponseData.Result == 0) - { - var info = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr && obj.DeviceEpoint == dimmableLight.DeviceEpoint); - if (info != null) - { - gwa.DeviceList.Remove(info); - } - } - } - break; - case DeviceType.Repeater: - var repeater = new Repeater() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - repeater.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (repeater.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(repeater); - UpdateDeviceInfo(repeater, "RemoveDeviceRespon"); - if (repeater.removeDeviceResponseData.Result == 0) - { - var info = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == repeater.DeviceID && obj.DeviceAddr == repeater.DeviceAddr && obj.DeviceEpoint == repeater.DeviceEpoint); - if (info != null) - { - gwa.DeviceList.Remove(info); - } - } - } - break; - case DeviceType.Thermostat: - var ac = new AC() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - ac.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AC.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (ac.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(ac); - UpdateDeviceInfo(ac, "RemoveDeviceRespon"); - if (ac.removeDeviceResponseData.Result == 0) - { - var info = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ac.DeviceID && obj.DeviceAddr == ac.DeviceAddr && obj.DeviceEpoint == ac.DeviceEpoint); - if (info != null) - { - gwa.DeviceList.Remove(info); - } - } - } - break; - case DeviceType.Transverter: - var transverter = new Transverter() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - transverter.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (transverter.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(transverter); - UpdateDeviceInfo(transverter, "RemoveDeviceRespon"); - if (transverter.removeDeviceResponseData.Result == 0) - { - var info = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == transverter.DeviceID && obj.DeviceAddr == transverter.DeviceAddr && obj.DeviceEpoint == transverter.DeviceEpoint); - if (info != null) - { - gwa.DeviceList.Remove(info); - } - } - } - break; - case DeviceType.DoorLock: - var doorLock = new DoorLock() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - doorLock.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (doorLock.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceStatus(doorLock); - UpdateDeviceInfo(doorLock, "RemoveDeviceRespon"); - if (doorLock.removeDeviceResponseData.Result == 0) - { - var info = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == doorLock.DeviceID && obj.DeviceAddr == doorLock.DeviceAddr && obj.DeviceEpoint == doorLock.DeviceEpoint); - if (info != null) - { - gwa.DeviceList.Remove(info); - } - } - } - break; + var tempDevice = new CommonDevice() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; + tempDevice.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RemoveDeviceResponseData>(jobject["Data"].ToString()); + if (tempDevice.removeDeviceResponseData == null) + { + return; + } + else + { + UpdateDeviceStatus(tempDevice); + UpdateDeviceInfo(tempDevice, "RemoveDeviceRespon"); + if (tempDevice.removeDeviceResponseData.Result == 0) + { + var infoTempDevice = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == tempDevice.DeviceID && obj.DeviceAddr == tempDevice.DeviceAddr && obj.DeviceEpoint == tempDevice.DeviceEpoint); + if (infoTempDevice != null) + { + gwa.DeviceList.Remove(infoTempDevice); + } + } } } } @@ -4449,76 +3913,10 @@ var tempEpoint = jobject.Value<int>("Epoint"); var dataId = jobject.Value<int>("Data_ID"); - switch ((DeviceType)(deviceID)) - { - case DeviceType.DimmableLight: - var light = new DimmableLight { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - light.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(light); - UpdateDeviceInfo(light, "DeviceStatusReport"); - break; - case DeviceType.OnOffSwitch: - var lightSwitch = new Panel { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - lightSwitch.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(lightSwitch); - UpdateDeviceInfo(lightSwitch, "DeviceStatusReport"); - break; - case DeviceType.OnOffOutput: - var lighttoggle = new ToggleLight { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - lighttoggle.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(lighttoggle); - UpdateDeviceInfo(lighttoggle, "DeviceStatusReport"); - break; - case DeviceType.AirSwitch: - var airSwitch = new AirSwitch { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - airSwitch.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(airSwitch); - UpdateDeviceInfo(airSwitch, "DeviceStatusReport"); - break; - case DeviceType.WindowCoveringDevice: - var curtain = new Rollershade { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - curtain.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(curtain); - UpdateDeviceInfo(curtain, "DeviceStatusReport"); - break; - case DeviceType.OtaDevice: - case DeviceType.OtaPanelDevice: - var ota = new OTADevice { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - ota.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<OTADevice.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(ota); - UpdateDeviceInfo(ota, "DeviceStatusReport"); - break; - case DeviceType.IASZone: - var ias = new IASZone { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - ias.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(ias); - UpdateDeviceInfo(ias, "DeviceStatusReport"); - break; - case DeviceType.Repeater: - var repeater = new Repeater { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - repeater.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<Repeater.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(repeater); - UpdateDeviceInfo(repeater, "DeviceStatusReport"); - break; - case DeviceType.Thermostat: - var ac = new AC { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - ac.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<AC.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(ac); - UpdateDeviceInfo(ac, "DeviceStatusReport"); - break; - case DeviceType.Transverter: - var transverter = new Transverter { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - transverter.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(transverter); - UpdateDeviceInfo(transverter, "DeviceStatusReport"); - break; - case DeviceType.DoorLock: - var doorLock = new DoorLock { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - doorLock.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock.DeviceStatusReportData>(jobject["Data"].ToString()); - UpdateDeviceStatus(doorLock); - UpdateDeviceInfo(doorLock, "DeviceStatusReport"); - break; - } + 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 #region IAS瀹夐槻淇℃伅涓婃姤 diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs index 99875dd..d39f734 100755 --- a/ZigbeeApp/Shared/R.cs +++ b/ZigbeeApp/Shared/R.cs @@ -255,6 +255,20 @@ public readonly static int DelLocalBindListThenAddAgain2 = 170; public readonly static int DelLocalBindListThenAddAgain3 = 171; //闈㈡澘缁戝畾浠ヤ笂 + public readonly static int IcCard = 172; + public readonly static int Password = 173; + public readonly static int Fingerprint = 174; + public readonly static int ModigfyFailed = 175; + public readonly static int OnlyBeDeletedOnTheDevice = 176; + public readonly static int Undistributed = 177; + public readonly static int AfterThirtySeconds = 178; + //闂ㄩ攣楠岃瘉瀵嗙爜澶辫触 + public readonly static int OperrateFailed = 179; + public readonly static int RemoteUnlockBindSucessTip1 = 180; + public readonly static int RemoteUnlockBindSucessTip2 = 181; + public readonly static int CLose = 182; + public readonly static int Opening = 183; + public readonly static int DoorLockOpen = 184; public readonly static int RemindSetting = 548; public readonly static int AddNewUser = 650; @@ -3995,7 +4009,14 @@ /// 缂栬緫鎴块棿 /// </summary> public const int uEditorRoom = 15771; - + /// <summary> + /// 鑾峰彇涓�... + /// </summary> + public const int uGetting = 15772; + /// <summary> + /// 瀛樺湪闈炴硶瀛楃銆寋0}銆� + /// </summary> + public const int uErrorFieldIsEsixt = 15773; //鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� /// <summary> diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems index 63c4ecc..8c3c7fe 100755 --- a/ZigbeeApp/Shared/Shared.projitems +++ b/ZigbeeApp/Shared/Shared.projitems @@ -109,6 +109,28 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Bind\BindCommonLayout.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Bind\BindTargetsPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Bind\ChooseKeyModePage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\AddUnLockMethod.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\AddUnLockMethodFailedTip.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\AddUnLockMethodTip.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorLockCommonInfo.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorLockCommonLayout.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorlockDialog.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorLockListPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\DoorLockUserMangement.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\EntryStatusPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\FunctionSetting.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\HistoryRecordPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\MasterManagementPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\MemberFrozenPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\MemberManagement.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\RemotelyUnlock.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\SubAccountManagementPage.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" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UnLockMethod.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UserDoorLockPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UserManagement.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Password\CheckNewPhoneForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Password\CheckOldPhoneForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Password\EditorSecondaryPasswordForm.cs" /> @@ -117,8 +139,9 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\AddNewRoomForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\EditorRoomInforForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\FloorListRoomForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\LookRoomDeviceListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\ResidenceManagementForm.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\TemperatrueHumiditySensorSelectForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\LookRoomSettionForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\UserMain\QRCodeForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Password\ResetAccountPasswordForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Form\AreaCodeSelectForm.cs" /> @@ -128,7 +151,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\NormalSelectControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\NormalControls\DateSelectControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceUpdateLogic.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\DeviceTypePictrueImageEnum.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\GatewayBackupEnum.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ClickButtonControls\NormalClickButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\DeviceInformationListControl.cs" /> @@ -182,7 +204,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\PirSensor\PirSensorLightSettionForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Curtain\RollerShadeDirectionLimitSettingForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceSearchForm.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\SelectDeviceForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Form\SelectDeviceForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\IntelligentLocksH06cDirectionForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceDryContactSettionForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceFunctionSettionForm.cs" /> @@ -320,7 +342,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\AddDeviceTypeListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceMacInfoEditorForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceAddSuccessForm.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\SelectRoomForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\AddDevicesSameTypeList.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\AddDevieDetailFromAddFunction.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\DeviceUI.cs" /> -- Gitblit v1.8.0