From 07466c19110693e3e439a7d7c8ad0bc21d9b3287 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期三, 29 四月 2020 09:14:01 +0800 Subject: [PATCH] 优化代码,更改门锁需求接口 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs | 4 ZigbeeApp/Home.Ios/AppDelegate.cs | 3 ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs | 14 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 181 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 217 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs | 5 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs | 68 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs | 343 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs | 52 ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorDoorWindowDirectionForm.cs | 18 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs | 5 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/Login/AccountResetPWDSuccess.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs | 66 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEightButtonDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 67 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs | 74 ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirPic.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs | 14 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs | 24 ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/noMode.png | 0 ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlBackupListForm.cs | 24 ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirRealDevicePic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs | 16 ZigbeeApp/Shared/Phone/UserCenter/Member/SubAccountLevelUpSuccessForm.cs | 52 ZigbeeApp/Home.Ios/Info.plist | 14 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorWaterDirectionForm.cs | 10 ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs | 148 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs | 335 ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs | 0 ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs | 10 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs | 72 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs | 220 ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs | 391 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs | 50 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs | 2 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs | 22 ZigbeeApp/Shared/Phone/Category/SelectFloorForm.cs | 48 ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs | 6 ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll | 0 ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 24 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RepeaterZigbeeDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorFireDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs | 42 ZigbeeApp/Shared/Common/CommonPage.cs | 4 ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpDirectionForm.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs | 156 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs | 22 ZigbeeApp/Home.Ios/Resources/Phone/FreshAir/FreshAirPic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEnvironmentDirectionForm.cs | 16 ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs | 1 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs | 19 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/DimmableLightOneLoadDirectionForm.cs | 80 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs | 22 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 28 ZigbeeApp/Shared/Phone/Device/CommonForm/SelectTime.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RelayThreeLoadDirectionForm.cs | 80 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs | 8 ZigbeeApp/Shared/Phone/UserView/HomePage.cs | 228 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/LoadingControl.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs | 24 ZigbeeApp/Home.Ios/Home.IOS.csproj | 14 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs | 27 ZigbeeApp/Shared/R.cs | 86 ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs | 6 ZigbeeApp/Shared/Common/Logic.cs | 1 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs | 20 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/GatewayResourse.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs | 7 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorCarbonMonoxideDirectionForm.cs | 14 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 73 ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs | 194 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs | 4 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs | 19 ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs | 12 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs | 261 + ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs | 68 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs | 74 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFourButtonDirectionForm.cs | 16 ZigbeeApp/Home.Ios/Resources/Phone/FreshAir/FreshAirRealDevicePic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs | 8 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs | 92 ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs | 4 ZigbeeApp/Shared/Common/House.cs | 36 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs | 9 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection3Form.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs | 10 ZigbeeApp/GateWay.Droid/Assets/Language.ini | 35 ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs | 56 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs | 2 ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/noMode.png | 0 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs | 4 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpoint.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 218 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardMethord.cs | 7 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 133 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs | 18 ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 110 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs | 44 ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs | 26 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs | 0 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs | 19 ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs | 2 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs | 18 ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs | 10 ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs | 28 ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs | 302 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs | 72 ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs | 14 ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs | 4 ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs | 133 ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs | 8 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainAutoOpenDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs | 248 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs | 18 ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs | 98 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorInfraredDirectionForm.cs | 28 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs | 52 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 142 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs | 434 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/PswNumberInputControl.cs | 28 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorTemperatureHumidityForm.cs | 22 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 13 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirConditionerZbGatewayDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs | 20 ZigbeeApp/Shared/Shared.projitems | 35 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs | 67 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs | 24 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 26 ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs | 5 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs | 36 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainSiphonateDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/Device/Logic/Method.cs | 41 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs | 18 ZigbeeApp/Shared/Common/ResponseEntity/GetAreaCode.cs | 10 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs | 18 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/UserMain/QRCodeForm.cs | 26 ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpointSelected2.png | 0 ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 32 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs | 41 ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs | 11 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs | 2 ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs | 508 ++ ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs | 65 ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs | 16 ZigbeeApp/Shared/Common/SceneUI.cs | 1 ZigbeeApp/Shared/Phone/Login/PhoneZone.cs | 15 ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs | 170 ZigbeeApp/Shared/Phone/Login/AccountLogin.cs | 1303 +---- ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs | 11 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs | 43 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPirDirectionForm.cs | 22 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueTwoButtonDirectionForm.cs | 16 ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs | 6 ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs | 142 ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpoint.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected2.png | 0 ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs | 22 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs | 20 ZigbeeApp/Shared/Phone/Login/AccountRegister.cs | 2 ZigbeeApp/Home.Ios/Resources/Language.ini | 34 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs | 19 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs | 25 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs | 38 ZigbeeApp/Shared/Phone/MainPage/Controls/SafetyShortcutControl.cs | 4 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs | 37 ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs | 69 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/RowLayoutBase.cs | 37 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs | 66 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs | 964 ++++ ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/openMode.png | 0 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs | 5 ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs | 110 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs | 26 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs | 172 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs | 96 ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpointSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirSwitchCloudContrDirectionForm.cs | 28 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs | 6 ZigbeeApp/Shared/Common/Device.cs | 97 ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs | 10 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs | 74 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 86 ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/openMode.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs | 157 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs | 69 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs | 62 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs | 418 + /dev/null | 884 --- ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 8 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs | 39 ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs | 133 ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs | 37 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs | 7 228 files changed, 7,799 insertions(+), 5,746 deletions(-) diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini index e07949f..de4baf5 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini +++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini @@ -312,7 +312,8 @@ 307=璀﹀憡锛佹椂鏁堟�у父寮�鍏抽棴闂ㄩ攣鍔熻兘澶辫触锛岃鎵嬪姩鍙栨秷甯稿紑妯″紡銆� 308=璀﹀憡锛佹椂鏁堟�у父寮�鍒犻櫎澶辫触銆� 309=鏃舵晥鎬у父寮�鍒犻櫎澶辫触锛岀户缁�滃父寮�妯″紡鈥濊鍓嶅線闂ㄩ攣鐢ㄦ埛鐣岄潰璁剧疆; - +310=璇疯緭鍏ュ悎娉曠殑鏁板瓧 +311=鎵嬪姩 5097=鍙栨秷 5098=纭畾 @@ -570,8 +571,13 @@ 5380=甯稿紑妯″紡 5381=娣诲姞鏉′欢鎴栬�呮坊鍔犲姛鑳戒负绌� 5382=鏌ョ湅 - - +5383=鍏抽棴 +5384=骞� +5385=鏈� +5386=鏃� +5387=鍙� +5388=甯稿紑鑷姩鍖� +5389=鏃舵晥鎬у父寮�璁剧疆 10000=HDL Home @@ -626,7 +632,7 @@ -10150=鏀规埧闂村悕绉板凡瀛樺湪 +10150=鎴块棿鍚嶇О宸插瓨鍦� 10151=鍦烘櫙鍚嶄笉鑳戒负绌� 10152=鎺у埗鍦烘櫙澶辫触 10153=鍦烘櫙涓虹┖ @@ -661,7 +667,7 @@ 11013=淇℃伅缂栬緫 11014=鍔熻兘鍚嶇О 11015=鎵�灞炲尯鍩� -11016=鎵�灞炴ā鍧� +11016=鎵�灞炶澶� 11017=鏈煡 11018=鍒嗕韩 11019=鍒嗕韩鐨� @@ -1806,6 +1812,21 @@ 16097=鍜� 16098=鏈嶅姟鏉℃ 16099=璇峰厛闃呰骞跺悓鎰忋�婇殣绉佹潈鏀跨瓥銆嬪拰銆婃湇鍔℃潯娆俱�� +16100=甯稿紑妯″紡寮�鍚�(鑷姩鍖栬Е鍙�) +16101=甯稿紑妯″紡缁撴潫(鑷姩鍖栬Е鍙�) +16102=涓存椂瀵嗙爜寮�閿佹垚鍔� +16103=涓存椂瀵嗙爜寮�閿佸け璐� +16104=鐢垫満绌鸿皟妯″潡 +16105=涓滆姖绌鸿皟妯″潡 +16106=鏍煎姏绌鸿皟妯″潡 +16107=缇庣殑绌鸿皟妯″潡 +16108=铏氭嫙缃戝叧 +16109=鐜勫叧 +16110=鍘ㄦ埧 +16111=璧板粖 +16112=铏氭嫙璐﹀彿 +16113=鐏叏寮� +16114=鐏叏鍏� ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� @@ -1987,8 +2008,8 @@ 50031=Zigbee鏂规偊鍥涘紑鍏帶闈㈡澘 50032=Zigbee鏂规偊鏂伴闈㈡澘 50033=Zigbee鏂规偊鐜闈㈡澘 -50034=Zigbee绠�绾�4鎸夐敭闈㈡澘 -50035=Zigbee绠�绾�2璺潰鏉� +50034=Zigbee绠�绾�4鎸夐敭鍦烘櫙闈㈡澘 +50035=Zigbee绠�绾�2璺獥甯橀潰鏉� 50036=Zigbee鏂规偊2璺獥甯橀潰鏉� 50037=Zigbee鏅鸿兘闂ㄩ攣 50038=鏂伴鎺у埗灏忔ā鍧� diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpoint.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpoint.png new file mode 100755 index 0000000..c637e9b --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpoint.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected.png new file mode 100755 index 0000000..d028074 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected2.png new file mode 100755 index 0000000..14d38c3 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/FreshAirEpointSelected2.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorEmergencyButton.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorEmergencyButton.png deleted file mode 100755 index 6742514..0000000 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorEmergencyButton.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirPic.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirPic.png new file mode 100755 index 0000000..fc08f7b --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirRealDevicePic.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirRealDevicePic.png new file mode 100755 index 0000000..721a5dd --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FreshAir/FreshAirRealDevicePic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/noMode.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/noMode.png new file mode 100755 index 0000000..899ff12 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/noMode.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/openMode.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/openMode.png new file mode 100755 index 0000000..83434a8 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/openMode.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj index 40a2824..c075865 100644 --- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj +++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj @@ -19,7 +19,7 @@ <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime> <NuGetPackageImportStamp> </NuGetPackageImportStamp> - <AndroidKeyStore>true</AndroidKeyStore> + <AndroidKeyStore>false</AndroidKeyStore> <AndroidSigningKeyStore>C:\Users\admin\AppData\Local\Xamarin\Mono for Android\Keystore\HDL Home\HDL Home.keystore</AndroidSigningKeyStore> <AndroidSigningStorePass>85521566</AndroidSigningStorePass> <AndroidSigningKeyAlias>HDL Home</AndroidSigningKeyAlias> @@ -319,7 +319,6 @@ <AndroidAsset Include="Assets\Phone\Device\Sensor.png" /> <AndroidAsset Include="Assets\Phone\Device\SensorCarbonMonoxide.png" /> <AndroidAsset Include="Assets\Phone\Device\SensorDoorWindow.png" /> - <AndroidAsset Include="Assets\Phone\Device\SensorEmergencyButton.png" /> <AndroidAsset Include="Assets\Phone\Device\SensorFire.png" /> <AndroidAsset Include="Assets\Phone\Device\SensorHumidity.png" /> <AndroidAsset Include="Assets\Phone\Device\SensorInfrared.png" /> @@ -2096,6 +2095,27 @@ <ItemGroup> <AndroidAsset Include="Assets\Phone\Item\Check1Selected.png" /> </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\ZigeeLogic\noMode.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\ZigeeLogic\openMode.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\FreshAirEpoint.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\FreshAirEpointSelected.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\FreshAirEpointSelected2.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\FreshAir\FreshAirPic.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\FreshAir\FreshAirRealDevicePic.png" /> + </ItemGroup> <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> <Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" /> diff --git a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml index ecad3bb..f00ee0c 100644 --- a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml +++ b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020041501" android:installLocation="auto" android:versionName="1.0.20041501"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020042701" android:installLocation="auto" android:versionName="1.0.20042701"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> <permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> diff --git a/ZigbeeApp/Home.Ios/AppDelegate.cs b/ZigbeeApp/Home.Ios/AppDelegate.cs index fc43236..856f57d 100644 --- a/ZigbeeApp/Home.Ios/AppDelegate.cs +++ b/ZigbeeApp/Home.Ios/AppDelegate.cs @@ -25,7 +25,8 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { - //base.FinishedLaunching(application, launchOptions); + Shared.Application.IsMusicEnable = false; + base.FinishedLaunching(application, launchOptions); Shared.Application.FontSize = 12; Shared.Application.IsUsePingFang = true; Window = new UIWindow(UIScreen.MainScreen.Bounds); diff --git a/ZigbeeApp/Home.Ios/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj index d98b09b..3620641 100644 --- a/ZigbeeApp/Home.Ios/Home.IOS.csproj +++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj @@ -108,7 +108,6 @@ </ItemGroup> <ItemGroup> <Folder Include="Resources\" /> - <Folder Include="Resources\Phone\FreshAir\" /> </ItemGroup> <ItemGroup> <InterfaceDefinition Include="LaunchScreen.storyboard" /> @@ -359,6 +358,8 @@ <BundleResource Include="Resources\Phone\Center\MainBack1.png" /> <BundleResource Include="Resources\Phone\Center\Admin.png" /> <BundleResource Include="Resources\Phone\Center\SafetyManagement.png" /> + <BundleResource Include="Resources\Phone\FreshAir\FreshAirRealDevicePic.png" /> + <BundleResource Include="Resources\Phone\FreshAir\FreshAirPic.png" /> <BundleResource Include="Resources\Phone\Navigation\CategorySelected.png" /> <BundleResource Include="Resources\Phone\Navigation\Category.png" /> <BundleResource Include="Resources\Phone\Navigation\HomeSelected.png" /> @@ -594,6 +595,7 @@ <BundleResource Include="Resources\Phone\ZigeeLogic\add.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\sensor0.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\selectedsensor13.png" /> + <BundleResource Include="Resources\Phone\ZigeeLogic\noMode.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\logicbj1.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\dimmableLight.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\athome.png" /> @@ -663,6 +665,7 @@ <BundleResource Include="Resources\Phone\ZigeeLogic\humidity.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\2.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\selectedac.png" /> + <BundleResource Include="Resources\Phone\ZigeeLogic\openMode.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\selectedsensor21.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\3.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\back.png" /> @@ -729,6 +732,7 @@ <BundleResource Include="Resources\Phone\Device\AirConditionerEpointSelected.png" /> <BundleResource Include="Resources\Phone\Device\CurtainAutoOpenSelected.png" /> <BundleResource Include="Resources\Phone\Device\Sensor.png" /> + <BundleResource Include="Resources\Phone\Device\FreshAirEpointSelected2.png" /> <BundleResource Include="Resources\Phone\Device\RepeaterSelected.png" /> <BundleResource Include="Resources\Phone\Device\AirSwitchSelected2.png" /> <BundleResource Include="Resources\Phone\Device\ConverterSelected2.png" /> @@ -739,7 +743,6 @@ <BundleResource Include="Resources\Phone\Device\IntelligentLocks.png" /> <BundleResource Include="Resources\Phone\Device\ConverterZb485Selected.png" /> <BundleResource Include="Resources\Phone\Device\ColorLightSelected.png" /> - <BundleResource Include="Resources\Phone\Device\SensorEmergencyButton.png" /> <BundleResource Include="Resources\Phone\Device\AirSwitch.png" /> <BundleResource Include="Resources\Phone\Device\IntelligentLocksH06CSelected2.png" /> <BundleResource Include="Resources\Phone\Device\SwitchSelected.png" /> @@ -766,6 +769,7 @@ <BundleResource Include="Resources\Phone\Device\AirConditionerSelected.png" /> <BundleResource Include="Resources\Phone\Device\ButtonPanel.png" /> <BundleResource Include="Resources\Phone\Device\ButtonPanelTwoSelected2.png" /> + <BundleResource Include="Resources\Phone\Device\FreshAirEpointSelected.png" /> <BundleResource Include="Resources\Phone\Device\AirConditionerZbGateway.png" /> <BundleResource Include="Resources\Phone\Device\DryContact.png" /> <BundleResource Include="Resources\Phone\Device\AirSwitchCloudContrSelected2.png" /> @@ -791,6 +795,7 @@ <BundleResource Include="Resources\Phone\Device\DimmableLightOneLoadSelected.png" /> <BundleResource Include="Resources\Phone\Device\SensorTemperatureSelected.png" /> <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueTwoSelected2.png" /> + <BundleResource Include="Resources\Phone\Device\FreshAirEpoint.png" /> <BundleResource Include="Resources\Phone\Device\ColorLightSelected2.png" /> <BundleResource Include="Resources\Phone\Device\DimmableLightOneLoadSelected2.png" /> <BundleResource Include="Resources\Phone\Device\ButtonPanelThree.png" /> @@ -1010,11 +1015,6 @@ <BundleResource Include="Resources\Phone\Gateway\WiredGateway.png" /> <BundleResource Include="Resources\Phone\Gateway\WirelessGateway.png" /> <BundleResource Include="Resources\Phone\Gateway\AddGatewaySuccess.png" /> - <BundleResource Include="Resources\Phone\FreshAir\FreshAirPic.png" /> - <BundleResource Include="Resources\Phone\Device\FreshAirEpoint.png" /> - <BundleResource Include="Resources\Phone\Device\FreshAirEpointSelected.png" /> - <BundleResource Include="Resources\Phone\Device\FreshAirEpointSelected2.png" /> - <BundleResource Include="Resources\Phone\FreshAir\FreshAirRealDevicePic.png" /> </ItemGroup> <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> diff --git a/ZigbeeApp/Home.Ios/Info.plist b/ZigbeeApp/Home.Ios/Info.plist index b1f348e..16a3e1d 100755 --- a/ZigbeeApp/Home.Ios/Info.plist +++ b/ZigbeeApp/Home.Ios/Info.plist @@ -6,6 +6,8 @@ <string>闇�瑕佽鍙栭�氳褰�,鐢ㄤ簬娣诲姞鑳佽揩鑱旂郴浜�</string> <key>NSLocationWhenInUseUsageDescription</key> <string>浣跨敤鏈熼棿闇�瑕佷娇鐢ㄥ湴鐞嗕綅缃紝浠ヤ究鎻愪緵鏈嶅姟锛屽澶╂皵</string> + <key>NSLocationAlwaysUsageDescription</key> + <string>搴旂敤鍦ㄥ悗鍙拌繍琛�,瀹氭椂涓婃姤浣嶇疆,鎵ц鑷姩鍖栭�昏緫鍔熻兘</string> <key>UIViewControllerBasedStatusBarAppearance</key> <false/> <key>NSPhotoLibraryUsageDescription</key> @@ -51,13 +53,8 @@ <string>闇�瑕佷娇鐢ㄥ濯掍綋鏉冮檺锛屼互渚挎彁渚涙洿澶氱殑澶氬獟浣撴湇鍔�</string> <key>aps-environment</key> <string>development</string> - <key>UIBackgroundModes</key> - <array> - <string>location</string> - <string>remote-notification</string> - </array> <key>CFBundleShortVersionString</key> - <string>1.0.20040901</string> + <string>1.0.20042601</string> <key>CFBundleVersion</key> <string>2</string> <key>CFBundleURLTypes</key> @@ -78,5 +75,10 @@ </array> <key>CFBundleDevelopmentRegion</key> <string>zh_CN</string> + <key>UIBackgroundModes</key> + <array> + <string>location</string> + <string>remote-notification</string> + </array> </dict> </plist> diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini index eac7933..25227ce 100755 --- a/ZigbeeApp/Home.Ios/Resources/Language.ini +++ b/ZigbeeApp/Home.Ios/Resources/Language.ini @@ -314,6 +314,7 @@ 309=鏃舵晥鎬у父寮�鍒犻櫎澶辫触锛岀户缁�滃父寮�妯″紡鈥濊鍓嶅線闂ㄩ攣鐢ㄦ埛鐣岄潰璁剧疆; 310=璇疯緭鍏ュ悎娉曠殑鏁板瓧 311=鎵嬪姩 +312=鑳屽厜鐏鑹� 5097=鍙栨秷 5098=纭畾 @@ -571,8 +572,13 @@ 5380=甯稿紑妯″紡 5381=娣诲姞鏉′欢鎴栬�呮坊鍔犲姛鑳戒负绌� 5382=鏌ョ湅 - - +5383=鍏抽棴 +5384=骞� +5385=鏈� +5386=鏃� +5387=鍙� +5388=甯稿紑鑷姩鍖� +5389=鏃舵晥鎬у父寮�璁剧疆 10000=HDL Home @@ -627,7 +633,7 @@ -10150=鏀规埧闂村悕绉板凡瀛樺湪 +10150=鎴块棿鍚嶇О宸插瓨鍦� 10151=鍦烘櫙鍚嶄笉鑳戒负绌� 10152=鎺у埗鍦烘櫙澶辫触 10153=鍦烘櫙涓虹┖ @@ -662,7 +668,7 @@ 11013=淇℃伅缂栬緫 11014=鍔熻兘鍚嶇О 11015=鎵�灞炲尯鍩� -11016=鎵�灞炴ā鍧� +11016=鎵�灞炶澶� 11017=鏈煡 11018=鍒嗕韩 11019=鍒嗕韩鐨� @@ -1807,6 +1813,21 @@ 16097=鍜� 16098=鏈嶅姟鏉℃ 16099=璇峰厛闃呰骞跺悓鎰忋�婇殣绉佹潈鏀跨瓥銆嬪拰銆婃湇鍔℃潯娆俱�� +16100=甯稿紑妯″紡寮�鍚�(鑷姩鍖栬Е鍙�) +16101=甯稿紑妯″紡缁撴潫(鑷姩鍖栬Е鍙�) +16102=涓存椂瀵嗙爜寮�閿佹垚鍔� +16103=涓存椂瀵嗙爜寮�閿佸け璐� +16104=鐢垫満绌鸿皟妯″潡 +16105=涓滆姖绌鸿皟妯″潡 +16106=鏍煎姏绌鸿皟妯″潡 +16107=缇庣殑绌鸿皟妯″潡 +16108=铏氭嫙缃戝叧 +16109=鐜勫叧 +16110=鍘ㄦ埧 +16111=璧板粖 +16112=铏氭嫙璐﹀彿 +16113=鐏叏寮� +16114=鐏叏鍏� ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� @@ -1952,7 +1973,6 @@ 40015=鎻掑骇 40016=鐏厜 40017=骞叉帴鐐� -40018=鏂伴 ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽� 50000=绱ф�ユ寜閽� @@ -1989,8 +2009,8 @@ 50031=Zigbee鏂规偊鍥涘紑鍏帶闈㈡澘 50032=Zigbee鏂规偊鏂伴闈㈡澘 50033=Zigbee鏂规偊鐜闈㈡澘 -50034=Zigbee绠�绾�4鎸夐敭闈㈡澘 -50035=Zigbee绠�绾�2璺潰鏉� +50034=Zigbee绠�绾�4鎸夐敭鍦烘櫙闈㈡澘 +50035=Zigbee绠�绾�2璺獥甯橀潰鏉� 50036=Zigbee鏂规偊2璺獥甯橀潰鏉� 50037=Zigbee鏅鸿兘闂ㄩ攣 50038=鏂伴鎺у埗灏忔ā鍧� diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpoint.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpoint.png old mode 100644 new mode 100755 Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpointSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpointSelected.png old mode 100644 new mode 100755 Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpointSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/FreshAirEpointSelected2.png old mode 100644 new mode 100755 Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorEmergencyButton.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorEmergencyButton.png deleted file mode 100755 index 6742514..0000000 --- a/ZigbeeApp/Home.Ios/Resources/Phone/Device/SensorEmergencyButton.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FreshAir/FreshAirPic.png b/ZigbeeApp/Home.Ios/Resources/Phone/FreshAir/FreshAirPic.png old mode 100644 new mode 100755 Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/FreshAir/FreshAirRealDevicePic.png b/ZigbeeApp/Home.Ios/Resources/Phone/FreshAir/FreshAirRealDevicePic.png old mode 100644 new mode 100755 Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/noMode.png b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/noMode.png new file mode 100755 index 0000000..899ff12 --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/noMode.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/openMode.png b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/openMode.png new file mode 100755 index 0000000..83434a8 --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/openMode.png Binary files differ diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs index 684ca0d..febcb6a 100755 --- a/ZigbeeApp/Shared/Common/CommonPage.cs +++ b/ZigbeeApp/Shared/Common/CommonPage.cs @@ -57,7 +57,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string CodeIDString = "1.0.20041601"; + public static string CodeIDString = "1.0.20042701"; /// <summary> /// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee) /// </summary> @@ -392,7 +392,7 @@ CommonPage.Instance.Show(); var login = new Phone.Login.AccountLogin(); CommonPage.Instance.AddChidren(login); - login.Show(); + login.ShowForm(); }); } catch { } diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs old mode 100644 new mode 100755 index 197639c..d9cddaa --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -115,7 +115,7 @@ { CommonDevice device = null; //鍙嶅簭鍒楀寲涓烘寚瀹氱殑绫伙紝涓嶇劧鏁版嵁浼氫涪澶辫�屽鑷存棤娉曞己杞� - try + try { device = CommonDevice.CommonDeviceByFilePath(file); } @@ -400,6 +400,27 @@ } } + /// <summary> + /// 娣诲姞铏氭嫙璁惧鍒扮紦瀛� + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + public void AddVirtualDeviceToMemory(CommonDevice device) + { + string mainKeys = this.GetDeviceMainKeys(device); + this.dicAllDevice[mainKeys] = device; + + //璁惧鍥炶矾鏀堕泦 + if (this.dicDeviceEpoint.ContainsKey(device.DeviceAddr) == false) + { + this.dicDeviceEpoint[device.DeviceAddr] = new HashSet<int>(); + } + if (this.dicDeviceEpoint[device.DeviceAddr].Contains(device.DeviceEpoint) == false) + { + this.dicDeviceEpoint[device.DeviceAddr].Add(device.DeviceEpoint); + } + device.ReSave(); + } + #endregion #region 鈻� 淇敼璁惧___________________________ @@ -416,6 +437,12 @@ this.SetEpointName(device, newName); this.BackupDeviceAfterReName(device); + + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return true; + } //涓嶅啀妫�娴嬪悕瀛楁槸鍚︿竴鏍� //鎴愬憳鍙兘淇敼鑷繁鏈湴鐨勫悕瀛� @@ -462,6 +489,11 @@ //鏇存敼鍚嶅瓧鍚庯紝鍒锋柊璁惧缂撳瓨 this.BackupDeviceAfterReName(device2); + } + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return true; } CommonDevice device = listDevice[0]; @@ -679,7 +711,11 @@ /// <param name="device"></param> public void SetFixedPositionCommand(CommonDevice device) { - device.IdentifyControl(device.DeviceAddr, device.DeviceEpoint, 5); + //濡傛灉褰撳墠浣忓畢涓嶆槸铏氭嫙浣忓畢 + if (Common.Config.Instance.Home.IsVirtually == false) + { + device.IdentifyControl(device.DeviceAddr, device.DeviceEpoint, 5); + } } /// <summary> @@ -1766,8 +1802,8 @@ info.ConcreteType = DeviceConcreteType.Sensor_Humidity; } info.ObjectTypeNameId = 60000;//浼犳劅鍣� - } - //14鏂伴璁惧 + } + //14鏂伴璁惧 else if (dicType.ContainsKey(DeviceType.FreshAir) == true) { info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId2310; @@ -2024,16 +2060,16 @@ list.Add(DeviceBeloneType.A鎻掑骇); list.Add(DeviceBeloneType.A璋冨厜鍣�); list.Add(DeviceBeloneType.A绐楀笜); - list.Add(DeviceBeloneType.A鏂伴); list.Add(DeviceBeloneType.A绌鸿皟); list.Add(DeviceBeloneType.A缁х數鍣�); list.Add(DeviceBeloneType.A骞叉帴鐐�); list.Add(DeviceBeloneType.A鏅鸿兘闂ㄩ攣); list.Add(DeviceBeloneType.A鏅鸿兘绌哄紑); - list.Add(DeviceBeloneType.A浼犳劅鍣�); - //鍏朵粬鐨勭湅鐫�鍔炲憲,閮芥槸鎺掑湪鍚庨潰鐨�,閮藉綊涓鸿繖涓睘鎬� - list.Add(DeviceBeloneType.A鏈煡璁惧); - + list.Add(DeviceBeloneType.A浼犳劅鍣�); + + //鍏朵粬鐨勭湅鐫�鍔炲憲,閮芥槸鎺掑湪鍚庨潰鐨�,閮藉綊涓鸿繖涓睘鎬� + list.Add(DeviceBeloneType.A鏈煡璁惧); + return list; } @@ -2509,10 +2545,7 @@ else if (deviceType == DeviceType.FreshAir) { device = new FreshAir(); } else if (deviceType == DeviceType.DoorLock) { device = new DoorLock(); } else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); } - else if (deviceType == DeviceType.FreshAirHumiditySensor) - { - device = new HumiditySensor(); - } + else if (deviceType == DeviceType.FreshAirHumiditySensor) { device = new HumiditySensor(); } else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); } else { return null; } @@ -2651,12 +2684,13 @@ this.dicDeviceModelIdChanged["MULTI-FIRE--EA05"] = "MSS01/M-ZB.10";//鐑熼浘浼犳劅鍣� this.dicDeviceModelIdChanged["MULTI-MOTI--EA04"] = "MSPIR01/M-ZB.10";//绾㈠浼犳劅鍣� this.dicDeviceModelIdChanged["MULTI-WATE--EA02"] = "MSW01/M-ZB.10";//姘存蹈浼犳劅鍣� - this.dicDeviceModelIdChanged["MULTI-BURO--EA06"] = "MBU01/M-ZB.10";//绱ф�ユ寜閿� - - - //鉁┾湬鉁┾湬鉁╅渶瑕佸叡鏈夌殑鍥剧墖瀵硅薄鉁┾湬鉁┾湬鉁� - //涓よ�呴兘鏄疍eviceConcreteType - //Keys:鎸囧畾鐨勮澶� value:娌跨敤鐨勫浘鐗囨槸鍝璁惧鐨� + this.dicDeviceModelIdChanged["MULTI-BURO--EA06"] = "MBU01/M-ZB.10";//绱ф�ユ寜閿� + + + + //鉁┾湬鉁┾湬鉁╅渶瑕佸叡鏈夌殑鍥剧墖瀵硅薄鉁┾湬鉁┾湬鉁� + //涓よ�呴兘鏄疍eviceConcreteType + //Keys:鎸囧畾鐨勮澶� value:娌跨敤鐨勫浘鐗囨槸鍝璁惧鐨� this.dicPictrueShard = new Dictionary<string, string>(); this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//绠�绾�4鎸夐敭闈㈡澘 娌跨敤 4鎸夐敭鐨勫浘鏍� this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//绠�绾�3鎸夐敭闈㈡澘 娌跨敤 3鎸夐敭鐨勫浘鏍� @@ -2824,11 +2858,6 @@ /// </summary> Sensor_Humidity = -1310, - /// <summary> - /// PM2.5浼犳劅鍣� - /// </summary> - Sensor_PM = -1311, - //=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄========= /// <summary> /// 缁х數鍣� @@ -2841,9 +2870,9 @@ /// <summary> /// 鏂规偊鏂伴灏忔ā鍧� 闀滃儚id锛�2310 /// </summary> - Relay_FangyueFreshAirModul = 2310, - - //=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄========= + Relay_FangyueFreshAirModul = 2310, + + //=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄========= /// <summary> /// 璋冨厜鍣� /// </summary> @@ -2953,7 +2982,7 @@ /// <summary> /// 鎸夐敭闈㈡澘(200-1199) /// </summary> - A鎸夐敭闈㈡澘 = 200, + A鎸夐敭闈㈡澘 = 200, /// <summary> /// 浼犳劅鍣�(1200-2299) /// </summary> @@ -2961,11 +2990,7 @@ /// <summary> /// 缁х數鍣�(2300-2499) /// </summary> - A缁х數鍣� = 2300, - /// <summary> - /// 鏂伴 - /// </summary> - A鏂伴 = 2310, + A缁х數鍣� = 2300, /// <summary> /// 璋冨厜鍣�(2500-2799) /// </summary> @@ -3021,7 +3046,11 @@ /// <summary> /// 骞叉帴鐐� /// </summary> - A骞叉帴鐐� = 16, + A骞叉帴鐐� = 16, + /// <summary> + /// 鏂伴 + /// </summary> + A鏂伴 = 17 } #endregion diff --git a/ZigbeeApp/Shared/Common/House.cs b/ZigbeeApp/Shared/Common/House.cs index d8a2c06..871b61b 100755 --- a/ZigbeeApp/Shared/Common/House.cs +++ b/ZigbeeApp/Shared/Common/House.cs @@ -23,17 +23,14 @@ return $"House_{Id}.json"; } } - /// <summary> /// 浣忓畢id--浣跨敤浜戠鎻愪緵鐨勪綇瀹呭敮涓�Id /// </summary> public string Id = string.Empty; - /// <summary> /// 浣忓畢鍚嶇О /// </summary> public string Name = string.Empty; - /// <summary> /// 鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹� /// </summary> @@ -42,7 +39,10 @@ /// 褰撳墠浣忓畢鏄叾浠栦富甯愬彿鍒嗕韩杩囨潵鐨勪富甯愬彿鐨勫垎甯冨紡Id /// </summary> public string MainUserDistributedMark; - + /// <summary> + /// 璇ヤ綇瀹呮槸鍚︽槸铏氭嫙鐨�,true鐨勮瘽浠h〃缃戝叧鍜岃澶囬兘鏄櫄鎷熺殑(榛樿涓篺alse) + /// </summary> + public bool IsVirtually = false; /// <summary> /// 浠呭瓙璐﹀彿鐧婚檰鐨勬椂鍊欎娇鐢�,褰撱�怚sOthreShare銆戜负"true"锛屽苟涓斻�怉ccountType銆戜负"1"鏃讹紝璇ヨ处鍙锋嫢鏈夌鐞嗗憳鏉冮檺 /// </summary> @@ -59,12 +59,10 @@ /// 浣忓畢鎵�鍦ㄧ殑鍦扮悊浣嶇疆鐨勫悕绉� /// </summary> public string ResidenceAddressName = string.Empty; - /// <summary> /// 鎴块棿鍒楄〃(鎴块棿鐨処D) /// </summary> public List<string> ListRooms = new List<string>(); - /// <summary> /// 妤煎眰瀛楀吀 /// key:FloorId @@ -75,27 +73,6 @@ /// 褰撳墠妤煎眰Id /// </summary> public string CurrentFloorId = string.Empty; - - /// <summary> - /// 鍏ㄥ眬鍦烘櫙璺緞鍒楄〃---澶囩敤 - /// </summary> - public List<string> SceneFilePathList = new List<string> { }; - /// <summary> - /// 璁惧璺緞鍒楄〃---澶囩敤 - /// </summary> - public List<string> DeviceFilePathList = new List<string> { }; - /// <summary> - /// 鍔熻兘璺緞鍒楄〃---澶囩敤 - /// </summary> - public List<string> FunctionFilePathList = new List<string> { }; - /// <summary> - /// 閫氱敤鏍囪瘑--澶囩敤 - /// </summary> - public object Tag; - /// <summary> - /// 鏈熴�佹爧銆佸眰绛夊尯鍩�---澶囩敤 - /// </summary> - public Dictionary<string, string> LocationInfoList = new Dictionary<string, string> { }; #endregion @@ -186,6 +163,10 @@ /// <param name="houseName">House name.</param> public static void EditorHouseByHouseId(string houseId, string houseName) { + if (Config.Instance.Home.Id == houseId) + { + Config.Instance.Home.Name = houseName; + } var home = GetHouseByHouseId(houseId); if (home == null) { @@ -193,7 +174,6 @@ } home.Name = houseName; home.Save(); - Config.Instance.Save(); } #endregion diff --git a/ZigbeeApp/Shared/Common/Logic.cs b/ZigbeeApp/Shared/Common/Logic.cs index 1bc61e4..25b7c00 100755 --- a/ZigbeeApp/Shared/Common/Logic.cs +++ b/ZigbeeApp/Shared/Common/Logic.cs @@ -8,6 +8,7 @@ { public static List<Logic> LogicList = new List<Logic>(); public static List<Logic> LockLogicList = new List<Logic>(); + public static List<Logic> SoneLogicList = new List<Logic>(); public static List<ZigBee.Device.CommonDevice> LogicDviceList = new List<ZigBee.Device.CommonDevice>(); public static Logic CurrentLogic; /// <summary> diff --git a/ZigbeeApp/Shared/Common/ResponseEntity/BackupInfoRes.cs b/ZigbeeApp/Shared/Common/ResponseEntity/BackupInfoRes.cs deleted file mode 100755 index d8438fc..0000000 --- a/ZigbeeApp/Shared/Common/ResponseEntity/BackupInfoRes.cs +++ /dev/null @@ -1,12 +0,0 @@ -锘縰sing System; - -namespace Shared.Common.ResponseEntity -{ - [Serializable] - public class BackupInfoRes - { - public int Id; - - public string FileName ; - } -} diff --git a/ZigbeeApp/Shared/Common/ResponseEntity/FirmwareManaRes.cs b/ZigbeeApp/Shared/Common/ResponseEntity/FirmwareManaRes.cs deleted file mode 100755 index 1353c3e..0000000 --- a/ZigbeeApp/Shared/Common/ResponseEntity/FirmwareManaRes.cs +++ /dev/null @@ -1,51 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; - -namespace Shared.Common.ResponseEntity -{ - /// <summary> - /// 鍥轰欢 - /// </summary> - [Serializable] - public class FirmwareManaRes - { - public string ResponseVersion; - public string StateCode; - public string ErrorInfo; - public List<FirmwareManaObj> ResponseData = new List<FirmwareManaObj>{}; - } - [Serializable] - public class FirmwareManaObj - { - /// <summary> - /// apk鍚嶇О - /// </summary> - /// <value>The name.</value> - public string Name { get; set; } - /// <summary> - /// apk鐗堟湰 - /// </summary> - /// <value>The firmware version.</value> - public string FirmwareVersion { get; set; } - /// <summary> - /// 澶囨敞 - /// </summary> - /// <value>The remarks.</value> - public string Remarks { get; set; } - /// <summary> - /// 鍥轰欢鍒嗗竷寮忓敮涓�,涔熸槸涓嬭浇鏃剁殑[涓嬭浇鍥轰欢鐨勫敮涓�鏍囪瘑] - /// </summary> - /// <value>The distributed mark.</value> - public string DistributedMark { get; set; } - /// <summary> - /// 涓婚敭 - /// </summary> - /// <value>The identifier.</value> - public string Id { get; set; } - /// <summary> - /// 鍒涘缓鏃堕棿 - /// </summary> - /// <value>The created on UTC.</value> - public string CreatedOnUtc { get; set; } - } -} diff --git a/ZigbeeApp/Shared/Common/ResponseEntity/FolderRes.cs b/ZigbeeApp/Shared/Common/ResponseEntity/FolderRes.cs deleted file mode 100755 index c6eeb38..0000000 --- a/ZigbeeApp/Shared/Common/ResponseEntity/FolderRes.cs +++ /dev/null @@ -1,14 +0,0 @@ -锘縰sing System; - -namespace Shared.Common.ResponseEntity -{ - [Serializable] - public class FolderRes - { - public int FolderID; - - public string FolderName; - - public DateTime FolderAddTime; - } -} diff --git a/ZigbeeApp/Shared/Common/ResponseEntity/GatewayRes.cs b/ZigbeeApp/Shared/Common/ResponseEntity/GatewayRes.cs deleted file mode 100755 index a46f7f0..0000000 --- a/ZigbeeApp/Shared/Common/ResponseEntity/GatewayRes.cs +++ /dev/null @@ -1,23 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; - -namespace Shared.Common.ResponseEntity -{ - [Serializable] - public class GatewayRes - { - public List<GatewayObj> PageData = new List<GatewayObj>(); - public int PageIndex; - public int PageSize; - public int TotalCount; - public int TotalPages; - public bool HasPreviousPage; - public bool HasNextPage; - } - [Serializable] - public class GatewayObj - { - public string ZigbeeUniqueId{ get; set; } - - } -} diff --git a/ZigbeeApp/Shared/Common/ResponseEntity/GetAreaCode.cs b/ZigbeeApp/Shared/Common/ResponseEntity/GetAreaCode.cs index 89683af..206ebee 100755 --- a/ZigbeeApp/Shared/Common/ResponseEntity/GetAreaCode.cs +++ b/ZigbeeApp/Shared/Common/ResponseEntity/GetAreaCode.cs @@ -3,16 +3,6 @@ namespace Shared.Common.ResponseEntity { [Serializable] - public class GetAreaCode - { - public List<AreaCodeOBJ> ResponseData = new List<AreaCodeOBJ>(); - public string ErrorInfo_En; - public string ErrorInfo_Zh; - public string ResponseVersion; - public string StateCode; - public string ErrorInfo; - } - [Serializable] public class AreaCodeOBJ { public string Name{ get; set; } diff --git a/ZigbeeApp/Shared/Common/ResponseEntity/UserRegisterReqDto.cs b/ZigbeeApp/Shared/Common/ResponseEntity/UserRegisterReqDto.cs deleted file mode 100755 index 926a0e1..0000000 --- a/ZigbeeApp/Shared/Common/ResponseEntity/UserRegisterReqDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -锘縰sing System; -namespace Shared.Common.ResponseEntity -{ - public class UserRegisterReqDto - { - public UserRegisterReqDto() - { - } - } -} diff --git a/ZigbeeApp/Shared/Common/SceneRoomUI.cs b/ZigbeeApp/Shared/Common/SceneRoomUI.cs deleted file mode 100755 index b6e5613..0000000 --- a/ZigbeeApp/Shared/Common/SceneRoomUI.cs +++ /dev/null @@ -1,62 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using Shared.Phone.Device.Category; - -namespace Shared.Common -{ - /// <summary> - /// 鍦ㄥ垎绫诲満鏅腑浣跨敤锛屽睍绀鸿鍔犱笂鎴块棿鐨勫悕绉� - /// </summary> - [System.Serializable] - public class SceneRoomUI - { - /// <summary> - /// 鍦烘櫙淇℃伅 - /// </summary> - public SceneUI sceneUI; - /// <summary> - /// 鎴块棿 - /// </summary> - public Room room; - - /// <summary> - /// 鎵�鏈夌殑鍦烘櫙鍜屾埧闂翠俊鎭� - /// </summary> - public static void GetAllSceneRoomUIList() - { - //閫夋嫨鍦烘櫙--鎵�鏈夋埧闂寸殑鎵�鏈夊満鏅� - AllSceneRoomUIList.Clear(); - List<int> sceneIdList = new List<int> { }; - var listAllRoom = Phone.UserCenter.HdlRoomLogic.Current.GetAllListRooms(); - foreach (var r in listAllRoom) - { - if (r.ListSceneId.Count == 0) - { - continue; - } - foreach (var sceneId in r.ListSceneId) - { - var scene = Phone.UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId); - if (scene == null) - { - continue; - } - if(!sceneIdList.Contains(scene.Id)) - { - var sceneRoomUI = new SceneRoomUI { sceneUI = scene, room = r }; - sceneIdList.Add(scene.Id); - AllSceneRoomUIList.Add(sceneRoomUI); - } - } - } - } - - /// <summary> - /// 鎵�鏈夌殑鍦烘櫙鍜屾埧闂翠俊鎭� -璇峰厛璋冪敤 GetAllSceneRoomUIList - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public static List<SceneRoomUI> AllSceneRoomUIList = new List<SceneRoomUI> { }; - - - } -} diff --git a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs b/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs deleted file mode 100755 index 666855b..0000000 --- a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs +++ /dev/null @@ -1,183 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Globalization; -using ZigBee.Device; -using static ZigBee.Device.Scene; - -namespace Shared.Common -{ - /// <summary> - /// 鍦烘櫙娣诲姞鎵ц鐩爣(璁惧銆佹椂闂撮棿闅斻�佸満鏅級 - /// </summary> - [System.Serializable] - public class SceneTargetDeviceUI - { - /// <summary> - /// 鍦烘櫙娣诲姞瀵硅薄鐨勭被鍨� 榛樿0璁惧 2鏃堕棿娈� 1鍏朵粬鍦烘櫙 - /// </summary> - public int Type = 0; - /// <summary> - /// 浠诲姟鍒楄〃涓殑鏁版嵁鍒楄〃 - /// Type=0 瀛樺湪 - /// </summary> - public List<Safeguard.TaskListInfo> TaskList = new List<Safeguard.TaskListInfo>(); - /// <summary> - /// 閫夋嫨鐨勮澶� - /// Type=0 瀛樺湪 - /// </summary> - public CommonDevice DeviceUI = new CommonDevice(); - - /// <summary> - /// Type=0銆�1銆�2 瀛樺湪 - /// 寤舵椂鏃堕棿 - /// </summary> - public int DelayTime = 0; - /// <summary> - /// 褰揟ype=2鏃跺瓨鍦� - /// 寤舵椂鎵ц搴忓彿锛岃〃绀虹鍑犱釜寤舵椂鍔ㄤ綔 - /// </summary> - public int DelayTimeSerialNumber = 0; - - /// <summary> - /// 閫夋嫨鐨勫満鏅� - /// Type=1 瀛樺湪 - /// </summary> - public SceneUI SceneUI = new SceneUI(); - /// <summary> - /// 浣滀负鎴愬憳鐨勫叾浠栧満鏅痠d銆� - /// Type=1 瀛樺湪 - /// </summary> - public int ElseScenesId = 0; - /// <summary> - /// 鍦烘櫙鍚嶇О - /// Type=1 瀛樺湪 - /// </summary> - public string SceneName = string.Empty; - /// <summary> - /// 鍞竴鏍囪瘑--HashCode - /// DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo) - /// </summary> - public string SceneTargetDeviceUIID = Guid.NewGuid().ToString(); - - /// <summary> - /// GetDeviceStatu - /// </summary> - /// <returns></returns> - public string GetDeviceStatu() - { - if (DeviceUI.Type == ZigBee.Device.DeviceType.OnOffOutput) - { - if (TaskList.Count == 0) - { - return null; - } - if (TaskList[0].Data1 == 1) - { - return Language.StringByID(R.MyInternationalizationString.Open); - } - return Language.StringByID(R.MyInternationalizationString.Shut); - } - else if (DeviceUI.Type == ZigBee.Device.DeviceType.AirSwitch) - { - if (TaskList.Count == 0) - { - return null; - } - if (TaskList[0].Data1 == 1) - { - return Language.StringByID(R.MyInternationalizationString.Open); - } - return Language.StringByID(R.MyInternationalizationString.Shut); - } - else if (DeviceUI.Type == ZigBee.Device.DeviceType.DimmableLight) - { - if (TaskList.Count == 0) - { - return null; - } - if (TaskList[0].Data1 == 0) - { - return Language.StringByID(R.MyInternationalizationString.Shut); - } - return $"{(int)(TaskList[0].Data1 * 1.0 / 254 * 100)}%"; - } - else if (DeviceUI.Type == ZigBee.Device.DeviceType.WindowCoveringDevice) - { - if (TaskList.Count == 0) - { - return null; - } - if (TaskList[0].Data1 == 1) - { - return Language.StringByID(R.MyInternationalizationString.Shut); - } - return $"{TaskList[0].Data2}%"; - } - else if (DeviceUI.Type == ZigBee.Device.DeviceType.Thermostat) - { - //娓╁害锛屾ā寮忥紝椋庨�� - string tempareture = string.Empty; - string model = string.Empty; - string wind = string.Empty; - if (TaskList.Count == 0) - { - return null; - } - foreach(var taskListInfo in TaskList) - { - if(taskListInfo.Data1==3) - { - if(taskListInfo.Data2==0) - { - return Language.StringByID(R.MyInternationalizationString.Shut); - } - else if(taskListInfo.Data2==1) - { - model = Language.StringByID(R.MyInternationalizationString.Mode_Auto); - } - else if(taskListInfo.Data2==3) - { - model = Language.StringByID(R.MyInternationalizationString.Mode_Cool); - } - else if (taskListInfo.Data2 == 4) - { - model = Language.StringByID(R.MyInternationalizationString.Mode_Heat); - } - else if (taskListInfo.Data2 == 7) - { - model = Language.StringByID(R.MyInternationalizationString.Mode_FanOnly); - } - else if (taskListInfo.Data2 == 8) - { - model = Language.StringByID(R.MyInternationalizationString.Mode_Dry); - } - } - else if(taskListInfo.Data1==4 || taskListInfo.Data1==5) - { - tempareture = $"{ taskListInfo.Data2/100} 鈩�"; - } - else if (taskListInfo.Data1 == 6) - { - if (taskListInfo.Data2 == 1) - { - wind = Language.StringByID(R.MyInternationalizationString.Fan_Low); - } - else if(taskListInfo.Data2 ==2) - { - wind = Language.StringByID(R.MyInternationalizationString.Fan_Middle); - } - else if (taskListInfo.Data2 == 3) - { - wind = Language.StringByID(R.MyInternationalizationString.Fan_Height); - } - } - } - return $"{tempareture},{model},{wind}"; - } - else - { - return null; - } - } - } -} diff --git a/ZigbeeApp/Shared/Common/SceneUI.cs b/ZigbeeApp/Shared/Common/SceneUI.cs index 9bd6282..4ca5160 100755 --- a/ZigbeeApp/Shared/Common/SceneUI.cs +++ b/ZigbeeApp/Shared/Common/SceneUI.cs @@ -1,6 +1,5 @@ 锘縰sing System; using System.Collections.Generic; -using Shared.Phone.Device.Category; using Shared.Phone.UserCenter; namespace Shared.Common diff --git a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll index be91c83..e3716df 100755 --- a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll +++ b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll Binary files differ diff --git a/ZigbeeApp/Shared/Pad/MainPage.cs b/ZigbeeApp/Shared/Pad/MainPage.cs deleted file mode 100755 index 2943b2e..0000000 --- a/ZigbeeApp/Shared/Pad/MainPage.cs +++ /dev/null @@ -1,22 +0,0 @@ -锘縩amespace Shared.Pad -{ - public class MainPage - { - public void Show(){ - - } - - static MainPage mainPage; - public static MainPage Instance - { - get - { - if (mainPage == null) - { - mainPage = new MainPage { }; - } - return mainPage; - } - } - } -} \ No newline at end of file diff --git a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs index 8ee6132..d89aea9 100755 --- a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs @@ -259,7 +259,7 @@ /// </summary> private void InitAddTargetControl() { - if (this.frameTargetTableControl == null) + if (this.frameTargetTableControl == null || this.frameTargetTableControl.Parent == null) { //娣诲姞鐩爣鐨勭殑瀹瑰櫒鎺т欢 this.frameTargetTableControl = new FrameListControl(); @@ -295,8 +295,11 @@ { //浠庣綉鍏宠幏鍙栧満鏅殑鎵ц鐩爣 var result = await this.GetSceneTargetList(); - //娣诲姞銆愭墽琛岀洰鏍囪銆� - this.AddTargetRow(); + if (result == true) + { + //娣诲姞銆愭墽琛岀洰鏍囪銆� + this.AddTargetRow(); + } }); } @@ -636,6 +639,7 @@ { return true; } + //鎵撳紑杩涘害鏉� this.ShowProgressBar(); //鑾峰彇鎵ц鐩爣鍒楄〃 diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs index c88d512..2173df9 100755 --- a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs @@ -1,22 +1,22 @@ -锘縰sing System; -using System.Collections.Generic; +锘縰sing System; +using System.Collections.Generic; using Shared.Phone.UserCenter; -namespace Shared.Phone.Category -{ +namespace Shared.Phone.Category +{ /// <summary> /// 鍦烘櫙鎵ц鐩爣娣诲姞寤舵椂鐨勭晫闈� - /// </summary> - public class AdjustTargetAddDelayTimeForm : EditorCommonForm + /// </summary> + public class AdjustTargetAddDelayTimeForm : EditorCommonForm { - #region 鈻� 鍙橀噺澹版槑___________________________ - + #region 鈻� 鍙橀噺澹版槑___________________________ + /// <summary> /// 纭畾閫夋嫨鐨勪簨浠� - /// </summary> - public Action<int> FinishSelectEvent = null; - - #endregion + /// </summary> + public Action<int> FinishSelectEvent = null; + + #endregion #region 鈻� 鍒濆鍖朹____________________________ @@ -48,29 +48,29 @@ //鍥炬爣绗竴灞傚簳鑹� var frameFirstBack = new FrameLayout(); frameFirstBack.Y = Application.GetRealHeight(118); - frameFirstBack.Height = Application.GetMinRealAverage(207); - frameFirstBack.Width = Application.GetMinRealAverage(207); + frameFirstBack.Height = this.GetPictrueRealSize(207); + frameFirstBack.Width = this.GetPictrueRealSize(207); frameFirstBack.BackgroundColor = UserCenterColor.Current.White; - frameFirstBack.Radius = (uint)Application.GetMinRealAverage(207) / 2; - frameFirstBack.Gravity = Gravity.CenterHorizontal; + frameFirstBack.Radius = (uint)this.GetPictrueRealSize(207) / 2; + frameFirstBack.Gravity = Gravity.CenterHorizontal; bodyFrameLayout.AddChidren(frameFirstBack); //闃叉鍑虹幇璇樊 - int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); + int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12); //鍥炬爣绗簩灞傚簳鑹� var btnSecondBack = new NormalViewControl(iconWidth, iconWidth, false); btnSecondBack.BackgroundColor = 0xfffef1ed; btnSecondBack.Radius = (uint)iconWidth / 2; btnSecondBack.Gravity = Gravity.Center; - frameFirstBack.AddChidren(btnSecondBack); - //鍥炬爣 - var btnIcon = new IconViewControl(124); - btnIcon.UnSelectedImagePath = "Item/Timer.png"; - btnIcon.Gravity = Gravity.Center; - frameFirstBack.AddChidren(btnIcon); - - //涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅� - var btnMsg = new NormalViewControl(700, 62, true); - btnMsg.Y = frameFirstBack.Bottom + Application.GetRealHeight(34); + frameFirstBack.AddChidren(btnSecondBack); + //鍥炬爣 + var btnIcon = new IconViewControl(124); + btnIcon.UnSelectedImagePath = "Item/Timer.png"; + btnIcon.Gravity = Gravity.Center; + frameFirstBack.AddChidren(btnIcon); + + //涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅� + var btnMsg = new NormalViewControl(700, 62, true); + btnMsg.Y = frameFirstBack.Bottom + Application.GetRealHeight(34); btnMsg.TextSize = 15; btnMsg.TextID = R.MyInternationalizationString.SelectTimeForAction; btnMsg.TextAlignment = TextAlignment.Center; @@ -84,35 +84,35 @@ frameWhiteBack.Height = Application.GetRealHeight(1500);//瓒呰繃搴曢儴鍗冲彲 frameWhiteBack.Radius = (uint)Application.GetRealHeight(58); bodyFrameLayout.AddChidren(frameWhiteBack); - //婊戝姩鎺т欢 - var pickView = new UIPickerView(); + //婊戝姩鎺т欢 + var pickView = new UIPickerView(); pickView.Y = Application.GetRealHeight(127); - pickView.Height = Application.GetRealHeight(153 * 3); - frameWhiteBack.AddChidren(pickView); - - //鍒� - string strMinute = Language.StringByID(R.MyInternationalizationString.uMinute); - //绉� - string strSecond = Language.StringByID(R.MyInternationalizationString.uSecond); - var listfirst = new List<string>(); - var listSecond = new List<List<string>>(); - for (int i = 0; i <= 59; i++) - { - listfirst.Add(i.ToString().PadLeft(2, '0') + strMinute); - var listTemp = new List<string>(); - for (int j = 0; j <= 59; j++) - { - if (i == 0 && j == 0) - { - continue; - } - listTemp.Add(j.ToString().PadLeft(2, '0') + strSecond); - } - listSecond.Add(listTemp); - } - //鍔犱竴涓�60鍒嗛挓鍚� - listfirst.Add("60" + strMinute); - var listTemp2 = new List<string>() { "00" + strSecond }; + pickView.Height = Application.GetRealHeight(153 * 3); + frameWhiteBack.AddChidren(pickView); + + //鍒� + string strMinute = Language.StringByID(R.MyInternationalizationString.uMinute); + //绉� + string strSecond = Language.StringByID(R.MyInternationalizationString.uSecond); + var listfirst = new List<string>(); + var listSecond = new List<List<string>>(); + for (int i = 0; i <= 59; i++) + { + listfirst.Add(i.ToString().PadLeft(2, '0') + strMinute); + var listTemp = new List<string>(); + for (int j = 0; j <= 59; j++) + { + if (i == 0 && j == 0) + { + continue; + } + listTemp.Add(j.ToString().PadLeft(2, '0') + strSecond); + } + listSecond.Add(listTemp); + } + //鍔犱竴涓�60鍒嗛挓鍚� + listfirst.Add("60" + strMinute); + var listTemp2 = new List<string>() { "00" + strSecond }; listSecond.Add(listTemp2); int firstIndex = selectTime / 60; @@ -120,19 +120,19 @@ //鍥犱负0鍒嗙殑鏃跺�欙紝瀹冩槸浠�1绉掑紑濮嬬殑锛屾墍浠ュ畠鐨勭储寮曢渶瑕�-1 if (firstIndex == 0) { secondIndex--; } - pickView.setPicker(listfirst, listSecond); - pickView.setCurrentItems(firstIndex, secondIndex, 0); - pickView.OnSelectChangeEvent += (value1, value2, value3) => + pickView.setPicker(listfirst, listSecond); + pickView.setCurrentItems(firstIndex, secondIndex, 0); + pickView.OnSelectChangeEvent += (value1, value2, value3) => { int minute = Convert.ToInt32(listfirst[value1].Substring(0, 2)); int second = Convert.ToInt32(listSecond[value1][value2].Substring(0, 2)); - selectTime = minute * 60 + second; - }; - - //瀹屾垚鎸夐挳 - var btnSave = new BottomClickButton(); - btnSave.TextID = R.MyInternationalizationString.uSave; - bodyFrameLayout.AddChidren(btnSave); + selectTime = minute * 60 + second; + }; + + //瀹屾垚鎸夐挳 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uSave; + bodyFrameLayout.AddChidren(btnSave); btnSave.ButtonClickEvent += (sender, e) => { //閫夋嫨鐨勬槸鍚屼竴涓椂闂�,鍒欎笉瑙﹀彂鍥炶皟鍑芥暟 @@ -143,20 +143,20 @@ }; } - #endregion + #endregion - #region 鈻� 鐣岄潰鍏抽棴___________________________ - + #region 鈻� 鐣岄潰鍏抽棴___________________________ + /// <summary> /// 鐣岄潰鍏抽棴 - /// </summary> + /// </summary> public override void CloseFormBefore() { this.FinishSelectEvent = null; base.CloseFormBefore(); - } - - #endregion - } -} + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs index a0a3125..80f6792 100755 --- a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs @@ -333,11 +333,11 @@ //璁惧鍥炬爣鑳屾櫙鎺т欢 var frameIconBackGroud = new FrameLayout(); - frameIconBackGroud.Height = Application.GetMinRealAverage(112); - frameIconBackGroud.Width = Application.GetMinRealAverage(112); + frameIconBackGroud.Height = this.GetPictrueRealSize(112); + frameIconBackGroud.Width = this.GetPictrueRealSize(112); frameIconBackGroud.Gravity = Gravity.CenterVertical; frameIconBackGroud.X = Application.GetRealWidth(46); - frameIconBackGroud.Radius = (uint)Application.GetMinRealAverage(112 / 2); + frameIconBackGroud.Radius = (uint)this.GetPictrueRealSize(112 / 2); frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor; rowDevice.AddChidren(frameIconBackGroud, ChidrenBindMode.NotBind); frameIconBackGroud.Y += rowDevice.chidrenYaxis; diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs old mode 100644 new mode 100755 index 2e14264..79e9432 --- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs @@ -155,7 +155,7 @@ frameSwitchBack.AddChidren(btnFloorName); btnFloorName.ButtonClickEvent += (sender, e) => { - var floors = new Device.Category.SelectFloor(); + var floors = new SelectFloorForm(); AddChidren(floors); floors.Init(580, 330, Direction.Right); floors.changeFloor = true; @@ -438,8 +438,8 @@ var noFunction = new Button() { Y = Application.GetRealHeight(320), - Width = Application.GetMinRealAverage(757), - Height = Application.GetMinRealAverage(435), + Width = this.GetPictrueRealSize(757), + Height = this.GetPictrueRealSize(435), UnSelectedImagePath = "Item/NoFunction.png", Gravity = Gravity.CenterHorizontal }; @@ -476,14 +476,14 @@ var listDevice = new List<CommonDevice>(); for (int i = 0; i < rowInfo.listDeviceKeys.Count; i++) { - var device = LocalDevice.Current.GetDevice(rowInfo.listDeviceKeys[i]); - - //鑾峰彇璁惧绫诲瀷鐨� - var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); - //鏂伴闈㈡澘涓嬬殑鍥炶矾涓嶆樉绀猴紝锛堝鏂伴銆佹俯/婀垮害浼犳劅鍣ㄥ垯涓嶆樉绀猴級 - if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) - { - continue; + var device = LocalDevice.Current.GetDevice(rowInfo.listDeviceKeys[i]); + + //鑾峰彇璁惧绫诲瀷鐨� + var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); + //鏂伴闈㈡澘涓嬬殑鍥炶矾涓嶆樉绀猴紝锛堝鏂伴銆佹俯/婀垮害浼犳劅鍣ㄥ垯涓嶆樉绀猴級 + if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) + { + continue; } if (device != null) @@ -525,8 +525,8 @@ } // 鏂伴 else if (device.Type == DeviceType.FreshAir) - { - cardContr = new Controls.DeviceFreshAirRowControl(listView.rowSpace / 2); + { + cardContr = new Controls.DeviceFreshAirRowControl(listView.rowSpace / 2); } //褰╃伅(璋冨厜鍣�) else if (device.Type == DeviceType.DimmableLight) @@ -638,8 +638,8 @@ { listview2 = new VerticalListControl(); functionSceneBodyView.AddChidren(listview2); - } - + } + foreach (var scene in listScene) { //鍦烘櫙鍗$墖鎺т欢 @@ -654,23 +654,45 @@ { if (listview1 != null) { - //鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂� - this.GetAllDelayScene(dicSceneContr, listview1); + //鎵撳紑鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂� + this.StartAllDelayScene(dicSceneContr, listview1); } else { - //鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂� - this.GetAllDelayScene(dicSceneContr, listview2); + //鎵撳紑鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂� + this.StartAllDelayScene(dicSceneContr, listview2); } }, ShowErrorMode.NO); } /// <summary> - /// 鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂� + /// 鎵撳紑鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂� /// </summary> /// <param name="dicSceneContr"></param> - private async void GetAllDelayScene(Dictionary<int, SceneCategoryView> dicSceneContr, ViewGroup listview) + private async void StartAllDelayScene(Dictionary<int, SceneCategoryView> dicSceneContr, ViewGroup listview) { + string hourText = Language.StringByID(R.MyInternationalizationString.Hour); + string minuText = Language.StringByID(R.MyInternationalizationString.Minute); + string secondText = Language.StringByID(R.MyInternationalizationString.Second); + + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� + if (Config.Instance.Home.IsVirtually == true) + { + HdlThreadLogic.Current.RunMain(() => + { + //寮�鍚欢鏃剁壒鏁� + foreach (var myContr in dicSceneContr.Values) + { + if (myContr.scene.RemainTime > 0) + { + //寮�鍚満鏅欢鏃剁壒鏁� + this.StartSceneDelayApeal(myContr, listview, myContr.scene.RemainTime, hourText, minuText, secondText); + } + } + }, ShowErrorMode.NO); + return; + } + //璇诲彇鍏ㄩ儴鐨勫欢鏃舵椂闂� var result = await Scene.CatDelaySceneAsync(); if (result == null || result.catDelaySceneResponseData == null || @@ -679,10 +701,6 @@ //鍑洪敊涓嶉笩瀹� return; } - - string hourText = Language.StringByID(R.MyInternationalizationString.Hour); - string minuText = Language.StringByID(R.MyInternationalizationString.Minute); - string secondText = Language.StringByID(R.MyInternationalizationString.Second); foreach (var data in result.catDelaySceneResponseData.DelayScenesList) { @@ -699,30 +717,45 @@ { continue; } - HdlThreadLogic.Current.RunThread(() => + //寮�鍚満鏅欢鏃剁壒鏁� + this.StartSceneDelayApeal(seceneContr, listview, remainTime, hourText, minuText, secondText); + } + } + + /// <summary> + /// 寮�鍚満鏅欢鏃剁壒鏁� + /// </summary> + /// <param name="sceneContr"></param> + /// <param name="remainTime"></param> + /// <param name="hourText"></param> + /// <param name="minuText"></param> + /// <param name="secondText"></param> + private void StartSceneDelayApeal(SceneCategoryView sceneContr, ViewGroup listview, int remainTime, + string hourText, string minuText, string secondText) + { + HdlThreadLogic.Current.RunThread(() => + { + //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾) + HdlSceneLogic.Current.StartDelayTimeThread(sceneContr.scene); + while (remainTime > 0 && this.Parent != null) { - //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾) - HdlSceneLogic.Current.StartDelayTimeThread(seceneContr.scene); - while (remainTime > 0 && this.Parent != null) - { - System.Threading.Thread.Sleep(1000); - Application.RunOnMainThread(() => - { - seceneContr.SetTimeText(this.GetTimeString(remainTime, hourText, minuText, secondText)); - }); - remainTime--; - } + System.Threading.Thread.Sleep(1000); Application.RunOnMainThread(() => { - if (listview.Parent != null) - { - seceneContr.SetTimeImage(); - //寮�鍚疞oading鐗规晥 - seceneContr.StartLoadingApreal(); - } + sceneContr.SetTimeText(this.GetTimeString(remainTime, hourText, minuText, secondText)); }); + remainTime--; + } + Application.RunOnMainThread(() => + { + if (listview.Parent != null) + { + sceneContr.SetTimeImage(); + //寮�鍚疞oading鐗规晥 + sceneContr.StartLoadingApreal(); + } }); - } + }); } /// <summary> @@ -733,8 +766,8 @@ var noFunction = new Button() { Y = Application.GetRealHeight(320), - Width = Application.GetMinRealAverage(757), - Height = Application.GetMinRealAverage(435), + Width = this.GetPictrueRealSize(757), + Height = this.GetPictrueRealSize(435), UnSelectedImagePath = "Item/NoFunction.png", Gravity = Gravity.CenterHorizontal }; @@ -891,10 +924,10 @@ LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2); dic[typeInfo.BeloneTextId].IconPath = path1; dic[typeInfo.BeloneTextId].IconPathSelected = path2; - if (device.Type == DeviceType.FreshAir) - { - dic[typeInfo.BeloneTextId].IconPath = "Device/FreshAirEpoint.png"; - dic[typeInfo.BeloneTextId].IconPathSelected = "Device/FreshAirEpointSelected.png"; + if (device.Type == DeviceType.FreshAir) + { + dic[typeInfo.BeloneTextId].IconPath = "Device/FreshAirEpoint.png"; + dic[typeInfo.BeloneTextId].IconPathSelected = "Device/FreshAirEpointSelected.png"; } dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId; } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs index 04dc6ed..afff6e7 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs @@ -77,11 +77,11 @@ this.device = i_device; //璁惧鍥炬爣鑳屾櫙鎺т欢 this.frameIconBackGroud = new FrameLayout(); - frameIconBackGroud.Height = Application.GetMinRealAverage(112); - frameIconBackGroud.Width = Application.GetMinRealAverage(112); + frameIconBackGroud.Height = this.GetPictrueRealSize(112); + frameIconBackGroud.Width = this.GetPictrueRealSize(112); frameIconBackGroud.Gravity = Gravity.CenterVertical; frameIconBackGroud.X = Application.GetRealWidth(46); - frameIconBackGroud.Radius = (uint)Application.GetMinRealAverage(112 / 2); + frameIconBackGroud.Radius = (uint)this.GetPictrueRealSize(112 / 2); frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor; this.frameTable.AddChidren(frameIconBackGroud, ChidrenBindMode.NotBind); if (chidrenYaxis != 0) diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs index 89474f2..8de2889 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs @@ -102,7 +102,7 @@ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendACStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendACStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs index 9db3b47..8bad345 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -35,6 +36,14 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((LightBase)i_device).OnOffStatus = btnSwitch.IsSelected == true ? 0 : 1; + this.RefreshControlInfo(this.device); + return; + } bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetRowOpenStatu(setStatu); @@ -112,10 +121,15 @@ /// </summary> public override void SendStatuComand() { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendLightStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs index a3ab47f..97018dd 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -35,6 +36,14 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴淇敼缂撳瓨 + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((LightBase)i_device).OnOffStatus = btnSwitch.IsSelected == true ? 0 : 1; + this.RefreshControlInfo(this.device); + return; + } bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetRowOpenStatu(setStatu); @@ -98,10 +107,15 @@ /// </summary> public override void SendStatuComand() { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendDimmableLightStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs index 325d9ac..72e5900 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs @@ -61,6 +61,13 @@ btnOpen.X = Application.GetRealWidth(625) - btnOpen.XOffset; btnOpen.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴淇敼缂撳瓨 + if (Common.Config.Instance.Home.IsVirtually == true) + { + ((Rollershade)i_device).WcdCurrentPositionLiftPercentage = 100; + base.RefreshControlInfo(i_device); + return; + } ((Rollershade)i_device).CurtainUpDownStopControl(0); }; @@ -74,7 +81,11 @@ btnStop.X = Application.GetRealWidth(769) - btnOpen.XOffset; btnStop.ButtonClickEvent += (sender, e) => { - ((Rollershade)i_device).CurtainUpDownStopControl(2); + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == false) + { + ((Rollershade)i_device).CurtainUpDownStopControl(2); + } }; //鍏抽棴 @@ -85,6 +96,13 @@ btnClose.X = Application.GetRealWidth(896) - btnOpen.XOffset; btnClose.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴淇敼缂撳瓨 + if (Common.Config.Instance.Home.IsVirtually == true) + { + ((Rollershade)i_device).WcdCurrentPositionLiftPercentage = 0; + base.RefreshControlInfo(i_device); + return; + } ((Rollershade)i_device).CurtainUpDownStopControl(1); }; @@ -134,10 +152,15 @@ /// </summary> public override void SendStatuComand() { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendCurtainStatuComand(this.device); } if (((Rollershade)this.device).WcdType == -1) { diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs index 52175d5..69d12e9 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs @@ -30,8 +30,12 @@ { base.InitControl(i_device); - //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 - this.AddDetailInfoEvent(i_device); + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == false) + { + //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 + this.AddDetailInfoEvent(i_device); + } } #endregion diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs old mode 100644 new mode 100755 index c2ab4b8..41fd742 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs @@ -96,7 +96,7 @@ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendFreshAirStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendFreshAirStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs index 69a2494..8da00ad 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -35,6 +36,15 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((LightBase)i_device).OnOffStatus = btnSwitch.IsSelected == true ? 0 : 1; + this.RefreshControlInfo(this.device); + return; + } + bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetRowOpenStatu(setStatu); @@ -112,10 +122,15 @@ /// </summary> public override void SendStatuComand() { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendLightStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs index ac16b4d..3fa9a7c 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceTemperatureRowControl.cs @@ -29,6 +29,11 @@ /// </summary> public override void SendStatuComand() { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs b/ZigbeeApp/Shared/Phone/Category/SelectFloorForm.cs similarity index 72% rename from ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs rename to ZigbeeApp/Shared/Phone/Category/SelectFloorForm.cs index 8779c91..29e69c7 100755 --- a/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs +++ b/ZigbeeApp/Shared/Phone/Category/SelectFloorForm.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using Shared.Common; -namespace Shared.Phone.Device.Category +namespace Shared.Phone.Category { - public class SelectFloor : FrameLayout + public class SelectFloorForm : UserCenter.FrameLayoutBase { public Action<string> FloorAction; @@ -22,7 +22,7 @@ /// <summary> /// Init /// </summary> - public void Init(int x, int y, CommonForm.Direction direction = CommonForm.Direction.Left) + public void Init(int x, int y, Device.CommonForm.Direction direction = Device.CommonForm.Direction.Left) { dialogBackground = new Dialog { @@ -43,8 +43,8 @@ { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), - Width = Application.GetMinRealAverage(449), - Height = Application.GetMinRealAverage(773), + Width = this.GetPictrueRealSize(449), + Height = this.GetPictrueRealSize(773), UnSelectedImagePath = "Floor/SelectFloor_Left_4.png" }; dialog.AddChidren(bg); @@ -53,16 +53,16 @@ { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y + 23), - Width = Application.GetMinRealAverage(449), - Height = Application.GetMinRealAverage(773 - 23) + Width = this.GetPictrueRealSize(449), + Height = this.GetPictrueRealSize(773 - 23) }; dialog.AddChidren(backgroundFL); var tip = new Button { X = Application.GetRealWidth(80), - Width = Application.GetMinRealAverage(350), - Height = Application.GetMinRealAverage(150), + Width = this.GetPictrueRealSize(350), + Height = this.GetPictrueRealSize(150), TextColor = ZigbeeColor.Current.GXCTextBlackColor, TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.SelectFloor, @@ -74,8 +74,8 @@ var floorLayout = new VerticalScrolViewLayout { Y = tip.Bottom, - Width = Application.GetMinRealAverage(449), - Height = Application.GetMinRealAverage(600), + Width = this.GetPictrueRealSize(449), + Height = this.GetPictrueRealSize(600), VerticalScrollBarEnabled = false }; backgroundFL.AddChidren(floorLayout); @@ -85,7 +85,7 @@ if (floorCount > 0) { string directStr = string.Empty; - if (direction == CommonForm.Direction.Right) + if (direction == Device.CommonForm.Direction.Right) { directStr = "Right"; } @@ -97,16 +97,16 @@ if (floorCount > 5) { bg.UnSelectedImagePath = $"Floor/SelectFloor_{directStr}_5.png"; - bg.Height = Application.GetMinRealAverage(150*6+23); - backgroundFL.Height = Application.GetMinRealAverage(150 * 6); - floorLayout.Height = Application.GetMinRealAverage(150 * 5); + bg.Height = this.GetPictrueRealSize(150*6+23); + backgroundFL.Height = this.GetPictrueRealSize(150 * 6); + floorLayout.Height = this.GetPictrueRealSize(150 * 5); } else { bg.UnSelectedImagePath = $"Floor/SelectFloor_{directStr}_{floorCount}.png"; - bg.Height = Application.GetMinRealAverage(150 * (floorCount + 1)+23); - backgroundFL.Height = Application.GetMinRealAverage(150 * (floorCount + 1)); - floorLayout.Height = Application.GetMinRealAverage(150 * floorCount); + bg.Height = this.GetPictrueRealSize(150 * (floorCount + 1)+23); + backgroundFL.Height = this.GetPictrueRealSize(150 * (floorCount + 1)); + floorLayout.Height = this.GetPictrueRealSize(150 * floorCount); } foreach (var floor in Config.Instance.Home.FloorDics) @@ -122,9 +122,9 @@ /// <param name="verticalScrolView"></param> private void AddFloor(VerticalScrolViewLayout verticalScrolView, KeyValuePair<string, string> floor,bool isLast=false) { - var frow = new CommonForm.LeftIconButtonRow(449, 150); - frow.Width = Application.GetMinRealAverage(449); - frow.Height = Application.GetMinRealAverage(150); + var frow = new Device.CommonForm.LeftIconButtonRow(449, 150); + frow.Width = this.GetPictrueRealSize(449); + frow.Height = this.GetPictrueRealSize(150); frow.Tag = floor.Key; frow.Init("Floor/Floor.png", "Floor/FloorSelected.png", floor.Value); verticalScrolView.AddChidren(frow); @@ -154,15 +154,15 @@ /// <param name="mouseEventArgs"></param> private void SelectFloor_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) { - (sender as CommonForm.LeftIconButtonRow).IsSelected = true; + (sender as Device.CommonForm.LeftIconButtonRow).IsSelected = true; if (changeFloor) { - Config.Instance.Home.CurrentFloorId = (sender as CommonForm.LeftIconButtonRow).Tag.ToString(); + Config.Instance.Home.CurrentFloorId = (sender as Device.CommonForm.LeftIconButtonRow).Tag.ToString(); Config.Instance.Home.Save(false); UserCenter.HdlRoomLogic.Current.RefreshRoomListView(); } RemoveView(); - FloorAction?.Invoke((sender as CommonForm.LeftIconButtonRow).Tag.ToString()); + FloorAction?.Invoke((sender as Device.CommonForm.LeftIconButtonRow).Tag.ToString()); } diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectHouse.cs b/ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs similarity index 71% rename from ZigbeeApp/Shared/Phone/Device/Category/SelectHouse.cs rename to ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs index 37dc7ef..1383415 100755 --- a/ZigbeeApp/Shared/Phone/Device/Category/SelectHouse.cs +++ b/ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using Shared.Common; -namespace Shared.Phone.Device.Category +namespace Shared.Phone.Category { - public class SelectHouse : FrameLayout + public class SelectHouseForm : UserCenter.FrameLayoutBase { public Action<string> HouseAction; @@ -33,8 +33,8 @@ { X = Application.GetRealWidth(35), Y = Application.GetRealHeight(256), - Width = Application.GetMinRealAverage(449), - Height = Application.GetMinRealAverage(773), + Width = this.GetPictrueRealSize(449), + Height = this.GetPictrueRealSize(773), UnSelectedImagePath = "Floor/SelectFloor_Left_4.png" }; dialog.AddChidren(bg); @@ -43,16 +43,16 @@ { X = Application.GetRealWidth(35), Y = Application.GetRealHeight(256+23), - Width = Application.GetMinRealAverage(449), - Height = Application.GetMinRealAverage(773 - 23) + Width = this.GetPictrueRealSize(449), + Height = this.GetPictrueRealSize(773 - 23) }; dialog.AddChidren(changeHomeFL); var changeHomeBtn = new Button() { X = Application.GetRealWidth(80), - Width = Application.GetMinRealAverage(350), - Height = Application.GetMinRealAverage(150), + Width = this.GetPictrueRealSize(350), + Height = this.GetPictrueRealSize(150), TextColor = ZigbeeColor.Current.GXCTextBlackColor, TextID = R.MyInternationalizationString.ChangeHome, TextAlignment = TextAlignment.CenterLeft, @@ -64,8 +64,8 @@ var scrolView = new VerticalScrolViewLayout() { Y = changeHomeBtn.Bottom, - Width = Application.GetMinRealAverage(449), - Height = Application.GetMinRealAverage(600), + Width = this.GetPictrueRealSize(449), + Height = this.GetPictrueRealSize(600), VerticalScrollBarEnabled = false }; changeHomeFL.AddChidren(scrolView); @@ -76,16 +76,16 @@ if (houseCount > 5) { bg.UnSelectedImagePath = $"Floor/SelectFloor_Left_5.png"; - bg.Height = Application.GetMinRealAverage(150 * 6 + 23); - changeHomeFL.Height = Application.GetMinRealAverage(150 * 6); - scrolView.Height = Application.GetMinRealAverage(150 * 5); + bg.Height = this.GetPictrueRealSize(150 * 6 + 23); + changeHomeFL.Height = this.GetPictrueRealSize(150 * 6); + scrolView.Height = this.GetPictrueRealSize(150 * 5); } else { bg.UnSelectedImagePath = $"Floor/SelectFloor_Left_{houseCount}.png"; - bg.Height = Application.GetMinRealAverage(150 * (houseCount + 1) + 23); - changeHomeFL.Height = Application.GetMinRealAverage(150 * (houseCount + 1)); - scrolView.Height = Application.GetMinRealAverage(150 * houseCount); + bg.Height = this.GetPictrueRealSize(150 * (houseCount + 1) + 23); + changeHomeFL.Height = this.GetPictrueRealSize(150 * (houseCount + 1)); + scrolView.Height = this.GetPictrueRealSize(150 * houseCount); } foreach (var housePath in Config.Instance.HomeFilePathList) @@ -106,9 +106,9 @@ /// <param name="verticalScrolView"></param> private void AddFloor(VerticalScrolViewLayout verticalScrolView, House house) { - var frow = new CommonForm.LeftIconButtonRow(449, 150); - frow.Width = Application.GetMinRealAverage(449); - frow.Height = Application.GetMinRealAverage(150); + var frow = new Device.CommonForm.LeftIconButtonRow(449, 150); + frow.Width = this.GetPictrueRealSize(449); + frow.Height = this.GetPictrueRealSize(150); frow.Tag = house.FileName; frow.Init("Item/House.png", "Item/HouseSelected.png", house.Name); verticalScrolView.AddChidren(frow); @@ -127,8 +127,8 @@ /// <param name="mouseEventArgs"></param> private void SelectFloor_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) { - (sender as CommonForm.LeftIconButtonRow).IsSelected = true; - var home = House.GetHouseByFilePath((sender as CommonForm.LeftIconButtonRow).Tag.ToString()); + (sender as Device.CommonForm.LeftIconButtonRow).IsSelected = true; + var home = House.GetHouseByFilePath((sender as Device.CommonForm.LeftIconButtonRow).Tag.ToString()); RemoveView(); HouseAction?.Invoke(home.Id); } diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/CompleteButton.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/CompleteButton.cs deleted file mode 100755 index dbc70fa..0000000 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/CompleteButton.cs +++ /dev/null @@ -1,51 +0,0 @@ -锘縰sing System; -using Shared.Common; -namespace Shared.Phone.Device.CommonForm -{ - /// <summary> - /// Complete button. - /// <para>榛樿鏂囧瓧锛� 瀹屾垚 </para> - /// <para>鐧借壊瀛椾綋</para> - /// <para>榛戣壊鑳屾櫙</para> - /// <para>鏂囧瓧灞呬腑</para> - /// <para>榛樿瀛楀彿澶у皬</para> - /// </summary> - public class CompleteButton:Button - { - /// <summary> - /// CompleteButton - /// </summary> - /// <param name="y"></param> - /// <param name="width"></param> - /// <param name="height"></param> - public CompleteButton(int y, int width, int height) - { - this.Y = Application.GetRealHeight(y); - this.Width = Application.GetRealWidth(width); - this.Height = Application.GetRealHeight(height); - TextID = R.MyInternationalizationString.Complete; - BackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor; - TextColor = ZigbeeColor.Current.GXCTextWhiteColor; - IsBold = true; - TextSize = 16; - Gravity = Gravity.CenterHorizontal; - Radius = (uint)Application.GetRealHeight(height / 2); - } - /// <summary> - /// SetTitle - /// </summary> - /// <param name="title"></param> - public void SetTitle(string title) - { - Text = title; - } - /// <summary> - /// SetTitle - /// </summary> - /// <param name="title"></param> - public void SetTitle(int title) - { - SetTitle(Language.StringByID(title)); - } - } -} diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceIconSelectedIMGByLocal.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceIconSelectedIMGByLocal.cs deleted file mode 100755 index e9ec72d..0000000 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceIconSelectedIMGByLocal.cs +++ /dev/null @@ -1,126 +0,0 @@ -锘縰sing System; -using Shared.Common; - -namespace Shared.Phone.Device.CommonForm -{ - public class DeviceIconSelectedIMGByLocal:FrameLayout - { - /// <summary> - /// bodyFrameLayout - /// </summary> - private FrameLayout bodyFrameLayout; - /// <summary> - /// action - /// </summary> - public Action<string,string > action; - /// <summary> - /// tempIcon - /// </summary> - private FunctionIconButton tempIcon; - - /// <summary> - /// DeviceIconSelectedIMGByLocal - /// </summary> - public DeviceIconSelectedIMGByLocal() - { - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; - } - - /// <summary> - /// RemoveFromParent - /// </summary> - public override void RemoveFromParent() - { - base.RemoveFromParent(); - } - - /// <summary> - /// Show - /// </summary> - public void Show() - { - AddTop(); - - AddBodyView(); - } - - #region Add____________________________________ - - /// <summary> - /// AddTop - /// </summary> - public void AddTop() - { - var top = new TopFrameLayout(); - AddChidren(top); - top.InitTopview(); - top.SetTopTitle(R.MyInternationalizationString.SelectIcon); - top.backButton.MouseUpEventHandler += (sender, e) => - { - RemoveFromParent(); - }; - } - /// <summary> - /// AddBodyView - /// </summary> - public void AddBodyView() - { - bodyFrameLayout = new FrameLayout() - { - Y = Application.GetRealHeight(184), - Height = Application.GetRealHeight(1737), - BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor - }; - AddChidren(bodyFrameLayout); - - //FunctionIconButton - var scrollView = new VerticalScrolViewLayout() - { - Height = Application.GetRealHeight(1450), - BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor - }; - bodyFrameLayout.AddChidren(scrollView); - - int k = 1; - tempIcon = new FunctionIconButton(); - for (int j = 0; j < 5; j++) - { - var itemView = new FrameLayout() - { - Height = Application.GetRealHeight(207 + CommonPage.XLeft) - }; - scrollView.AddChidren(itemView); - for (int i = 0; i < 4; i++) - { - var icon = new FunctionIconButton(58+ i*(207+46), 58); - icon.Init($"FunctionIcon/{k}Icon.png", $"FunctionIcon/{k}IconSelected.png"); - itemView.AddChidren(icon); - k++; - - EventHandler<MouseEventArgs> selectIcon = (sender, e) => - { - ((sender as Button).Parent as FunctionIconButton).IsSelected = true; - tempIcon.IsSelected = false; - tempIcon = (sender as Button).Parent as FunctionIconButton; - }; - icon.ImageBG.MouseUpEventHandler += selectIcon; - icon.ImageBtn.MouseUpEventHandler += selectIcon; - } - } - - var confirmBtn = new CommonForm.CompleteButton(1472, 907, 127); - confirmBtn.SetTitle(R.MyInternationalizationString.Save); - bodyFrameLayout.AddChidren(confirmBtn); - confirmBtn.MouseUpEventHandler += (sender, e) => - { - if (tempIcon.ImageBtn != null) - { - action(tempIcon.ImageBtn.UnSelectedImagePath, tempIcon.ImageBtn.SelectedImagePath); - } - RemoveFromParent(); - }; - } - - #endregion - } -} diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceInfoRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceInfoRow.cs deleted file mode 100755 index 397eb92..0000000 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceInfoRow.cs +++ /dev/null @@ -1,166 +0,0 @@ -锘縰sing System; -using Shared.Common; -namespace Shared.Phone.Device.CommonForm -{ - public class DeviceInfoRow : FrameLayout - { - /// <summary> - /// TipBtn - /// </summary> - public Button TipBtn; - /// <summary> - /// NameText - /// </summary> - public Button NameText; - /// <summary> - /// NextBtn - /// </summary> - public Button NextBtn; - /// <summary> - /// ClickBtn - /// </summary> - public Button ClickBtn; - /// <summary> - /// line - /// </summary> - private Button line; - - /// <summary> - /// DeviceInfoEditRow - /// </summary> - public DeviceInfoRow(int y) - { - X = Application.GetRealWidth(0); - Y = Application.GetRealHeight(y); - Width = Application.GetRealWidth(1080); - Height = Application.GetRealHeight(127); - } - - /// <summary> - /// Init - /// </summary> - public void Init() - { - TipBtn = new Button - { - X = Application.GetRealWidth(CommonFormResouce.X_Left), - Width = Application.GetRealWidth(223), - Height = Application.GetRealHeight(80), - Gravity = Gravity.CenterVertical, - TextColor = ZigbeeColor.Current.GXCTextBlackColor, - TextAlignment = TextAlignment.CenterLeft, - TextSize=CommonFormResouce.TextSize - }; - AddChidren(TipBtn); - - NameText = new Button - { - X = Application.GetRealWidth(300), - Width = Application.GetRealWidth(650), - Height = Application.GetRealHeight(80), - Gravity = Gravity.CenterVertical, - TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CommonFormResouce.TextSize - }; - AddChidren(NameText); - - NextBtn = new Button - { - X = Application.GetRealWidth(910), - Width = Application.GetMinRealAverage(100), - Height = Application.GetMinRealAverage(100), - Gravity = Gravity.CenterVertical, - SelectedImagePath= "Item/NextSelected.png", - UnSelectedImagePath= "Item/Next.png" - }; - AddChidren(NextBtn); - - line = new Button() - { - X = Application.GetRealWidth(CommonFormResouce.X_Left), - Y = Height - 1, - Width = Application.GetRealWidth(965), - Height = 1, - BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2, - }; - AddChidren(line); - - ClickBtn = new Button(); - AddChidren(ClickBtn); - } - - /// <summary> - /// SetTitle - /// </summary> - /// <param name="title"></param> - public void SetTitle(string title) - { - NameText.Text = title; - } - - /// <summary> - /// SetTitle - /// </summary> - /// <param name="title"></param> - public void SetTitle(int title) - { - SetTitle(Language.StringByID(title)); - } - - /// <summary> - /// SetTitleColor - /// </summary> - /// <param name="color"></param> - public void SetTitleColor(uint color) - { - NameText.TextColor = color; - } - - - /// <summary> - /// SetName - /// </summary> - /// <param name="title"></param> - public void SetTipTitle(string title) - { - TipBtn.Text = title; - } - - /// <summary> - /// SetTipTitle - /// </summary> - /// <param name="title"></param> - public void SetTipTitle(int title) - { - SetTipTitle(Language.StringByID(title)); - } - - /// <summary> - /// HideLine - /// </summary> - /// <param name="hiden"></param> - public void HideLine(bool hiden) - { - line.Visible = !hiden; - } - - /// <summary> - /// HideNext - /// </summary> - /// <param name="hiden"></param> - public void HideNext(bool hiden) - { - NextBtn.Visible = !hiden; - } - - /// <summary> - /// CanClick - /// </summary> - /// <param name="canClick"></param> - public void CanClick(bool canClick) - { - ClickBtn.Enable = canClick; - } - } -} diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionIconButton.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionIconButton.cs deleted file mode 100755 index ac6d475..0000000 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionIconButton.cs +++ /dev/null @@ -1,92 +0,0 @@ -锘縰sing System; -using Shared.Common; - -namespace Shared.Phone.Device.CommonForm -{ - public class FunctionIconButton : FrameLayout - { - - /// <summary> - /// Image - /// </summary> - public Button ImageBtn; - /// <summary> - /// ImageBG - /// </summary> - public Button ImageBG; - /// <summary> - /// v_Selected - /// </summary> - private bool v_Selected; - /// <summary> - /// IsSelected - /// </summary> - public bool IsSelected - { - set - { - try - { - v_Selected = value; - SetStatu(v_Selected); - } - catch { }; - } - get - { - return v_Selected; - } - } - - /// <summary> - /// FunctionIconButton - /// </summary> - /// <param name="x"></param> - /// <param name="y"></param> - public FunctionIconButton(int x = 0, int y = 0) - { - X = Application.GetRealWidth(x); - Y = Application.GetRealHeight(y); - Width = Application.GetRealWidth(207); - Height = Application.GetRealHeight(207); - } - - /// <summary> - /// Init - /// </summary> - /// <param name="imagePath"></param> - /// <param name="selectedImagePath"></param> - public void Init(string imagePath, string selectedImagePath) - { - ImageBG = new Button() - { - Width = Application.GetRealWidth(207), - Height = Application.GetRealWidth(207), - Gravity = Gravity.Center, - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, - SelectedBackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor, - Radius = (uint)Application.GetRealWidth(207 / 2) - }; - AddChidren(ImageBG); - - ImageBtn = new Button() - { - Width = Application.GetMinRealAverage(114), - Height = Application.GetMinRealAverage(114), - Gravity = Gravity.Center, - UnSelectedImagePath = imagePath, - SelectedImagePath = selectedImagePath, - }; - AddChidren(ImageBtn); - } - - /// <summary> - /// SetStatu - /// </summary> - /// <param name="statu"></param> - public void SetStatu(bool statu) - { - ImageBG.IsSelected = ImageBtn.IsSelected = statu; - } - } -} diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs index ac65aa1..44418be 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs @@ -2,7 +2,7 @@ using Shared.Common; namespace Shared.Phone.Device.CommonForm { - public class LeftIconButtonRow:FrameLayout + public class LeftIconButtonRow: UserCenter.FrameLayoutBase { #region 鈼� 鍙橀噺__________________________ /// <summary> @@ -70,8 +70,8 @@ IconButton = new Button() { X = Application.GetRealWidth(80), - Height = Application.GetMinRealAverage(80), - Width = Application.GetMinRealAverage(80), + Height = this.GetPictrueRealSize(80), + Width = this.GetPictrueRealSize(80), UnSelectedImagePath = iconPath, SelectedImagePath = iconSelectedPath, Gravity = Gravity.CenterVertical, diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs index d9e47fd..9a5f16c 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs @@ -1,12 +1,11 @@ 锘縰sing System; using Shared.Common; -using Shared.Phone.Device.DeviceLogic; using Shared.Phone.UserCenter; using ZigBee.Device; namespace Shared.Phone.Device.CommonForm { - public class RoomView : FrameLayout + public class RoomView : FrameLayoutBase { /// <summary> /// Room @@ -22,12 +21,12 @@ Button temperatureText; Button humidityText; - /// <summary> - /// 娓╁害璁惧 + /// <summary> + /// 娓╁害璁惧 /// </summary> private CommonDevice temperDevice = null; - /// <summary> - /// 婀垮害璁惧 + /// <summary> + /// 婀垮害璁惧 /// </summary> private CommonDevice humidDevice = null; @@ -122,8 +121,8 @@ var temperatureIcon = new Button { X = Application.GetRealWidth(12), - Width = Application.GetMinRealAverage(58), - Height = Application.GetMinRealAverage(58), + Width = this.GetPictrueRealSize(58), + Height = this.GetPictrueRealSize(58), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Room/Temperature.png" }; @@ -138,8 +137,8 @@ TextAlignment = TextAlignment.CenterLeft }; if (LocalDevice.Current.GetDevice(room.TemperatrueDevice) != null) - { - //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� + { + //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� temperatureText.Text = room.Temperatrue == 0 ? "0.0鈩�" : room.Temperatrue.ToString() + "鈩�"; } roomTemperatureBackground.AddChidren(temperatureText); @@ -148,8 +147,8 @@ var humidityIcon = new Button { X = temperatureText.Right, - Width = Application.GetMinRealAverage(58), - Height = Application.GetMinRealAverage(58), + Width = this.GetPictrueRealSize(58), + Height = this.GetPictrueRealSize(58), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Room/Humidity.png" }; @@ -164,8 +163,8 @@ TextAlignment = TextAlignment.CenterLeft }; if (LocalDevice.Current.GetDevice(room.HumidityDevice) != null) - { - //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� + { + //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� humidityText.Text = room.Humidity == 0 ? "0.0%" : room.Humidity.ToString() + "%"; } roomTemperatureBackground.AddChidren(humidityText); @@ -173,24 +172,24 @@ roomTemperatureBackground.Width = (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)) > Application.GetRealWidth(600) ? Application.GetRealWidth(600) : (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)); if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) - { + { //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护 var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); - ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(dev); + HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(dev); } if (string.IsNullOrEmpty(room.HumidityDevice) == false) { var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); - ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(dev); + HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(dev); } roomListBtn = new Button() { X = roomBackView.Width - Application.GetRealWidth(100 + 20), Y = Application.GetRealHeight(20), - Width = Application.GetMinRealAverage(100), - Height = Application.GetMinRealAverage(100), + Width = this.GetPictrueRealSize(100), + Height = this.GetPictrueRealSize(100), UnSelectedImagePath = "Room/List.png", }; roomBackView.AddChidren(roomListBtn); @@ -201,50 +200,50 @@ var form = new UserCenter.Residence.EditorRoomInforForm(); form.AddForm(room); - form.FinishEditorEvent += (roomName2) => - { - //閲嶆柊鍒锋柊鎺т欢 - this.Init(this.room); + form.FinishEditorEvent += (roomName2) => + { + //閲嶆柊鍒锋柊鎺т欢 + this.Init(this.room); }; }; //璁惧灞炴�т笂鎶� - HdlGatewayReceiveLogic.Current.AddAttributeEvent("RoomView" + this.room.Id, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) => + HdlGatewayReceiveLogic.Current.AddAttributeEvent("RoomView" + this.room.Id, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) => { - if (this.temperDevice != null) - { - //娓╁害璁惧 - if (report.DeviceAddr == temperDevice.DeviceAddr && report.DeviceEpoint == temperDevice.DeviceEpoint) - { - HdlThreadLogic.Current.RunMain(() => - { - if (((TemperatureSensor)temperDevice).Temperatrue == 0) - { - temperatureText.Text = "0.0鈩�"; - } - else - { - temperatureText.Text = ((TemperatureSensor)temperDevice).Temperatrue + "鈩�"; - } - }, ShowErrorMode.NO); - } + if (this.temperDevice != null) + { + //娓╁害璁惧 + if (report.DeviceAddr == temperDevice.DeviceAddr && report.DeviceEpoint == temperDevice.DeviceEpoint) + { + HdlThreadLogic.Current.RunMain(() => + { + if (((TemperatureSensor)temperDevice).Temperatrue == 0) + { + temperatureText.Text = "0.0鈩�"; + } + else + { + temperatureText.Text = ((TemperatureSensor)temperDevice).Temperatrue + "鈩�"; + } + }, ShowErrorMode.NO); + } } - if (this.humidDevice != null) - { - //婀垮害璁惧 - if (report.DeviceAddr == humidDevice.DeviceAddr && report.DeviceEpoint == humidDevice.DeviceEpoint) - { - HdlThreadLogic.Current.RunMain(() => - { - if (((TemperatureSensor)temperDevice).Humidity == 0) - { - humidityText.Text = "--%"; - } - else - { - humidityText.Text = ((TemperatureSensor)temperDevice).Humidity + "%"; - } - }, ShowErrorMode.NO); - } + if (this.humidDevice != null) + { + //婀垮害璁惧 + if (report.DeviceAddr == humidDevice.DeviceAddr && report.DeviceEpoint == humidDevice.DeviceEpoint) + { + HdlThreadLogic.Current.RunMain(() => + { + if (((TemperatureSensor)temperDevice).Humidity == 0) + { + humidityText.Text = "--%"; + } + else + { + humidityText.Text = ((TemperatureSensor)temperDevice).Humidity + "%"; + } + }, ShowErrorMode.NO); + } } }); } @@ -255,15 +254,15 @@ public void HideName(bool statu) { roomNameBackground.Visible = roomTemperatureBackground.Visible = roomListBtn.Visible = !statu; - } - - /// <summary> - /// - /// </summary> - public override void RemoveFromParent() - { - HdlGatewayReceiveLogic.Current.RemoveEvent("RoomView" + this.room.Id); - base.RemoveFromParent(); + } + + /// <summary> + /// + /// </summary> + public override void RemoveFromParent() + { + HdlGatewayReceiveLogic.Current.RemoveEvent("RoomView" + this.room.Id); + base.RemoveFromParent(); } } } diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs index c12c3c5..045ed5d 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneCategoryView.cs @@ -1,30 +1,29 @@ -锘縰sing System; -using System.Collections.Generic; -using Shared.Common; -using Shared.Phone.Device.Category; -using Shared.Phone.UserCenter; - -namespace Shared.Phone.Device.CommonForm -{ - public class SceneCategoryView : RowLayout +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using Shared.Phone.UserCenter; + +namespace Shared.Phone.Device.CommonForm +{ + public class SceneCategoryView : RowLayoutBase { - #region 鈻� 鍙橀噺澹版槑___________________________ - - /// <summary> - /// scene - /// </summary> - public SceneUI scene; - /// <summary> - /// room - /// </summary> - private Common.Room room; - /// <summary> - /// 寤舵椂鏃堕棿 - /// </summary> - private NormalViewControl btnDelayTime; - /// <summary> - /// 寤舵椂鍥炬爣 - /// </summary> + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// scene + /// </summary> + public SceneUI scene; + /// <summary> + /// room + /// </summary> + private Common.Room room; + /// <summary> + /// 寤舵椂鏃堕棿 + /// </summary> + private NormalViewControl btnDelayTime; + /// <summary> + /// 寤舵椂鍥炬爣 + /// </summary> private IconViewControl btnDelayIcon; /// <summary> /// 鍦烘櫙鍥剧墖鎺т欢 @@ -35,19 +34,19 @@ /// </summary> private bool isInitControlFinish = false; - #endregion + #endregion #region 鈻� 鍒濆鍖朹____________________________ - /// <summary> - /// SceneCategoryView - /// </summary> - public SceneCategoryView() - { - this.Width = Application.GetRealWidth(1080); - this.Height = Application.GetRealHeight(397 + 46); - this.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor; - this.IsUseSameSubViewWidth = false; + /// <summary> + /// SceneCategoryView + /// </summary> + public SceneCategoryView() + { + this.Width = Application.GetRealWidth(1080); + this.Height = Application.GetRealHeight(397 + 46); + this.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor; + this.IsUseSameSubViewWidth = false; } /// <summary> @@ -60,47 +59,47 @@ this.LineColor = UserCenterColor.Current.Transparent; - this.scene = i_scene; + this.scene = i_scene; this.room = i_room; - //鑷畾涔夌殑鍦烘櫙鍥剧墖鎺т欢 + //鑷畾涔夌殑鍦烘櫙鍥剧墖鎺т欢 this.sceneContr = new ScenePictrueControl(); - this.AddChidren(sceneContr); - sceneContr.InitControl(this.scene); + this.AddChidren(sceneContr); + sceneContr.InitControl(this.scene); //鍦烘櫙鐐瑰嚮 sceneContr.ButtonClickEvent += (sender, e) => { this.SceneUpHandler(); - }; - - //鏀惰棌 - sceneContr.AddCollectionControl(); + }; + + //鏀惰棌 + sceneContr.AddCollectionControl(); sceneContr.CollectEvent += (collect) => { - if (room.IsLove) - { - this.RemoveFromParent(); + if (room.IsLove) + { + this.RemoveFromParent(); } - }; - - //寤舵椂鏃堕棿 - this.btnDelayTime = new NormalViewControl(200, 58, true); - btnDelayTime.X = Application.GetRealWidth(780); - btnDelayTime.Y = Application.GetRealHeight(317); - btnDelayTime.Text = CommonFormResouce.GetTimeString(scene.SceneDelayTime); + }; + + //寤舵椂鏃堕棿 + this.btnDelayTime = new NormalViewControl(400, 58, true); + btnDelayTime.X = Application.GetRealWidth(580); + btnDelayTime.Y = Application.GetRealHeight(317); + btnDelayTime.Text = CommonFormResouce.GetTimeString(scene.SceneDelayTime); btnDelayTime.TextAlignment = TextAlignment.CenterRight; - btnDelayTime.TextColor = ZigbeeColor.Current.GXCTextSelectedColor3; - btnDelayTime.IsBold = true; - this.AddChidren(btnDelayTime); - - //寤舵椂鍥炬爣 + btnDelayTime.TextColor = ZigbeeColor.Current.GXCTextSelectedColor3; + btnDelayTime.IsBold = true; + this.AddChidren(btnDelayTime); + + //寤舵椂鍥炬爣 this.btnDelayIcon = new IconViewControl(52); btnDelayIcon.X = Application.GetRealWidth(900); - btnDelayIcon.Y = Application.GetRealHeight(30); - btnDelayIcon.Width = Application.GetMinRealAverage(52); - btnDelayIcon.Height = Application.GetMinRealAverage(52); - btnDelayIcon.UnSelectedImagePath = "Scene/Delaying.png"; + btnDelayIcon.Y = Application.GetRealHeight(30); + btnDelayIcon.Width = this.GetPictrueRealSize(52); + btnDelayIcon.Height = this.GetPictrueRealSize(52); + btnDelayIcon.UnSelectedImagePath = "Scene/Delaying.png"; this.AddChidren(btnDelayIcon); btnDelayIcon.Visible = false; @@ -117,14 +116,14 @@ this.AddLeftView(btnTemp1); //瀹氭椂 var btnDelay = new NormalViewControl(Application.GetRealWidth(199), sceneContr.btnScenePic.Height, false); - btnDelay.BackgroundColor = ZigbeeColor.Current.GXCTextSelectedColor; - btnDelay.TextID = R.MyInternationalizationString.Delay; - btnDelay.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; - btnDelay.TextAlignment = TextAlignment.Center; - btnDelay.Tag = scene.SceneDelayTime; - btnDelay.Radius = (uint)Application.GetRealHeight(17); - btnDelay.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight | - HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); + btnDelay.BackgroundColor = ZigbeeColor.Current.GXCTextSelectedColor; + btnDelay.TextID = R.MyInternationalizationString.Delay; + btnDelay.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; + btnDelay.TextAlignment = TextAlignment.Center; + btnDelay.Tag = scene.SceneDelayTime; + btnDelay.Radius = (uint)Application.GetRealHeight(17); + btnDelay.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight | + HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); this.AddLeftView(btnDelay); //鍙樻洿鎸夐挳鐨勯珮搴� btnDelay.Height = sceneContr.btnScenePic.Height; @@ -132,23 +131,23 @@ //缂栬緫 var btnEditor = new NormalViewControl(Application.GetRealWidth(199), sceneContr.btnScenePic.Height, false); - btnEditor.BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor; - btnEditor.TextID = R.MyInternationalizationString.Edit; - btnEditor.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; - btnEditor.TextAlignment = TextAlignment.Center; + btnEditor.BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor; + btnEditor.TextID = R.MyInternationalizationString.Edit; + btnEditor.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; + btnEditor.TextAlignment = TextAlignment.Center; btnEditor.Tag = scene.SceneDelayTime; btnEditor.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerTopLeft); //鍒犻櫎 - var btnDelete = new NormalViewControl(Application.GetRealWidth(199), sceneContr.btnScenePic.Height, false); - btnDelete.Tag = scene; - btnDelete.BackgroundColor = ZigbeeColor.Current.GXCRedColor; - btnDelete.TextID = R.MyInternationalizationString.Delete; - btnDelete.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; - btnDelete.TextAlignment = TextAlignment.Center; + var btnDelete = new NormalViewControl(Application.GetRealWidth(199), sceneContr.btnScenePic.Height, false); + btnDelete.Tag = scene; + btnDelete.BackgroundColor = ZigbeeColor.Current.GXCRedColor; + btnDelete.TextID = R.MyInternationalizationString.Delete; + btnDelete.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; + btnDelete.TextAlignment = TextAlignment.Center; btnDelete.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight); - if (room.IsSharedRoom == false && room.IsLove == false) + if (room.IsSharedRoom == false && room.IsLove == false) { //涓嶆槸鍒嗕韩,骞朵笖涓嶆槸鏀惰棌 this.AddRightView(btnEditor); @@ -156,20 +155,28 @@ //鍙樻洿鎸夐挳鐨勯珮搴� btnEditor.Height = sceneContr.btnScenePic.Height; btnEditor.Y = 0; - btnDelete.Height = sceneContr.btnScenePic.Height; - btnDelete.Y = 0; - //娣诲姞鍙宠竟绌虹櫧鍖哄煙 + btnDelete.Height = sceneContr.btnScenePic.Height; + btnDelete.Y = 0; + //娣诲姞鍙宠竟绌虹櫧鍖哄煙 var btnTemp2 = new NormalViewControl(Application.GetRealWidth(58), sceneContr.btnScenePic.Height, false); - this.AddRightView(btnTemp2); - } - - //鍒犻櫎鍦烘櫙 + this.AddRightView(btnTemp2); + } + + //鍒犻櫎鍦烘櫙 btnDelete.ButtonClickEvent += (sender, e) => { var alert = new ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.ConfirmDelete)); alert.Show(); alert.ConfirmClickEvent += async () => { + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //绉婚櫎缂撳瓨 + HdlSceneLogic.Current.DeleteLocalScene(scene); + RemoveFromParent(); + return; + } //0 绉婚櫎澶辫触 1 绉婚櫎鎴愬姛 2 娌℃湁璇ュ満鏅� var removeSceneAllData = await ZigBee.Device.Scene.DeleteSceneAsync(scene.Id); if (removeSceneAllData == null || removeSceneAllData.removeSceneData == null) @@ -180,7 +187,7 @@ //1鎴愬姛 if (removeSceneAllData.removeSceneData.Result == 1) { - HdlSceneLogic.Current.RemoveScene(scene); + HdlSceneLogic.Current.DeleteLocalScene(scene); RemoveFromParent(); } //0 绉婚櫎澶辫触 @@ -192,128 +199,128 @@ //2 娌℃湁璇ュ満鏅� else if (removeSceneAllData.removeSceneData.Result == 2) { - HdlSceneLogic.Current.RemoveScene(scene); + HdlSceneLogic.Current.DeleteLocalScene(scene); RemoveFromParent(); return; } }; - }; - - //缂栬緫鍦烘櫙 - btnEditor.ButtonClickEvent += (sender, e) => - { - //鍏抽棴宸︽粦鑿滃崟 - this.HideMenu(); - //缂栬緫鍦烘櫙 - var form = new Phone.Category.AddOrEditorSceneForm(); - form.AddForm(i_scene); - form.SceneChangedEvent = (myScene, roomId) => - { - if (roomId != room.Id) - { - //瀹冨彉鏇翠簡鎴块棿 - this.RemoveFromParent(); - } - else - { - this.InitControl(myScene, room); - } - }; - }; - //缂栬緫寤舵椂 - btnDelay.ButtonClickEvent += (sender, e) => - { - if (scene.RemainTime > 0) - { - CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying)); - return; - } - var timeSelect = new SelectTime(); - CommonPage.Instance.AddChidren(timeSelect); - timeSelect.TempTime = scene.SceneDelayTime; - timeSelect.Init(); - timeSelect.TimeAction = (t) => - { - //闅愯棌鍙冲垝鑿滃崟 - this.HideMenu(); - scene.SceneDelayTime = t; - btnDelayTime.Text = CommonFormResouce.GetTimeString(t); - }; + }; + + //缂栬緫鍦烘櫙 + btnEditor.ButtonClickEvent += (sender, e) => + { + //鍏抽棴宸︽粦鑿滃崟 + this.HideMenu(); + //缂栬緫鍦烘櫙 + var form = new Phone.Category.AddOrEditorSceneForm(); + form.AddForm(i_scene); + form.SceneChangedEvent = (myScene, roomId) => + { + if (roomId != room.Id) + { + //瀹冨彉鏇翠簡鎴块棿 + this.RemoveFromParent(); + } + else + { + this.InitControl(myScene, room); + } + }; + }; + //缂栬緫寤舵椂 + btnDelay.ButtonClickEvent += (sender, e) => + { + if (scene.RemainTime > 0) + { + CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying)); + return; + } + var timeSelect = new SelectTime(); + CommonPage.Instance.AddChidren(timeSelect); + timeSelect.TempTime = scene.SceneDelayTime; + timeSelect.Init(); + timeSelect.TimeAction = (t) => + { + //闅愯棌鍙冲垝鑿滃崟 + this.HideMenu(); + scene.SceneDelayTime = t; + btnDelayTime.Text = CommonFormResouce.GetTimeString(t); + }; }; } - #endregion - + #endregion + /// <summary> /// /// </summary> /// <param name="btnScenePic"></param> - /// <param name="btnSceneName"></param> - private async void SceneUpHandler() - { + /// <param name="btnSceneName"></param> + private async void SceneUpHandler() + { if (scene.SceneDelayTime <= 0 && scene.RemainTime <= 0) { //濡傛灉娌℃湁寤惰繜鐨勮瘽,鐩存帴寮�鍚疞oading鐗规晥 this.StartLoadingApreal(); - } - //璋冪敤鍦烘櫙 - var result = await HdlSceneLogic.Current.ControlScene(scene); - if (result == false) - { - return; - } - - scene.RemainTime = scene.SceneDelayTime; - scene.SceneDelayTime = 0; + } + //璋冪敤鍦烘櫙 + var result = await HdlSceneLogic.Current.ControlScene(scene); + if (result == false) + { + return; + } + + scene.RemainTime = scene.SceneDelayTime; + scene.SceneDelayTime = 0; if (scene.RemainTime <= 0) { return; - } + } int myRemainTime = scene.RemainTime; //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾) - HdlSceneLogic.Current.StartDelayTimeThread(scene); - - new System.Threading.Thread(() => - { - while (myRemainTime > 0 && this.Parent != null) - { - System.Threading.Thread.Sleep(1000); - Application.RunOnMainThread(() => - { - SetTimeText(CommonFormResouce.GetTimeString(scene.RemainTime)); - }); - myRemainTime--; - } - Application.RunOnMainThread(() => - { + HdlSceneLogic.Current.StartDelayTimeThread(scene); + + new System.Threading.Thread(() => + { + while (myRemainTime > 0 && this.Parent != null) + { + System.Threading.Thread.Sleep(1000); + Application.RunOnMainThread(() => + { + SetTimeText(CommonFormResouce.GetTimeString(scene.RemainTime)); + }); + myRemainTime--; + } + Application.RunOnMainThread(() => + { if (this.Parent != null) { SetTimeImage(); //鐩存帴寮�鍚疞oading鐗规晥 this.StartLoadingApreal(); - } - }); - }) - { IsBackground = true }.Start(); - } - - /// <summary> - /// SetTimeText - /// </summary> - /// <param name="name"></param> - public void SetTimeText(string name) - { - btnDelayIcon.Visible = true; - btnDelayTime.Text = name; - } - - /// <summary> - /// SetTimeImage - /// </summary> - public void SetTimeImage() - { - btnDelayIcon.Visible = false; - btnDelayTime.Text = string.Empty; + } + }); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// SetTimeText + /// </summary> + /// <param name="name"></param> + public void SetTimeText(string name) + { + btnDelayIcon.Visible = true; + btnDelayTime.Text = name; + } + + /// <summary> + /// SetTimeImage + /// </summary> + public void SetTimeImage() + { + btnDelayIcon.Visible = false; + btnDelayTime.Text = string.Empty; } /// <summary> @@ -350,8 +357,8 @@ frameBack1.RemoveFromParent(); frameBack2.RemoveFromParent(); }; - } - + } + /// <summary> /// 鑷畾涔夋帶浠�(闇�瑕佺殑瀹冪Щ闄や簨浠�) /// </summary> @@ -371,6 +378,6 @@ this.DisponeEvent?.Invoke(); this.DisponeEvent = null; } - } - } -} + } + } +} diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectTime.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectTime.cs index e9fe90d..5530536 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectTime.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectTime.cs @@ -4,7 +4,7 @@ namespace Shared.Phone.Device.CommonForm { - public class SelectTime:FrameLayout + public class SelectTime: UserCenter.FrameLayoutBase { public Action<int> TimeAction; @@ -166,8 +166,8 @@ var selectBtn = new Button { X = Application.GetRealWidth(942), - Width = Application.GetMinRealAverage(60), - Height=Application.GetMinRealAverage(60), + Width = this.GetPictrueRealSize(60), + Height=this.GetPictrueRealSize(60), Gravity=Gravity.CenterVertical, UnSelectedImagePath="Item/ItemSelected.png", Visible=false diff --git a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs deleted file mode 100644 index 746a189..0000000 --- a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs +++ /dev/null @@ -1,374 +0,0 @@ -锘縰sing System; -using ZigBee.Device; - -namespace Shared.Phone.Device.DeviceLogic -{ - public class ReadDeviceAttributeLogic - { - #region 鈼� 鍙橀噺____________________________ - /// <summary> - /// ReadDeviceAttributeLogic - /// </summary> - private static ReadDeviceAttributeLogic _instance; - /// <summary> - /// ReadDeviceAttributeLogic - /// </summary> - public static ReadDeviceAttributeLogic Instance - { - get - { - if (_instance == null) - { - _instance = new ReadDeviceAttributeLogic(); - } - return _instance; - } - } - - #endregion - - #region 鈼� 鏂伴____________________________ - /// <summary> - /// SendFreshAirStatuComand - /// </summary> - /// <param name="device">璁惧</param> - public void SendFreshAirStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - new System.Threading.Thread(() => - { - SendFreshAirFanStatuComand(device); - System.Threading.Thread.Sleep(300); - }) - { IsBackground = true }.Start(); - } - - /// <summary> - /// SendFanStatuComand - /// </summary> - /// <param name="device">璁惧</param> - private void SendFreshAirFanStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.FanControl }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.FanMode} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send("GetDeviceStatus", jObject.ToString()); - } - - #endregion - - #region 鈼� 绌鸿皟____________________________ - - /// <summary> - /// SendACStatuComand - /// </summary> - /// <param name="device">璁惧</param> - public void SendACStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - new System.Threading.Thread(() => - { - SendFanStatuComand(device); - System.Threading.Thread.Sleep(300); - SendThermostatStatuComand(device); - }) - { IsBackground = true }.Start(); - } - - /// <summary> - /// SendThermostatStatuComand - /// </summary> - /// <param name="device">璁惧</param> - public void SendThermostatStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.Thermostat }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.LocalTemperature} - }, - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.CoolingSetpoint} - }, - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.HeatingSetpoint} - }, - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.AutoSetpoint} - }, - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.SystemMode} - }, - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.AcModeSupport} - }, - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.CleanStatu} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); - } - - /// <summary> - /// SendFanStatuComand - /// </summary> - /// <param name="device">璁惧</param> - private void SendFanStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.FanControl }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.FanMode} - }, - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.FanSwing} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send("GetDeviceStatus", jObject.ToString()); - } - - #endregion - - #region 鈼� 绐楀笜____________________________ - /// <summary> - /// 鍙戦�佽幏鍙栫獥甯樼姸鎬佸懡浠� - /// </summary> - /// <param name="device">绐楀笜</param> - public void SendCurtainStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.WindowCovering }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.CurrentPositionLiftPercentage} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); - } - - #endregion - - #region 鈼� 鐏厜____________________________ - - /// <summary> - /// Light - /// </summary> - /// <param name="device"></param> - public void SendLightStatuComand(CommonDevice device) - { - SendSwitchStatuComand(device); - } - - /// <summary> - /// Light - /// </summary> - /// <param name="device"></param> - public void SendDimmableLightStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - new System.Threading.Thread(() => - { - SendSwitchStatuComand(device); - System.Threading.Thread.Sleep(300); - SendLevelStatuComand(device); - }) - { IsBackground = true }.Start(); - } - - /// <summary> - /// 鍙戦�佽幏鍙栫伅鍏夌姸鎬佸懡浠� - /// </summary> - /// <param name="device">绐楀笜</param> - private void SendSwitchStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.Switch }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.Switch} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); - } - - /// <summary> - /// 鍙戦�佽幏鍙栫伅鍏夌姸鎬佸懡浠� - /// </summary> - /// <param name="device">绐楀笜</param> - private void SendLevelStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.LevelControl }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.LevelControl} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); - } - - #endregion - - #region 鈼� 娓╂箍搴___________________________ - - /// <summary> - /// 璇诲彇娓╁害 - /// </summary> - /// <param name="device"></param> - public void SendTemperatureStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.TemperatureMeasurement }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.MeasuredValue} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); - } - - /// <summary> - /// 璇诲彇婀垮害 - /// </summary> - /// <param name="device"></param> - public void SendHumidityStatuComand(CommonDevice device) - { - if (device == null) - { - return; - } - var jObject = new Newtonsoft.Json.Linq.JObject - { - { "DeviceAddr",device.DeviceAddr }, - { "Epoint", device.DeviceEpoint }, - { "Cluster_ID", (int)Cluster_ID.RelativeHumidityMeasurement }, - { "Command", 108 } - }; - var attriBute = new Newtonsoft.Json.Linq.JArray - { - new Newtonsoft.Json.Linq.JObject - { - { "AttriButeId", (int)AttriButeId.MeasuredValue} - } - }; - var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; - jObject.Add("Data", data); - device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); - } - - #endregion - - } -} diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs index 27e8df6..3b5ffb5 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs @@ -303,9 +303,9 @@ foreach (var sceneId in scenelist) { var scene = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId); - if (scene == null) - { - continue; + if (scene == null) + { + continue; } var sceneFramelayout = new FrameLayout { diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs index 5ccee7d..8dbb478 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs @@ -535,7 +535,7 @@ Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1026"); Send.dictionary(deviceConditionsInfo, "AttriButeId", "0"); Send.dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣� - Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿娓╁害鍊�50鈩� + Send.dictionary(deviceConditionsInfo, "AttriButeData1", "5000");//榛樿娓╁害鍊�50鈩� Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0"); } else @@ -544,7 +544,7 @@ Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1029"); Send.dictionary(deviceConditionsInfo, "AttriButeId", "0"); Send.dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣� - Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿婀垮害鍊�50% + Send.dictionary(deviceConditionsInfo, "AttriButeData1", "5000");//榛樿婀垮害鍊�50% Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0"); } mUIPickerView.setNPicker(mList1, mList2, mList3); @@ -553,8 +553,10 @@ mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) => { + ///娓╁害杩涚巼杞崲*100 + var strValue = (int.Parse(mList2[s2]) * 100).ToString(); SelectedDeviceStatus = "TemperatureSensor"; - Send.dictionary(deviceConditionsInfo, "AttriButeData1", mList2[s2]); + Send.dictionary(deviceConditionsInfo, "AttriButeData1", strValue); switch (mList1[s1]) { case ">": @@ -620,8 +622,10 @@ break; } //鏌ユ壘绱㈠紩 - index1 = mList1.IndexOf(s); - index2 = mList2.IndexOf(devices["AttriButeData1"]); + index1 = mList1.IndexOf(s); + //杞崲娓╁害鍊�/100 + var dd = (int.Parse(devices["AttriButeData1"])/100).ToString(); + index2 = mList2.IndexOf(dd); } ///鏇存柊鏈�鏂扮姸鎬侊紱 diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs index 1c697dd..c593a35 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs @@ -85,13 +85,13 @@ } bool yes = false; for (int a = 0; a < logic.Accounts.Count; a++) - { - if (logic.Accounts[a]["MacAddr"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Epoint"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) - { - //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 - //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; - yes = false; - break; + { + if (logic.Accounts[a]["MacAddr"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Epoint"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) + { + //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 + //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; + yes = false; + break; } if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid) { @@ -246,13 +246,13 @@ { var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, Language.StringByID(MyInternationalizationString.doyouwanttodelete), - Language.StringByID(MyInternationalizationString.confrim)); - alert.Show(); - alert.ConfirmClickEvent += () => + Language.StringByID(MyInternationalizationString.confrim)); + alert.Show(); + alert.ConfirmClickEvent += () => { Common.Logic.LockLogicList.Remove(logic); Automationview(); - Send.DelLogic(logic.LogicId); + Send.DelLogic(logic.LogicId); }; }; diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs index 837877f..97b170b 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs @@ -499,16 +499,18 @@ s = "鈮�"; } break; - } + } + ///杞崲娓╁害鍊�/100 + string srtValue = (int.Parse(conditions["AttriButeData1"]) / 100).ToString(); if (conditions["Cluster_ID"] == "1026") { icon = "ZigeeLogic/temperature.png"; - state = s + conditions["AttriButeData1"] + "鈩�"; + state = s + srtValue + "鈩�"; } else { icon = "ZigeeLogic/humidity.png"; - state = s + conditions["AttriButeData1"] + "%"; + state = s + srtValue + "%"; } break; diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs index af09f9e..a893a4a 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs @@ -153,7 +153,7 @@ { if (Common.Logic.CurrentLogic.Actions[i]["LinkType"].ToString() == "8") { - if (Common.Logic.CurrentLogic.Actions[i]["DeviceAddr"].ToString() == common.DeviceAddr && Common.Logic.CurrentLogic.Actions[i]["Epoint"].ToString() == common.DeviceEpoint.ToString()) + if (Common.Logic.CurrentLogic.Actions[i]["DeviceAddr"].ToString() == common.DeviceAddr && Common.Logic.CurrentLogic.Actions[i]["Epoint"].ToString() =="200") { Common.Logic.CurrentLogic.Actions.RemoveAt(i); Common.Logic.CurrentLogic.Actions.Insert(i, actionsInfo); diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs index 13b3d18..6539d80 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs @@ -15,6 +15,10 @@ /// </summary> public static string _LockLogic = "LockLogic"; /// <summary> + ///- Sone闂ㄩ攣-鑱斿姩浜嬩欢鐨勫垽鏂瓧绗︿覆 + /// </summary> + public static string _SoneLogic = "SoneLogic"; + /// <summary> /// 鑷姩鍖栫殑-鏉′欢-鍒ゆ柇瀛楃涓� /// </summary> public static string Condition_Logic = "condition_logic"; diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs index 12f8acd..5df1e25 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs @@ -767,15 +767,20 @@ { succeed = true; CurrentLogic.LogicId = logicifon.LogicId; + if (LogicView.IfString._Logic == if_logic || LogicView.IfString._SoneLogic == if_logic) + { + //鑷姩鍖栭�昏緫鍒楄〃 + Common.Logic.LogicList.Add(CurrentLogic); + } if (LogicView.IfString._LockLogic == if_logic) { //闂ㄩ攣鑱斿姩浜嬩欢閫昏緫鍒楄〃 Common.Logic.LockLogicList.Add(CurrentLogic); } - else + if (LogicView.IfString._SoneLogic == if_logic) { - //鑷姩鍖栭�昏緫鍒楄〃 - Common.Logic.LogicList.Add(CurrentLogic); + //Sone闂ㄩ攣鑱斿姩浜嬩欢閫昏緫鍒楄〃 + Common.Logic.SoneLogicList.Add(CurrentLogic); } if (tag) @@ -802,34 +807,32 @@ //TipView("娣诲姞鑷姩鍖栧け璐�"); //return; } - + UserView.HomePage.Instance.RemoveViewByTag("Logic");//绉婚櫎鎵�鏈夋爣璁癓ogic鐣岄潰 if (LogicView.IfString._Logic == if_logic) { - UserView.HomePage.Instance.RemoveViewByTag("Logic"); - if (CurrentLogic.LogicType == 0) - { - //鍙埛鏂板垎绫讳笂涓嬫粦鍔╲iew锛� - Phone.Category.CategoryMainForm.instance?.RefreshBodyView(); - // Category.Category.instance?.RefreshBodyView(); - } - else if (CurrentLogic.LogicType == 2) - { - //鍒锋柊鏁翠釜鍒嗙被锛� - //闂ㄩ攣甯稿紑妯″紡鐗规畩; - UserView.UserPage.Instance.ShowCategoryAutoListForm(); - - } + //鍙埛鏂板垎绫�-鑷姩鍖栦笂涓嬫粦鍔╲iew锛� + Phone.Category.CategoryMainForm.instance?.RefreshBodyView(); + // Category.Category.instance?.RefreshBodyView(); } else if (LogicView.IfString._LockLogic == if_logic) { - UserView.HomePage.Instance.RemoveViewByTag("Logic");//绉婚櫎鎵�鏈夋爣璁癓ogic鐣岄潰 + //璺冲埌闂ㄩ攣鑱斿姩浜嬩欢鍒楄〃鐣岄潰 UserView.HomePage.Instance.RemoveViewByTag("LockListView");//绉婚櫎鎵�鏈夋爣璁癓ockListView鐣岄潰 var doorLockLogicList = new DoorLockLogic.LockLogicList(); UserView.HomePage.Instance.AddChidren(doorLockLogicList); UserView.HomePage.Instance.PageIndex += 1; doorLockLogicList.Show(); } + else if (LogicView.IfString._SoneLogic == if_logic) + { + //璺冲埌Sone闂ㄩ攣鑱斿姩浜嬩欢鍒楄〃鐣岄潰 + UserView.HomePage.Instance.RemoveViewByTag("SoneLogic");//绉婚櫎鎵�鏈夋爣璁癓ockListView鐣岄潰 + var soneLogicList = new SoneLogicList(); + UserView.HomePage.Instance.AddChidren(soneLogicList); + UserView.HomePage.Instance.PageIndex += 1; + soneLogicList.Show(); + } } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs b/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs index b470b06..437e22b 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/OneLogic.cs @@ -24,8 +24,8 @@ /// <param name="Yes"></param> public void Show(bool Yes) { - UserView.HomePage.Instance.ScrollEnabled = false; #region View甯冨眬浠g爜 + UserView.HomePage.Instance.ScrollEnabled = false; TopView view = new TopView(); this.AddChidren(view.TopRowView()); @@ -47,7 +47,7 @@ view.clickBtn.MouseDownEventHandler += (sender, e) => { - // UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦 + UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦 RemoveFromParent(); }; var middle = new VerticalScrolViewLayout @@ -193,17 +193,15 @@ //S-one闂ㄩ攣鐗规畩,涓嶈兘鍐嶆缂栬緫; actiondevice.stateRow.AddRightView(actiondevice.edit); } - - var linkType = int.Parse(Common.Logic.CurrentLogic.Actions[i]["LinkType"].ToString()); var actions = Common.Logic.CurrentLogic.Actions[i]; - switch (linkType) { case 8: - { - - var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); + { + //S-one闂ㄩ攣鐗规畩锛圡ac鏄敮涓�鐨勮瘑鍒級 + ///濡傛灉涓嶈繖鏍锋煡鎵撅紝鍒嗙被-鑷姩鍖栬繘鏉ユ煡鐪嬩細瀛樺湪闂 + var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == actions["DeviceAddr"].ToString(); }); if (deviceinof == null) { deviceinof = new CommonDevice(); @@ -241,15 +239,16 @@ break; } - ///缂栬緫 actiondevice.edit.MouseUpEventHandler += (sender, e) => { switch (linkType) { case 8: - { - var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); + { + //S-one闂ㄩ攣鐗规畩锛圡ac鏄敮涓�鐨勮瘑鍒級 + ///濡傛灉涓嶈繖鏍锋煡鎵撅紝鍒嗙被-鑷姩鍖栬繘鏉ユ煡鐪嬩細瀛樺湪闂 + var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == actions["DeviceAddr"].ToString(); }); if (deviceinof == null) { deviceinof = new CommonDevice(); @@ -326,14 +325,12 @@ return; } var name = logicTextBox.Text.Trim(); - Method.SaveLogic(IfString._Logic, name, IfString.Tag, Common.Logic.CurrentLogic); + Method.SaveLogic(IfString._SoneLogic, name, IfString.Tag, Common.Logic.CurrentLogic); }; - - } /// <summary> - /// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠舵垨鑰呯洰鏍囩殑瑙嗗浘鏂规硶 + /// 閫変腑璇ヤ綔涓烘潯浠舵垨鑰呯洰鏍囩殑瑙嗗浘鏂规硶 /// </summary> /// <param name="common">Common.</param> void DevcieView( CommonDevice common,Button button) @@ -371,7 +368,7 @@ Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); actionsInfo.Add("LinkType", 8); actionsInfo.Add("DeviceAddr", common.DeviceAddr); - actionsInfo.Add("Epoint", common.DeviceEpoint); + actionsInfo.Add("Epoint","200"); string SelectedDeviceStatus = ""; switch (common.Type) { @@ -406,34 +403,24 @@ }; - foreach (var deviceinfo in Common.Logic.CurrentLogic.Actions) + if (button.Text == Language.StringByID(MyInternationalizationString.logicopen)) { - if (deviceinfo["LinkType"].ToString() == "8") - { - if (deviceinfo["DeviceAddr"].ToString() == common.DeviceAddr && deviceinfo["Epoint"].ToString() == common.DeviceEpoint.ToString()) - { - if (deviceinfo["PassData"].ToString() == "055704010112") - {//寮�鍚� - SelectedDeviceStatus = Language.StringByID(MyInternationalizationString.logicopen); - openView.selectedIconBtn.Visible = true; - closeView.selectedIconBtn.Visible = false; - openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; - closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - } - else - {//鍏抽棴 - SelectedDeviceStatus = Language.StringByID(MyInternationalizationString.logicclose); - openView.selectedIconBtn.Visible = false; - closeView.selectedIconBtn.Visible = true; - openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; + //寮�鍚� + SelectedDeviceStatus = Language.StringByID(MyInternationalizationString.logicopen); + openView.selectedIconBtn.Visible = true; + closeView.selectedIconBtn.Visible = false; + openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; + closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - } - break; - } - } } - + else { + //鍏抽棴 + SelectedDeviceStatus = Language.StringByID(MyInternationalizationString.logicclose); + openView.selectedIconBtn.Visible = false; + closeView.selectedIconBtn.Visible = true; + openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; + closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; + } } break; diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs index 6d0a404..9b3974a 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs @@ -180,7 +180,7 @@ }); } ///<summary> - /// 鍒犻櫎閫昏緫 + /// 鍒犻櫎閫昏緫(0鎴愬姛,鍏跺畠鍊�:澶辫触) /// </summary> public static async System.Threading.Tasks.Task<int> DelLogic(int LogicId) { diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs index d06d4eb..ca15989 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs @@ -15,10 +15,10 @@ /// </summary> public static void SkipAddLogic(int intvalue, DoorLock doorLock = null, UserCenter.MemberInfoRes accountObj = null) { - /// 0.姝e父鑷姩鍖�;1.闂ㄩ攣鑷姩鍖�;2.闂ㄩ攣甯稿紑.鍏�; + /// 0.姝e父鑷姩鍖�;1.闂ㄩ攣鑷姩鍖�;2.Sone闂ㄩ攣; switch (intvalue) { - case 0: + case 0: { //new涓�涓柊閫昏緫瀵硅薄锛� //鏂板姝e父鑷姩鍖栧叆鍙� @@ -30,75 +30,57 @@ UserView.HomePage.Instance.AddChidren(addLogicPage); UserView.HomePage.Instance.PageIndex += 1; addLogicPage.Show(); - } + + } break; - case 1: + case 1: { //杩涘叆闂ㄩ攣鑱斿姩浜嬩欢鍏ュ彛 - Send.UserMemberInfoRes = accountObj; - Send.CurrentDoorLock = doorLock; - if (accountObj == null) - { - ///闃叉鎶涘紓甯� - Send.UserMemberInfoRes = new UserCenter.MemberInfoRes(); - } - if (doorLock == null) - { - ///闃叉鎶涘紓甯� - Send.CurrentDoorLock = new DoorLock(); - } - ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱 - Common.Logic.LogicDviceList.Clear(); - if (Common.Logic.LogicDviceList.Count == 0) - { - Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); - } - var doorLockLogicList = new DoorLockLogic.LockLogicList(); - UserView.HomePage.Instance.AddChidren(doorLockLogicList); - UserView.HomePage.Instance.PageIndex += 1; - doorLockLogicList.Show(); - } - break; - case 2: - { + Send.UserMemberInfoRes = accountObj; + Send.CurrentDoorLock = doorLock; + if (accountObj == null) + { + ///闃叉鎶涘紓甯� + Send.UserMemberInfoRes = new UserCenter.MemberInfoRes(); + } + if (doorLock == null) + { + ///闃叉鎶涘紓甯� + Send.CurrentDoorLock = new DoorLock(); + } + ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱 Common.Logic.LogicDviceList.Clear(); if (Common.Logic.LogicDviceList.Count == 0) { Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); } - //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒� - //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒� - var h = DateTime.Now.ToString("HH"); - var m = DateTime.Now.ToString("mm"); - Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>(); - timeConditionsInfo.Add("Type", "0"); - timeConditionsInfo.Add("IsValid", "1"); - timeConditionsInfo.Add("DateType", "0"); - timeConditionsInfo.Add("RemindTime", "0"); - timeConditionsInfo.Add("EnDelay", "0"); - timeConditionsInfo.Add("DelayTime", "0"); - timeConditionsInfo.Add("DoorLockOpenDelayTime", "0"); - timeConditionsInfo.Add("StartHour", h); - timeConditionsInfo.Add("StartMin", m); - Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); - actionsInfo.Add("LinkType", 8); - actionsInfo.Add("DeviceAddr", doorLock.DeviceAddr); - actionsInfo.Add("Epoint", doorLock.DeviceEpoint); - actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧 - - //new涓�涓柊閫昏緫瀵硅薄锛� - //鏂板闂ㄩ攣甯稿紑妯″紡鑷姩鍖栧叆鍙o紱 - Common.Logic.CurrentLogic = new Common.Logic(); - Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 - Common.Logic.CurrentLogic.LogicType = 2;//鏍囪閫昏緫绫诲瀷 - Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.openmode); - Common.Logic.CurrentLogic.Conditions.Add(timeConditionsInfo);//娣诲姞鏉′欢 - Common.Logic.CurrentLogic.Actions.Add(actionsInfo);//娣诲姞鐩爣 - var oneLogic = new OneLogic(); - UserView.HomePage.Instance.AddChidren(oneLogic); + var doorLockLogicList = new DoorLockLogic.LockLogicList(); + UserView.HomePage.Instance.AddChidren(doorLockLogicList); UserView.HomePage.Instance.PageIndex += 1; - oneLogic.Show(false); - } + doorLockLogicList.Show(); + } + break; + case 2: + { + ///Sone闂ㄩ攣涓诲叆鍙� + if (doorLock == null) + { + ///闃叉鎶涘紓甯� + doorLock = new DoorLock(); + } + Send.CurrentDoorLock = doorLock; + ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱 + Common.Logic.LogicDviceList.Clear(); + if (Common.Logic.LogicDviceList.Count == 0) + { + Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); + } + var addLogicPage = new SoneLogicList(); + UserView.HomePage.Instance.AddChidren(addLogicPage); + UserView.HomePage.Instance.PageIndex += 1; + addLogicPage.Show(); + + } break; } @@ -106,7 +88,6 @@ #region 鈼� 鑷姩鍖朹_________________________ - /// <summary> /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙� /// </summary> @@ -180,8 +161,8 @@ X = Application.GetRealWidth(58), Y = scenehorizontalScrol.Bottom, }; - functionSceneAutoBodyView.AddChidren(logicScrolView); - + functionSceneAutoBodyView.AddChidren(logicScrolView); + logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); bool no = false; //鏄剧ず榛樿妯℃澘鐨勭晫闈簨浠� @@ -286,9 +267,9 @@ Read(logicScrolView, no); //鍏抽棴鍒锋柊View锛� logicScrolView.EndHeaderRefreshing(); - }; - - //鑷姩鍖� + }; + + //鑷姩鍖� Read(logicScrolView, no); } @@ -341,13 +322,11 @@ Automationview(logicScrolView, no); CommonPage.Loading.Hide(); } + static RowLayout selectedRow = new RowLayout() { Tag = "0" };//璁板綍宸︽粦鐘舵�� /// <summary> /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈� /// </summary> /// <param name="refresview">Refresview.</param> - - static RowLayout selectedRow = new RowLayout() { Tag="0"};//璁板綍宸︽粦鐘舵�� - private static async void Automationview(VerticalRefreshLayout refresview, bool no) { refresview.RemoveAll(); @@ -439,8 +418,8 @@ fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); - } - i++; + } + i++; var logicnameBtn = new Button { Height = Application.GetRealHeight(58), @@ -537,13 +516,13 @@ { var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, Language.StringByID(MyInternationalizationString.doyouwanttodelete), - Language.StringByID(MyInternationalizationString.confrim)); - alert.Show(); - alert.ConfirmClickEvent += () => + Language.StringByID(MyInternationalizationString.confrim)); + alert.Show(); + alert.ConfirmClickEvent += () => { Common.Logic.LogicList.Remove(logic); Automationview(refresview, no); - Send.DelLogic(logic.LogicId); + Send.DelLogic(logic.LogicId); }; }; @@ -555,9 +534,9 @@ Width = Application.GetRealWidth(1080 - 58), BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor, }; - fLayout.AddChidren(line); - - + fLayout.AddChidren(line); + + } } @@ -595,8 +574,8 @@ { indexlist.Add(linkType); } - } - //鎺掑垪鍥炬爣椤哄簭; + } + //鎺掑垪鍥炬爣椤哄簭; if (indexlist.Contains("0") || indexlist.Contains("8")) { iconIndexlist.Add("0"); @@ -716,7 +695,6 @@ } } } - #endregion /// <summary> @@ -753,55 +731,51 @@ currentLogic.LogicName = Language.StringByID(R.MyInternationalizationString.openmode); currentLogic.Conditions.Add(timeConditionsInfo); currentLogic.Actions.Add(actionsInfo); - Exist(3);//鏌ユ壘鏄惁瀛樺湪璁剧疆杩囧け鏁堟椂闂�(鏈夌殑璇濆垹闄わ紝鍐嶆坊鍔�) var logicIfon = await Send.AddModifyLogic(currentLogic); - if (logicIfon != null && logicIfon.LogicId != 0) - { - //娣诲姞闂ㄩ攣澶辨晥鏃堕棿鐨勫巻鍙茶褰� - UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString()); + if (logicIfon != null && logicIfon.LogicId != 0) + { + //娣诲姞闂ㄩ攣澶辨晥鏃堕棿鐨勫巻鍙茶褰� + UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString()); return true;//琛ㄧず娣诲姞鎴愬姛; } return false;//琛ㄧず娣诲姞澶辫触; - } - - ///<summary> - /// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶; - /// 娉ㄦ剰锛堝弬鏁�2锛�3锛夛細valueInt=3鏄垹闄よ缃け鏁堟椂闂磋嚜鍔ㄥ寲锛泇alueInt=2鍒ゆ柇鏄惁瀛樺湪鑷姩鍖栵紱 - /// 杩斿洖鍊硷細0涓嶅瓨鍦�;1瀛樺湪;2鍒犻櫎鎴愬姛;3鍒犻櫎澶辫触; - /// </summary> - public static async System.Threading.Tasks.Task<int> Exist(int valueInt = 2) - { - int exist = 0; - var Idlist = await Send.GetLogicId(valueInt); - if (Idlist.Count != 0) - { - if (valueInt == 3) - { - for (int i = 0; i < Idlist.Count; i++) - { - //valueInt=3涓�鏉$壒娈婄殑鑷姩鍖�(鐢ㄦ潵璁剧疆澶辨晥鏃堕棿) - var d=await Send.DelLogic(Idlist[i]); - if (d == 0) - { - //鍒犻櫎鎴愬姛 - exist = 2; - } - else - { - //鍒犻櫎澶辫触 - exist = 3; - } - return exist; + } - } - } - exist = 1; + ///<summary> + /// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶; + /// 娉ㄦ剰(鍙傛暟:2-甯稿紑鑷姩鍖�;3-澶辨晥鏃堕棿鑷姩鍖�); + /// 杩斿洖鍊硷細0涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪; + /// </summary> + public static async System.Threading.Tasks.Task<int> Exist(int valueInt) + { + int exist = 0; + var Idlist = await Send.GetLogicId(valueInt); + if (Idlist.Count != 0) + { + //榛樿鍙栫涓�涓�昏緫ID + exist = Idlist[0]; + } return exist; } - + ///<summary> + ///鑾峰彇閫昏緫淇℃伅 + /// 杩斿洖鍊硷細null涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪; + /// </summary> + public static async System.Threading.Tasks.Task<Common.Logic> GetLogicIfon() + { + Common.Logic logic = null; + var Idlist = await Send.GetLogicId(3); + if (Idlist.Count != 0) + { + //榛樿鍙栫涓�涓�昏緫ID(鏃舵晥鎬у彧鏈変竴鏉¢�昏緫) + int exist = Idlist[0]; + logic = await Send.GetLogic(exist, 3); + } + return logic; + } } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs new file mode 100755 index 0000000..57a5a58 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs @@ -0,0 +1,508 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared.Common; +using Shared.R; +using Shared; + +namespace Shared.Phone.Device.Logic +{ + public class SoneLogicList : FrameLayout + { + public SoneLogicList() + { + Tag = "SoneLogic"; + } + public async void Show() + { + #region 鐣岄潰鐨勫竷灞�浠g爜 + UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦 + TopView view = new TopView(); + this.AddChidren(view.TopRowView()); + view.toptitleNameBtn.TextID = MyInternationalizationString.selection; + view.clickBtn.MouseDownEventHandler += (sender, e) => + { + UserView.HomePage.Instance.ScrollEnabled = true; + RemoveFromParent(); + }; + + var middle = new FrameLayout + { + Y = view.topRowLayout.Bottom, + Height = Application.GetRealHeight(Method.H - 184), + BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + }; + this.AddChidren(middle); + #endregion + + #region 甯稿紑妯″紡鍥炬爣 鏃舵晥鎬у父寮�璁剧疆 + ///绗簩鍧楃涓�绾х埗鎺т欢 + var fLayout = new FrameLayout + { + Width = Application.GetRealWidth(1080), + Height = Application.GetRealHeight(829 - 184), + BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + }; + middle.AddChidren(fLayout); + ///甯稿紑妯″紡鍥炬爣 + var modeIconBtn = new Button + { + X = Application.GetRealWidth(395), + Y = Application.GetRealHeight(92), + Width = Application.GetMinRealAverage(294), + Height = Application.GetMinRealAverage(294), + UnSelectedImagePath = "ZigeeLogic/noMode.png", + SelectedImagePath = "ZigeeLogic/openMode.png", + }; + fLayout.AddChidren(modeIconBtn); + var logic = await SkipView.GetLogicIfon(); + if (logic != null) + { + + + fLayout.Height = Application.GetRealHeight(780);//鏀瑰彉楂樺害 + modeIconBtn.IsSelected = true;//鏀瑰彉鍥炬爣鐘舵�� + ///绗簩绾х埗鎺т欢 + var openModeFl = new FrameLayout + { + Y = Application.GetRealHeight(455), + Height = Application.GetRealHeight(127 + 199), + Width = Application.GetRealWidth(1080), + }; + fLayout.AddChidren(openModeFl); + ///鍏抽棴鏃舵晥鎬ц嚜鍔ㄥ寲 + Button closeBtn = new Button + { + X = Application.GetRealWidth(86), + Height = Application.GetRealHeight(127), + Width = Application.GetRealWidth(907), + Radius = (uint)Application.GetRealHeight(58), + BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, + TextID = MyInternationalizationString.closeUp, + TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, + TextSize = 16, + }; + openModeFl.AddChidren(closeBtn); + closeBtn.MouseUpEventHandler += (sender,e) => { + + + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, + Language.StringByID(MyInternationalizationString.doyouwanttodelete), + Language.StringByID(MyInternationalizationString.confrim)); + alert.Show(); + alert.ConfirmClickEvent += () => + { + Send.DelLogic(logic.LogicId); + this.RemoveFromParent(); + var soneLogicList = new SoneLogicList(); + UserView.HomePage.Instance.AddChidren(soneLogicList); + UserView.HomePage.Instance.PageIndex += 1; + soneLogicList.Show(); + }; + }; + + ///鏄剧ず澶辨晥璁剧疆鏃堕棿鏂囨湰鎺т欢 + var timeTextBtn= new Button + { + Y = Application.GetRealHeight(127 + 69), + X = Application.GetRealWidth(225), + Width = Application.GetRealWidth(634), + Height = Application.GetRealHeight(60), + TextSize = 15, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + Text = "鏃舵晥鎬у父寮�璁剧疆12:20", + }; + openModeFl.AddChidren(timeTextBtn); + ///鏃舵晥鎬у父寮�鍙湁涓�涓潯浠�; + try + { + var y = DateTime.Now.ToString("yy");//閭d竴骞� + var m = DateTime.Now.ToString("mm");//閭d竴鏈� + var d = DateTime.Now.ToString("dd");//閭d竴澶� + var h =int.Parse(DateTime.Now.ToString("HH"));//褰撳墠绯荤粺鏃堕棿 + var me = DateTime.Now.ToLongDateString(); + var timeInt = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]); + int dayInt = (h + timeInt)/ 24;//绠楀嚭鍑犲ぉ鍚庢墽琛� + int hour = (h + timeInt) % 24;//绠楀嚭鍑犲ぉ鍚庨偅涓椂闂存墽琛� + timeTextBtn.Text = "鏃舵晥鎬у父寮�璁剧疆" + y + "骞�" + m + "鏈�" + d + dayInt + "鍙�" + timeInt + "鏃�"+ "鎵ц"; + } + catch { } + + } + else + { + fLayout.Height = Application.GetRealHeight(645);//鏀瑰彉楂樺害 + modeIconBtn.IsSelected = false;//鏀瑰彉鍥炬爣鐘舵�� + ///绗簩绾х埗鎺т欢 + var modeFl = new FrameLayout + { + Y = Application.GetRealHeight(478), + X = Application.GetRealWidth(58), + Height = Application.GetRealHeight(138), + Width = Application.GetRealWidth(1022), + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, + }; + fLayout.AddChidren(modeFl); + modeFl.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft); + modeFl.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); + ///鏃舵晥鎬у父寮�璁剧疆鏄剧ず鏂囨湰鎺т欢 + var modeTextBtn = new Button + { + + Y = Application.GetRealHeight(40), + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(600), + Height = Application.GetRealHeight(60), + TextSize = 15, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextAlignment = TextAlignment.CenterLeft, + // Text = "鏃舵晥鎬у父寮�璁剧疆", + TextID=MyInternationalizationString.timeSetSone, + }; + modeFl.AddChidren(modeTextBtn); + ///涓嬩竴绾ц彍鍗曞浘鏍囨帶浠� + var nextIconBtn = new Button + { + Width = Application.GetMinRealAverage(104), + Height = Application.GetMinRealAverage(104), + X = Application.GetRealWidth(861), + Y = Application.GetRealHeight(17), + UnSelectedImagePath = "ZigeeLogic/next.png", + }; + modeFl.AddChidren(nextIconBtn); + + var clickBtn = new Button + { + Y = Application.GetRealHeight(478), + X = Application.GetRealWidth(58), + Height = Application.GetRealHeight(138), + Width = Application.GetRealWidth(1022), + }; + modeFl.AddChidren(clickBtn); + + + clickBtn.MouseUpEventHandler += async (sender, e) => + { + var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock); + }; + } + + #endregion + + #region 甯稿紑鑷姩鍖� + ///绗笁鍧楃涓�绾х埗鎺т欢 + var listLogicFl = new FrameLayout + { + Y = fLayout.Bottom, + X = Application.GetRealWidth(58), + Height = middle.Height - fLayout.Height, + Width = Application.GetRealWidth(1022), + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, + }; + middle.AddChidren(listLogicFl); + listLogicFl.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); + + ///娣诲姞甯稿紑鑷姩鍖栫殑鐖舵帶浠� + var addLogicfL = new FrameLayout + { + Height = Application.GetRealHeight(187), + Width = Application.GetRealWidth(1080 - 58), + }; + listLogicFl.AddChidren(addLogicfL); + ///甯稿紑鑷姩鍖栨樉绀烘枃鏈殑鎺т欢 + var addTextBtn = new Button + { + Y = Application.GetRealHeight(46), + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(600), + Height = Application.GetRealHeight(95), + TextSize = 24, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextAlignment = TextAlignment.CenterLeft, + //Text = "甯稿紑鑷姩鍖�", + TextID = MyInternationalizationString.openAutomationSone, + }; + addLogicfL.AddChidren(addTextBtn); + ///娣诲姞鑷姩鍖栧浘鏍囩殑鎺т欢 + var addIconBtn = new Button + { + Width = Application.GetMinRealAverage(69), + Height = Application.GetMinRealAverage(69), + X = Application.GetRealWidth(890), + Y = Application.GetRealHeight(60), + UnSelectedImagePath = "ZigeeLogic/add.png", + }; + addLogicfL.AddChidren(addIconBtn); + addIconBtn.MouseUpEventHandler += (sender, e) => + { + + //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒� + //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒� + var h = DateTime.Now.ToString("HH"); + var m = DateTime.Now.ToString("mm"); + Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>(); + timeConditionsInfo.Add("Type", "0"); + timeConditionsInfo.Add("IsValid", "1"); + timeConditionsInfo.Add("DateType", "0"); + timeConditionsInfo.Add("RemindTime", "0"); + timeConditionsInfo.Add("EnDelay", "0"); + timeConditionsInfo.Add("DelayTime", "0"); + timeConditionsInfo.Add("DoorLockOpenDelayTime", "0"); + timeConditionsInfo.Add("StartHour", h); + timeConditionsInfo.Add("StartMin", m); + Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); + actionsInfo.Add("LinkType", 8); + actionsInfo.Add("DeviceAddr", Send.CurrentDoorLock.DeviceAddr); + actionsInfo.Add("Epoint", "200"); + actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧 + //new涓�涓柊閫昏緫瀵硅薄锛� + //鏂板闂ㄩ攣甯稿紑妯″紡鑷姩鍖栧叆鍙o紱 + Common.Logic.CurrentLogic = new Common.Logic(); + Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 + Common.Logic.CurrentLogic.LogicType = 2;//鏍囪閫昏緫绫诲瀷 + Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.openmode); + Common.Logic.CurrentLogic.Conditions.Add(timeConditionsInfo);//娣诲姞鏉′欢 + Common.Logic.CurrentLogic.Actions.Add(actionsInfo);//娣诲姞鐩爣 + var oneLogic = new OneLogic(); + UserView.HomePage.Instance.AddChidren(oneLogic); + UserView.HomePage.Instance.PageIndex += 1; + oneLogic.Show(false); + + }; + + ///甯稿紑鑷姩鍖栧垪琛ㄤ笂涓嬫粦鍔ㄧ殑鎺т欢 + var verticalRefresh = new VerticalRefreshLayout + { + + Y = addLogicfL.Bottom, + X = Application.GetRealWidth(46), + Height = listLogicFl.Height - addLogicfL.Height, + Width = listLogicFl.Width - Application.GetRealWidth(46), + }; + listLogicFl.AddChidren(verticalRefresh); + verticalRefresh.BeginHeaderRefreshingAction += () => + { + Common.Logic.SoneLogicList.Clear(); + Read(verticalRefresh, false); + verticalRefresh.EndHeaderRefreshing(); + }; + Read(verticalRefresh, true); + #endregion + } + /// <summary> + /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱 + /// </summary> + /// <param name="verticalRefresh"></param> + private async void Read(VerticalRefreshLayout verticalRefresh, bool yes) + { + if (yes) + { + CommonPage.Loading.Start(); + } + try + { + if (Common.Logic.SoneLogicList.Count == 0) + { + var Idlist = await Send.GetLogicId(2);//闂ㄩ攣甯稿紑妯″紡 + if (Idlist.Count != 0) + { + var listlogic = await Send.ReadList(Idlist.Count, 2); + for (int i = 0; i < listlogic.Count; i++) + { + var logic = listlogic[i]; + if (logic.LogicType != 2) + { + continue; + } + Common.Logic.SoneLogicList.Add(logic); + } + } + } + } + catch (Exception e) + { + var dd = e.Message; + } + //鑷姩鍖� + RefreshView(verticalRefresh); + if (yes) + { + CommonPage.Loading.Hide(); + + } + } + /// <summary> + /// 鍔犺浇鑷姩鍖栧垪琛� + /// </summary> + /// <param name="verticalRefresh"></param> + private void RefreshView(VerticalRefreshLayout verticalRefresh) + { + verticalRefresh.RemoveAll(); + for (int i = 0; i < 6; i++) + { + Common.Logic.SoneLogicList.Add(new Common.Logic { LogicName = i.ToString() }); + + } + foreach (var logic in Common.Logic.SoneLogicList) + { + #region 鑷姩鍖栧竷灞�View + + ///鑷姩鍖栫埗鎺т欢 + var fLayout = new FrameLayout + { + Height = Application.GetRealHeight(184), + }; + verticalRefresh.AddChidren(fLayout); + ///宸﹀彸鍙粦鍔ㄦ帶浠� + var logicRow = new RowLayout + { + LineColor = ZigbeeColor.Current.LogicBackgroundColor, + BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + SubViewWidth = Application.GetRealWidth(184),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛� + }; + fLayout.AddChidren(logicRow); + //宸︽粦鑿滃崟浜嬩欢 + logicRow.OpenMenuAction += () => + { + //if (selectedRow.Tag.ToString() != logicRowlayout.Tag.ToString()) + //{ //淇濈暀宸︽粦鍙湁涓�涓�; + // selectedRow.HideMenu();// + //} + //selectedRow = logicRowlayout; + }; + ///鏄剧ず閫昏緫鍚嶇О鐨勬帶浠� + var nameBtn = new Button + { + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(350), + Text = logic.LogicName, + X = Application.GetRealWidth(12), + Y = Application.GetRealHeight(3), + TextAlignment = TextAlignment.CenterLeft, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize = 14, + }; + logicRow.AddChidren(nameBtn); + ///鏄剧ず鐩爣鍔熻兘鑳屾櫙棰滆壊鐨勬帶浠� + var typeBjBtn = new FrameLayout + { + Width = Application.GetMinRealAverage(82), + Height = Application.GetMinRealAverage(82), + X = Application.GetRealWidth(17), + Y = Application.GetRealHeight(84), + Radius = (uint)Application.GetMinRealAverage(41), + BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + }; + logicRow.AddChidren(typeBjBtn); + ///鏄剧ず鐩爣鍔熻兘鍥炬爣鐨勬帶浠� + var typeIconBtn = new Button + { + Width = Application.GetMinRealAverage(58), + Height = Application.GetMinRealAverage(58), + Gravity = Gravity.Center, + }; + typeBjBtn.AddChidren(typeIconBtn); + ///閫昏緫寮�鍏冲浘鏍囩殑鎺т欢 + var switchBtn = new Button + { + Width = Application.GetMinRealAverage(104), + Height = Application.GetMinRealAverage(63), + UnSelectedImagePath = "ZigeeLogic/logicclose.png", + SelectedImagePath = "ZigeeLogic/logicopen.png", + X = Application.GetRealWidth(815), + Y = Application.GetRealHeight(92), + + }; + logicRow.AddChidren(switchBtn); + if (logic.IsEnable == 1) + { + switchBtn.IsSelected = true; + typeIconBtn.UnSelectedImagePath = "ZigeeLogic/function1.png"; + typeBjBtn.BackgroundColor = ZigbeeColor.Current.LogicFunction1Color; + } + else if (logic.IsEnable == 0) + { + switchBtn.IsSelected = false; + typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nofunction.png"; + typeBjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; + } + ///缂栬緫 + var edit = new Button + { + BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1, + Text = Language.StringByID(MyInternationalizationString.edit), + TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, + }; + logicRow.AddRightView(edit); + if (logic.LogicType == 2) + { + edit.TextID = MyInternationalizationString.look; + } + ///鍒犻櫎 + var del = new Button + { + BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1, + Text = Language.StringByID(MyInternationalizationString.del), + TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, + }; + logicRow.AddRightView(del); + ///绾跨殑鎺т欢 + var line = new Button + { + Y = fLayout.Height - 1, + Height = 1, + Width = Application.GetRealWidth(976), + BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor, + }; + fLayout.AddChidren(line); + #endregion + ///寮�鍏崇偣鍑讳簨浠� + switchBtn.MouseUpEventHandler += (sender1, e1) => + { + switchBtn.IsSelected = !switchBtn.IsSelected; + if (switchBtn.IsSelected) + { + //閫昏緫寮� + logic.IsEnable = 1; + typeIconBtn.UnSelectedImagePath = "ZigeeLogic/function1.png"; + typeBjBtn.BackgroundColor = ZigbeeColor.Current.LogicFunction1Color; + } + else + { + //閫昏緫鍏� + typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nofunction.png"; + typeBjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; + } + Send.LogicControlSwitch(logic); + //Logic.Send.AddModifyLogic(logic); + }; + ///缂栬緫鐐瑰嚮浜嬩欢 + edit.MouseUpEventHandler += (sender, e) => + { + Common.Logic.CurrentLogic = logic; + var oneLogic = new OneLogic(); + UserView.HomePage.Instance.AddChidren(oneLogic); + UserView.HomePage.Instance.PageIndex += 1; + oneLogic.Show(false); + }; + ///鍒犻櫎鐐瑰嚮浜嬩欢 + del.MouseUpEventHandler += (sender, e) => + { + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, + Language.StringByID(MyInternationalizationString.doyouwanttodelete), + Language.StringByID(MyInternationalizationString.confrim)); + alert.Show(); + alert.ConfirmClickEvent += () => + { + Common.Logic.SoneLogicList.Remove(logic); + //logicRow.Parent.RemoveFromParent(); + fLayout.RemoveFromParent(); + Send.DelLogic(logic.LogicId); + }; + + }; + } + + + } + } +} diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs b/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs index ff07e07..8bafd8e 100755 --- a/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs +++ b/ZigbeeApp/Shared/Phone/Login/AccountLogin.cs @@ -1,855 +1,31 @@ -锘縰sing System; -using Shared.Common; -using Shared.Phone.UserView; -using Shared.Phone.Device.CommonForm; +锘縰sing System; +using Shared.Common; +using Shared.Phone.UserView; +using Shared.Phone.Device.CommonForm; using Shared.Phone.UserCenter; -namespace Shared.Phone.Login -{ - /// <summary> - /// 鐧诲綍鐣岄潰 - /// </summary> - public class AccountLogin : FrameLayout - { - #region 鈼� 鍙橀噺____________________________ - /// <summary> - /// 鑳屾櫙瑙嗗浘 - /// </summary> - private FrameLayout midFrameLayout; - /// <summary> - /// 鎵嬫満閭 - /// </summary> - private PhoneEmailForm phoneEmailForm; - /// <summary> - /// phoneRowForm - /// </summary> - private PhoneLoginRowForm phoneRow; - /// <summary> - /// emailRow - /// </summary> - private EmailLoginRowForm emailRow; - /// <summary> - /// phonePwdRow - /// </summary> - private PwdLoginRowForm phonePwdRow; - /// <summary> - /// emailPwdRow - /// </summary> - private PwdLoginRowForm emailPwdRow; - - /// <summary> - /// 璐﹀彿瀵嗙爜fl - /// </summary> - private FrameLayout accountPwdFL; - /// <summary> - /// 鐧诲綍閿欒鎻愮ず鎸夐挳 - /// </summary> - private Button loginErrorBtn; - /// <summary> - /// 蹇樿瀵嗙爜鎸夐挳 - /// </summary> - private Button forgotPasswordBtn; - /// <summary> - /// 鐧诲綍鎸夐挳 - /// </summary> - private Button loginBtn; - /// <summary> - /// 楠岃瘉鐮佺櫥褰曟寜閽� - /// </summary> - private Button loginByCodeBtn; - /// <summary> - /// 娉ㄥ唽鎸夐挳 - /// </summary> - private Button registerBtn; - /// <summary> - /// wechat - /// </summary> - private Button wechatBtn; - /// <summary> - /// qq - /// </summary> - private Button qqBtn; - /// <summary> - /// 杈撳叆鐨勭櫥闄嗚处鍙�(閲嶆柊鐧婚檰鏃朵娇鐢�) - /// </summary> - private string oldInputPhone = string.Empty; - /// <summary> - /// 杈撳叆鐨勭櫥闄嗚处鍙�(閲嶆柊鐧婚檰鏃朵娇鐢�) - /// </summary> - private string oldInputEmail = string.Empty; - - #endregion - - #region 鈼� 鏋勯�犳柟娉昣________________________ - - /// <summary> - /// 鏋勯�犳柟娉� - /// </summary> - public AccountLogin() - { - CommonPage.Instance.IsDrawerLockMode = true; - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; - Tag = "Login"; - } - - public override void RemoveFromParent() - { - base.RemoveFromParent(); - } - - #endregion - - #region 鈼� 鏄剧ず鐣岄潰_________________________ - - /// <summary> - /// 鏄剧ず鐣岄潰 - /// </summary> - /// <param name="account">Account.</param> - /// <param name="password">Password.</param> - public void Show(string account = "", string password = "") - { - if (Config.Instance.IsLogin) - { - - } - else - { - LoginViewShow(account); - } - } - - /// <summary> - /// Logins the view show. - /// </summary> - /// <param name="account">Account.</param> - public void LoginViewShow(string account = "") - { - //璁剧疆涓�涓嬪垵濮嬪�� - if (account.Contains("@") == true) { this.oldInputEmail = account; } - else { this.oldInputPhone = account; } - - #region midFrameLayout - midFrameLayout = new FrameLayout() - { - Width = LayoutParams.MatchParent, - Height = Application.GetRealHeight(CommonPage.AppRealHeight), - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - AddChidren(midFrameLayout); - #endregion - - #region 甯冨眬璐︽埛锛屽瘑鐮侊紝蹇樿瀵嗙爜锛屾敞鍐� 鎵嬫満楠岃瘉鐮佺櫥褰� - - var logoBG = new Button() - { - Height = Application.GetRealHeight(619), - UnSelectedImagePath = "Account/Logo_loginBG.png" - }; - midFrameLayout.AddChidren(logoBG); - - var phoneEmailBGFL = new FrameLayout() - { - Y = logoBG.Bottom, - Height = Application.GetRealHeight(1921), - BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor - }; - midFrameLayout.AddChidren(phoneEmailBGFL); - - var logo = new Button() - { - Width = Application.GetMinRealAverage(184), - Height = Application.GetMinRealAverage(184), - Y = Application.GetRealHeight(230), - UnSelectedImagePath = "Account/Logo_White.png", - Gravity = Gravity.CenterHorizontal - }; - midFrameLayout.AddChidren(logo); - - var logoName = new Button() - { - Y = logo.Bottom, - Height = Application.GetRealHeight(69), - Width = Application.GetRealWidth(300), - Gravity = Gravity.CenterHorizontal, - TextID = R.MyInternationalizationString.AppName, - TextColor = ZigbeeColor.Current.GXCTextWhiteColor, - TextSize = 16 - }; - midFrameLayout.AddChidren(logoName); - - phoneEmailForm = new PhoneEmailForm(); - phoneEmailForm.Init(midFrameLayout); - - - //閿欒鎻愮ずBtn - loginErrorBtn = new Button() - { - X = Application.GetRealWidth(242), - Y = Application.GetRealHeight(740), - Width = Application.GetRealWidth(700), - Height = Application.GetRealHeight(58), - TextColor = ZigbeeColor.Current.GXCTextRed, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CommonFormResouce.TextSize, - IsBold = true - }; - midFrameLayout.AddChidren(loginErrorBtn); - - accountPwdFL = new FrameLayout() - { - Y = Application.GetRealHeight(801), - Height = Application.GetRealHeight(553), - Width = Application.GetRealWidth(942), - Gravity = Gravity.CenterHorizontal, - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, - Radius = (uint)Application.GetRealHeight(17) - }; - midFrameLayout.AddChidren(accountPwdFL); - - AddPhoneOrEmailFL(accountPwdFL, "Phone"); - - forgotPasswordBtn = new Button() - { - X = Application.GetRealWidth(CommonPage.AppRealWidth - 115 - 250), - Y = Application.GetRealHeight(1198), - Width = Application.GetRealWidth(250), - Height = Application.GetRealHeight(58), - TextID = R.MyInternationalizationString.ForgotPWD_1, - TextSize = CommonFormResouce.loginTextSize, - TextColor = Shared.Common.ZigbeeColor.Current.GXCTextGrayColor, - TextAlignment = TextAlignment.CenterRight - }; - midFrameLayout.AddChidren(forgotPasswordBtn); - - loginBtn = new Button() - { - Y = Application.GetRealHeight(1293), - Width = Application.GetRealWidth(688), - Height = Application.GetRealHeight(127), - Gravity = Gravity.CenterHorizontal, - TextID = R.MyInternationalizationString.Login, - TextSize = 16, - TextColor = ZigbeeColor.Current.GXCTextGrayColor, - SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, - SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor, - BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor, - Radius = (uint)Application.GetRealHeight(127 / 2), - Enable = false, - IsBold = true - }; - midFrameLayout.AddChidren(loginBtn); - - loginByCodeBtn = new Button() - { - X = Application.GetRealWidth(98), - Y = Application.GetRealHeight(1466), - Width = Application.GetRealWidth(300), - Height = Application.GetRealHeight(49), - TextID = R.MyInternationalizationString.LoginByCode, - TextColor = ZigbeeColor.Current.GXCTextGrayColor, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CommonFormResouce.loginTextSize - }; - midFrameLayout.AddChidren(loginByCodeBtn); - - registerBtn = new Button() - { - X = Application.GetRealWidth(738), - Y = Application.GetRealHeight(1466), - Width = Application.GetRealWidth(244), - Height = Application.GetRealHeight(49), - TextID = R.MyInternationalizationString.Register, - TextColor = ZigbeeColor.Current.GXCTextGrayColor, - TextAlignment = TextAlignment.CenterRight, - TextSize = CommonFormResouce.loginTextSize - }; - midFrameLayout.AddChidren(registerBtn); - - wechatBtn = new Button - { - X = Application.GetRealWidth(395), - Y = Application.GetRealHeight(1737), - Width = Application.GetMinRealAverage(115), - Height = Application.GetMinRealAverage(115), - UnSelectedImagePath = "Account/Wechat.png", - Gravity = Gravity.CenterHorizontal - }; - midFrameLayout.AddChidren(wechatBtn); - - qqBtn = new Button - { - X = Application.GetRealWidth(567), - Y = Application.GetRealHeight(1737), - Width = Application.GetMinRealAverage(115), - Height = Application.GetMinRealAverage(115), - UnSelectedImagePath = "Account/QQ.png" - }; - //midFrameLayout.AddChidren(qqBtn); - - //娣诲姞鏈嶅姟鍗忚鎺т欢 - //this.AddServiceAgreementControl(phoneEmailBGFL); - - #endregion - - BindEvent(); - - if (account.Contains("@") == true) - { - SelectPhoneOrEmail_MouseUpEvent(phoneEmailForm.SelectedEmail, null); - } - } - - #endregion - - #region 鈼� 缁戝畾浜嬩欢_________________________ - - /// <summary> - /// 缁戝畾鎸夐挳浜嬩欢 - /// </summary> - private void BindEvent() - { - //閫夋嫨鎵嬫満閭 - phoneEmailForm.SelectedPhone.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent; - phoneEmailForm.SelectedEmail.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent; - //鐧诲綍浜嬩欢 - loginBtn.MouseUpEventHandler += LoginBtnEvent; - //鐭俊鐧诲綍 - loginByCodeBtn.MouseUpEventHandler += LoginByCode; - //娉ㄥ唽浜嬩欢 - registerBtn.MouseUpEventHandler += Register; - //蹇樿瀵嗙爜 - forgotPasswordBtn.MouseUpEventHandler += ForgetPWD_MouseUpEvent; - //wechat - wechatBtn.MouseUpEventHandler += LoginByWechat; - //qq - qqBtn.MouseUpEventHandler += LoginByQQ; - } - - #endregion - - #region 鈼� 鐧诲綍____________________________ - - /// <summary> - /// 鐧诲綍浜嬩欢 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void LoginBtnEvent(object sender, MouseEventArgs mouseEventArgs) - { - //妫�娴嬮殣绉佸崗璁� - if (this.CheckPrivacyPolicy() == false) - { - return; - } - if (phoneEmailForm.SelectedPhone.IsSelected) - { - Login(phoneRow.AccountET.Text.Trim(), phonePwdRow.PasswrodET.Text.Trim()); - } - else - { - Login(emailRow.AccountET.Text.Trim(), emailPwdRow.PasswrodET.Text.Trim()); - } - - } - - /// <summary> - /// 鐧诲綍 - /// </summary> - /// <param name="accountStr">Account.</param> - /// <param name="passwordStr">Password.</param> - private void Login(string accountStr, string passwordStr) - { - //Application.RunOnMainThread( () => - //{ - Action action = async () => - { - try - { - if (CheckAccount(accountStr) == false) - { - return; - } +namespace Shared.Phone.Login +{ + /// <summary> + /// 鐧诲綍鐣岄潰 + /// </summary> + public class AccountLogin : FrameLayoutBase + { + #region 鈻� 鍙橀噺澹版槑___________________________ - CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining)); - - var requestObj = new SendDataToServer.LoginObj - { - Account = accountStr, - Password = passwordStr, - Source = CommonPage.Source, - Company = CommonPage.Company - }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/Login", System.Text.Encoding.UTF8.GetBytes(requestJson)); - if (revertObj == null) - { - CommonPage.Instance.FailureToServer(); - CommonPage.Loading.Hide(); - return; - } - var stateCodeStr = revertObj.StateCode.ToUpper(); - //Error 涓嶈兘鐩存帴浠庢湇鍔″櫒鍙栵紝鍙兘鏍规嵁鐘舵�佺爜閫愪竴鍒ゆ柇 - if (stateCodeStr == "SUCCESS") - { - if (revertObj.ResponseData == null) - { - return; - } - - HomePage.Instance.ShowLoginLoadView(); - - new System.Threading.Thread(async () => - { - //瀛樺偍鏁版嵁 - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString()); - var revertData = responseDataObj; - Config.ReFresh(); - //鏍囪涓婁竴娆℃槸涓嶆槸鍚屼竴涓处鍙风櫥闄� - UserCenter.UserCenterResourse.ResidenceOption.TheSameLoginAccount = Config.Instance.Guid == revertData.Guid; - Config.Instance.Account = revertData.Account; - Config.Instance.Password = passwordStr; - Config.Instance.MD5PWD = revertData.MD5PWD; - Config.Instance.Guid = revertData.Guid; - Config.Instance.LoginDateTime = DateTime.Now; - Config.Instance.LoginToken = revertData.Token; - Config.Instance.Save(); - - var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); - var homes = await House.GetHomeLists(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - Application.RunOnMainThread(() => - { - CommonPage.Loading.Hide(); - this.RemoveFromParent(); - CommonPage.Instance.RemoveViewByTag("Login"); - UserPage.Instance.Fresh(); - }); - }) - { IsBackground = true }.Start(); - } - else if (stateCodeStr == "NOTVERIFY") - { - CommonPage.Loading.Hide(); - //鏈縺娲� - loginErrorBtn.TextID = R.MyInternationalizationString.NOTVERIFY; - } - else if (stateCodeStr == "NOTENABLE") - { - CommonPage.Loading.Hide(); - //璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤 - loginErrorBtn.TextID = R.MyInternationalizationString.NOTENABLE; - } - else if (stateCodeStr == "USERNAMEORPWDERROR") - { - CommonPage.Loading.Hide(); - //璐﹀彿鎴栧瘑鐮侀敊璇� - loginErrorBtn.TextID = R.MyInternationalizationString.USERNAMEORPWDERROR; - } - else if (stateCodeStr == "ACCOUNTNOEXISTS") - { - CommonPage.Loading.Hide(); - //璐﹀彿涓嶅瓨鍦� - loginErrorBtn.TextID = R.MyInternationalizationString.ACCOUNTNOEXISTS; - } - else if (stateCodeStr == "YOUDATANOISLOCALREGION") - { - CommonPage.Loading.Hide(); - //涓嶅湪鏈尯鍩燂紝闇�瑕侀噸瀹氬悜鍖哄煙鍚庡啀娆¤姹傜櫥褰� - if (revertObj.ResponseData == null) - { - return; - } - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginLocalRegionRes>(revertObj.ResponseData.ToString()); - CommonPage.RequestHttpsHost = responseDataObj.RegionServer; - //鍐嶆鐧诲綍 - Login(accountStr, passwordStr); - } - else - { - loginErrorBtn.TextID = R.MyInternationalizationString.RequestServerFailed; - } - } - catch (Exception ex) - { - System.Console.WriteLine($"鐧诲綍澶辫触--{ex.Message}"); - CommonPage.Loading.Hide(); - CommonPage.Instance.FailureToServer(); - } - finally - { - //CommonPage.Loading.Hide(); - } - //}); - }; - action(); - } - - /// <summary> - /// CheckAccount - /// </summary> - /// <param name="accountStr"></param> - /// <returns></returns> - private bool CheckAccount(string accountStr) - { - if (phoneEmailForm.SelectedEmail.IsSelected) - { - if (AccountLogic.Instance.CheckEmail(accountStr) == false) - { - loginErrorBtn.TextID = R.MyInternationalizationString.TheEmailError; - return false; - } - } - else - { - if (AccountLogic.Instance.CheckPhone(accountStr) == false) - { - loginErrorBtn.TextID = R.MyInternationalizationString.ThePhoneError; - return false; - } - } - return true; - } - - /// <summary> - /// 閫氳繃楠岃瘉鐮佺櫥褰� - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void LoginByCode(object sender, MouseEventArgs mouseEventArgs) - { - //妫�娴嬮殣绉佸崗璁� - if (this.CheckPrivacyPolicy() == false) - { - return; - } - //this.RemoveFromParent(); - var loginByCodePage = new AccountLoginByCode(); - CommonPage.Instance.AddChidren(loginByCodePage); - loginByCodePage.Show(); - } - - /// <summary> - /// wechat鐧诲綍 - /// </summary> - /// <param name="sender"></param> - /// <param name="mouseEventArgs"></param> - private void LoginByWechat(object sender, MouseEventArgs mouseEventArgs) - { - //妫�娴嬮殣绉佸崗璁� - if (this.CheckPrivacyPolicy() == false) - { - return; - } -#if Android - //var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), - // Language.StringByID(R.MyInternationalizationString.LoginByWechat), - // Language.StringByID(R.MyInternationalizationString.Cancel), - // Language.StringByID(R.MyInternationalizationString.Confrim)); - //alert.Show(); - //alert.ResultEventHandler += (send, e) => - //{ - //if (e) - //{ - com.hdl.home.Application.WXLogin(); - com.hdl.home.WXEntryActivity.RespAction = (authStr) => - { - if (authStr == null) - { - - } - else - { - new System.Threading.Thread(async () => - { - var re = await isBindAuthAsync(authStr); - if (re) - { - Application.RunOnMainThread(() => - { - //鐩存帴鐧诲綍 - HomePage.Instance.ShowLoginLoadView(); - }); - var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); - var homes = await House.GetHomeLists(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - Application.RunOnMainThread(() => - { - this.RemoveFromParent(); - CommonPage.Instance.RemoveViewByTag("Login"); - UserPage.Instance.Fresh(); - }); - } - else - { - var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr); - Application.RunOnMainThread(() => - { - var registerPage = new AccountRegister(); - Shared.Common.CommonPage.Instance.AddChidren(registerPage); - registerPage.OpenID = authRes.openid; - registerPage.Show(); - }); - } - }) - { IsBackground = true }.Start(); - } - }; - //} - //}; -#endif - -#if iOS - Home.IOS.AppDelegate.WXLogin(); - Home.IOS.AppDelegate.RespAction = (authStr) => - { - if (authStr == null) - { - - } - else - { - new System.Threading.Thread(async () => - { - - var re = await isBindAuthAsync(authStr); - if (re) - { - //鐩存帴鐧诲綍 - //this.RemoveFromParent(); - - //UserPage.Instance.Fresh(); - var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); - var homes = await House.GetHomeLists(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - Application.RunOnMainThread(() => - { - this.RemoveFromParent(); - UserPage.Instance.Fresh(); - }); - } - else - { - var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr); - Application.RunOnMainThread(() => - { - var registerPage = new AccountRegister(); - Shared.Common.CommonPage.Instance.AddChidren(registerPage); - registerPage.OpenID = authRes.openid; - registerPage.Show(); - }); - } - }) - { IsBackground = true }.Start(); - } - }; -#endif - - - - } - - /// <summary> - /// qq鐧诲綍 - /// </summary> - /// <param name="sender"></param> - /// <param name="mouseEventArgs"></param> - private void LoginByQQ(object sender, MouseEventArgs mouseEventArgs) - { - - } - - /// <summary> - /// phone/email 閫夋嫨 - /// </summary> - /// <param name="sender"></param> - /// <param name="mouseEventArgs"></param> - private void SelectPhoneOrEmail_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) - { - phoneEmailForm.SelectedPhone.IsSelected = phoneEmailForm.SelectedEmail.IsSelected = false; - phoneEmailForm.SelectedPhone.IsBold = phoneEmailForm.SelectedEmail.IsBold = false; - loginBtn.Enable = loginBtn.IsSelected = false; - loginErrorBtn.Text = string.Empty; - (sender as Button).IsSelected = (sender as Button).IsBold = true; - if ((sender as Button).Tag.ToString() == "Phone") - { - AddPhoneOrEmailFL(accountPwdFL, "Phone"); - } - else - { - AddPhoneOrEmailFL(accountPwdFL, "Email"); - } - } - /// <summary> - /// AddPhoneOrEmailFL - /// </summary> - /// <param name="accountPwdFrameLayout"></param> - /// <param name="phoneOrEmail"></param> - private void AddPhoneOrEmailFL(FrameLayout accountPwdFrameLayout, string phoneOrEmail) - { - if (phoneOrEmail == "Phone") - { - if (phoneRow != null) - { - phoneRow.Visible = true; - phonePwdRow.Visible = true; - if (emailRow != null) - { - emailRow.Visible = false; - emailPwdRow.Visible = false; - } - this.Pwd_TextChange(phonePwdRow); - return; - } - phoneRow = new PhoneLoginRowForm(); - phoneRow.Init(accountPwdFrameLayout, this, this.oldInputPhone, 29, 29); - phoneRow.AccountET.TextChangeEventHandler += Account_TextChange; - - phonePwdRow = new PwdLoginRowForm(); - phonePwdRow.Init(accountPwdFrameLayout, 29, 225); - phonePwdRow.PasswrodET.TextChangeEventHandler += (sender, e) => - { - this.Pwd_TextChange(phonePwdRow); - }; - } - else - { - if (emailRow != null) - { - emailRow.Visible = true; - emailPwdRow.Visible = true; - if (phoneRow != null) - { - phoneRow.Visible = false; - phonePwdRow.Visible = false; - } - this.Pwd_TextChange(emailPwdRow); - return; - } - emailRow = new EmailLoginRowForm(); - emailRow.Init(accountPwdFrameLayout, this.oldInputEmail, 29, 29); - emailRow.AccountET.TextChangeEventHandler += Account_TextChange; - - emailPwdRow = new PwdLoginRowForm(); - emailPwdRow.Init(accountPwdFrameLayout, 29, 225); - emailPwdRow.PasswrodET.TextChangeEventHandler += (sender, e) => - { - this.Pwd_TextChange(emailPwdRow); - }; - } - } - #endregion - - - #region 鈼� 蹇樿瀵嗙爜________________________ - /// <summary> - /// 蹇樿瀵嗙爜 - /// </summary> - private void ForgetPWD_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) - { - //妫�娴嬮殣绉佸崗璁� - if (this.CheckPrivacyPolicy() == false) - { - return; - } - var forgot = new AccountForgetPWD(); - CommonPage.Instance.AddChidren(forgot); - forgot.Show(); - } - - #endregion - - #region 鈼� 娉ㄥ唽_____________________________ - - /// <summary> - /// 娉ㄥ唽 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void Register(object sender, MouseEventArgs mouseEventArgs) - { - //妫�娴嬮殣绉佸崗璁� - if (this.CheckPrivacyPolicy() == false) - { - return; - } - var registerPage = new AccountRegister(); - CommonPage.Instance.AddChidren(registerPage); - registerPage.Show(); - } - - #endregion - - #region 鈼� 璐﹀彿瀵嗙爜鐩戝惉______________________ - /// <summary> - /// 璐﹀彿鐩戝惉 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void Account_TextChange(object sender, string mouseEventArgs) - { - loginErrorBtn.Text = string.Empty; - } - - /// <summary> - /// 瀵嗙爜鐩戝惉浜嬩欢 - /// </summary> - /// <param name="pwdRow">Sender.</param> - private void Pwd_TextChange(PwdLoginRowForm pwdRow) - { - loginErrorBtn.Text = string.Empty; - string pswText = pwdRow.PasswrodET.Text.Trim(); - if (1 <= pswText.Length && pswText.Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length > 0)) - { - loginBtn.Enable = loginBtn.IsSelected = true; - } - else if (pswText.Length > 16) - { - pwdRow.PasswrodET.Text = pswText.Substring(0, 16); - if (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow?.AccountET.Text.Trim().Length > 0) - { - loginBtn.Enable = loginBtn.IsSelected = true; - } - } - else - { - loginBtn.Enable = loginBtn.IsSelected = false; - } - } - - - #endregion - - - - - #region 鈻� 鍙橀噺澹版槑___________________________ - /// <summary> /// 閿欒鎻愮ず鎺т欢 - /// </summary> - private NormalViewControl btnErrorMsg = null; + /// </summary> + private NormalViewControl btnErrorMsg = null; /// <summary> /// 鏄惁鍚屾剰闅愮鍗忚 - /// </summary> - private bool isAgreePrivacyPolicy = true; - - #endregion + /// </summary> + private bool isAgreePrivacyPolicy = true; - #region 鈻� 鍒濆鍖朹____________________________ - + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + /// <summary> /// 鐣岄潰鏄剧ず /// </summary> @@ -860,57 +36,57 @@ { return; } - CommonPage.Instance.IsDrawerLockMode = true; - this.Tag = "Login"; - - //鐣岄潰涓婇儴鐨勯粦鑹插浘鐗� - var btnTopBlackPic = new NormalViewControl(this.Width, Application.GetRealHeight(619), false); - btnTopBlackPic.UnSelectedImagePath = "Account/Logo_loginBG.png"; - this.AddChidren(btnTopBlackPic); - - //涓棿娴呯櫧鑹茬殑鑳屾櫙 - var frameMidBack = new FrameLayout(); - frameMidBack.Y = btnTopBlackPic.Bottom; - frameMidBack.Height = this.Height - btnTopBlackPic.Bottom; - frameMidBack.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor; - this.AddChidren(frameMidBack); - - //HdlHome鐨勫浘鏍� - var btnLogoIcon = new PicViewControl(184, 184); - btnLogoIcon.Y = Application.GetRealHeight(230); - btnLogoIcon.UnSelectedImagePath = "Account/Logo_White.png"; + CommonPage.Instance.IsDrawerLockMode = true; + this.Tag = "Login"; + + //鐣岄潰涓婇儴鐨勯粦鑹插浘鐗� + var btnTopBlackPic = new NormalViewControl(this.Width, Application.GetRealHeight(619), false); + btnTopBlackPic.UnSelectedImagePath = "Account/Logo_loginBG.png"; + this.AddChidren(btnTopBlackPic); + + //涓棿娴呯櫧鑹茬殑鑳屾櫙 + var frameMidBack = new FrameLayout(); + frameMidBack.Y = btnTopBlackPic.Bottom; + frameMidBack.Height = this.Height - btnTopBlackPic.Bottom; + frameMidBack.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor; + this.AddChidren(frameMidBack); + + //HdlHome鐨勫浘鏍� + var btnLogoIcon = new PicViewControl(184, 184); + btnLogoIcon.Y = Application.GetRealHeight(230); + btnLogoIcon.UnSelectedImagePath = "Account/Logo_White.png"; btnLogoIcon.Gravity = Gravity.CenterHorizontal; - this.AddChidren(btnLogoIcon); - //Hdl Home + this.AddChidren(btnLogoIcon); + //Hdl Home var btnLogoName = new NormalViewControl(300, 69, true); btnLogoName.Y = btnLogoIcon.Bottom; btnLogoName.Gravity = Gravity.CenterHorizontal; btnLogoName.TextID = R.MyInternationalizationString.AppName; btnLogoName.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; btnLogoName.TextAlignment = TextAlignment.Center; - btnLogoName.TextSize = 16; + btnLogoName.TextSize = 16; this.AddChidren(btnLogoName); //1:鎵嬫満鍙� 2锛氶偖绠� int selectIndex = account.Contains("@") == false ? 1 : 2; //鍒濆鍖� 鎵嬫満璐﹀彿鐧婚檰绐楀彛 - var frameAccLoginPhoneback = this.InitAccoutLoginWindow(frameMidBack, selectIndex == 1 ? account : string.Empty, 1); + var frameAccLoginPhoneback = this.InitAccoutLoginWindow(frameMidBack, selectIndex == 1 ? account : string.Empty, 1); //鍒濆鍖� 閭璐﹀彿鐧婚檰绐楀彛 var frameEmailLoginPhoneback = this.InitAccoutLoginWindow(frameMidBack, selectIndex == 1 ? string.Empty : account, 2); //鍒濆鍖� 鎵嬫満璐﹀彿楠岃瘉鐮佺櫥闄嗙獥鍙� - var frameAccCodeLoginPhoneback = this.InitCodeLoginWindow(frameMidBack, selectIndex == 1 ? account : string.Empty, 1); + var frameAccCodeLoginPhoneback = this.InitCodeLoginWindow(frameMidBack, selectIndex == 1 ? account : string.Empty, 1); //鍒濆鍖� 閭璐﹀彿楠岃瘉鐮佺櫥闄嗙獥鍙� - var frameEmailCodeLoginPhoneback = this.InitCodeLoginWindow(frameMidBack, selectIndex == 1 ? string.Empty : account, 2); - - //瀹氫箟杩欎袱涓笢瑗�,鏄负浜嗗噺灏戝垽鏂殑浠g爜 - var framePhone = frameAccLoginPhoneback; - var frameEmail = frameEmailLoginPhoneback; - - //閭,鎵嬫満鍙风殑鍒囨崲鎺т欢 - var sitchControl = new Controls.PhoneEmailSelectControl(); - sitchControl.Y = Application.GetRealHeight(559); - this.AddChidren(sitchControl); + var frameEmailCodeLoginPhoneback = this.InitCodeLoginWindow(frameMidBack, selectIndex == 1 ? string.Empty : account, 2); + + //瀹氫箟杩欎袱涓笢瑗�,鏄负浜嗗噺灏戝垽鏂殑浠g爜 + var framePhone = frameAccLoginPhoneback; + var frameEmail = frameEmailLoginPhoneback; + + //閭,鎵嬫満鍙风殑鍒囨崲鎺т欢 + var sitchControl = new Controls.PhoneEmailSelectControl(); + sitchControl.Y = Application.GetRealHeight(559); + this.AddChidren(sitchControl); sitchControl.SelectMenuEvent += (selectMenu) => { selectIndex = selectMenu; @@ -926,26 +102,26 @@ framePhone.Visible = false; frameEmail.Visible = true; } - }; - //鎵ц鍒濆鍖� - sitchControl.InitControl(ZigbeeColor.Current.GXCButtonSelectedColor, selectIndex); - - //閿欒鎻愮ず鎺т欢 - this.btnErrorMsg = new NormalViewControl(700, 60, true); - btnErrorMsg.Y = frameAccLoginPhoneback.Y - Application.GetRealHeight(60 + 3); - btnErrorMsg.X = Application.GetRealWidth(288); - btnErrorMsg.TextColor = ZigbeeColor.Current.GXCTextRed; - btnErrorMsg.IsBold = true; + }; + //鎵ц鍒濆鍖� + sitchControl.InitControl(ZigbeeColor.Current.GXCButtonSelectedColor, selectIndex); + + //閿欒鎻愮ず鎺т欢 + this.btnErrorMsg = new NormalViewControl(700, 60, true); + btnErrorMsg.Y = frameAccLoginPhoneback.Y - Application.GetRealHeight(60 + 3); + btnErrorMsg.X = Application.GetRealWidth(288); + btnErrorMsg.TextColor = ZigbeeColor.Current.GXCTextRed; + btnErrorMsg.IsBold = true; frameMidBack.AddChidren(btnErrorMsg); //楠岃瘉鐮佺櫥闄� //1:璐﹀彿鐧婚檰 2:楠岃瘉鐮佺櫥闄� int codeDiv = 1; - var btnLoginByCode = new NormalViewControl(300, 100, true); + var btnLoginByCode = new NormalViewControl(300, 100, true); btnLoginByCode.X = Application.GetRealWidth(98); - btnLoginByCode.Y = frameAccLoginPhoneback.Bottom + Application.GetRealHeight(21); - btnLoginByCode.TextID = R.MyInternationalizationString.LoginByCode; - btnLoginByCode.TextColor = UserCenterColor.Current.TextGrayColor3; + btnLoginByCode.Y = frameAccLoginPhoneback.Bottom + Application.GetRealHeight(21); + btnLoginByCode.TextID = R.MyInternationalizationString.LoginByCode; + btnLoginByCode.TextColor = UserCenterColor.Current.TextGrayColor3; btnLoginByCode.TextSize = 12; frameMidBack.AddChidren(btnLoginByCode); btnLoginByCode.ButtonClickEvent += (sender, e) => @@ -979,12 +155,12 @@ }; //娉ㄥ唽鐢ㄦ埛 - var btnRegister = new NormalViewControl(244, 100, true); - btnRegister.Y = btnLoginByCode.Y; - btnRegister.X = frameMidBack.Width - Application.GetRealWidth(98 + 244); - btnRegister.TextID = R.MyInternationalizationString.Register; - btnRegister.TextColor = UserCenterColor.Current.TextGrayColor3; - btnRegister.TextSize = 12; + var btnRegister = new NormalViewControl(300, 100, true); + btnRegister.Y = btnLoginByCode.Y; + btnRegister.X = frameMidBack.Width - Application.GetRealWidth(98 + 300); + btnRegister.TextID = R.MyInternationalizationString.Register; + btnRegister.TextColor = UserCenterColor.Current.TextGrayColor3; + btnRegister.TextSize = 12; btnRegister.TextAlignment = TextAlignment.CenterRight; frameMidBack.AddChidren(btnRegister); btnRegister.ButtonClickEvent += (sender, e) => @@ -995,9 +171,9 @@ }; //寰俊鍥炬爣 - var btnWebChat = new IconViewControl(115); - btnWebChat.Y = frameMidBack.Height - Application.GetRealHeight(69) - btnWebChat.IconSize; - btnWebChat.UnSelectedImagePath = "Account/Wechat.png"; + var btnWebChat = new IconViewControl(115); + btnWebChat.Y = frameMidBack.Height - Application.GetRealHeight(69) - btnWebChat.IconSize; + btnWebChat.UnSelectedImagePath = "Account/Wechat.png"; btnWebChat.Gravity = Gravity.CenterHorizontal; frameMidBack.AddChidren(btnWebChat); btnWebChat.ButtonClickEvent += (sender, e) => @@ -1007,19 +183,46 @@ }; //娣诲姞鏈嶅姟鍗忚鎺т欢 - // this.AddServiceAgreementControl(frameMidBack); + //this.AddServiceAgreementControl(frameMidBack); + + //娓稿浣撻獙 + var btnTiyan = new NormalViewControl(300, 100, true); + btnTiyan.Y = btnLoginByCode.Y; + btnTiyan.TextAlignment = TextAlignment.Center; + btnTiyan.TextColor = UserCenterColor.Current.TextGrayColor3; + btnTiyan.TextSize = 12; + btnTiyan.Gravity = Gravity.CenterHorizontal; + btnTiyan.Text = "娓稿浣撻獙"; + frameMidBack.AddChidren(btnTiyan); + btnTiyan.ButtonClickEvent += (sender, e) => + { + btnTiyan.CanClick = false; + //鏄剧ず鍚姩椤� + HomePage.Instance.ShowLoginLoadView(); + HdlThreadLogic.Current.RunThread(() => + { + //鍒濆鍖栧叏閮ㄤ綋楠屾暟鎹� + HdlExperienceAccountLogic.Current.InitAllExperienceData(); + HdlThreadLogic.Current.RunMain(() => + { + this.RemoveFromParent(); + CommonPage.Instance.RemoveViewByTag("Login"); + UserPage.Instance.Fresh(); + }); + }); + }; } - #endregion + #endregion - #region 鈻� 鍒濆鍖栬处鍙风櫥闄嗙獥鍙________________ - + #region 鈻� 鍒濆鍖栬处鍙风櫥闄嗙獥鍙________________ + /// <summary> /// 鍒濆鍖栬处鍙风櫥闄嗙獥鍙� /// </summary> /// <param name="frameMidBack">涓棿娴呰壊鐨勮儗鏅鍣�</param> /// <param name="i_account">鐧婚檰璐﹀彿</param> - /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> + /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> private FrameLayout InitAccoutLoginWindow(FrameLayout frameMidBack, string i_account, int i_div) { //鐧婚檰鎸夐挳 @@ -1077,10 +280,7 @@ txtAccount.TextChangeEventHandler += (sender, e) => { //闅愯棌閿欒鎻愮ず - if (this.btnErrorMsg.Visible == true) - { - this.btnErrorMsg.Visible = false; - } + this.btnErrorMsg.Text = string.Empty; if (txtAccount.Text.Trim().Length > 0 && txtPsw.Text.Length > 0) { //鑳藉鐧婚檰 @@ -1139,9 +339,9 @@ //闅愯棌鎴栬�呮樉绀哄瘑鐮佺殑鍥炬爣 var btnHiden = new IconViewControl(92); btnHiden.X = rowPassword.Width - Application.GetRealWidth(46) - btnHiden.IconSize; - btnHiden.SelectedImagePath = "Account/UnhidePwd.png"; + btnHiden.SelectedImagePath = "Account/UnhidePwd.png"; btnHiden.UnSelectedImagePath = "Account/HidePwd.png"; - btnHiden.Gravity = Gravity.CenterVertical; + btnHiden.Gravity = Gravity.CenterVertical; rowPassword.AddChidren(btnHiden); btnHiden.ButtonClickEvent += (sender, e) => { @@ -1170,13 +370,13 @@ }; //蹇樿瀵嗙爜? - var btnForgot = new NormalViewControl(250, 90, true); - btnForgot.Y = rowPassword.Bottom + Application.GetRealHeight(15); - btnForgot.X = frameWhiteBack.Width - Application.GetRealWidth(250 + 35); - btnForgot.TextSize = 12; - btnForgot.TextColor = UserCenterColor.Current.TextGrayColor3; - btnForgot.TextAlignment = TextAlignment.CenterRight; - btnForgot.TextID = R.MyInternationalizationString.ForgotPWD_1; + var btnForgot = new NormalViewControl(250, 90, true); + btnForgot.Y = rowPassword.Bottom + Application.GetRealHeight(15); + btnForgot.X = frameWhiteBack.Width - Application.GetRealWidth(250 + 35); + btnForgot.TextSize = 12; + btnForgot.TextColor = UserCenterColor.Current.TextGrayColor3; + btnForgot.TextAlignment = TextAlignment.CenterRight; + btnForgot.TextID = R.MyInternationalizationString.ForgotPWD_1; frameWhiteBack.AddChidren(btnForgot); btnForgot.ButtonClickEvent += (sender, e) => { @@ -1201,7 +401,7 @@ return frameBack; } - #endregion + #endregion #region 鈻� 鍒濆鍖栭獙璇佺爜鐧婚檰绐楀彛_______________ @@ -1210,7 +410,7 @@ /// </summary> /// <param name="frameMidBack">涓棿娴呰壊鐨勮儗鏅鍣�</param> /// <param name="i_account">鐧婚檰璐﹀彿</param> - /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> + /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> private FrameLayout InitCodeLoginWindow(FrameLayout frameMidBack, string i_account, int i_div) { //鐧婚檰鎸夐挳 @@ -1286,12 +486,9 @@ txtAccount.TextChangeEventHandler += (sender, e) => { //闅愯棌閿欒鎻愮ず - if (this.btnErrorMsg.Visible == true) - { - this.btnErrorMsg.Visible = false; - } + this.btnErrorMsg.Text = string.Empty; //蹇呴』瑕佸彂閫佹垚鍔熸墠琛� - if (hadSendCode = true && txtAccount.Text.Trim().Length > 0 && txtVerCode.Text.Length > 0) + if (hadSendCode == true && txtAccount.Text.Trim().Length > 0 && txtVerCode.Text.Length > 0) { //鑳藉鐧婚檰 if (btnLogin.CanClick == false) { btnLogin.CanClick = true; } @@ -1339,25 +536,24 @@ txtVerCode.Gravity = Gravity.CenterVertical; txtVerCode.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputVerificationCode); txtVerCode.PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor; - txtVerCode.SecureTextEntry = true; rowVerCode.AddChidren(txtVerCode); txtVerCode.TextChangeEventHandler += (sender, e) => { txtAccount.TextChangeEventHandler(sender, e); }; //绔栫嚎 - var btnLine2 = new NormalViewControl(1, Application.GetRealHeight(66), false); + var btnLine2 = new NormalViewControl(1, Application.GetRealHeight(66), false); btnLine2.X = Application.GetRealWidth(611); btnLine2.Gravity = Gravity.CenterVertical; btnLine2.BackgroundColor = ZigbeeColor.Current.GXCLineColor; rowVerCode.AddChidren(btnLine2); //鑾峰彇楠岃瘉鐮� - var btnSendCode = new NormalViewControl(250, 70, true); - btnSendCode.X = btnLine2.Right + Application.GetRealWidth(36); - btnSendCode.Gravity = Gravity.CenterVertical; + var btnSendCode = new NormalViewControl(250, 70, true); + btnSendCode.X = btnLine2.Right + Application.GetRealWidth(36); + btnSendCode.Gravity = Gravity.CenterVertical; btnSendCode.TextID = R.MyInternationalizationString.SendVerificationCode; btnSendCode.TextColor = UserCenterColor.Current.TextGrayColor3; - btnSendCode.TextAlignment = TextAlignment.Center; + btnSendCode.TextAlignment = TextAlignment.Center; btnSendCode.IsBold = true; rowVerCode.AddChidren(btnSendCode); btnSendCode.ButtonClickEvent += async (sender, e) => @@ -1393,13 +589,13 @@ }; //蹇樿瀵嗙爜? - var btnForgot = new NormalViewControl(250, 90, true); - btnForgot.Y = rowVerCode.Bottom + Application.GetRealHeight(15); - btnForgot.X = frameWhiteBack.Width - Application.GetRealWidth(250 + 35); - btnForgot.TextSize = 12; - btnForgot.TextColor = UserCenterColor.Current.TextGrayColor3; - btnForgot.TextAlignment = TextAlignment.CenterRight; - btnForgot.TextID = R.MyInternationalizationString.ForgotPWD_1; + var btnForgot = new NormalViewControl(250, 90, true); + btnForgot.Y = rowVerCode.Bottom + Application.GetRealHeight(15); + btnForgot.X = frameWhiteBack.Width - Application.GetRealWidth(250 + 35); + btnForgot.TextSize = 12; + btnForgot.TextColor = UserCenterColor.Current.TextGrayColor3; + btnForgot.TextAlignment = TextAlignment.CenterRight; + btnForgot.TextID = R.MyInternationalizationString.ForgotPWD_1; frameWhiteBack.AddChidren(btnForgot); btnForgot.ButtonClickEvent += (sender, e) => { @@ -1423,7 +619,7 @@ return frameBack; } - #endregion + #endregion #region 鈻� 鏈嶅姟鍗忚___________________________ @@ -1434,7 +630,7 @@ private void AddServiceAgreementControl(FrameLayout frameBack) { var frameRow = new FrameLayout(); - frameRow.Height = Application.GetMinRealAverage(110); + frameRow.Height = this.GetPictrueRealSize(110); frameRow.Y = Application.GetRealHeight(959); frameRow.Gravity = Gravity.CenterHorizontal; @@ -1512,7 +708,7 @@ btnIcon.SelectedImagePath = "Item/Check1Selected.png"; //璁$畻琛屾帶浠剁殑瀹藉害 - frameRow.Width = fontWidth + Application.GetMinRealAverage(42) + Application.GetRealWidth(23) - speceilValue * 3; + frameRow.Width = fontWidth + this.GetPictrueRealSize(42) + Application.GetRealWidth(23) - speceilValue * 3; frameBack.AddChidren(frameRow); //鍥炬爣鎺т欢鍒濆鍖� @@ -1541,14 +737,14 @@ #endregion - #region 鈻� 璐﹀彿瀵嗙爜鐧婚檰_______________________ + #region 鈻� 璐﹀彿瀵嗙爜鐧婚檰_______________________ /// <summary> /// 璐﹀彿瀵嗙爜鐧婚檰 /// </summary> /// <param name="i_account">璐﹀彿</param> - /// <param name="i_psw">瀵嗙爜</param> - /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> + /// <param name="i_psw">瀵嗙爜</param> + /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> private void LoginByAccountAndPsw(string i_account, string i_psw, int i_div) { //妫�娴嬭处鍙� @@ -1578,59 +774,59 @@ }); } - /// <summary> - /// 妫�娴嬭緭鍏ョ殑璐﹀彿 - /// </summary> - /// <param name="i_areaCode">鍦板尯鐮�</param> - /// <param name="i_account">璐﹀彿</param> - /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> - /// <returns></returns> - private bool CheckInputAccount(string i_areaCode, string i_account, int i_div) - { + /// <summary> + /// 妫�娴嬭緭鍏ョ殑璐﹀彿 + /// </summary> + /// <param name="i_areaCode">鍦板尯鐮�</param> + /// <param name="i_account">璐﹀彿</param> + /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> + /// <returns></returns> + private bool CheckInputAccount(string i_areaCode, string i_account, int i_div) + { if (i_div == 1) { //妫�娴嬫墜鏈� - if (i_areaCode != string.Empty && AccountLogic.Instance.CheckPhoneWithZone(i_account, i_areaCode) == false) - { - btnErrorMsg.TextID = R.MyInternationalizationString.ThePhoneError; - return false; + if (i_areaCode != string.Empty && AccountLogic.Instance.CheckPhoneWithZone(i_account, i_areaCode) == false) + { + btnErrorMsg.TextID = R.MyInternationalizationString.ThePhoneError; + return false; } //妫�娴嬫墜鏈� - if (i_areaCode == string.Empty && AccountLogic.Instance.CheckPhone(i_account) == false) - { - btnErrorMsg.TextID = R.MyInternationalizationString.ThePhoneError; - return false; + if (i_areaCode == string.Empty && AccountLogic.Instance.CheckPhone(i_account) == false) + { + btnErrorMsg.TextID = R.MyInternationalizationString.ThePhoneError; + return false; } - } - else + } + else { //妫�娴嬮偖绠� - if (AccountLogic.Instance.CheckEmail(i_account) == false) - { - btnErrorMsg.TextID = R.MyInternationalizationString.TheEmailError; - return false; + if (AccountLogic.Instance.CheckEmail(i_account) == false) + { + btnErrorMsg.TextID = R.MyInternationalizationString.TheEmailError; + return false; } - } - return true; + } + return true; } - #endregion + #endregion - #region 鈻� 寰俊鐧婚檰___________________________ + #region 鈻� 寰俊鐧婚檰___________________________ - /// <summary> - /// 寰俊鐧诲綍 - /// </summary> - private void LoginByWechat() + /// <summary> + /// 寰俊鐧诲綍 + /// </summary> + private void LoginByWechat() { #if Android com.hdl.home.Application.WXLogin(); com.hdl.home.WXEntryActivity.RespAction = (authStr) => { #endif -#if iOS +#if iOS Home.IOS.AppDelegate.WXLogin(); - Home.IOS.AppDelegate.RespAction = (authStr) => + Home.IOS.AppDelegate.RespAction = (authStr) => { #endif if (authStr == null) @@ -1677,19 +873,19 @@ }; } - /// <summary> - /// 鏄惁宸茬粦瀹� - /// </summary> - /// <param name="authStr"></param> - /// <returns></returns> - private async System.Threading.Tasks.Task<bool> isBindAuthAsync(string authStr) - { - var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr); - var auth = new SendDataToServer.AuthUser() - { - AccessToken = authRes.access_token, - RefreshToken = authRes.refresh_token, - OpenID = authRes.openid + /// <summary> + /// 鏄惁宸茬粦瀹� + /// </summary> + /// <param name="authStr"></param> + /// <returns></returns> + private async System.Threading.Tasks.Task<bool> isBindAuthAsync(string authStr) + { + var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr); + var auth = new SendDataToServer.AuthUser() + { + AccessToken = authRes.access_token, + RefreshToken = authRes.refresh_token, + OpenID = authRes.openid }; //鑾峰彇寰俊鏄电О var strUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + authRes.access_token; @@ -1701,44 +897,44 @@ } var receipData = System.Text.Encoding.UTF8.GetString(byteData); var nickData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserCenter.NicknameInfo>(receipData); - auth.UserName = nickData.nickname; - - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth); - var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/InsertOrUpdateAuthUser", System.Text.Encoding.UTF8.GetBytes(requestJson)); - if (revertObj == null) - { - return false; - } - var stateCodeStr = revertObj.StateCode.ToUpper(); - if (stateCodeStr == "SUCCESS") - { - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString()); + auth.UserName = nickData.nickname; + + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth); + var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/InsertOrUpdateAuthUser", System.Text.Encoding.UTF8.GetBytes(requestJson)); + if (revertObj == null) + { + return false; + } + var stateCodeStr = revertObj.StateCode.ToUpper(); + if (stateCodeStr == "SUCCESS") + { + var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString()); var revertData = responseDataObj; //鏍囪涓婁竴娆℃槸涓嶆槸鍚屼竴涓处鍙风櫥闄� - UserCenter.UserCenterResourse.ResidenceOption.TheSameLoginAccount = Config.Instance.Guid == revertData.Guid; - Config.Instance.Account = revertData.Account; - Config.Instance.MD5PWD = revertData.MD5PWD; - Config.Instance.Guid = revertData.Guid; - Config.Instance.LoginDateTime = DateTime.Now; - Config.Instance.Save(); - return true; - } - else - { - return false; - } + UserCenter.UserCenterResourse.ResidenceOption.TheSameLoginAccount = Config.Instance.Guid == revertData.Guid; + Config.Instance.Account = revertData.Account; + Config.Instance.MD5PWD = revertData.MD5PWD; + Config.Instance.Guid = revertData.Guid; + Config.Instance.LoginDateTime = DateTime.Now; + Config.Instance.Save(); + return true; + } + else + { + return false; + } } - #endregion + #endregion - #region 鈻� 楠岃瘉鐮佺櫥闄哶________________________ + #region 鈻� 楠岃瘉鐮佺櫥闄哶________________________ /// <summary> /// 楠岃瘉鐮佺櫥闄� /// </summary> /// <param name="i_account">璐﹀彿</param> - /// <param name="i_verCode">楠岃瘉鐮�</param> - /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> + /// <param name="i_verCode">楠岃瘉鐮�</param> + /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> private async void LoginByVerCode(string i_account, string i_verCode, int i_div) { var pra = new SendDataToServer.LoginValidCodeOBJ() @@ -1751,15 +947,15 @@ var result = await CommonFormResouce.LoginByCode(pra); //澶勭悊鐧婚檰鎴愬姛鐨勬暟鎹� this.AdjustLoginSuccessData(result, pra, i_account, string.Empty, i_div); - } - + } + /// <summary> /// 鍙戦�侀獙璇佺爜 /// </summary> /// <param name="btnSendCode">鍙戦�佹寜閽�</param> /// <param name="account">璐﹀彿</param> /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> - /// <returns></returns> + /// <returns></returns> private async System.Threading.Tasks.Task<bool> SendVerCode(NormalViewControl btnSendCode, string account, int i_div) { //涓嶈兘鍐嶇偣鍑� @@ -1831,12 +1027,12 @@ }); return false; - } - + } + /// <summary> /// 寮�鍚彂閫侀獙璇佺爜鐨勫�掕鏃� /// </summary> - /// <param name="btnSendCode"></param> + /// <param name="btnSendCode"></param> private void StartSendVerCodeTimeOutThread(NormalViewControl btnSendCode) { HdlThreadLogic.Current.RunThread(() => @@ -1851,16 +1047,21 @@ btnSendCode.Text = time + "s" + strText; }); time--; + System.Threading.Thread.Sleep(1000); } //鍊掕鏃跺畬鎴愪箣鍚�,鍙互鍐嶆鐐瑰嚮 btnSendCode.CanClick = true; - btnSendCode.TextID = R.MyInternationalizationString.SendVerificationCode;//鑾峰彇楠岃瘉鐮� + HdlThreadLogic.Current.RunMain(() => + { + //鑾峰彇楠岃瘉鐮� + btnSendCode.Text = Language.StringByID(R.MyInternationalizationString.SendVerificationCode); + }); }); } - #endregion + #endregion - #region 鈻� 澶勭悊鐧婚檰鎴愬姛鐨勬暟鎹甠________________ + #region 鈻� 澶勭悊鐧婚檰鎴愬姛鐨勬暟鎹甠________________ /// <summary> /// 澶勭悊鐧婚檰鎴愬姛鐨勬暟鎹� @@ -1868,8 +1069,8 @@ /// <param name="revertObj">浜戠杩斿洖鐨勬暟鎹�</param> /// <param name="pra">鎺ュ彛璇锋眰鍙傛暟</param> /// <param name="i_account">璐﹀彿</param> - /// <param name="i_psw">瀵嗙爜锛岄獙璇佺爜鐧婚檰鏃�,璁剧疆涓� string.Empty</param> - /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> + /// <param name="i_psw">瀵嗙爜锛岄獙璇佺爜鐧婚檰鏃�,璁剧疆涓� string.Empty</param> + /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param> private async void AdjustLoginSuccessData(Common.ResponseEntity.ResponsePack revertObj, object pra, string i_account, string i_psw, int i_div) { @@ -1936,15 +1137,15 @@ //璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤 btnErrorMsg.TextID = R.MyInternationalizationString.NOTENABLE; } - else if (stateCodeStr == "PARAMETEROREMPTY") - { - //鎻愪緵鐨勫弬鏁伴敊璇� - btnErrorMsg.TextID = R.MyInternationalizationString.PARAMETEROREMPTY; + else if (stateCodeStr == "PARAMETEROREMPTY") + { + //鎻愪緵鐨勫弬鏁伴敊璇� + btnErrorMsg.TextID = R.MyInternationalizationString.PARAMETEROREMPTY; } - else if (stateCodeStr == "VALIDCODEANDPHONENOEQUAL") - { - //楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏� - btnErrorMsg.TextID = R.MyInternationalizationString.VALIDCODEANDPHONENOEQUAL; + else if (stateCodeStr == "VALIDCODEANDPHONENOEQUAL") + { + //楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏� + btnErrorMsg.TextID = R.MyInternationalizationString.VALIDCODEANDPHONENOEQUAL; } else if (stateCodeStr == "USERNAMEORPWDERROR") { @@ -1956,10 +1157,10 @@ //璐﹀彿涓嶅瓨鍦� btnErrorMsg.TextID = R.MyInternationalizationString.ACCOUNTNOEXISTS; } - else if (stateCodeStr == "NORECORD" && i_psw == string.Empty) - { - //璇峰厛鑾峰彇楠岃瘉鐮� - btnErrorMsg.TextID = R.MyInternationalizationString.NORECORD; + else if (stateCodeStr == "NORECORD" && i_psw == string.Empty) + { + //璇峰厛鑾峰彇楠岃瘉鐮� + btnErrorMsg.TextID = R.MyInternationalizationString.NORECORD; } else if (stateCodeStr == "YOUDATANOISLOCALREGION") { @@ -1989,14 +1190,14 @@ }); } - #endregion + #endregion - #region 鈻� 涓�鑸柟娉昣__________________________ - + #region 鈻� 涓�鑸柟娉昣__________________________ + /// <summary> /// 妫�娴嬮殣绉佸崗璁� /// </summary> - /// <returns></returns> + /// <returns></returns> private bool CheckPrivacyPolicy() { if (isAgreePrivacyPolicy == false) @@ -2007,8 +1208,8 @@ return false; } return true; - } - - #endregion - } -} + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs b/ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs deleted file mode 100755 index db2e075..0000000 --- a/ZigbeeApp/Shared/Phone/Login/AccountLoginByCode.cs +++ /dev/null @@ -1,884 +0,0 @@ -锘縰sing System; -using Shared.Common; -using System.Text.RegularExpressions; -using System.Collections.Generic; -using System.Timers; -using Shared.Phone.UserView; -using Shared.Phone.Device.CommonForm; - -namespace Shared.Phone.Login -{ - /// <summary> - /// 楠岃瘉鐮佺櫥褰� - /// </summary> - public class AccountLoginByCode : FrameLayout - { - - #region 鈼� 鍙橀噺____________________________ - /// <summary> - /// 鑳屾櫙瑙嗗浘 - /// </summary> - private FrameLayout midFrameLayout; - /// <summary> - /// 鎵嬫満閭 - /// </summary> - private PhoneEmailForm phoneEmailForm; - /// <summary> - /// phoneRowForm - /// </summary> - private PhoneRowForm phoneRow; - /// <summary> - /// emailRow - /// </summary> - private EmailRowForm emailRow; - /// <summary> - /// codeRow - /// </summary> - private VerificationCodeRowForm codeRow; - /// <summary> - /// 璐﹀彿楠岃瘉鐮乫l - /// </summary> - private FrameLayout accountCodeFL; - /// <summary> - /// 鐧诲綍鎸夐挳 - /// </summary> - private Button loginBtn; - /// <summary> - /// 蹇樿瀵嗙爜鎸夐挳 - /// </summary> - private Button forgotPasswordBtn; - /// <summary> - /// 娉ㄥ唽 - /// </summary> - private Button registerBtn; - /// <summary> - /// 璐﹀彿鐧诲綍 - /// </summary> - private Button LoginByAccountPWDBtn; - /// <summary> - /// 鐧诲綍閿欒鎻愮ず鎸夐挳 - /// </summary> - private Button loginErrorBtn; - /// <summary> - /// 璐﹀彿 - /// </summary> - private string account; - /// <summary> - /// 楠岃瘉鐮� - /// </summary> - private string code; - /// <summary> - /// wechat - /// </summary> - private Button wechatBtn; - - private Timer t; - private DateTime dateBegin; - - #endregion - - - /// <summary> - /// The phone string. - /// </summary> - //public string phoneStr = ""; - /// <summary> - /// 鎵嬫満鍙疯緭鍏ユ槸鍚︾鍚堣鍒� - /// </summary> - public bool IsRightAccount = false; - /// <summary> - /// Initializes a new instance of the <see cref="T:Shared.Phone.Device.Account.AccountLoginByCode"/> class. - /// </summary> - public AccountLoginByCode() - { - CommonPage.Instance.IsDrawerLockMode = true; - Tag = "Login"; - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; - t = new Timer(); - dateBegin = new DateTime(); - } - public override void RemoveFromParent() - { - base.RemoveFromParent(); - } - /// <summary> - /// Show this instance. - /// </summary> - public void Show() - { - ShowLoginByCodeView(); - } - /// <summary> - /// Shows the login by code view. - /// </summary> - public void ShowLoginByCodeView() - { - #region midFrameLayout - midFrameLayout = new FrameLayout() - { - Width = LayoutParams.MatchParent, - Height = Application.GetRealHeight(CommonPage.AppRealHeight), - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - AddChidren(midFrameLayout); - #endregion - - var logoBG = new Button() - { - Height = Application.GetRealHeight(619), - UnSelectedImagePath = "Account/Logo_loginBG.png" - }; - midFrameLayout.AddChidren(logoBG); - - var phoneEmailBGFL = new FrameLayout() - { - Y = logoBG.Bottom, - Height = Application.GetRealHeight(1921), - BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor - }; - midFrameLayout.AddChidren(phoneEmailBGFL); - - var logo = new Button() - { - Width = Application.GetMinRealAverage(184), - Height = Application.GetMinRealAverage(184), - Y = Application.GetRealHeight(230), - UnSelectedImagePath = "Account/Logo_White.png", - Gravity = Gravity.CenterHorizontal - }; - midFrameLayout.AddChidren(logo); - - var logoName = new Button() - { - Y = logo.Bottom, - Height = Application.GetRealHeight(69), - Width = Application.GetRealWidth(300), - Gravity = Gravity.CenterHorizontal, - TextID = R.MyInternationalizationString.AppName, - TextColor = ZigbeeColor.Current.GXCTextWhiteColor, - TextSize = 16 - }; - midFrameLayout.AddChidren(logoName); - - phoneEmailForm = new PhoneEmailForm(); - phoneEmailForm.Init(midFrameLayout); - - //閿欒鎻愮ずBtn - loginErrorBtn = new Button() - { - X = Application.GetRealWidth(242), - Y = Application.GetRealHeight(740), - Width = Application.GetRealWidth(700), - Height = Application.GetRealHeight(58), - TextColor = ZigbeeColor.Current.GXCTextRed, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CommonFormResouce.TextSize, - IsBold = true - }; - midFrameLayout.AddChidren(loginErrorBtn); - - accountCodeFL = new FrameLayout() - { - Y = Application.GetRealHeight(801), - Height = Application.GetRealHeight(553), - Width = Application.GetRealWidth(942), - Gravity = Gravity.CenterHorizontal, - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, - Radius = (uint)Application.GetRealHeight(17) - }; - midFrameLayout.AddChidren(accountCodeFL); - - AddPhoneOrEmailFL(accountCodeFL, "Phone"); - - forgotPasswordBtn = new Button() - { - X = Application.GetRealWidth(CommonPage.AppRealWidth - 115 - 250), - Y = Application.GetRealHeight(1198), - Width = Application.GetRealWidth(250), - Height = Application.GetRealHeight(58), - TextID = R.MyInternationalizationString.ForgotPWD_1, - TextSize = CommonFormResouce.loginTextSize, - TextColor = Shared.Common.ZigbeeColor.Current.GXCTextGrayColor, - TextAlignment = TextAlignment.CenterRight - }; - midFrameLayout.AddChidren(forgotPasswordBtn); - - loginBtn = new Button() - { - Y = Application.GetRealHeight(1281), - Width = Application.GetRealWidth(688), - Height = Application.GetRealHeight(127), - Gravity = Gravity.CenterHorizontal, - TextID = R.MyInternationalizationString.Login, - TextSize = 16, - IsBold=true, - TextColor = ZigbeeColor.Current.GXCTextGrayColor, - SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, - SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor, - BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor, - Radius = (uint)Application.GetRealHeight(127 / 2), - Enable = !string.IsNullOrEmpty(codeRow.VerificationCodeET?.Text), - IsSelected = !string.IsNullOrEmpty(codeRow.VerificationCodeET?.Text) - }; - midFrameLayout.AddChidren(loginBtn); - - LoginByAccountPWDBtn = new Button() - { - X = Application.GetRealWidth(98), - Y = Application.GetRealHeight(1466), - Width = Application.GetRealWidth(300), - Height = Application.GetRealHeight(49), - TextID = R.MyInternationalizationString.LoginByAccountPWD, - TextColor = ZigbeeColor.Current.GXCTextGrayColor, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CommonFormResouce.loginTextSize - }; - midFrameLayout.AddChidren(LoginByAccountPWDBtn); - - registerBtn = new Button() - { - X = Application.GetRealWidth(738), - Y = Application.GetRealHeight(1466), - Width = Application.GetRealWidth(244), - Height = Application.GetRealHeight(49), - TextID = R.MyInternationalizationString.Register, - TextColor = ZigbeeColor.Current.GXCTextGrayColor, - TextAlignment = TextAlignment.CenterRight, - TextSize = CommonFormResouce.loginTextSize - }; - midFrameLayout.AddChidren(registerBtn); - - wechatBtn = new Button - { - X = Application.GetRealWidth(395), - Y = Application.GetRealHeight(1737), - Width = Application.GetMinRealAverage(115), - Height = Application.GetMinRealAverage(115), - UnSelectedImagePath = "Account/Wechat.png", - Gravity = Gravity.CenterHorizontal - }; - midFrameLayout.AddChidren(wechatBtn); - - BindEvent(); - } - - #region 鈼� 缁戝畾浜嬩欢_________________________ - - /// <summary> - /// 缁戝畾鎸夐挳浜嬩欢 - /// </summary> - private void BindEvent() - { - //閫夋嫨鎵嬫満閭 - phoneEmailForm.SelectedPhone.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent; - phoneEmailForm.SelectedEmail.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent; - //鐧诲綍浜嬩欢 - loginBtn.MouseUpEventHandler += LoginBtnEvent; - //璐﹀彿鐧诲綍 - LoginByAccountPWDBtn.MouseUpEventHandler += LoginByPWD; - //娉ㄥ唽浜嬩欢 - registerBtn.MouseUpEventHandler += Register; - //蹇樿瀵嗙爜 - forgotPasswordBtn.MouseUpEventHandler += ForgetPWD_MouseUpEvent; - //wechat - wechatBtn.MouseUpEventHandler += LoginByWechat; - - } - - #endregion - - - #region 鈼� 鐧诲綍____________________________ - - /// <summary> - /// 鐧诲綍浜嬩欢 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private async void LoginBtnEvent(object sender, MouseEventArgs mouseEventArgs) - { - CommonPage.Loading.Start(); - try - { - if (CheckAccount(account) == false) - { - return; - } - var reqLoginByCode = new SendDataToServer.LoginValidCodeOBJ() - { - Account = account, - Code = code, - Language = CommonPage.ZigBeeLanguage, - AreaCode = int.Parse(CommonPage.PhoneZoneStr) - }; - var requestRevetLoginCodeOBJ = await CommonFormResouce.LoginByCode(reqLoginByCode); - if (requestRevetLoginCodeOBJ == null) - { - CommonPage.Instance.FailureToServer(); - return; - } - var stateCodeStr = requestRevetLoginCodeOBJ.StateCode.ToUpper(); - if (stateCodeStr == "SUCCESS") - { - if (requestRevetLoginCodeOBJ.ResponseData == null) - { - return; - } - - HomePage.Instance.ShowLoginLoadView(); - new System.Threading.Thread(async () => - { - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(requestRevetLoginCodeOBJ.ResponseData.ToString()); - var revertData = responseDataObj; - Config.ReFresh(); - //鏍囪涓婁竴娆℃槸涓嶆槸鍚屼竴涓处鍙风櫥闄� - UserCenter.UserCenterResourse.ResidenceOption.TheSameLoginAccount = Config.Instance.Guid == revertData.Guid; - Config.Instance.Password = string.Empty; - Config.Instance.Account = revertData.Account; - Config.Instance.Guid = revertData.Guid; - Config.Instance.MD5PWD = revertData.MD5PWD; - Config.Instance.LoginDateTime = DateTime.Now; - Config.Instance.LoginToken = revertData.Token; - //闇�瑕佹妸鐧诲綍鍚庤繑鍥炵殑md5瀵嗙爜 璧嬪�肩敓鎴怲oken 鍥犱负鐢ㄦ埛娌℃湁杈撳叆瀵嗙爜 - Config.Instance.MD5PWD = revertData.MD5PWD; - Config.Instance.Save(); - var resultRegID = await CommonPage.Instance.PushRegID(); - var homes = await House.GetHomeLists(); - - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - Application.RunOnMainThread(() => - { - this.RemoveFromParent(); - CommonPage.Instance.RemoveViewByTag("Login"); - UserPage.Instance.Fresh(); - CommonPage.Loading.Hide(); - }); - }) - { IsBackground = true }.Start(); - } - else if (stateCodeStr == "NOTVERIFY") - { - CommonPage.Loading.Hide(); - //鏈縺娲� - loginErrorBtn.TextID = R.MyInternationalizationString.NOTVERIFY; - CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.NOTVERIFY); - } - else if (stateCodeStr == "NOTENABLE") - { - CommonPage.Loading.Hide(); - //璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤 - loginErrorBtn.TextID = R.MyInternationalizationString.NOTENABLE; - } - else if (stateCodeStr == "PARAMETEROREMPTY") - { - CommonPage.Loading.Hide(); - //鎻愪緵鐨勫弬鏁伴敊璇� - loginErrorBtn.TextID = R.MyInternationalizationString.PARAMETEROREMPTY; - } - else if (stateCodeStr == "VALIDCODEANDPHONENOEQUAL") - { - CommonPage.Loading.Hide(); - loginErrorBtn.TextID = R.MyInternationalizationString.VALIDCODEANDPHONENOEQUAL; - } - else if (stateCodeStr == "NORECORD") - { - CommonPage.Loading.Hide(); - loginErrorBtn.TextID = R.MyInternationalizationString.NORECORD; - } - else if (stateCodeStr == "YOUDATANOISLOCALREGION") - { - CommonPage.Loading.Hide(); - //涓嶅湪鏈尯鍩燂紝闇�瑕侀噸瀹氬悜鍖哄煙鍚庡啀娆¤姹傜櫥褰� - if (requestRevetLoginCodeOBJ.ResponseData == null) - { - return; - } - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginLocalRegionRes>(requestRevetLoginCodeOBJ.ResponseData.ToString()); - CommonPage.RequestHttpsHost = responseDataObj.RegionServer; - //鍐嶆鐧诲綍 - //loginByCode(); - } - else - { - CommonPage.Loading.Hide(); - loginErrorBtn.TextID = R.MyInternationalizationString.RequestServerFailed; - } - } - catch - { - CommonPage.Loading.Hide(); - CommonPage.Instance.FailureToServer(); - } - finally - { - CommonPage.Loading.Hide(); - } - - } - - /// <summary> - /// 閫氳繃瀵嗙爜鐧诲綍 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void LoginByPWD(object sender, MouseEventArgs mouseEventArgs) - { - this.RemoveFromParent(); - var login = new AccountLogin(); - Shared.Common.CommonPage.Instance.AddChidren(login); - login.Show(); - } - - /// <summary> - /// phone/email 閫夋嫨 - /// </summary> - /// <param name="sender"></param> - /// <param name="mouseEventArgs"></param> - private void SelectPhoneOrEmail_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) - { - phoneEmailForm.SelectedPhone.IsSelected = phoneEmailForm.SelectedEmail.IsSelected = false; - phoneEmailForm.SelectedPhone.IsBold = phoneEmailForm.SelectedEmail.IsBold = false; - loginBtn.Enable = loginBtn.IsSelected = false; - (sender as Button).IsSelected = (sender as Button).IsBold = true; - if ((sender as Button).Tag.ToString() == "Phone") - { - AddPhoneOrEmailFL(accountCodeFL, "Phone"); - } - else - { - AddPhoneOrEmailFL(accountCodeFL, "Email"); - } - } - /// <summary> - /// AddPhoneOrEmailFL - /// </summary> - /// <param name="accountCodeFrameLayout"></param> - /// <param name="phoneOrEmail"></param> - private void AddPhoneOrEmailFL(FrameLayout accountCodeFrameLayout, string phoneOrEmail) - { - accountCodeFrameLayout.RemoveAll(); - account = string.Empty; - loginErrorBtn.Text = string.Empty; - if (phoneOrEmail == "Phone") - { - phoneRow = new PhoneRowForm(); - phoneRow.Init(accountCodeFrameLayout, this, this.account, 29, 29); - phoneRow.AccountET.TextChangeEventHandler += Account_TextChange; - } - else - { - emailRow = new EmailRowForm(); - emailRow.Init(accountCodeFrameLayout, this.account, 29, 29); - emailRow.AccountET.TextChangeEventHandler += Account_TextChange; - } - - codeRow = new VerificationCodeRowForm(); - codeRow.Init(accountCodeFrameLayout, 29, 225); - codeRow.SendCodeBtn.MouseUpEventHandler += SendCode_MouseUpEventAsync; - codeRow.VerificationCodeET.TextChangeEventHandler += Code_TextChange; - } - - /// <summary> - /// wechat鐧诲綍 - /// </summary> - /// <param name="sender"></param> - /// <param name="mouseEventArgs"></param> - private void LoginByWechat(object sender, MouseEventArgs mouseEventArgs) - { -#if Android - //var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), - // Language.StringByID(R.MyInternationalizationString.LoginByWechat), - // Language.StringByID(R.MyInternationalizationString.Cancel), - // Language.StringByID(R.MyInternationalizationString.Confrim)); - //alert.Show(); - //alert.ResultEventHandler += (send, e) => - //{ - //if (e) - //{ - com.hdl.home.Application.WXLogin(); - com.hdl.home.WXEntryActivity.RespAction = (authStr) => - { - if (authStr == null) - { - - } - else - { - new System.Threading.Thread(async () => - { - var re = await isBindAuthAsync(authStr); - if (re) - { - Application.RunOnMainThread(() => - { - //鐩存帴鐧诲綍 - HomePage.Instance.ShowLoginLoadView(); - }); - var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); - var homes = await House.GetHomeLists(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - Application.RunOnMainThread(() => - { - this.RemoveFromParent(); - CommonPage.Instance.RemoveViewByTag("Login"); - UserPage.Instance.Fresh(); - }); - } - else - { - var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr); - Application.RunOnMainThread(() => - { - var registerPage = new AccountRegister(); - Shared.Common.CommonPage.Instance.AddChidren(registerPage); - registerPage.OpenID = authRes.openid; - registerPage.Show(); - }); - } - }) - { IsBackground = true }.Start(); - } - }; - //} - //}; -#endif - -#if iOS - Home.IOS.AppDelegate.WXLogin(); - Home.IOS.AppDelegate.RespAction = (authStr) => - { - if (authStr == null) - { - - } - else - { - new System.Threading.Thread(async () => - { - - var re = await isBindAuthAsync(authStr); - if (re) - { - //鐩存帴鐧诲綍 - //this.RemoveFromParent(); - - //UserPage.Instance.Fresh(); - var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); - var homes = await House.GetHomeLists(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - Application.RunOnMainThread(() => - { - this.RemoveFromParent(); - UserPage.Instance.Fresh(); - }); - } - else - { - var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr); - Application.RunOnMainThread(() => - { - var registerPage = new AccountRegister(); - Shared.Common.CommonPage.Instance.AddChidren(registerPage); - registerPage.OpenID = authRes.openid; - registerPage.Show(); - }); - } - }) - { IsBackground = true }.Start(); - } - }; -#endif - } - - /// <summary> - /// qq鐧诲綍 - /// </summary> - /// <param name="sender"></param> - /// <param name="mouseEventArgs"></param> - private void LoginByQQ(object sender, MouseEventArgs mouseEventArgs) - { - - } - - /// <summary> - /// 鏄惁宸茬粦瀹� - /// </summary> - /// <param name="authStr"></param> - /// <returns></returns> - private async System.Threading.Tasks.Task<bool> isBindAuthAsync(string authStr) - { - var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr); - var auth = new SendDataToServer.AuthUser() - { - AccessToken = authRes.access_token, - RefreshToken = authRes.refresh_token, - OpenID = authRes.openid - }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth); - var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/InsertOrUpdateAuthUser", System.Text.Encoding.UTF8.GetBytes(requestJson)); - if (revertObj == null) - { - return false; - } - var stateCodeStr = revertObj.StateCode.ToUpper(); - if (stateCodeStr == "SUCCESS") - { - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString()); - var revertData = responseDataObj; - //鏍囪涓婁竴娆℃槸涓嶆槸鍚屼竴涓处鍙风櫥闄� - UserCenter.UserCenterResourse.ResidenceOption.TheSameLoginAccount = Config.Instance.Guid == revertData.Guid; - Config.Instance.Account = revertData.Account; - Config.Instance.MD5PWD = revertData.MD5PWD; - Config.Instance.Guid = revertData.Guid; - Config.Instance.LoginDateTime = DateTime.Now; - Config.Instance.Save(); - return true; - } - else - { - return false; - } - } - - #endregion - - #region 鈼� 璐﹀彿銆侀獙璇佺爜鐩戝惉______________________ - /// <summary> - /// 璐﹀彿鐩戝惉 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void Account_TextChange(object sender, string mouseEventArgs) - { - loginErrorBtn.Text = string.Empty; - if ((sender as EditText).Text.Trim().Length > 0) - { - IsRightAccount = true; - codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = true; - account= (sender as EditText).Text.Trim(); - } - else - { - IsRightAccount = false; - codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = false; - } - } - - /// <summary> - /// code鐩戝惉浜嬩欢 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void Code_TextChange(object sender, string mouseEventArgs) - { - loginErrorBtn.Text = ""; - if ((sender as EditText).Text.Trim().Length > 0 && IsRightAccount) - { - loginBtn.Enable = loginBtn.IsSelected = true; - } - else - { - loginBtn.Enable = loginBtn.IsSelected = false; - } - code = (sender as EditText).Text.Trim(); - } - - #endregion - - - void TimeOut(object sender, System.Timers.ElapsedEventArgs e) - { - var span = DateTime.Now - dateBegin; - if (span.TotalSeconds <= 61) - { - Application.RunOnMainThread(() => - { - codeRow.SendCodeBtn.Text = Convert.ToInt16(60 - span.TotalSeconds) + "s" + Language.StringByID(R.MyInternationalizationString.SendVerificationCodeAgain); - codeRow.SendCodeBtn.Enable = false; - }); - } - else - { - Application.RunOnMainThread(() => - { - codeRow.SendCodeBtn.Enable = true; - codeRow.SendCodeBtn.TextID = R.MyInternationalizationString.SendVerificationCode; - t.Stop(); - t.Close(); - }); - } - } - - void TimeBegin() - { - t.Interval = 1000; - t.AutoReset = true; - t.Enabled = true; - t.Elapsed += TimeOut; - //鍚姩璁℃椂鍣ㄥ�掕鏃�-60s - t.Start(); - dateBegin = DateTime.Now; - } - - #region 鈼� 娉ㄥ唽_____________________________ - - /// <summary> - /// 娉ㄥ唽 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> - private void Register(object sender, MouseEventArgs mouseEventArgs) - { - this.RemoveFromParent(); - var registerPage = new AccountRegister(); - CommonPage.Instance.AddChidren(registerPage); - registerPage.Show(); - } - - #endregion - - #region 鈼� 蹇樿瀵嗙爜________________________ - /// <summary> - /// 蹇樿瀵嗙爜 - /// </summary> - private void ForgetPWD_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) - { - this.RemoveFromParent(); - var forgot = new AccountForgetPWD(); - CommonPage.Instance.AddChidren(forgot); - forgot.Show(); - } - - #endregion - - #region 鈼� 鍙戦�侀獙璇佺爜________________________ - /// <summary> - /// 鍙戦�侀獙璇佺爜 - /// </summary> - /// <param name="sender"></param> - /// <param name="mouseEventArgs"></param> - private async void SendCode_MouseUpEventAsync(object sender, MouseEventArgs mouseEventArgs) - { - if (CheckAccount(account) == false) - { - return; - } - - (sender as Button).Enable = (sender as Button).IsSelected = false; - CommonPage.Loading.Start(); - try - { - int companyInt = 0; - if (CommonPage.PhoneZoneStr == "86" || phoneEmailForm.SelectedEmail.IsSelected) - { - companyInt = CommonPage.Company; - } - else - { - companyInt = CommonPage.CompanyForINTERNETION; - } - var reqDtoSignPhone = new SendDataToServer.LoginSendVerCodeObj() - { - Account = account, - Company = companyInt, - AreaCode = int.Parse(CommonPage.PhoneZoneStr), - Language = CommonPage.ZigBeeLanguage - }; - var requestRevertObj = await CommonFormResouce.LoginSendVerCode(reqDtoSignPhone); - if (requestRevertObj == null) - { - CommonPage.Instance.FailureToServer(); - return; - } - var stateCodeStr = requestRevertObj.StateCode.ToUpper(); - if (stateCodeStr == "SUCCESS") - { - TimeBegin(); - var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SendVerificationCodeSuccess), Language.StringByID(R.MyInternationalizationString.Confrim)); - alert.Show(); - } - else if (stateCodeStr == "PARAMETEROREMPTY") - { - //鎻愪緵鐨勫弬鏁伴敊璇� - loginErrorBtn.TextID = R.MyInternationalizationString.PARAMETEROREMPTY; - (sender as Button).Enable = (sender as Button).IsSelected = true; - } - else if (stateCodeStr == "ACCOUNTNOEXISTS") - { - //璐﹀彿涓嶅瓨鍦� - loginErrorBtn.TextID = R.MyInternationalizationString.ACCOUNTNOEXISTS; - IsRightAccount = false; - (sender as Button).Enable = (sender as Button).IsSelected = true; - } - else if (stateCodeStr == "SENDFAIL") - { - //楠岃瘉鐮佸彂閫佸け璐� - loginErrorBtn.TextID = R.MyInternationalizationString.SENDFAIL; - (sender as Button).Enable = (sender as Button).IsSelected = true; - } - else - { - loginErrorBtn.TextID = R.MyInternationalizationString.RequestServerFailed; - (sender as Button).Enable = (sender as Button).IsSelected = true; - } - } - catch - { - loginErrorBtn.TextID = R.MyInternationalizationString.RequestServerFailed; - (sender as Button).Enable = (sender as Button).IsSelected = true; - } - finally - { - CommonPage.Loading.Hide(); - } - } - - /// <summary> - /// CheckAccount - /// </summary> - /// <param name="accountStr"></param> - /// <returns></returns> - private bool CheckAccount(string accountStr) - { - loginErrorBtn.Text = string.Empty; - if (phoneEmailForm.SelectedEmail.IsSelected) - { - if (AccountLogic.Instance.CheckEmail(accountStr) == false) - { - loginErrorBtn.TextID = R.MyInternationalizationString.TheEmailError; - return false; - } - } - else - { - if (AccountLogic.Instance.CheckPhoneWithZone(accountStr, CommonPage.PhoneZoneStr) == false) - { - loginErrorBtn.TextID = R.MyInternationalizationString.ThePhoneError; - return false; - } - } - return true; - } - - #endregion - - #region 鈼� 楠岃瘉楠岃瘉鐮乢_______________________ - - - - #endregion - } -} diff --git a/ZigbeeApp/Shared/Phone/Login/AccountRegister.cs b/ZigbeeApp/Shared/Phone/Login/AccountRegister.cs index fbd8451..13b39cb 100755 --- a/ZigbeeApp/Shared/Phone/Login/AccountRegister.cs +++ b/ZigbeeApp/Shared/Phone/Login/AccountRegister.cs @@ -308,7 +308,7 @@ { var registerSuccess = new AccountRegisterSuccess(); CommonPage.Instance.AddChidren(registerSuccess); - registerSuccess.Show(account, pwdRow.PasswrodET.Text.Trim(), OpenID); + registerSuccess.ShowForm(account, pwdRow.PasswrodET.Text.Trim(), OpenID); } else if (stateCodeStr == "EXIST") { diff --git a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs index d7429da..20faead 100755 --- a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs +++ b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs @@ -1,186 +1,168 @@ 锘縰sing System; using System.Text; using Shared.Common; +using Shared.Phone.UserCenter; using Shared.Phone.UserView; namespace Shared.Phone.Login { + /// <summary> + /// 璐﹀彿娉ㄥ唽鎴愬姛鐨勬彁绀虹晫闈� + /// </summary> public class AccountRegisterSuccess : FrameLayout - { + { + #region 鈻� 鍒濆鍖朹____________________________ + /// <summary> - /// registerSuccess + /// 鍒濆鍖� /// </summary> - /// <param name="account"></param> - /// <param name="password"></param> - public void Show(string account, string password,string OpenID="") + /// <param name="account">璐﹀彿</param> + /// <param name="password">瀵嗙爜</param> + /// <param name="OpenID">绗笁鏂圭粦瀹氱殑id</param> + public void ShowForm(string account, string password, string OpenID = "") { - var dialog = new FrameLayout() - { - BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor - }; - AddChidren(dialog); + //鏁翠釜鑳屾櫙 + var frameBack = new FrameLayout(); + frameBack.BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor; + this.AddChidren(frameBack); + //涓婇儴榛戣壊閮ㄥ垎 + var frameBlack = new FrameLayout(); + frameBlack.Y = Application.GetRealHeight(527); + frameBlack.Width = Application.GetRealWidth(688); + frameBlack.Height = Application.GetRealHeight(274); + frameBlack.Gravity = Gravity.CenterHorizontal; + frameBlack.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor; + frameBlack.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); + this.AddChidren(frameBlack); + //涓嬮儴鐧借壊閮ㄥ垎 + var frameWhite = new FrameLayout(); + frameWhite.Y = frameBlack.Bottom; + frameWhite.Width = Application.GetRealWidth(688); + frameWhite.Height = Application.GetRealHeight(579); + frameWhite.Gravity = Gravity.CenterHorizontal; + frameWhite.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; + frameWhite.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); + this.AddChidren(frameWhite); + //璐﹀彿澶村儚 + var btnAccountIcon = new PicViewControl(294, 316); + btnAccountIcon.Y = Application.GetRealHeight(648); + btnAccountIcon.Gravity = Gravity.CenterHorizontal; + btnAccountIcon.UnSelectedImagePath = "Account/Cat.png"; + this.AddChidren(btnAccountIcon); + //璐﹀彿 + var btnAccount = new NormalViewControl(500, 80, true); + btnAccount.Y = btnAccountIcon.Bottom; + btnAccount.Gravity = Gravity.CenterHorizontal; + btnAccount.Text = account; + btnAccount.TextColor = ZigbeeColor.Current.GXCTextGrayColor2; + btnAccount.TextAlignment = TextAlignment.Center; + this.AddChidren(btnAccount); + //鎭枩娉ㄥ唽鎴愬姛锛� + var btnTip = new NormalViewControl(500, 80, true); + btnTip.Y = Application.GetRealHeight(1143); + btnTip.Gravity = Gravity.CenterHorizontal; + btnTip.TextID = R.MyInternationalizationString.RegisterSuccessTip; + btnTip.TextColor = ZigbeeColor.Current.GXCTextBlackColor2; + btnTip.TextAlignment = TextAlignment.Center; + btnTip.TextSize = 16; + btnTip.IsBold = true; + this.AddChidren(btnTip); + //鍗冲皢鑷姩鐧诲綍 + var btnWillLogin = new NormalViewControl(500, 80, true); + btnWillLogin.Y = btnTip.Bottom + Application.GetRealHeight(15); + btnWillLogin.Gravity = Gravity.CenterHorizontal; + btnWillLogin.TextID = R.MyInternationalizationString.WillAutoLogin; + btnWillLogin.TextColor = ZigbeeColor.Current.GXCTextGrayColor; + btnWillLogin.TextAlignment = TextAlignment.Center; + AddChidren(btnWillLogin); - var blackBG = new FrameLayout() - { - Y = Application.GetRealHeight(527), - Width = Application.GetRealWidth(688), - Height = Application.GetRealHeight(274), - Gravity = Gravity.CenterHorizontal, - BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor - }; - AddChidren(blackBG); - - var whiteBG = new FrameLayout() - { - Y = blackBG.Bottom, - Width = Application.GetRealWidth(688), - Height = Application.GetRealHeight(579), - Gravity = Gravity.CenterHorizontal, - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - AddChidren(whiteBG); - - var accountImg = new Button() - { - Y = Application.GetRealHeight(648), - Width = Application.GetMinRealAverage(294), - Height = Application.GetMinRealAverage(316), - Gravity = Gravity.CenterHorizontal, - UnSelectedImagePath = "Account/Cat.png" - }; - AddChidren(accountImg); - - var accountBtn = new Button() - { - Y = accountImg.Bottom, - Width = Application.GetRealWidth(500), - Height = Application.GetRealHeight(80), - Gravity = Gravity.CenterHorizontal, - Text = account, - TextColor = ZigbeeColor.Current.GXCTextGrayColor2, - TextSize = 14, - }; - AddChidren(accountBtn); - - var tip = new Button() - { - Y = Application.GetRealHeight(1143), - Width = Application.GetRealWidth(500), - Height = Application.GetRealHeight(80), - Gravity = Gravity.CenterHorizontal, - TextID = R.MyInternationalizationString.RegisterSuccessTip, - TextColor = ZigbeeColor.Current.GXCTextBlackColor2, - TextSize = 16, - }; - AddChidren(tip); - - var willLogin = new Button() - { - Y = tip.Bottom + Application.GetRealHeight(15), - Width = Application.GetRealWidth(500), - Height = Application.GetRealHeight(80), - Gravity = Gravity.CenterHorizontal, - TextID = R.MyInternationalizationString.WillAutoLogin, - TextColor = ZigbeeColor.Current.GXCTextGrayColor, - TextSize = 14, - }; - AddChidren(willLogin); - - AutoLogin(account, password,OpenID); - } - + HdlThreadLogic.Current.RunThread(() => + { + System.Threading.Thread.Sleep(2000); + //2绉掑悗鑷姩鐧诲綍 + this.LoginByAccountAndPsw(account, password, OpenID); + }); + } + + #endregion + + #region 鈻� 鑷姩鐧诲綍___________________________ + /// <summary> /// AutoLogin /// </summary> /// <param name="account"></param> /// <param name="password"></param> - private void AutoLogin(string account, string password, string OpenID = "") + private void LoginByAccountAndPsw(string account, string password, string OpenID = "") { - new System.Threading.Thread(() => - { - System.Threading.Thread.Sleep(1500); - Application.RunOnMainThread(() => - { - try - { - HomePage.Instance.ShowLoginLoadView(); - - CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining)); - Action action = async () => { - var loginSuccess = await HomePage.Instance.LoginByPWDAsync(account, password); - if (loginSuccess==1) - { - new System.Threading.Thread(async () => - { - if (string.IsNullOrEmpty(OpenID)==false) - { - BindAuthUser(Config.Instance.Guid, OpenID); - } - //鐧诲綍鎴愬姛 - var homes = await House.GetHomeLists(); - - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - - Application.RunOnMainThread(() => - { - CommonPage.Loading.Hide(); - this.RemoveFromParent(); - CommonPage.Instance.RemoveViewByTag("Register"); - CommonPage.Instance.RemoveViewByTag("Login"); - UserPage.Instance.Fresh(); - }); - }) - { IsBackground = true }.Start(); - - } - else - { - //鏈櫥褰曟垚鍔熷脊鍑虹櫥褰曠晫闈� 鍚屾椂闇�瑕佹爣璁颁负鏈櫥褰曠姸鎬� - Config.Instance.LoginDateTime = new DateTime(1970, 1, 1); - Config.Instance.Save(); - var login = new AccountLogin { }; - CommonPage.Instance.AddChidren(login); - login.Show(account); - } - }; - action(); - } - catch (Exception ex) - { - var errMsg = ex.Message; - } - finally - { - CommonPage.Loading.Hide(); - } - }); - }) - { IsBackground = true }.Start(); - } + HdlThreadLogic.Current.RunMain(() => + { + //鎵撳紑鍚姩椤� + HomePage.Instance.ShowLoginLoadView(); + CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining)); + + HdlThreadLogic.Current.RunThread(async () => + { + //璐﹀彿瀵嗙爜鐧婚檰 + var loginSuccess = await HomePage.Instance.LoginByPWDAsync(account, password); + if (loginSuccess == 1) + { + if (string.IsNullOrEmpty(OpenID) == false) + { + //缁戝畾绗笁鏂� + await BindAuthUser(Config.Instance.Guid, OpenID); + } + var homes = await House.GetHomeLists(); + + //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ + await UserCenterLogic.InitUserCenterMenmoryAndThread(); + //鍚姩ZigBee + ZigBee.Common.Application.Init(); + + HdlThreadLogic.Current.RunMain(() => + { + CommonPage.Loading.Hide(); + this.RemoveFromParent(); + CommonPage.Instance.RemoveViewByTag("Register"); + CommonPage.Instance.RemoveViewByTag("Login"); + UserPage.Instance.Fresh(); + }); + } + else + { + HdlThreadLogic.Current.RunMain(() => + { + //鏈櫥褰曟垚鍔熷脊鍑虹櫥褰曠晫闈� 鍚屾椂闇�瑕佹爣璁颁负鏈櫥褰曠姸鎬� + Config.Instance.LoginDateTime = new DateTime(1970, 1, 1); + Config.Instance.Save(); + var login = new AccountLogin(); + CommonPage.Instance.AddChidren(login); + login.ShowForm(account); + }); + } + }); + }); + } + + #endregion + + #region 鈻� 缁戝畾绗笁鏂筥________________________ /// <summary> /// 缁戝畾 /// </summary> /// <param name="guid"></param> /// <param name="openId"></param> - private void BindAuthUser(string guid, string openId) - { - new System.Threading.Thread(async () => - { - var auth = new SendDataToServer.BindAuthUser - { - AccountGuid = guid, - OpenID = openId - }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth); - var revert = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/BindAuthUserToAccount", Encoding.UTF8.GetBytes(requestJson)); - }) - { - IsBackground = true - }.Start(); - } + private async System.Threading.Tasks.Task BindAuthUser(string guid, string openId) + { + var auth = new SendDataToServer.BindAuthUser(); + auth.AccountGuid = guid; + auth.OpenID = openId; + + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth); + await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/BindAuthUserToAccount", Encoding.UTF8.GetBytes(requestJson)); + } + + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/Login/AccountResetPWDSuccess.cs b/ZigbeeApp/Shared/Phone/Login/AccountResetPWDSuccess.cs index a8d0d6b..6c3db57 100755 --- a/ZigbeeApp/Shared/Phone/Login/AccountResetPWDSuccess.cs +++ b/ZigbeeApp/Shared/Phone/Login/AccountResetPWDSuccess.cs @@ -97,7 +97,7 @@ { var login = new AccountLogin(); CommonPage.Instance.AddChidren(login); - login.Show(); + login.ShowForm(); } }; } diff --git a/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs b/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs index 0ae4177..9e3a426 100755 --- a/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs +++ b/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs @@ -6,7 +6,7 @@ namespace Shared.Phone.Login { - public class PhoneEmailForm : FrameLayout + public class PhoneEmailForm : FrameLayoutBase { /// <summary> /// 閫夋嫨鎵嬫満 @@ -33,8 +33,8 @@ PhoneEmailFL = new FrameLayout() { Y = Application.GetRealHeight(y), - Width = Application.GetMinRealAverage(905), - Height = Application.GetMinRealAverage(170), + Width = this.GetPictrueRealSize(905), + Height = this.GetPictrueRealSize(170), //BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor, //Radius = (uint)Application.GetRealHeight(height / 2), Gravity = Gravity.CenterHorizontal @@ -43,8 +43,8 @@ var bg = new Button { - Width = Application.GetMinRealAverage(905), - Height = Application.GetMinRealAverage(170), + Width = this.GetPictrueRealSize(905), + Height = this.GetPictrueRealSize(170), UnSelectedImagePath = "Account/PhoneEmail_White.png", Gravity = Gravity.CenterHorizontal }; @@ -53,8 +53,8 @@ SelectedPhone = new Button() { X=Application.GetRealWidth(10), - Width = Application.GetMinRealAverage(905 / 2 + 20), - Height=Application.GetMinRealAverage(height), + Width = this.GetPictrueRealSize(905 / 2 + 20), + Height=this.GetPictrueRealSize(height), SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor, TextID = R.MyInternationalizationString.PhoneNum, TextColor = ZigbeeColor.Current.GXCTextColor, @@ -69,9 +69,9 @@ SelectedEmail = new Button() { - X = Application.GetMinRealAverage(905 / 2 - 20), - Width = Application.GetMinRealAverage(905 / 2 + 20), - Height = Application.GetMinRealAverage(height), + X = this.GetPictrueRealSize(905 / 2 - 20), + Width = this.GetPictrueRealSize(905 / 2 + 20), + Height = this.GetPictrueRealSize(height), SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor, TextID = R.MyInternationalizationString.Email, TextColor = ZigbeeColor.Current.GXCTextColor, @@ -97,7 +97,7 @@ } } - public class PhoneRowForm : FrameLayout + public class PhoneRowForm : FrameLayoutBase { /// <summary> /// 鎵嬫満鍖哄彿btn @@ -206,7 +206,7 @@ } } - public class PhoneLoginRowForm : FrameLayout + public class PhoneLoginRowForm : FrameLayoutBase { /// <summary> /// 璐﹀彿杈撳叆鎺т欢 @@ -227,19 +227,19 @@ /// <param name="frameLayout"></param> /// <param name="account"></param> public void Init(FrameLayout frameLayout, FrameLayout parFL, string account, int x, int y) - { - this.X = Application.GetRealWidth(x); - this.Y = Application.GetRealHeight(y); - this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); - this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); + { + this.X = Application.GetRealWidth(x); + this.Y = Application.GetRealHeight(y); + this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); + this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; frameLayout.AddChidren(this); var accountBtn = new Button() { X = Application.GetRealWidth(69), - Width = Application.GetMinRealAverage(Button_Height), - Height = Application.GetMinRealAverage(Button_Height), + Width = this.GetPictrueRealSize(Button_Height), + Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Account.png" }; @@ -294,7 +294,7 @@ } } - public class EmailRowForm : FrameLayout + public class EmailRowForm : FrameLayoutBase { /// <summary> /// 璐﹀彿杈撳叆鎺т欢 @@ -329,8 +329,8 @@ var accountBtn = new Button() { X = Application.GetRealWidth(29), - Width = Application.GetMinRealAverage(Button_Height), - Height = Application.GetMinRealAverage(Button_Height), + Width = this.GetPictrueRealSize(Button_Height), + Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Account.png" }; @@ -385,7 +385,7 @@ } - public class EmailLoginRowForm : FrameLayout + public class EmailLoginRowForm : FrameLayoutBase { /// <summary> /// 璐﹀彿杈撳叆鎺т欢 @@ -406,19 +406,19 @@ /// <param name="frameLayout"></param> /// <param name="account"></param> public void Init(FrameLayout frameLayout, string account, int x, int y) - { - this.X = Application.GetRealWidth(x); - this.Y = Application.GetRealHeight(y); - this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); - this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); + { + this.X = Application.GetRealWidth(x); + this.Y = Application.GetRealHeight(y); + this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); + this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; frameLayout.AddChidren(this); var accountBtn = new Button() { X = Application.GetRealWidth(69), - Width = Application.GetMinRealAverage(Button_Height), - Height = Application.GetMinRealAverage(Button_Height), + Width = this.GetPictrueRealSize(Button_Height), + Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Account.png" }; @@ -472,7 +472,7 @@ } - public class EmailForgotRowForm : FrameLayout + public class EmailForgotRowForm : FrameLayoutBase { /// <summary> /// 璐﹀彿杈撳叆鎺т欢 @@ -551,7 +551,7 @@ } } - public class VerificationCodeRowForm : FrameLayout + public class VerificationCodeRowForm : FrameLayoutBase { /// <summary> /// Button_Height @@ -595,8 +595,8 @@ var codeBtn = new Button() { X = Application.GetRealWidth(29), - Width = Application.GetMinRealAverage(Button_Height), - Height = Application.GetMinRealAverage(Button_Height), + Width = this.GetPictrueRealSize(Button_Height), + Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Code.png" }; @@ -675,7 +675,7 @@ } } - public class PwdRowForm : FrameLayout + public class PwdRowForm : FrameLayoutBase { /// <summary> /// PasswrodET @@ -716,8 +716,8 @@ var passwordBtn = new Button() { X = Application.GetRealWidth(29), - Width = Application.GetMinRealAverage(Button_Height), - Height = Application.GetMinRealAverage(Button_Height), + Width = this.GetPictrueRealSize(Button_Height), + Height = this.GetPictrueRealSize(Button_Height), Gravity=Gravity.CenterVertical, UnSelectedImagePath = "Account/Password.png" }; @@ -797,7 +797,7 @@ } } - public class PwdLoginRowForm : FrameLayout + public class PwdLoginRowForm : FrameLayoutBase { /// <summary> /// PasswrodET @@ -824,19 +824,19 @@ /// <param name="x"></param> /// <param name="y"></param> public void Init(FrameLayout frameLayout, int x, int y, string password = "") - { - this.X = Application.GetRealWidth(x); - this.Y = Application.GetRealHeight(y); - this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); - this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); + { + this.X = Application.GetRealWidth(x); + this.Y = Application.GetRealHeight(y); + this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); + this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; frameLayout.AddChidren(this); var passwordBtn = new Button() { X = Application.GetRealWidth(69), - Width = Application.GetMinRealAverage(Button_Height), - Height = Application.GetMinRealAverage(Button_Height), + Width = this.GetPictrueRealSize(Button_Height), + Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Password.png" }; @@ -916,7 +916,7 @@ } } - public class PwdForForgetRowForm : FrameLayout + public class PwdForForgetRowForm : FrameLayoutBase { /// <summary> /// PasswrodET @@ -1029,7 +1029,7 @@ } } - public class CodeForRegisterRowForm : FrameLayout + public class CodeForRegisterRowForm : FrameLayoutBase { /// <summary> /// Button_Height @@ -1084,8 +1084,8 @@ var codeBtn = new Button() { X = Application.GetRealWidth(29), - Width = Application.GetMinRealAverage(Button_Height), - Height = Application.GetMinRealAverage(Button_Height), + Width = this.GetPictrueRealSize(Button_Height), + Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Code.png" }; @@ -1156,31 +1156,31 @@ /// TimeBegin /// </summary> public void TimeBegin() - { - SendCodeBtn.BackgroundColor = UserCenterColor.Current.White; - SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextBlackColor; - - HdlThreadLogic.Current.RunThread(() => - { - //鍚庨噸鍙� - string txtValue = Language.StringByID(R.MyInternationalizationString.SendVerificationCodeAgain); - int timeOut = 60; - while (timeOut > 0 && SendCodeBtn.Parent != null) - { - HdlThreadLogic.Current.RunMain(() => - { - SendCodeBtn.Text = timeOut + "s" + txtValue; - }); - timeOut--; - System.Threading.Thread.Sleep(1000); - } - HdlThreadLogic.Current.RunMain(() => - { + { + SendCodeBtn.BackgroundColor = UserCenterColor.Current.White; + SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextBlackColor; + + HdlThreadLogic.Current.RunThread(() => + { + //鍚庨噸鍙� + string txtValue = Language.StringByID(R.MyInternationalizationString.SendVerificationCodeAgain); + int timeOut = 60; + while (timeOut > 0 && SendCodeBtn.Parent != null) + { + HdlThreadLogic.Current.RunMain(() => + { + SendCodeBtn.Text = timeOut + "s" + txtValue; + }); + timeOut--; + System.Threading.Thread.Sleep(1000); + } + HdlThreadLogic.Current.RunMain(() => + { SendCodeBtn.TextID = R.MyInternationalizationString.SendVerificationCode; SendCodeBtn.BackgroundColor = 0xFFFC744B; SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; - SendCodeBtn.CanClick = true; - }); + SendCodeBtn.CanClick = true; + }); }); } diff --git a/ZigbeeApp/Shared/Phone/Login/PhoneZone.cs b/ZigbeeApp/Shared/Phone/Login/PhoneZone.cs index a9e1ac4..13a0844 100755 --- a/ZigbeeApp/Shared/Phone/Login/PhoneZone.cs +++ b/ZigbeeApp/Shared/Phone/Login/PhoneZone.cs @@ -4,7 +4,7 @@ namespace Shared.Phone.Device.Login { - public class PhoneZone : FrameLayout + public class PhoneZone : UserCenter.FrameLayoutBase { #region 鈼� 鍙橀噺____________________________ /// <summary> @@ -184,20 +184,21 @@ }; phoneZoneSelectedShowView.AddChidren(phoneZoneListView); - var okBtn = new CommonForm.CompleteButton(1166, 668, 127); - phoneZoneSelectedShowView.AddChidren(okBtn); - okBtn.MouseUpEventHandler += (sender, e) => + var btnOk = new UserCenter.BottomClickButton(668); + btnOk.Y = Application.GetRealHeight(1166); + btnOk.TextID = R.MyInternationalizationString.Complete; + phoneZoneSelectedShowView.AddChidren(btnOk); + btnOk.ButtonClickEvent += (sender, e) => { ActionSelectedZone?.Invoke(CommonPage.PhoneZoneStr); ActionSelectedZone = null; RemoveFromParent(); }; - phoneZoneSelectedShowView.AddChidren(okBtn); var cancleBtn = new Button() { Y = Application.GetRealHeight(1719), - Height = Application.GetMinRealAverage(86), - Width = Application.GetMinRealAverage(86), + Height = this.GetPictrueRealSize(86), + Width = this.GetPictrueRealSize(86), UnSelectedImagePath = "Account/Cancle.png", Gravity = Gravity.CenterHorizontal }; diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs old mode 100644 new mode 100755 index a8c383d..13fae51 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs @@ -1,5 +1,4 @@ 锘縰sing Shared.Common; -using Shared.Phone.Device.AC; using Shared.Phone.UserCenter; using System; using System.Collections.Generic; @@ -13,7 +12,8 @@ /// </summary> public class DeviceAcDetailCardForm : DeviceDetailCardCommonForm { - #region 鈻� 鍙橀噺澹版槑___________________________ + #region 鈻� 鍙橀噺澹版槑___________________________ + /// <summary> /// 鐣岄潰涓婂彲浠ユ搷浣滅殑鎺т欢 /// </summary> @@ -66,11 +66,11 @@ public override void InitMiddleFrameAfter(FrameLayout frameWhiteBack) { //宸︽粦涓嶈兘 - this.ScrollEnabled = true; + this.ScrollEnabled = false; this.deviceAc = (AC)this.device; //鍏堟竻绌� this.listControl = new List<ButtonBase>(); - if (device.HadReadDeviceStatu == true && ACControlBase.IsOpen(deviceAc) == true) + if (device.HadReadDeviceStatu == true && DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) { //璁剧疆鐘舵�佹枃瀛� 褰撳墠瀹ゆ俯 this.SetStatuText(deviceAc.currentLocalTemperature + "鈩�"); @@ -84,7 +84,7 @@ //娓呮礂婊ょ綉鎻愮ず鐨凢rameLayout this.frameClrean = new FrameLayout(); frameClrean.Width = Application.GetRealWidth(600); - frameClrean.Height = Application.GetMinRealAverage(69); + frameClrean.Height = this.GetPictrueRealSize(69); frameClrean.X = ControlCommonResourse.XXLeft; frameClrean.Y = Application.GetRealHeight(35); frameWhiteBack.AddChidren(frameClrean); @@ -112,17 +112,17 @@ /// <param name="frameWhiteBack"></param> private void InitAcControl(FrameLayout frameWhiteBack) { - bool isAcOpen = ACControlBase.IsOpen(deviceAc); + bool isAcOpen = DeviceAcDetailCardMethord.IsOpen(deviceAc); //绌鸿皟鎺т欢鐨勫鍣� var frameAcBack = new FrameLayout(); frameAcBack.Y = Application.GetRealHeight(412); - frameAcBack.Width = Application.GetMinRealAverage(671); - frameAcBack.Height = Application.GetMinRealAverage(671); + frameAcBack.Width = this.GetPictrueRealSize(671); + frameAcBack.Height = this.GetPictrueRealSize(671); frameAcBack.Gravity = Gravity.CenterHorizontal; frameWhiteBack.AddChidren(frameAcBack); - this.nowProgressValue = ACControlBase.GetCurrentModeTemperature(deviceAc); + this.nowProgressValue = DeviceAcDetailCardMethord.GetCurrentModeTemperature(deviceAc); if (nowProgressValue < 16) { nowProgressValue = 16; } if (nowProgressValue > 32) { nowProgressValue = 32; } //绌鸿皟鎺т欢 @@ -146,9 +146,9 @@ //绌鸿皟鎺т欢閲岄潰鐨勯偅涓樉绀哄埗鐑�,鍒跺喎鐨勬帶浠� this.btnNowModeView = new NormalViewControl(200, 55, true); - btnNowModeView.Y = Application.GetMinRealAverage(184); + btnNowModeView.Y = this.GetPictrueRealSize(184); btnNowModeView.Gravity = Gravity.CenterHorizontal; - btnNowModeView.Text = ACControlBase.GetModeNameByModeId(deviceAc.currentSystemMode); + btnNowModeView.Text = DeviceAcDetailCardMethord.GetModeNameByModeId(deviceAc.currentSystemMode); btnNowModeView.TextSize = 12; btnNowModeView.TextAlignment = TextAlignment.Center; frameAcBack.AddChidren(btnNowModeView); @@ -157,8 +157,8 @@ this.btnReduce = new IconViewControl(81); btnReduce.CanClick = isAcOpen; btnReduce.UnSelectedImagePath = "AC/Reduce.png"; - btnReduce.X = Application.GetMinRealAverage(132); - btnReduce.Y = Application.GetMinRealAverage(268); + btnReduce.X = this.GetPictrueRealSize(132); + btnReduce.Y = this.GetPictrueRealSize(268); frameAcBack.AddChidren(btnReduce); btnReduce.ButtonClickEvent += (sender, e) => { @@ -173,7 +173,7 @@ this.btnAdd = new IconViewControl(81); btnAdd.CanClick = isAcOpen; btnAdd.UnSelectedImagePath = "AC/Add.png"; - btnAdd.X = frameAcBack.Width - Application.GetMinRealAverage(81 + 132); + btnAdd.X = frameAcBack.Width - this.GetPictrueRealSize(81 + 132); btnAdd.Y = btnReduce.Y; frameAcBack.AddChidren(btnAdd); btnAdd.ButtonClickEvent += (sender, e) => @@ -187,7 +187,7 @@ //鈩� var btnUint = new NormalViewControl(100, 66, true); - btnUint.Y = Application.GetMinRealAverage(366); + btnUint.Y = this.GetPictrueRealSize(366); btnUint.Gravity = Gravity.CenterHorizontal; btnUint.TextAlignment = TextAlignment.Center; btnUint.Text = "鈩�"; @@ -218,14 +218,14 @@ btnFanSwingMode.X = XX; btnFanSwingMode.Y = YY; - btnFanSwingMode.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); - btnFanSwingMode.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + btnFanSwingMode.UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + btnFanSwingMode.SelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); btnFanSwingMode.IsSelected = isAcOpen; frameWhiteBack.AddChidren(btnFanSwingMode); btnFanSwingMode.ButtonClickEvent += (sender, e) => { //绌鸿皟鎵撳紑鐘舵�佹墠鑳界偣鍑� - if (ACControlBase.IsOpen(deviceAc) == true) + if (DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) { //閫夋嫨鎽嗛 this.SelectFanSwing(frameWhiteBack); @@ -240,8 +240,8 @@ var btnModel = new IconViewControl(81); btnModel.X = XX; btnModel.Y = YY; - btnModel.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(deviceAc.currentSystemMode); - btnModel.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(deviceAc.currentSystemMode); + btnModel.UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByModeId(deviceAc.currentSystemMode); + btnModel.SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByModeId(deviceAc.currentSystemMode); btnModel.IsSelected = isAcOpen; frameWhiteBack.AddChidren(btnModel); XX = btnModel.Right + IconSpace; @@ -249,7 +249,7 @@ btnModel.ButtonClickEvent += (sender, e) => { //绌鸿皟鎵撳紑鐘舵�佹墠鑳界偣鍑� - if (ACControlBase.IsOpen(deviceAc) == true) + if (DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) { //閫夋嫨妯″紡 this.SelectAcModel(frameWhiteBack); @@ -275,15 +275,15 @@ var btnFanMode = new IconViewControl(81); btnFanMode.X = XX; btnFanMode.Y = YY; - btnFanMode.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(deviceAc.currentFanMode); - btnFanMode.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(deviceAc.currentFanMode); + btnFanMode.UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanModeUnSelectedImagePathByFanModeId(deviceAc.currentFanMode); + btnFanMode.SelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanModeId(deviceAc.currentFanMode); btnFanMode.IsSelected = isAcOpen; frameWhiteBack.AddChidren(btnFanMode); this.listControl.Add(btnFanMode); btnFanMode.ButtonClickEvent += (sender, e) => { //绌鸿皟鎵撳紑鐘舵�佹墠鑳界偣鍑� - if (ACControlBase.IsOpen(deviceAc) == true) + if (DeviceAcDetailCardMethord.IsOpen(deviceAc) == true) { //閫夋嫨妯″紡 this.SelectAcWindSpeed(frameWhiteBack); @@ -358,14 +358,35 @@ //鍙戦�佽繘搴﹀�� if (deviceAc.currentSystemMode == 3 || deviceAc.currentSystemMode == 8) { + //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + this.canSetProgress = true; + deviceAc.currentCoolingSetpoint = value; + return; + } deviceAc.SetCoolingTemperatureAsync(value * 100); } else if (deviceAc.currentSystemMode == 4) { + //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + this.canSetProgress = true; + deviceAc.currentHeatingSetpoint = value; + return; + } deviceAc.SetHeatingTemperatureAsync(value * 100); } else if (deviceAc.currentSystemMode == 1) { + //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + this.canSetProgress = true; + deviceAc.currentAutoSetpoint = value; + return; + } deviceAc.SetAutoTemperatureAsync(value * 100); } } @@ -480,6 +501,16 @@ /// <param name="fanSwingMode">Fan mode.</param> private void SetFanSwingComand(AC.FanSwingMode fanSwingMode) { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentFanSwingMode = (int)fanSwingMode; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 4096 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + return; + } var oldModel = (AC.FanSwingMode)deviceAc.currentFanSwingMode; if (oldModel == fanSwingMode) { @@ -495,14 +526,14 @@ HdlThreadLogic.Current.RunMain(() => { //杩樺師鐘舵�� - listControl[0].SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingMode(oldModel); - listControl[0].UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingMode(oldModel); + listControl[0].SelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeSelectedImagePathByFanSwingMode(oldModel); + listControl[0].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeUnSelectedImagePathByFanSwingMode(oldModel); }); } }); - listControl[0].SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingMode(fanSwingMode); - listControl[0].UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingMode(fanSwingMode); + listControl[0].SelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeSelectedImagePathByFanSwingMode(fanSwingMode); + listControl[0].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeUnSelectedImagePathByFanSwingMode(fanSwingMode); deviceAc.SetFanSwingAsyncMode(fanSwingMode); } @@ -645,6 +676,32 @@ //閫夋嫨鐨勬槸鍚屼竴涓� return; } + + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentSystemMode = (int)mode; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + //閫侀鐨勬椂鍊�,娌℃湁娓╁害鐨勬蹇� + if (mode == AC.AcMode.FanOnly) + { + //鍔犲噺涓嶅彲浠ョ偣鍑� + btnAdd.CanClick = false; + btnReduce.CanClick = false; + } + //濡傛灉鍘熸潵鐨勭姸鎬佹槸閫侀鐨勮瘽 + else if (oldModel == AC.AcMode.FanOnly) + { + //鍔犲噺鍙互鐐瑰嚮 + btnAdd.CanClick = true; + btnReduce.CanClick = true; + } + return; + } + //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 this.StartCheckResponeResult(this.listControl, (result) => { @@ -654,8 +711,8 @@ HdlThreadLogic.Current.RunMain(() => { //杩樺師鐘舵�� - listControl[1].SelectedImagePath = ACControlBase.GetModeSelectedImagePathByMode(oldModel); - listControl[1].UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByMode(oldModel); + listControl[1].SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByMode(oldModel); + listControl[1].UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByMode(oldModel); }); } else @@ -685,8 +742,8 @@ } }); - listControl[1].SelectedImagePath = ACControlBase.GetModeSelectedImagePathByMode(mode); - listControl[1].UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByMode(mode); + listControl[1].SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByMode(mode); + listControl[1].UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByMode(mode); deviceAc.SetSystemModeAsync(mode); } @@ -718,6 +775,20 @@ /// <param name="isOpen"></param> private void SetSwitchComand(bool isOpen) { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentSystemMode = isOpen == true ? 3 : 0; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + //鍔犲噺鏄惁鍙互鐐瑰嚮 + btnAdd.CanClick = isOpen; + btnReduce.CanClick = isOpen; + return; + } + //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 this.StartCheckResponeResult(this.listControl, (result) => { @@ -853,6 +924,17 @@ rowFrame.ButtonClickEvent += (sender, e) => { ((DialogCommonForm)frameBack.Parent.Parent).CloseForm(); + + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ヤ慨鏀圭紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true) + { + deviceAc.currentFanMode = (int)i_div; + var tempDevice = new CommonDevice(); + tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 }; + tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 0 } }; + this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, tempDevice); + return; + } //鍙戦�侀閫熷懡浠� this.SetAcWindSpeedComand(i_div); }; @@ -879,14 +961,14 @@ HdlThreadLogic.Current.RunMain(() => { //杩樺師鐘舵�� - listControl[3].SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanMode(oldModel); - listControl[3].UnSelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanMode(oldModel); + listControl[3].SelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanMode(oldModel); + listControl[3].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanMode(oldModel); }); } }); - listControl[3].SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanMode(mode); - listControl[3].UnSelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanMode(mode); + listControl[3].SelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanMode(mode); + listControl[3].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanMode(mode); deviceAc.SetFanModeAsync(mode); } @@ -1007,11 +1089,11 @@ arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); } } - this.listControl[1].SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(deviceAc.currentSystemMode); - this.listControl[1].UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(deviceAc.currentSystemMode); - this.btnNowModeView.Text = ACControlBase.GetModeNameByModeId(deviceAc.currentSystemMode); - arcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(deviceAc); - arcScaleSeekBar.IsClickable = ACControlBase.IsOpen(deviceAc); + this.listControl[1].SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByModeId(deviceAc.currentSystemMode); + this.listControl[1].UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByModeId(deviceAc.currentSystemMode); + this.btnNowModeView.Text = DeviceAcDetailCardMethord.GetModeNameByModeId(deviceAc.currentSystemMode); + arcScaleSeekBar.Progress = DeviceAcDetailCardMethord.GetCurrentModeTemperature(deviceAc); + arcScaleSeekBar.IsClickable = DeviceAcDetailCardMethord.IsOpen(deviceAc); //璁剧疆鐘舵�佹枃瀛� 褰撳墠瀹ゆ俯 this.SetStatuText(deviceAc.currentLocalTemperature + "鈩�"); //閫侀娌℃湁娓╁害鐨勬蹇� @@ -1049,8 +1131,8 @@ { this.listControl[3].IsSelected = true; } - this.listControl[3].SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(deviceAc.currentFanMode); - this.listControl[3].UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(deviceAc.currentFanMode); + this.listControl[3].SelectedImagePath = DeviceAcDetailCardMethord.GetFanModeSelectedImagePathByFanModeId(deviceAc.currentFanMode); + this.listControl[3].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanModeUnSelectedImagePathByFanModeId(deviceAc.currentFanMode); }); //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 return true; @@ -1064,8 +1146,8 @@ { this.listControl[0].IsSelected = true; } - this.listControl[0].SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); - this.listControl[0].UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + this.listControl[0].SelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); + this.listControl[0].UnSelectedImagePath = DeviceAcDetailCardMethord.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(deviceAc.currentFanSwingMode); }); //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 return true; diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControlBase.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardMethord.cs similarity index 98% rename from ZigbeeApp/Shared/Phone/Device/AC/ACControlBase.cs rename to ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardMethord.cs index d30aff2..f421dd9 100755 --- a/ZigbeeApp/Shared/Phone/Device/AC/ACControlBase.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardMethord.cs @@ -1,7 +1,10 @@ 锘縰sing System; -namespace Shared.Phone.Device.AC +namespace Shared.Phone.MainPage.ControlForm { - public class ACControlBase + /// <summary> + /// 閮洩鍩庣殑绌鸿皟娣卞害鍗$墖鐨勫悇绉嶆柟娉� + /// </summary> + public class DeviceAcDetailCardMethord { #region 鈼� 鍙橀噺_____________________________ /// <summary> diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs index 53a0bff..1204b2f 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorLightDetailCardForm.cs @@ -1,5 +1,4 @@ 锘縰sing Shared.Common; -using Shared.Phone.Device.DeviceLogic; using Shared.Phone.UserCenter; using System; using System.Collections.Generic; @@ -73,8 +72,8 @@ //褰╃伅鎺т欢 this.waveSeekBar = new WaveSeekBar(); waveSeekBar.Y = Application.GetRealHeight(377); - waveSeekBar.Width = Application.GetMinRealAverage(271); - waveSeekBar.Height = Application.GetMinRealAverage(533); + waveSeekBar.Width = this.GetPictrueRealSize(271); + waveSeekBar.Height = this.GetPictrueRealSize(533); waveSeekBar.Gravity = Gravity.CenterHorizontal; waveSeekBar.WavePadding = Application.GetRealWidth(8); waveSeekBar.MaxValue = 100; @@ -155,7 +154,15 @@ //鍙樻洿杩涘害鐧惧垎姣旂殑鏄剧ず btnProgress.Y = progressY + waveSeekBar.NowProgressY; btnProgress.Text = value + "%"; - nowProgressValue = value; + if (Common.Config.Instance.Home.IsVirtually == false) + { + nowProgressValue = value; + } + else + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛� + ((DimmableLight)this.device).Level = value; + } }; if (this.hadInitControl == true) @@ -194,6 +201,15 @@ /// <param name="isOpen"></param> private void SetSwitchCommand(bool isOpen) { + //濡傛灉浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + ((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0; + //鍒锋柊寮�鍏崇姸鎬� + this.RefreshSwitchStatu(isOpen); + return; + } + //褰撴寜涓嬪紑鍏虫寜閽椂,涓嶈兘鍐嶅彂閫佽繘搴﹀�� this.canSetProgressValue = false; @@ -217,27 +233,20 @@ }); }); - //鐘舵�佸彇鍙� - listControl[0].IsSelected = !listControl[0].IsSelected; //鍙戦�佺瓑寰呯殑鏃堕棿鍐�,涓嶈兘婊戝姩褰╃伅鎺т欢 waveSeekBar.IsClickable = false; + //鐘舵�佸彇鍙� + listControl[0].IsSelected = !listControl[0].IsSelected; if (isOpen == true) { waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End); - } - else - { - waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); - } - - if (isOpen == true) - { //鎵撳紑 this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1)); this.device.SwitchControl(1); } else { + waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); //鍏抽棴 this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close)); this.device.SwitchControl(0); diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs index 8fb999c..27098e8 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs @@ -83,6 +83,22 @@ btnOpen.Y = Application.GetRealHeight(994) - btnOpen.YOffset; btnOpen.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == true) + { + ((Rollershade)device).WcdCurrentPositionLiftPercentage = 100; + if (this.WcdType == 0) + { + SeekBarSiphonateCurtain.Progress = 100; + } + else + { + SeekBarOpenCurtain.Progress = 100; + } + //璁剧疆鐘舵�佹枃瀛� + this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device)); + return; + } //鍙戦�佺獥甯樺懡浠� this.SetCurtainCommand(0); }; @@ -98,6 +114,11 @@ btnStop.Y = btnOpen.Y; btnStop.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //鍙戦�佺獥甯樺懡浠� this.SetCurtainCommand(2); }; @@ -111,6 +132,22 @@ btnClose.Y = btnOpen.Y; btnClose.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == true) + { + ((Rollershade)device).WcdCurrentPositionLiftPercentage = 0; + if (this.WcdType == 0) + { + SeekBarSiphonateCurtain.Progress = 0; + } + else + { + SeekBarOpenCurtain.Progress = 0; + } + //璁剧疆鐘舵�佹枃瀛� + this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device)); + return; + } //鍙戦�佺獥甯樺懡浠� this.SetCurtainCommand(1); }; @@ -143,8 +180,8 @@ //鍗峰笜鎺т欢 this.SeekBarSiphonateCurtain = new CurtainRollSeekBar(); SeekBarSiphonateCurtain.Y = Application.GetRealHeight(300); - SeekBarSiphonateCurtain.Width = Application.GetMinRealAverage(438); - SeekBarSiphonateCurtain.Height = Application.GetMinRealAverage(576); + SeekBarSiphonateCurtain.Width = this.GetPictrueRealSize(438); + SeekBarSiphonateCurtain.Height = this.GetPictrueRealSize(576); SeekBarSiphonateCurtain.Gravity = Gravity.CenterHorizontal; SeekBarSiphonateCurtain.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage; frameWhiteBack.AddChidren(SeekBarSiphonateCurtain); @@ -193,7 +230,16 @@ //鍙樻洿杩涘害鐧惧垎姣旂殑鏄剧ず btnProgress.Y = progressY + SeekBarSiphonateCurtain.NowProgressY; btnProgress.Text = value + "%"; - nowProgressValue = value; + + if (Common.Config.Instance.Home.IsVirtually == false) + { + nowProgressValue = value; + } + else + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛� + (device as Rollershade).WcdCurrentPositionLiftPercentage = value; + } }; if (this.hadInitControl == true) @@ -233,8 +279,8 @@ //寮�鍚堝笜鎺т欢 this.SeekBarOpenCurtain = new CurtainSeekBar(); SeekBarOpenCurtain.Y = Application.GetRealHeight(334); - SeekBarOpenCurtain.Width = Application.GetMinRealAverage(570); - SeekBarOpenCurtain.Height = Application.GetMinRealAverage(513); + SeekBarOpenCurtain.Width = this.GetPictrueRealSize(570); + SeekBarOpenCurtain.Height = this.GetPictrueRealSize(513); SeekBarOpenCurtain.Gravity = Gravity.CenterHorizontal; SeekBarOpenCurtain.IsProgressTextShow = false; SeekBarOpenCurtain.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage; @@ -280,7 +326,16 @@ { btnProgress.X = progressX + SeekBarOpenCurtain.NowProgressX - Application.GetMinReal(5); btnProgress.Text = value + "%"; - nowProgressValue = value; + + if (Common.Config.Instance.Home.IsVirtually == false) + { + nowProgressValue = value; + } + else + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴淇敼缂撳瓨 + (device as Rollershade).WcdCurrentPositionLiftPercentage = value; + } }; //寮�涓�涓嚎绋�,鐩戣鏄惁婊戝姩鐨勬粦鍔ㄦ潯,姣忕妫�娴嬩竴娆� diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs index 542282a..885111b 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs @@ -109,8 +109,8 @@ { //寮�鍏崇殑鑳屾櫙鍥剧墖 var picSwitchBack = new FrameLayout(); - picSwitchBack.Height = Application.GetMinRealAverage(579); - picSwitchBack.Width = Application.GetMinRealAverage(579); + picSwitchBack.Height = this.GetPictrueRealSize(579); + picSwitchBack.Width = this.GetPictrueRealSize(579); picSwitchBack.Y = Application.GetRealHeight(340); picSwitchBack.BackgroundImagePath = "Light/OnOff.png"; picSwitchBack.Gravity = Gravity.CenterHorizontal; @@ -120,8 +120,8 @@ var btnClose = new IconViewControl(81); btnClose.UnSelectedImagePath = "Light/OFF.png"; btnClose.SelectedImagePath = "Light/OFFSelected.png"; - btnClose.X = Application.GetMinRealAverage(101); - btnClose.Y = Application.GetMinRealAverage(248); + btnClose.X = this.GetPictrueRealSize(101); + btnClose.Y = this.GetPictrueRealSize(248); picSwitchBack.AddChidren(btnClose); listControl.Add(btnClose); @@ -129,7 +129,7 @@ var btnOpen = new IconViewControl(81); btnOpen.UnSelectedImagePath = "Light/ON.png"; btnOpen.SelectedImagePath = "Light/ONSelected.png"; - btnOpen.X = Application.GetMinRealAverage(397); + btnOpen.X = this.GetPictrueRealSize(397); btnOpen.Y = btnClose.Y; picSwitchBack.AddChidren(btnOpen); listControl.Add(btnOpen); @@ -273,6 +273,16 @@ /// <param name="isOpen"></param> private void SetSwitchCommand(bool isOpen) { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + ((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0; + //鍙樻洿鍗$墖鐘舵�� + this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1); + //璁剧疆鐘舵�佹枃瀛� + this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device)); + return; + } //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 this.StartCheckResponeResult(this.listControl, (result) => { diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs index e40e221..fbc388a 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs @@ -9,7 +9,7 @@ /// <summary> /// 涓婚〉鐨勮澶囧崱鐗囨帶浠跺簳灞傚叡閫�(瀹藉害:458 + 14 * 2 楂樺害:305 + 43) /// </summary> - public class DeviceCardCommon : FrameLayoutControl + public class DeviceCardCommon : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ @@ -145,7 +145,7 @@ this.ChangedChidrenBindMode(fraDeviceRound, ChidrenBindMode.BindEventOnly); //鐘舵�佹枃鏈帶浠� - this.btnStatu = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(280), HdlControlLogic.Current.GetPictrueRealSize(63), false); + this.btnStatu = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(300), HdlControlLogic.Current.GetPictrueRealSize(63), false); btnStatu.X = HdlControlLogic.Current.GetPictrueRealSize(46); btnStatu.Y = HdlControlLogic.Current.GetPictrueRealSize(236); btnStatu.TextColor = UserCenterColor.Current.TextColor1; @@ -195,6 +195,8 @@ } //璁惧鍥炬爣涔熷埛鏂� Common.LocalDevice.Current.SetDeviceIconToControl2(btnDeviceIcon, i_device); + //鍚嶅瓧鍒锋柊 + this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device); //妫�娴嬭澶囨槸鍚︽槸鎵撳紑鐘舵�� bool isOpen = this.CheckIsOpenStatu(i_device); if (this.isHadOpenSwitch == true && i_device.HadReadDeviceStatu == false) @@ -343,6 +345,11 @@ /// <param name="oldOpenStatu">璁惧鐩墠鐨勫紑鍏崇姸鎬�</param> public void StartCheckResponeResult(bool oldOpenStatu) { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } this.ResponeResult = 0; //寮�鍏虫寜閽笉鑳藉啀鐐瑰嚮 if (btnSwitch != null) { this.btnSwitch.CanClick = false; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs index 7094af3..fecfda3 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -27,6 +28,15 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((AC)i_device).currentSystemMode = btnSwitch.IsSelected == true ? 0 : 3; + this.RefreshControlInfo(this.device); + return; + } + bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetCardOpenStatu(setStatu); @@ -92,10 +102,15 @@ /// </summary> public override void SendStatuComand() { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendACStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendACStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs index 59f0a9a..d37e7e5 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -27,6 +28,14 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((LightBase)i_device).OnOffStatus = btnSwitch.IsSelected == true ? 0 : 1; + this.RefreshControlInfo(this.device); + return; + } bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetCardOpenStatu(setStatu); @@ -106,10 +115,15 @@ /// </summary> public override void SendStatuComand() { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendLightStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs index 46e3cf1..1d249da 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -27,6 +28,14 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((LightBase)i_device).OnOffStatus = btnSwitch.IsSelected == true ? 0 : 1; + this.RefreshControlInfo(this.device); + return; + } bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetCardOpenStatu(setStatu); @@ -92,10 +101,15 @@ /// </summary> public override void SendStatuComand() { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendDimmableLightStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs index 533c332..e0184f4 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -27,6 +28,15 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((Rollershade)i_device).WcdCurrentPositionLiftPercentage = btnSwitch.IsSelected == true ? 0 : 100; + this.RefreshControlInfo(this.device); + return; + } + bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetCardOpenStatu(setStatu); @@ -91,10 +101,15 @@ /// </summary> public override void SendStatuComand() { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendCurtainStatuComand(this.device); } if (((Rollershade)this.device).WcdType == -1) { diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs index 5e9c574..fdc89bc 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs @@ -19,9 +19,12 @@ public override void InitControl(CommonDevice i_device) { base.InitControl(i_device); - - //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 - this.AddDetailInfoEvent(i_device); + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == false) + { + //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 + this.AddDetailInfoEvent(i_device); + } } #endregion diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs index 2b5184e..738ffde 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Phone.UserCenter; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -27,6 +28,15 @@ var btnSwitch = this.AddSwitchControl(); btnSwitch.ButtonClickEvent += (sender, e) => { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //鐩存帴鍙樻洿缂撳瓨 + ((LightBase)i_device).OnOffStatus = btnSwitch.IsSelected == true ? 0 : 1; + this.RefreshControlInfo(this.device); + return; + } + bool setStatu = !btnSwitch.IsSelected; //鍙樻洿鍗$墖鐘舵�� this.SetCardOpenStatu(setStatu); @@ -106,10 +116,15 @@ /// </summary> public override void SendStatuComand() { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { - Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendLightStatuComand(this.device); + HdlDeviceAttributeLogic.Current.SendLightStatuComand(this.device); } } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs index b9b5160..85f4a84 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceTemperatureCardControl.cs @@ -17,6 +17,11 @@ /// </summary> public override void SendStatuComand() { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠� if (this.CheckCanSendStatuComand() == true) { diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs index f23edeb..3bd2403 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs @@ -8,7 +8,7 @@ /// <summary> /// 鏈垎閰嶇晫闈㈢殑璁惧鍔熻兘鍥炬爣鎺т欢 /// </summary> - public class DeviceFunctionUnallocatedControl : FrameLayoutControl + public class DeviceFunctionUnallocatedControl : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs index aafb758..aa87c60 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs @@ -79,11 +79,11 @@ this.device = i_device; //璁惧鍥炬爣鑳屾櫙鎺т欢 this.frameIconBackGroud = new FrameLayout(); - frameIconBackGroud.Height = Application.GetMinRealAverage(112); - frameIconBackGroud.Width = Application.GetMinRealAverage(112); + frameIconBackGroud.Height = this.GetPictrueRealSize(112); + frameIconBackGroud.Width = this.GetPictrueRealSize(112); frameIconBackGroud.Gravity = Gravity.CenterVertical; frameIconBackGroud.X = Application.GetRealWidth(46); - frameIconBackGroud.Radius = (uint)Application.GetMinRealAverage(112 / 2); + frameIconBackGroud.Radius = (uint)this.GetPictrueRealSize(112 / 2); frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor; this.AddChidren(frameIconBackGroud, ChidrenBindMode.NotBind); if (chidrenYaxis != 0) diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs index 319a7f6..02125b8 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs @@ -8,7 +8,7 @@ /// <summary> /// 宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈤噷闈㈢殑鎴块棿鍗$墖鎺т欢 /// </summary> - public class ListRoomCardControl : FrameLayoutControl + public class ListRoomCardControl : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/SafetyShortcutControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/SafetyShortcutControl.cs index 38484ea..b8df966 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/SafetyShortcutControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/SafetyShortcutControl.cs @@ -21,8 +21,8 @@ /// </summary> public SafetyShortcutControl() { - this.Height = Application.GetMinRealAverage(69); - this.Width = Application.GetMinRealAverage(69); + this.Height = HdlControlLogic.Current.GetPictrueRealSize(69); + this.Width = HdlControlLogic.Current.GetPictrueRealSize(69); this.UnSelectedImagePath = "Item/SafetyShortcut.png"; this.MouseUpEventHandler += (sender, e) => { diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs index fbb0cd2..58b89b3 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs @@ -8,7 +8,7 @@ /// <summary> /// 鍦烘櫙鍗$墖鎺т欢 /// </summary> - public class SceneCardControl : FrameLayoutControl + public class SceneCardControl : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ diff --git a/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs b/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs old mode 100644 new mode 100755 index cf7e7a4..3e38a1c --- a/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs @@ -86,11 +86,9 @@ btnPic.InitControl(device.DeviceAddr, device.DeviceEpoint); btnPic.ButtonClickEvent += (sender, e) => { - var localPic = new Device.CommonForm.DeviceIconSelectedIMGByLocal(); - UserView.HomePage.Instance.AddChidren(localPic); - UserView.HomePage.Instance.PageIndex += 1; - localPic.Show(); - localPic.action = (unSelectedImagePath, selectedImagePath) => + var form = new SelectLocalDeviceImageForm(); + form.AddForm(); + form.FinishSelectEvent = (unSelectedImagePath) => { //鍙樻洿鍥剧墖 device.IconPath = unSelectedImagePath; @@ -151,7 +149,7 @@ } //鎵�灞炴ā鍧� - caption = Language.StringByID(R.MyInternationalizationString.BelongModel); + caption = Language.StringByID(R.MyInternationalizationString.BelongDevice); deviceName = Common.LocalDevice.Current.GetDeviceMacName(device); var rowBelongModul = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2); listview.AddChidren(rowBelongModul); @@ -248,7 +246,7 @@ } //鎵�灞炴ā鍧� - caption = Language.StringByID(R.MyInternationalizationString.BelongModel); + caption = Language.StringByID(R.MyInternationalizationString.BelongDevice); nameValue = Common.LocalDevice.Current.GetDeviceMacName(device); var rowBelongModul = new FrameCaptionViewControl(caption, nameValue, listview.rowSpace / 2); rowBelongModul.UseClickStatu = false; @@ -362,17 +360,17 @@ } //濡傛灉鏄柊椋� - if (device.Type == DeviceType.FreshAir) - { - //鍔熻兘绫诲瀷 - string caption = Language.StringByID(R.MyInternationalizationString.uFunctionType); + if (device.Type == DeviceType.FreshAir) + { + //鍔熻兘绫诲瀷 + string caption = Language.StringByID(R.MyInternationalizationString.uFunctionType); string strType = Language.StringByID(R.MyInternationalizationString.FreshAir); var btnFunction = new FrameCaptionViewControl(caption, strType, listview.rowSpace / 2); btnFunction.UseClickStatu = false; listview.AddChidren(btnFunction); btnFunction.InitControl(); //搴曠嚎 - btnFunction.AddBottomLine(); + btnFunction.AddBottomLine(); } } diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs index 97428b0..fb67b15 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs @@ -161,7 +161,7 @@ } else { - var selectHouse = new Device.Category.SelectHouse(); + var selectHouse = new Category.SelectHouseForm(); selectHouse.Init(); selectHouse.HouseAction = (houseId) => { @@ -187,7 +187,7 @@ } //妫�娴嬫槸鍚︾粦瀹氭湁缃戝叧 - if (this.CheckHadBindGateway() == false) + if (Common.Config.Instance.Home.IsVirtually == false && this.CheckHadBindGateway() == false) { //鏄剧ず娌℃湁缁戝畾杩囩綉鍏崇殑鐣岄潰 this.ShowNoGatewayTip(); @@ -312,7 +312,7 @@ bg.UnSelectedImagePath = "Item/NoBindGW.png"; this.listBodyContr.frameTable.AddChidren(bg); - var tip = new NormalViewControl(Application.GetMinRealAverage(717), Application.GetMinRealAverage(58), false); + var tip = new NormalViewControl(this.GetPictrueRealSize(717), this.GetPictrueRealSize(58), false); tip.Y = Application.GetRealHeight(815); tip.Gravity = Gravity.CenterHorizontal; tip.TextID = R.MyInternationalizationString.NewAccountNeedBingGW; @@ -573,7 +573,7 @@ //璁惧璁℃暟 int contrCount = 0; //X杞村潗鏍�(鍥剧墖宸﹁竟鏈変綑鐧�) - int XX = Application.GetMinRealAverage(44); + int XX = this.GetPictrueRealSize(44); //Y杞村潗鏍� int YY = 0; var listContr = new List<Controls.DeviceCardCommon>(); @@ -647,11 +647,11 @@ //璁惧璁℃暟 contrCount++; //鍗$墖宸﹀彸涓よ竟鏈�14鐨勪綑鐧�,姣忎袱涓悗,X杞撮噸缃� - XX = contrCount % 2 == 0 ? Application.GetMinRealAverage(44) : cardContr.Right + Application.GetMinRealAverage(20); + XX = contrCount % 2 == 0 ? this.GetPictrueRealSize(44) : cardContr.Right + this.GetPictrueRealSize(20); if (contrCount % 2 == 0) { //娌′袱涓箣鍚�,Y杞撮�掑 - YY = cardContr.Bottom + Application.GetMinRealAverage(15); + YY = cardContr.Bottom + this.GetPictrueRealSize(15); } //鎺т欢璁板綍鍒扮紦瀛樹腑 this.dicDeviceCardControl[LocalDevice.Current.GetDeviceMainKeys(device)] = cardContr; @@ -699,8 +699,8 @@ var noFunction = new Button { Y = Application.GetRealHeight(69), - Width = Application.GetMinRealAverage(683), - Height = Application.GetMinRealAverage(392), + Width = this.GetPictrueRealSize(683), + Height = this.GetPictrueRealSize(392), Gravity = Gravity.CenterHorizontal, UnSelectedImagePath = "Item/NoFunction.png" }; @@ -755,12 +755,12 @@ if (contrCount % 2 == 1) { //绗竴涓浐瀹�44 - XX = Application.GetMinRealAverage(44); + XX = this.GetPictrueRealSize(44); } else { //绗簩涓槸44+鎺т欢瀹藉害+20浣欑櫧 - XX = Application.GetMinRealAverage(44) + this.dicDeviceCardControl[mainkey].Width + Application.GetMinRealAverage(20); + XX = this.GetPictrueRealSize(44) + this.dicDeviceCardControl[mainkey].Width + this.GetPictrueRealSize(20); } //姣忎袱涓箣鍚�,骞朵笖鏄涓�涓殑鏃跺��,Y杞撮�掑 @@ -769,7 +769,7 @@ //姹傚晢 int value = contrCount / 2; //鎺т欢鐨勫簳閮ㄦ湁15鐨勯棿闅� - YY = value * (this.dicDeviceCardControl[mainkey].Height + Application.GetMinRealAverage(15)); + YY = value * (this.dicDeviceCardControl[mainkey].Height + this.GetPictrueRealSize(15)); } if (canMove == true) { @@ -1009,12 +1009,12 @@ if (contrCount % 2 == 1) { //绗竴涓浐瀹�44 - XX = Application.GetMinRealAverage(44); + XX = this.GetPictrueRealSize(44); } else { //绗簩涓槸44+鎺т欢瀹藉害+20浣欑櫧 - XX = Application.GetMinRealAverage(44) + this.dicSceneCardControl[sceneId].Width + Application.GetMinRealAverage(20); + XX = this.GetPictrueRealSize(44) + this.dicSceneCardControl[sceneId].Width + this.GetPictrueRealSize(20); } //姣忎袱涓箣鍚�,骞朵笖鏄涓�涓椂,Y杞撮�掑 @@ -1023,7 +1023,7 @@ //姹傚晢 int value = contrCount / 2; //鎺т欢鐨勫簳閮ㄦ湁15鐨勯棿闅� - YY = value * (this.dicSceneCardControl[sceneId].Height + Application.GetMinRealAverage(15)); + YY = value * (this.dicSceneCardControl[sceneId].Height + this.GetPictrueRealSize(15)); } if (canMove == true) { @@ -1095,8 +1095,6 @@ Config.Instance.Save(); //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ await UserCenterLogic.InitUserCenterMenmoryAndThread(); - //鍒濆鍖栧叏閮ㄦ埧闂� - HdlRoomLogic.Current.InitAllRoom(); Application.RunOnMainThread(() => { @@ -1217,7 +1215,7 @@ /// </summary> private void ShowSelectFloorForm(NormalViewControl btnFloor) { - var floorFL = new Device.Category.SelectFloor(); + var floorFL = new Category.SelectFloorForm(); this.AddChidren(floorFL); floorFL.Init(35, 153); floorFL.changeFloor = true; diff --git a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs index e916bc0..aa8dd52 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs @@ -1,7 +1,6 @@ 锘縰sing System; using System.Collections.Generic; using Shared.Common; -using Shared.Phone.Device.Category; using Shared.Phone.Device.CommonForm; using Shared.Phone.UserCenter; using Shared.Phone.UserView; @@ -91,7 +90,10 @@ }; //鑾峰彇妤煎眰 - this.curFloorId = Config.Instance.Home.CurrentFloorId; + if (this.curFloorId == string.Empty) + { + this.curFloorId = Config.Instance.Home.CurrentFloorId; + } var dicFloor = HdlRoomLogic.Current.GetFloorSortList(); if (dicFloor.Count == 0) { @@ -113,7 +115,7 @@ btnIconContr.ButtonClickEvent += (sender, e) => { //妤煎眰鑿滃崟 - var floors = new SelectFloor(); + var floors = new Category.SelectFloorForm(); AddChidren(floors); floors.changeFloor = false; floors.CurFloorId = curFloorId; @@ -237,7 +239,7 @@ private void InitRoomCardControl(int XX, int YY) { //妗屽竷鎺т欢 - var frameBack = new FrameLayoutControl(); + var frameBack = new FrameLayoutStatuControl(); frameBack.X = XX; frameBack.Y = YY; frameBack.Width = this.GetPictrueRealSize(495); diff --git a/ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs new file mode 100755 index 0000000..6b03468 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs @@ -0,0 +1,133 @@ +锘縰sing Shared.Phone.UserCenter; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.MainPage +{ + /// <summary> + /// 閫夋嫨鏈湴璁惧鍥剧墖鐨勭晫闈� + /// </summary> + public class SelectLocalDeviceImageForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 缁撴潫閫夋嫨鐨勪簨浠�(鍥剧墖鍚嶅瓧) + /// </summary> + public Action<string> FinishSelectEvent = null; + /// <summary> + /// 褰撳墠閫夋嫨鐨勫浘鏍囨帶浠� + /// </summary> + private PicViewControl selectContr = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.SelectIcon)); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + //鍒楄〃鎺т欢 + var listView = new VerticalListControl(); + listView.Height = bodyFrameLayout.Height; + bodyFrameLayout.AddChidren(listView); + + int space = this.GetPictrueRealSize(46); + int backWidth = (listView.Width - ControlCommonResourse.XXLeft * 2 - space * 3) / 4; + //闃叉璇樊锛屽垎涓ゆ璁$畻 + int iconWidth = backWidth - this.GetPictrueRealSize(43) - this.GetPictrueRealSize(43); + + //涓�鍏�28寮犲浘鐗� + FrameLayout frameRow = null; + for (int i = 0; i < 28; i++) + { + //4涓竴缁� + if (i % 4 == 0) + { + //琛屾帶浠� + frameRow = new FrameLayout(); + frameRow.Height = backWidth + Application.GetRealHeight(58); + listView.AddChidren(frameRow); + } + //鑳屾櫙 + var frameBack = new FrameLayoutStatuControl(); + frameBack.UseClickStatu = false; + frameBack.Height = backWidth; + frameBack.Width = backWidth; + frameBack.Radius = (uint)backWidth / 2; + frameBack.BackgroundColor = UserCenterColor.Current.White; + frameBack.X = ControlCommonResourse.XXLeft + (i % 4) * (backWidth + space); + frameBack.Y = Application.GetRealHeight(58); + frameRow.AddChidren(frameBack); + + //鍥剧墖 + var btnIcon = new PicViewControl(iconWidth, iconWidth, false); + btnIcon.UnSelectedImagePath = $"FunctionIcon/{i + 1}Icon.png"; + btnIcon.SelectedImagePath = $"FunctionIcon/{i + 1}IconSelected.png"; + btnIcon.Gravity = Gravity.Center; + frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); + + frameBack.ButtonClickEvent += (sender, e) => + { + btnIcon.IsSelected = !btnIcon.IsSelected; + if (this.selectContr != null && this.selectContr.UnSelectedImagePath != btnIcon.UnSelectedImagePath) + { + //鍙栨秷鎺夊墠涓�涓� + this.selectContr.IsSelected = false; + } + this.selectContr = btnIcon; + }; + } + + //纭畾 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uConfirm1; + bodyFrameLayout.AddChidren(btnSave); + btnSave.ButtonClickEvent += (sender, e) => + { + if (this.selectContr != null && this.selectContr.IsSelected == true) + { + //璋冪敤鍥炶皟鍑芥暟 + this.FinishSelectEvent?.Invoke(this.selectContr.UnSelectedImagePath); + } + this.CloseForm(); + }; + + //璋冩暣妗屽竷楂樺害 + listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23)); + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + this.FinishSelectEvent = null; + + base.CloseFormBefore(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs index 74c5755..81d6f2a 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs @@ -1,7 +1,6 @@ 锘縰sing System; using System.Collections.Generic; using Shared.Common; -using Shared.Phone.Device.Category; using Shared.Phone.Device.CommonForm; using Shared.Phone.UserCenter; using Shared.Phone.UserView; @@ -19,7 +18,7 @@ /// <summary> /// 娣诲姞鍒� 鐨勮儗鏅浘鎺т欢 /// </summary> - private FrameLayoutControl frameAddBackGroud = null; + private FrameLayoutStatuControl frameAddBackGroud = null; /// <summary> /// 鍔熻兘鐨勬甯冩帶浠� /// </summary> @@ -511,7 +510,7 @@ private void InitAddToControl() { //娣诲姞鍒� 鐨勮儗鏅浘鎺т欢 - this.frameAddBackGroud = new FrameLayoutControl(); + this.frameAddBackGroud = new FrameLayoutStatuControl(); frameAddBackGroud.UseClickStatu = false; frameAddBackGroud.Height = Application.GetRealHeight(202); frameAddBackGroud.Gravity = Gravity.BottomCenter; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs index 7b0dbfb..5ffb606 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs @@ -1,10 +1,9 @@ 锘縰sing System; using System.Collections.Generic; using System.Net; -using System.Runtime.Remoting.Contexts; using System.Text; using Shared.Common; -using Shared.Phone.Device.CommonForm; + namespace Shared.Phone.UserCenter.Abount { /// <summary> @@ -20,11 +19,11 @@ /// <summary> /// The web client. /// </summary> - public WebClient webClient=new WebClient { }; + public WebClient webClient = new WebClient { }; /// <summary> /// 鏇存柊涓� /// </summary> - public Button updatingBtn; + public NormalViewControl btnUpdating; /// <summary> /// distributedMark /// </summary> @@ -32,7 +31,7 @@ /// <summary> /// updateRow /// </summary> - public DeviceInfoRow updateRow; + public FrameRowControl rowUpdate; /// <summary> /// 涓嬭浇瀹夊崜apk鐨刡yte闀垮害 /// </summary> @@ -40,13 +39,6 @@ #endregion - /// <summary> - /// Initializes a new instance of the <see cref="T:Shared.Phone.UserCenter.Abount.AbountForm"/> class. - /// </summary> - public AbountForm() - { - - } /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> @@ -63,28 +55,9 @@ public override void CloseFormBefore() { #if Android - //if (isUpdating == true) - //{ - //var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.CancelUpdating), Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim)); - //alert.Show(); - //alert.ResultEventHandler += (send, e) => - //{ - // if (e) - // { - SetDownLoadBtnNoVisible(); - CancelDownLoadApkAsync(); - base.CloseFormBefore(); - //} - // else - // { - // return; - // } - // }; - //} - //else - //{ - // base.CloseFormBefore(); - //} + SetDownLoadBtnNoVisible(); + CancelDownLoadApkAsync(); + base.CloseFormBefore(); #elif iOS base.CloseFormBefore(); #endif @@ -94,111 +67,103 @@ /// </summary> private void InitMiddleFrame() { - bodyFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor; - var logoFrameLayout = new FrameLayout - { - Height = Application.GetRealHeight(484), - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - bodyFrameLayout.AddChidren(logoFrameLayout); - - var logoBackground = new FrameLayout - { - Y = Application.GetRealHeight(104), - Width = Application.GetMinRealAverage(167), - Height = Application.GetMinRealAverage(167), - Gravity = Gravity.CenterHorizontal, - BackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor, - Radius = (uint)Application.GetRealHeight(37), - }; - logoFrameLayout.AddChidren(logoBackground); - - var logoBtn = new Button() - { - Width = Application.GetMinRealAverage(144), - Height = Application.GetMinRealAverage(144), - UnSelectedImagePath = "Account/Logo_White.png", - Gravity = Gravity.Center - }; - logoBackground.AddChidren(logoBtn); - - var nameBtn = new Button() - { - Y = Application.GetRealHeight(294), - Width = Application.GetRealWidth(700), - Height = Application.GetRealHeight(60), - Gravity = Gravity.CenterHorizontal, - Text = "HDL Home", - TextSize = 15, - TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor - }; - logoFrameLayout.AddChidren(nameBtn); - - var versionBtn = new Button() - { - Y = Application.GetRealHeight(366), - Width = Application.GetRealWidth(700), - Height = Application.GetRealHeight(50), - Gravity = Gravity.CenterHorizontal, - Text = $"{Language.StringByID(R.MyInternationalizationString.VersionCode)} {CommonPage.CodeIDString}", - TextSize = 12, - TextColor = ZigbeeColor.Current.GXCTextGrayColor - }; - logoFrameLayout.AddChidren(versionBtn); - - - var versionFL = new FrameLayout - { - Y = Application.GetRealHeight(510), - //Height = Application.GetRealHeight(300), - Height = Application.GetRealHeight(300-127-12), - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - bodyFrameLayout.AddChidren(versionFL); - - //var SLARow = new DeviceInfoRow(12); - //SLARow.Init(); - //SLARow.SetTipTitle(R.MyInternationalizationString.SLA); - //SLARow.NameText.TextAlignment = TextAlignment.CenterRight; - //versionFL.AddChidren(SLARow); - //SLARow.ClickBtn.MouseUpEventHandler += (sender, e) => - //{ - // var slaForm = new SLAForm(); - // slaForm.AddForm(); - //}; - - //updateRow = new DeviceInfoRow(12 + 127 + 12); - updateRow = new DeviceInfoRow(12); - updateRow.Init(); - updateRow.SetTipTitle(R.MyInternationalizationString.UpdateVersion); - updateRow.NameText.TextAlignment = TextAlignment.CenterRight; - updateRow.HideLine(true); - updateRow.SetTitle(R.MyInternationalizationString.TheAppVersionIsNewest); - updateRow.CanClick(false); - updateRow.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor); - versionFL.AddChidren(updateRow); - updateRow.ClickBtn.MouseUpEventHandler += (sender, e) => + //澶撮儴鐧借壊鑳屾櫙 + var frameLogo = new FrameLayoutBase(); + frameLogo.Height = Application.GetRealHeight(484); + frameLogo.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; + bodyFrameLayout.AddChidren(frameLogo); + //鍥炬爣鐨勫鍣� + var frameLogoBackground = new FrameLayoutBase(); + frameLogoBackground.Y = Application.GetRealHeight(104); + frameLogoBackground.Width = this.GetPictrueRealSize(167); + frameLogoBackground.Height = this.GetPictrueRealSize(167); + frameLogoBackground.Gravity = Gravity.CenterHorizontal; + frameLogoBackground.BackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor; + frameLogoBackground.Radius = (uint)Application.GetRealHeight(37); + frameLogo.AddChidren(frameLogoBackground); + //鍥炬爣 + var btnLogo = new IconViewControl(144); + btnLogo.UnSelectedImagePath = "Account/Logo_White.png"; + btnLogo.Gravity = Gravity.Center; + frameLogoBackground.AddChidren(btnLogo); + //HDL Home + var btnName = new NormalViewControl(700, 60, true); + btnName.Y = Application.GetRealHeight(294); + btnName.Gravity = Gravity.CenterHorizontal; + btnName.Text = "HDL Home"; + btnName.TextSize = 15; + btnName.TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor; + btnName.TextAlignment = TextAlignment.Center; + frameLogo.AddChidren(btnName); + //鐗堟湰鍙� + var btnVersion = new NormalViewControl(700, 50, true); + btnVersion.Y = Application.GetRealHeight(366); + btnVersion.Gravity = Gravity.CenterHorizontal; + btnVersion.Text = $"{Language.StringByID(R.MyInternationalizationString.VersionCode)} {CommonPage.CodeIDString}"; + btnVersion.TextSize = 12; + btnVersion.TextColor = ZigbeeColor.Current.GXCTextGrayColor; + btnVersion.TextAlignment = TextAlignment.Center; + frameLogo.AddChidren(btnVersion); + //鍒楄〃鎺т欢 + var listView = new FrameListControl(12); + listView.Y = frameLogo.Bottom + Application.GetRealHeight(23); + listView.BackgroundColor = UserCenterColor.Current.White; + listView.Height = Application.GetRealHeight(500); + bodyFrameLayout.AddChidren(listView); + //鏈嶅姟鍗忚 + //var rowService = new FrameRowControl(listView.rowSpace / 2); + //listView.AddChidren(rowService); + //rowService.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.SLA), 400); + //rowService.AddRightArrow(); + //rowService.AddBottomLine(); + //鐗堟湰鏇存柊 + this.rowUpdate = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(rowUpdate); + rowUpdate.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.UpdateVersion), 400); + rowUpdate.AddRightArrow(); + var btnRightView = rowUpdate.AddMostRightView("", 400); + rowUpdate.CanClick = false; + rowUpdate.ButtonClickEvent += (sender, e) => { UpdateVersion(); }; + //璋冩暣妗屽竷楂樺害 + listView.AdjustRealHeight(Application.GetRealHeight(23)); + //鏇存柊涓� + this.btnUpdating = new NormalViewControl(556, 106, true); + btnUpdating.Y = Application.GetRealHeight(994); + btnUpdating.Radius = (uint)Application.GetRealHeight(53); + btnUpdating.BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor; + btnUpdating.TextID = R.MyInternationalizationString.Updating; + btnUpdating.TextSize = 15; + btnUpdating.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; + btnUpdating.Gravity = Gravity.CenterHorizontal; + btnUpdating.TextAlignment = TextAlignment.Center; + bodyFrameLayout.AddChidren(btnUpdating); - updatingBtn = new Button() + //璁剧疆杩涘害鎺т欢涓嶅彲瑙� + this.SetDownLoadBtnNoVisible(); + + //妫�娴嬫柊鐗堟湰 + HdlThreadLogic.Current.RunThread(async () => { - Y = Application.GetRealHeight(994), - Width = Application.GetRealWidth(556), - Height = Application.GetRealHeight(106), - Radius=(uint)Application.GetRealHeight(53), - BackgroundColor=ZigbeeColor.Current.GXCDailogBackGroundColor, - TextID = R.MyInternationalizationString.Updating, - TextSize=15, - TextColor = ZigbeeColor.Current.GXCTextWhiteColor, - Gravity=Gravity.CenterHorizontal - }; - bodyFrameLayout.AddChidren(updatingBtn); + var result = await CanUpdateAsync(); + HdlThreadLogic.Current.RunMain(() => + { + if (result) + { + //鏇存柊鏈�鏂扮増 + btnRightView.TextID = R.MyInternationalizationString.Update; + rowUpdate.CanClick = true; + } + else + { + btnRightView.TextID = R.MyInternationalizationString.TheAppVersionIsNewest; + } + }); - SetDownLoadBtnNoVisible(); - CheckVersion(); + }); } /// <summary> @@ -208,16 +173,7 @@ { new System.Threading.Thread(async () => { - var re = await CanUpdateAsync(); - if (re) - { - Application.RunOnMainThread(() => - { - updateRow.CanClick(true); - updateRow.SetTitleColor(ZigbeeColor.Current.GXCButtonSelectedColor); - updateRow.SetTitle(R.MyInternationalizationString.Update); - }); - } + }) { IsBackground = true }.Start(); @@ -228,7 +184,7 @@ private void SetDownLoadBtnNoVisible() { isUpdating = false; - updatingBtn.Visible = false; + btnUpdating.Visible = false; } /// <summary> /// 璁剧疆杩涘害鎺т欢鍙 @@ -236,8 +192,8 @@ private void SetDownLoadBtnVisible() { isUpdating = true; - updatingBtn.Visible = true; - updateRow.CanClick(false); + btnUpdating.Visible = true; + rowUpdate.CanClick = false; } /// <summary> @@ -501,7 +457,7 @@ Application.RunOnMainThread(() => { SetDownLoadBtnVisible(); - updatingBtn.Text = $"{ Language.StringByID(R.MyInternationalizationString.Updating)} {(int)(e.BytesReceived / (float)ApkBytesTotalLength * 100)}%"; + btnUpdating.Text = $"{ Language.StringByID(R.MyInternationalizationString.Updating)} {(int)(e.BytesReceived / (float)ApkBytesTotalLength * 100)}%"; }); } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs index 158bed1..7c602f5 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs @@ -1313,4 +1313,54 @@ } #endregion + + #region 鈻� 鑷姩鍖栨帹閫佺粨鏋淿_____________________ + + /// <summary> + /// 鑷姩鍖栨帹閫佸唴瀹� + /// </summary> + public class LogicPushResult + { + /// <summary> + /// 鑷姩鍖朓D + /// </summary> + public int LogicId = -1; + /// <summary> + /// 鑷姩鍖栧悕绉� + /// </summary> + public string LogicName = string.Empty; + /// <summary> + /// 鑷姩鍖栨帹閫佸唴瀹� + /// </summary> + public string LogicCustomPushText = string.Empty; + /// <summary> + /// 闂ㄩ攣甯稿紑妯″紡鏁版嵁(鑷姩鍖栨帹閫�) + /// </summary> + public DoorNormallyOpenData ActionData = null; + } + + /// <summary> + /// 闂ㄩ攣甯稿紑妯″紡鏁版嵁(鑷姩鍖栨帹閫�) + /// </summary> + public class DoorNormallyOpenData + { + /// <summary> + /// 8:甯稿紑妯″紡鐨勬暟鎹� + /// </summary> + public int Actiontype = -1; + /// <summary> + /// 闂ㄩ攣Mac鍦板潃 + /// </summary> + public string MacStr = string.Empty; + /// <summary> + /// 闂ㄩ攣绔彛鍙� + /// </summary> + public int Epoint = -1; + /// <summary> + /// 璁剧疆鑷姩鍖栨椂锛屽彂閫佺殑閫忎紶鏁版嵁 055704010112:甯稿紑妯″紡鎵撳紑 055704010113:甯稿紑妯″紡鍏抽棴 + /// </summary> + public string PassDataString = string.Empty; + } + + #endregion } 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 6427e96..000d878 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs @@ -17,7 +17,7 @@ private bool m_CanClick = true; /// <summary> /// 璁剧疆鑳藉惁瑙︾偣鍑讳簨浠� - /// </summary> + /// </summary> public bool CanClick { get { return m_CanClick; } @@ -82,8 +82,8 @@ /// <summary> /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�) /// </summary> - /// <param name="i_Width">瀹藉害</param> - /// <param name="i_Height">楂樺害</param> + /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Height">楂樺害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> public void InitSize(int i_Width, int i_Height, bool real = true) { @@ -91,50 +91,50 @@ { i_Width = Application.GetRealWidth(i_Width); i_Height = Application.GetRealHeight(i_Height); - } - this.Height = i_Height; + } + this.Height = i_Height; this.Width = i_Width; } /// <summary> /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�) /// </summary> - /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Width">瀹藉害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> public void InitSize(int i_Width, bool real = false) { if (real == true) { i_Width = Application.GetRealWidth(i_Width); - } - - this.Height = ControlCommonResourse.NormalControlHeight; + } + + this.Height = ControlCommonResourse.NormalControlHeight; this.Width = i_Width; } /// <summary> /// 鍒濆鍖栧浘鏍囨帶浠跺ぇ灏�(浠ュ钩鍧囧�艰繘琛岀湡瀹炴暟鍊艰绠�) /// </summary> - /// <param name="i_Width">瀹藉害</param> - /// <param name="i_Height">楂樺害</param> + /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Height">楂樺害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> public void InitIconSize(int i_Width, int i_Height, bool real = true) { if (real == true) { - i_Width = Application.GetMinRealAverage(i_Width); - i_Height = Application.GetMinRealAverage(i_Height); - } - - this.Height = i_Height; + i_Width = this.GetPictrueRealSize(i_Width); + i_Height = this.GetPictrueRealSize(i_Height); + } + + this.Height = i_Height; this.Width = i_Width; } /// <summary> /// 鍒濆鍖栧浘鐗囨帶浠跺ぇ灏� /// </summary> - /// <param name="i_Width">瀹藉害</param> - /// <param name="i_Height">楂樺害</param> + /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Height">楂樺害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> public void InitPictrueSize(int i_Width, int i_Height, bool real = true) { @@ -142,9 +142,9 @@ { i_Width = HdlControlLogic.Current.GetPictrueRealSize(i_Width); i_Height = HdlControlLogic.Current.GetPictrueRealSize(i_Height); - } - - this.Height = i_Height; + } + + this.Height = i_Height; this.Width = i_Width; } @@ -319,6 +319,16 @@ #endif } + /// <summary> + /// 璁$畻鍥剧墖鐨勭湡瀹為珮瀹藉害 + /// </summary> + /// <param name="i_size"></param> + /// <returns></returns> + public int GetPictrueRealSize(int i_size) + { + return HdlControlLogic.Current.GetPictrueRealSize(i_size); + } + #endregion #region 鈻� Log鍑哄姏____________________________ diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs new file mode 100755 index 0000000..889170d --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs @@ -0,0 +1,38 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// FrameLayout鐨勬渶鍒濆師鍨� + /// </summary> + public class FrameLayoutBase : FrameLayout + { + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// FrameLayout鐨勬渶鍒濆師鍨� + /// </summary> + public FrameLayoutBase() + { + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 璁$畻鍥剧墖鐨勭湡瀹為珮瀹藉害 + /// </summary> + /// <param name="i_size"></param> + /// <returns></returns> + public int GetPictrueRealSize(int i_size) + { + return HdlControlLogic.Current.GetPictrueRealSize(i_size); + } + + #endregion + + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/RowLayoutBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/RowLayoutBase.cs new file mode 100755 index 0000000..f808a9c --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/RowLayoutBase.cs @@ -0,0 +1,37 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// RowLayout鐨勬渶鍒濆師鍨� + /// </summary> + public class RowLayoutBase : RowLayout + { + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// FrameLayout鐨勬渶鍒濆師鍨� + /// </summary> + public RowLayoutBase() + { + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 璁$畻鍥剧墖鐨勭湡瀹為珮瀹藉害 + /// </summary> + /// <param name="i_size"></param> + /// <returns></returns> + public int GetPictrueRealSize(int i_size) + { + return HdlControlLogic.Current.GetPictrueRealSize(i_size); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs index 4c69fe1..c825e64 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs @@ -49,8 +49,8 @@ /// <summary> /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�) /// </summary> - /// <param name="i_Width">瀹藉害</param> - /// <param name="i_Height">楂樺害</param> + /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Height">楂樺害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> public void InitSize(int i_Width, int i_Height, bool real = true) { @@ -58,43 +58,43 @@ { i_Width = Application.GetRealWidth(i_Width); i_Height = Application.GetRealHeight(i_Height); - } - - this.Height = i_Height; + } + + this.Height = i_Height; this.Width = i_Width; } /// <summary> /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�) /// </summary> - /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Width">瀹藉害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> public void InitSize(int i_Width, bool real = true) { if (real == true) { i_Width = Application.GetRealWidth(i_Width); - } - - this.Height = ControlCommonResourse.NormalControlHeight; + } + + this.Height = ControlCommonResourse.NormalControlHeight; this.Width = i_Width; } /// <summary> /// 鍒濆鍖栨帶浠跺ぇ灏�(浠ュ钩鍧囧�艰繘琛岀湡瀹炴暟鍊艰绠�) /// </summary> - /// <param name="i_Width">瀹藉害</param> - /// <param name="i_Height">楂樺害</param> + /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Height">楂樺害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> public void InitAvgSize(int i_Width, int i_Height, bool real = true) { if (real == true) { - i_Width = Application.GetMinRealAverage(i_Width); - i_Height = Application.GetMinRealAverage(i_Height); - } - - this.Height = i_Height; + i_Width = this.GetPictrueRealSize(i_Width); + i_Height = this.GetPictrueRealSize(i_Height); + } + + this.Height = i_Height; this.Width = i_Width; } @@ -143,6 +143,17 @@ //Y杞撮噸缃� this.Y = HdlControlLogic.Current.GetControlChidrenYaxis(this.Parent.Height, this.Height, alignment, Space); } + + /// <summary> + /// 璁$畻鍥剧墖鐨勭湡瀹為珮瀹藉害 + /// </summary> + /// <param name="i_size"></param> + /// <returns></returns> + public int GetPictrueRealSize(int i_size) + { + return HdlControlLogic.Current.GetPictrueRealSize(i_size); + } + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs index 7754ffb..659a38b 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs @@ -7,7 +7,7 @@ /// <summary> /// 浣嶄簬宸︿笅瑙掔殑鍗曞嚮鎺т欢 /// </summary> - public class BottomLeftClickButton : FrameLayoutControl + public class BottomLeftClickButton : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs index 3e47a2b..f79050c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs @@ -7,7 +7,7 @@ /// <summary> /// 浣嶄簬鍙充笅瑙掔殑鍗曞嚮鎺т欢 /// </summary> - public class BottomRightClickButton : FrameLayoutControl + public class BottomRightClickButton : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/PswNumberInputControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/PswNumberInputControl.cs index cf840fd..e348862 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/PswNumberInputControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/PswNumberInputControl.cs @@ -7,7 +7,7 @@ /// <summary> /// 鏁板瓧鎸夐敭瀵嗙爜杈撳叆鎺т欢(鑷埗鐨勬墜鍔ㄦ寜閿緭鍏ョ被鍨�,璇峰疄鐜般�怉ctionPswFinish銆戜簨浠�) /// </summary> - public class PswNumberInputControl : FrameLayout + public class PswNumberInputControl : FrameLayoutBase { #region 鈻� 鍙橀噺澹版槑___________________________ @@ -79,8 +79,8 @@ { this.passwordLength = i_passwordLength; //鍔犻棿璺� - this.Width = Application.GetMinRealAverage(NumberSize * 3 + NumberLeftRightSpace * 2 + 80); - this.Height = Application.GetMinRealAverage(NumberSize * 4 + NumberTopButtomSpace * 3) + Application.GetRealHeight(368); + this.Width = this.GetPictrueRealSize(NumberSize * 3 + NumberLeftRightSpace * 2 + 80); + this.Height = this.GetPictrueRealSize(NumberSize * 4 + NumberTopButtomSpace * 3) + Application.GetRealHeight(368); this.btnTitle = new NormalViewControl(Application.CurrentWidth, Application.GetRealWidth(75), false); btnTitle.Text = i_title; btnTitle.IsBold = true; @@ -112,7 +112,7 @@ //鍒犻櫎鎺т欢 this.btnDelete = new NormalViewControl(200, 60, true); - btnDelete.X = this.Width - Application.GetRealWidth(200) - Application.GetMinRealAverage(40); + btnDelete.X = this.Width - Application.GetRealWidth(200) - this.GetPictrueRealSize(40); btnDelete.Y = this.Height - Application.GetRealHeight(60); btnDelete.TextColor = UserCenterColor.Current.TextGrayColor3; btnDelete.TextAlignment = TextAlignment.Center; @@ -144,9 +144,9 @@ private void InitPswIconControl() { //鍥炬爣澶у皬 - int iconSize = Application.GetMinRealAverage(36); + int iconSize = this.GetPictrueRealSize(36); //鍥炬爣闂寸殑闂撮殧 - int space = Application.GetMinRealAverage(100); + int space = this.GetPictrueRealSize(100); //璁$畻瀵嗙爜涓暟鏄惁瓒婄晫 int value = Application.CurrentWidth - iconSize * passwordLength; if (passwordLength > 1) @@ -194,13 +194,13 @@ frameNumberIcon.Y = Application.GetRealHeight(368); frameNumberIcon.Width = this.Width; frameNumberIcon.Gravity = Gravity.CenterHorizontal; - frameNumberIcon.Height = Application.GetMinRealAverage(NumberSize * 4 + NumberTopButtomSpace * 3); + frameNumberIcon.Height = this.GetPictrueRealSize(NumberSize * 4 + NumberTopButtomSpace * 3); this.AddChidren(frameNumberIcon); //鍓嶄竴涓帶浠剁殑鍙冲潗鏍� int btnTempRight = 0; //闂磋窛 - int space = Application.GetMinRealAverage(NumberLeftRightSpace); + int space = this.GetPictrueRealSize(NumberLeftRightSpace); //1鍒�9鐨勬暟瀛楃洏 for (int i = 1; i <= 9; i++) { @@ -212,7 +212,7 @@ } frameNumberIcon.AddChidren(btnNum); - btnNum.Y = (i - 1) / 3 * (btnNum.Height + Application.GetMinRealAverage(NumberTopButtomSpace)); + btnNum.Y = (i - 1) / 3 * (btnNum.Height + this.GetPictrueRealSize(NumberTopButtomSpace)); btnNum.ButtonClickEvent += (sender, e) => { //鐐瑰嚮鏁板瓧鎸夐敭 @@ -228,11 +228,11 @@ //0鐨勬暟瀛楃洏 var btnNum0 = this.InitNumberControl(); - btnNum0.X = Application.GetMinRealAverage(40) + frameNumberIcon.GetChildren(0).Height + space; + btnNum0.X = this.GetPictrueRealSize(40) + frameNumberIcon.GetChildren(0).Height + space; btnNum0.Text = "0"; frameNumberIcon.AddChidren(btnNum0); - btnNum0.Y = 3 * (frameNumberIcon.GetChildren(0).Height + Application.GetMinRealAverage(NumberTopButtomSpace)); + btnNum0.Y = 3 * (frameNumberIcon.GetChildren(0).Height + this.GetPictrueRealSize(NumberTopButtomSpace)); btnNum0.ButtonClickEvent += (sender, e) => { //鐐瑰嚮鏁板瓧鎸夐敭 @@ -246,9 +246,9 @@ /// <returns></returns> private NormalClickButton InitNumberControl() { - int iconSize = Application.GetMinRealAverage(NumberSize); + int iconSize = this.GetPictrueRealSize(NumberSize); var btnNum = new NormalClickButton(iconSize, iconSize, false); - btnNum.X = Application.GetMinRealAverage(40); + btnNum.X = this.GetPictrueRealSize(40); btnNum.BackgroundColor = this.NumberIconBackColor; btnNum.clickStatuColor = 0x7e656565; btnNum.Radius = (uint)iconSize / 2; @@ -364,7 +364,7 @@ } //鑷姩璋冩暣楂樺害 - int minHeight = Application.GetMinRealAverage(NumberSize * 4 + NumberTopButtomSpace * 3) + Application.GetRealHeight(368); + int minHeight = this.GetPictrueRealSize(NumberSize * 4 + NumberTopButtomSpace * 3) + Application.GetRealHeight(368); int realHeight = this.btnDelete.Bottom; if (realHeight < minHeight) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs index 9d32c3d..2b18246 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs @@ -58,7 +58,7 @@ /// <summary> /// 鍓嶅洖閫夋嫨鐨勬帶浠� /// </summary> - private FrameLayoutControl oldFrameBack = null; + private FrameLayoutStatuControl oldFrameBack = null; /// <summary> /// 鍓嶅洖閫夋嫨鐨勬帶浠� /// </summary> @@ -163,7 +163,7 @@ } //甯﹀浘鐗囩殑 - var frameBack = new FrameLayoutControl(); + var frameBack = new FrameLayoutStatuControl(); frameBack.UseClickStatu = false; frameBack.Gravity = Gravity.Center; frameBack.Height = Application.GetRealHeight(159); @@ -257,7 +257,7 @@ } //甯﹀浘鐗囩殑 - var frameBack = new FrameLayoutControl(); + var frameBack = new FrameLayoutStatuControl(); frameBack.UseClickStatu = false; frameBack.Gravity = Gravity.Center; frameBack.Height = Application.GetRealHeight(159); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs index e5428f4..736f59c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs @@ -138,11 +138,11 @@ #endregion - #region 鈻� 甯冮槻鎾ら槻___________________________ + #region 鈻� 甯冮槻鎾ら槻___________________________ /// <summary> /// 鍦ㄥ甯冮槻 - /// </summary> + /// </summary> private async void SetSafetyGarrisonModeInAtHome() { //鎵撳紑杩涘害鏉� @@ -180,11 +180,11 @@ var control = new ShowMsgControl(ShowMsgType.Tip, msg); control.Show(); }); - } - + } + /// <summary> /// 绂诲甯冮槻 - /// </summary> + /// </summary> private async void SetSafetyGarrisonModeInRemoveHome() { //鎵撳紑杩涘害鏉� @@ -212,11 +212,11 @@ var control = new ShowMsgControl(ShowMsgType.Tip, msg); control.Show(); }); - } - + } + /// <summary> /// 鎾ら槻 - /// </summary> + /// </summary> private async void RemoveSafetyGarrisonMode() { //鎵撳紑杩涘害鏉� @@ -240,12 +240,12 @@ var control = new ShowMsgControl(ShowMsgType.Tip, msg); control.Show(); }); - } - + } + /// <summary> /// 鏍规嵁甯冮槻妯″紡锛岃缃浘鏍囩殑閫夋嫨鐘舵�� /// </summary> - /// <param name="mode"></param> + /// <param name="mode"></param> public void SetIconStatuByGarrisonMode(GarrisonMode mode) { //鍦ㄥ甯冮槻 @@ -277,7 +277,7 @@ /// <summary> /// 璁剧疆甯冮槻鎸夐挳鐨勫彲瑙嗙姸鎬� - /// </summary> + /// </summary> public void SetButtonVisible() { //璁剧疆鏈夊唴閮ㄩ槻鍖� @@ -303,7 +303,7 @@ /// <summary> /// 灏佽鐨勫竷闃叉帶浠� /// </summary> - private class GarrisonControl : FrameLayoutControl + private class GarrisonControl : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ @@ -350,7 +350,7 @@ this.RemoveBaseClickEvent(); //鑳屾櫙 - int backHeight = Application.GetMinRealAverage(132); + int backHeight = this.GetPictrueRealSize(132); btnBack = new NormalViewControl(backHeight, backHeight, false); btnBack.Gravity = Gravity.CenterHorizontal; btnBack.Radius = (uint)backHeight / 2; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs index 373ca78..484e815 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs @@ -37,7 +37,7 @@ /// <summary> /// 榛樿鐨勯偅涓彍鍗� /// </summary> - private FrameLayoutControl frameDefult = null; + private FrameLayoutStatuControl frameDefult = null; #endregion @@ -81,7 +81,7 @@ private int InitTitleTextControl(int i_index, string titleText, int realWidth, int XX) { //鍦烘櫙妗�(鐐瑰嚮鑼冨洿鏈夌偣灏忥紝闇�瑕佹墿澶у畠鐨勭偣鍑昏寖鍥�) - var frameBack = new FrameLayoutControl(); + var frameBack = new FrameLayoutStatuControl(); frameBack.UseClickStatu = false; frameBack.Height = Application.GetRealHeight(90); frameBack.Width = realWidth; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs index 7da740e..561b5b3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs @@ -8,7 +8,7 @@ /// <summary> /// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�(鍏煎缃戝叧) /// </summary> - public class DeviceInfoIconControl : FrameLayoutControl + public class DeviceInfoIconControl : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ @@ -39,10 +39,10 @@ public DeviceInfoIconControl() { //绗竴灞傚簳鑹� - this.Height = Application.GetMinRealAverage(207); - this.Width = Application.GetMinRealAverage(207); + this.Height = this.GetPictrueRealSize(207); + this.Width = this.GetPictrueRealSize(207); this.BackgroundColor = UserCenterColor.Current.White; - this.Radius = (uint)Application.GetMinRealAverage(207) / 2; + this.Radius = (uint)this.GetPictrueRealSize(207) / 2; this.UseClickStatu = false; } @@ -54,7 +54,7 @@ { this.deviceMac = i_device.DeviceAddr; //闃叉鍑虹幇璇樊 - int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); + int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12); //绗簩灞傚簳鑹� var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false); btnIcon2.BackgroundColor = 0xfffef1ed; @@ -69,7 +69,7 @@ //瀵瑰簲鍗曠函鍙湁200鍥炶矾鐨勮澶� listDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac)); } - btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false); + btnIcon = new NormalViewControl(this.GetPictrueRealSize(121), this.GetPictrueRealSize(121), false); btnIcon.Gravity = Gravity.Center; Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice); this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); @@ -84,7 +84,7 @@ this.deviceMac = deviceMacAddr; this.deviceEpoint = epoint; //闃叉鍑虹幇璇樊 - int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); + int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12); //绗簩灞傚簳鑹� var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false); btnIcon2.BackgroundColor = 0xfffef1ed; @@ -93,7 +93,7 @@ this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly); //璁惧鍥炬爣 - btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false); + btnIcon = new NormalViewControl(this.GetPictrueRealSize(121), this.GetPictrueRealSize(121), false); btnIcon.Gravity = Gravity.Center; Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, Common.LocalDevice.Current.GetDevice(deviceMacAddr, epoint)); this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); @@ -107,7 +107,7 @@ { this.zbGateway = i_gateway; //闃叉鍑虹幇璇樊 - int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12); + int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12); //绗簩灞傚簳鑹� var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false); btnIcon2.BackgroundColor = 0xfffef1ed; @@ -116,7 +116,7 @@ this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly); //璁惧鍥炬爣 - btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false); + btnIcon = new NormalViewControl(this.GetPictrueRealSize(121), this.GetPictrueRealSize(121), false); btnIcon.Gravity = Gravity.Center; HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, i_gateway); this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs index d2b9aa3..7038321 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs @@ -36,7 +36,7 @@ /// 鍋氭垚涓�涓ā鎷烺owLayout,杩涜杈撳叆鐨凢rameLayout鎺т欢(宸﹁竟鏈夋爣棰�) /// </summary> /// <param name="i_caption">鏍囬鏂囨湰</param> - /// <param name="i_text">杈撳叆妗嗙殑鍊�</param> + /// <param name="i_text">鏄剧ず鏂囨湰鐨勫��</param> /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> public FrameCaptionViewControl(string i_caption, string i_text, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) { @@ -58,7 +58,7 @@ /// </summary> /// <param name="caption">鏍囬</param> /// <param name="text">鏂囨湰妗嗙殑鍊�</param> - public void InitControl() + public virtual void InitControl() { this.AddChidren(btnCaption, ChidrenBindMode.BindEventOnly); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs similarity index 97% rename from ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs rename to ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs index bab9c6a..f5da451 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs @@ -7,21 +7,21 @@ /// <summary> /// 鍋氭垚涓�涓偣鍑诲悗鑳藉鏄剧ず鐐瑰嚮鐘舵�佺殑鎺т欢(鍩哄眰鎺т欢) /// </summary> - public class FrameLayoutControl : FrameLayout + public class FrameLayoutStatuControl : FrameLayoutBase { #region 鈻� 鍙橀噺澹版槑___________________________ - /// <summary> - /// 鍗曞嚮寮硅捣浜嬩欢 - /// </summary> - public Action<object, MouseEventArgs> ButtonClickEvent; - /// <summary> - /// 鐘舵�佽缃殑浜嬩欢(浼氶噸杞藉簳灞傛晥鏋�) - /// </summary> + /// <summary> + /// 鍗曞嚮寮硅捣浜嬩欢 + /// </summary> + public Action<object, MouseEventArgs> ButtonClickEvent; + /// <summary> + /// 鐘舵�佽缃殑浜嬩欢(浼氶噸杞藉簳灞傛晥鏋�) + /// </summary> public Action<bool> SelectStatuEvent; /// <summary> /// 鏄惁鍚敤鐐逛寒鍔熻兘(榛樿鍚敤) - /// </summary> + /// </summary> public bool UseClickStatu = true; /// <summary> /// 鑳藉惁鐐瑰嚮 @@ -29,11 +29,11 @@ public bool CanClick = true; /// <summary> /// 鍘熸潵鐨勮儗鏅壊 - /// </summary> - private uint oldBackColor = 0; + /// </summary> + private uint oldBackColor = 0; /// <summary> /// 褰撳墠鏄惁宸茬粡澶勪簬閫夋嫨鐘舵�� - /// </summary> + /// </summary> private bool IsSelectStatu = false; /// <summary> /// 瀛愭帶浠禮杞村亸绉婚噺(鍏遍�氬畾涔夎�屽凡) @@ -47,47 +47,47 @@ set { this.Radius = (uint)Application.GetRealHeight(value); } } - #endregion + #endregion #region 鈻� 鍒濆鍖朹____________________________ /// <summary> /// 鍋氭垚涓�涓偣鍑诲悗鑳藉鏄剧ず鐐瑰嚮鐘舵�佺殑鎺т欢 - /// </summary> - /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> - public FrameLayoutControl(int i_ChidrenYaxis = 0) + /// </summary> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> + public FrameLayoutStatuControl(int i_ChidrenYaxis = 0) { this.chidrenYaxis = i_ChidrenYaxis; this.MouseUpEventHandler += ChildrenUpEvent; - this.MouseDownEventHandler += ChildrenDownEvent; + this.MouseDownEventHandler += ChildrenDownEvent; } - #endregion + #endregion - #region 鈻� 缁戝畾浜嬩欢___________________________ + #region 鈻� 缁戝畾浜嬩欢___________________________ /// <summary> /// 鍙樻洿瀛愭帶浠剁殑缁戝畾妯″紡 /// </summary> /// <param name="view">瀛愭帶浠�</param> - /// <param name="chidrenBindMode">鍙樻洿鐨勭粦瀹氭ā寮�</param> + /// <param name="chidrenBindMode">鍙樻洿鐨勭粦瀹氭ā寮�</param> public void ChangedChidrenBindMode(View view, ChidrenBindMode chidrenBindMode) { - if (view is ButtonBase) + if (view is ButtonBase) { //瀛愭帶浠剁Щ闄や簨浠� ButtonBase button = (ButtonBase)view; button.ButtonClickEvent -= ChildrenUpEvent; - button.MouseDownEventHandler -= ChildrenDownEvent; - - this.BindChidrenEvent(view, chidrenBindMode); + button.MouseDownEventHandler -= ChildrenDownEvent; + + this.BindChidrenEvent(view, chidrenBindMode); } else if (view is ImageView) { view.MouseUpEventHandler -= ChildrenUpEvent; - view.MouseDownEventHandler -= ChildrenDownEvent; - + view.MouseDownEventHandler -= ChildrenDownEvent; + this.BindChidrenEvent(view, chidrenBindMode); } else if (view is ViewGroup) @@ -114,20 +114,20 @@ this.BindChidrenEvent(view, chidrenBindMode); } - } - + } + /// <summary> /// 缁戝畾瀛愭帶浠朵簨浠�(濡傛灉鏄鍚堟帶浠�,鍦ㄥ垵濮嬪寲瀹屾垚鍚�,璋冪敤ChangedChidrenBindMode) /// </summary> /// <param name="view"></param> - /// <param name="chidrenBindMode"></param> + /// <param name="chidrenBindMode"></param> private void BindChidrenEvent(View view, ChidrenBindMode chidrenBindMode) { if (chidrenBindMode == ChidrenBindMode.NotBind) { return; } - if (view is ButtonBase) + if (view is ButtonBase) { //涓哄瓙鎺т欢娣诲姞浜嬩欢 ButtonBase button = (ButtonBase)view; @@ -135,7 +135,7 @@ button.MouseDownEventHandler -= ChildrenDownEvent; button.ButtonClickEvent += ChildrenUpEvent; - button.MouseDownEventHandler += ChildrenDownEvent; + button.MouseDownEventHandler += ChildrenDownEvent; } else if (view is ImageView) { @@ -181,52 +181,52 @@ #region 鈻� 娣诲姞瀛愭帶浠禵________________________ - /// <summary> - /// 娣诲姞瀛愭帶浠� - /// </summary> - /// <param name="view">瀛愭帶浠�</param> - /// <param name="chidrenBindMode">缁戝畾妯″紡</param> - public void AddChidren(View view, ChidrenBindMode chidrenBindMode = ChidrenBindMode.BindAll) + /// <summary> + /// 娣诲姞瀛愭帶浠� + /// </summary> + /// <param name="view">瀛愭帶浠�</param> + /// <param name="chidrenBindMode">缁戝畾妯″紡</param> + public void AddChidren(View view, ChidrenBindMode chidrenBindMode = ChidrenBindMode.BindAll) { this.oldBackColor = this.BackgroundColor; - + base.AddChidren(view); //缁戝畾瀛愭帶浠朵簨浠� - this.BindChidrenEvent(view, chidrenBindMode); + this.BindChidrenEvent(view, chidrenBindMode); } #endregion #region 鈻� 鎺т欢浜嬩欢___________________________ - /// <summary> - /// 鐐瑰嚮鎸変笅浜嬩欢(鐐逛寒) - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="e">E.</param> - private void ChildrenDownEvent(object sender, MouseEventArgs e) + /// <summary> + /// 鐐瑰嚮鎸変笅浜嬩欢(鐐逛寒) + /// </summary> + /// <param name="sender">Sender.</param> + /// <param name="e">E.</param> + private void ChildrenDownEvent(object sender, MouseEventArgs e) { - if (this.UseClickStatu == false|| this.CanClick == false) + if (this.UseClickStatu == false || this.CanClick == false) { return; } - this.StartSelectStatuAppeal(ControlCommonResourse.StatuChangedWaitTime); + this.StartSelectStatuAppeal(ControlCommonResourse.StatuChangedWaitTime); } - /// <summary> - /// 鐐瑰嚮鏉惧紑浜嬩欢 - /// </summary> - /// <param name="sender">Sender.</param> - /// <param name="e">E.</param> - private void ChildrenUpEvent(object sender, MouseEventArgs e) + /// <summary> + /// 鐐瑰嚮鏉惧紑浜嬩欢 + /// </summary> + /// <param name="sender">Sender.</param> + /// <param name="e">E.</param> + private void ChildrenUpEvent(object sender, MouseEventArgs e) { if (this.CanClick == false) { //涓嶅厑璁哥偣鍑� return; } - if (sender is FrameLayoutControl) + if (sender is FrameLayoutStatuControl) { //LOG鍑哄姏 this.WriteLog(); @@ -235,49 +235,49 @@ { //璋冪敤濮旀墭 ButtonClickEvent?.Invoke(sender, e); - } - catch (Exception ex) + } + catch (Exception ex) { //鍑虹幇鏈煡閿欒 var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError)); alert.Show(); //Log鍑哄姏 HdlLogLogic.Current.WriteLog(ex); - } + } } - #endregion + #endregion - #region 鈻� 鍗曞嚮鐘舵�佹樉绀篲______________________ + #region 鈻� 鍗曞嚮鐘舵�佹樉绀篲______________________ - /// <summary> - /// 璁剧疆鍗曞嚮鍚庣粨鏉熺殑鐘舵�� - /// </summary> - public void SetClickNotSelectStatu() + /// <summary> + /// 璁剧疆鍗曞嚮鍚庣粨鏉熺殑鐘舵�� + /// </summary> + public void SetClickNotSelectStatu() { - this.IsSelectStatu = false; + this.IsSelectStatu = false; if (this.SelectStatuEvent != null) { this.SelectStatuEvent(false); return; } - - this.BackgroundColor = this.oldBackColor; - } - - /// <summary> - /// 璁剧疆鍗曞嚮鏃剁殑鐘舵�� - /// </summary> - public void SetClickSelectStatu() + + this.BackgroundColor = this.oldBackColor; + } + + /// <summary> + /// 璁剧疆鍗曞嚮鏃剁殑鐘舵�� + /// </summary> + public void SetClickSelectStatu() { - this.IsSelectStatu = true; + this.IsSelectStatu = true; if (this.SelectStatuEvent != null) { this.SelectStatuEvent(true); return; } - - this.BackgroundColor = UserCenterColor.Current.RowSelectBackColor; + + this.BackgroundColor = UserCenterColor.Current.RowSelectBackColor; } #endregion @@ -287,7 +287,7 @@ /// <summary> /// 寮哄埗瀹炴柦鎺т欢閫変腑鐘舵�佺殑鐗规晥 /// </summary> - /// <param name="waiTime"></param> + /// <param name="waiTime"></param> public void StartSelectStatuAppeal(int waiTime) { if (this.IsSelectStatu == true) @@ -311,7 +311,7 @@ /// <summary> /// 绉婚櫎搴曞眰鎺т欢鑷韩鐨勫崟鍑讳簨浠� - /// </summary> + /// </summary> public void RemoveBaseClickEvent() { this.MouseUpEventHandler -= ChildrenUpEvent; @@ -320,7 +320,7 @@ /// <summary> /// 鎺т欢鎽ф瘉 - /// </summary> + /// </summary> public override void RemoveFromParent() { this.ButtonClickEvent = null; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs index bb6104d..9fff52d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs @@ -1,18 +1,18 @@ -锘縰sing System; -using System.Collections.Generic; - -namespace Shared.Phone.UserCenter -{ - /// <summary> - /// 鍋氭垚涓�涓猂owLayout鍨嬬殑FrameLayout - /// </summary> - public class FrameRowControl : FrameLayoutControl +锘縰sing System; +using System.Collections.Generic; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 鍋氭垚涓�涓猂owLayout鍨嬬殑FrameLayout + /// </summary> + public class FrameRowControl : FrameLayoutStatuControl { #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> /// 姝ゆ帶浠剁殑璇嗗埆涓婚敭(鑷畾涔夎缃殑) - /// </summary> + /// </summary> public string MainKeys = string.Empty; /// <summary> /// 宸﹀亸绉婚噺,鍙拡瀵瑰唴缃帶浠舵湁鏁�(杩欐槸涓�涓湡瀹炲��,榛樿涓嶅亸绉汇�傛鏁颁负鍚戝彸鍋忕Щ,璐熸暟涓哄悜宸﹀亸绉�) @@ -35,19 +35,19 @@ /// </summary> private NormalViewControl btnBottomLine = null; - #endregion + #endregion #region 鈻� 鍒濆鍖朹____________________________ /// <summary> /// 鍋氭垚涓�涓猂owLayout鍨嬬殑FrameLayout - /// </summary> - /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> - public FrameRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) - { + /// </summary> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> + public FrameRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) + { this.Height = ControlCommonResourse.ListViewRowHeight; - this.Width = Application.CurrentWidth; - } + this.Width = Application.CurrentWidth; + } #endregion @@ -56,7 +56,7 @@ /// <summary> /// <para>娣诲姞搴曠嚎(濡傛灉宸﹁竟鏈夊浘鏍囷紝鍒欏厛娣诲姞鍥炬爣锛屽啀娣诲姞搴曠嚎)</para> /// <para>瀹冪殑闀垮害涓猴細褰撳墠鎺т欢瀹藉害-宸﹀彸鍥哄畾闂磋窛-宸﹁竟鍥剧墖瀹藉害(濡傛灉鏈�)-鍙宠竟鐨勫亸绉婚噺</para> - /// </summary> + /// </summary> public virtual NormalViewControl AddBottomLine() { if (this.btnBottomLine != null) @@ -90,7 +90,7 @@ /// <param name="i_caption">鍐呭</param> /// <param name="i_width">瀹藉害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> - /// <returns></returns> + /// <returns></returns> public NormalViewControl AddLeftCaption(string i_caption, int i_width, bool real = true) { if (real == true) @@ -114,7 +114,7 @@ /// <param name="i_width">瀹藉害</param> /// <param name="i_height">楂樺害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> - /// <returns></returns> + /// <returns></returns> public NormalViewControl AddLeftCaption(string i_caption, int i_width, int i_height, bool real = true) { int XX = ControlCommonResourse.XXLeft + LeftOffset; @@ -140,7 +140,7 @@ /// <param name="i_txtValue">鍒濆鍐呭</param> /// <param name="i_width">瀹藉害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> - /// <returns></returns> + /// <returns></returns> public TextInputControl AddLeftInput(string i_txtValue, int i_width, bool real = true) { if (real == true) @@ -173,7 +173,7 @@ /// 娣诲姞宸﹁竟鍥炬爣 /// </summary> /// <param name="i_Iconsize">鍥炬爣澶у皬</param> - /// <returns></returns> + /// <returns></returns> public IconViewControl AddLeftIcon(int i_Iconsize = 81) { var btnIcon = new IconViewControl(i_Iconsize); @@ -217,7 +217,7 @@ /// <summary> /// 娣诲姞鏈�鍙宠竟鐨勭┖鐧藉浘鐗囨帶浠� /// </summary> - /// <param name="i_width">鎺т欢绌哄害(闈炵湡瀹炲��)</param> + /// <param name="i_width">鎺т欢绌哄害(闈炵湡瀹炲��)</param> /// <param name="i_height">鎺т欢楂樺害(闈炵湡瀹炲��)</param> /// <returns></returns> public MostRightIconControl AddMostRightEmptyIcon(int i_width, int i_height) @@ -233,7 +233,7 @@ btnContr.X += RightOffset; } - this.rightIconSize = Application.GetMinRealAverage(i_width); + this.rightIconSize = this.GetPictrueRealSize(i_width); if (chidrenYaxis != 0) { btnContr.btnIcon.Y += chidrenYaxis; @@ -312,7 +312,7 @@ return btnContr; } - #endregion + #endregion #region 鈻� 娣诲姞涓婇儴鐨勬樉绀烘枃鏈琠________________ @@ -322,7 +322,7 @@ /// <param name="i_caption">鍐呭</param> /// <param name="i_width">瀹藉害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> - /// <returns></returns> + /// <returns></returns> public NormalViewControl AddTopView(string i_caption, int i_width, bool real = true) { if (real == true) @@ -337,7 +337,7 @@ return contr; } - #endregion + #endregion #region 鈻� 娣诲姞涓嬮儴鐨勬樉绀烘枃鏈琠________________ @@ -347,7 +347,7 @@ /// <param name="i_caption">鍐呭</param> /// <param name="i_width">瀹藉害</param> /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> - /// <returns></returns> + /// <returns></returns> public NormalViewControl AddBottomView(string i_caption, int i_width, bool real = true) { if (real == true) @@ -363,6 +363,6 @@ return contr; } - #endregion - } -} + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs index 5f5a143..25cbd29 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs @@ -196,7 +196,7 @@ { #if Android //纭 - var frameConfirm = new FrameLayoutControl(); + var frameConfirm = new FrameLayoutStatuControl(); frameConfirm.Height = Application.GetRealHeight(127); frameConfirm.Width = frameBack.Width; frameConfirm.Gravity = Gravity.BottomCenter; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs index 7e73166..369fa2e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs @@ -1,16 +1,16 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; - -namespace Shared.Phone.UserCenter -{ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ /// <summary> /// 鍋氭垚涓�涓猅opFrameLayout鐨勮繑鍥為敭鉁� /// </summary> - public class BackViewControl : FrameLayoutControl + public class BackViewControl : FrameLayoutStatuControl { - /// <summary> - /// 鍥炬爣瀹藉害 + /// <summary> + /// 鍥炬爣瀹藉害 /// </summary> private int iconWidth = 30; @@ -22,25 +22,25 @@ this.UseClickStatu = false; this.Name = "btnBack"; this.X = ControlCommonResourse.XXLeft - Application.GetRealWidth((110 - iconWidth) / 2); - this.Width = Application.GetMinRealAverage(110); - this.Height = Application.GetMinRealAverage(110); + this.Width = this.GetPictrueRealSize(110); + this.Height = this.GetPictrueRealSize(110); this.Gravity = Gravity.CenterVertical; } - /// <summary> - /// 鍒濆鍖� + /// <summary> + /// 鍒濆鍖� /// </summary> - public void InitControl() - { - var btnIcon = new ButtonBase(); - btnIcon.Width = Application.GetMinRealAverage(30); - btnIcon.Height = Application.GetMinRealAverage(51); - btnIcon.UnSelectedImagePath = "Item/Back.png"; - btnIcon.Gravity = Gravity.Center; - - this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); - //杩欏紶鍥剧墖濂藉儚寰堢壒娈�,鏃犳硶灞呬腑 - btnIcon.Y += Application.GetRealHeight(5); + public void InitControl() + { + var btnIcon = new ButtonBase(); + btnIcon.Width = this.GetPictrueRealSize(30); + btnIcon.Height = this.GetPictrueRealSize(51); + btnIcon.UnSelectedImagePath = "Item/Back.png"; + btnIcon.Gravity = Gravity.Center; + + this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); + //杩欏紶鍥剧墖濂藉儚寰堢壒娈�,鏃犳硶灞呬腑 + btnIcon.Y += Application.GetRealHeight(5); } - } -} + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs index cec8d6f..c63d817 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs @@ -7,7 +7,7 @@ /// <summary> /// 鍋氭垚涓�涓姞澶х偣鍑诲尯鍩熺殑鍥炬爣鎺т欢 /// </summary> - public class IconBigViewControl : FrameLayoutControl + public class IconBigViewControl : FrameLayoutStatuControl { /// <summary> /// 鍥炬爣鎺т欢(杩笉寰楀繁锛岃繖涓笢瑗垮紑鏀惧嚭鍘�) @@ -61,12 +61,12 @@ /// <param name="i_height">鎺т欢楂樺害</param> public IconBigViewControl(int i_width, int i_height) { - this.Width = Application.GetMinRealAverage(110); - this.Height = Application.GetMinRealAverage(110); + this.Width = this.GetPictrueRealSize(110); + this.Height = this.GetPictrueRealSize(110); this.btnIcon = new IconControlCommon(); - btnIcon.Width = Application.GetMinRealAverage(i_width); - btnIcon.Height = Application.GetMinRealAverage(i_height); + btnIcon.Width = this.GetPictrueRealSize(i_width); + btnIcon.Height = this.GetPictrueRealSize(i_height); btnIcon.Gravity = Gravity.Center; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs index 6068952..eb6a9cc 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs @@ -1,16 +1,16 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; - -namespace Shared.Phone.UserCenter -{ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ /// <summary> /// 鍋氭垚涓�涓樉绀哄浘鏍囩殑鎺т欢(闇�瑕佹墜鍔ㄥ紑鍚偣鍑荤姸鎬�) /// </summary> public class IconViewControl : IconControlCommon { - /// <summary> - /// 鍥炬爣澶у皬 + /// <summary> + /// 鍥炬爣澶у皬 /// </summary> public int IconSize = 0; /// <summary> @@ -22,10 +22,10 @@ { this.InitIconSize(size, size, real); this.IconSize = size; - if (real == true) - { - this.IconSize = Application.GetMinRealAverage(size); + if (real == true) + { + this.IconSize = this.GetPictrueRealSize(size); } } - } -} + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs index 70dd722..7733c6f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs @@ -18,7 +18,7 @@ { this.InitIconSize(size, size, true); this.BackgroundColor = UserCenterColor.Current.Red; - this.Radius = (uint)Application.GetMinRealAverage(size) / 2; + this.Radius = (uint)this.GetPictrueRealSize(size) / 2; this.X = TargetView.X + TargetView.Width / 2 + Application.GetRealWidth(10); this.Y = TargetView.Y; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/LoadingControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/LoadingControl.cs index 979d63f..9ba0531 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/LoadingControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/LoadingControl.cs @@ -14,8 +14,8 @@ /// </summary> public LoadingControl() { - this.Width = Application.GetMinRealAverage(74); - this.Height = Application.GetMinRealAverage(76); + this.Width = HdlControlLogic.Current.GetPictrueRealSize(74); + this.Height = HdlControlLogic.Current.GetPictrueRealSize(76); } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs index 2a7151f..77406ae 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs @@ -14,23 +14,28 @@ /// </summary> public MessageManagementControl() { - this.Height = Application.GetMinRealAverage(69); - this.Width = Application.GetMinRealAverage(69); + this.Height = this.GetPictrueRealSize(69); + this.Width = this.GetPictrueRealSize(69); this.UnSelectedImagePath = "Item/MessageManagement.png"; this.SelectedImagePath = "Item/MessageManagementSelected.png"; - this.ButtonClickEvent += (sender, e) => - { - //鐐瑰嚮鍚�,娓呯┖鐘舵�� - this.IsSelected = false; - ControlCommonResourse.HadNewMessage = false; - var form = new UserMain.MessageManagementForm(); - form.AddForm(); - }; - //娣诲姞缂撳瓨 - ControlCommonResourse.listMessageManaContr.Add(this); - //鍒锋柊鐘舵�� - this.RefreshStatu(); + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == false) + { + this.ButtonClickEvent += (sender, e) => + { + //鐐瑰嚮鍚�,娓呯┖鐘舵�� + this.IsSelected = false; + ControlCommonResourse.HadNewMessage = false; + + var form = new UserMain.MessageManagementForm(); + form.AddForm(); + }; + //娣诲姞缂撳瓨 + ControlCommonResourse.listMessageManaContr.Add(this); + //鍒锋柊鐘舵�� + this.RefreshStatu(); + } } /// <summary> @@ -38,6 +43,12 @@ /// </summary> public void RefreshStatu() { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } + if (ControlCommonResourse.HadNewMessage == true) { //濡傛灉宸茬粡鏈夋柊娑堟伅杩囨潵浜�,灏变笉鐢ㄨ浜� diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs index 673e824..0d777ab 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs @@ -4,18 +4,18 @@ namespace Shared.Phone.UserCenter { - /// <summary> - /// 鍋氭垚鏀惧湪鐢婚潰鍙宠竟鐨勭殑鍥炬爣鎺т欢(娉ㄦ剰,瀹冧笉鑳界敤鏉ュ仛銆愬悜鍙炽�戠殑鍥炬爣) - /// </summary> - public class MostRightIconControl : FrameLayoutControl - { + /// <summary> + /// 鍋氭垚鏀惧湪鐢婚潰鍙宠竟鐨勭殑鍥炬爣鎺т欢(娉ㄦ剰,瀹冧笉鑳界敤鏉ュ仛銆愬悜鍙炽�戠殑鍥炬爣) + /// </summary> + public class MostRightIconControl : FrameLayoutStatuControl + { /// <summary> /// 鍥炬爣鎺т欢(杩笉寰楀繁锛岃繖涓笢瑗垮紑鏀惧嚭鍘�) - /// </summary> - public IconControlCommon btnIcon = null; + /// </summary> + public IconControlCommon btnIcon = null; /// <summary> /// UnSelectedImagePath - /// </summary> + /// </summary> public string UnSelectedImagePath { get { return btnIcon.UnSelectedImagePath; } @@ -23,7 +23,7 @@ } /// <summary> /// SelectedImagePath - /// </summary> + /// </summary> public string SelectedImagePath { get { return btnIcon.SelectedImagePath; } @@ -31,49 +31,49 @@ } /// <summary> /// IsSelected - /// </summary> + /// </summary> public bool IsSelected { get { return btnIcon.IsSelected; } set { btnIcon.IsSelected = value; } - } - + } + /// <summary> /// X杞寸殑鐪熷疄鍋忕Щ閲�(璇风‘淇濆凡缁忚皟鐢↖nitControl鍒濆鍖栧嚱鏁�,鐢ㄦ硶:钃濇箹涓婄殑X杞�,鍑忔帀杩欎釜鍊煎嵆鍙�) - /// </summary> + /// </summary> public int XOffset { get { return (this.Width - btnIcon.Width) / 2; } - } - + } + /// <summary> /// 鍋氭垚鏀惧湪鐢婚潰鍙宠竟鐨勭殑鍥炬爣鎺т欢(娉ㄦ剰,瀹冧笉鑳界敤鏉ュ仛銆愬悜鍙炽�戠殑鍥炬爣) /// </summary> - /// <param name="i_width">鎺т欢绌哄害</param> - /// <param name="i_height">鎺т欢楂樺害</param> - public MostRightIconControl(int i_width, int i_height) - { - this.UseClickStatu = false; - - this.Width = Application.GetMinRealAverage(110); - this.Height = this.Parent != null ? this.Parent.Height : ControlCommonResourse.ListViewRowHeight; - this.Gravity = Gravity.CenterVertical; - - var XX = Application.CurrentWidth - Application.GetMinRealAverage(i_width) - ControlCommonResourse.XXLeft; - this.X = XX - Application.GetMinRealAverage((110 - i_width) / 2); + /// <param name="i_width">鎺т欢绌哄害</param> + /// <param name="i_height">鎺т欢楂樺害</param> + public MostRightIconControl(int i_width, int i_height) + { + this.UseClickStatu = false; + + this.Width = this.GetPictrueRealSize(110); + this.Height = this.Parent != null ? this.Parent.Height : ControlCommonResourse.ListViewRowHeight; + this.Gravity = Gravity.CenterVertical; + + var XX = Application.CurrentWidth - this.GetPictrueRealSize(i_width) - ControlCommonResourse.XXLeft; + this.X = XX - this.GetPictrueRealSize((110 - i_width) / 2); this.btnIcon = new IconControlCommon(); - btnIcon.Width = Application.GetMinRealAverage(i_width); - btnIcon.Height = Application.GetMinRealAverage(i_height); + btnIcon.Width = this.GetPictrueRealSize(i_width); + btnIcon.Height = this.GetPictrueRealSize(i_height); btnIcon.Gravity = Gravity.Center; - } - + } + /// <summary> /// 鍒濆鍖� - /// </summary> + /// </summary> public void InitControl() { this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); - } + } } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs new file mode 100755 index 0000000..d907473 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs @@ -0,0 +1,261 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 璁惧鍔熻兘绫诲瀷鐨勮嚜瀹氫箟琛屾帶浠� + /// </summary> + public class DeviceFunctionTypeRowControl : FrameCaptionViewControl + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鍒ゆ柇璇ユ帶浠惰兘鍚︽樉绀�(鏈�濂界‘淇濊澶囧璞′笉涓簄ull) + /// </summary> + public bool CanShowRow + { + get { return this.CheckCanShowRow(); } + } + /// <summary> + /// 璁惧瀵硅薄 + /// </summary> + private CommonDevice device = null; + /// <summary> + /// 褰撳墠閫夋嫨鐨勫姛鑳界被鍨嬬储寮� + /// </summary> + private int nowSelectNo = -1; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 璁惧鍔熻兘绫诲瀷鐨勮嚜瀹氫箟琛屾帶浠�(姝ゆ柟娉曢�夋嫨涔嬪悗,鏃犳潯浠剁洿鎺ュ彉鏇寸被鍨�) + /// </summary> + /// <param name="i_device">璁惧鐨勫璞�</param> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> + public DeviceFunctionTypeRowControl(CommonDevice i_device, int i_ChidrenYaxis = 0) : base("", "", i_ChidrenYaxis) + { + this.device = i_device; + this.UseClickStatu = false; + } + + /// <summary> + /// 鍒濆鍖� + /// </summary> + public override void InitControl() + { + //鍒濆鍖栧垵濮嬫暟鎹� + this.InitDefultData(); + //鍒濆鍖栧簳灞傛暟鎹� + base.InitControl(); + + if (this.device == null) + { + //姝ゆ帶浠堕噰鐢ㄧ殑鏄彟澶栦竴绉嶅垵濮嬪寲鏂瑰紡 + return; + } + + //绌烘皵寮�鍏冲拰缁х數鍣ㄥ彲浠ラ�夋嫨鍔熻兘绫诲瀷 + if (this.device.Type == DeviceType.AirSwitch + || this.device.Type == DeviceType.OnOffOutput) + { + this.UseClickStatu = true; + //鍙崇澶� + this.AddRightArrow(); + + this.ButtonClickEvent += (sender, e) => + { + //鏄剧ず閫夋嫨璁惧鍔熻兘绫诲瀷鐨勭晫闈� + this.ShowSelectDeviceFunctionListForm(); + }; + } + } + + #endregion + + #region 鈻� 鏄剧ず閫夋嫨璁惧鍔熻兘绫诲瀷_______________ + + /// <summary> + /// 鏄剧ず閫夋嫨璁惧鍔熻兘绫诲瀷鐨勭晫闈� + /// </summary> + private void ShowSelectDeviceFunctionListForm() + { + //鏄剧ず鍒楄〃 + var listText = new List<string>(); + listText.Add(Language.StringByID(R.MyInternationalizationString.uSwitch));//寮�鍏� + listText.Add(Language.StringByID(R.MyInternationalizationString.uLight));//鐏厜 + listText.Add(Language.StringByID(R.MyInternationalizationString.uSocket1));//鎻掑骇 + //鏍囬:閫夋嫨鍔熻兘绫诲瀷 + var title = Language.StringByID(R.MyInternationalizationString.uSelectFunctionType); + + var form = new BottomItemSelectForm(); + form.CancelCallEvent = true;//鍏佽鍙栨秷 + form.AddForm(title, listText, nowSelectNo); + form.FinishSelectEvent += (selectNo) => + { + //-1:閫夋嫨鍙栨秷 + this.Text = selectNo == -1 ? string.Empty : listText[selectNo]; + nowSelectNo = selectNo; + + //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨� + this.RefreshDfunctionType(); + }; + } + #endregion + + #region 鈻� 鍒濆鍖栧垵濮嬫暟鎹甠____________________ + + /// <summary> + /// 鍒濆鍖栧垵濮嬫暟鎹� + /// </summary> + private void InitDefultData() + { + //鏍囬锛氬姛鑳界被鍨� + this.btnCaption.Text = Language.StringByID(R.MyInternationalizationString.uFunctionType); + + var myFunType = DeviceFunctionType.A鏈畾涔�; + if (this.device != null) + { + myFunType = this.device.DfunctionType; + } + + //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛� + string strType = string.Empty; + if (myFunType == DeviceFunctionType.A鐏厜) + { + strType = Language.StringByID(R.MyInternationalizationString.uLight); + nowSelectNo = 1; + } + else if (this.device.DfunctionType == DeviceFunctionType.A寮�鍏�) + { + strType = Language.StringByID(R.MyInternationalizationString.uSwitch); + nowSelectNo = 0; + } + else if (this.device.DfunctionType == DeviceFunctionType.A鎻掑骇) + { + strType = Language.StringByID(R.MyInternationalizationString.uSocket1); + nowSelectNo = 2; + } + + //濡傛灉璁惧涓嶄负null + if (this.device != null) + { + if (this.device.Type == DeviceType.ColorDimmableLight + || this.device.Type == DeviceType.DimmableLight) + { + //鐏厜绫诲浐瀹氫负 鐏厜 + strType = Language.StringByID(R.MyInternationalizationString.uLight); + nowSelectNo = 1; + } + else if (this.device.Type == DeviceType.WindowCoveringDevice) + { + //绐楀笜鍥哄畾涓� 閬槼 + strType = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId100); + nowSelectNo = -1; + } + else if (this.device.Type == DeviceType.Thermostat) + { + //绌鸿皟鍥哄畾涓� 绌鸿皟 + strType = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId3600); + nowSelectNo = -1; + } + else if (this.device.Type == DeviceType.DoorLock) + { + //闂ㄩ攣鍥哄畾涓� 闂ㄩ攣 + strType = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId2800); + nowSelectNo = -1; + } + } + //鏄剧ず鏂囨湰 + this.txtView.Text = strType; + } + + #endregion + + #region 鈻� 妫�娴嬭兘鍚︽樉绀篲______________________ + + /// <summary> + /// 妫�娴嬭兘鍚︽樉绀� + /// </summary> + /// <returns></returns> + private bool CheckCanShowRow() + { + if (this.device == null) { return true; } + + if (this.device.Type == DeviceType.AirSwitch//绌烘皵寮�鍏� + || this.device.Type == DeviceType.ColorDimmableLight//褰╃伅 + || this.device.Type == DeviceType.DimmableLight//璋冨厜鐏� + || this.device.Type == DeviceType.DoorLock//闂ㄩ攣 + || this.device.Type == DeviceType.OnOffOutput//缁х數鍣� + || this.device.Type == DeviceType.Thermostat//绌鸿皟 + || this.device.Type == DeviceType.WindowCoveringDevice)//绐楀笜 + { + return true; + } + return false; + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 鍒锋柊璁惧鍔熻兘绫诲瀷 + /// </summary> + private void RefreshDfunctionType() + { + if (this.nowSelectNo == 0) + { + this.device.DfunctionType = DeviceFunctionType.A寮�鍏�; + if (this.device.IsCustomizeImage == false) + { + //閲嶆柊璁剧疆鍥剧墖 + this.device.IconPath = "Device/Switch.png"; + } + } + else if (this.nowSelectNo == 1) + { + this.device.DfunctionType = DeviceFunctionType.A鐏厜; + if (this.device.IsCustomizeImage == false) + { + //閲嶆柊璁剧疆鍥剧墖 + this.device.IconPath = "Device/Light.png"; + } + } + else if (this.nowSelectNo == 2) + { + this.device.DfunctionType = DeviceFunctionType.A鎻掑骇; + if (this.device.IsCustomizeImage == false) + { + //閲嶆柊璁剧疆鍥剧墖 + this.device.IconPath = "Device/Socket1.png"; + } + } + else + { + this.device.DfunctionType = DeviceFunctionType.A鏈畾涔�; + if (this.device.IsCustomizeImage == false) + { + //閲嶆柊璁剧疆鍥剧墖 + if (this.device.Type == DeviceType.AirSwitch) + { + //绌烘皵寮�鍏� + this.device.IconPath = "Device/Switch.png"; + } + else if (this.device.Type == DeviceType.OnOffOutput) + { + //缁х數鍣� + this.device.IconPath = "Device/RelayEpoint.png"; + } + } + } + this.device.ReSave(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs index 1e42396..668b90c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs @@ -6,7 +6,7 @@ /// <summary> /// 鍋氭垚涓�涓偣鍑昏兘澶熸樉绀洪�変腑鐘舵�佽儗鏅壊鐨凴owLayout(鎷ユ湁妗屽竷) /// </summary> - public class RowLayoutControl : RowLayout + public class RowLayoutControl : RowLayoutBase { #region 鈻� 鍙橀噺澹版槑___________________________ @@ -112,9 +112,8 @@ } return btnEditor; - } - - #endregion + } + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs index a650b64..bc94bb7 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs @@ -126,5 +126,348 @@ } #endregion + + #region 鈻� 绌鸿皟_______________________________ + + /// <summary> + /// SendACStatuComand + /// </summary> + /// <param name="device">璁惧</param> + public void SendACStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + new System.Threading.Thread(() => + { + SendFanStatuComand(device); + System.Threading.Thread.Sleep(300); + SendThermostatStatuComand(device); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// SendThermostatStatuComand + /// </summary> + /// <param name="device">璁惧</param> + public void SendThermostatStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.Thermostat }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.LocalTemperature} + }, + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.CoolingSetpoint} + }, + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.HeatingSetpoint} + }, + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.AutoSetpoint} + }, + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.SystemMode} + }, + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.AcModeSupport} + }, + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.CleanStatu} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); + } + + /// <summary> + /// SendFanStatuComand + /// </summary> + /// <param name="device">璁惧</param> + private void SendFanStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.FanControl }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.FanMode} + }, + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.FanSwing} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send("GetDeviceStatus", jObject.ToString()); + } + + #endregion + + #region 鈻� 鏂伴_______________________________ + /// <summary> + /// SendFreshAirStatuComand + /// </summary> + /// <param name="device">璁惧</param> + public void SendFreshAirStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + new System.Threading.Thread(() => + { + SendFreshAirFanStatuComand(device); + System.Threading.Thread.Sleep(300); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// SendFanStatuComand + /// </summary> + /// <param name="device">璁惧</param> + private void SendFreshAirFanStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.FanControl }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.FanMode} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send("GetDeviceStatus", jObject.ToString()); + } + + #endregion + + #region 鈻� 绐楀笜_______________________________ + /// <summary> + /// 鍙戦�佽幏鍙栫獥甯樼姸鎬佸懡浠� + /// </summary> + /// <param name="device">绐楀笜</param> + public void SendCurtainStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.WindowCovering }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.CurrentPositionLiftPercentage} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); + } + + #endregion + + #region 鈻� 鐏厜_______________________________ + + /// <summary> + /// Light + /// </summary> + /// <param name="device"></param> + public void SendLightStatuComand(CommonDevice device) + { + SendSwitchStatuComand(device); + } + + /// <summary> + /// Light + /// </summary> + /// <param name="device"></param> + public void SendDimmableLightStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + new System.Threading.Thread(() => + { + SendSwitchStatuComand(device); + System.Threading.Thread.Sleep(300); + SendLevelStatuComand(device); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鍙戦�佽幏鍙栫伅鍏夌姸鎬佸懡浠� + /// </summary> + /// <param name="device">绐楀笜</param> + private void SendSwitchStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.Switch }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.Switch} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); + } + + /// <summary> + /// 鍙戦�佽幏鍙栫伅鍏夌姸鎬佸懡浠� + /// </summary> + /// <param name="device">绐楀笜</param> + private void SendLevelStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.LevelControl }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.LevelControl} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); + } + + #endregion + + #region 鈻� 娓╂箍搴____________________________ + + /// <summary> + /// 璇诲彇娓╁害 + /// </summary> + /// <param name="device"></param> + public void SendTemperatureStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.TemperatureMeasurement }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.MeasuredValue} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); + } + + /// <summary> + /// 璇诲彇婀垮害 + /// </summary> + /// <param name="device"></param> + public void SendHumidityStatuComand(CommonDevice device) + { + if (device == null) + { + return; + } + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "DeviceAddr",device.DeviceAddr }, + { "Epoint", device.DeviceEpoint }, + { "Cluster_ID", (int)Cluster_ID.RelativeHumidityMeasurement }, + { "Command", 108 } + }; + var attriBute = new Newtonsoft.Json.Linq.JArray + { + new Newtonsoft.Json.Linq.JObject + { + { "AttriButeId", (int)AttriButeId.MeasuredValue} + } + }; + var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; + jObject.Add("Data", data); + device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); + } + + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs old mode 100644 new mode 100755 index 89e7821..6fbdb9e --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs @@ -154,21 +154,21 @@ } return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%"; } - else if (device.Type == DeviceType.FreshAir) - { - //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 + else if (device.Type == DeviceType.FreshAir) + { + //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎 if (device.HadReadDeviceStatu == false) { return Language.StringByID(R.MyInternationalizationString.uOffLine); - } - - //妯″紡 - string wind = string.Empty; - var freshAir = device as FreshAir; - if (freshAir.currentFanStatus == 0) - { - return Language.StringByID(R.MyInternationalizationString.Close); - } + } + + //妯″紡 + string wind = string.Empty; + var freshAir = device as FreshAir; + if (freshAir.currentFanStatus == 0) + { + return Language.StringByID(R.MyInternationalizationString.Close); + } if (freshAir.currentFanSpeed == 1) { wind = Language.StringByID(R.MyInternationalizationString.Fan_Low); @@ -180,8 +180,8 @@ else if (freshAir.currentFanSpeed == 3) { wind = Language.StringByID(R.MyInternationalizationString.Fan_Height); - } - return $"{wind}"; + } + return $"{wind}"; } else if (device.Type == DeviceType.Thermostat) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs new file mode 100755 index 0000000..d181a06 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs @@ -0,0 +1,964 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using Shared.Common; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// App浣撻獙璐﹀彿鐨勯�昏緫 + /// </summary> + public class HdlExperienceAccountLogic + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// App浣撻獙璐﹀彿鐨勯�昏緫 + /// </summary> + private static HdlExperienceAccountLogic m_Current = null; + /// <summary> + /// App浣撻獙璐﹀彿鐨勯�昏緫 + /// </summary> + public static HdlExperienceAccountLogic Current + { + get + { + if (m_Current == null) + { + m_Current = new HdlExperienceAccountLogic(); + } + return m_Current; + } + } + + /// <summary> + /// 鐢ㄦ潵閫掑鐢熸垚Mac鐢ㄧ殑 + /// </summary> + private int DeviceNumber = 0; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栧叏閮ㄤ綋楠屾暟鎹� + /// </summary> + public void InitAllExperienceData() + { + //鍒濆鍖栫敤鎴� + this.InitUserInfoData(); + //鍒濆鍖栦綇瀹� + this.InitHomeData(); + //鍒濆鍖栨ゼ灞� + this.InitFloorData(); + //鍒濆鍖栨埧闂� + this.InitRoomData(); + //鍒濆鍖栬澶� + this.InitDeviceData(); + //鍒濆鍖栧満鏅� + this.InitSceneData(); + } + + #endregion + + #region 鈻� 鍒濆鍖栫敤鎴穇________________________ + + /// <summary> + /// 鍒濆鍖栫敤鎴� + /// </summary> + private void InitUserInfoData() + { + UserCenterResourse.UserInfo = new UserInformation(); + UserCenterResourse.UserInfo.AuthorityNo = 1;//缁欎粬绠$悊鍛樼О鍙� + UserCenterResourse.UserInfo.AuthorityText = Language.StringByID(R.MyInternationalizationString.Administrator); + //铏氭嫙璐﹀彿 + UserCenterResourse.UserInfo.UserName = Language.StringByID(R.MyInternationalizationString.uVirtualAccount); + } + + #endregion + + #region 鈻� 鍒濆鍖栦綇瀹卂________________________ + + /// <summary> + /// 鍒濆鍖栦綇瀹� + /// </summary> + private void InitHomeData() + { + //鍒濆鍖栦綇瀹匢D + string homeId = "abcdefghijklmn"; + //鍒濆Guid + Config.Instance.Guid = "chushiGuid"; + var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, homeId); + if (System.IO.Directory.Exists(path) == true) + { + //鍐嶆鍚姩鐨勬椂鍊欙紝閲嶆柊寮�濮� + System.IO.Directory.Delete(path, true); + } + System.IO.Directory.CreateDirectory(path); + + //娉ㄦ剰,杩欓噷涓嶆竻绌哄綋鍓嶄綇瀹呭垪琛�,淇濈暀瀹冧箣鍓嶇殑浣忓畢鍒楄〃 + + //鍒涘缓涓存椂浣忓畢 + var house = new House() { Id = homeId, Name = Language.StringByID(R.MyInternationalizationString.uMyHome) }; + house.IsVirtually = true; + house.Save(false); + Config.Instance.HomeId = house.Id; + Config.Instance.Home = House.GetHouseByHouseId(house.Id); + } + + #endregion + + #region 鈻� 鍒濆鍖栨ゼ灞俖________________________ + + /// <summary> + /// 鍒濆鍖栨ゼ灞� + /// </summary> + private void InitFloorData() + { + Config.Instance.Home.FloorDics = new Dictionary<string, string>(); + //Config.Instance.Home.FloorDics["floorKey1"] = "1F"; + //Config.Instance.Home.FloorDics["floorKey2"] = "2F"; + //Config.Instance.Home.FloorDics["floorKey3"] = "3F"; + //Config.Instance.Home.FloorDics["floorKey4"] = "4F"; + //Config.Instance.Home.FloorDics["floorKey5"] = "5F"; + } + + #endregion + + #region 鈻� 鍒濆鍖栨埧闂確________________________ + + /// <summary> + /// 鑾峰彇鎴块棿鏍锋澘鍒楄〃 + /// </summary> + /// <returns></returns> + private Dictionary<string, string> GetRoomSampleList() + { + var dicRoomName = new Dictionary<string, string>(); + //瀹㈠巺 + dicRoomName["KeTing"] = Language.StringByID(R.MyInternationalizationString.uLivingRoom); + //闃冲彴 + dicRoomName["YangTai"] = Language.StringByID(R.MyInternationalizationString.uBalcony); + //鍗у + dicRoomName["WoShi"] = Language.StringByID(R.MyInternationalizationString.uBedroom); + //鐜勫叧 + dicRoomName["XuanGuan"] = Language.StringByID(R.MyInternationalizationString.uVestibule); + //鍘ㄦ埧 + dicRoomName["ChuFang"] = Language.StringByID(R.MyInternationalizationString.uKitchen); + //璧板粖 + dicRoomName["ZouLang"] = Language.StringByID(R.MyInternationalizationString.uCorridor); + + return dicRoomName; + } + + /// <summary> + /// 鍒濆鍖栨埧闂� + /// </summary> + private void InitRoomData() + { + //鍏堝埛鏂板鍣� + HdlRoomLogic.Current.InitAllRoom(); + + //鑾峰彇鍏ㄩ儴鐨勬ゼ灞備富閿� + var listFloorKey = this.GetAllFloorKeys(); + var dicRoomName = this.GetRoomSampleList(); + + //璁剧疆鍒濆妤煎眰 + Config.Instance.Home.CurrentFloorId = listFloorKey[0]; + foreach (string floorKey in listFloorKey) + { + foreach (string roomId in dicRoomName.Keys) + { + //鍒涘缓鏂版埧闂� + var newRoom = new Room(); + newRoom.Id = floorKey + "_" + roomId; + newRoom.Name = dicRoomName[roomId]; + newRoom.BackgroundImage = "RoomIcon/0.jpg"; + newRoom.FloorId = floorKey; + HdlRoomLogic.Current.AddRoom(newRoom, false); + } + } + } + + /// <summary> + /// 鑾峰彇鍏ㄩ儴鐨勬ゼ灞備富閿� + /// </summary> + /// <returns></returns> + private List<string> GetAllFloorKeys() + { + var listKey = new List<string>(); + foreach (var strKey in Config.Instance.Home.FloorDics.Keys) + { + listKey.Add(strKey); + } + if (listKey.Count == 0) + { + listKey.Add(""); + } + return listKey; + } + + #endregion + + #region 鈻� 鍒濆鍖栬澶嘷________________________ + + /// <summary> + /// 璁剧疆闇�瑕佸垱寤虹殑铏氭嫙璁惧鍒楄〃 + /// </summary> + /// <returns></returns> + private List<AddDevicePra> GetVirtualDeviceList() + { + //floorKey1 _ KeTing YangTai WoShi XuanGuan ChuFang ZouLang + var list = new List<AddDevicePra>(); + //鑾峰彇鍏ㄩ儴鐨勬ゼ灞備富閿� + var listFloorKey = this.GetAllFloorKeys(); + foreach (var floorKey in listFloorKey) + { + //瀹㈠巺 + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A2鎸夐敭闈㈡澘, RoomId = floorKey + "_KeTing", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A3鎸夐敭闈㈡澘, RoomId = floorKey + "_KeTing", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4鎸夐敭闈㈡澘, RoomId = floorKey + "_KeTing", DeviceCount = 2 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A绌鸿皟缃戝叧, RoomId = floorKey + "_KeTing", DeviceCount = 1 }); + + //闃冲彴 + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A220pir浼犳劅鍣�, RoomId = floorKey + "_YangTai", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A鍗峰笜鐢垫満, RoomId = floorKey + "_YangTai", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A寮�鍚堝笜鐢垫満, RoomId = floorKey + "_YangTai", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A2鎸夐敭闈㈡澘, RoomId = floorKey + "_YangTai", DeviceCount = 1 }); + + //鍗у + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A1璺皟鍏夊櫒, RoomId = floorKey + "_WoShi", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A3璺户鐢靛櫒, RoomId = floorKey + "_WoShi", DeviceCount = 1 }); + + //鐜勫叧 + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A绌烘皵寮�鍏�, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A1璺皟鍏夊櫒, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A闂ㄧ獥纾佷紶鎰熷櫒, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A鏅鸿兘闂ㄩ攣, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 }); + + //鍘ㄦ埧 + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4鎸夐敭闈㈡澘, RoomId = floorKey + "_ChuFang", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A姘存蹈浼犳劅鍣�, RoomId = floorKey + "_ChuFang", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A鐑熼浘浼犳劅鍣�, RoomId = floorKey + "_ChuFang", DeviceCount = 1 }); + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A鐕冩皵浼犳劅鍣�, RoomId = floorKey + "_ChuFang", DeviceCount = 1 }); + + //璧板粖 + list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4鎸夐敭闈㈡澘, RoomId = floorKey + "_ZouLang", DeviceCount = 1 }); + } + return list; + } + + /// <summary> + /// 鍒濆鍖栬澶� + /// </summary> + private void InitDeviceData() + { + //鍏堝埛鏂板鍣� + LocalDevice.Current.ReFreshByLocal(); + + Type thisType = m_Current.GetType(); + //鑾峰彇闇�瑕佸垱寤虹殑铏氭嫙璁惧鍒楄〃 + var list = this.GetVirtualDeviceList(); + foreach (var data in list) + { + string methordName = "Zigbee" + data.DeviceType.ToString().Substring(1); + //鍙嶅皠鎸囧畾鐨勫嚱鏁� + var myMethod = thisType.GetMethod(methordName); + myMethod.Invoke(this, new object[] { data.DeviceCount, data.RoomId }); + } + } + + #endregion + + #region 鈻� 鍒濆鍖栧満鏅痏________________________ + + /// <summary> + /// 鍒濆鍖栧満鏅� + /// </summary> + private void InitSceneData() + { + //鍒锋柊瀹瑰櫒 + HdlSceneLogic.Current.ReFreshByLocal(); + + //鑾峰彇鍏ㄩ儴鐨勬ゼ灞備富閿� + var listFloorKey = this.GetAllFloorKeys(); + //鑾峰彇鍏ㄩ儴鐨勬埧闂存ā鏉垮垪琛� + var dicRoom = this.GetRoomSampleList(); + + //floorKey1 _ KeTing YangTai WoShi XuanGuan ChuFang ZouLang + int sceneIdNo = 1; + //瀵规瘡涓�涓ゼ灞� + foreach (var floorKey in listFloorKey) + { + //瀵规瘡涓�涓埧闂� + foreach (var strKey in dicRoom.Keys) + { + var room = HdlRoomLogic.Current.GetRoomById(floorKey + "_" + strKey); + if (room == null) + { + continue; + } + //鐏叏寮� + var listAdjust1 = this.InitVirtualSceneAdjustList(room, 1); + var sceneName = Language.StringByID(R.MyInternationalizationString.uAllLightOpen); + var scene = HdlSceneLogic.Current.AddVirtualScene(sceneIdNo, sceneName, listAdjust1); + sceneIdNo++; + HdlSceneLogic.Current.AddSceneToRoom(room, scene); + + //鐏叏鍏� + var listAdjust2 = this.InitVirtualSceneAdjustList(room, 0); + var sceneName2 = Language.StringByID(R.MyInternationalizationString.uAllLightClose); + var scene2 = HdlSceneLogic.Current.AddVirtualScene(sceneIdNo, sceneName2, listAdjust2); + sceneIdNo++; + HdlSceneLogic.Current.AddSceneToRoom(room, scene2); + } + } + } + + /// <summary> + /// 鍒濆鍖栬櫄鎷熷満鏅殑鎵ц鐩爣(statu 0:鍏� 1:寮�) + /// </summary> + /// <param name="i_room"></param> + /// <param name="statu"></param> + /// <returns></returns> + private List<Scene.DeviceListData> InitVirtualSceneAdjustList(Room i_room, int statu) + { + var listBind = new List<Scene.DeviceListData>(); + foreach (var mainKey in i_room.ListDevice) + { + var device = LocalDevice.Current.GetDevice(mainKey); + if (device == null) { continue; } + //鍙缁х數鍣ㄥ拰鐏� + if (device.Type == DeviceType.OnOffOutput + || device.Type == DeviceType.DimmableLight) + { + var data = new Scene.DeviceListData(); + data.Type = 0; + data.DeviceAddr = device.DeviceAddr; + data.Epoint = device.DeviceEpoint; + data.TaskList.Add(new Safeguard.TaskListInfo() { TaskType = 1, Data1 = statu }); + listBind.Add(data); + } + } + return listBind; + } + + #endregion + + #region 鈻� 鍒涘缓铏氭嫙璁惧鍒楄〃___________________ + + public void Zigbee寮�鍚堝笜鐢垫満(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new Rollershade() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.WcdType = 4; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 100, 100, "MWM65B-ZB.20", i_RoomId); + this.DeviceNumber++; + } + } + + public void Zigbee鍗峰笜鐢垫満(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new Rollershade() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.WcdType = 0; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 101, 101, "MVSM35B-ZB.20", i_RoomId); + this.DeviceNumber++; + } + } + + public void Zigbee4鎸夐敭闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //4涓共鎺ョ偣 + for (int j = 1; j <= 4; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 200, 200, "MPT4/R4-ZB.18", i_RoomId); + } + //4涓户鐢靛櫒 + for (int j = 5; j <= 8; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 200, 200, "MPT4/R4-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 4); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 9 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 200, 200, "MPT4/R4-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee3鎸夐敭闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //3涓共鎺ョ偣 + for (int j = 1; j <= 3; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 201, 201, "MPT3/R3-ZB.18", i_RoomId); + } + //3涓户鐢靛櫒 + for (int j = 4; j <= 6; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 201, 201, "MPT3/R3-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 3); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 7 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 201, 201, "MPT3/R3-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee2鎸夐敭闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //2涓共鎺ョ偣 + for (int j = 1; j <= 2; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 202, 202, "MPT2/R2-ZB.18", i_RoomId); + } + //2涓户鐢靛櫒 + for (int j = 3; j <= 4; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 202, 202, "MPT2/R2-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 2); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 5 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 202, 202, "MPT2/R2-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee绠�绾�4鎸夐敭闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //4涓共鎺ョ偣 + for (int j = 1; j <= 4; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 220, 220, "MPT4R4L/S-ZB.18", i_RoomId); + } + //4涓户鐢靛櫒 + for (int j = 5; j <= 8; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 220, 220, "MPT4R4L/S-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 4); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 9 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 220, 220, "MPT4R4L/S-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee绠�绾�3鎸夐敭闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //3涓共鎺ョ偣 + for (int j = 1; j <= 3; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 221, 221, "MPT3R3L/S-ZB.18", i_RoomId); + } + //3涓户鐢靛櫒 + for (int j = 4; j <= 6; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 221, 221, "MPT3R3L/S-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 3); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 7 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 221, 221, "MPT3R3L/S-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee绠�绾�2鎸夐敭闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //2涓共鎺ョ偣 + for (int j = 1; j <= 2; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 222, 222, "MPT2R2L/S-ZB.18", i_RoomId); + } + //2涓户鐢靛櫒 + for (int j = 3; j <= 4; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 222, 222, "MPT2R2L/S-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 2); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 5 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 222, 222, "MPT2R2L/S-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee220pir浼犳劅鍣�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //1涓紶鎰熷櫒 + var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.IasDeviceType = 13; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 1200, 1200, "MSPIR01-ZB.10", i_RoomId); + + //1涓户鐢靛櫒 + var device2 = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 2 }; + device2.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 1200, 1200, "MSPIR01-ZB.10", i_RoomId); + device2.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + 1; + + this.DeviceNumber++; + } + } + + public void Zigbee鐕冩皵浼犳劅鍣�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.IasDeviceType = 43; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 1300, 1300, "MSG01/M-ZB.10", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee闂ㄧ獥纾佷紶鎰熷櫒(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.IasDeviceType = 21; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 1301, 1301, "MSDC01/M-ZB.10", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee鐑熼浘浼犳劅鍣�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.IasDeviceType = 40; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 1301, 1301, "MSS01/M-ZB.10", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee绾㈠浼犳劅鍣�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.IasDeviceType = 13; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 1303, 1303, "MSPIR01/M-ZB.10", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee姘存蹈浼犳劅鍣�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.IasDeviceType = 42; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 1304, 1304, "MSW01/M-ZB.10", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee绱ф�ユ寜閿�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + device.IasDeviceType = 44; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 1305, 1305, "MBU01/M-ZB.10", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee3璺户鐢靛櫒(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //3涓户鐢靛櫒 + for (int j = 1; j <= 3; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 2300, 2300, "MPR0310-ZB.10", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + j; + } + //7涓共鎺ョ偣 + for (int j = 4; j <= 10; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 2300, 2300, "MPR0310-ZB.10", i_RoomId); + } + + this.DeviceNumber++; + } + } + + public void Zigbee1璺皟鍏夊櫒(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //7涓共鎺ョ偣 + for (int j = 1; j <= 7; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 2300, 2300, "MPD0101-ZB.10", i_RoomId); + } + + //1涓户鐢靛櫒 + var device2 = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 8 }; + device2.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 2300, 2300, "MPD0101-ZB.10", i_RoomId); + device2.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + 1; + + + this.DeviceNumber++; + } + } + + public void Zigbee绌鸿皟缃戝叧(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //10涓┖璋冨簲璇ュ彲浠ヤ簡 + for (int j = 1; j <= 10; j++) + { + var device = new AC() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //瀹ゆ俯榛樿26鈩� + device.currentLocalTemperature = 26; + device.currentCoolingSetpoint = 26; + device.currentHeatingSetpoint = 26; + device.currentAutoSetpoint = 26; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 3600, 3600, "MAC/GW-ZB.10", i_RoomId); + } + this.DeviceNumber++; + } + } + + public void Zigbee绌烘皵寮�鍏�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new AirSwitch() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 4100, 4100, "MBCI01-ZB.10", i_RoomId); + device.DfunctionType = DeviceFunctionType.A寮�鍏�; + + this.DeviceNumber++; + } + } + + public void Zigbee鏅鸿兘闂ㄩ攣(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + var device = new ZigBee.Device.DoorLock() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 2800, 2800, "S-one", i_RoomId); + device.DfunctionType = DeviceFunctionType.A寮�鍏�; + + this.DeviceNumber++; + } + } + + public void Zigbee鏂规偊鍗曞紑鍙屾帶闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //2涓共鎺ョ偣 + for (int j = 1; j <= 2; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 240, 240, "MP2B/TILE-ZB.18", i_RoomId); + } + //1涓户鐢靛櫒 + for (int j = 3; j <= 3; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 240, 240, "MP2B/TILE-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 2); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 4 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 240, 240, "MP2B/TILE-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee鏂规偊鍙屽紑鍥涙帶闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //4涓共鎺ョ偣 + for (int j = 1; j <= 4; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 241, 241, "MP4B/TILE-ZB.18", i_RoomId); + } + //2涓户鐢靛櫒 + for (int j = 5; j <= 6; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 241, 241, "MP4B/TILE-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 4); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 7 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 241, 241, "MP4B/TILE-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee鏂规偊鍥涘紑鍏帶闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //8涓共鎺ョ偣 + for (int j = 1; j <= 8; j++) + { + var device = new Panel() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 242, 242, "MP8B/TILE-ZB.18", i_RoomId); + } + //4涓户鐢靛櫒 + for (int j = 9; j <= 12; j++) + { + var device = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = j }; + device.DfunctionType = DeviceFunctionType.A鐏厜; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 242, 242, "MP8B/TILE-ZB.18", i_RoomId); + device.DeviceEpointName = Language.StringByID(R.MyInternationalizationString.uLight) + (j - 8); + } + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 13 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 242, 242, "MP8B/TILE-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee鏂规偊鏂伴闈㈡澘(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //1鏂伴 + var device = new FreshAir() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 250, 250, "MPFA/TILE-ZB.18", i_RoomId); + + //1娓╁害鎺㈠ご + var device2 = new TemperatureSensor() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 2 }; + device2.SensorDiv = 1; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device2, 250, 250, "MPFA/TILE-ZB.18", i_RoomId); + + this.DeviceNumber++; + } + } + + public void Zigbee鏂规偊鏂伴灏忔ā鍧�(int i_DeviceCount, string i_RoomId) + { + for (int i = 0; i < i_DeviceCount; i++) + { + //1鏂伴 + var device = new FreshAir() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 }; + //璁剧疆璁惧鐨勫熀鏈俊鎭� + this.SetBaseDataToDevice(device, 2310, 2310, "MFA01-ZB.10", i_RoomId); + + this.DeviceNumber++; + } + } + + /// <summary> + /// 璁剧疆璁惧鐨勫熀鏈俊鎭� + /// </summary> + /// <param name="device"></param> + private void SetBaseDataToDevice(CommonDevice device, int HwVersion, int ImgTypeId, + string ModelIdentifier, string roomId) + { + device.DeviceEpointName = string.Empty; + device.HadReadDeviceStatu = true; + device.DeviceName = string.Empty; + device.IsOnline = 1; + device.HwVersion = HwVersion; + device.ImgTypeId = ImgTypeId; + device.DriveCode = 0; + device.ManufacturerName = "HDL"; + device.ModelIdentifier = ModelIdentifier; + device.CurrentGateWayId = string.Empty; + + //榛樿姣忎釜璁惧閮藉彲浠ュ畾浣� + device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 3 }); + device.OutClusterList.Add(new CommonDevice.OutClusterObj { OutCluster = 3 }); + + //娣诲姞铏氭嫙璁惧 + LocalDevice.Current.AddVirtualDeviceToMemory(device); + + var room = HdlRoomLogic.Current.GetRoomById(roomId); + if (room != null) + { + //娣诲姞鎴块棿 + HdlRoomLogic.Current.AddDevice(room, device, true); + } + } + + #endregion + + #region 鈻� 璁惧鏋氫妇___________________________ + + /// <summary> + /// 铏氭嫙璁惧鏋氫妇 + /// </summary> + private enum VirtualDeviceEnum + { + A寮�鍚堝笜鐢垫満 = 1, + A鍗峰笜鐢垫満 = 2, + A4鎸夐敭闈㈡澘 = 3, + A3鎸夐敭闈㈡澘 = 4, + A2鎸夐敭闈㈡澘 = 5, + A绠�绾�4鎸夐敭闈㈡澘 = 7, + A绠�绾�3鎸夐敭闈㈡澘 = 8, + A绠�绾�2鎸夐敭闈㈡澘 = 9, + A220pir浼犳劅鍣� = 10, + A鐕冩皵浼犳劅鍣� = 11, + A闂ㄧ獥纾佷紶鎰熷櫒 = 12, + A鐑熼浘浼犳劅鍣� = 13, + A绾㈠浼犳劅鍣� = 14, + A姘存蹈浼犳劅鍣� = 15, + A绱ф�ユ寜閿� = 16, + A3璺户鐢靛櫒 = 17, + A1璺皟鍏夊櫒 = 18, + A绌鸿皟缃戝叧 = 19, + A绌烘皵寮�鍏� = 20, + A鏅鸿兘闂ㄩ攣 = 21, + A鏂规偊鍗曞紑鍙屾帶闈㈡澘 = 22, + A鏂规偊鍙屽紑鍥涙帶闈㈡澘 = 23, + A鏂规偊鍥涘紑鍏帶闈㈡澘 = 24, + A鏂规偊鏂伴闈㈡澘 = 25, + A鏂规偊鏂伴灏忔ā鍧� = 26 + } + + #endregion + + #region 鈻� 缁撴瀯浣揰____________________________ + + /// <summary> + /// 娣诲姞璁惧鐨勫弬鏁� + /// </summary> + private class AddDevicePra + { + /// <summary> + /// 璁惧绫诲瀷 + /// </summary> + public VirtualDeviceEnum DeviceType = VirtualDeviceEnum.A绌烘皵寮�鍏�; + /// <summary> + /// 娣诲姞鐨勮澶囦釜鏁�(涓嶆槸鍥炶矾鏁�) + /// </summary> + public int DeviceCount = 1; + /// <summary> + /// 灏嗚澶囨坊鍔犲埌鐨勬埧闂�(涓嶈缃〃绀轰笉娣诲姞鍒版埧闂�) + /// </summary> + public string RoomId = string.Empty; + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs old mode 100644 new mode 100755 index 5c00a59..31b6add --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs @@ -188,7 +188,7 @@ //閫昏緫瑙﹀彂涓婃姤 else if (topic == gatewayId + "/Logic/Execute_Respon") { - this.LogicExecutePush(null); + this.LogicExecutePush(JObject.Parse(msgData)); } //鍦烘櫙瑙﹀彂涓婃姤 else if (topic == gatewayId + "/Scene/Exec_Respon") @@ -339,70 +339,70 @@ } //绌鸿皟鏁版嵁 else if (report.DeviceStatusReport.CluterID == 514) - { + { locadevice.DeviceStatusReport = report.DeviceStatusReport; foreach (var attData in report.DeviceStatusReport.AttriBute) - { - //鍖哄垎鏄┖璋冭繕鏄柊椋� - var device = Shared.Common.LocalDevice.Current.GetDevice(report.DeviceAddr, report.DeviceEpoint); - - if (device.Type == DeviceType.FreshAir) - { - if (attData.AttributeId == 0) - { - switch (attData.AttriButeData) - { - case 0: - case 4: - ((FreshAir)locadevice).currentFanStatus = attData.AttriButeData; - break; - case 1: - case 2: - case 3: - ((FreshAir)locadevice).currentFanSpeed = attData.AttriButeData; - break; - case 5: - case 7: - ((FreshAir)locadevice).currentFanMode = attData.AttriButeData; - break; - } - //宸茬粡鎺ユ敹鍒扮姸鎬� - locadevice.HadReadDeviceStatu = true; - } - } - else - { - if (attData.AttributeId == 0) - { - //椋庢墖妯″紡 - ((AC)locadevice).currentFanMode = attData.AttriButeData; - //宸茬粡鎺ユ敹鍒扮姸鎬� - locadevice.HadReadDeviceStatu = true; - } - else if (attData.AttributeId == 4096) - { - //椋庢墖鎵 - ((AC)locadevice).currentFanSwingMode = attData.AttriButeData; - //宸茬粡鎺ユ敹鍒扮姸鎬� - locadevice.HadReadDeviceStatu = true; - } - else if (attData.AttributeId == 4097) - { - //杞崲涓轰簩杩涘埗 - var value = Convert.ToString(attData.AttriButeData, 2).PadLeft(16, '0'); - //杩欎釜璁剧疆鏄斁鍦ㄥ悗闈㈢殑 - value = value.Substring(value.Length - 1, 1); - //鍚敤鎽嗛鍔熻兘 - ((AC)locadevice).UseSwingFunction = value == "1"; - locadevice.ReSave(); - } - } + { + //鍖哄垎鏄┖璋冭繕鏄柊椋� + var device = Shared.Common.LocalDevice.Current.GetDevice(report.DeviceAddr, report.DeviceEpoint); + + if (device.Type == DeviceType.FreshAir) + { + if (attData.AttributeId == 0) + { + switch (attData.AttriButeData) + { + case 0: + case 4: + ((FreshAir)locadevice).currentFanStatus = attData.AttriButeData; + break; + case 1: + case 2: + case 3: + ((FreshAir)locadevice).currentFanSpeed = attData.AttriButeData; + break; + case 5: + case 7: + ((FreshAir)locadevice).currentFanMode = attData.AttriButeData; + break; + } + //宸茬粡鎺ユ敹鍒扮姸鎬� + locadevice.HadReadDeviceStatu = true; + } + } + else + { + if (attData.AttributeId == 0) + { + //椋庢墖妯″紡 + ((AC)locadevice).currentFanMode = attData.AttriButeData; + //宸茬粡鎺ユ敹鍒扮姸鎬� + locadevice.HadReadDeviceStatu = true; + } + else if (attData.AttributeId == 4096) + { + //椋庢墖鎵 + ((AC)locadevice).currentFanSwingMode = attData.AttriButeData; + //宸茬粡鎺ユ敹鍒扮姸鎬� + locadevice.HadReadDeviceStatu = true; + } + else if (attData.AttributeId == 4097) + { + //杞崲涓轰簩杩涘埗 + var value = Convert.ToString(attData.AttriButeData, 2).PadLeft(16, '0'); + //杩欎釜璁剧疆鏄斁鍦ㄥ悗闈㈢殑 + value = value.Substring(value.Length - 1, 1); + //鍚敤鎽嗛鍔熻兘 + ((AC)locadevice).UseSwingFunction = value == "1"; + locadevice.ReSave(); + } + } } - } + } #endregion - + #region 鈻� 浜害鏁版嵁 - //浜害鏁版嵁 + //浜害鏁版嵁 else if (report.DeviceStatusReport.CluterID == 8) { locadevice.DeviceStatusReport = report.DeviceStatusReport; @@ -528,10 +528,10 @@ private void DoorLockDeviceReportPush(JObject receiveData) { //鍙湁寰愭鐨勯棬閿佺晫闈㈡病鏈夋墦寮�鐨勬儏鍐典笅,鎵嶄細澶勭悊杩欎釜涓滆タ - if (ControlCommonResourse.IsDoorLockPageOpen == false) + if (ControlCommonResourse.IsDoorLockPageOpen == false && UserCenterResourse.UserInfo.AuthorityNo == 1) { var device = Common.LocalDevice.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint")); - if ((device is ZigBee.Device.DoorLock) == false) + if (device.Type != DeviceType.DoorLock) { //瀹冧笉鏄棬閿� return; @@ -539,24 +539,21 @@ var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLockAlarmsResult>(receiveData["Data"].ToString()); if (info.Clusterid == 257) { - //甯稿紑妯″紡寮�鍚� - if (info.AlarmCode == 216) + //甯稿紑妯″紡鍏抽棴 + if (info.AlarmCode == 217 || info.AlarmCode == 219) { - //娓╁眳鍩庣殑瑕佺綉鍏充腑鏄惁鏈夐�昏緫瀛樺湪 - Application.RunOnMainThread(async () => - { - var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(); - if (resTemp == 1) - { - DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush, true, null); - } - else if (resTemp == 0) - { - DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush, false, null); - } - - - }); + HdlThreadLogic.Current.RunThread(async () => + { + //娓╁眳鍩庣殑瑕佺綉鍏充腑鏄惁鏈夐�昏緫瀛樺湪 + //鍙傛暟:2-甯稿紑鑷姩鍖�;3-澶辨晥鏃堕棿鑷姩鍖� + var result = await Shared.Phone.Device.Logic.SkipView.Exist(2); + HdlThreadLogic.Current.RunMain(() => + { + //寮瑰嚭寰愭鐨勯偅涓獥鍙� + DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush, + result != 0 ? true : false, null); + }); + }); } } } @@ -572,7 +569,7 @@ /// 璁惧鍦ㄧ嚎鐘舵�佹洿鏂板弽棣� /// </summary> /// <param name="receiveData"></param> - private void DeviceOnlineChangePush(JObject receiveData) + private void DeviceOnlineChangePush (JObject receiveData) { if (this.dicDeviceEvent.Count == 0) { @@ -749,10 +746,30 @@ /// <param name="receiveData"></param> private void LogicExecutePush(JObject receiveData) { - //鐩墠涓嶅鐞嗛�昏緫涓婃姤鍐呭 - //鏄剧ず鏈夋柊娑堟伅鐨勭壒鏁� this.ShowHadNewMessageAppeal(); + + //杩欎釜涓滆タ鏆傛椂涓嶅鐞� + ////鍙湁寰愭鐨勯棬閿佺晫闈㈡病鏈夋墦寮�鐨勬儏鍐典笅,鎵嶄細澶勭悊杩欎釜涓滆タ + //if (ControlCommonResourse.IsDoorLockPageOpen == false && UserCenterResourse.UserInfo.AuthorityNo == 1) + //{ + // var device = Common.LocalDevice.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint")); + // if (device.Type != DeviceType.DoorLock) + // { + // return; + // } + // //鑷姩鍖栨墽琛� 甯稿紑鍏抽棴 + // var data = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicPushResult>(receiveData["Data"].ToString()); + // if (data.ActionData != null && data.ActionData.Actiontype == 8 + // && data.ActionData.PassDataString == "055704010113") + // { + // HdlThreadLogic.Current.RunMain(() => + // { + // //寮瑰嚭寰愭鐨勯偅涓獥鍙� + // DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush, null); + // }); + // } + //} } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs index 50863d1..997240b 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs @@ -32,6 +32,71 @@ #endregion + #region 鈻� 鑾峰彇鏈湴浣忓畢鍒楄〃___________________ + + /// <summary> + /// 鑾峰彇鏈湴浣忓畢鍒楄〃 + /// </summary> + /// <returns></returns> + public List<Common.House> GetLocalResidenceList() + { + //濡傛灉鏄櫄鎷熶綇瀹�,鍒欎粠鏍圭洰褰曚腑鑾峰彇 + if (Common.Config.Instance.Home.IsVirtually == true) + { + //浠庢枃浠跺す涓幏鍙栧叏閮ㄧ殑浣忓畢瀵硅薄 + return this.GetAllLocalResidenceListByDirectory(); + } + + var listHome = new List<Common.House>(); + foreach (var housePath in Common.Config.Instance.HomeFilePathList) + { + var home = Common.House.GetHouseByFilePath(housePath); + if (home == null) + { + continue; + } + listHome.Add(home); + } + return listHome; + } + + /// <summary> + /// 浠庢枃浠跺す涓幏鍙栧叏閮ㄧ殑浣忓畢瀵硅薄 + /// </summary> + /// <returns></returns> + public List<Common.House> GetAllLocalResidenceListByDirectory() + { + var strPath = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid); + var listHome = new List<Common.House>(); + //鑾峰彇鍏ㄩ儴鐨勬枃浠跺す + var listDirectory = new List<string>(); + var arryDirs = System.IO.Directory.GetDirectories(strPath); + foreach (var file in arryDirs) + { + string[] arry = file.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); + listDirectory.Add(arry[arry.Length - 1]); + } + foreach (var myDir in listDirectory) + { + //鑾峰彇鍚勪釜鏂囦欢澶归噷闈㈢殑浣忓畢鏂囦欢 + string nowPath = System.IO.Path.Combine(strPath, myDir); + var arryHouse = System.IO.Directory.GetFiles(nowPath, "House_*"); + if (arryHouse.Length > 0) + { + //璇诲彇鏂囦欢鍐呭 + var textValue = UserCenterLogic.LoadFileContent(System.IO.Path.Combine(nowPath, arryHouse[0])); + if (textValue != null) + { + var myHouse = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.House>(textValue); + listHome.Add(myHouse); + } + } + } + return listHome; + } + + #endregion + #region 鈻� 涓�鑸柟娉昣__________________________ /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs old mode 100644 new mode 100755 index bd3a852..8daca3a --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs @@ -75,8 +75,8 @@ //娓呯┖鏈湴缂撳瓨 this.dicRooms.Clear(); //妫�娴嬫垜鐨勫枩鐖辫繖涓埧闂村璞� - this.CheckLoveRoom(); - + this.CheckLoveRoom(); + foreach (var roomId in Config.Instance.Home.ListRooms) { //浠庢枃浠堕噷闈㈣幏鍙栨埧闂村璞� @@ -227,7 +227,8 @@ /// 澧炲姞鎴块棿 /// </summary> /// <param name="room">Room.</param> - public void AddRoom(Room room) + /// <param name="rorefreshRoomViewom">鏄惁鍒锋柊鎴块棿瑙嗗浘鍒楄〃鐣岄潰</param> + public void AddRoom(Room room, bool refreshRoomView = true) { if (Global.IsExistsByHomeId(room.FileName) == true || Config.Instance.Home.ListRooms.Contains(room.Id) == true) @@ -242,8 +243,11 @@ room.Save(); //澶囦唤 HdlAutoBackupLogic.AddOrEditorFile(room.FileName); - //鍒锋柊鎴块棿瑙嗗浘鍒楄〃 - this.RefreshRoomListView(); + if (refreshRoomView == true) + { + //鍒锋柊鎴块棿瑙嗗浘鍒楄〃 + this.RefreshRoomListView(); + } } #endregion @@ -924,6 +928,10 @@ /// <returns></returns> public List<Room> GetFloorSortRoom(string i_floorKeys, bool getShard = true) { + if (i_floorKeys == null) + { + i_floorKeys = string.Empty; + } Dictionary<string, List<string>> dicAllSort = new Dictionary<string, List<string>>(); //璇诲彇鎴块棿椤哄簭 string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.RoomSortFile); @@ -1018,34 +1026,26 @@ if (strData != null) { listFloorSort = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(strData); - } - - - foreach (string keys in Common.Config.Instance.Home.FloorDics.Keys) - { - if (listFloorSort != null) - { - if (listFloorSort.Contains(keys) == false) - { - //鏂版坊鍔犵殑妤煎眰 - listFloorSort.Add(keys); - } - } - - } - - var dic = new Dictionary<string, string>(); - if (listFloorSort != null) - { - for (int i = 0; i < listFloorSort.Count; i++) - { - if (Config.Instance.Home.FloorDics.ContainsKey(listFloorSort[i]) == true) - { - dic[listFloorSort[i]] = Config.Instance.Home.FloorDics[listFloorSort[i]]; - } - } - } - //淇濆瓨椤哄簭 + } + foreach (string keys in Common.Config.Instance.Home.FloorDics.Keys) + { + if (listFloorSort.Contains(keys) == false) + { + //鏂版坊鍔犵殑妤煎眰 + listFloorSort.Add(keys); + } + } + + var dic = new Dictionary<string, string>(); + for (int i = 0; i < listFloorSort.Count; i++) + { + if (Config.Instance.Home.FloorDics.ContainsKey(listFloorSort[i]) == true) + { + dic[listFloorSort[i]] = Config.Instance.Home.FloorDics[listFloorSort[i]]; + } + } + + //淇濆瓨椤哄簭 UserCenterLogic.SaveFileContent(fullName, listFloorSort); return dic; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs index 35fc675..d1d8ec5 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs @@ -1154,10 +1154,10 @@ } else if (data.Type == "1") { - var scene = Common.SceneRoomUI.AllSceneRoomUIList.Find((obj) => obj.sceneUI.Id == data.ScenesId); + var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(data.ScenesId); if (scene != null) { - string msg = scene.sceneUI.Name + "\r\n"; + string msg = scene.Name + "\r\n"; //鐩爣鍦烘櫙涓嶅瓨鍦� msg += Language.StringByID(R.MyInternationalizationString.uTargetSceneIsNotExsit); this.ShowTipMsg(msg); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs index ce36714..7f5755c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs @@ -109,7 +109,7 @@ foreach (var sceneui in listDelete) { //鎵ц鍒犻櫎 - this.RemoveScene(sceneui); + this.DeleteLocalScene(sceneui); } return true; @@ -127,25 +127,36 @@ /// <returns></returns> public async Task<SceneUI> AddNewSceneToGateway(string sceneName, List<Scene.DeviceListData> listAdjustTarget) { - var result1 = await Scene.GetSceneNewIdAsync(sceneName); - //鍏遍�氶敊璇娴� - string error = HdlCheckLogic.Current.CheckCommonErrorCode(result1); - if (error != null) + int NewScenesId = -1; + //濡傛灉褰撳墠浣忓畢涓嶆槸铏氭嫙浣忓畢 + if (Common.Config.Instance.Home.IsVirtually == false) { - this.ShowErrorMsg(error); - return null; + var result1 = await Scene.GetSceneNewIdAsync(sceneName); + //鍏遍�氶敊璇娴� + string error = HdlCheckLogic.Current.CheckCommonErrorCode(result1); + if (error != null) + { + this.ShowErrorMsg(error); + return null; + } + if (result1 == null || result1.getSceneIdData == null) + { + //娣诲姞鍦烘櫙澶辫触 + string msg1 = Language.StringByID(R.MyInternationalizationString.AddSceneFail); + //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg + msg1 = UserCenterLogic.CombineGatewayTimeOutMsg(msg1, result1); + this.ShowTipMsg(msg1); + return null; + } + NewScenesId = result1.getSceneIdData.NewScenesId; } - if (result1 == null || result1.getSceneIdData == null) + else { - //娣诲姞鍦烘櫙澶辫触 - string msg1 = Language.StringByID(R.MyInternationalizationString.AddSceneFail); - //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg - msg1 = UserCenterLogic.CombineGatewayTimeOutMsg(msg1, result1); - this.ShowTipMsg(msg1); - return null; + //铏氭嫙鍦烘櫙ID + NewScenesId = Convert.ToInt32(DateTime.Now.ToString("HHmmss")); } //娣诲姞鎵ц鐩爣 - var listSuccess = await this.AddTargetToScene(result1.getSceneIdData.NewScenesId, listAdjustTarget); + var listSuccess = await this.AddTargetToScene(NewScenesId, listAdjustTarget); if (listSuccess == null) { return null; @@ -154,7 +165,7 @@ //鍒涘缓鍦烘櫙瀵硅薄 var newScene = new SceneUI(); newScene.Name = sceneName; - newScene.Id = result1.getSceneIdData.NewScenesId; + newScene.Id = NewScenesId; newScene.AdjustTargetList.AddRange(listSuccess); //娣诲姞缂撳瓨 newScene.Save(); @@ -172,6 +183,12 @@ /// <returns></returns> private async Task<List<Scene.DeviceListData>> AddTargetToScene(int sceneId, List<Scene.DeviceListData> listAdjustTarget) { + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹呯殑璇� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //涓嶉渶瑕佹洿鏂扮綉鍏� + return listAdjustTarget; + } var listSuccess = new List<Scene.DeviceListData>(); for (int i = 0; i < listAdjustTarget.Count; i++) { @@ -286,32 +303,34 @@ } /// <summary> - /// 鍒犻櫎鍦烘櫙(杩欎釜鍙Щ闄ゅ唴瀛�) + /// 娣诲姞铏氭嫙鍦烘櫙 /// </summary> - /// <param name="scene"></param> - public void DeleteSceneFromRoom(Room i_room, SceneUI scene) + /// <param name="sceneId">鎸囧畾鍦烘櫙id,濡傛灉涓�-1,鍒欎細鍐呴儴鑷姩缂栧彿(鍙兘浼氶噸澶�)</param> + /// <param name="sceneName">鍦烘櫙鍚嶅瓧</param> + /// <param name="listAdjustTarget">缁戝畾鐩爣</param> + /// <returns></returns> + public SceneUI AddVirtualScene(int sceneId, string sceneName, List<Scene.DeviceListData> listAdjustTarget) { - //绉婚櫎缂撳瓨 - if (i_room.ListSceneId.Contains(scene.Id) == true) + if (sceneId == -1) { - i_room.ListSceneId.Remove(scene.Id); - i_room.Save(); + sceneId = Convert.ToInt32(DateTime.Now.ToString("HHmmss")); } - } + //鍒涘缓鍦烘櫙瀵硅薄 + var newScene = new SceneUI(); + newScene.Name = sceneName; + newScene.IconPath = "SceneIcon/0.png"; + //铏氭嫙鍦烘櫙ID + newScene.Id = sceneId; + if (listAdjustTarget != null) + { + newScene.AdjustTargetList.AddRange(listAdjustTarget); + } + //娣诲姞缂撳瓨 + newScene.Save(); + //鍔犲叆缂撳瓨 + this.dicScenes[newScene.Id] = newScene; - /// <summary> - /// 鍒犻櫎鎼滆棌鍦烘櫙 - /// </summary> - /// <param name="scene"></param> - public void DeleteLoveScene(SceneUI scene) - { - var nowRoom = HdlRoomLogic.Current.GetLoveRoom(); - //绉婚櫎缂撳瓨 - if (nowRoom.ListSceneId.Contains(scene.Id) == true) - { - nowRoom.ListSceneId.Remove(scene.Id); - nowRoom.Save(); - } + return newScene; } #endregion @@ -326,6 +345,16 @@ /// <returns></returns> public async Task<bool> EditorSceneFromGateway(SceneUI sceneUI, List<Scene.DeviceListData> listAdjustTarget) { + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹呯殑璇� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //娓呯┖鍦烘櫙鐨勬墽琛岀洰鏍囧垪琛ㄧ殑缂撳瓨 + sceneUI.AdjustTargetList.Clear(); + sceneUI.AdjustTargetList.AddRange(listAdjustTarget); + sceneUI.Save(); + return true; + } + //鍏堟竻绌哄叏閮ㄧ殑鎵ц鐩爣 var deleteData = new Scene.SceneRemoveMemberData(); var deleteTargetData = new List<Scene.RemoveSceneDeviceListInfo>(); @@ -401,6 +430,12 @@ /// <returns></returns> public async Task<bool> EditorSceneNameFromGateway(SceneUI scene, string newName) { + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹呯殑璇� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //涓嶉渶瑕佹洿鏂扮綉鍏� + return true; + } var result1 = await Scene.RenameSceneAsync(scene.Id, newName); //鍏遍�氶敊璇娴� string error = HdlCheckLogic.Current.CheckCommonErrorCode(result1); @@ -440,10 +475,10 @@ #region 鈻� 鍒犻櫎鍦烘櫙___________________________ /// <summary> - /// 绉婚櫎鍦烘櫙--璇ヤ粎杩涜浜嗗鏈湴鍦烘櫙鏁版嵁鐨勫垹闄� + /// 鍒犻櫎鏈湴鍦烘櫙鏁版嵁 /// </summary> /// <param name="sceneUI">Scene user interface.</param> - public void RemoveScene(SceneUI sceneUI) + public void DeleteLocalScene(SceneUI sceneUI) { //绉婚櫎缂撳瓨 this.dicScenes.Remove(sceneUI.Id); @@ -476,6 +511,35 @@ Global.DeleteFilebyHomeId(sceneUI.IconPath); HdlAutoBackupLogic.DeleteFile(sceneUI.IconPath); } + } + } + + /// <summary> + /// 鍒犻櫎鍦烘櫙(杩欎釜鍙Щ闄ゅ唴瀛�) + /// </summary> + /// <param name="scene"></param> + public void DeleteSceneFromRoom(Room i_room, SceneUI scene) + { + //绉婚櫎缂撳瓨 + if (i_room.ListSceneId.Contains(scene.Id) == true) + { + i_room.ListSceneId.Remove(scene.Id); + i_room.Save(); + } + } + + /// <summary> + /// 鍒犻櫎鎼滆棌鍦烘櫙 + /// </summary> + /// <param name="scene"></param> + public void DeleteLoveScene(SceneUI scene) + { + var nowRoom = HdlRoomLogic.Current.GetLoveRoom(); + //绉婚櫎缂撳瓨 + if (nowRoom.ListSceneId.Contains(scene.Id) == true) + { + nowRoom.ListSceneId.Remove(scene.Id); + nowRoom.Save(); } } @@ -639,6 +703,13 @@ }); return false; } + //濡傛灉鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + //涓嶈皟鐢ㄧ綉鍏� + return true; + } + //鎵ц璋冪敤鍦烘櫙 var result = await Scene.ControlSceneAsync(scene.Id, scene.SceneDelayTime); if (result == null || result.sceneOpenData == null) @@ -681,6 +752,14 @@ /// <returns></returns> public async Task<List<Scene.DeviceListData>> GetAdjustTargetList(SceneUI i_scene) { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + var listAdjustTarget = new List<Scene.DeviceListData>(); + listAdjustTarget.AddRange(i_scene.AdjustTargetList); + return listAdjustTarget; + } + var result = await Scene.GetSceneDeviceListAsync(i_scene.Id); //鍏遍�氶敊璇娴� string error = HdlCheckLogic.Current.CheckCommonErrorCode(result); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs index 2da6efc..4244dad 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs @@ -451,7 +451,7 @@ private Dictionary<string, string> GetAllShardFileAgoUpdateTime() { var dicTime = new Dictionary<string, string>(); - var data = Global.ReadFileByDirectory(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ShardFileUpdateFile); + var data = Global.ReadFileByDirectory(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ShardFileUpdateTimeFile); if (data == null) { //鐩爣鏂囦欢涓嶅瓨鍦� @@ -469,7 +469,7 @@ { var data = Newtonsoft.Json.JsonConvert.SerializeObject(dicTime); var byteData = System.Text.Encoding.UTF8.GetBytes(data); - Global.WriteFileToDirectoryByBytes(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ShardFileUpdateFile, byteData); + Global.WriteFileToDirectoryByBytes(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ShardFileUpdateTimeFile, byteData); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs index d97b76c..421cd93 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs @@ -631,6 +631,23 @@ /// <param name="noticeDb">鏄惁閫氱煡浜戠</param> public static void ReLoginAgain(string account = "", bool noticeDb = true) { + if (Config.Instance.Home.IsVirtually == true) + { + //濡傛灉鏄櫄鎷熶綇瀹� + HdlThreadLogic.Current.RunMain(() => + { + //鏀惰捣宸﹁彍鍗� + CommonPage.Instance.CloseLeftMenu(); + //鍏抽棴鎵�鏈夋墦寮�浜嗙殑鐣岄潰 + CloseAllOpenForm(); + + //鏄剧ず鐧婚檰鐢婚潰 + var formLogin = new Login.AccountLogin(); + Shared.Common.CommonPage.Instance.AddChidren(formLogin); + formLogin.ShowForm(account); + }); + return; + } UserCenterResourse.AccountOption.OldAccountId = string.Empty; //鍏抽棴鎵�鏈夋帴鏀� HdlGatewayReceiveLogic.Current.RemoveAllEvent(); @@ -668,7 +685,7 @@ //鏄剧ず鐧婚檰鐢婚潰 var formLogin = new Login.AccountLogin(); Shared.Common.CommonPage.Instance.AddChidren(formLogin); - formLogin.Show(account); + formLogin.ShowForm(account); }); if (noticeDb == true) @@ -815,6 +832,14 @@ /// <returns></returns> public async static Task<bool> InitUserCenterMenmoryAndThread(bool ShowPrompted = true) { + //濡傛灉鏄櫄鎷熶綇瀹� + if (Config.Instance.Home.IsVirtually == true) + { + //鍒濆鍖栬櫄鎷熶綇瀹呯殑涓汉涓績鐨勬暟鎹�(鍒囨崲浣忓畢浣跨敤) + InitUserCenterMenmoryByVirtualHome(); + return true; + } + //APP缂撳瓨鍔犺浇寮�濮� UserCenterResourse.AccountOption.AppCanSignout = false; //杩樺師杩滅▼杩炴帴鏉冮檺鍙橀噺 @@ -898,7 +923,7 @@ //0:宸茬粡鍚屾杩囷紝涓嶉渶瑕佸悓姝�,杩欎釜鏃跺�欓渶瑕佹彁绀哄浠� if (result == 0 && ShowPrompted == true) { - //寮�鍚嚜鍔ㄥ浠芥彁绀� + //寮�鍚嚜鍔ㄥ浠� HdlAutoBackupLogic.ShowAutoBackupPromptedForm(); } //鏄剧ず寮曞鐣岄潰 @@ -908,6 +933,25 @@ UserCenterResourse.AccountOption.AppCanSignout = true; return true; + } + + /// <summary> + /// 鍒濆鍖栬櫄鎷熶綇瀹呯殑涓汉涓績鐨勬暟鎹�(鍒囨崲浣忓畢浣跨敤) + /// </summary> + private static void InitUserCenterMenmoryByVirtualHome() + { + //娓呯┖鎵�鏈夋垚鍛樼紦瀛� + ClearAllMemberMemory(); + //棰勫垱寤轰釜浜轰腑蹇冨叏閮ㄧ殑鏂囦欢澶� + CreatAllUserCenterDirectory(); + //鍏抽棴鎵�鏈夋帴鏀� + HdlGatewayReceiveLogic.Current.RemoveAllEvent(); + //鍒濆鍖栨湰鍦扮殑缃戝叧淇℃伅 + HdlGatewayLogic.Current.ReFreshByLocal(); + //鍒濆鍖栨湰鍦扮殑璁惧淇℃伅 + Common.LocalDevice.Current.ReFreshByLocal(); + //鍒濆鍖栨埧闂�(閮洩鍩庨偅杈逛笉鍋氬鐞�,闇�瑕佽繖閲岀壒娈婃墽琛屼竴姝�) + HdlRoomLogic.Current.RefreshAllRoomByLocation(); } /// <summary> @@ -1411,7 +1455,7 @@ #region 鈻� 鏂囦欢淇濆瓨鍜岃鍙朹____________________ /// <summary> - /// 鏂囦欢淇濆瓨(鏁村ぉ蹇樿,鎵�浠ュ缓涓�涓嚱鏁版潵鐜╃帺) + /// 鏂囦欢淇濆瓨,浠呴檺褰撳墠浣忓畢(鏁村ぉ蹇樿,鎵�浠ュ缓涓�涓嚱鏁版潵鐜╃帺) /// </summary> /// <param name="fullName">鍏ㄨ矾寰�</param> /// <param name="obj">闇�瑕佸簭鍒楀寲鐨勪笢瑗�</param> @@ -1424,18 +1468,48 @@ } /// <summary> - /// 璇诲彇鏂囦欢(鏂囦欢涓嶅瓨鍦ㄨ繑鍥瀗ull,鏁村ぉ蹇樿,鎵�浠ュ缓涓�涓嚱鏁版潵鐜╃帺) + /// 璇诲彇鏂囦欢,涓嶉檺鍒朵綇瀹�(鏂囦欢涓嶅瓨鍦ㄨ繑鍥瀗ull,鏁村ぉ蹇樿,鎵�浠ュ缓涓�涓嚱鏁版潵鐜╃帺) /// </summary> /// <param name="fullName">鍏ㄨ矾寰�</param> /// <returns></returns> public static string LoadFileContent(string fullName) { + //璇诲彇鏂囦欢 + var varByte = ReadFileContent(fullName); + if (varByte == null) + { + return null; + } + return Encoding.UTF8.GetString(varByte); + } + + /// <summary> + /// 璇诲彇鏂囦欢,涓嶉檺鍒朵綇瀹�,鏂囦欢涓嶅瓨鍦ㄨ繑鍥瀗ull + /// </summary> + /// <param name="fullName">鍏ㄨ矾寰�</param> + /// <returns></returns> + public static byte[] ReadFileContent(string fullName) + { if (System.IO.File.Exists(fullName) == false) { return null; } - var varByte = Shared.IO.FileUtils.ReadFile(fullName); - return System.Text.Encoding.UTF8.GetString(varByte); + System.IO.FileStream fileStream = null; + try + { + fileStream = new System.IO.FileStream(fullName, System.IO.FileMode.Open, System.IO.FileAccess.Read); + byte[] array = new byte[fileStream.Length]; + fileStream.Read(array, 0, array.Length); + return array; + } + catch + { + return null; + } + finally + { + fileStream?.Close(); + } } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs index aef49cd..381c07e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs @@ -35,10 +35,6 @@ /// </summary> public const string AppOldSelectGatewayFile = "1f2d13116b051b76b111b99246bb23f1"; /// <summary> - /// 鑷姩澶囦唤涓嶉渶瑕佸啀娆℃彁閱掔殑銆愭枃浠跺悕銆�(涓嶉渶瑕佸浠藉強涓婁紶) - /// </summary> - public const string AutoBackupNotPromptedFile = "9479e724666d970fb9ae5dff2b739cf1bc8c1a95d63bf182dc8f290cac98592f"; - /// <summary> /// 淇濆瓨瀹夐槻璁板綍鐨勩�愭枃浠跺す銆� /// </summary> public const string SafeguardAlarmDirectory = "b101c307ddc2fae59a133a31604304560180c5748135de81"; @@ -61,7 +57,11 @@ /// <summary> /// 璁板綍鍒嗕韩鏂囦欢鏇存柊鏃堕棿鐨勩�愭枃浠躲�� /// </summary> - public const string ShardFileUpdateFile = "b4137733cb527d03d1ee8417c8230a8b35109a02db4d0528"; + public const string ShardFileUpdateTimeFile = "b4137733cb527d033a3f63d2b32cd6e0f886eef3cee19601"; + /// <summary> + /// 璁板綍鑷姩澶囦唤鏂囦欢鏇存柊鏃堕棿鐨勩�愭枃浠躲�� + /// </summary> + public const string AutoBackFileUpdateTimeFile = "9479e724666d970f1a2df4fa67cc456b74b31c4d3fce3b4f8c8eef2f2c0559ec"; /// <summary> /// 淇濆瓨鐢ㄦ埛涓汉淇℃伅鐨勩�愭枃浠躲�� /// </summary> @@ -70,6 +70,10 @@ /// 淇濆瓨鏂綉鏃跺�欙紝澶囦唤缃戝叧id鐢ㄧ殑銆愭枃浠躲�� /// </summary> public const string BackupGatewayIdFile = "5f7fdfe4258d4cd19a433412468a586834643bed528cdba1"; + /// <summary> + /// 鑷姩澶囦唤涓嶉渶瑕佸啀娆℃彁閱掔殑銆愭枃浠跺悕銆�(涓嶉渶瑕佸浠藉強涓婁紶) + /// </summary> + public const string AutoBackupNotPromptedFile = "9479e724666d970fb9ae5dff2b739cf1bc8c1a95d63bf182dc8f290cac98592f"; /// <summary> /// 骞叉帴鐐圭鏈夊睘鎬х殑淇濆瓨鏂囦欢 /// </summary> @@ -132,6 +136,10 @@ public const string OpenGbsFile = "cd8f75492cb65ef0951442460336db62"; /// <summary> + /// 璁板綍鑷姩澶囦唤涓婁紶鏃ユ湡鐨勩�愭枃浠躲��,涓嶅姞瀵� + /// </summary> + public const string UpLoadAutoBackDayFile = "UpLoadAutoBackDayFile"; + /// <summary> /// 鏄剧ず鍔熻兘鑿滃崟鐨勩�愭爣璇嗘枃浠躲��,涓嶅姞瀵� /// </summary> public const string ShowOptionMenuFile = "ShowOptionMenuFile"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/GatewayResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/GatewayResourse.cs index 002f576..b5aaf62 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/GatewayResourse.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/GatewayResourse.cs @@ -11,9 +11,9 @@ public class GatewayResourse { /// <summary> - /// 褰撳墠閫夋嫨鐨勭綉鍏�(浣跨敤瀹屾椂锛岃缃┖) + /// 褰撳墠閫夋嫨鐨勭綉鍏矷D /// </summary> - public static ZbGateway NowSelectGateway = null; + public static string NowSelectGatewayId = string.Empty; /// <summary> /// APP鏈�鍚庨�夋嫨鐨勭綉鍏矷D(鎴栬杩欎釜鍙橀噺鏄澶囩鐞嗙晫闈笓鐢ㄧ殑) /// </summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs index 2680692..4cd1d83 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs @@ -78,7 +78,16 @@ private void InitAirConditioningModuleList(VerticalListControl listView) { var list = HdlFirmwareUpdateLogic.GetFirmwareVersionListInfo(FirmwareLevelType.ZigbeeDevice, otaDevice.HwVersion.ToString(), otaDevice.ImgTypeId.ToString()); - if (list.Count == 0) + var listUpdate = new List<FirmwareVersionInfo>(); + foreach (var data in list) + { + if (data.Name.EndsWith(".bin") == true) + { + //鍙.bin鏂囦欢 + listUpdate.Add(data); + } + } + if (listUpdate.Count == 0) { //娌℃湁鍙崌绾х殑绌鸿皟妯″潡 this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uNotHadAirConditioningUpdateModule)); @@ -86,10 +95,10 @@ } HdlThreadLogic.Current.RunMainInThread(() => { - for (int i = 0; i < list.Count; i++) + for (int i = 0; i < listUpdate.Count; i++) { //娣诲姞妯″潡琛� - this.AddModuleRow(listView, list[i], i.ToString(), i != list.Count - 1); + this.AddModuleRow(listView, listUpdate[i], i.ToString(), i != listUpdate.Count - 1); } //璋冩暣楂樺害 listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23)); @@ -100,7 +109,7 @@ bodyFrameLayout.AddChidren(btnUpdate); btnUpdate.ButtonClickEvent += (sender, e) => { - var selectInfo = this.GetSelectFirmware(listView, list); + var selectInfo = this.GetSelectFirmware(listView, listUpdate); if (selectInfo == null) { //娌℃湁閫夋嫨鍥轰欢 @@ -175,6 +184,26 @@ //鏃ョ珛绌鸿皟妯″潡 textView = Language.StringByID(R.MyInternationalizationString.uHitachiAirConditioningModule); } + else if (info.Name.Contains("IRACC_SAEC") == true) + { + //鐢垫満绌鸿皟妯″潡 + textView = Language.StringByID(R.MyInternationalizationString.uSaecAirConditioningModule); + } + else if (info.Name.Contains("IRACC_TOSHIBA") == true) + { + //涓滆姖绌鸿皟妯″潡 + textView = Language.StringByID(R.MyInternationalizationString.uToshibaAirConditioningModule); + } + else if (info.Name.Contains("IRACC_GREE") == true) + { + //鏍煎姏绌鸿皟妯″潡 + textView = Language.StringByID(R.MyInternationalizationString.uGreeAirConditioningModule); + } + else if (info.Name.Contains("IRACC_MIDEA") == true) + { + //缇庣殑绌鸿皟妯″潡 + textView = Language.StringByID(R.MyInternationalizationString.uMideaAirConditioningModule); + } else { //绌鸿皟鍗囩骇妯″潡 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs index 07b2928..85634c4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs @@ -86,7 +86,7 @@ { var rowInfo = new RowControlInfo(); - var frameTable = new FrameLayoutControl(); + var frameTable = new FrameLayoutStatuControl(); frameTable.UseClickStatu = false; frameTable.Width = Application.GetRealWidth(994); frameTable.Height = Application.GetRealHeight(337); @@ -98,9 +98,9 @@ var btnIconBack = new FrameLayout(); btnIconBack.X = Application.GetRealWidth(46); btnIconBack.Y = Application.GetRealHeight(43); - btnIconBack.Height = Application.GetMinRealAverage(112); - btnIconBack.Width = Application.GetMinRealAverage(112); - btnIconBack.Radius = (uint)Application.GetMinRealAverage(112) / 2; + btnIconBack.Height = this.GetPictrueRealSize(112); + btnIconBack.Width = this.GetPictrueRealSize(112); + btnIconBack.Radius = (uint)this.GetPictrueRealSize(112) / 2; btnIconBack.BackgroundColor = 0xfff5f6fa; frameTable.AddChidren(btnIconBack, ChidrenBindMode.NotBind); rowInfo.btnIconBack = btnIconBack; @@ -216,7 +216,7 @@ return; } //璇诲彇鐘舵�� - Phone.Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendThermostatStatuComand(listDevice[i]); + HdlDeviceAttributeLogic.Current.SendThermostatStatuComand(listDevice[i]); System.Threading.Thread.Sleep(200); } }); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs old mode 100644 new mode 100755 index ccccd7c..1685d91 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs @@ -234,8 +234,8 @@ } } else - { - // 鑾峰彇妤煎眰瀵瑰簲瀵规埧闂� + { + // 鑾峰彇妤煎眰瀵瑰簲瀵规埧闂� var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); foreach (var room in listAllRoom) { @@ -453,7 +453,7 @@ /// <returns></returns> List<CommonDevice> GetALlDispalyRoomDeviceList() { - currentKeyAllRoomDeviceList.Clear(); + currentKeyAllRoomDeviceList.Clear(); var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); switch (curDeviceBindType) { @@ -492,7 +492,7 @@ if (r.IsLove == true) { continue; - } + } foreach (var deviceKeys in r.ListDevice) { var device = LocalDevice.Current.GetDevice(deviceKeys); @@ -548,9 +548,9 @@ switch (curDeviceBindType) { case "AddSwitch": - foreach (var deviceKeys in curRoom.ListDevice) - { - var device = LocalDevice.Current.GetDevice(deviceKeys); + foreach (var deviceKeys in curRoom.ListDevice) + { + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 6)); @@ -561,10 +561,10 @@ } } break; - case "AddDimmer": - foreach (var deviceKeys in curRoom.ListDevice) - { - var device = LocalDevice.Current.GetDevice(deviceKeys); + case "AddDimmer": + foreach (var deviceKeys in curRoom.ListDevice) + { + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 8)); @@ -575,10 +575,10 @@ } } break; - case "AddCurtain": - foreach (var deviceKeys in curRoom.ListDevice) - { - var device = LocalDevice.Current.GetDevice(deviceKeys); + case "AddCurtain": + foreach (var deviceKeys in curRoom.ListDevice) + { + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 258)); @@ -839,9 +839,9 @@ btnMethodText.IsSelected = true; oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; oldbuttonText.IsBold = true; - } - - //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� + } + + //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); foreach (var room in listAllRoom) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs old mode 100644 new mode 100755 index 52eb782..3cf0c4f --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs @@ -183,8 +183,8 @@ //鑾峰彇妤煎眰 dicFloor = HdlRoomLogic.Current.GetFloorSortList(); currentKey.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); - btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); - + btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); + var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); if (Common.Config.Instance.Home.FloorDics.Count == 0) { @@ -615,7 +615,7 @@ Y = Application.GetMinRealAverage(46), Width = Application.GetMinReal(81), Height = Application.GetMinReal(81), - UnSelectedImagePath = "Scene/SceneIcon.png",// scene.IconPath, + UnSelectedImagePath = "Scene/SceneIcon.png",// scene.IconPath, }; rowLayout.AddChidren(devicePic); @@ -868,9 +868,9 @@ btnMethodText.IsSelected = true; oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; oldbuttonText.IsBold = true; - } - - //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� + } + + //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); foreach (var room in listAllRoom) { @@ -930,8 +930,8 @@ /// <returns></returns> List<SceneUI> GetALlDispalyRoomSceneList() { - currentKeyAllRoomSceneList.Clear(); - // 鑾峰彇鎵�鏈夋埧闂� + currentKeyAllRoomSceneList.Clear(); + // 鑾峰彇鎵�鏈夋埧闂� var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); foreach (var room in listAllRoom) { @@ -947,7 +947,7 @@ } foreach (var sceneId in room.ListSceneId) - { + { var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId); if (scene == null) { @@ -968,10 +968,10 @@ var tempSceneUIList = new List<SceneUI>(); foreach (var sceneId in curRoom.ListSceneId) { - var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId); - if (scene == null) - { - continue; + var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId); + if (scene == null) + { + continue; } var gwSc = gwCurScenesList.Find(obj => (obj.ScenesId == sceneId)); if (gwSc != null) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs index b22d780..4bc702c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Shared.Common; -using Shared.Phone.Device.Category; using Shared.Phone.UserCenter.Device; using ZigBee.Device; using static ZigBee.Device.Panel; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs index c141dc8..49d8a27 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs @@ -185,44 +185,44 @@ var frameIcon = new FrameLayout(); frameIcon.X = Application.GetRealWidth(228); frameIcon.Y = Application.GetRealHeight(121); - frameIcon.Width = Application.GetMinRealAverage(265); - frameIcon.Height= Application.GetMinRealAverage(495); + frameIcon.Width = this.GetPictrueRealSize(265); + frameIcon.Height= this.GetPictrueRealSize(495); frameIcon.BackgroundImagePath = "Item/DeviceLimitGround.png"; frameBack.AddChidren(frameIcon); - var frameIconback = new FrameLayoutControl(); - frameIconback.Height = Application.GetMinRealAverage(144); - frameIconback.Width = Application.GetMinRealAverage(144); - frameIconback.Radius = (uint)Application.GetMinRealAverage(144) / 2; + var frameIconback = new FrameLayoutStatuControl(); + frameIconback.Height = this.GetPictrueRealSize(144); + frameIconback.Width = this.GetPictrueRealSize(144); + frameIconback.Radius = (uint)this.GetPictrueRealSize(144) / 2; frameIconback.BackgroundColor = 0xffeff2fb; frameIconback.Gravity = Gravity.CenterHorizontal; - frameIconback.Y = Application.GetMinRealAverage(35); + frameIconback.Y = this.GetPictrueRealSize(35); frameIcon.AddChidren(frameIconback); - var btnIcon = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(35), false); + var btnIcon = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(35), false); btnIcon.UnSelectedImagePath = "Item/DownTriangle.png"; btnIcon.Gravity = Gravity.Center; frameIconback.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); - var frameText = new FrameLayoutControl(); - frameText.Y= Application.GetMinRealAverage(265); - frameText.Height = Application.GetMinRealAverage(120); + var frameText = new FrameLayoutStatuControl(); + frameText.Y= this.GetPictrueRealSize(265); + frameText.Height = this.GetPictrueRealSize(120); frameIcon.AddChidren(frameText); //纭畾 - var btnOk = new NormalViewControl(frameIcon.Width, Application.GetMinRealAverage(60), false); + var btnOk = new NormalViewControl(frameIcon.Width, this.GetPictrueRealSize(60), false); btnOk.TextID = R.MyInternationalizationString.uConfirm1; btnOk.TextAlignment = TextAlignment.Center; btnOk.TextColor = UserCenterColor.Current.TextOrangeColor; frameText.AddChidren(btnOk, ChidrenBindMode.BindEventOnly); //搴曠嚎 - var btnLine1 = new NormalViewControl(Application.GetMinRealAverage(100), ControlCommonResourse.BottomLineHeight, false); + var btnLine1 = new NormalViewControl(this.GetPictrueRealSize(100), ControlCommonResourse.BottomLineHeight, false); btnLine1.BackgroundColor = UserCenterColor.Current.TextOrangeColor; btnLine1.Gravity = Gravity.CenterHorizontal; - btnLine1.Y = btnOk.Bottom - Application.GetMinRealAverage(8); + btnLine1.Y = btnOk.Bottom - this.GetPictrueRealSize(8); frameText.AddChidren(btnLine1); //涓嬮檺浣� - var btnDown = new NormalViewControl(frameIcon.Width, Application.GetMinRealAverage(60), false); + var btnDown = new NormalViewControl(frameIcon.Width, this.GetPictrueRealSize(60), false); btnDown.TextID = R.MyInternationalizationString.uDownLimit; btnDown.Y = btnOk.Bottom; btnDown.TextAlignment = TextAlignment.Center; @@ -230,10 +230,10 @@ frameText.AddChidren(btnDown, ChidrenBindMode.BindEventOnly); //搴曠嚎 - var btnLine2 = new NormalViewControl(Application.GetMinRealAverage(124), ControlCommonResourse.BottomLineHeight, false); + var btnLine2 = new NormalViewControl(this.GetPictrueRealSize(124), ControlCommonResourse.BottomLineHeight, false); btnLine2.BackgroundColor = UserCenterColor.Current.TextOrangeColor; btnLine2.Gravity = Gravity.CenterHorizontal; - btnLine2.Y = btnDown.Bottom - Application.GetMinRealAverage(8); + btnLine2.Y = btnDown.Bottom - this.GetPictrueRealSize(8); frameText.AddChidren(btnLine2); //鍥炬爣鐐瑰嚮 @@ -294,44 +294,44 @@ var frameIcon = new FrameLayout(); frameIcon.X = Application.GetRealWidth(619); frameIcon.Y = Application.GetRealHeight(121); - frameIcon.Width = Application.GetMinRealAverage(265); - frameIcon.Height = Application.GetMinRealAverage(495); + frameIcon.Width = this.GetPictrueRealSize(265); + frameIcon.Height = this.GetPictrueRealSize(495); frameIcon.BackgroundImagePath = "Item/DeviceLimitGround.png"; frameBack.AddChidren(frameIcon); - var frameIconback = new FrameLayoutControl(); - frameIconback.Height = Application.GetMinRealAverage(144); - frameIconback.Width = Application.GetMinRealAverage(144); - frameIconback.Radius = (uint)Application.GetMinRealAverage(144) / 2; + var frameIconback = new FrameLayoutStatuControl(); + frameIconback.Height = this.GetPictrueRealSize(144); + frameIconback.Width = this.GetPictrueRealSize(144); + frameIconback.Radius = (uint)this.GetPictrueRealSize(144) / 2; frameIconback.BackgroundColor = 0xffeff2fb; frameIconback.Gravity = Gravity.CenterHorizontal; - frameIconback.Y = Application.GetMinRealAverage(35); + frameIconback.Y = this.GetPictrueRealSize(35); frameIcon.AddChidren(frameIconback); - var btnIcon = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(35), false); + var btnIcon = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(35), false); btnIcon.UnSelectedImagePath = "Item/UpTriangle.png"; btnIcon.Gravity = Gravity.Center; frameIconback.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); - var frameText = new FrameLayoutControl(); - frameText.Y = Application.GetMinRealAverage(265); - frameText.Height = Application.GetMinRealAverage(120); + var frameText = new FrameLayoutStatuControl(); + frameText.Y = this.GetPictrueRealSize(265); + frameText.Height = this.GetPictrueRealSize(120); frameIcon.AddChidren(frameText); //纭畾 - var btnOk = new NormalViewControl(frameIcon.Width, Application.GetMinRealAverage(60), false); + var btnOk = new NormalViewControl(frameIcon.Width, this.GetPictrueRealSize(60), false); btnOk.TextID = R.MyInternationalizationString.uConfirm1; btnOk.TextAlignment = TextAlignment.Center; btnOk.TextColor = UserCenterColor.Current.TextOrangeColor; frameText.AddChidren(btnOk, ChidrenBindMode.BindEventOnly); //搴曠嚎 - var btnLine1 = new NormalViewControl(Application.GetMinRealAverage(100), ControlCommonResourse.BottomLineHeight, false); + var btnLine1 = new NormalViewControl(this.GetPictrueRealSize(100), ControlCommonResourse.BottomLineHeight, false); btnLine1.BackgroundColor = UserCenterColor.Current.TextOrangeColor; btnLine1.Gravity = Gravity.CenterHorizontal; - btnLine1.Y = btnOk.Bottom - Application.GetMinRealAverage(8); + btnLine1.Y = btnOk.Bottom - this.GetPictrueRealSize(8); frameText.AddChidren(btnLine1); //涓婇檺浣� - var btnDown = new NormalViewControl(frameIcon.Width, Application.GetMinRealAverage(60), false); + var btnDown = new NormalViewControl(frameIcon.Width, this.GetPictrueRealSize(60), false); btnDown.TextID = R.MyInternationalizationString.uUpLimit; btnDown.Y = btnOk.Bottom; btnDown.TextAlignment = TextAlignment.Center; @@ -339,10 +339,10 @@ frameText.AddChidren(btnDown, ChidrenBindMode.BindEventOnly); //搴曠嚎 - var btnLine2 = new NormalViewControl(Application.GetMinRealAverage(124), ControlCommonResourse.BottomLineHeight, false); + var btnLine2 = new NormalViewControl(this.GetPictrueRealSize(124), ControlCommonResourse.BottomLineHeight, false); btnLine2.BackgroundColor = UserCenterColor.Current.TextOrangeColor; btnLine2.Gravity = Gravity.CenterHorizontal; - btnLine2.Y = btnDown.Bottom - Application.GetMinRealAverage(8); + btnLine2.Y = btnDown.Bottom - this.GetPictrueRealSize(8); frameText.AddChidren(btnLine2); //鍥炬爣鐐瑰嚮 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs index a6cb796..cf2a242 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs @@ -179,6 +179,8 @@ btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uMoreSettion); btnHelp.ButtonClickEvent += (sender, e) => { + //鏇存敼杩囦竴娆′箣鍚庯紝鍒欑晫闈㈠叧闂悗涓嶅啀鏇存敼 + this.saveDefultName = string.Empty; //鏀瑰悕瀛� btnNote.txtInput.FinishInputEvent(); @@ -235,6 +237,8 @@ detailBackFrame.AddChidren(btnFinish); btnFinish.MouseUpEventHandler += (sender, e) => { + //鏇存敼杩囦竴娆′箣鍚庯紝鍒欑晫闈㈠叧闂悗涓嶅啀鏇存敼 + this.saveDefultName = string.Empty; //鏀瑰悕瀛� btnNote.txtInput.FinishInputEvent(); //鍏抽棴鑷韩 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs old mode 100644 new mode 100755 index ea3f30e..bf36e95 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs @@ -87,12 +87,20 @@ //鍒濆鍖栨甯� this.tableContr = new InformationEditorControl(); - this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1128); - - //鍒濆鍖栬澶囧洖璺浘鏍� - this.InitDeviceEpointIcon(listBackControl); - - //淇濆瓨 + + if (this.deviceObj.Type == DeviceType.FreshAir) + { + this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028); + } + else + { + this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1128); + } + + //鍒濆鍖栬澶囧洖璺浘鏍� + this.InitDeviceEpointIcon(listBackControl); + + //淇濆瓨 var btnFinish = new BottomClickButton(); btnFinish.TextID = R.MyInternationalizationString.uSave; bodyFrameLayout.AddChidren(btnFinish); @@ -316,8 +324,8 @@ { strType = Language.StringByID(R.MyInternationalizationString.uSocket1); nowSelectNo = 2; - } - + } + var btnFunction = new FrameCaptionViewControl(caption, strType, listview.rowSpace / 2); btnFunction.UseClickStatu = false; listview.AddChidren(btnFunction); @@ -379,18 +387,18 @@ } //濡傛灉鏄柊椋� - if (nowSelectDevice.Type == DeviceType.FreshAir) - { - //鍔熻兘绫诲瀷 - string caption = Language.StringByID(R.MyInternationalizationString.uFunctionType); + if (nowSelectDevice.Type == DeviceType.FreshAir) + { + //鍔熻兘绫诲瀷 + string caption = Language.StringByID(R.MyInternationalizationString.uFunctionType); string strType = Language.StringByID(R.MyInternationalizationString.FreshAir); var btnFunction = new FrameCaptionViewControl(caption, strType, listview.rowSpace / 2); btnFunction.UseClickStatu = false; listview.AddChidren(btnFunction); btnFunction.InitControl(); //搴曠嚎 - btnFunction.AddBottomLine(); - } + btnFunction.AddBottomLine(); + } } #endregion @@ -428,7 +436,7 @@ else { //涓嶉渶瑕佹粦鍔ㄦ帶浠� - frameBorder.AddChidren(frameBack); + frameBorder.AddChidren(frameBack); } int index = 0; @@ -443,16 +451,19 @@ if (listIcon.Count == 1) { - frame.Gravity = Gravity.CenterVertical; - - //濡傛灉鏄柊椋� - if (deviceObj.Type == DeviceType.FreshAir) - { - frame.RemoveFromParent(); - frameBack.BackgroundImagePath = "FreshAir/FreshAirRealDevicePic.png"; - frameBack.Width = Application.GetMinRealAverage(878); - frameBack.Height = Application.GetMinRealAverage(354); - frameBack.Gravity = Gravity.Center; + frame.Gravity = Gravity.CenterVertical; + + //濡傛灉鏄柊椋� + if (deviceObj.Type == DeviceType.FreshAir) + { + frame.RemoveFromParent(); + frameBorder.Y = Application.GetRealHeight(0); + frameBorder.Height = Application.GetRealHeight(709); + frameBack.BackgroundImagePath = "FreshAir/FreshAirRealDevicePic.png"; + frameBack.Width = this.GetPictrueRealSize(878); + frameBack.Height = this.GetPictrueRealSize(354); + frameBack.Y = Application.GetRealHeight(153); + frameBack.Gravity = Gravity.Center; } } else @@ -466,15 +477,15 @@ //璁$畻鐪熷疄楂樺害 int realHeight = this.GetPictrueRealSize(58 + 58);//涓婁笅闂磋窛 realHeight += frameBack.ChildrenCount * this.GetPictrueRealSize(124);//鍦嗗湀楂樺害 - realHeight += (frameBack.ChildrenCount - 1) * this.GetPictrueRealSize(60);//鍦嗗湀闂磋窛 + realHeight += (frameBack.ChildrenCount-1) * this.GetPictrueRealSize(60);//鍦嗗湀闂磋窛 if (realHeight > frameBack.Height) { //鍙樻洿楂樺害 frameBack.Height = realHeight; } } - } - + } + /// <summary> /// 鍒濆鍖栦竴琛岃澶囧浘鏍� /// </summary> @@ -515,8 +526,6 @@ //鍒濆鍖栬彍鍗曡 this.DeviceEpointSelectEvent(btnTemp, null); } - - } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs old mode 100644 new mode 100755 index c20f9e1..4bd8639 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs @@ -59,20 +59,6 @@ btnAddDeviceIcon.InitControl(); btnAddDeviceIcon.ButtonClickEvent += (sender, e) => { - ZbGateway realWay = null; - if (GatewayResourse.NowSelectGateway == null || HdlGatewayLogic.Current.GetRealGateway(ref realWay, GatewayResourse.NowSelectGateway) == false) - { - //缃戝叧瀵硅薄寮傚父,璇烽噸鏂伴�夋嫨缃戝叧 - string msg = Language.StringByID(R.MyInternationalizationString.uGatewayIsErrorAndReSelect); - this.ShowMassage(ShowMsgType.Error, msg, () => - { - var form2 = new GatewayManage.GatewayListForm(); - form2.AddForm(); - }); - return; - } - GatewayResourse.NowSelectGateway = realWay; - var form = new DeviceDirection.AddDeviceTypeListForm(); form.AddForm(); }; @@ -92,8 +78,9 @@ this.ClearBodyFrame(); //鍒濆鍖栫綉鍏宠鎺т欢 - GatewayResourse.NowSelectGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId); - this.gatewayViewRow = new MyGatewayControl(GatewayResourse.NowSelectGateway); + GatewayResourse.NowSelectGatewayId = GatewayResourse.AppOldSelectGatewayId; + var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId); + this.gatewayViewRow = new MyGatewayControl(nowGateway); bodyFrameLayout.AddChidren(gatewayViewRow); gatewayViewRow.InitControl(); @@ -156,9 +143,8 @@ private void InitDeviceListControl() { //鑾峰彇璁惧鍒楄〃 - string gwID = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway); - var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(gwID); - var listSpecialOta = Common.LocalDevice.Current.GetSpecialOtaDevice(gwID); + var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(GatewayResourse.NowSelectGatewayId); + var listSpecialOta = Common.LocalDevice.Current.GetSpecialOtaDevice(GatewayResourse.NowSelectGatewayId); listDevice.AddRange(listSpecialOta); this.dicRowInfo.Clear(); @@ -190,11 +176,14 @@ //娣诲姞璁惧鐨勮彍鍗曡 this.AddDeviceMenuRow(macAddress); } - - //寮�鍚綉鍏冲湪绾跨洃娴嬬殑绾跨▼ - this.StartGatewayOnlieCheckThread(); - //妫�娴嬭澶囨柊鐗堟湰 - this.CheckDeviceNewVersion(listOta); + //濡傛灉褰撳墠涓嶆槸铏氭嫙浣忓畢 + if (Common.Config.Instance.Home.IsVirtually == false) + { + //寮�鍚綉鍏冲湪绾跨洃娴嬬殑绾跨▼ + this.StartGatewayOnlieCheckThread(); + //妫�娴嬭澶囨柊鐗堟湰 + this.CheckDeviceNewVersion(listOta); + } }); } @@ -384,8 +373,12 @@ rowDevice.HideMenu(); //鐣岄潰璺宠浆,璁板綍褰撳墠鐨勬鍦ㄦ搷浣滅殑璁惧鐨凪ac鍦板潃 this.nowActionDeviceMac = device.DeviceAddr; - //鏄剧ず璁惧鍔熻兘閰嶇疆鐣岄潰 - this.ShowDeviceFunctionSettionForm(device, deviceEnumInfo); + //濡傛灉褰撳墠浣忓畢涓嶆槸铏氭嫙浣忓畢 + if (Common.Config.Instance.Home.IsVirtually == false) + { + //鏄剧ず璁惧鍔熻兘閰嶇疆鐣岄潰 + this.ShowDeviceFunctionSettionForm(device, deviceEnumInfo); + } }; //宸︽粦鑿滃崟浜嬩欢 rowDevice.OpenMenuAction += () => @@ -446,19 +439,19 @@ } //鏂伴闈㈡澘 else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir) - { - //鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃� - //骞叉帴鐐� + { + //鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃� + //骞叉帴鐐� if (device.Type == DeviceType.FreshAir) { - var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm(); + var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm(); form.AddForm(device); - } - else - { + } + else + { var form = new DeviceFunctionSettionForm(); - form.AddForm(device, true); - } + form.AddForm(device, true); + } } //鏂规偊闈㈡澘 else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo @@ -600,12 +593,25 @@ /// </summary> private async void ListViewBeginHeaderRefreshing() { + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熺殑 + if (Common.Config.Instance.Home.IsVirtually == true) + { + //灏辨樉绀轰竴涓壒鏁堣�屽凡 + System.Threading.Thread.Sleep(2000); + HdlThreadLogic.Current.RunMain(() => + { + //闅愯棌涓嬫媺鍒锋柊鐗规晥 + listView.EndHeaderRefreshing(); + }); + return; + } //濡傛灉鏄湪绾跨殑 - if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(GatewayResourse.NowSelectGateway) == true) + var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.NowSelectGatewayId); + if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(nowGateway) == true) { //妫�娴嬪箍鎾埌鐨勮繖涓綉鍏虫槸鍚︽嫢鏈変綇瀹匢D ZbGateway realWay = null; - if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, GatewayResourse.NowSelectGateway) == true) + if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, nowGateway) == true) { //閲嶆柊璁剧疆浣忓畢ID(杩欎釜搴旇鏄笉缁忚繃APP,鐩存帴鎶婄綉鍏虫仮澶嶄簡鍑哄巶璁剧疆) if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.getGatewayBaseInfo.HomeId) == true) @@ -628,7 +634,7 @@ } //鑾峰彇鍏ㄩ儴璁惧 - int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(GatewayResourse.NowSelectGateway); + int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway); if (this.Parent == null) { return; @@ -654,12 +660,7 @@ /// </summary> private void StartGatewayOnlieCheckThread() { - if (GatewayResourse.NowSelectGateway == null) - { - return; - } - - string selectGwId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway); + string selectGwId = GatewayResourse.NowSelectGatewayId; HdlThreadLogic.Current.RunThread(() => { ZbGateway zbGateway = HdlGatewayLogic.Current.GetLocalGateway(selectGwId); @@ -731,7 +732,7 @@ private void StartCheckDeviceOnline() { //澶栭儴璋冪敤鐨勮瘽,涓嶅啀閲嶆柊鑾峰彇璁惧鐘舵�� - if (GatewayResourse.NowSelectGateway == null || this.reGetDeviceOnlineStatu == false) + if (this.reGetDeviceOnlineStatu == false) { return; } @@ -739,7 +740,7 @@ //娣诲姞鎺ユ敹璁惧鍦ㄧ嚎涓婃姤鐨勭洃鍚� HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceListFormReceivePushOnline", ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤, this.ReceiveDeviceStatu); - string gwId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway); + string gwId = GatewayResourse.NowSelectGatewayId; HdlThreadLogic.Current.RunThread(() => { //杩欓噷涓昏鍙槸鑾峰彇鍦ㄧ嚎鐘舵�� @@ -1026,8 +1027,6 @@ HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceListFormSensor"); HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceListFormReceivePushOnline"); - GatewayResourse.NowSelectGateway = null; - base.CloseFormBefore(); } @@ -1091,7 +1090,10 @@ public MyGatewayControl(ZbGateway i_zbGateway) { this.UseClickStatu = false; - this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway); + if (i_zbGateway != null) + { + this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway); + } this.BackgroundColor = UserCenterColor.Current.White; this.Height = Application.GetRealHeight(173); } @@ -1105,16 +1107,32 @@ ZbGateway zbway = HdlGatewayLogic.Current.GetLocalGateway(zbGatewayId); //鍥炬爣 var btnIcon = this.AddLeftIcon(81); - HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, zbway); + if (zbway != null) + { + HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, zbway); + } + else + { + btnIcon.UnSelectedImagePath = "Gateway/GatewayIcon1.png"; + } //鏄剧ず鏂囨湰 - btnName = this.AddLeftCaption(HdlGatewayLogic.Current.GetGatewayName(zbway), 700); + btnName = this.AddLeftCaption(string.Empty, 700); btnName.Height = Application.GetRealHeight(60); btnName.TextSize = 15; btnName.Y = Application.GetRealHeight(35); - if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway) == false) + if (zbway != null) { - btnName.TextColor = UserCenterColor.Current.TextGrayColor1; + btnName.Text = HdlGatewayLogic.Current.GetGatewayName(zbway); + if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway) == false) + { + btnName.TextColor = UserCenterColor.Current.TextGrayColor1; + } + } + else + { + //铏氭嫙缃戝叧 + btnName.Text = Language.StringByID(R.MyInternationalizationString.uVirtualGateway); } //褰撳墠缃戝叧 @@ -1131,15 +1149,19 @@ var btnMament = this.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uGatewayManagement), 300); btnMament.Name = "btnMament"; - this.ButtonClickEvent += (sernder, e) => + //褰撳墠涓嶆槸铏氭嫙浣忓畢鐨勮瘽 + if (Common.Config.Instance.Home.IsVirtually == false) { - if (string.IsNullOrEmpty(((View)sernder).Name) == false) + this.ButtonClickEvent += (sernder, e) => { - //鎵撳紑缃戝叧鍒楄〃鐣岄潰 - var form = new GatewayManage.GatewayListForm(); - form.AddForm(); - } - }; + if (string.IsNullOrEmpty(((View)sernder).Name) == false) + { + //鎵撳紑缃戝叧鍒楄〃鐣岄潰 + var form = new GatewayManage.GatewayListForm(); + form.AddForm(); + } + }; + } } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs old mode 100644 new mode 100755 index 4281bcb..e7b18cf --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -141,7 +141,7 @@ //閫夋嫨鏈垎閰嶆椂,娓呯┖ if (roomKeys == string.Empty) { listCheck = new List<string>(); } foreach (var device in this.listNewDevice) - { + { if (device is OTADevice) { //閽堝鍗曠函鍙湁涓�涓�200绔偣鐨勮澶� @@ -160,16 +160,16 @@ //杩欓噷鏈夌偣鐗规畩,濡傛灉鍥炶矾娌℃湁璁剧疆鏈夊尯鍩熺殑鏃跺��,鎵嶈缃� listCheck.Add(mainKeys); HdlRoomLogic.Current.ChangedRoom(device, roomKeys); - } - else if (this.deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir - && device.Type == DeviceType.FreshAir) - { - //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欏尯鍩熻窡鐫�妯″潡涓�璧� - HdlRoomLogic.Current.ChangedRoom(device, roomKeys); + } + else if (this.deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir + && device.Type == DeviceType.FreshAir) + { + //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欏尯鍩熻窡鐫�妯″潡涓�璧� + HdlRoomLogic.Current.ChangedRoom(device, roomKeys); } else if (listCheck.Contains(mainKeys) == true) - { - //濡傛灉杩欎釜鍥炶矾涔嬪墠閮借繕娌℃湁鍖哄煙,鍦ㄦ湰鐣岄潰杩樻病鏈夊叧闂箣鍓�,鍙互鏃犳潯浠堕殢渚垮彉鏇� + { + //濡傛灉杩欎釜鍥炶矾涔嬪墠閮借繕娌℃湁鍖哄煙,鍦ㄦ湰鐣岄潰杩樻病鏈夊叧闂箣鍓�,鍙互鏃犳潯浠堕殢渚垮彉鏇� HdlRoomLogic.Current.ChangedRoom(device, roomKeys); } } @@ -206,6 +206,19 @@ this.CloseForm(); } }; + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹呯殑璇�,璁╂墍鏈夎彍鍗曢兘涓嶈兘鐐瑰嚮 + if (Common.Config.Instance.Home.IsVirtually == true) + { + for (int i = 0; i < listview.ChildrenCount; i++) + { + var myRow = listview.GetChildren(i) as FrameRowControl; + if (myRow != null) + { + myRow.UseClickStatu = false; + myRow.CanClick = false; + } + } + } } #endregion @@ -251,8 +264,8 @@ //娣诲姞銆愭寜閿缃�戣(闈㈡澘涓撶敤) this.AddPanelSettionRow(); } - - if (this.IsFangyueFreshaAirPanel() == false) + //妫�娴嬭兘鍚︽樉绀哄姛鑳借缃殑鑿滃崟 + if (this.CheckCanShowFunctionSettionRow() == true) { //娣诲姞銆愬姛鑳借缃�戣 this.AddFunctionSettionRow(); @@ -376,6 +389,11 @@ if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword) == false) { btnswitch.IsSelected = true; + } + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹呯殑璇�,璁╂墍鏈夎彍鍗曢兘涓嶈兘鐐瑰嚮 + if (Common.Config.Instance.Home.IsVirtually == true) + { + btnswitch.CanClick = false; } btnswitch.ButtonClickEvent += async (sender, e) => @@ -558,22 +576,6 @@ #endregion - #region 鈻� 鎸夐敭璁剧疆(鏂规偊)_____________________ - - /// <summary> - /// 鏄惁鏄柟鎮︽柊椋庨潰鏉� - /// </summary> - private bool IsFangyueFreshaAirPanel() - { - if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir) - { - return true; - } - return false; - } - - #endregion - #region 鈻� 骞叉帴鐐硅缃�(骞叉帴鐐�)_________________ /// <summary> @@ -582,8 +584,8 @@ private void AddDryContactSettionRow() { if (this.listDeviceType.Contains(DeviceType.OnOffSwitch) == false) - { - //蹇呴』鏈変竴璺洖璺槸OnOffSwitch鎵嶈,闈㈡澘鐨勫共鎺ョ偣鐨勮瘽锛屼娇鐢ㄧ殑鏄埆鐨勮彍鍗� + { + //蹇呴』鏈変竴璺洖璺槸OnOffSwitch鎵嶈,闈㈡澘鐨勫共鎺ョ偣鐨勮瘽锛屼娇鐢ㄧ殑鏄埆鐨勮彍鍗� return; } if (deviceEnumInfo.IsHdlDevice == true && deviceEnumInfo.BeloneType == DeviceBeloneType.A鎸夐敭闈㈡澘) @@ -679,12 +681,12 @@ { //鍙湁鍥炶矾鏁板ぇ浜�1鎵嶈兘鏈夎繖涓彍鍗� if (Common.LocalDevice.Current.GetDevicesCountByMac(listNewDevice[0].DeviceAddr) == 1) - { - //瑕佹眰鏂伴灏忔ā鍧楃殑鏂伴鏈夊姛鑳借缃� - if (deviceEnumInfo.ConcreteType != DeviceConcreteType.Relay_FangyueFreshAirModul) - { - return; - } + { + //瑕佹眰鏂伴灏忔ā鍧楃殑鏂伴鏈夊姛鑳借缃� + if (deviceEnumInfo.ConcreteType != DeviceConcreteType.Relay_FangyueFreshAirModul) + { + return; + } } if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir) @@ -813,6 +815,11 @@ btnFunction.AddLeftCaption(caption, 600); //寮�鍏冲浘鏍� var btnSwitch = btnFunction.AddMostRightSwitchIcon(); + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹呯殑璇�,璁╂墍鏈夎彍鍗曢兘涓嶈兘鐐瑰嚮 + if (Common.Config.Instance.Home.IsVirtually == true) + { + btnSwitch.CanClick = false; + } //搴曠嚎 btnFunction.AddBottomLine(); btnSwitch.ButtonClickEvent += async (sender, e) => @@ -899,103 +906,12 @@ //涓嶆槸绌烘皵寮�鍏� return; } - - //鍔熻兘绫诲瀷 - string caption = Language.StringByID(R.MyInternationalizationString.uFunctionType); - var DfunctionType = this.listNewDevice[0].DfunctionType; - - //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛� - int nowSelectNo = 1; - string strType = string.Empty; - if (DfunctionType == DeviceFunctionType.A鐏厜) - { - strType = Language.StringByID(R.MyInternationalizationString.uLight); - nowSelectNo = 1; - } - else if (DfunctionType == DeviceFunctionType.A寮�鍏�) - { - strType = Language.StringByID(R.MyInternationalizationString.uSwitch); - nowSelectNo = 0; - } - else if (DfunctionType == DeviceFunctionType.A鎻掑骇) - { - strType = Language.StringByID(R.MyInternationalizationString.uSocket1); - nowSelectNo = 2; - } - - var btnFunction = new FrameCaptionViewControl(caption, strType, listview.rowSpace / 2); - btnFunction.UseClickStatu = true; - listview.AddChidren(btnFunction); - btnFunction.InitControl(); + //鑷畾涔夊姛鑳界被鍨嬫帶浠� + var rowFunction = new DeviceFunctionTypeRowControl(this.listNewDevice[0], listview.rowSpace / 2); + listview.AddChidren(rowFunction); + rowFunction.InitControl(); //搴曠嚎 - btnFunction.AddBottomLine(); - //鍙崇澶� - btnFunction.AddRightArrow(); - btnFunction.ButtonClickEvent += (sender, e) => - { - //鏄剧ず鍒楄〃 - var listText = new List<string>(); - listText.Add(Language.StringByID(R.MyInternationalizationString.uSwitch));//寮�鍏� - listText.Add(Language.StringByID(R.MyInternationalizationString.uLight));//鐏厜 - listText.Add(Language.StringByID(R.MyInternationalizationString.uSocket1));//鎻掑骇 - //鏍囬:閫夋嫨鍔熻兘绫诲瀷 - var title = Language.StringByID(R.MyInternationalizationString.uSelectFunctionType); - - var form = new BottomItemSelectForm(); - form.CancelCallEvent = true;//鍏佽鍙栨秷 - form.AddForm(title, listText, nowSelectNo); - form.FinishSelectEvent += (selectNo) => - { - if (selectNo == -1) - { - //閫夋嫨鍙栨秷 - btnFunction.Text = string.Empty; - } - else - { - btnFunction.Text = listText[selectNo]; - } - nowSelectNo = selectNo; - //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨� - if (selectNo == 0) - { - this.listNewDevice[0].DfunctionType = DeviceFunctionType.A寮�鍏�; - if (this.listNewDevice[0].IsCustomizeImage == false) - { - //閲嶆柊璁剧疆鍥剧墖 - this.listNewDevice[0].IconPath = "Device/Switch.png"; - } - } - else if (selectNo == 1) - { - this.listNewDevice[0].DfunctionType = DeviceFunctionType.A鐏厜; - if (this.listNewDevice[0].IsCustomizeImage == false) - { - //閲嶆柊璁剧疆鍥剧墖 - this.listNewDevice[0].IconPath = "Device/Light.png"; - } - } - else if (selectNo == 2) - { - this.listNewDevice[0].DfunctionType = DeviceFunctionType.A鎻掑骇; - if (this.listNewDevice[0].IsCustomizeImage == false) - { - //閲嶆柊璁剧疆鍥剧墖 - this.listNewDevice[0].IconPath = "Device/Socket1.png"; - } - } - else - { - this.listNewDevice[0].DfunctionType = DeviceFunctionType.A鏈畾涔�; - if (this.listNewDevice[0].IsCustomizeImage == false) - { - //閲嶆柊璁剧疆鍥剧墖 - this.listNewDevice[0].IconPath = "Device/Switch.png"; - } - } - this.listNewDevice[0].ReSave(); - }; - }; + rowFunction.AddBottomLine(); } #endregion @@ -1101,8 +1017,12 @@ btnNewVersion.Visible = false; }; - //璁剧疆璁惧鐨勭増鏈俊鎭� - this.SetDeviceVersionInfo(btnNewVersion, oTADevice); + //濡傛灉褰撳墠浣忓畢涓嶆槸铏氭嫙浣忓畢 + if (Common.Config.Instance.Home.IsVirtually == false) + { + //璁剧疆璁惧鐨勭増鏈俊鎭� + this.SetDeviceVersionInfo(btnNewVersion, oTADevice); + } } /// <summary> @@ -1163,15 +1083,9 @@ /// <param name="i_deviceName">deviceName.</param> private async void DeviceReName(string i_deviceName, bool closeForm) { - //寮�鍚繘搴︽潯 - this.ShowProgressBar(); - //淇敼MAC鍚� string deviceName = i_deviceName.Trim(); var result = await Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName); - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); - if (result == false) { return; @@ -1215,8 +1129,8 @@ private void ShowTopRightMenu() { //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘(鎷跨鐐规渶灏忕殑閭d釜鍥炶矾鍘诲畾浣�) - bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]); - + bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]); + var frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1); string deviceMenu = string.Empty; if (canTest == true) @@ -1234,6 +1148,11 @@ deviceMenu = Language.StringByID(R.MyInternationalizationString.uDelete); frame.AddRowMenu(deviceMenu, "Item/DeleteIcon2.png", "Item/DeleteIcon2Selected.png", () => { + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //纭鍒犻櫎璇ヨ澶囧強鍔熻兘锛� string msg = Language.StringByID(R.MyInternationalizationString.uDeleteDeviceMsg); this.ShowMassage(ShowMsgType.Confirm, msg, () => @@ -1364,6 +1283,22 @@ }); } + /// <summary> + /// 妫�娴嬭兘鍚︽樉绀哄姛鑳借缃殑鑿滃崟 + /// </summary> + /// <returns></returns> + private bool CheckCanShowFunctionSettionRow() + { + //鏂规偊鏂伴闈㈡澘娌℃湁鍔熻兘璁剧疆 + if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir + || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FourButtonScene + || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_TwoButtonCurtain) + { + return false; + } + return true; + } + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs index 4102a31..e0ea8f3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs @@ -80,7 +80,7 @@ //璁剧疆鏍囬淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - this.gatewayId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway); + this.gatewayId = GatewayResourse.NowSelectGatewayId; HdlGatewayLogic.Current.GetRealGateway(ref this.realGateway, this.gatewayId); //鍒濆鍖栦腑閮ㄦ帶浠� @@ -97,7 +97,7 @@ //鍥剧墖 var btnPic = new PicViewControl(878, 478); - btnPic.Y = Application.GetMinRealAverage(251); + btnPic.Y = Application.GetRealHeight(251); btnPic.Gravity = Gravity.CenterHorizontal; btnPic.UnSelectedImagePath = "Instruct/DeviceSearch.png"; bodyFrameLayout.AddChidren(btnPic); @@ -142,11 +142,13 @@ btnProgressView.Text = "0%"; frameProgress.AddChidren(btnProgressView); - //鍏佽璁惧鍏ョ綉 - this.StartDeviceCanAddToGateway(false); - - //娣诲姞鐩戣璁惧鏂颁笂鎶ョ殑浜嬩欢 - this.realGateway.GwResDataAction += this.AdjustGatewayResultData; + if (this.realGateway != null) + { + //鍏佽璁惧鍏ョ綉 + this.StartDeviceCanAddToGateway(false); + //娣诲姞鐩戣璁惧鏂颁笂鎶ョ殑浜嬩欢 + this.realGateway.GwResDataAction += this.AdjustGatewayResultData; + } //寮�鍚繛鎺ョ殑鍋囨兂鍔ㄧ敾鏁堟灉绾跨▼ this.StartConcetionAnimeteThread(); } @@ -312,20 +314,20 @@ /// </summary> private void StartConcetionAnimeteThread() { - int iconSize = Application.GetMinRealAverage(23); + int iconSize = this.GetPictrueRealSize(23); var listPoint = new List<int>(); for (int i = 0; i < 9; i++) { //X杞�+Index*(鍥炬爣澶у皬+闂磋窛) - listPoint.Add(Application.GetMinRealAverage(394) + i * (iconSize + Application.GetMinRealAverage(10))); + listPoint.Add(this.GetPictrueRealSize(394) + i * (iconSize + this.GetPictrueRealSize(10))); } var btnRound = new PicViewControl(iconSize, iconSize, false); btnRound.Radius = (uint)iconSize / 2; btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor; btnRound.X = listPoint[0]; - btnRound.Y = Application.GetMinRealAverage(475); + btnRound.Y = this.GetPictrueRealSize(475); bodyFrameLayout.AddChidren(btnRound); HdlThreadLogic.Current.RunThread(() => @@ -571,15 +573,18 @@ /// </summary> public override void CloseFormBefore() { - //鍋滄鎺ユ敹 - this.realGateway.GwResDataAction -= this.AdjustGatewayResultData; - - HdlThreadLogic.Current.RunThread(() => + if (this.realGateway != null) { - System.Threading.Thread.Sleep(1200); - //鍏抽棴鍏ョ綉妯″紡 - this.realGateway.AddNewDeviceToGateway(0); - }); + //鍋滄鎺ユ敹 + this.realGateway.GwResDataAction -= this.AdjustGatewayResultData; + + HdlThreadLogic.Current.RunThread(() => + { + System.Threading.Thread.Sleep(1200); + //鍏抽棴鍏ョ綉妯″紡 + this.realGateway.AddNewDeviceToGateway(0); + }); + } base.CloseFormBefore(); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirConditionerZbGatewayDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirConditionerZbGatewayDirectionForm.cs index 046fa30..56fc6ad 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirConditionerZbGatewayDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirConditionerZbGatewayDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(893); - framePic.Height = Application.GetMinRealAverage(852); + framePic.Width = this.GetPictrueRealSize(893); + framePic.Height = this.GetPictrueRealSize(852); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(75); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(475), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(415); - btnGreanLinght.Y = Application.GetMinRealAverage(272); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(475), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(415); + btnGreanLinght.Y = this.GetPictrueRealSize(272); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(573); - btnSecond.Y = Application.GetMinRealAverage(718); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(573); + btnSecond.Y = this.GetPictrueRealSize(718); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirSwitchCloudContrDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirSwitchCloudContrDirectionForm.cs index 2c2f206..eaf94e5 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirSwitchCloudContrDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AirSwitchCloudContrDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(858); - framePic.Height = Application.GetMinRealAverage(850); + framePic.Width = this.GetPictrueRealSize(858); + framePic.Height = this.GetPictrueRealSize(850); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(58); bodyFrameLayout.AddChidren(framePic); @@ -40,36 +40,36 @@ framePic.AddChidren(btnPic); //鎸囩ず鐏� - var btnLinght = new NormalViewControl(Application.GetMinRealAverage(100), Application.GetMinRealAverage(40), false); - btnLinght.X = Application.GetMinRealAverage(487); - btnLinght.Y = Application.GetMinRealAverage(202); + var btnLinght = new NormalViewControl(this.GetPictrueRealSize(100), this.GetPictrueRealSize(40), false); + btnLinght.X = this.GetPictrueRealSize(487); + btnLinght.Y = this.GetPictrueRealSize(202); btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnLinght.TextSize = 8.45f; btnLinght.TextID = R.MyInternationalizationString.uPilotLamp; framePic.AddChidren(btnLinght); //宸ヤ綔 - var btnWork = new NormalViewControl(Application.GetMinRealAverage(70), Application.GetMinRealAverage(40), false); - btnWork.X = Application.GetMinRealAverage(628); - btnWork.Y = Application.GetMinRealAverage(113); + var btnWork = new NormalViewControl(this.GetPictrueRealSize(70), this.GetPictrueRealSize(40), false); + btnWork.X = this.GetPictrueRealSize(628); + btnWork.Y = this.GetPictrueRealSize(113); btnWork.TextColor = UserCenterColor.Current.TextGrayColor3; btnWork.TextSize = 8.45f; btnWork.TextID = R.MyInternationalizationString.uWork; framePic.AddChidren(btnWork); //閰嶅 - var btnPair = new NormalViewControl(Application.GetMinRealAverage(70), Application.GetMinRealAverage(40), false); - btnPair.X = Application.GetMinRealAverage(628); - btnPair.Y = Application.GetMinRealAverage(217); + var btnPair = new NormalViewControl(this.GetPictrueRealSize(70), this.GetPictrueRealSize(40), false); + btnPair.X = this.GetPictrueRealSize(628); + btnPair.Y = this.GetPictrueRealSize(217); btnPair.TextColor = UserCenterColor.Current.TextGrayColor3; btnPair.TextSize = 8.45f; btnPair.TextID = R.MyInternationalizationString.uPair; framePic.AddChidren(btnPair); //绾㈣壊鎸囩ず鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(397); - btnGreanLinght.Y = Application.GetMinRealAverage(295); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(397); + btnGreanLinght.Y = this.GetPictrueRealSize(295); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainAutoOpenDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainAutoOpenDirectionForm.cs index 5dae3ab..17285b3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainAutoOpenDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainAutoOpenDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(873); - framePic.Height = Application.GetMinRealAverage(665); + framePic.Width = this.GetPictrueRealSize(873); + framePic.Height = this.GetPictrueRealSize(665); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(144); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏紦鎱㈤棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(449), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(420); - btnGreanLinght.Y = Application.GetMinRealAverage(343); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(449), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(420); + btnGreanLinght.Y = this.GetPictrueRealSize(343); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 9; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(478); - btnSecond.Y = Application.GetMinRealAverage(568); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(478); + btnSecond.Y = this.GetPictrueRealSize(568); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 9; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainSiphonateDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainSiphonateDirectionForm.cs index 6187bf4..971a3ec 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainSiphonateDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/CurtainSiphonateDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(887); - framePic.Height = Application.GetMinRealAverage(769); + framePic.Width = this.GetPictrueRealSize(887); + framePic.Height = this.GetPictrueRealSize(769); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(89); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(501), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(383); - btnGreanLinght.Y = Application.GetMinRealAverage(372); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(501), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(383); + btnGreanLinght.Y = this.GetPictrueRealSize(372); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 9; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(547); - btnSecond.Y = Application.GetMinRealAverage(583); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(547); + btnSecond.Y = this.GetPictrueRealSize(583); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 9; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/DimmableLightOneLoadDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/DimmableLightOneLoadDirectionForm.cs index adb0a07..d16048c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/DimmableLightOneLoadDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/DimmableLightOneLoadDirectionForm.cs @@ -11,38 +11,38 @@ { #region 鈻� 鍒濆鍖朹____________________________ - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() - { - //鍥剧墖 - var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(873); - framePic.Height = Application.GetMinRealAverage(665); - framePic.Gravity = Gravity.CenterHorizontal; - framePic.Y = Application.GetRealHeight(144); - bodyFrameLayout.AddChidren(framePic); - var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); - btnPic.UnSelectedImagePath = "Instruct/DimmableLightOneLoad.png"; + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鍥剧墖 + var framePic = new FrameLayout(); + framePic.Width = this.GetPictrueRealSize(873); + framePic.Height = this.GetPictrueRealSize(665); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Y = Application.GetRealHeight(144); + bodyFrameLayout.AddChidren(framePic); + var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); + btnPic.UnSelectedImagePath = "Instruct/DimmableLightOneLoad.png"; framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(442); - btnGreanLinght.Y = Application.GetMinRealAverage(368); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(442); + btnGreanLinght.Y = this.GetPictrueRealSize(368); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //鎸囩ず鐏� - var btnLinght = new NormalViewControl(Application.GetMinRealAverage(250), Application.GetMinRealAverage(45), false); - btnLinght.X = Application.GetMinRealAverage(340); - btnLinght.Y = Application.GetMinRealAverage(514); + var btnLinght = new NormalViewControl(this.GetPictrueRealSize(250), this.GetPictrueRealSize(45), false); + btnLinght.X = this.GetPictrueRealSize(340); + btnLinght.Y = this.GetPictrueRealSize(514); btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnLinght.TextSize = 10; btnLinght.TextID = R.MyInternationalizationString.uPilotLamp; @@ -64,9 +64,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(518); - btnSecond.Y = Application.GetMinRealAverage(545); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(518); + btnSecond.Y = this.GetPictrueRealSize(545); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; @@ -79,8 +79,8 @@ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg1.Y = Application.GetRealHeight(1037); msg1.Text = msgArry[0]; - msg1.TextColor = UserCenterColor.Current.TextGrayColor3; - msg1.TextAlignment = TextAlignment.Center; + msg1.TextColor = UserCenterColor.Current.TextGrayColor3; + msg1.TextAlignment = TextAlignment.Center; bodyFrameLayout.AddChidren(msg1); var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg2.Y = msg1.Bottom; @@ -88,9 +88,9 @@ { msg2.Text = msgArry[1]; } - msg2.TextColor = UserCenterColor.Current.TextGrayColor3; - msg2.TextAlignment = TextAlignment.Center; - bodyFrameLayout.AddChidren(msg2); + msg2.TextColor = UserCenterColor.Current.TextGrayColor3; + msg2.TextAlignment = TextAlignment.Center; + bodyFrameLayout.AddChidren(msg2); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs index dd721fa..5617e35 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelCurtainDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(115); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸夐敭鎸囩ず鐏寒璧� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(463), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(372); - btnGreanLinght.Y = Application.GetMinRealAverage(258); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(463), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(372); + btnGreanLinght.Y = this.GetPictrueRealSize(258); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //鎸変綇姝ゆ寜閿� - var btnPress = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnPress.X = Application.GetMinRealAverage(144); - btnPress.Y = Application.GetMinRealAverage(275); + var btnPress = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnPress.X = this.GetPictrueRealSize(144); + btnPress.Y = this.GetPictrueRealSize(275); btnPress.TextColor = UserCenterColor.Current.TextGrayColor3; btnPress.TextSize = 10; btnPress.TextID = R.MyInternationalizationString.uPressAndHoldThisKey; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEightButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEightButtonDirectionForm.cs index 123f6ed..c57c089 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEightButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEightButtonDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(115); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸夐敭鎸囩ず鐏寒璧� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(374); - btnGreanLinght.Y = Application.GetMinRealAverage(258); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(374); + btnGreanLinght.Y = this.GetPictrueRealSize(258); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //鎸変綇姝ゆ寜閿� - var btnPress = new NormalViewControl(Application.GetMinRealAverage(230), Application.GetMinRealAverage(45), false); - btnPress.X = Application.GetMinRealAverage(144); - btnPress.Y = Application.GetMinRealAverage(275); + var btnPress = new NormalViewControl(this.GetPictrueRealSize(230), this.GetPictrueRealSize(45), false); + btnPress.X = this.GetPictrueRealSize(144); + btnPress.Y = this.GetPictrueRealSize(275); btnPress.TextColor = UserCenterColor.Current.TextGrayColor3; btnPress.TextSize = 10; btnPress.TextID = R.MyInternationalizationString.uPressAndHoldThisKey; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEnvironmentDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEnvironmentDirectionForm.cs index 0cda559..d49c5b9 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEnvironmentDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueEnvironmentDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(708); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(708); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(115); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸夐敭鎸囩ず鐏寒璧� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(374); - btnGreanLinght.Y = Application.GetMinRealAverage(319); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(374); + btnGreanLinght.Y = this.GetPictrueRealSize(319); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //鎸変綇姝ゆ寜閿� - var btnPress = new NormalViewControl(Application.GetMinRealAverage(230), Application.GetMinRealAverage(45), false); - btnPress.X = Application.GetMinRealAverage(409); - btnPress.Y = Application.GetMinRealAverage(584); + var btnPress = new NormalViewControl(this.GetPictrueRealSize(230), this.GetPictrueRealSize(45), false); + btnPress.X = this.GetPictrueRealSize(409); + btnPress.Y = this.GetPictrueRealSize(584); btnPress.TextColor = UserCenterColor.Current.TextGrayColor3; btnPress.TextSize = 10; btnPress.TextID = R.MyInternationalizationString.uKeyIndicatorLightsUp; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFourButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFourButtonDirectionForm.cs index 823a184..a08100b 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFourButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFourButtonDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(115); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸夐敭鎸囩ず鐏寒璧� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(374); - btnGreanLinght.Y = Application.GetMinRealAverage(258); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(374); + btnGreanLinght.Y = this.GetPictrueRealSize(258); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //鎸変綇姝ゆ寜閿� - var btnPress = new NormalViewControl(Application.GetMinRealAverage(230), Application.GetMinRealAverage(45), false); - btnPress.X = Application.GetMinRealAverage(144); - btnPress.Y = Application.GetMinRealAverage(275); + var btnPress = new NormalViewControl(this.GetPictrueRealSize(230), this.GetPictrueRealSize(45), false); + btnPress.X = this.GetPictrueRealSize(144); + btnPress.Y = this.GetPictrueRealSize(275); btnPress.TextColor = UserCenterColor.Current.TextGrayColor3; btnPress.TextSize = 10; btnPress.TextID = R.MyInternationalizationString.uPressAndHoldThisKey; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs index 4470e76..3c20826 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirDirectionForm.cs @@ -3,7 +3,7 @@ { public class PanelFangyueFreshAirDirectionForm : DirectionCommonForm { - #region 鈻� 鍒濆鍖朹____________________________ + #region 鈻� 鍒濆鍖朹____________________________ /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) @@ -24,49 +24,49 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(144); bodyFrameLayout.AddChidren(framePic); var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); btnPic.UnSelectedImagePath = "Instruct/PanelFreshAir.png"; - framePic.AddChidren(btnPic); - - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(374); - btnGreanLinght.Y = Application.GetMinRealAverage(319); - btnGreanLinght.TextAlignment = TextAlignment.Center; - btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; - btnGreanLinght.TextSize = 10; - btnGreanLinght.TextID = R.MyInternationalizationString.uKeyIndicatorLightsUp; + framePic.AddChidren(btnPic); + + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(374); + btnGreanLinght.Y = this.GetPictrueRealSize(319); + btnGreanLinght.TextAlignment = TextAlignment.Center; + btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; + btnGreanLinght.TextSize = 10; + btnGreanLinght.TextID = R.MyInternationalizationString.uKeyIndicatorLightsUp; framePic.AddChidren(btnGreanLinght); //鎸変綇姝ゆ寜閿� - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(441); - btnSecond.Y = Application.GetMinRealAverage(583); - btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; - btnSecond.TextSize = 10; - btnSecond.TextID = R.MyInternationalizationString.uPressAndHoldThisKey; - framePic.AddChidren(btnSecond); - - //闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑� - //杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 - string[] msgArry = Language.StringByID(R.MyInternationalizationString.AddFreshAirPanelMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); - - var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); - msg1.Y = Application.GetRealHeight(1037); - msg1.Text = msgArry[0]; + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(441); + btnSecond.Y = this.GetPictrueRealSize(583); + btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; + btnSecond.TextSize = 10; + btnSecond.TextID = R.MyInternationalizationString.uPressAndHoldThisKey; + framePic.AddChidren(btnSecond); + + //闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑� + //杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 + string[] msgArry = Language.StringByID(R.MyInternationalizationString.AddFreshAirPanelMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); + + var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); + msg1.Y = Application.GetRealHeight(1037); + msg1.Text = msgArry[0]; msg1.TextColor = UserCenterColor.Current.TextGrayColor3; msg1.TextAlignment = TextAlignment.Center; - bodyFrameLayout.AddChidren(msg1); - var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); - msg2.Y = msg1.Bottom; - if (msgArry.Length > 1) - { - msg2.Text = msgArry[1]; - } + bodyFrameLayout.AddChidren(msg1); + var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); + msg2.Y = msg1.Bottom; + if (msgArry.Length > 1) + { + msg2.Text = msgArry[1]; + } msg2.TextColor = UserCenterColor.Current.TextGrayColor3; msg2.TextAlignment = TextAlignment.Center; bodyFrameLayout.AddChidren(msg2); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs index 5fe1158..1fb635c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueFreshAirModulDirectionForm.cs @@ -1,54 +1,54 @@ -锘縰sing System; -using Shared.Phone.UserCenter.DeviceDirection; - -namespace Shared.Phone.UserCenter.DeviceDirection -{ - public class PanelFangyueFreshAirModulDirectionForm : DirectionCommonForm - { +锘縰sing System; +using Shared.Phone.UserCenter.DeviceDirection; + +namespace Shared.Phone.UserCenter.DeviceDirection +{ + public class PanelFangyueFreshAirModulDirectionForm : DirectionCommonForm + { #region 鈻� 鍒濆鍖朹____________________________ - - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() - { - //鍥剧墖 - var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(873); - framePic.Height = Application.GetMinRealAverage(665); - framePic.Gravity = Gravity.CenterHorizontal; - framePic.Y = Application.GetRealHeight(144); - bodyFrameLayout.AddChidren(framePic); - var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); - btnPic.UnSelectedImagePath = "Instruct/RelayThreeLoad.png"; + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鍥剧墖 + var framePic = new FrameLayout(); + framePic.Width = this.GetPictrueRealSize(873); + framePic.Height = this.GetPictrueRealSize(665); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Y = Application.GetRealHeight(144); + bodyFrameLayout.AddChidren(framePic); + var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); + btnPic.UnSelectedImagePath = "Instruct/RelayThreeLoad.png"; framePic.AddChidren(btnPic); - //缁胯壊鎸囩ず鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(442); - btnGreanLinght.Y = Application.GetMinRealAverage(368); + //缁胯壊鎸囩ず鐏棯鐑� + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(442); + btnGreanLinght.Y = this.GetPictrueRealSize(368); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; btnGreanLinght.TextID = R.MyInternationalizationString.GreenLightLighting; framePic.AddChidren(btnGreanLinght); - //鎸囩ず鐏� - var btnLinght = new NormalViewControl(Application.GetMinRealAverage(250), Application.GetMinRealAverage(45), false); - btnLinght.X = Application.GetMinRealAverage(340); - btnLinght.Y = Application.GetMinRealAverage(514); + //鎸囩ず鐏� + var btnLinght = new NormalViewControl(this.GetPictrueRealSize(250), this.GetPictrueRealSize(45), false); + btnLinght.X = this.GetPictrueRealSize(340); + btnLinght.Y = this.GetPictrueRealSize(514); btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnLinght.TextSize = 10; btnLinght.TextID = R.MyInternationalizationString.uPilotLamp; @@ -59,10 +59,10 @@ if (textMsg.Contains("{0}") == true) { textMsg = string.Format(textMsg, "5"); - } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(518); - btnSecond.Y = Application.GetMinRealAverage(545); + } + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(518); + btnSecond.Y = this.GetPictrueRealSize(545); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; @@ -75,8 +75,8 @@ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg1.Y = Application.GetRealHeight(1037); msg1.Text = msgArry[0]; - msg1.TextColor = UserCenterColor.Current.TextGrayColor3; - msg1.TextAlignment = TextAlignment.Center; + msg1.TextColor = UserCenterColor.Current.TextGrayColor3; + msg1.TextAlignment = TextAlignment.Center; bodyFrameLayout.AddChidren(msg1); var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg2.Y = msg1.Bottom; @@ -84,10 +84,10 @@ { msg2.Text = msgArry[1]; } - msg2.TextColor = UserCenterColor.Current.TextGrayColor3; - msg2.TextAlignment = TextAlignment.Center; - bodyFrameLayout.AddChidren(msg2); - } - #endregion - } -} + msg2.TextColor = UserCenterColor.Current.TextGrayColor3; + msg2.TextAlignment = TextAlignment.Center; + bodyFrameLayout.AddChidren(msg2); + } + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueTwoButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueTwoButtonDirectionForm.cs index ef36eeb..c34dadd 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueTwoButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFangyueTwoButtonDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(115); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸夐敭鎸囩ず鐏寒璧� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(374); - btnGreanLinght.Y = Application.GetMinRealAverage(258); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(374); + btnGreanLinght.Y = this.GetPictrueRealSize(258); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //鎸変綇姝ゆ寜閿� - var btnPress = new NormalViewControl(Application.GetMinRealAverage(230), Application.GetMinRealAverage(45), false); - btnPress.X = Application.GetMinRealAverage(144); - btnPress.Y = Application.GetMinRealAverage(279); + var btnPress = new NormalViewControl(this.GetPictrueRealSize(230), this.GetPictrueRealSize(45), false); + btnPress.X = this.GetPictrueRealSize(144); + btnPress.Y = this.GetPictrueRealSize(279); btnPress.TextColor = UserCenterColor.Current.TextGrayColor3; btnPress.TextSize = 10; btnPress.TextID = R.MyInternationalizationString.uPressAndHoldThisKey; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs index 5bcf6e8..acded9a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs @@ -11,38 +11,38 @@ { #region 鈻� 鍒濆鍖朹____________________________ - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() - { - //鍥剧墖 - var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); - framePic.Gravity = Gravity.CenterHorizontal; - framePic.Y = Application.GetRealHeight(144); - bodyFrameLayout.AddChidren(framePic); - var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); - btnPic.UnSelectedImagePath = "Instruct/PanelFourButton.png"; + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鍥剧墖 + var framePic = new FrameLayout(); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Y = Application.GetRealHeight(144); + bodyFrameLayout.AddChidren(framePic); + var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); + btnPic.UnSelectedImagePath = "Instruct/PanelFourButton.png"; framePic.AddChidren(btnPic); //鎸夐敭鑳屽厜鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(442); - btnGreanLinght.Y = Application.GetMinRealAverage(257); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(442); + btnGreanLinght.Y = this.GetPictrueRealSize(257); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(441); - btnSecond.Y = Application.GetMinRealAverage(583); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(441); + btnSecond.Y = this.GetPictrueRealSize(583); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; @@ -70,8 +70,8 @@ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg1.Y = Application.GetRealHeight(1037); msg1.Text = msgArry[0]; - msg1.TextColor = UserCenterColor.Current.TextGrayColor3; - msg1.TextAlignment = TextAlignment.Center; + msg1.TextColor = UserCenterColor.Current.TextGrayColor3; + msg1.TextAlignment = TextAlignment.Center; bodyFrameLayout.AddChidren(msg1); var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg2.Y = msg1.Bottom; @@ -79,9 +79,9 @@ { msg2.Text = msgArry[1]; } - msg2.TextColor = UserCenterColor.Current.TextGrayColor3; - msg2.TextAlignment = TextAlignment.Center; - bodyFrameLayout.AddChidren(msg2); + msg2.TextColor = UserCenterColor.Current.TextGrayColor3; + msg2.TextAlignment = TextAlignment.Center; + bodyFrameLayout.AddChidren(msg2); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs index ab7c507..02ade6f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs @@ -11,38 +11,38 @@ { #region 鈻� 鍒濆鍖朹____________________________ - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() - { - //鍥剧墖 - var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); - framePic.Gravity = Gravity.CenterHorizontal; - framePic.Y = Application.GetRealHeight(144); - bodyFrameLayout.AddChidren(framePic); - var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); - btnPic.UnSelectedImagePath = "Instruct/PanelThreeButton.png"; + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鍥剧墖 + var framePic = new FrameLayout(); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Y = Application.GetRealHeight(144); + bodyFrameLayout.AddChidren(framePic); + var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); + btnPic.UnSelectedImagePath = "Instruct/PanelThreeButton.png"; framePic.AddChidren(btnPic); //鎸夐敭鑳屽厜鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(442); - btnGreanLinght.Y = Application.GetMinRealAverage(257); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(442); + btnGreanLinght.Y = this.GetPictrueRealSize(257); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(441); - btnSecond.Y = Application.GetMinRealAverage(583); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(441); + btnSecond.Y = this.GetPictrueRealSize(583); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; @@ -70,8 +70,8 @@ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg1.Y = Application.GetRealHeight(1037); msg1.Text = msgArry[0]; - msg1.TextColor = UserCenterColor.Current.TextGrayColor3; - msg1.TextAlignment = TextAlignment.Center; + msg1.TextColor = UserCenterColor.Current.TextGrayColor3; + msg1.TextAlignment = TextAlignment.Center; bodyFrameLayout.AddChidren(msg1); var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg2.Y = msg1.Bottom; @@ -79,9 +79,9 @@ { msg2.Text = msgArry[1]; } - msg2.TextColor = UserCenterColor.Current.TextGrayColor3; - msg2.TextAlignment = TextAlignment.Center; - bodyFrameLayout.AddChidren(msg2); + msg2.TextColor = UserCenterColor.Current.TextGrayColor3; + msg2.TextAlignment = TextAlignment.Center; + bodyFrameLayout.AddChidren(msg2); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs index dcd81d1..ae74341 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs @@ -11,38 +11,38 @@ { #region 鈻� 鍒濆鍖朹____________________________ - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() - { - //鍥剧墖 - var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(835); - framePic.Height = Application.GetMinRealAverage(711); - framePic.Gravity = Gravity.CenterHorizontal; - framePic.Y = Application.GetRealHeight(144); - bodyFrameLayout.AddChidren(framePic); - var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); - btnPic.UnSelectedImagePath = "Instruct/PanelTwoButton.png"; + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鍥剧墖 + var framePic = new FrameLayout(); + framePic.Width = this.GetPictrueRealSize(835); + framePic.Height = this.GetPictrueRealSize(711); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Y = Application.GetRealHeight(144); + bodyFrameLayout.AddChidren(framePic); + var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); + btnPic.UnSelectedImagePath = "Instruct/PanelTwoButton.png"; framePic.AddChidren(btnPic); //鎸夐敭鑳屽厜鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(442); - btnGreanLinght.Y = Application.GetMinRealAverage(257); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(442); + btnGreanLinght.Y = this.GetPictrueRealSize(257); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(441); - btnSecond.Y = Application.GetMinRealAverage(583); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(441); + btnSecond.Y = this.GetPictrueRealSize(583); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; @@ -70,8 +70,8 @@ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg1.Y = Application.GetRealHeight(1037); msg1.Text = msgArry[0]; - msg1.TextColor = UserCenterColor.Current.TextGrayColor3; - msg1.TextAlignment = TextAlignment.Center; + msg1.TextColor = UserCenterColor.Current.TextGrayColor3; + msg1.TextAlignment = TextAlignment.Center; bodyFrameLayout.AddChidren(msg1); var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg2.Y = msg1.Bottom; @@ -79,9 +79,9 @@ { msg2.Text = msgArry[1]; } - msg2.TextColor = UserCenterColor.Current.TextGrayColor3; - msg2.TextAlignment = TextAlignment.Center; - bodyFrameLayout.AddChidren(msg2); + msg2.TextColor = UserCenterColor.Current.TextGrayColor3; + msg2.TextAlignment = TextAlignment.Center; + bodyFrameLayout.AddChidren(msg2); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RelayThreeLoadDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RelayThreeLoadDirectionForm.cs index 355df9c..5a4d5eb 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RelayThreeLoadDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RelayThreeLoadDirectionForm.cs @@ -11,38 +11,38 @@ { #region 鈻� 鍒濆鍖朹____________________________ - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() - { - //鍥剧墖 - var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(873); - framePic.Height = Application.GetMinRealAverage(665); - framePic.Gravity = Gravity.CenterHorizontal; - framePic.Y = Application.GetRealHeight(144); - bodyFrameLayout.AddChidren(framePic); - var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); - btnPic.UnSelectedImagePath = "Instruct/RelayThreeLoad.png"; + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //鍥剧墖 + var framePic = new FrameLayout(); + framePic.Width = this.GetPictrueRealSize(873); + framePic.Height = this.GetPictrueRealSize(665); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Y = Application.GetRealHeight(144); + bodyFrameLayout.AddChidren(framePic); + var btnPic = new PicViewControl(framePic.Width, framePic.Height, false); + btnPic.UnSelectedImagePath = "Instruct/RelayThreeLoad.png"; framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(442); - btnGreanLinght.Y = Application.GetMinRealAverage(368); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(442); + btnGreanLinght.Y = this.GetPictrueRealSize(368); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //鎸囩ず鐏� - var btnLinght = new NormalViewControl(Application.GetMinRealAverage(250), Application.GetMinRealAverage(45), false); - btnLinght.X = Application.GetMinRealAverage(340); - btnLinght.Y = Application.GetMinRealAverage(514); + var btnLinght = new NormalViewControl(this.GetPictrueRealSize(250), this.GetPictrueRealSize(45), false); + btnLinght.X = this.GetPictrueRealSize(340); + btnLinght.Y = this.GetPictrueRealSize(514); btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnLinght.TextSize = 10; btnLinght.TextID = R.MyInternationalizationString.uPilotLamp; @@ -64,9 +64,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(400), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(518); - btnSecond.Y = Application.GetMinRealAverage(545); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(518); + btnSecond.Y = this.GetPictrueRealSize(545); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; @@ -79,8 +79,8 @@ var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg1.Y = Application.GetRealHeight(1037); msg1.Text = msgArry[0]; - msg1.TextColor = UserCenterColor.Current.TextGrayColor3; - msg1.TextAlignment = TextAlignment.Center; + msg1.TextColor = UserCenterColor.Current.TextGrayColor3; + msg1.TextAlignment = TextAlignment.Center; bodyFrameLayout.AddChidren(msg1); var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); msg2.Y = msg1.Bottom; @@ -88,9 +88,9 @@ { msg2.Text = msgArry[1]; } - msg2.TextColor = UserCenterColor.Current.TextGrayColor3; - msg2.TextAlignment = TextAlignment.Center; - bodyFrameLayout.AddChidren(msg2); + msg2.TextColor = UserCenterColor.Current.TextGrayColor3; + msg2.TextAlignment = TextAlignment.Center; + bodyFrameLayout.AddChidren(msg2); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RepeaterZigbeeDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RepeaterZigbeeDirectionForm.cs index dad0545..a7bba65 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RepeaterZigbeeDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/RepeaterZigbeeDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(878); - framePic.Height = Application.GetMinRealAverage(691); + framePic.Width = this.GetPictrueRealSize(878); + framePic.Height = this.GetPictrueRealSize(691); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(135); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸囩ず鐏彉缁块棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(501), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(374); - btnGreanLinght.Y = Application.GetMinRealAverage(346); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(501), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(374); + btnGreanLinght.Y = this.GetPictrueRealSize(346); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(432); - btnSecond.Y = Application.GetMinRealAverage(508); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(432); + btnSecond.Y = this.GetPictrueRealSize(508); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorCarbonMonoxideDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorCarbonMonoxideDirectionForm.cs index a66f80b..5e9ceea 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorCarbonMonoxideDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorCarbonMonoxideDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(861); - framePic.Height = Application.GetMinRealAverage(706); + framePic.Width = this.GetPictrueRealSize(861); + framePic.Height = this.GetPictrueRealSize(706); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(135); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏揩閫熼棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(501), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(357); - btnGreanLinght.Y = Application.GetMinRealAverage(326); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(501), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(357); + btnGreanLinght.Y = this.GetPictrueRealSize(326); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -56,8 +56,8 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond2 = new NormalViewControl(Application.GetMinRealAverage(357), Application.GetMinRealAverage(45), false); - btnSecond2.Y = Application.GetMinRealAverage(222); + var btnSecond2 = new NormalViewControl(this.GetPictrueRealSize(357), this.GetPictrueRealSize(45), false); + btnSecond2.Y = this.GetPictrueRealSize(222); btnSecond2.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond2.TextSize = 10; btnSecond2.TextAlignment = TextAlignment.Center; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorDoorWindowDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorDoorWindowDirectionForm.cs index cd71d66..3948f52 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorDoorWindowDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorDoorWindowDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(877); - framePic.Height = Application.GetMinRealAverage(723); + framePic.Width = this.GetPictrueRealSize(877); + framePic.Height = this.GetPictrueRealSize(723); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(132); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏揩閫熼棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(501), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(383); - btnGreanLinght.Y = Application.GetMinRealAverage(372); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(501), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(383); + btnGreanLinght.Y = this.GetPictrueRealSize(372); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -60,15 +60,15 @@ string textMsg1 = textMsg.Substring(0, index); string textMsg2 = textMsg.Substring(index, textMsg.Length - index); - var btnSecond1 = new NormalViewControl(Application.GetMinRealAverage(150), Application.GetMinRealAverage(45), false); - btnSecond1.X = Application.GetMinRealAverage(235); - btnSecond1.Y = Application.GetMinRealAverage(214); + var btnSecond1 = new NormalViewControl(this.GetPictrueRealSize(150), this.GetPictrueRealSize(45), false); + btnSecond1.X = this.GetPictrueRealSize(235); + btnSecond1.Y = this.GetPictrueRealSize(214); btnSecond1.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond1.TextAlignment = TextAlignment.Center; btnSecond1.TextSize = 10; btnSecond1.Text = textMsg1; framePic.AddChidren(btnSecond1); - var btnSecond2 = new NormalViewControl(Application.GetMinRealAverage(120), Application.GetMinRealAverage(45), false); + var btnSecond2 = new NormalViewControl(this.GetPictrueRealSize(120), this.GetPictrueRealSize(45), false); btnSecond2.X = btnSecond1.X; btnSecond2.Y = btnSecond1.Bottom; btnSecond2.TextAlignment = TextAlignment.Center; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorFireDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorFireDirectionForm.cs index f579a2c..01557a1 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorFireDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorFireDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(861); - framePic.Height = Application.GetMinRealAverage(706); + framePic.Width = this.GetPictrueRealSize(861); + framePic.Height = this.GetPictrueRealSize(706); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(135); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏揩閫熼棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(501), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(357); - btnGreanLinght.Y = Application.GetMinRealAverage(326); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(501), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(357); + btnGreanLinght.Y = this.GetPictrueRealSize(326); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -55,9 +55,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(400); - btnSecond.Y = Application.GetMinRealAverage(614); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(400); + btnSecond.Y = this.GetPictrueRealSize(614); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorInfraredDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorInfraredDirectionForm.cs index 9063711..2b3b497 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorInfraredDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorInfraredDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(988); - framePic.Height = Application.GetMinRealAverage(775); + framePic.Width = this.GetPictrueRealSize(988); + framePic.Height = this.GetPictrueRealSize(775); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(78); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸囩ず鐏� - var btnLinght = new NormalViewControl(Application.GetMinRealAverage(200), Application.GetMinRealAverage(45), false); - btnLinght.X = Application.GetMinRealAverage(173); - btnLinght.Y = Application.GetMinRealAverage(266); + var btnLinght = new NormalViewControl(this.GetPictrueRealSize(200), this.GetPictrueRealSize(45), false); + btnLinght.X = this.GetPictrueRealSize(173); + btnLinght.Y = this.GetPictrueRealSize(266); btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnLinght.TextSize = 10; btnLinght.TextID = R.MyInternationalizationString.uPilotLamp; @@ -54,9 +54,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(550), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(435); - btnSecond.Y = Application.GetMinRealAverage(120); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(550), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(435); + btnSecond.Y = this.GetPictrueRealSize(120); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextAlignment = TextAlignment.Center; btnSecond.TextSize = 10; @@ -64,9 +64,9 @@ framePic.AddChidren(btnSecond); //缁胯壊鎸囩ず鐏棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(550), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(435); - btnGreanLinght.Y = Application.GetMinRealAverage(400); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(550), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(435); + btnGreanLinght.Y = this.GetPictrueRealSize(400); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -74,9 +74,9 @@ framePic.AddChidren(btnGreanLinght); //閫嗘椂閽堟嫥寮�鐢垫睜鍚庣洊 - var btnBattery = new NormalViewControl(Application.GetMinRealAverage(550), Application.GetMinRealAverage(50), false); - btnBattery.X = Application.GetMinRealAverage(455); - btnBattery.Y = Application.GetMinRealAverage(622); + var btnBattery = new NormalViewControl(this.GetPictrueRealSize(550), this.GetPictrueRealSize(50), false); + btnBattery.X = this.GetPictrueRealSize(455); + btnBattery.Y = this.GetPictrueRealSize(622); btnBattery.TextColor = UserCenterColor.Current.TextGrayColor3; btnBattery.TextSize = 12; btnBattery.TextID = R.MyInternationalizationString.uUnscrewTheBatteryAnticlockwise; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPirDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPirDirectionForm.cs index 5d83487..e8f209c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPirDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorPirDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(860); - framePic.Height = Application.GetMinRealAverage(714); + framePic.Width = this.GetPictrueRealSize(860); + framePic.Height = this.GetPictrueRealSize(714); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(130); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //鎸囩ず鐏彉缁裤�侀棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(398); - btnGreanLinght.Y = Application.GetMinRealAverage(300); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(398); + btnGreanLinght.Y = this.GetPictrueRealSize(300); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,18 +50,18 @@ framePic.AddChidren(btnGreanLinght); //鎸囩ず鐏� - var btnLinght = new NormalViewControl(Application.GetMinRealAverage(250), Application.GetMinRealAverage(45), false); - btnLinght.X = Application.GetMinRealAverage(398); - btnLinght.Y = Application.GetMinRealAverage(642); + var btnLinght = new NormalViewControl(this.GetPictrueRealSize(250), this.GetPictrueRealSize(45), false); + btnLinght.X = this.GetPictrueRealSize(398); + btnLinght.Y = this.GetPictrueRealSize(642); btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnLinght.TextSize = 10; btnLinght.TextID = R.MyInternationalizationString.uPilotLamp; framePic.AddChidren(btnLinght); //閽堝瓟寮忛噸缃寜閿� - var btnReset = new NormalViewControl(Application.GetMinRealAverage(250), Application.GetMinRealAverage(45), false); - btnReset.X = Application.GetMinRealAverage(512); - btnReset.Y = Application.GetMinRealAverage(512); + var btnReset = new NormalViewControl(this.GetPictrueRealSize(250), this.GetPictrueRealSize(45), false); + btnReset.X = this.GetPictrueRealSize(512); + btnReset.Y = this.GetPictrueRealSize(512); btnReset.TextColor = UserCenterColor.Current.TextGrayColor3; btnReset.TextSize = 10; btnReset.TextID = R.MyInternationalizationString.uPinholeTypeResetButton; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorTemperatureHumidityForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorTemperatureHumidityForm.cs index 50363d8..29311a8 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorTemperatureHumidityForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorTemperatureHumidityForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(897); - framePic.Height = Application.GetMinRealAverage(732); + framePic.Width = this.GetPictrueRealSize(897); + framePic.Height = this.GetPictrueRealSize(732); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(130); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //淇″彿鍥炬爣蹇棯 - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(455), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(400); - btnGreanLinght.Y = Application.GetMinRealAverage(295); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(455), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(400); + btnGreanLinght.Y = this.GetPictrueRealSize(295); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; @@ -50,9 +50,9 @@ framePic.AddChidren(btnGreanLinght); //淇″彿鍥炬爣 - var btnLinght = new NormalViewControl(Application.GetMinRealAverage(250), Application.GetMinRealAverage(45), false); - btnLinght.X = Application.GetMinRealAverage(505); - btnLinght.Y = Application.GetMinRealAverage(602); + var btnLinght = new NormalViewControl(this.GetPictrueRealSize(250), this.GetPictrueRealSize(45), false); + btnLinght.X = this.GetPictrueRealSize(505); + btnLinght.Y = this.GetPictrueRealSize(602); btnLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnLinght.TextSize = 10; btnLinght.TextID = R.MyInternationalizationString.uSignalIcon; @@ -64,9 +64,9 @@ { textMsg = string.Format(textMsg, "5"); } - var btnSecond = new NormalViewControl(Application.GetMinRealAverage(360), Application.GetMinRealAverage(45), false); - btnSecond.X = Application.GetMinRealAverage(100); - btnSecond.Y = Application.GetMinRealAverage(200); + var btnSecond = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false); + btnSecond.X = this.GetPictrueRealSize(100); + btnSecond.Y = this.GetPictrueRealSize(200); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorWaterDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorWaterDirectionForm.cs index d681c51..4f8a917 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorWaterDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/SensorWaterDirectionForm.cs @@ -30,8 +30,8 @@ { //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(861); - framePic.Height = Application.GetMinRealAverage(706); + framePic.Width = this.GetPictrueRealSize(861); + framePic.Height = this.GetPictrueRealSize(706); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(135); bodyFrameLayout.AddChidren(framePic); @@ -40,9 +40,9 @@ framePic.AddChidren(btnPic); //缁胯壊鎸囩ず鐏揩閫熼棯鐑� - var btnGreanLinght = new NormalViewControl(Application.GetMinRealAverage(501), Application.GetMinRealAverage(45), false); - btnGreanLinght.X = Application.GetMinRealAverage(369); - btnGreanLinght.Y = Application.GetMinRealAverage(358); + var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(501), this.GetPictrueRealSize(45), false); + btnGreanLinght.X = this.GetPictrueRealSize(369); + btnGreanLinght.Y = this.GetPictrueRealSize(358); btnGreanLinght.TextAlignment = TextAlignment.Center; btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3; btnGreanLinght.TextSize = 10; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs index 620df26..3879f6e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs @@ -581,7 +581,7 @@ #endregion - #region 鈻� 鑾峰彇璁板綍___________________________ + #region 鈻� 鑾峰彇闂ㄩ攣鎵撳紑璁板綍___________________ /// <summary> /// 鑾峰彇鍘嗗彶璁板綍 @@ -648,7 +648,15 @@ return null; } var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetHistoryDataResult>(result); - listLog.AddRange(dataInfo.PageData); + foreach (var data in dataInfo.PageData) + { + //涓嶇煡閬撲负浠�涔堜細鏈変笂鎶ヤ簡铏氭嫙9000鐨勯偅涓壒娈婄殑涓滆タ + if (data.OpenLockMode == 9000 && data.OtherOpenLockMode <= 9000) + { + continue; + } + listLog.Add(data); + } if (dataInfo.HasNextPage == false) { @@ -662,6 +670,10 @@ return listLog; } + #endregion + + #region 鈻� 鑾峰彇闂ㄩ攣鍏朵粬璁板綍___________________ + /// <summary> /// 鑾峰彇闂ㄩ攣鐨勫叾浠栬褰� /// </summary> @@ -670,7 +682,7 @@ { var listLog = new List<HistoryInfo>(); - //鍘昏幏鍙栧叾浠栦俊鎭� + //鑾峰彇闂ㄩ攣鍏朵粬绫讳俊鎭笂鎶� var pra2 = new MessageInfoPra(); pra2.BeginTime = beginTime; pra2.EndTime = endTime; @@ -681,6 +693,36 @@ { return null; } + this.AdjustDoorOtherAlarmData(ref listLog, result); + + //浠庤嚜鍔ㄥ寲涓�,鑾峰彇甯稿紑妯″紡璁板綍 + pra2.Topic = "/Logic/Execute_Respon"; + result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2); + if (result == null) + { + return null; + } + this.AdjustDoorNormallyOpenData(ref listLog, result); + + //鑾峰彇闂ㄩ攣涓存椂瀵嗙爜寮�閿佽褰� + pra2.Topic = "/DoorLock/DoorLockOperatingEventNotificationCommand"; + result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2); + if (result == null) + { + return null; + } + this.AdjustDoorTemporaryPasswordData(ref listLog, result); + + return listLog; + } + + /// <summary> + /// 澶勭悊闂ㄩ攣甯稿紑妯″紡璁板綍淇℃伅 + /// </summary> + /// <param name="listLog"></param> + /// <param name="result"></param> + private void AdjustDoorOtherAlarmData(ref List<HistoryInfo> listLog, string result) + { var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint; foreach (var myInfo in dataInfo2.PageData) @@ -712,8 +754,109 @@ } listLog.Add(data); } + } - return listLog; + /// <summary> + /// 澶勭悊闂ㄩ攣甯稿紑妯″紡淇℃伅涓婃姤 + /// </summary> + /// <param name="listLog"></param> + /// <param name="result"></param> + private void AdjustDoorNormallyOpenData(ref List<HistoryInfo> listLog, string result) + { + var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); + string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint; + foreach (var myInfo in dataInfo2.PageData) + { + var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson); + var myActionData = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicPushResult>(jobject["Data"].ToString()); + if (myActionData.ActionData == null || myActionData.ActionData.Actiontype != 8) + { + //涓嶆槸甯稿紑妯″紡鐨勮嚜鍔ㄥ寲 + continue; + } + string deviceAddr = myActionData.ActionData.MacStr; + int deviceEpoint = myActionData.ActionData.Epoint; + if (doorKey != deviceAddr + "_" + deviceEpoint) + { + //涓嶆槸鍚屼竴涓棬閿佺殑璁板綍 + continue; + } + + var data = new HistoryInfo(); + data.DeviceMac = deviceAddr; + data.DeviceEpoint = deviceEpoint; + //娑堟伅 + if (myActionData.ActionData.PassDataString == "055704010112") + { + //甯稿紑妯″紡寮�鍚�(鑷姩鍖栬Е鍙�) + data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg11); + } + else if (myActionData.ActionData.PassDataString == "055704010113") + { + //甯稿紑妯″紡缁撴潫(鑷姩鍖栬Е鍙�) + data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg12); + } + else + { + continue; + } + //鏃堕棿 + data.UnlockTime = myInfo.CreatedOnUtc; + //涓婚敭 + data.MsgKeyId = myInfo.Id; + //娑堟伅鍖哄垎 + data.OpenLockMode = 9000; + + listLog.Add(data); + } + } + + /// <summary> + /// 澶勭悊闂ㄩ攣涓存椂瀵嗙爜涓婃姤 + /// </summary> + /// <param name="listLog"></param> + /// <param name="result"></param> + private void AdjustDoorTemporaryPasswordData(ref List<HistoryInfo> listLog, string result) + { + var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); + string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint; + foreach (var myInfo in dataInfo2.PageData) + { + var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson); + string deviceAddr = jobject.Value<string>("DeviceAddr"); + int deviceEpoint = jobject.Value<int>("Epoint"); + if (doorKey != deviceAddr + "_" + deviceEpoint) + { + //涓嶆槸鍚屼竴涓棬閿佺殑璁板綍 + continue; + } + var myActionData = Newtonsoft.Json.JsonConvert.DeserializeObject<PasswordOperationData>(jobject["Data"].ToString()); + if (myActionData.UserID != 246) + { + //涓嶆槸涓存椂瀵嗙爜 + continue; + } + var data = new HistoryInfo(); + data.DeviceMac = deviceAddr; + data.DeviceEpoint = deviceEpoint; + //娑堟伅 + if (myActionData.OperationEventCode == 2) + { + //涓存椂瀵嗙爜寮�閿佹垚鍔� + data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg13); + } + else + { + //涓存椂瀵嗙爜寮�閿佸け璐� + data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg14); + } + //鏃堕棿 + data.UnlockTime = myInfo.CreatedOnUtc; + //涓婚敭 + data.MsgKeyId = myInfo.Id; + + listLog.Add(data); + } } #endregion @@ -986,6 +1129,25 @@ public string MsgKeyId = string.Empty; } + /// <summary> + /// 涓存椂瀵嗙爜鏁版嵁 + /// </summary> + private class PasswordOperationData + { + /// <summary> + /// 0:瀵嗙爜 15:鎸囩汗 3:IC鍗� + /// </summary> + public int OperationEventSoure = -1; + /// <summary> + /// 2:寮�閿佹垚鍔� + /// </summary> + public int OperationEventCode = -1; + /// <summary> + /// 246浠h〃涓存椂瀵嗙爜 + /// </summary> + public int UserID = -1; + } + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs old mode 100644 new mode 100755 index e9b7b89..6181276 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs @@ -2,17 +2,17 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; -using ZigBee.Device; -namespace Shared.Phone.UserCenter.DevicePanel -{ - public class PanelBackLighWithSensorForm : EditorCommonForm - { - #region 鈻� 鍙橀噺澹版槑___________________________ +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DevicePanel +{ + public class PanelBackLighWithSensorForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> /// 鍒楄〃鎺т欢 /// </summary> - private VerticalScrolViewLayout listview = null; - + private VerticalScrolViewLayout listview = null; + /// <summary> /// 闈㈡澘鐨勫洖璺� /// </summary> @@ -68,35 +68,35 @@ if (result == false) { return; - } - - //娓呯┖bodyFrame - this.ClearBodyFrame(); - + } + + //娓呯┖bodyFrame + this.ClearBodyFrame(); + HdlThreadLogic.Current.RunMain(() => { - listview = new VerticalScrolViewLayout(); - listview.Height = Application.GetRealHeight(1981 - 184); - bodyFrameLayout.AddChidren(listview); - - //娣诲姞鑺傝兘妯″紡 - this.AddEnergyConservationRow(); - //娣诲姞鐐瑰嚮鍓嶏紝浜害杩涘害鏉� + listview = new VerticalScrolViewLayout(); + listview.Height = Application.GetRealHeight(1981 - 184); + bodyFrameLayout.AddChidren(listview); + + //娣诲姞鑺傝兘妯″紡 + this.AddEnergyConservationRow(); + //娣诲姞鐐瑰嚮鍓嶏紝浜害杩涘害鏉� this.AddBeforeClickProgress(); //娣诲姞鐐瑰嚮鍚庯紝浜害杩涘害鏉� - this.AddAfterClickProgress(); - - this.FinishInitControl(listview, energyModeInfo.enable); + this.AddAfterClickProgress(); - //淇濆瓨 - var btnSave = new BottomClickButton(); - btnSave.TextID = R.MyInternationalizationString.uSave; - bodyFrameLayout.AddChidren(btnSave); - btnSave.ButtonClickEvent += (sender, e) => - { - //淇濆瓨闈㈡澘鏁版嵁 - this.SavePanelData(); - }; + this.FinishInitControl(listview, energyModeInfo.enable); + + //淇濆瓨 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uSave; + bodyFrameLayout.AddChidren(btnSave); + btnSave.ButtonClickEvent += (sender, e) => + { + //淇濆瓨闈㈡澘鏁版嵁 + this.SavePanelData(); + }; }); } @@ -123,18 +123,18 @@ btnSwitch.ButtonClickEvent += (sender, e) => { btnSwitch.IsSelected = !btnSwitch.IsSelected; - energyModeInfo.enable = btnSwitch.IsSelected; - //灞曞紑鎴栬�呯缉灏忕殑楂樺害 + energyModeInfo.enable = btnSwitch.IsSelected; + //灞曞紑鎴栬�呯缉灏忕殑楂樺害 var value = Application.GetRealHeight(443); if (btnSwitch.IsSelected == true) { - frameBack.Height += value; + frameBack.Height += value; } else { - frameBack.Height -= value; - } - //瀹瑰櫒琛ュ厖 + frameBack.Height -= value; + } + //瀹瑰櫒琛ュ厖 this.FinishInitControl(listview, energyModeInfo.enable); }; if (energyModeInfo.enable == true) @@ -195,20 +195,20 @@ frameBack.Height += value; } - //娣诲姞鎺ヨ繎鎰熷簲 - this.AddProximitySensorsRow(frameBack); - } - + //娣诲姞鎺ヨ繎鎰熷簲 + this.AddProximitySensorsRow(frameBack); + } + #endregion - + #region 鈻� 鎺ヨ繎鎰熷簲___________________________ - + /// <summary> /// 鎺ヨ繎鎰熷簲琛� /// </summary> private void AddProximitySensorsRow(FrameRowControl frameRowControl) - { - //鎺ヨ繎鎰熷簲琛� + { + //鎺ヨ繎鎰熷簲琛� var frameBack = new FrameRowControl(); frameBack.BackgroundColor = UserCenterColor.Current.White; frameBack.UseClickStatu = false; @@ -219,22 +219,22 @@ //鎺ヨ繎鎰熷簲 frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400); //寮�鍏虫帶浠� - var btnSwitch = frameBack.AddMostRightSwitchIcon(); - - btnSwitch.ButtonClickEvent += (sender, e) => - { - btnSwitch.IsSelected = !btnSwitch.IsSelected; - proximitySensorsInfo.enable = btnSwitch.IsSelected; - }; + var btnSwitch = frameBack.AddMostRightSwitchIcon(); + + btnSwitch.ButtonClickEvent += (sender, e) => + { + btnSwitch.IsSelected = !btnSwitch.IsSelected; + proximitySensorsInfo.enable = btnSwitch.IsSelected; + }; if (proximitySensorsInfo.enable == true) { btnSwitch.IsSelected = true; - } - } + } + } #endregion - + #region 鈻� 鐐瑰嚮鍓峗____________________________ - + /// <summary> /// 娣诲姞鐐瑰嚮鍓嶇殑鑳屽厜鐏繘搴︽潯 /// </summary> @@ -243,7 +243,7 @@ { //鐐瑰嚮鍓� var btnClick = new NormalViewControl(600, 107, true); - btnClick.X = ControlCommonResourse.XXLeft; + btnClick.X = ControlCommonResourse.XXLeft; btnClick.TextSize = 12; btnClick.TextColor = UserCenterColor.Current.TextGrayColor3; btnClick.TextID = R.MyInternationalizationString.uBeforeClick; @@ -299,16 +299,16 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); frameBack.AddChidren(frameColor); //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false); + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -320,33 +320,33 @@ int R1 = Convert.ToInt32(this.keyColorData.CloseColorR, 16); int G1 = Convert.ToInt32(this.keyColorData.CloseColorG, 16); int B1 = Convert.ToInt32(this.keyColorData.CloseColorB, 16); - uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); - - //棰滆壊澶栨 - var btnColorLine = new FrameLayoutControl(); + uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); + + //棰滆壊澶栨 + var btnColorLine = new FrameLayoutStatuControl(); btnColorLine.Width = Application.GetRealHeight(79); - btnColorLine.Height = Application.GetMinRealAverage(79); + btnColorLine.Height = this.GetPictrueRealSize(79); btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18); - btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; btnColorLine.BorderWidth = 1; - btnColorLine.BorderColor = 0xffcccccc; + btnColorLine.BorderColor = 0xffcccccc; frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); - var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false); + var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false); btnColor.Gravity = Gravity.Center; - btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2; + btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2; btnColor.BackgroundColor = backColor; btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly); //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { @@ -437,16 +437,16 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); - frameBack.AddChidren(frameColor); - - //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false); + frameBack.AddChidren(frameColor); + + //棰滆壊 + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -458,33 +458,33 @@ int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16); int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16); int B1 = Convert.ToInt32(this.keyColorData.OpenColorB, 16); - uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); - - //棰滆壊澶栨 - var btnColorLine = new FrameLayoutControl(); + uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); + + //棰滆壊澶栨 + var btnColorLine = new FrameLayoutStatuControl(); btnColorLine.Width = Application.GetRealHeight(79); - btnColorLine.Height = Application.GetMinRealAverage(79); + btnColorLine.Height = this.GetPictrueRealSize(79); btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18); - btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; btnColorLine.BorderWidth = 1; - btnColorLine.BorderColor = 0xffcccccc; - frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); - - var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false); + btnColorLine.BorderColor = 0xffcccccc; + frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); + + var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false); btnColor.Gravity = Gravity.Center; - btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2; + btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2; btnColor.BackgroundColor = backColor; btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly); //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { @@ -576,7 +576,7 @@ //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) //鑲栧織璞粰鎸夐敭鎺у埗闈㈡澘锛堝洓寮�鍏帶锛夎澶囷紝璇撮粯璁�15绉掓椂闂达紝杩欐牱鎺ヨ繎鎰熷簲鍔熻兘鎵嶅悎鐞� - energyModeInfo.time = 4094; + energyModeInfo.time = 15; result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); if (result == false) { @@ -640,8 +640,8 @@ private uint GetColorByRGB(byte R, byte G, byte B) { return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B); - } - + } + #endregion } -} +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs index 085aae4..26f4c3a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs @@ -273,15 +273,15 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = frameLinght.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); frameBack.AddChidren(frameColor); //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false); + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -296,18 +296,18 @@ uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); //棰滆壊澶栨 - var frameColorLine = new FrameLayoutControl(); + var frameColorLine = new FrameLayoutStatuControl(); frameColorLine.UseClickStatu = false; - frameColorLine.Height = Application.GetMinRealAverage(79); - frameColorLine.Width = Application.GetMinRealAverage(79); + frameColorLine.Height = this.GetPictrueRealSize(79); + frameColorLine.Width = this.GetPictrueRealSize(79); frameColorLine.X = btnColorView.Right + Application.GetRealHeight(18); - frameColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + frameColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; frameColorLine.BorderWidth = 1; frameColorLine.BorderColor = 0xffcccccc; frameColor.AddChidren(frameColorLine, ChidrenBindMode.NotBind); //鍒嗕袱姝ヨ绠楋紝涓嶇劧鏈夊彲鑳藉畠寰楀嚭鐨勭粨鏋滄湁璇樊瀵艰嚧涓嶅眳涓� - int btnColorWidth = frameColorLine.Height - Application.GetMinRealAverage(7) - Application.GetMinRealAverage(7); + int btnColorWidth = frameColorLine.Height - this.GetPictrueRealSize(7) - this.GetPictrueRealSize(7); var btnColor = new NormalViewControl(btnColorWidth, btnColorWidth, false); btnColor.Gravity = Gravity.Center; btnColor.Radius = (uint)btnColorWidth / 2; @@ -318,12 +318,12 @@ //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { @@ -415,15 +415,15 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = frameLinght.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); frameBack.AddChidren(frameColor); //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false); + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -438,18 +438,18 @@ uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); //棰滆壊澶栨 - var frameColorLine = new FrameLayoutControl(); + var frameColorLine = new FrameLayoutStatuControl(); frameColorLine.UseClickStatu = false; - frameColorLine.Height = Application.GetMinRealAverage(79); - frameColorLine.Width = Application.GetMinRealAverage(79); + frameColorLine.Height = this.GetPictrueRealSize(79); + frameColorLine.Width = this.GetPictrueRealSize(79); frameColorLine.X = btnColorView.Right + Application.GetRealHeight(18); - frameColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + frameColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; frameColorLine.BorderWidth = 1; frameColorLine.BorderColor = 0xffcccccc; frameColor.AddChidren(frameColorLine, ChidrenBindMode.NotBind); //鍒嗕袱姝ヨ绠楋紝涓嶇劧鏈夊彲鑳藉畠寰楀嚭鐨勭粨鏋滄湁璇樊瀵艰嚧涓嶅眳涓� - int btnColorWidth = frameColorLine.Height - Application.GetMinRealAverage(7) - Application.GetMinRealAverage(7); + int btnColorWidth = frameColorLine.Height - this.GetPictrueRealSize(7) - this.GetPictrueRealSize(7); var btnColor = new NormalViewControl(btnColorWidth, btnColorWidth, false); btnColor.Gravity = Gravity.Center; btnColor.Radius = (uint)btnColorWidth / 2; @@ -460,12 +460,12 @@ //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs index 390b7e9..428d2c0 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs @@ -322,7 +322,9 @@ //鍙湁绠�绾﹂潰鏉挎墠浼氭湁杩欎釜鑿滃崟 if (myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleTwo || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleThree - || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleFour) + || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleFour + || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FourButtonScene + || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_TwoButtonCurtain) { //闇囧姩鍙嶉 var rowContr = new FrameRowControl(listview.rowSpace / 2); @@ -436,8 +438,8 @@ var frameBorder = new FrameLayout(); frameBorder.Y = Application.GetRealHeight(150); frameBorder.Gravity = Gravity.CenterHorizontal; - frameBorder.Width = Application.GetMinRealAverage(426); - frameBorder.Height = Application.GetMinRealAverage(426); + frameBorder.Width = this.GetPictrueRealSize(426); + frameBorder.Height = this.GetPictrueRealSize(426); listBackControl.frameTable.AddChidren(frameBorder); var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false); @@ -468,12 +470,12 @@ /// <param name="device">璁惧瀵硅薄</param> /// <param name="isFirst">鏄惁鏄涓�涓�</param> /// <returns></returns> - private void InitDeviceIcon(FrameLayoutControl frame, CommonDevice device) + private void InitDeviceIcon(FrameLayoutStatuControl frame, CommonDevice device) { //涓嶄娇鐢ㄧ偣鍑荤壒鏁� frame.UseClickStatu = false; - var btnIcon = new NormalViewControl(Application.GetMinRealAverage(52), Application.GetMinRealAverage(52), false); + var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false); btnIcon.Name = "btn" + device.DeviceEpoint; btnIcon.Gravity = Gravity.Center; btnIcon.RadiusEx = 16; @@ -506,20 +508,20 @@ private void InitTwoButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice) { //鎸夐敭1 - var frame1 = new FrameLayoutControl(); - frame1.Height = Application.GetMinRealAverage(110); - frame1.Width = Application.GetMinRealAverage(110); - frame1.Y = Application.GetMinRealAverage(63); + var frame1 = new FrameLayoutStatuControl(); + frame1.Height = this.GetPictrueRealSize(110); + frame1.Width = this.GetPictrueRealSize(110); + frame1.Y = this.GetPictrueRealSize(63); frame1.Gravity = Gravity.CenterHorizontal; frameBack.AddChidren(frame1); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame1, listDevice[0]); //鎸夐敭2 - var frame2 = new FrameLayoutControl(); - frame2.Height = Application.GetMinRealAverage(110); - frame2.Width = Application.GetMinRealAverage(110); - frame2.Y = Application.GetMinRealAverage(245); + var frame2 = new FrameLayoutStatuControl(); + frame2.Height = this.GetPictrueRealSize(110); + frame2.Width = this.GetPictrueRealSize(110); + frame2.Y = this.GetPictrueRealSize(245); frame2.Gravity = Gravity.CenterHorizontal; frameBack.AddChidren(frame2); //鍒濆鍖栬澶囧浘鏍� @@ -538,31 +540,31 @@ private void InitThreeButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice) { //鎸夐敭1 - var frame1 = new FrameLayoutControl(); - frame1.Height = Application.GetMinRealAverage(110); - frame1.Width = Application.GetMinRealAverage(110); - frame1.Y = Application.GetMinRealAverage(63); + var frame1 = new FrameLayoutStatuControl(); + frame1.Height = this.GetPictrueRealSize(110); + frame1.Width = this.GetPictrueRealSize(110); + frame1.Y = this.GetPictrueRealSize(63); frame1.Gravity = Gravity.CenterHorizontal; frameBack.AddChidren(frame1); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame1, listDevice[0]); //鎸夐敭2 - var frame2 = new FrameLayoutControl(); - frame2.Height = Application.GetMinRealAverage(110); - frame2.Width = Application.GetMinRealAverage(110); - frame2.X = Application.GetMinRealAverage(63); - frame2.Y = Application.GetMinRealAverage(245); + var frame2 = new FrameLayoutStatuControl(); + frame2.Height = this.GetPictrueRealSize(110); + frame2.Width = this.GetPictrueRealSize(110); + frame2.X = this.GetPictrueRealSize(63); + frame2.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame2); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame2, listDevice[1]); //鎸夐敭3 - var frame3 = new FrameLayoutControl(); - frame3.Height = Application.GetMinRealAverage(110); - frame3.Width = Application.GetMinRealAverage(110); - frame3.X = Application.GetMinRealAverage(245); - frame3.Y = Application.GetMinRealAverage(245); + var frame3 = new FrameLayoutStatuControl(); + frame3.Height = this.GetPictrueRealSize(110); + frame3.Width = this.GetPictrueRealSize(110); + frame3.X = this.GetPictrueRealSize(245); + frame3.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame3); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame3, listDevice[2]); @@ -580,41 +582,41 @@ private void InitFourButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice) { //鎸夐敭1 - var frame1 = new FrameLayoutControl(); - frame1.Height = Application.GetMinRealAverage(110); - frame1.Width = Application.GetMinRealAverage(110); - frame1.X = Application.GetMinRealAverage(63); - frame1.Y = Application.GetMinRealAverage(63); + var frame1 = new FrameLayoutStatuControl(); + frame1.Height = this.GetPictrueRealSize(110); + frame1.Width = this.GetPictrueRealSize(110); + frame1.X = this.GetPictrueRealSize(63); + frame1.Y = this.GetPictrueRealSize(63); frameBack.AddChidren(frame1); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame1, listDevice[0]); //鎸夐敭2 - var frame2 = new FrameLayoutControl(); - frame2.Height = Application.GetMinRealAverage(110); - frame2.Width = Application.GetMinRealAverage(110); - frame2.X = Application.GetMinRealAverage(245); - frame2.Y = Application.GetMinRealAverage(63); + var frame2 = new FrameLayoutStatuControl(); + frame2.Height = this.GetPictrueRealSize(110); + frame2.Width = this.GetPictrueRealSize(110); + frame2.X = this.GetPictrueRealSize(245); + frame2.Y = this.GetPictrueRealSize(63); frameBack.AddChidren(frame2); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame2, listDevice[1]); //鎸夐敭3 - var frame3 = new FrameLayoutControl(); - frame3.Height = Application.GetMinRealAverage(110); - frame3.Width = Application.GetMinRealAverage(110); - frame3.X = Application.GetMinRealAverage(63); - frame3.Y = Application.GetMinRealAverage(245); + var frame3 = new FrameLayoutStatuControl(); + frame3.Height = this.GetPictrueRealSize(110); + frame3.Width = this.GetPictrueRealSize(110); + frame3.X = this.GetPictrueRealSize(63); + frame3.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame3); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame3, listDevice[2]); //鎸夐敭4 - var frame4 = new FrameLayoutControl(); - frame4.Height = Application.GetMinRealAverage(110); - frame4.Width = Application.GetMinRealAverage(110); - frame4.X = Application.GetMinRealAverage(245); - frame4.Y = Application.GetMinRealAverage(245); + var frame4 = new FrameLayoutStatuControl(); + frame4.Height = this.GetPictrueRealSize(110); + frame4.Width = this.GetPictrueRealSize(110); + frame4.X = this.GetPictrueRealSize(245); + frame4.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame4); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame4, listDevice[3]); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs index 54474b0..b1cbd81 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs @@ -23,11 +23,11 @@ /// <summary> /// 褰撳墠閫夋嫨鐨勬帶浠�(澶栨) /// </summary> - private FrameLayoutControl nowSelectIcon1 = null; + private FrameLayoutStatuControl nowSelectIcon1 = null; /// <summary> /// 鍦嗙洏閫夋嫨鐨勯鑹叉樉绀烘帶浠�(澶栨) /// </summary> - private FrameLayoutControl wheelSelectIcon1 = null; + private FrameLayoutStatuControl wheelSelectIcon1 = null; /// <summary> /// 鍦嗙洏閫夋嫨鐨勯鑹叉樉绀烘帶浠�(鍐呮) /// </summary> @@ -102,8 +102,8 @@ bodyFrameLayout.AddChidren(frameBack); var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(588); - framePic.Height = Application.GetMinRealAverage(588); + framePic.Width = this.GetPictrueRealSize(588); + framePic.Height = this.GetPictrueRealSize(588); framePic.Gravity = Gravity.Center; frameBack.AddChidren(framePic); @@ -116,7 +116,7 @@ var btnWhiteView = new IconViewControl(30); btnWhiteView.Visible = false; btnWhiteView.BackgroundColor = UserCenterColor.Current.White; - btnWhiteView.Radius = (uint)Application.GetMinRealAverage(30) / 2; + btnWhiteView.Radius = (uint)this.GetPictrueRealSize(30) / 2; framePic.AddChidren(btnWhiteView); colorPic.ColorChaged += (sender, eColor) => @@ -163,16 +163,16 @@ //鎺т欢鏁� var listColor = this.InitSpareDefultColor(); //X杞村垵濮嬪潗鏍� - int Xdefult = (bodyFrameLayout.Width - Application.GetMinRealAverage(80 + 24) * (listColor.Count - 1) - Application.GetMinRealAverage(80)) / 2; + int Xdefult = (bodyFrameLayout.Width - this.GetPictrueRealSize(80 + 24) * (listColor.Count - 1) - this.GetPictrueRealSize(80)) / 2; for (int i = 0; i < listColor.Count; i++) { var dataColor = listColor[i]; - var btnFrame = new FrameLayoutControl(); - btnFrame.Height = Application.GetMinRealAverage(80); - btnFrame.Width = Application.GetMinRealAverage(80); - btnFrame.Radius = (uint)Application.GetMinRealAverage(80) / 2; - btnFrame.X = Xdefult + i * Application.GetMinRealAverage(80 + 24); + var btnFrame = new FrameLayoutStatuControl(); + btnFrame.Height = this.GetPictrueRealSize(80); + btnFrame.Width = this.GetPictrueRealSize(80); + btnFrame.Radius = (uint)this.GetPictrueRealSize(80) / 2; + btnFrame.X = Xdefult + i * this.GetPictrueRealSize(80 + 24); btnFrame.Y = Application.GetRealHeight(1054); btnFrame.BackgroundColor = UserCenterColor.Current.White; btnFrame.BorderWidth = 1; @@ -180,7 +180,7 @@ bodyFrameLayout.AddChidren(btnFrame); //鍒嗕袱姝ヨ绠楋紝涓嶇劧鏈夊彲鑳藉畠寰楀嚭鐨勭粨鏋滄湁璇樊瀵艰嚧涓嶅眳涓� - int iconWidth = btnFrame.Height - Application.GetMinRealAverage(10) - Application.GetMinRealAverage(10); + int iconWidth = btnFrame.Height - this.GetPictrueRealSize(10) - this.GetPictrueRealSize(10); var btnIcon = new IconViewControl(iconWidth, false); btnIcon.Gravity = Gravity.Center; btnIcon.Radius = (uint)btnIcon.IconSize / 2; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs index 514859d..225a2aa 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs @@ -340,8 +340,8 @@ var frameBorder = new FrameLayout(); frameBorder.Y = Application.GetRealHeight(150); frameBorder.Gravity = Gravity.CenterHorizontal; - frameBorder.Width = Application.GetMinRealAverage(426); - frameBorder.Height = Application.GetMinRealAverage(426); + frameBorder.Width = this.GetPictrueRealSize(426); + frameBorder.Height = this.GetPictrueRealSize(426); listBackControl.frameTable.AddChidren(frameBorder); var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false); @@ -376,14 +376,14 @@ /// <returns></returns> private NormalViewControl InitDeviceButtonControl(FrameLayout frame, CommonDevice device) { - var btnIcon = new NormalViewControl(Application.GetMinRealAverage(52), Application.GetMinRealAverage(52), false); + var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false); btnIcon.Text = "Button" + device.DeviceEpoint; btnIcon.TextAlignment = TextAlignment.Center; btnIcon.TextColor = UserCenterColor.Current.TextGrayColor1; - if (frame is FrameLayoutControl) + if (frame is FrameLayoutStatuControl) { - ((FrameLayoutControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); - ((FrameLayoutControl)frame).ButtonClickEvent += (sender, e) => + ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); + ((FrameLayoutStatuControl)frame).ButtonClickEvent += (sender, e) => { //鎸夐敭鐐瑰嚮 this.DeviceEpointSelectEvent(btnIcon, null); @@ -421,15 +421,15 @@ { //鎸夐敭1 var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]); - btnButton1.Height = Application.GetMinRealAverage(175); - btnButton1.Width = Application.GetMinRealAverage(361); - btnButton1.Y = Application.GetMinRealAverage(39); + btnButton1.Height = this.GetPictrueRealSize(175); + btnButton1.Width = this.GetPictrueRealSize(361); + btnButton1.Y = this.GetPictrueRealSize(39); btnButton1.Gravity = Gravity.CenterHorizontal; //鎸夐敭2 var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]); - btnButton2.Height = Application.GetMinRealAverage(175); - btnButton2.Width = Application.GetMinRealAverage(361); + btnButton2.Height = this.GetPictrueRealSize(175); + btnButton2.Width = this.GetPictrueRealSize(361); btnButton2.Y = btnButton1.Bottom; btnButton2.Gravity = Gravity.CenterHorizontal; } @@ -448,32 +448,32 @@ //鎸夐敭1 var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]); btnButton1.TextSize = 12; - btnButton1.Height = Application.GetMinRealAverage(175); - btnButton1.Width = Application.GetMinRealAverage(183); - btnButton1.X = Application.GetMinRealAverage(34); - btnButton1.Y = Application.GetMinRealAverage(30); + btnButton1.Height = this.GetPictrueRealSize(175); + btnButton1.Width = this.GetPictrueRealSize(183); + btnButton1.X = this.GetPictrueRealSize(34); + btnButton1.Y = this.GetPictrueRealSize(30); //鎸夐敭2 var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]); btnButton2.TextSize = 12; - btnButton2.Height = Application.GetMinRealAverage(175); - btnButton2.Width = Application.GetMinRealAverage(183); + btnButton2.Height = this.GetPictrueRealSize(175); + btnButton2.Width = this.GetPictrueRealSize(183); btnButton2.X = btnButton1.Right; btnButton2.Y = btnButton1.Y; //鎸夐敭3 var btnButton3 = this.InitDeviceButtonControl(frameBack, listDevice[2]); btnButton3.TextSize = 12; - btnButton3.Height = Application.GetMinRealAverage(175); - btnButton3.Width = Application.GetMinRealAverage(183); + btnButton3.Height = this.GetPictrueRealSize(175); + btnButton3.Width = this.GetPictrueRealSize(183); btnButton3.X = btnButton1.X; - btnButton3.Y = btnButton1.Bottom + Application.GetMinRealAverage(4); + btnButton3.Y = btnButton1.Bottom + this.GetPictrueRealSize(4); //鎸夐敭4 var btnButton4 = this.InitDeviceButtonControl(frameBack, listDevice[3]); btnButton4.TextSize = 12; - btnButton4.Height = Application.GetMinRealAverage(175); - btnButton4.Width = Application.GetMinRealAverage(183); + btnButton4.Height = this.GetPictrueRealSize(175); + btnButton4.Width = this.GetPictrueRealSize(183); btnButton4.X = btnButton2.X; btnButton4.Y = btnButton3.Y; } @@ -491,10 +491,10 @@ { //鎸夐敭1锝炴寜閿�2 var frame1 = new FrameLayout(); - frame1.X = Application.GetMinRealAverage(34); - frame1.Y = Application.GetMinRealAverage(30); - frame1.Height = Application.GetMinRealAverage(183); - frame1.Width = Application.GetMinRealAverage(183); + frame1.X = this.GetPictrueRealSize(34); + frame1.Y = this.GetPictrueRealSize(30); + frame1.Height = this.GetPictrueRealSize(183); + frame1.Width = this.GetPictrueRealSize(183); frameBack.AddChidren(frame1); this.InitEightButtonPanelIcon(frame1, listDevice[0], listDevice[1]); @@ -510,7 +510,7 @@ //鎸夐敭5锝炴寜閿�6 var frame3 = new FrameLayout(); frame3.X = frame1.X; - frame3.Y = frame1.Bottom + Application.GetMinRealAverage(4); + frame3.Y = frame1.Bottom + this.GetPictrueRealSize(4); frame3.Height = frame1.Height; frame3.Width = frame1.Width; frameBack.AddChidren(frame3); @@ -519,7 +519,7 @@ //鎸夐敭7锝炴寜閿�8 var frame4 = new FrameLayout(); frame4.X = frame1.Right; - frame4.Y = frame1.Bottom + Application.GetMinRealAverage(4); + frame4.Y = frame1.Bottom + this.GetPictrueRealSize(4); frame4.Height = frame1.Height; frame4.Width = frame1.Width; frameBack.AddChidren(frame4); @@ -535,19 +535,19 @@ private void InitEightButtonPanelIcon(FrameLayout frameBack, CommonDevice device1, CommonDevice device2) { //鎸夐敭1 - var frameButton1 = new FrameLayoutControl(); + var frameButton1 = new FrameLayoutStatuControl(); frameButton1.UseClickStatu = false; - frameButton1.Height = Application.GetMinRealAverage(92); - frameButton1.Width = Application.GetMinRealAverage(183); + frameButton1.Height = this.GetPictrueRealSize(92); + frameButton1.Width = this.GetPictrueRealSize(183); frameBack.AddChidren(frameButton1); var btnButton1 = this.InitDeviceButtonControl(frameButton1, device1); btnButton1.TextSize = 10; - btnButton1.Height = Application.GetMinRealAverage(35); - btnButton1.Width = Application.GetMinRealAverage(183); - btnButton1.Y = Application.GetMinRealAverage(37); + btnButton1.Height = this.GetPictrueRealSize(35); + btnButton1.Width = this.GetPictrueRealSize(183); + btnButton1.Y = this.GetPictrueRealSize(37); //鎸夐敭2 - var frameButton2 = new FrameLayoutControl(); + var frameButton2 = new FrameLayoutStatuControl(); frameButton2.UseClickStatu = false; frameButton2.Height = frameButton1.Height; frameButton2.Width = frameButton1.Width; @@ -557,7 +557,7 @@ btnButton2.TextSize = 10; btnButton2.Height = btnButton1.Height; btnButton2.Width = btnButton1.Width; - btnButton2.Y = Application.GetMinRealAverage(20); + btnButton2.Y = this.GetPictrueRealSize(20); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs index ef714aa..d70ff25 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs @@ -212,15 +212,15 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); frameBack.AddChidren(frameColor); //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(50), false); + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(50), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -235,17 +235,17 @@ uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); //棰滆壊澶栨 - var frameColorLine = new FrameLayoutControl(); + var frameColorLine = new FrameLayoutStatuControl(); frameColorLine.UseClickStatu = false; - frameColorLine.Height = Application.GetMinRealAverage(79); - frameColorLine.Width = Application.GetMinRealAverage(79); - frameColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + frameColorLine.Height = this.GetPictrueRealSize(79); + frameColorLine.Width = this.GetPictrueRealSize(79); + frameColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; frameColorLine.BorderWidth = 1; frameColorLine.BorderColor = 0xffcccccc; frameColor.AddChidren(frameColorLine, ChidrenBindMode.NotBind); //鍒嗕袱姝ヨ绠楋紝涓嶇劧鏈夊彲鑳藉畠寰楀嚭鐨勭粨鏋滄湁璇樊瀵艰嚧涓嶅眳涓� - int btnColorWidth = frameColorLine.Height - Application.GetMinRealAverage(7) - Application.GetMinRealAverage(7); + int btnColorWidth = frameColorLine.Height - this.GetPictrueRealSize(7) - this.GetPictrueRealSize(7); var btnColor = new NormalViewControl(btnColorWidth, btnColorWidth, false); btnColor.Gravity = Gravity.Center; btnColor.Radius = (uint)btnColorWidth / 2; @@ -256,12 +256,12 @@ //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs index 759549a..a05ec13 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs @@ -1,15 +1,15 @@ -锘縰sing System; -using System.Threading.Tasks; -using ZigBee.Device; -namespace Shared.Phone.UserCenter.DevicePanel -{ - public class PanelFangyueFreshAirBackLightSettionForm : EditorCommonForm - { +锘縰sing System; +using System.Threading.Tasks; +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DevicePanel +{ + public class PanelFangyueFreshAirBackLightSettionForm : EditorCommonForm + { #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> /// 鍒楄〃鎺т欢 /// </summary> - private VerticalScrolViewLayout listview = null; + private VerticalScrolViewLayout listview = null; /// <summary> /// 闈㈡澘鐨勫洖璺� /// </summary> @@ -42,7 +42,7 @@ public void ShowForm(Panel i_panel) { //宸︽粦浣胯兘涓嶅彲 - this.ScrollEnabled = false; + this.ScrollEnabled = false; this.panelDevice = i_panel; //璁剧疆澶撮儴淇℃伅 @@ -56,8 +56,8 @@ /// 鍒濆鍖栦腑閮ㄤ俊鎭� /// </summary> private async void InitMiddleFrame() - { - //鑾峰彇璁惧鍒濆鏁版嵁 + { + //鑾峰彇璁惧鍒濆鏁版嵁 var result = await this.GetDeviceDefultData(); if (result == false) { @@ -65,34 +65,35 @@ } //娓呯┖bodyFrame - this.ClearBodyFrame(); - - listview = new VerticalScrolViewLayout(); - listview.Height = Application.GetRealHeight(1981 - 184); - bodyFrameLayout.AddChidren(listview); - + this.ClearBodyFrame(); + + listview = new VerticalScrolViewLayout(); + listview.Height = Application.GetRealHeight(1981 - 184); + bodyFrameLayout.AddChidren(listview); + HdlThreadLogic.Current.RunMain(() => - { - //娣诲姞鑺傝兘妯″紡鎺т欢 - this.AddEnergyConservationRow(); - - //娣诲姞灞忓箷浜害绾у埆鎺т欢 - this.AddScreenBrightnesLevelControl(); - //娣诲姞鑳屽厜鐏寒搴︽帶浠躲�愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ�� - //this.AddBackLightControl(); - //銆愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ�� + { + //娣诲姞鑺傝兘妯″紡鎺т欢 + this.AddEnergyConservationRow(); + + //娣诲姞灞忓箷浜害绾у埆鎺т欢 + this.AddScreenBrightnesLevelControl(); + + //娣诲姞鑳屽厜鐏寒搴︽帶浠躲�愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ�� + this.AddBackLightControl(); + //銆愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ�� //this.FinishInitControl(listview, energyModeInfo.enable); - //淇濆瓨 + //淇濆瓨 var btnSave = new BottomClickButton(); btnSave.TextID = R.MyInternationalizationString.uSave; bodyFrameLayout.AddChidren(btnSave); btnSave.ButtonClickEvent += (sender, e) => { - //淇濆瓨闈㈡澘鏁版嵁 + //淇濆瓨闈㈡澘鏁版嵁 this.SavePanelData(); }; - }); + }); } #endregion @@ -103,13 +104,13 @@ /// </summary> private void AddScreenBrightnesLevelControl() { - var btnEspace = new NormalViewControl(600, 58, true); - btnEspace.X = ControlCommonResourse.XXLeft; - listview.AddChidren(btnEspace); - + var btnEspace = new NormalViewControl(600, 58, true); + btnEspace.X = ControlCommonResourse.XXLeft; + listview.AddChidren(btnEspace); + var frameBack = new FrameLayout(); frameBack.Height = Application.GetRealHeight(429); - frameBack.Y = Application.GetRealHeight(58); + frameBack.Y = Application.GetRealHeight(58); frameBack.BackgroundColor = UserCenterColor.Current.White; listview.AddChidren(frameBack); @@ -152,91 +153,91 @@ frameBack.AddChidren(seekBar1); seekBar1.ProgressChangedEvent += (div, value) => { - if (value == 0) - { - btnProgress1.Text = (value + 1).ToString(); - } - else - { - btnProgress1.Text = value.ToString(); - } - - switch (value) - { - case 0: - case 1: - linghtLevelInfo.panelDirectionsLevel = 20; - btnLevel.Text = "1" + strRank; - - break; - case 2: - linghtLevelInfo.panelDirectionsLevel = 40; - btnLevel.Text = "2" + strRank; - break; - case 3: - linghtLevelInfo.panelDirectionsLevel = 60; - btnLevel.Text = "3" + strRank; - break; - case 4: - linghtLevelInfo.panelDirectionsLevel = 80; - btnLevel.Text = "4" + strRank; - break; - case 5: - linghtLevelInfo.panelDirectionsLevel = 100; - btnLevel.Text = "5" + strRank; - break; - } + if (value == 0) + { + btnProgress1.Text = (value + 1).ToString(); + } + else + { + btnProgress1.Text = value.ToString(); + } + + switch (value) + { + case 0: + case 1: + linghtLevelInfo.panelDirectionsLevel = 20; + btnLevel.Text = "1" + strRank; + + break; + case 2: + linghtLevelInfo.panelDirectionsLevel = 40; + btnLevel.Text = "2" + strRank; + break; + case 3: + linghtLevelInfo.panelDirectionsLevel = 60; + btnLevel.Text = "3" + strRank; + break; + case 4: + linghtLevelInfo.panelDirectionsLevel = 80; + btnLevel.Text = "4" + strRank; + break; + case 5: + linghtLevelInfo.panelDirectionsLevel = 100; + btnLevel.Text = "5" + strRank; + break; + } }; seekBar1.OnStopTrackingTouchEvent += (div, value) => { - if (value == 0) - { - seekBar1.Progress = 1; - } - else - { - seekBar1.Progress = value; - } + if (value == 0) + { + seekBar1.Progress = 1; + } + else + { + seekBar1.Progress = value; + } }; - if (linghtLevelInfo.panelDirectionsLevel <= 20 && linghtLevelInfo.panelDirectionsLevel >= 0) - { - btnLevel.Text = "1" + strRank; - btnProgress1.Text = "1"; - seekBar1.Progress = 1; - } - else if (linghtLevelInfo.panelDirectionsLevel <= 40 && linghtLevelInfo.panelDirectionsLevel > 20) - { - btnLevel.Text = "2" + strRank; - btnProgress1.Text = "2"; - seekBar1.Progress = 2; - } - else if (linghtLevelInfo.panelDirectionsLevel <= 60 && linghtLevelInfo.panelDirectionsLevel > 40) - { - btnLevel.Text = "3" + strRank; - btnProgress1.Text = "3"; - seekBar1.Progress = 3; - } - else if (linghtLevelInfo.panelDirectionsLevel <= 80 && linghtLevelInfo.panelDirectionsLevel > 60) - { - btnLevel.Text = "4" + strRank; - btnProgress1.Text = "4"; - seekBar1.Progress = 4; - } - else if (linghtLevelInfo.panelDirectionsLevel <= 100 && linghtLevelInfo.panelDirectionsLevel > 80) - { - btnLevel.Text = "5" + strRank; - btnProgress1.Text = "5"; - seekBar1.Progress = 5; - } - else - { - btnLevel.Text = "1" + strRank; - btnProgress1.Text = "1"; - seekBar1.Progress = 1; - } - + if (linghtLevelInfo.panelDirectionsLevel <= 20 && linghtLevelInfo.panelDirectionsLevel >= 0) + { + btnLevel.Text = "1" + strRank; + btnProgress1.Text = "1"; + seekBar1.Progress = 1; + } + else if (linghtLevelInfo.panelDirectionsLevel <= 40 && linghtLevelInfo.panelDirectionsLevel > 20) + { + btnLevel.Text = "2" + strRank; + btnProgress1.Text = "2"; + seekBar1.Progress = 2; + } + else if (linghtLevelInfo.panelDirectionsLevel <= 60 && linghtLevelInfo.panelDirectionsLevel > 40) + { + btnLevel.Text = "3" + strRank; + btnProgress1.Text = "3"; + seekBar1.Progress = 3; + } + else if (linghtLevelInfo.panelDirectionsLevel <= 80 && linghtLevelInfo.panelDirectionsLevel > 60) + { + btnLevel.Text = "4" + strRank; + btnProgress1.Text = "4"; + seekBar1.Progress = 4; + } + else if (linghtLevelInfo.panelDirectionsLevel <= 100 && linghtLevelInfo.panelDirectionsLevel > 80) + { + btnLevel.Text = "5" + strRank; + btnProgress1.Text = "5"; + seekBar1.Progress = 5; + } + else + { + btnLevel.Text = "1" + strRank; + btnProgress1.Text = "1"; + seekBar1.Progress = 1; + } + var btnTemp1 = new NormalViewControl(200, 50, true); btnTemp1.X = ControlCommonResourse.XXLeft; btnTemp1.Y = Application.GetRealHeight(322); @@ -256,17 +257,17 @@ } #endregion - #region 鈻� 鑳屽厜鐏寒搴________________________ + #region 鈻� 鑳屽厜棰滆壊_________________________ /// <summary> /// 娣诲姞鑳屽厜鐏寒搴︽帶浠� /// </summary> private void AddBackLightControl() { - var btnEspace = new NormalViewControl(600, 58, true); - btnEspace.X = ControlCommonResourse.XXLeft; - listview.AddChidren(btnEspace); - + var btnEspace = new NormalViewControl(600, 58, true); + btnEspace.X = ControlCommonResourse.XXLeft; + listview.AddChidren(btnEspace); + //鑳屾櫙 var frameBack = new FrameLayout(); frameBack.Y = Application.GetRealHeight(490); @@ -274,11 +275,11 @@ frameBack.BackgroundColor = UserCenterColor.Current.White; listview.AddChidren(frameBack); - //鑳屽厜鐏寒搴� + //鑳屽厜鐏鑹� var btnLevelView = new NormalViewControl(400, 60, true); btnLevelView.X = ControlCommonResourse.XXLeft; btnLevelView.Y = Application.GetRealHeight(54); - btnLevelView.TextID = R.MyInternationalizationString.uBacklightBrightness; + btnLevelView.TextID = R.MyInternationalizationString.BackgroundLightColor; frameBack.AddChidren(btnLevelView); //褰撳墠浜害 @@ -324,15 +325,15 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); frameBack.AddChidren(frameColor); //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(50), false); + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(50), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -347,29 +348,29 @@ uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); //棰滆壊澶栨 - var btnColorLine = new NormalViewControl(Application.GetMinRealAverage(79), Application.GetMinRealAverage(79), false); + var btnColorLine = new NormalViewControl(this.GetPictrueRealSize(79), this.GetPictrueRealSize(79), false); btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18); - btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; btnColorLine.BorderWidth = 1; btnColorLine.BorderColor = 0xff666666; frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); - var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false); + var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false); btnColor.Y = Application.GetRealHeight(5); btnColor.X = btnColorView.Right + Application.GetRealHeight(23); - btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2; + btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2; btnColor.BackgroundColor = UserCenterColor.Current.ErrorColor; frameColor.AddChidren(btnColor, ChidrenBindMode.BindEventOnly); //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { @@ -390,10 +391,10 @@ seekBar1.ProgressBarColor = btnColor.BackgroundColor; }; }; - } - + } + #endregion - + #region 鈻� 鑺傝兘妯″紡琛宊________________________ /// <summary> /// 娣诲姞鑺傝兘妯″紡琛� @@ -415,18 +416,18 @@ btnSwitch.ButtonClickEvent += (sender, e) => { btnSwitch.IsSelected = !btnSwitch.IsSelected; - energyModeInfo.enable = btnSwitch.IsSelected; - //灞曞紑鎴栬�呯缉灏忕殑楂樺害 + energyModeInfo.enable = btnSwitch.IsSelected; + //灞曞紑鎴栬�呯缉灏忕殑楂樺害 var value = Application.GetRealHeight(443); if (btnSwitch.IsSelected == true) { - frameBack.Height += value; + frameBack.Height += value; } else { - frameBack.Height -= value; + frameBack.Height -= value; } - //瀹瑰櫒琛ュ厖 + //瀹瑰櫒琛ュ厖 this.FinishInitControl(listview, energyModeInfo.enable); }; if (energyModeInfo.enable == true) @@ -485,21 +486,21 @@ //灞曞紑鎴栬�呯缉灏忕殑楂樺害 var value = Application.GetRealHeight(443); frameBack.Height += value; - } - //娣诲姞鎺ヨ繎鎰熷簲 - this.AddProximitySensorsRow(frameBack); - } - + } + //娣诲姞鎺ヨ繎鎰熷簲 + this.AddProximitySensorsRow(frameBack); + } + #endregion - + #region 鈻� 鎺ヨ繎鎰熷簲___________________________ - + /// <summary> /// 鎺ヨ繎鎰熷簲琛� /// </summary> private void AddProximitySensorsRow(FrameRowControl frameRowControl) - { - //鎺ヨ繎鎰熷簲琛� + { + //鎺ヨ繎鎰熷簲琛� var frameBack = new FrameRowControl(); frameBack.BackgroundColor = UserCenterColor.Current.White; frameBack.UseClickStatu = false; @@ -510,18 +511,18 @@ //鎺ヨ繎鎰熷簲 frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400); //寮�鍏虫帶浠� - var btnSwitch = frameBack.AddMostRightSwitchIcon(); - - btnSwitch.ButtonClickEvent += (sender, e) => - { - btnSwitch.IsSelected = !btnSwitch.IsSelected; - proximitySensorsInfo.enable = btnSwitch.IsSelected; - }; + var btnSwitch = frameBack.AddMostRightSwitchIcon(); + + btnSwitch.ButtonClickEvent += (sender, e) => + { + btnSwitch.IsSelected = !btnSwitch.IsSelected; + proximitySensorsInfo.enable = btnSwitch.IsSelected; + }; if (proximitySensorsInfo.enable == true) { btnSwitch.IsSelected = true; - } - } + } + } #endregion #region 鈻� 鑾峰彇鍒濆鏁版嵁_______________________ @@ -584,7 +585,7 @@ //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) //璁惧鍚屼簨璇存柊椋庨潰鏉块粯璁�60绉掓椂闂达紝杩欐牱鎺ヨ繎鎰熷簲鍔熻兘鎵嶅悎鐞� - energyModeInfo.time = 65534; + energyModeInfo.time = 60; var result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); if (result == false) { @@ -598,15 +599,15 @@ this.CloseProgressBar(); return; } - - //浜害璋冭妭鏇存敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) - result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); - if (result == false) - { - this.CloseProgressBar(); - return; - } - + + //浜害璋冭妭鏇存敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) + result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); + if (result == false) + { + this.CloseProgressBar(); + return; + } + //璁剧疆鎸夐敭闈㈡澘鎸囧畾绔偣鐨勩�愭寚绀虹伅寮�鍏抽鑹层�戠殑淇℃伅 //result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData); //this.CloseProgressBar(); @@ -661,4 +662,4 @@ #endregion } -} +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs old mode 100644 new mode 100755 index 68aa327..51837e9 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs @@ -1,6 +1,5 @@ 锘縰sing System; using System.Collections.Generic; -using Org.BouncyCastle.Bcpg.OpenPgp; using Shared.Common; using ZigBee.Common; using ZigBee.Device; @@ -40,7 +39,7 @@ private string bindPmName = string.Empty; #endregion - + #region 鈻� 鍒濆鍖朹____________________________ /// <summary> @@ -50,8 +49,8 @@ public void ShowForm(CommonDevice i_device) { this.deviceObj = i_device; - //鑾峰彇鏁版嵁 - ReadDoorLockUserInfo(deviceObj); + //鑾峰彇鏁版嵁 + ReadDoorLockUserInfo(deviceObj); //璁剧疆澶撮儴淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uPanelSettion)); @@ -87,9 +86,9 @@ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028); //鍒濆鍖栬彍鍗曡 - this.InitMenuRow(); - - //鍒濆鍖栨甯冨畬鎴� + this.InitMenuRow(); + + //鍒濆鍖栨甯冨畬鎴� tableContr.FinishInitControl(); tableContr = null; @@ -101,14 +100,14 @@ { //鍏抽棴鑷韩 this.CloseForm(); - }; + }; } /// <summary> /// 鍒濆鍖栬彍鍗曡 /// </summary> private void InitMenuRow() - { + { this.listview.RemoveAll(); //娣诲姞鏂伴鐩爣 this.AddFreshAirRow(); @@ -164,7 +163,7 @@ }); } #endregion - + #region 鈻� 鏂伴鐩爣_________________________ /// <summary> /// 鏂伴鐩爣琛� @@ -178,15 +177,15 @@ //搴曠嚎 rowNewWind.AddBottomLine(); //鍙崇澶� - rowNewWind.AddRightArrow(); + rowNewWind.AddRightArrow(); - var msg = Language.StringByID(R.MyInternationalizationString.nothing); + var msg = Language.StringByID(R.MyInternationalizationString.nothing); if (!string.IsNullOrEmpty(bindFreshAirName)) { msg = bindFreshAirName; } var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700); - + rowNewWind.ButtonClickEvent += (sender, e) => { var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 1); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs old mode 100644 new mode 100755 index df25e36..4a06c6c --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs @@ -307,7 +307,7 @@ //鏀堕泦鍙互鏄剧ず鐨勮澶� this.dicShowDevice[room.Id].Add(device); } - } + } } return canShow; } @@ -317,7 +317,7 @@ bool canShow = false; return canShow; - } + } #endregion } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs old mode 100644 new mode 100755 index f72f4e3..b7a80c6 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs @@ -1,7 +1,6 @@ 锘縰sing System; using System.Collections.Generic; using System.Linq.Expressions; -using Microsoft.AppCenter.Crashes; using Shared.Common; using Shared.Phone.UserCenter.Safety; using ZigBee.Device; @@ -1362,7 +1361,7 @@ case 1: foreach (var deviceKeys in curRoom.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { //鑾峰彇璁惧绫诲瀷鐨� @@ -1382,7 +1381,7 @@ case 2: foreach (var deviceKeys in curRoom.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.TemperatureSensor) @@ -1395,7 +1394,7 @@ case 3: foreach (var deviceKeys in curRoom.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.FreshAirHumiditySensor) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs index 711e561..82f7f96 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs @@ -417,8 +417,8 @@ var frameBorder = new FrameLayout(); frameBorder.Y = Application.GetRealHeight(150); frameBorder.Gravity = Gravity.CenterHorizontal; - frameBorder.Width = Application.GetMinRealAverage(426); - frameBorder.Height = Application.GetMinRealAverage(426); + frameBorder.Width = this.GetPictrueRealSize(426); + frameBorder.Height = this.GetPictrueRealSize(426); listBackControl.frameTable.AddChidren(frameBorder); var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false); @@ -453,14 +453,14 @@ /// <returns></returns> private NormalViewControl InitDeviceButtonControl(FrameLayout frame, CommonDevice device) { - var btnIcon = new NormalViewControl(Application.GetMinRealAverage(52), Application.GetMinRealAverage(52), false); + var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false); btnIcon.Text = "Button" + device.DeviceEpoint; btnIcon.TextAlignment = TextAlignment.Center; btnIcon.TextColor = UserCenterColor.Current.TextGrayColor1; - if (frame is FrameLayoutControl) + if (frame is FrameLayoutStatuControl) { - ((FrameLayoutControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); - ((FrameLayoutControl)frame).ButtonClickEvent += (sender, e) => + ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); + ((FrameLayoutStatuControl)frame).ButtonClickEvent += (sender, e) => { //鎸夐敭鐐瑰嚮 this.DeviceEpointSelectEvent(btnIcon, null); @@ -498,15 +498,15 @@ { //鎸夐敭1 var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]); - btnButton1.Height = Application.GetMinRealAverage(175); - btnButton1.Width = Application.GetMinRealAverage(361); - btnButton1.Y = Application.GetMinRealAverage(39); + btnButton1.Height = this.GetPictrueRealSize(175); + btnButton1.Width = this.GetPictrueRealSize(361); + btnButton1.Y = this.GetPictrueRealSize(39); btnButton1.Gravity = Gravity.CenterHorizontal; //鎸夐敭2 var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]); - btnButton2.Height = Application.GetMinRealAverage(175); - btnButton2.Width = Application.GetMinRealAverage(361); + btnButton2.Height = this.GetPictrueRealSize(175); + btnButton2.Width = this.GetPictrueRealSize(361); btnButton2.Y = btnButton1.Bottom; btnButton2.Gravity = Gravity.CenterHorizontal; } @@ -525,32 +525,32 @@ //鎸夐敭1 var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]); btnButton1.TextSize = 12; - btnButton1.Height = Application.GetMinRealAverage(175); - btnButton1.Width = Application.GetMinRealAverage(183); - btnButton1.X = Application.GetMinRealAverage(34); - btnButton1.Y = Application.GetMinRealAverage(30); + btnButton1.Height = this.GetPictrueRealSize(175); + btnButton1.Width = this.GetPictrueRealSize(183); + btnButton1.X = this.GetPictrueRealSize(34); + btnButton1.Y = this.GetPictrueRealSize(30); //鎸夐敭2 var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]); btnButton2.TextSize = 12; - btnButton2.Height = Application.GetMinRealAverage(175); - btnButton2.Width = Application.GetMinRealAverage(183); + btnButton2.Height = this.GetPictrueRealSize(175); + btnButton2.Width = this.GetPictrueRealSize(183); btnButton2.X = btnButton1.Right; btnButton2.Y = btnButton1.Y; //鎸夐敭3 var btnButton3 = this.InitDeviceButtonControl(frameBack, listDevice[2]); btnButton3.TextSize = 12; - btnButton3.Height = Application.GetMinRealAverage(175); - btnButton3.Width = Application.GetMinRealAverage(183); + btnButton3.Height = this.GetPictrueRealSize(175); + btnButton3.Width = this.GetPictrueRealSize(183); btnButton3.X = btnButton1.X; - btnButton3.Y = btnButton1.Bottom + Application.GetMinRealAverage(4); + btnButton3.Y = btnButton1.Bottom + this.GetPictrueRealSize(4); //鎸夐敭4 var btnButton4 = this.InitDeviceButtonControl(frameBack, listDevice[3]); btnButton4.TextSize = 12; - btnButton4.Height = Application.GetMinRealAverage(175); - btnButton4.Width = Application.GetMinRealAverage(183); + btnButton4.Height = this.GetPictrueRealSize(175); + btnButton4.Width = this.GetPictrueRealSize(183); btnButton4.X = btnButton2.X; btnButton4.Y = btnButton3.Y; } @@ -568,10 +568,10 @@ { //鎸夐敭1锝炴寜閿�2 var frame1 = new FrameLayout(); - frame1.X = Application.GetMinRealAverage(34); - frame1.Y = Application.GetMinRealAverage(30); - frame1.Height = Application.GetMinRealAverage(183); - frame1.Width = Application.GetMinRealAverage(183); + frame1.X = this.GetPictrueRealSize(34); + frame1.Y = this.GetPictrueRealSize(30); + frame1.Height = this.GetPictrueRealSize(183); + frame1.Width = this.GetPictrueRealSize(183); frameBack.AddChidren(frame1); this.InitEightButtonPanelIcon(frame1, listDevice[0], listDevice[1]); @@ -587,7 +587,7 @@ //鎸夐敭5锝炴寜閿�6 var frame3 = new FrameLayout(); frame3.X = frame1.X; - frame3.Y = frame1.Bottom + Application.GetMinRealAverage(4); + frame3.Y = frame1.Bottom + this.GetPictrueRealSize(4); frame3.Height = frame1.Height; frame3.Width = frame1.Width; frameBack.AddChidren(frame3); @@ -596,7 +596,7 @@ //鎸夐敭7锝炴寜閿�8 var frame4 = new FrameLayout(); frame4.X = frame1.Right; - frame4.Y = frame1.Bottom + Application.GetMinRealAverage(4); + frame4.Y = frame1.Bottom + this.GetPictrueRealSize(4); frame4.Height = frame1.Height; frame4.Width = frame1.Width; frameBack.AddChidren(frame4); @@ -612,19 +612,19 @@ private void InitEightButtonPanelIcon(FrameLayout frameBack, CommonDevice device1, CommonDevice device2) { //鎸夐敭1 - var frameButton1 = new FrameLayoutControl(); + var frameButton1 = new FrameLayoutStatuControl(); frameButton1.UseClickStatu = false; - frameButton1.Height = Application.GetMinRealAverage(92); - frameButton1.Width = Application.GetMinRealAverage(183); + frameButton1.Height = this.GetPictrueRealSize(92); + frameButton1.Width = this.GetPictrueRealSize(183); frameBack.AddChidren(frameButton1); var btnButton1 = this.InitDeviceButtonControl(frameButton1, device1); btnButton1.TextSize = 10; - btnButton1.Height = Application.GetMinRealAverage(35); - btnButton1.Width = Application.GetMinRealAverage(183); - btnButton1.Y = Application.GetMinRealAverage(37); + btnButton1.Height = this.GetPictrueRealSize(35); + btnButton1.Width = this.GetPictrueRealSize(183); + btnButton1.Y = this.GetPictrueRealSize(37); //鎸夐敭2 - var frameButton2 = new FrameLayoutControl(); + var frameButton2 = new FrameLayoutStatuControl(); frameButton2.UseClickStatu = false; frameButton2.Height = frameButton1.Height; frameButton2.Width = frameButton1.Width; @@ -634,7 +634,7 @@ btnButton2.TextSize = 10; btnButton2.Height = btnButton1.Height; btnButton2.Width = btnButton1.Width; - btnButton2.Y = Application.GetMinRealAverage(20); + btnButton2.Y = this.GetPictrueRealSize(20); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs index 47590b7..3a46d58 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs @@ -417,8 +417,8 @@ var frameBorder = new FrameLayout(); frameBorder.Y = Application.GetRealHeight(150); frameBorder.Gravity = Gravity.CenterHorizontal; - frameBorder.Width = Application.GetMinRealAverage(426); - frameBorder.Height = Application.GetMinRealAverage(426); + frameBorder.Width = this.GetPictrueRealSize(426); + frameBorder.Height = this.GetPictrueRealSize(426); listBackControl.frameTable.AddChidren(frameBorder); var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false); @@ -448,12 +448,12 @@ /// <param name="frame">鎵╁ぇ鐐瑰嚮鍖哄煙鐨勫鍣�</param> /// <param name="device">璁惧瀵硅薄</param> /// <returns></returns> - private void InitDeviceIcon(FrameLayoutControl frame, CommonDevice device) + private void InitDeviceIcon(FrameLayoutStatuControl frame, CommonDevice device) { //涓嶄娇鐢ㄧ偣鍑荤壒鏁� frame.UseClickStatu = false; - var btnIcon = new NormalViewControl(Application.GetMinRealAverage(52), Application.GetMinRealAverage(52), false); + var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false); btnIcon.Name = "btn" + device.DeviceEpoint; btnIcon.Gravity = Gravity.Center; btnIcon.RadiusEx = 16; @@ -486,20 +486,20 @@ private void InitTwoButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice) { //鎸夐敭1 - var frame1 = new FrameLayoutControl(); - frame1.Height = Application.GetMinRealAverage(110); - frame1.Width = Application.GetMinRealAverage(110); - frame1.Y = Application.GetMinRealAverage(63); + var frame1 = new FrameLayoutStatuControl(); + frame1.Height = this.GetPictrueRealSize(110); + frame1.Width = this.GetPictrueRealSize(110); + frame1.Y = this.GetPictrueRealSize(63); frame1.Gravity = Gravity.CenterHorizontal; frameBack.AddChidren(frame1); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame1, listDevice[0]); //鎸夐敭2 - var frame2 = new FrameLayoutControl(); - frame2.Height = Application.GetMinRealAverage(110); - frame2.Width = Application.GetMinRealAverage(110); - frame2.Y = Application.GetMinRealAverage(245); + var frame2 = new FrameLayoutStatuControl(); + frame2.Height = this.GetPictrueRealSize(110); + frame2.Width = this.GetPictrueRealSize(110); + frame2.Y = this.GetPictrueRealSize(245); frame2.Gravity = Gravity.CenterHorizontal; frameBack.AddChidren(frame2); //鍒濆鍖栬澶囧浘鏍� @@ -518,31 +518,31 @@ private void InitThreeButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice) { //鎸夐敭1 - var frame1 = new FrameLayoutControl(); - frame1.Height = Application.GetMinRealAverage(110); - frame1.Width = Application.GetMinRealAverage(110); - frame1.Y = Application.GetMinRealAverage(63); + var frame1 = new FrameLayoutStatuControl(); + frame1.Height = this.GetPictrueRealSize(110); + frame1.Width = this.GetPictrueRealSize(110); + frame1.Y = this.GetPictrueRealSize(63); frame1.Gravity = Gravity.CenterHorizontal; frameBack.AddChidren(frame1); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame1, listDevice[0]); //鎸夐敭2 - var frame2 = new FrameLayoutControl(); - frame2.Height = Application.GetMinRealAverage(110); - frame2.Width = Application.GetMinRealAverage(110); - frame2.X = Application.GetMinRealAverage(63); - frame2.Y = Application.GetMinRealAverage(245); + var frame2 = new FrameLayoutStatuControl(); + frame2.Height = this.GetPictrueRealSize(110); + frame2.Width = this.GetPictrueRealSize(110); + frame2.X = this.GetPictrueRealSize(63); + frame2.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame2); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame2, listDevice[1]); //鎸夐敭3 - var frame3 = new FrameLayoutControl(); - frame3.Height = Application.GetMinRealAverage(110); - frame3.Width = Application.GetMinRealAverage(110); - frame3.X = Application.GetMinRealAverage(245); - frame3.Y = Application.GetMinRealAverage(245); + var frame3 = new FrameLayoutStatuControl(); + frame3.Height = this.GetPictrueRealSize(110); + frame3.Width = this.GetPictrueRealSize(110); + frame3.X = this.GetPictrueRealSize(245); + frame3.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame3); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame3, listDevice[2]); @@ -560,41 +560,41 @@ private void InitFourButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice) { //鎸夐敭1 - var frame1 = new FrameLayoutControl(); - frame1.Height = Application.GetMinRealAverage(110); - frame1.Width = Application.GetMinRealAverage(110); - frame1.X = Application.GetMinRealAverage(63); - frame1.Y = Application.GetMinRealAverage(63); + var frame1 = new FrameLayoutStatuControl(); + frame1.Height = this.GetPictrueRealSize(110); + frame1.Width = this.GetPictrueRealSize(110); + frame1.X = this.GetPictrueRealSize(63); + frame1.Y = this.GetPictrueRealSize(63); frameBack.AddChidren(frame1); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame1, listDevice[0]); //鎸夐敭2 - var frame2 = new FrameLayoutControl(); - frame2.Height = Application.GetMinRealAverage(110); - frame2.Width = Application.GetMinRealAverage(110); - frame2.X = Application.GetMinRealAverage(245); - frame2.Y = Application.GetMinRealAverage(63); + var frame2 = new FrameLayoutStatuControl(); + frame2.Height = this.GetPictrueRealSize(110); + frame2.Width = this.GetPictrueRealSize(110); + frame2.X = this.GetPictrueRealSize(245); + frame2.Y = this.GetPictrueRealSize(63); frameBack.AddChidren(frame2); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame2, listDevice[1]); //鎸夐敭3 - var frame3 = new FrameLayoutControl(); - frame3.Height = Application.GetMinRealAverage(110); - frame3.Width = Application.GetMinRealAverage(110); - frame3.X = Application.GetMinRealAverage(63); - frame3.Y = Application.GetMinRealAverage(245); + var frame3 = new FrameLayoutStatuControl(); + frame3.Height = this.GetPictrueRealSize(110); + frame3.Width = this.GetPictrueRealSize(110); + frame3.X = this.GetPictrueRealSize(63); + frame3.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame3); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame3, listDevice[2]); //鎸夐敭4 - var frame4 = new FrameLayoutControl(); - frame4.Height = Application.GetMinRealAverage(110); - frame4.Width = Application.GetMinRealAverage(110); - frame4.X = Application.GetMinRealAverage(245); - frame4.Y = Application.GetMinRealAverage(245); + var frame4 = new FrameLayoutStatuControl(); + frame4.Height = this.GetPictrueRealSize(110); + frame4.Width = this.GetPictrueRealSize(110); + frame4.X = this.GetPictrueRealSize(245); + frame4.Y = this.GetPictrueRealSize(245); frameBack.AddChidren(frame4); //鍒濆鍖栬澶囧浘鏍� this.InitDeviceIcon(frame4, listDevice[3]); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs index bb30fa1..c00653b 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs @@ -11,6 +11,10 @@ { #region 鏈湴鍙橀噺 /// <summary> + /// + /// </summary> + public static Action<bool> LogicAction = null; + /// <summary> /// 缃戝叧锛堥棬閿侊級鎵�鍦ㄧ殑鏃堕棿 /// </summary> public static DateTime DoorlockZoneTime = DateTime.Now; @@ -154,6 +158,11 @@ else { doorLock.IsDoorLockNormallyMode.Add(key, value); + } + + if (LogicAction != null) + { + LogicAction(value); } } @@ -406,6 +415,27 @@ alert.ConfirmClickEvent += async () => { + NomallyOpenModeInvalidTimeDialog(doorLock, action); + }; + } + + /// <summary> + /// 甯稿紑妯″紡澶辨晥鏃堕棿澶勭悊銆愬脊绐椼�� + /// </summary> + public static async void NomallyOpenModeInvalidTimeDialog(ZigBee.Device.DoorLock doorLock, Action action) + { + //澶辨晥璁剧疆 + string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime); + var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim); + var alertTimeInValidSetting = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim); + alertTimeInValidSetting.Show(); + + alertTimeInValidSetting.InvalidTimeAction += async (obj) => + { + //甯稿紑妯″紡澶辨晥鏃堕棿璁剧疆鎴愬姛 + var temp = int.Parse(obj); + DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp; + Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); var result = await doorLock.SetNormallyOpenModeFuncAsync(true); if (result == null || result.defaultControlResponseData == null) @@ -436,43 +466,24 @@ action?.Invoke(); Application.RunOnMainThread(() => { - NomallyOpenModeInvalidTimeDialog(doorLock); CommonPage.Loading.Hide(); }); } - }; - } - /// <summary> - /// 甯稿紑妯″紡澶辨晥鏃堕棿澶勭悊銆愬脊绐椼�� - /// </summary> - public static async void NomallyOpenModeInvalidTimeDialog(ZigBee.Device.DoorLock doorLock) - { - //澶辨晥璁剧疆 - string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime); - var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim); - var alertTimeInValidSetting = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim); - alertTimeInValidSetting.Show(); - - alertTimeInValidSetting.InvalidTimeAction += async (obj) => - { - //甯稿紑妯″紡澶辨晥鏃堕棿璁剧疆鎴愬姛 - var temp = int.Parse(obj); - DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp; //榛樿鍒涘缓甯稿紑妯″紡鐨勭壒娈婇�昏緫 var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); - if (!res) - { - Application.RunOnMainThread(() => - { - //榛樿鍒涘缓甯稿紑妯″紡澶辫触 - string msg0 = Language.StringByID(R.MyInternationalizationString.AddLogicNormallyModeFailed); - var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, msg0, Language.StringByID(R.MyInternationalizationString.confrim)); - alert.Show(); - //浜屾鍔犺浇寮圭獥 甯稿紑妯″紡寮�鍚彁绀� - NomallyOpenModeInvalidTimeDialog(doorLock); - }); - } + //if (!res) + //{ + // Application.RunOnMainThread(() => + // { + // //榛樿鍒涘缓甯稿紑妯″紡澶辫触 + // string msg0 = Language.StringByID(R.MyInternationalizationString.AddLogicNormallyModeFailed); + // var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, msg0, Language.StringByID(R.MyInternationalizationString.confrim)); + // alert.Show(); + // //浜屾鍔犺浇寮圭獥 甯稿紑妯″紡寮�鍚彁绀� + // NomallyOpenModeInvalidTimeDialog(doorLock, action); + // }); + //} }; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs index 401a08a..37af7b7 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs @@ -187,7 +187,7 @@ var listCheck = new List<string>(); rowBeloneArea.SelectRoomEvent += (roomKeys) => { - //閫夋嫨鏈垎閰嶆椂,娓呯┖ + //閫夋嫨鏈垎閰嶆椂,娓呯┖ if (roomKeys == string.Empty) { listCheck = new List<string>(); } foreach (var device in this.listNewDevice) { @@ -216,7 +216,7 @@ }; //璁惧妯″潡 - caption = Language.StringByID(R.MyInternationalizationString.BelongModel); + caption = Language.StringByID(R.MyInternationalizationString.BelongDevice); deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice); var btnType = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2); btnType.UseClickStatu = false; @@ -252,7 +252,7 @@ } }; } - #endregion + #endregion #region 娣诲姞鍏ㄩ儴鑿滃崟 /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs index 42ee72e..30d7a5f 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs @@ -1,8 +1,8 @@ 锘縰sing System; using System.Text; -using System.Text.RegularExpressions; -using Shared.Common; - +using System.Text.RegularExpressions; +using Shared.Common; + namespace Shared.Phone.UserCenter.DoorLock { /// <summary> @@ -18,11 +18,11 @@ /// <summary> /// 鐐瑰嚮鍙栨秷鐨勫洖璋冧簨浠� /// </summary> - public Action CancelClickEvent = null; + public Action CancelClickEvent = null; /// <summary> /// 鐐瑰嚮鑷姩鍖栫殑鍥炶皟浜嬩欢 /// </summary> - public Action LogicClickEvent = null; + public Action LogicClickEvent = null; /// <summary> /// 鐐瑰嚮纭鐨勫洖璋冧簨浠� /// </summary> @@ -50,16 +50,16 @@ /// <summary> /// 纭鎸夐挳鐨勬枃鏈� /// </summary> - private string buttonOkText = null; - /// <summary> - /// 澶辨晥鏃堕棿缂栬緫 - /// </summary> - private EditText editInvalidTime = null; - + private string buttonOkText = null; + /// <summary> + /// 澶辨晥鏃堕棿缂栬緫 + /// </summary> + private EditText editInvalidTime = null; + #endregion - + #region 鈻� 鍒濆鍖朹____________________________ - + /// <summary> /// 鏄剧ず涓�涓渶瑕佺‘璁ょ殑淇℃伅妗� /// </summary> @@ -71,7 +71,7 @@ //纭鎸夐挳鏂囨湰 this.buttonOkText = buttonText == null ? Language.StringByID(R.MyInternationalizationString.OkMsg) : buttonText; this.msgType = i_msgType; - this.msgText = i_msg; + this.msgText = i_msg; } #endregion @@ -84,8 +84,8 @@ public void Show() { try - { - //鍒濆鍖栨帶浠� + { + //鍒濆鍖栨帶浠� this.InitMsgControl(); } catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); } @@ -112,6 +112,11 @@ ((ViewGroup)nowForm).AddChidren(MsgControlFrameLayout); MsgControlFrameLayout.MouseDownEventHandler += (sender, e) => { + if (msgType == DoorLockMsgType.InValid) + { + return; + } + //绉婚櫎鐣岄潰 MsgControlFrameLayout.RemoveFromParent(); //鍥炶皟鍑芥暟 @@ -121,24 +126,24 @@ //鐧借壊鑳屾櫙妗� var frameBack = new FrameLayout(); - frameBack.BackgroundColor = UserCenterColor.Current.White; + frameBack.BackgroundColor = UserCenterColor.Current.White; frameBack.Gravity = Gravity.CenterHorizontal; frameBack.Radius = (uint)Application.GetRealHeight(17); - if (msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) - { - frameBack.Height = Application.GetRealHeight(409 + 127); - frameBack.Width = Application.GetRealWidth(850); - frameBack.Y = Application.GetRealHeight(648); - } - else - { - frameBack.Height = Application.GetRealHeight(478); - frameBack.Width = Application.GetRealWidth(792); - frameBack.Y = Application.GetRealHeight(706); + if (msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) + { + frameBack.Height = Application.GetRealHeight(409 + 127); + frameBack.Width = Application.GetRealWidth(850); + frameBack.Y = Application.GetRealHeight(648); } - MsgControlFrameLayout.AddChidren(frameBack); - - //鏍囬 + else + { + frameBack.Height = Application.GetRealHeight(478); + frameBack.Width = Application.GetRealWidth(792); + frameBack.Y = Application.GetRealHeight(706); + } + MsgControlFrameLayout.AddChidren(frameBack); + + //鏍囬 var btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(65), false); btnTitle.Y = Application.GetRealHeight(68); btnTitle.TextColor = 0xff333443; @@ -148,7 +153,7 @@ if (msgType == DoorLockMsgType.Confirm || msgType == DoorLockMsgType.DoorLockLogic || msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) { btnTitle.TextID = R.MyInternationalizationString.NormalTip; - } + } else if (msgType == DoorLockMsgType.InValid) { btnTitle.TextID = R.MyInternationalizationString.DoorLockInValidSetting; @@ -160,147 +165,152 @@ if (msgType == DoorLockMsgType.InValid) { - InitInValidTimeDialog(frameBack); - } - else if (msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) - { - CancelNormallyOpenModeWithLogicDialog(frameBack); - } - else - { - //娑堟伅 - var btnMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(180), false); - btnMsg.Y = Application.GetRealHeight(141); - btnMsg.IsMoreLines = true; - btnMsg.TextAlignment = TextAlignment.Center; - btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1; - btnMsg.Gravity = Gravity.CenterHorizontal; - frameBack.AddChidren(btnMsg); - btnMsg.Text = msgText; + InitInValidTimeDialog(frameBack); + } + else if (msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) + { + CancelNormallyOpenModeWithLogicDialog(frameBack); + } + else + { + //娑堟伅 + var btnMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(180), false); + btnMsg.Y = Application.GetRealHeight(141); + btnMsg.IsMoreLines = true; + btnMsg.TextAlignment = TextAlignment.Center; + btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1; + btnMsg.Gravity = Gravity.CenterHorizontal; + frameBack.AddChidren(btnMsg); + btnMsg.Text = msgText; } - if (msgType == DoorLockMsgType.Confirm || msgType == DoorLockMsgType.InValid || msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) + if (msgType == DoorLockMsgType.Confirm || msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) { //鍒濆鍖栫‘璁ょ被鍨嬬殑搴曢儴鎸夐挳 this.InitBottomConfirmButton(MsgControlFrameLayout, frameBack); - } + } + else if (msgType == DoorLockMsgType.InValid) + { + //澶辨晥璁剧疆鐨勫簳閮ㄦ寜閽� + this.InitBottomInvalidTimeButton(MsgControlFrameLayout, frameBack); + } else if (msgType == DoorLockMsgType.DoorLockLogic) { //澶辨晥璁剧疆鐨勫簳閮ㄦ寜閽� this.InitBottomLogicButton(MsgControlFrameLayout, frameBack); } - } - + } + /// <summary> /// 鍙栨秷甯稿紑妯″紡甯︽湁鑷姩鍖栫殑寮圭獥鏄剧ず /// </summary> /// <param name="frameMain"></param> /// <param name="frameBack"></param> private void CancelNormallyOpenModeWithLogicDialog(FrameLayout frameBack) - { - //娑堟伅 - var btnMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(63), false); - btnMsg.Y = Application.GetRealHeight(173); - btnMsg.IsMoreLines = true; - btnMsg.TextAlignment = TextAlignment.Center; - btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1; - btnMsg.Gravity = Gravity.CenterHorizontal; - frameBack.AddChidren(btnMsg); - btnMsg.Text = msgText; - - var alarmMsg = Language.StringByID(R.MyInternationalizationString.XingTip);//.Replace("{0}", "\r\n"); - var btnAlarmMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(104), false); - btnAlarmMsg.Y = Application.GetRealHeight(259); - btnAlarmMsg.IsMoreLines = true; - btnAlarmMsg.TextAlignment = TextAlignment.Center; - btnAlarmMsg.TextColor = ZigbeeColor.Current.XMAlarmText; - btnAlarmMsg.Gravity = Gravity.CenterHorizontal; - frameBack.AddChidren(btnAlarmMsg); - btnAlarmMsg.Text = alarmMsg; - } - + { + //娑堟伅 + var btnMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(63), false); + btnMsg.Y = Application.GetRealHeight(173); + btnMsg.IsMoreLines = true; + btnMsg.TextAlignment = TextAlignment.Center; + btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1; + btnMsg.Gravity = Gravity.CenterHorizontal; + frameBack.AddChidren(btnMsg); + btnMsg.Text = msgText; + + var alarmMsg = Language.StringByID(R.MyInternationalizationString.XingTip);//.Replace("{0}", "\r\n"); + var btnAlarmMsg = new NormalViewControl(frameBack.Width - Application.GetRealWidth(55 * 2), Application.GetRealHeight(104), false); + btnAlarmMsg.Y = Application.GetRealHeight(259); + btnAlarmMsg.IsMoreLines = true; + btnAlarmMsg.TextAlignment = TextAlignment.Center; + btnAlarmMsg.TextColor = ZigbeeColor.Current.XMAlarmText; + btnAlarmMsg.Gravity = Gravity.CenterHorizontal; + frameBack.AddChidren(btnAlarmMsg); + btnAlarmMsg.Text = alarmMsg; + } + /// <summary> /// 澶辨晥鏃堕棿璁剧疆鐨勫脊绐楁樉绀� /// </summary> /// <param name="frameMain"></param> /// <param name="frameBack"></param> private void InitInValidTimeDialog(FrameLayout frameBack) - { - //娑堟伅 - string[] msgArray = msgText.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); - var btnMsg1 = new Button() - { - Width = Application.GetRealWidth(389), - Height = Application.GetRealHeight(180), - Y = Application.GetRealHeight(141), - IsMoreLines = false, - TextColor = UserCenterColor.Current.TextGrayColor1, - TextAlignment = TextAlignment.CenterRight, - Text = msgArray[0], - }; - frameBack.AddChidren(btnMsg1); - - //澶辨晥鏃堕棿璁剧疆 - var editTextFrameLayout = new FrameLayout() - { - Width = Application.GetRealWidth(132), - Height = Application.GetRealHeight(81 + 40 * 2), - Y = Application.GetRealHeight(184 - 40), - X = btnMsg1.Right, - }; - frameBack.AddChidren(editTextFrameLayout); - editInvalidTime = new EditText() - { - Height = Application.GetRealHeight(81), - X = Application.GetRealWidth(132), - Y = Application.GetRealHeight(40), - Gravity = Gravity.Center, - Radius = (uint)Application.GetMinRealAverage(17), - BackgroundColor = ZigbeeColor.Current.XMPEditTextBackground, - TextColor = ZigbeeColor.Current.XMBlack, - TextAlignment = TextAlignment.Center, - TextSize = 14, - Text = DoorLockCommonInfo.NormallyOpenModeInvalidTime.ToString(), - PlaceholderTextColor = ZigbeeColor.Current.XMGray3, - IsNumberKeyboardType = true, - }; - editTextFrameLayout.AddChidren(editInvalidTime); - editInvalidTime.TextChangeEventHandler += (sender, e) => - { - if (!string.IsNullOrEmpty((sender as EditText).Text)) - { - var textFir = (sender as EditText).Text.Substring(0, 1); - if ((sender as EditText).Text.Length > 1) - { - if (textFir == "0") - { - editInvalidTime.Text = (sender as EditText).Text.Substring(1, 1); - } - } - if (int.Parse((sender as EditText).Text) > 72) - { - string msg0 = Language.StringByID(R.MyInternationalizationString.InvalidTimeMoreThan72); - var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, msg0, Language.StringByID(R.MyInternationalizationString.confrim)); - alert.Show(); - editInvalidTime.Text = "72"; - } - } - }; - - var btnMsg2 = new Button() - { - Width = Application.GetRealWidth(271), - Height = Application.GetRealHeight(180), - Y = Application.GetRealHeight(141), - X = editTextFrameLayout.Right, - IsMoreLines = false, - TextColor = UserCenterColor.Current.TextGrayColor1, - TextAlignment = TextAlignment.CenterLeft, - Text = msgArray[1] - }; - frameBack.AddChidren(btnMsg2); - } - + { + //娑堟伅 + string[] msgArray = msgText.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); + var btnMsg1 = new Button() + { + Width = Application.GetRealWidth(389), + Height = Application.GetRealHeight(180), + Y = Application.GetRealHeight(141), + IsMoreLines = false, + TextColor = UserCenterColor.Current.TextGrayColor1, + TextAlignment = TextAlignment.CenterRight, + Text = msgArray[0], + }; + frameBack.AddChidren(btnMsg1); + + //澶辨晥鏃堕棿璁剧疆 + var editTextFrameLayout = new FrameLayout() + { + Width = Application.GetRealWidth(132), + Height = Application.GetRealHeight(81 + 40 * 2), + Y = Application.GetRealHeight(184 - 40), + X = btnMsg1.Right, + }; + frameBack.AddChidren(editTextFrameLayout); + editInvalidTime = new EditText() + { + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(132), + Y = Application.GetRealHeight(40), + Gravity = Gravity.Center, + Radius = (uint)Application.GetMinRealAverage(17), + BackgroundColor = ZigbeeColor.Current.XMPEditTextBackground, + TextColor = ZigbeeColor.Current.XMBlack, + TextAlignment = TextAlignment.Center, + TextSize = 14, + Text = DoorLockCommonInfo.NormallyOpenModeInvalidTime.ToString(), + PlaceholderTextColor = ZigbeeColor.Current.XMGray3, + IsNumberKeyboardType = true, + }; + editTextFrameLayout.AddChidren(editInvalidTime); + editInvalidTime.TextChangeEventHandler += (sender, e) => + { + if (!string.IsNullOrEmpty((sender as EditText).Text)) + { + var textFir = (sender as EditText).Text.Substring(0, 1); + if ((sender as EditText).Text.Length > 1) + { + if (textFir == "0") + { + editInvalidTime.Text = (sender as EditText).Text.Substring(1, 1); + } + } + if (int.Parse((sender as EditText).Text) > 72) + { + string msg0 = Language.StringByID(R.MyInternationalizationString.InvalidTimeMoreThan72); + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, msg0, Language.StringByID(R.MyInternationalizationString.confrim)); + alert.Show(); + editInvalidTime.Text = "72"; + } + } + }; + + var btnMsg2 = new Button() + { + Width = Application.GetRealWidth(271), + Height = Application.GetRealHeight(180), + Y = Application.GetRealHeight(141), + X = editTextFrameLayout.Right, + IsMoreLines = false, + TextColor = UserCenterColor.Current.TextGrayColor1, + TextAlignment = TextAlignment.CenterLeft, + Text = msgArray[1] + }; + frameBack.AddChidren(btnMsg2); + } + /// <summary> /// 澶辨晥璁剧疆鐨勫簳閮ㄦ寜閽� /// </summary> @@ -315,8 +325,8 @@ btnDoorLockLogic.ButtonClickEvent += (sender, e) => { //绉婚櫎鐣岄潰 - frameMain.RemoveFromParent(); - //鍥炶皟鍑芥暟 + frameMain.RemoveFromParent(); + //鍥炶皟鍑芥暟 this.LogicClickEvent?.Invoke(); this.LogicClickEvent = null; }; @@ -333,6 +343,46 @@ this.InvalidClickEvent?.Invoke(); this.InvalidClickEvent = null; }; + } + + /// <summary> + /// 澶辨晥鏃堕棿鐨勫簳閮ㄦ寜閽� + /// </summary> + /// <param name="frameMain"></param> + /// <param name="frameBack"></param> + private void InitBottomInvalidTimeButton(FrameLayout frameMain, FrameLayout frameBack) + { + //纭畾鎸夐挳 + var btnConfirm = new BottomRightClickButton(frameBack.Width, Application.GetRealHeight(127)); + frameBack.AddChidren(btnConfirm); + btnConfirm.InitControl(buttonOkText); + btnConfirm.ButtonClickEvent += (sender, e) => + { + string textValue = string.Empty; + if (editInvalidTime != null) + { + textValue = editInvalidTime.Text.Trim(); + if (this.CheckInvalidTime(textValue.TrimStart('0')) == false) + { + return; + } + } + //绉婚櫎鐣岄潰 + frameMain.RemoveFromParent(); + if (msgType == DoorLockMsgType.InValid) + { + if (InvalidTimeAction != null) + { + InvalidTimeAction(textValue); + } + } + else + { + //鍥炶皟鍑芥暟 + this.ConfirmClickEvent?.Invoke(); + this.ConfirmClickEvent = null; + } + }; } /// <summary> @@ -346,16 +396,16 @@ var btnCancel = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127)); frameBack.AddChidren(btnCancel); var bottomLeftText = Language.StringByID(R.MyInternationalizationString.uCancel); - if (msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) - { - bottomLeftText = Language.StringByID(R.MyInternationalizationString.KeepNomallyMode); + if (msgType == DoorLockMsgType.NomallyOpenMode || msgType == DoorLockMsgType.CancelNomallyOpenModeWithLogic) + { + bottomLeftText = Language.StringByID(R.MyInternationalizationString.KeepNomallyMode); } btnCancel.InitControl(bottomLeftText); btnCancel.ButtonClickEvent += (sender, e) => { //绉婚櫎鐣岄潰 - frameMain.RemoveFromParent(); - //鍥炶皟鍑芥暟 + frameMain.RemoveFromParent(); + //鍥炶皟鍑芥暟 this.CancelClickEvent?.Invoke(); this.CancelClickEvent = null; }; @@ -365,39 +415,39 @@ frameBack.AddChidren(btnConfirm); btnConfirm.InitControl(buttonOkText); btnConfirm.ButtonClickEvent += (sender, e) => - { - string textValue = string.Empty; + { + string textValue = string.Empty; if (editInvalidTime != null) { textValue = editInvalidTime.Text.Trim(); if (this.CheckInvalidTime(textValue.TrimStart('0')) == false) { return; - } - } - //绉婚櫎鐣岄潰 + } + } + //绉婚櫎鐣岄潰 frameMain.RemoveFromParent(); - if (msgType == DoorLockMsgType.InValid) - { - if (InvalidTimeAction != null) - { - InvalidTimeAction(textValue); - } - } - else - { - //鍥炶皟鍑芥暟 - this.ConfirmClickEvent?.Invoke(); - this.ConfirmClickEvent = null; - } + if (msgType == DoorLockMsgType.InValid) + { + if (InvalidTimeAction != null) + { + InvalidTimeAction(textValue); + } + } + else + { + //鍥炶皟鍑芥暟 + this.ConfirmClickEvent?.Invoke(); + this.ConfirmClickEvent = null; + } }; - } - + } + /// <summary> /// 妫�娴嬪け鏁堟椂闂� /// </summary> /// <param name="tetxValue"></param> - /// <returns></returns> + /// <returns></returns> private bool CheckInvalidTime(string tetxValue) { if (tetxValue == string.Empty) @@ -438,35 +488,35 @@ return false; } return true; - } - + } + #endregion - + /// <summary> /// 淇℃伅鏄剧ず鐨勭被鍨� /// </summary> - public enum DoorLockMsgType - { + public enum DoorLockMsgType + { /// <summary> /// 纭绫诲瀷 /// </summary> - Confirm = 1, + Confirm = 1, /// <summary> /// 澶辨晥璁剧疆 /// </summary> - InValid = 2, + InValid = 2, /// <summary> /// 閫昏緫绫诲瀷 /// </summary> - DoorLockLogic = 3, + DoorLockLogic = 3, /// <summary> /// 甯稿紑妯″紡 /// </summary> - NomallyOpenMode = 4, + NomallyOpenMode = 4, /// <summary> /// 鍙栨秷甯︽湁閫昏緫鐨勫父寮�妯″紡 /// </summary> - CancelNomallyOpenModeWithLogic = 5, - } - } -} + CancelNomallyOpenModeWithLogic = 5, + } + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs index cc714f0..281a899 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs @@ -688,7 +688,7 @@ DoorLockCommonInfo.NormallyOpenModeValue(doorLock, tempRes); Application.RunOnMainThread(async () => { - var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(); + var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(2); if (resTemp == 1) { HaveLogicNormallyOpenMode = true; @@ -1415,11 +1415,11 @@ btnNormallyOpenFrameLayout.Width = Application.GetRealWidth(0); return; } - string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; - if (!doorLock.IsDoorLockNormallyMode.ContainsKey(key)) - { - return; - } + string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; + if (!doorLock.IsDoorLockNormallyMode.ContainsKey(key)) + { + return; + } if (doorLock.IsDoorLockNormallyMode[key] == true) { btnNormallyOpen.IsSelected = true; @@ -1517,6 +1517,7 @@ CommonPage.Instance.IsDrawerLockMode = false; } ZbGateway.StatusList.Remove(this); + DoorLockCommonInfo.LogicAction = null; base.RemoveFromParent(); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs index ce52da1..c6d8d0a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs @@ -60,9 +60,9 @@ //鍥炬爣 var picGwImage = new FrameLayout(); - picGwImage.Width = Application.GetMinRealAverage(861); - picGwImage.Height = Application.GetMinRealAverage(478); - picGwImage.Y = Application.GetRealWidth(251); + picGwImage.Width = this.GetPictrueRealSize(861); + picGwImage.Height = this.GetPictrueRealSize(478); + picGwImage.Y = Application.GetRealHeight(251); picGwImage.Gravity = Gravity.CenterHorizontal; picGwImage.BackgroundImagePath = "Gateway/WiredGatewaySearching.png"; bodyFrameLayout.AddChidren(picGwImage); @@ -89,8 +89,8 @@ //鍥炬爣 var picGwImage = new FrameLayout(); - picGwImage.Width = Application.GetMinRealAverage(861); - picGwImage.Height = Application.GetMinRealAverage(478); + picGwImage.Width = this.GetPictrueRealSize(861); + picGwImage.Height = this.GetPictrueRealSize(478); picGwImage.Y = Application.GetRealWidth(158); picGwImage.Gravity = Gravity.CenterHorizontal; picGwImage.BackgroundImagePath = "Gateway/WiredGatewaySearching.png"; @@ -98,12 +98,12 @@ var btnFailIcon = new PicViewControl(66, 66); btnFailIcon.UnSelectedImagePath = "Item/FailIcon.png"; btnFailIcon.Gravity = Gravity.CenterHorizontal; - btnFailIcon.Y = Application.GetMinRealAverage(181); + btnFailIcon.Y = this.GetPictrueRealSize(181); picGwImage.AddChidren(btnFailIcon); //鎼滅储澶辫触 var btnFailView = new NormalViewControl(300, 60, true); btnFailView.TextAlignment = TextAlignment.Center; - btnFailView.Y = Application.GetMinRealAverage(305); + btnFailView.Y = this.GetPictrueRealSize(305); btnFailView.Gravity = Gravity.CenterHorizontal; btnFailView.TextColor = UserCenterColor.Current.TextGrayColor3; btnFailView.TextID = R.MyInternationalizationString.uSearchFail; @@ -151,7 +151,7 @@ bodyFrameLayout.AddChidren(btnMsg5); //閲嶈瘯 - var frameback = new FrameLayoutControl(); + var frameback = new FrameLayoutStatuControl(); frameback.UseClickStatu = false; frameback.Y = Application.GetRealHeight(1259); frameback.Gravity = Gravity.CenterHorizontal; @@ -202,11 +202,11 @@ private void InitConcetionAnimete(FrameLayout picGwImage, NormalViewControl btnMsg) { //棣栨牸鐨刋杞� - int firstPoint = Application.GetMinRealAverage(288); + int firstPoint = this.GetPictrueRealSize(288); //涓�鏍肩殑瀹藉害 - int width = Application.GetMinRealAverage(22); + int width = this.GetPictrueRealSize(22); //闂磋窛澶у皬 - int space = Application.GetMinRealAverage(12); + int space = this.GetPictrueRealSize(12); //鐢熸垚鏍煎瓙鍧愭爣 var listPoint = new List<int>(); @@ -219,7 +219,7 @@ var btnRound = new PicViewControl(width, width, false); btnRound.Radius = (uint)width / 2; btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor; - btnRound.Y = Application.GetMinRealAverage(202); + btnRound.Y = this.GetPictrueRealSize(202); btnRound.X = listPoint[0]; picGwImage.AddChidren(btnRound); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs index 467eb3d..22423a0 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs @@ -33,8 +33,8 @@ //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(392); - framePic.Height = Application.GetMinRealAverage(259); + framePic.Width = this.GetPictrueRealSize(392); + framePic.Height = this.GetPictrueRealSize(259); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(426); framePic.BackgroundImagePath = "Gateway/WirelessApDirection.png"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs index dee86aa..840b0f4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs @@ -62,8 +62,8 @@ //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(852); - framePic.Height = Application.GetMinRealAverage(478); + framePic.Width = this.GetPictrueRealSize(852); + framePic.Height = this.GetPictrueRealSize(478); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(285); framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection3Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection3Form.cs index aa16a54..69bdde4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection3Form.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection3Form.cs @@ -63,8 +63,8 @@ //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(861); - framePic.Height = Application.GetMinRealAverage(245); + framePic.Width = this.GetPictrueRealSize(861); + framePic.Height = this.GetPictrueRealSize(245); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(363); framePic.BackgroundImagePath = "Gateway/WirelessApGatewaySearching.png"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs index b2414b7..b721d1b 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs @@ -82,8 +82,8 @@ //鍥炬爣 var picGwImage = new FrameLayout(); - picGwImage.Width = Application.GetMinRealAverage(861); - picGwImage.Height = Application.GetMinRealAverage(245); + picGwImage.Width = this.GetPictrueRealSize(861); + picGwImage.Height = this.GetPictrueRealSize(245); picGwImage.Y = Application.GetRealWidth(223); picGwImage.Gravity = Gravity.CenterHorizontal; picGwImage.BackgroundImagePath = "Gateway/WirelessApGatewaySearching.png"; @@ -91,7 +91,7 @@ var btnFailIcon = new PicViewControl(66, 66); btnFailIcon.UnSelectedImagePath = "Item/FailIcon.png"; btnFailIcon.Gravity = Gravity.CenterHorizontal; - btnFailIcon.Y = Application.GetMinRealAverage(110); + btnFailIcon.Y = this.GetPictrueRealSize(110); picGwImage.AddChidren(btnFailIcon); //鎼滅储澶辫触 var btnFailView = new NormalViewControl(300, 60, true); @@ -144,7 +144,7 @@ bodyFrameLayout.AddChidren(btnMsg5); //閲嶈瘯 - var frameback = new FrameLayoutControl(); + var frameback = new FrameLayoutStatuControl(); frameback.UseClickStatu = false; frameback.Y = Application.GetRealHeight(1259); frameback.Gravity = Gravity.CenterHorizontal; @@ -196,8 +196,8 @@ { //鍥炬爣 var btnGwImage = new FrameLayout(); - btnGwImage.Width = Application.GetMinRealAverage(861); - btnGwImage.Height = Application.GetMinRealAverage(245); + btnGwImage.Width = this.GetPictrueRealSize(861); + btnGwImage.Height = this.GetPictrueRealSize(245); btnGwImage.Y = Application.GetRealHeight(360); btnGwImage.Gravity = Gravity.CenterHorizontal; btnGwImage.BackgroundImagePath = "Gateway/WirelessApGatewaySearching.png"; @@ -212,11 +212,11 @@ bodyFrameLayout.AddChidren(btnMsg); //棣栨牸鐨刋杞� - int firstPoint = Application.GetMinRealAverage(275); + int firstPoint = this.GetPictrueRealSize(275); //涓�鏍肩殑瀹藉害 - int width = Application.GetMinRealAverage(22); + int width = this.GetPictrueRealSize(22); //闂磋窛澶у皬 - int space = Application.GetMinRealAverage(12); + int space = this.GetPictrueRealSize(12); //鐢熸垚鏍煎瓙鍧愭爣 var listPoint = new List<int>(); @@ -229,7 +229,7 @@ var btnRound = new PicViewControl(width, width, false); btnRound.Radius = (uint)width / 2; btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor; - btnRound.Y = Application.GetMinRealAverage(135); + btnRound.Y = this.GetPictrueRealSize(135); btnRound.X = listPoint[0]; btnGwImage.AddChidren(btnRound); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpDirectionForm.cs index 013dee5..90d4b15 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpDirectionForm.cs @@ -33,8 +33,8 @@ //鍥剧墖 var framePic = new FrameLayout(); - framePic.Width = Application.GetMinRealAverage(852); - framePic.Height = Application.GetMinRealAverage(478); + framePic.Width = this.GetPictrueRealSize(852); + framePic.Height = this.GetPictrueRealSize(478); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(251); framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs index 5a3c676..9b41e07 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs @@ -82,8 +82,8 @@ //鍥炬爣 var picGwImage = new FrameLayout(); - picGwImage.Width = Application.GetMinRealAverage(852); - picGwImage.Height = Application.GetMinRealAverage(478); + picGwImage.Width = this.GetPictrueRealSize(852); + picGwImage.Height = this.GetPictrueRealSize(478); picGwImage.Y = Application.GetRealWidth(158); picGwImage.Gravity = Gravity.CenterHorizontal; picGwImage.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png"; @@ -91,12 +91,12 @@ var btnFailIcon = new PicViewControl(66, 66); btnFailIcon.UnSelectedImagePath = "Item/FailIcon.png"; btnFailIcon.Gravity = Gravity.CenterHorizontal; - btnFailIcon.Y = Application.GetMinRealAverage(200); + btnFailIcon.Y = this.GetPictrueRealSize(200); picGwImage.AddChidren(btnFailIcon); //鎼滅储澶辫触 var btnFailView = new NormalViewControl(300, 60, true); btnFailView.TextAlignment = TextAlignment.Center; - btnFailView.Y = Application.GetMinRealAverage(305); + btnFailView.Y = this.GetPictrueRealSize(305); btnFailView.Gravity = Gravity.CenterHorizontal; btnFailView.TextColor = UserCenterColor.Current.TextGrayColor3; btnFailView.TextID = R.MyInternationalizationString.uSearchFail; @@ -144,7 +144,7 @@ bodyFrameLayout.AddChidren(btnMsg5); //閲嶈瘯 - var frameback = new FrameLayoutControl(); + var frameback = new FrameLayoutStatuControl(); frameback.UseClickStatu = false; frameback.Y = Application.GetRealHeight(1259); frameback.Gravity = Gravity.CenterHorizontal; @@ -196,8 +196,8 @@ { //鍥炬爣 var btnGwImage = new FrameLayout(); - btnGwImage.Width = Application.GetMinRealAverage(852); - btnGwImage.Height = Application.GetMinRealAverage(478); + btnGwImage.Width = this.GetPictrueRealSize(852); + btnGwImage.Height = this.GetPictrueRealSize(478); btnGwImage.Y = Application.GetRealHeight(193); btnGwImage.Gravity = Gravity.CenterHorizontal; btnGwImage.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png"; @@ -212,11 +212,11 @@ bodyFrameLayout.AddChidren(btnMsg); //棣栨牸鐨刋杞� - int firstPoint = Application.GetMinRealAverage(280); + int firstPoint = this.GetPictrueRealSize(280); //涓�鏍肩殑瀹藉害 - int width = Application.GetMinRealAverage(22); + int width = this.GetPictrueRealSize(22); //闂磋窛澶у皬 - int space = Application.GetMinRealAverage(12); + int space = this.GetPictrueRealSize(12); //鐢熸垚鏍煎瓙鍧愭爣 var listPoint = new List<int>(); @@ -229,7 +229,7 @@ var btnRound = new PicViewControl(width, width, false); btnRound.Radius = (uint)width / 2; btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor; - btnRound.Y = Application.GetMinRealAverage(225); + btnRound.Y = this.GetPictrueRealSize(225); btnRound.X = listPoint[0]; btnGwImage.AddChidren(btnRound); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs index be082e4..de5e249 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs @@ -59,7 +59,7 @@ bodyFrameLayout.AddChidren(btnMsg); //缁х画娣诲姞缃戝叧 - var frameAdd = new FrameLayoutControl(); + var frameAdd = new FrameLayoutStatuControl(); frameAdd.UseClickStatu = false; frameAdd.Y = Application.GetRealHeight(1224); frameAdd.Gravity = Gravity.CenterHorizontal; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs index c8523c8..e334f30 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs @@ -238,20 +238,20 @@ //鏄剧ず缂栬緫澶囪�冨悕鐢婚潰 this.ShowEditorBackupForm(fileInfo); }; - } - //鍒犻櫎 - var btnDelete = rowLayout.AddDeleteControl(); - btnDelete.ButtonClickEvent += (sender, e) => - { - //纭鍒犻櫎璇ュ浠芥暟鎹�? - string msg = Language.StringByID(R.MyInternationalizationString.uDoDeleteBackupMsg); - this.ShowMassage(ShowMsgType.Confirm, msg, () => + //鍒犻櫎 + var btnDelete = rowLayout.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => { - //鍒犻櫎澶囦唤鏂囨。 - this.DeleteBackInfo(fileInfo.Id); - }); - }; + //纭鍒犻櫎璇ュ浠芥暟鎹�? + string msg = Language.StringByID(R.MyInternationalizationString.uDoDeleteBackupMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //鍒犻櫎澶囦唤鏂囨。 + this.DeleteBackInfo(fileInfo.Id); + }); + }; + } } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs index 83e6910..04abc3d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs @@ -7,7 +7,7 @@ /// <summary> /// 寮曞鐣岄潰鐨勫叡閫氱晫闈� /// </summary> - public class GuideCommonForm : FrameLayout + public class GuideCommonForm : FrameLayoutBase { #region 鈻� 鍙橀噺澹版槑___________________________ @@ -243,8 +243,8 @@ //涓婚〉 var btnMenuHome = new IconViewControl(10, false); btnMenuHome.X = Application.GetRealWidth(109); - btnMenuHome.Width = Application.GetMinRealAverage(138); - btnMenuHome.Height = Application.GetMinRealAverage(98); + btnMenuHome.Width = this.GetPictrueRealSize(138); + btnMenuHome.Height = this.GetPictrueRealSize(98); btnMenuHome.UnSelectedImagePath = "Navigation/HomeSelected.png"; frameMenu.AddChidren(btnMenuHome); var btnMenuHomeName = new NormalViewControl(btnMenuHome.Width, Application.GetRealHeight(40), false); @@ -259,8 +259,8 @@ //鍒嗙被 var btnFenlei = new IconViewControl(10, false); btnFenlei.X = Application.GetRealWidth(469); - btnFenlei.Width = Application.GetMinRealAverage(138); - btnFenlei.Height = Application.GetMinRealAverage(98); + btnFenlei.Width = this.GetPictrueRealSize(138); + btnFenlei.Height = this.GetPictrueRealSize(98); btnFenlei.UnSelectedImagePath = "Navigation/Category.png"; frameMenu.AddChidren(btnFenlei); var btnFenleiName = new NormalViewControl(btnFenlei.Width, Application.GetRealHeight(40), false); @@ -275,8 +275,8 @@ //鎴戠殑 var btnMy = new IconViewControl(10, false); btnMy.X = Application.GetRealWidth(832); - btnMy.Width = Application.GetMinRealAverage(138); - btnMy.Height = Application.GetMinRealAverage(98); + btnMy.Width = this.GetPictrueRealSize(138); + btnMy.Height = this.GetPictrueRealSize(98); btnMy.UnSelectedImagePath = "Navigation/Setting.png"; frameMenu.AddChidren(btnMy); var btnMyName = new NormalViewControl(btnMy.Width, Application.GetRealHeight(40), false); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs index 266fc22..2d30198 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs @@ -60,7 +60,7 @@ bodyFrameLayout.AddChidren(btnMsg); //绔嬪嵆澶囦唤(鎺ㄨ崘) - var frameback = new FrameLayoutControl(); + var frameback = new FrameLayoutStatuControl(); frameback.UseClickStatu = false; frameback.Y = Application.GetRealHeight(1201); frameback.Gravity = Gravity.CenterHorizontal; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlBackupListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlBackupListForm.cs index 8f53bac..b2c2409 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlBackupListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlBackupListForm.cs @@ -219,20 +219,20 @@ //鏄剧ず缂栬緫澶囪�冨悕鐢婚潰 this.ShowEditorBackupForm(fileInfo); }; - } - //鍒犻櫎 - var btnDelete = rowLayout.AddDeleteControl(); - btnDelete.ButtonClickEvent += (sender, e) => - { - //纭鍒犻櫎璇ュ浠芥暟鎹�? - string msg = Language.StringByID(R.MyInternationalizationString.uDoDeleteBackupMsg); - this.ShowMassage(ShowMsgType.Confirm, msg, () => + //鍒犻櫎 + var btnDelete = rowLayout.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => { - //鍒犻櫎澶囦唤鏂囨。 - this.DeleteBackInfo(fileInfo.Id, ShowErrorMode.YES); - }); - }; + //纭鍒犻櫎璇ュ浠芥暟鎹�? + string msg = Language.StringByID(R.MyInternationalizationString.uDoDeleteBackupMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //鍒犻櫎澶囦唤鏂囨。 + this.DeleteBackInfo(fileInfo.Id, ShowErrorMode.YES); + }); + }; + } } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs index cfdeb44..43f19bc 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs @@ -60,13 +60,25 @@ listView.AddChidren(row1); row1.AddLeftCaption("鏍圭洰褰曟枃浠�", 800); row1.AddRightArrow(); - + row1.AddBottomLine(); row1.ButtonClickEvent += (sender, e) => { var form = new HideOptionFileListForm(); form.AddForm(UserCenterLogic.CombinePath()); }; + //鏌ョ湅鍏ㄩ儴鏂囦欢 + var row2 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row2); + row2.AddLeftCaption("鏌ョ湅鍏ㄩ儴鏂囦欢", 800); + row2.AddRightArrow(); + + row2.ButtonClickEvent += (sender, e) => + { + var form = new HideOptionSearchAllFile(); + form.AddForm(Shared.IO.FileUtils.RootPath); + }; + listView.AdjustRealHeight(Application.GetRealHeight(23)); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs index 2eda89e..dd5e4ed 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs @@ -36,8 +36,8 @@ { var btnPic = new ImageView(); btnPic.Y = Application.GetRealHeight(60); - btnPic.Width = Application.GetMinRealAverage(887); - btnPic.Height = Application.GetMinRealAverage(444); + btnPic.Width = this.GetPictrueRealSize(887); + btnPic.Height = this.GetPictrueRealSize(444); btnPic.Gravity = Gravity.CenterHorizontal; btnPic.Radius= (uint)Application.GetRealHeight(17); btnPic.ImageBytes = Shared.IO.FileUtils.ReadFile(i_file); @@ -62,7 +62,6 @@ btnText.TextAlignment = TextAlignment.TopLeft; btnText.TextColor = UserCenterColor.Current.TextColor1; btnText.Text = textValue; - btnText.Enable = false; bodyFrameLayout.AddChidren(btnText); } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs index d712c7c..0f19b03 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs @@ -34,7 +34,7 @@ btnButton.TextColor = UserCenterColor.Current.TopLayoutTitleText; btnButton.TextAlignment = TextAlignment.BottomRight; btnButton.TextSize = 17; - btnButton.Text = "瑙e瘑"; + btnButton.Text = "缈昏瘧"; topFrameLayout.AddChidren(btnButton); btnButton.ButtonClickEvent += (sender, e) => { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs index 16c2cb3..1b5698f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs @@ -55,7 +55,7 @@ this.AddTopButtomRowControl("浣忓畢ID", 400, Common.Config.Instance.Home.Id, 900); - this.AddTopButtomRowControl("璐﹀彿GUID", 400, Common.Config.Instance.Home.MainUserDistributedMark, 900); + this.AddTopButtomRowControl("璐﹀彿GUID", 400, string.IsNullOrEmpty(Common.Config.Instance.Guid) == true ? Common.Config.Instance.Home.MainUserDistributedMark : Common.Config.Instance.Guid, 900); this.AddNormalRowControl("浣忓畢鍒嗕韩", 400, Common.Config.Instance.Home.IsOthreShare == true ? "鏄�" : "鍚�", 400); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs new file mode 100755 index 0000000..4e4a511 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs @@ -0,0 +1,220 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter.HideOption +{ + /// <summary> + /// 鏌ョ湅鍏ㄩ儴鏂囦欢 + /// </summary> + public class HideOptionSearchAllFile : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 瑙e瘑 + /// </summary> + private bool decryptPassword = false; + private string nowDirectory = string.Empty; + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm(string directory) + { + this.nowDirectory = directory; + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText("鏂囦欢鍒楄〃"); + + var btnButton = new NormalViewControl(200, 69, true); + btnButton.Gravity = Gravity.CenterVertical; + btnButton.X = bodyFrameLayout.Width - Application.GetRealWidth(200) - ControlCommonResourse.XXLeft; + btnButton.TextColor = UserCenterColor.Current.TopLayoutTitleText; + btnButton.TextAlignment = TextAlignment.BottomRight; + btnButton.TextSize = 17; + btnButton.Text = "缈昏瘧"; + topFrameLayout.AddChidren(btnButton); + btnButton.ButtonClickEvent += (sender, e) => + { + if (this.decryptPassword == false) + { + this.decryptPassword = true; + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(nowDirectory); + } + }; + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(nowDirectory); + + this.BackButtonClickEvent += (btnContr) => + { + string rootPath = Shared.IO.FileUtils.RootPath.Trim('/'); + if (this.nowDirectory.Trim('/') == rootPath) + { + this.CloseForm(); + return; + } + string[] Arry = this.nowDirectory.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); + string nextDir = string.Empty; + for (int i = 0; i < Arry.Length - 1; i++) + { + nextDir += Arry[i] + "/"; + } + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(nextDir); + }; + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame(string directory) + { + this.nowDirectory = directory; + this.ClearBodyFrame(); + + var listDirectory = new List<string>(); + var listAllFile = new List<string>(); + + string rootPath = Shared.IO.FileUtils.RootPath.Trim('/'); + if (this.nowDirectory.Trim('/') == rootPath) + { + //鏍圭洰褰曞彧瑕佷袱涓氨鍙互浜� + listDirectory.Add(Common.Config.Instance.Guid); + listDirectory.Add(Application.Skin != null ? Application.Skin : "Phone"); + } + else + { + var files = System.IO.Directory.GetDirectories(directory); + foreach (var file in files) + { + string[] arry = file.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); + listDirectory.Add(arry[arry.Length - 1]); + } + listDirectory.Sort(); + + listAllFile = HdlAutoBackupLogic.GetFileFromDirectory(directory.TrimEnd('/')); + listAllFile.Sort(); + } + + var listView = new VerticalListControl(23); + listView.BackgroundColor = UserCenterColor.Current.White; + listView.Height = bodyFrameLayout.Height; + bodyFrameLayout.AddChidren(listView); + + if (listDirectory.Count > 0) + { + var row1 = new RowLayoutControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.frameTable.UseClickStatu = false; + row1.frameTable.AddLeftCaption("銆愭枃浠跺す鍒楄〃銆�", 800); + + for (int i = 0; i < listDirectory.Count; i++) + { + this.AddDirectoryRowControl(listView, listDirectory[i], directory, i != listDirectory.Count - 1); + } + } + + if (listAllFile.Count > 0) + { + var row1 = new RowLayoutControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.frameTable.UseClickStatu = false; + row1.frameTable.AddLeftCaption("銆愭枃浠跺垪琛ㄣ��", 800); + for (int i = 0; i < listAllFile.Count; i++) + { + this.AddFileRowControl(listView, listAllFile[i], directory, i != listAllFile.Count - 1); + } + } + listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(50)); + } + + private void AddDirectoryRowControl(VerticalListControl listView, string directoryName, string directory, bool addLine) + { + string dirNewName = directoryName; + if (decryptPassword == true) + { + try + { + dirNewName = UserCenterLogic.DecryptPassword(UserCenterResourse.FileEncryptKey, directoryName); + } + catch { dirNewName = directoryName; } + } + + var row1 = new RowLayoutControl(listView.rowSpace / 2); + listView.AddChidren(row1); + var btnName = row1.frameTable.AddLeftCaption(dirNewName, 800); + btnName.IsMoreLines = true; + if (addLine == true) + { + row1.frameTable.AddBottomLine(); + } + row1.frameTable.AddRightArrow(); + + row1.frameTable.ButtonClickEvent += (sender, e) => + { + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.decryptPassword = false; + this.InitMiddleFrame(System.IO.Path.Combine(directory, directoryName)); + }; + } + + private void AddFileRowControl(VerticalListControl listView, string fileName, string directory, bool addLine) + { + string fileNewName = fileName; + if (decryptPassword == true && fileName.StartsWith("Device_") == false) + { + try + { + fileNewName = UserCenterLogic.DecryptPassword(UserCenterResourse.FileEncryptKey, fileName); + } + catch { fileNewName = fileName; } + } + + var row1 = new RowLayoutControl(listView.rowSpace / 2); + listView.AddChidren(row1); + var btnName = row1.frameTable.AddLeftCaption(fileNewName, 800); + btnName.IsMoreLines = true; + if (addLine == true) + { + row1.frameTable.AddBottomLine(); + } + row1.frameTable.AddRightArrow(); + + var btnDelete = row1.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => + { + this.ShowMassage(ShowMsgType.Confirm, "鏄惁娓呴櫎璇ョ紦瀛樻枃浠�", () => + { + var myFile = System.IO.Path.Combine(directory, fileName); + try + { + System.IO.File.Delete(myFile); + row1.RemoveFromParent(); + } + catch (Exception ex) + { + this.ShowMassage(ShowMsgType.Error, "娓呴櫎缂撳瓨鏂囦欢寮傚父"); + HdlLogLogic.Current.WriteLog(ex, "娓呴櫎缂撳瓨鏂囦欢寮傚父"); + } + }); + }; + + row1.frameTable.ButtonClickEvent += (sender, e) => + { + var form = new HideOptionFileContentForm(); + form.AddForm(System.IO.Path.Combine(directory, fileName)); + }; + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs index 749b70d..f013a0f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs @@ -45,9 +45,9 @@ //澶村儚 var btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(207); - btnUserIcon.Width = Application.GetMinRealAverage(207); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2; + btnUserIcon.Height = this.GetPictrueRealSize(207); + btnUserIcon.Width = this.GetPictrueRealSize(207); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2; if (memberResult.HeadImage != null) { btnUserIcon.ImageBytes = memberResult.HeadImage; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs index f6661fe..ecdad76 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs @@ -59,9 +59,9 @@ //鐢ㄦ埛鍥炬爣 string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, i_iconMark + ".png"); var btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(207); - btnUserIcon.Width = Application.GetMinRealAverage(207); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2; + btnUserIcon.Height = this.GetPictrueRealSize(207); + btnUserIcon.Width = this.GetPictrueRealSize(207); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2; btnUserIcon.Y = Application.GetRealHeight(104); btnUserIcon.Gravity = Gravity.CenterHorizontal; if (System.IO.File.Exists(iconPath) == true) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs index 72b2353..d5b2cbd 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs @@ -105,9 +105,9 @@ //鐢ㄦ埛鍥炬爣 var btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(207); - btnUserIcon.Width = Application.GetMinRealAverage(207); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2; + btnUserIcon.Height = this.GetPictrueRealSize(207); + btnUserIcon.Width = this.GetPictrueRealSize(207); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2; btnUserIcon.ImagePath = UserCenterResourse.UserInfo.UserIconFile; btnUserIcon.Y = Application.GetRealHeight(46); btnUserIcon.Gravity = Gravity.CenterHorizontal; @@ -285,9 +285,9 @@ var btnIcon = new ImageView(); btnIcon.X = ControlCommonResourse.XXLeft; btnIcon.Gravity = Gravity.CenterVertical; - btnIcon.Height = Application.GetMinRealAverage(115); - btnIcon.Width = Application.GetMinRealAverage(115); - btnIcon.Radius = (uint)Application.GetMinRealAverage(115) / 2; + btnIcon.Height = this.GetPictrueRealSize(115); + btnIcon.Width = this.GetPictrueRealSize(115); + btnIcon.Radius = (uint)this.GetPictrueRealSize(115) / 2; if (System.IO.File.Exists(iconPath) == true) { btnIcon.ImagePath = iconPath; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs index f5ddef9..658ee39 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs @@ -116,9 +116,9 @@ //鐢ㄦ埛鍥炬爣 string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, memberInfo.DistributedMark + ".png"); var btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(207); - btnUserIcon.Width = Application.GetMinRealAverage(207); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2; + btnUserIcon.Height = this.GetPictrueRealSize(207); + btnUserIcon.Width = this.GetPictrueRealSize(207); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2; if (System.IO.File.Exists(iconPath) == true) { btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(iconPath); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/SubAccountLevelUpSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/SubAccountLevelUpSuccessForm.cs index 99c148a..06f7bcc 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Member/SubAccountLevelUpSuccessForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/SubAccountLevelUpSuccessForm.cs @@ -13,7 +13,7 @@ /// <summary> /// 鎴愬憳鐨勪俊鎭� - /// </summary> + /// </summary> private MemberInfoRes memberInfo = null; #endregion @@ -23,19 +23,19 @@ /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> - /// <param name="info">鎴愬憳淇℃伅</param> - public void ShowForm(MemberInfoRes info) - { - this.memberInfo = info; - - //鍒濆鍖栦腑閮ㄦ帶浠� - this.InitMiddleFrame(); + /// <param name="info">鎴愬憳淇℃伅</param> + public void ShowForm(MemberInfoRes info) + { + this.memberInfo = info; + + //鍒濆鍖栦腑閮ㄦ帶浠� + this.InitMiddleFrame(); } - /// <summary> - /// 鍒濆鍖栦腑閮ㄦ帶浠� - /// </summary> - private void InitMiddleFrame() + /// <summary> + /// 鍒濆鍖栦腑閮ㄦ帶浠� + /// </summary> + private void InitMiddleFrame() { //鑳屾櫙妗� var frame = new FrameLayout(); @@ -49,10 +49,10 @@ //鐢ㄦ埛鍥炬爣 string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, memberInfo.DistributedMark + ".png"); var btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(207); - btnUserIcon.Width = Application.GetMinRealAverage(207); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2; - btnUserIcon.Y = Application.GetRealHeight(104); + btnUserIcon.Height = this.GetPictrueRealSize(207); + btnUserIcon.Width = this.GetPictrueRealSize(207); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2; + btnUserIcon.Y = Application.GetRealHeight(104); btnUserIcon.Gravity = Gravity.CenterHorizontal; if (System.IO.File.Exists(iconPath) == true) { @@ -61,17 +61,17 @@ else { btnUserIcon.ImagePath = "Center/Admin.png"; - } + } frame.AddChidren(btnUserIcon); //鏄电О var btnName = new NormalViewControl(frame.Width, Application.GetRealHeight(55), false); - btnName.IsBold = true; - btnName.TextAlignment = TextAlignment.Center; - btnName.Y = Application.GetRealHeight(334); - btnName.TextColor = UserCenterColor.Current.TextColor2; - btnName.TextSize = 16; - btnName.Text = memberInfo.UserName; + btnName.IsBold = true; + btnName.TextAlignment = TextAlignment.Center; + btnName.Y = Application.GetRealHeight(334); + btnName.TextColor = UserCenterColor.Current.TextColor2; + btnName.TextSize = 16; + btnName.Text = memberInfo.UserName; if (string.IsNullOrEmpty(memberInfo.UserName) == true) { btnName.Text = memberInfo.Account; @@ -80,8 +80,8 @@ //鏉冮檺 var btnAuthority = new NormalViewControl(frame.Width, Application.GetRealHeight(50), false); - btnAuthority.TextAlignment = TextAlignment.Center; - btnAuthority.Y = Application.GetRealHeight(400); + btnAuthority.TextAlignment = TextAlignment.Center; + btnAuthority.Y = Application.GetRealHeight(400); btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor1; if (memberInfo.AccountType == 1) { @@ -128,7 +128,7 @@ btnView.TextColor = UserCenterColor.Current.TextGrayColor1; btnView.IsMoreLines = true; btnView.TextSize = 12; - frame.AddChidren(btnView); + frame.AddChidren(btnView); //瀹屾垚 var btnFinish = new BottomClickButton(688); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs index b58e19e..980c379 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs @@ -57,7 +57,7 @@ //鍙宠竟鍋忕Щ閲�->澧炲姞瀹藉害 rowPhone.RightOffset = -ControlCommonResourse.XXLeft; rowPhone.Y = Application.GetRealHeight(23); - rowPhone.Width = Application.GetMinRealAverage(628); + rowPhone.Width = this.GetPictrueRealSize(628); bodyFrameLayout.AddChidren(rowPhone); //璇疯緭鍏ラ偖绠辨垨鎵嬫満鍙� string phoneValue = string.IsNullOrEmpty(UserCenterResourse.UserInfo.Phone) == true ? string.Empty : "+" + UserCenterResourse.UserInfo.AreaCode + " " + UserCenterResourse.UserInfo.Phone; @@ -70,7 +70,7 @@ var rowCode = new FrameRowControl(); rowCode.Y = rowPhone.Bottom + Application.GetRealHeight(20); - rowCode.Width = Application.GetMinRealAverage(628); + rowCode.Width = this.GetPictrueRealSize(628); bodyFrameLayout.AddChidren(rowCode); //璇疯緭鍏ラ獙璇佺爜 var txtCode = rowCode.AddLeftInput("", 600); @@ -110,7 +110,7 @@ } //鏄剧ず鍙互鍒囨崲閭->涓�涓彲浠ラ伄浣廈ody鐨勪笢瑗� - var frameTran = new FrameLayoutControl(); + var frameTran = new FrameLayoutStatuControl(); frameTran.UseClickStatu = false; frameTran.BackgroundColor = UserCenterColor.Current.Transparent; bodyFrameLayout.AddChidren(frameTran); @@ -122,11 +122,11 @@ var frameList = new FrameLayout(); frameList.X = ControlCommonResourse.XXLeft - Application.GetRealWidth(17); frameList.Y = rowPhone.Bottom - ControlCommonResourse.BottomLineHeight - 1; - frameList.Width = Application.GetMinRealAverage(628); - frameList.Height = Application.GetMinRealAverage(176); + frameList.Width = this.GetPictrueRealSize(628); + frameList.Height = this.GetPictrueRealSize(176); frameTran.AddChidren(frameList); //鍔ㄧ敾鐢� - var frameAnimate = new FrameLayoutControl(); + var frameAnimate = new FrameLayoutStatuControl(); frameAnimate.UseClickStatu = false; frameList.AddChidren(frameAnimate); @@ -134,8 +134,8 @@ btnPic.UnSelectedImagePath = "Item/ForgotPswList.png"; frameAnimate.AddChidren(btnPic); var btnEmail = new NormalViewControl(450, 58, true); - btnEmail.X = Application.GetMinRealAverage(46); - btnEmail.Y = Application.GetMinRealAverage(32); + btnEmail.X = this.GetPictrueRealSize(46); + btnEmail.Y = this.GetPictrueRealSize(32); btnEmail.TextColor = UserCenterColor.Current.TextGrayColor3; btnEmail.Text = UserCenterResourse.UserInfo.Email; frameAnimate.AddChidren(btnEmail); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs index 983b93d..7d9474b 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs @@ -57,7 +57,7 @@ //鍙宠竟鍋忕Щ閲�->澧炲姞瀹藉害 rowPhone.RightOffset = -ControlCommonResourse.XXLeft; rowPhone.Y = Application.GetRealHeight(23); - rowPhone.Width = Application.GetMinRealAverage(628); + rowPhone.Width = this.GetPictrueRealSize(628); bodyFrameLayout.AddChidren(rowPhone); //璇疯緭鍏ラ偖绠辨垨鎵嬫満鍙� string phoneValue = string.IsNullOrEmpty(UserCenterResourse.UserInfo.Phone) == true ? string.Empty : "+" + UserCenterResourse.UserInfo.AreaCode + " " + UserCenterResourse.UserInfo.Phone; @@ -70,7 +70,7 @@ var rowCode = new FrameRowControl(); rowCode.Y = rowPhone.Bottom + Application.GetRealHeight(20); - rowCode.Width = Application.GetMinRealAverage(628); + rowCode.Width = this.GetPictrueRealSize(628); bodyFrameLayout.AddChidren(rowCode); //璇疯緭鍏ラ獙璇佺爜 var txtCode = rowCode.AddLeftInput("", 600); @@ -110,7 +110,7 @@ } //鏄剧ず鍙互鍒囨崲閭->涓�涓彲浠ラ伄浣廈ody鐨勪笢瑗� - var frameTran = new FrameLayoutControl(); + var frameTran = new FrameLayoutStatuControl(); frameTran.UseClickStatu = false; frameTran.BackgroundColor = UserCenterColor.Current.Transparent; bodyFrameLayout.AddChidren(frameTran); @@ -122,11 +122,11 @@ var frameList = new FrameLayout(); frameList.X = ControlCommonResourse.XXLeft - Application.GetRealWidth(17); frameList.Y = rowPhone.Bottom - ControlCommonResourse.BottomLineHeight - 1; - frameList.Width = Application.GetMinRealAverage(628); - frameList.Height = Application.GetMinRealAverage(176); + frameList.Width = this.GetPictrueRealSize(628); + frameList.Height = this.GetPictrueRealSize(176); frameTran.AddChidren(frameList); //鍔ㄧ敾鐢� - var frameAnimate = new FrameLayoutControl(); + var frameAnimate = new FrameLayoutStatuControl(); frameAnimate.UseClickStatu = false; frameList.AddChidren(frameAnimate); @@ -134,8 +134,8 @@ btnPic.UnSelectedImagePath = "Item/ForgotPswList.png"; frameAnimate.AddChidren(btnPic); var btnEmail = new NormalViewControl(450, 58, true); - btnEmail.X = Application.GetMinRealAverage(46); - btnEmail.Y = Application.GetMinRealAverage(32); + btnEmail.X = this.GetPictrueRealSize(46); + btnEmail.Y = this.GetPictrueRealSize(32); btnEmail.TextColor = UserCenterColor.Current.TextGrayColor3; btnEmail.Text = UserCenterResourse.UserInfo.Email; frameAnimate.AddChidren(btnEmail); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs index 5687b9e..79e3f4f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs @@ -195,8 +195,8 @@ var btnTemper = rowTemperature.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300); //搴曠嚎 rowTemperature.AddBottomLine(); - //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀� - if (this.editorRoom.IsSharedRoom == false) + //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀� 鎴栬�呭綋鍓嶄綇瀹呬笉鏄櫄鎷熺殑 + if (this.editorRoom.IsSharedRoom == false && Common.Config.Instance.Home.IsVirtually == false) { rowTemperature.ButtonClickEvent += (sender, e) => { @@ -219,8 +219,8 @@ var btnHumi = rowHumidity.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300); //搴曠嚎 rowHumidity.AddBottomLine(); - //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀� - if (this.editorRoom.IsSharedRoom == false) + //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀� 鎴栬�呭綋鍓嶄綇瀹呬笉鏄櫄鎷熺殑 + if (this.editorRoom.IsSharedRoom == false && Common.Config.Instance.Home.IsVirtually == false) { rowHumidity.ButtonClickEvent += (sender, e) => { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs index 422c4c5..194c955 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs @@ -179,8 +179,12 @@ } } listView.AdjustRealHeight(Application.GetRealHeight(23)); - //寮�鍚澶囧湪绾跨洃娴� - this.StartCheckDeviceOnline(listView, listGwId, dicData); + //濡傛灉涓嶆槸铏氭嫙浣忓畢 + if (Common.Config.Instance.Home.IsVirtually == false) + { + //寮�鍚澶囧湪绾跨洃娴� + this.StartCheckDeviceOnline(listView, listGwId, dicData); + } }); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs index 393b9e2..0dd08fd 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs @@ -16,9 +16,13 @@ /// </summary> private VerticalListControl listView = null; /// <summary> - /// 浣忓畢鏁版嵁 + /// 浣忓畢鏁版嵁(鏈夌綉鏃朵娇鐢�) /// </summary> private Dictionary<string, Common.ResponseEntity.ResidenceObj> dicResidenceData = null; + /// <summary> + /// 浣忓畢鏁版嵁(鏃犵綉鏃朵娇鐢�) + /// </summary> + private List<House> listLocalHouse = null; /// <summary> /// 浣忓畢椤哄簭 /// </summary> @@ -36,16 +40,20 @@ //璁剧疆鏍囬淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.ResidenceManagement)); - //鍙充笂娣诲姞鎸夐挳 - var btnTopIcon = new MostRightIconControl(69, 69); - btnTopIcon.UnSelectedImagePath = "Item/Add.png"; - topFrameLayout.AddChidren(btnTopIcon); - btnTopIcon.InitControl(); - btnTopIcon.ButtonClickEvent += (sender, e) => + //铏氭嫙浣忓畢鏃犳硶鏂板缓浣忓畢 + if (Common.Config.Instance.Home.IsVirtually == false) { - //鏄剧ず娣诲姞浣忓畢鍚嶇О鐨勭敾闈� - this.ShowAddNameForm(); - }; + //鍙充笂娣诲姞鎸夐挳 + var btnTopIcon = new MostRightIconControl(69, 69); + btnTopIcon.UnSelectedImagePath = "Item/Add.png"; + topFrameLayout.AddChidren(btnTopIcon); + btnTopIcon.InitControl(); + btnTopIcon.ButtonClickEvent += (sender, e) => + { + //鏄剧ず娣诲姞浣忓畢鍚嶇О鐨勭敾闈� + this.ShowAddNameForm(); + }; + } //鍒濆鍖栦腑閮ㄦ帶浠� this.InitMiddleFrame(); @@ -64,7 +72,6 @@ if (strData != null) { listResidenceSort = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(strData); - strData = null; } listView = new VerticalListControl(29); @@ -72,37 +79,68 @@ listView.BackgroundColor = UserCenterColor.Current.White; bodyFrameLayout.AddChidren(listView); - HdlThreadLogic.Current.RunThread(() => + //璁剧疆浣忓畢淇℃伅 + this.SetResidenceInfo(1); + } + + /// <summary> + /// 璁剧疆浣忓畢淇℃伅(1:鍏堣鍙栦簯绔�,鏃犳硶鑱旂綉,鍐嶈鍙栨湰鍦� 2:鍙浜戠 3:鍙鏈湴) + /// </summary> + /// <param name="div">1:鍏堣鍙栦簯绔�,鏃犳硶鑱旂綉,鍐嶈鍙栨湰鍦� 2:鍙浜戠 3:鍙鏈湴</param> + private void SetResidenceInfo(int div) + { + HdlThreadLogic.Current.RunThread(async () => { - //璁剧疆浣忓畢淇℃伅 - this.SetResidenceInfo(); + //铏氭嫙浣忓畢鐨勮瘽,鍙鏈湴 + if (div == 3 || Config.Instance.Home.IsVirtually == true) + { + //鍙鏈湴 + this.SetResidenceInfoByOffline(); + } + else + { + //寮�鍚繘搴︽潯 + this.ShowProgressBar(); + //璁剧疆浣忓畢淇℃伅(鏈夌綉鎯呭喌) + var result = await this.SetResidenceInfoByOnline(); + if (result == true) + { + //浜戠璇诲彇鎴愬姛 + this.CloseProgressBar(); + return; + } + if (div == 2) + { + //濡傛灉鍙浜戠 鍏抽棴杩涘害鏉� + this.CloseProgressBar(ShowReLoadMode.YES); + return; + } + //濡傛灉鍦ㄦ病缃戠殑鎯呭喌涓�,浠庢枃浠跺す璺緞涓幏鍙栧叏閮ㄤ綇瀹�,鐒跺悗鏄剧ず + this.SetResidenceInfoByOffline(); + + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + } }); } #endregion - #region 鈻� 璁剧疆浣忓畢淇℃伅_______________________ + #region 鈻� 璁剧疆浣忓畢淇℃伅(鏈夌綉鎯呭喌)_____________ /// <summary> - /// 璁剧疆浣忓畢淇℃伅 + /// 璁剧疆浣忓畢淇℃伅(鏈夌綉鎯呭喌) /// </summary> - private async void SetResidenceInfo() + private async System.Threading.Tasks.Task<bool> SetResidenceInfoByOnline() { - //寮�鍚繘搴︽潯 - this.ShowProgressBar(); - //鑾峰彇浣忓畢淇℃伅 var Pra = new GetResidenceInfoPra(); - string resultData = await UserCenterLogic.GetResponseDataByRequestHttps("App/GetHomePager", false, Pra); + var listNotCheck = new List<string>() { "NotSetAgain" }; + string resultData = await UserCenterLogic.GetResponseDataByRequestHttps("App/GetHomePager", false, Pra, listNotCheck); if (resultData == null) { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(ShowReLoadMode.YES); - return; + return false; } - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); - var pageData = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResidenceRes>(resultData); //鏆傛椂瀛樺偍鏁版嵁 @@ -135,7 +173,7 @@ { return; } - listView.Height = bodyFrameLayout.Height + Application.GetRealHeight(6); + listView.Height = bodyFrameLayout.Height; this.dicResidenceData = new Dictionary<string, Common.ResponseEntity.ResidenceObj>(); for (int i = 0; i < listResidenceSort.Count; i++) @@ -148,22 +186,20 @@ //鏀堕泦璇ヨ处鍙蜂綇瀹呯殑鏁版嵁 this.dicResidenceData[info.Id] = info; - this.AddRowLayout(info, i != listResidenceSort.Count - 1); + //娣诲姞浣忓畢鐨勮(鏈夌綉鎯呭喌) + this.AddRowLayoutByOnline(info, i != listResidenceSort.Count - 1); } //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� this.listView.AdjustRealHeight(Application.GetRealHeight(23)); }); + return true; } - #endregion - - #region 鈻� 娣诲姞浣忓畢鐨勮_______________________ - /// <summary> - /// 娣诲姞浣忓畢鐨勮 + /// 娣诲姞浣忓畢鐨勮(鏈夌綉鎯呭喌) /// </summary> /// <param name="info"></param> - private void AddRowLayout(Common.ResponseEntity.ResidenceObj info, bool addLine) + private void AddRowLayoutByOnline(Common.ResponseEntity.ResidenceObj info, bool addLine) { var rowLayout = new RowLayoutControl(listView.rowSpace / 2); this.listView.AddChidren(rowLayout); @@ -216,6 +252,7 @@ { HdlThreadLogic.Current.RunThread(async () => { + //寮�鍚繘搴︽潯 this.ShowProgressBar(); //妫�娴嬫湰鍦版湁娌℃湁杩欎釜浣忓畢 @@ -228,13 +265,13 @@ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ await UserCenterLogic.InitUserCenterMenmoryAndThread(false); - HdlRoomLogic.Current.InitAllRoom(); - HdlThreadLogic.Current.RunMain(() => { //閲嶆柊鍒锋柊鍒楄〃 this.listView.RemoveAll(); - this.SetResidenceInfo(); + this.SetResidenceInfo(2); + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); }); }); }); @@ -259,7 +296,132 @@ btnChanged.ButtonClickEvent += (sender, e) => { //鏄剧ず缂栬緫鍚嶇О鐣岄潰 - this.ShowEditorNameForm(info, btnHome); + this.ShowEditorNameForm(info, null, btnHome); + }; + } + + #endregion + + #region 鈻� 璁剧疆浣忓畢淇℃伅(鏃犵綉鎯呭喌)_____________ + + /// <summary> + /// 璁剧疆浣忓畢淇℃伅(鏃犵綉鎯呭喌) + /// </summary> + private void SetResidenceInfoByOffline() + { + //浠庢枃浠跺す涓幏鍙栧叏閮ㄧ殑浣忓畢瀵硅薄 + this.listLocalHouse = HdlResidenceLogic.Current.GetAllLocalResidenceListByDirectory(); + if (listLocalHouse.Count == 0) + { + return; + } + + HdlThreadLogic.Current.RunMain(() => + { + listView.Height = bodyFrameLayout.Height; + + for (int i = 0; i < listLocalHouse.Count; i++) + { + //娣诲姞浣忓畢鐨勮(鏃犵綉鎯呭喌) + this.AddRowLayoutByOffline(listLocalHouse[i], i != listLocalHouse.Count - 1); + } + //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� + this.listView.AdjustRealHeight(Application.GetRealHeight(23)); + }); + } + + /// <summary> + /// 娣诲姞浣忓畢鐨勮(鏃犵綉鎯呭喌) + /// </summary> + /// <param name="i_home"></param> + private void AddRowLayoutByOffline(House i_home, bool addLine) + { + var rowLayout = new RowLayoutControl(listView.rowSpace / 2); + this.listView.AddChidren(rowLayout); + + //鍥炬爣 + var btnIcon = rowLayout.frameTable.AddLeftIcon(81); + btnIcon.UnSelectedImagePath = "Item/ResidenceIcon.png"; + //褰撳墠浣忓畢 + NormalViewControl btnHome = null; + if (i_home.Id == Config.Instance.Home.Id) + { + //浣忓畢鍚嶇О + btnHome = rowLayout.frameTable.AddLeftCaption(i_home.Name, 800, 60, true); + btnHome.TextSize = 15; + btnHome.Y = Application.GetRealHeight(12) + rowLayout.chidrenYaxis; + rowLayout.frameTable.AddChidren(btnHome, ChidrenBindMode.BindEventOnly); + + //褰撳墠浣忓畢 + var btnNowView = rowLayout.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowResidence), 800, 49, true); + btnNowView.Y = Application.GetRealHeight(72) + rowLayout.chidrenYaxis; + btnNowView.TextSize = 12; + btnNowView.TextColor = UserCenterColor.Current.TextGrayColor1; + rowLayout.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEventOnly); + } + else + { + //浣忓畢鍚嶇О + btnHome = rowLayout.frameTable.AddLeftCaption(i_home.Name, 800, true); + btnHome.TextSize = 15; + } + //鍙崇澶� + rowLayout.frameTable.AddRightArrow(); + if (addLine == true) + { + //搴曠嚎 + rowLayout.frameTable.AddBottomLine(); + } + + rowLayout.frameTable.ButtonClickEvent += (sender, e) => + { + if (i_home.Id != Config.Instance.Home.Id) + { + //纭鍒囨崲褰撳墠浣忓畢鍒般�屻��? + string msg = Language.StringByID(R.MyInternationalizationString.uSwitchResidenceMsg); + if (msg.Contains("{0}") == true) + { + msg = string.Format(msg, i_home.Name); + } + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + HdlThreadLogic.Current.RunThread(async () => + { + this.ShowProgressBar(); + + Config.Instance.HomeId = i_home.Id; + //閲嶆柊鍒濆鍖栦綇瀹呭璞� + Config.Instance.Home = House.GetHouseByHouseId(i_home.Id); + Config.Instance.Save(); + //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ + await UserCenterLogic.InitUserCenterMenmoryAndThread(false); + + HdlThreadLogic.Current.RunMain(() => + { + //閲嶆柊鍒锋柊鍒楄〃 + this.listView.RemoveAll(); + this.SetResidenceInfo(3); + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + }); + }); + }); + } + else + { + //妫�娴嬭兘鍚﹀垹闄や綇瀹� + bool flage = this.CheckIsCanDeleteResidence(i_home); + var form = new ResidenceManagementForm(); + form.AddForm(flage); + } + }; + //鏇存敼 + var btnChanged = rowLayout.AddEditorControl(); + btnChanged.TextID = R.MyInternationalizationString.uChanged1; + btnChanged.ButtonClickEvent += (sender, e) => + { + //鏄剧ず缂栬緫鍚嶇О鐣岄潰 + this.ShowEditorNameForm(null, i_home, btnHome); }; } @@ -270,16 +432,18 @@ /// <summary> /// 鏄剧ず缂栬緫浣忓畢鍚嶇О鐣岄潰 /// </summary> - /// <param name="info"></param> - private void ShowEditorNameForm(Common.ResponseEntity.ResidenceObj info, NormalViewControl btnHome) + /// <param name="info">鏈夌綉鏃朵娇鐢�</param> + /// <param name="i_house">鏃犵綉鏃堕�傜敤</param> + private void ShowEditorNameForm(Common.ResponseEntity.ResidenceObj info, House i_house, NormalViewControl btnHome) { + string oldName = info != null ? info.Name : i_house.Name; //鐢熸垚涓�涓脊绐楃敾闈� var dialogForm = new DialogInputControl(); //缂栬緫浣忓畢 dialogForm.SetTitleText(Language.StringByID(R.MyInternationalizationString.uChangedName)); //璇疯緭鍏ヤ綇瀹呭悕绉� dialogForm.SetTipText(Language.StringByID(R.MyInternationalizationString.uPleaseInputResidenceName)); - dialogForm.Text = info.Name; + dialogForm.Text = oldName; //鎸変笅纭鎸夐挳 dialogForm.ComfirmClickEvent += ((textValue) => @@ -293,11 +457,25 @@ } //鐢婚潰鍏抽棴 dialogForm.CloseDialog(); - - if (info.Name != textValue) + if (oldName != textValue) { - //缂栬緫浜戠鐨勪綇瀹呭悕绉� - this.EditorResidenceName(textValue, info); + if (info != null) + { + //缂栬緫浜戠鐨勪綇瀹呭悕绉� + this.EditorResidenceName(textValue, info, btnHome); + } + else + { + //鐩存帴缂栬緫浣忓畢缂撳瓨 + if (this.CheckIsCanSaveResidence(i_house.Id, textValue, true) == false) + { + return; + } + //鍒锋柊鍐呭瓨鐨勪綇瀹呭悕 + House.EditorHouseByHouseId(i_house.Id, textValue); + //鏇存敼鏄剧ず鐨勫悕瀛� + btnHome.Text = textValue; + } } }); } @@ -308,7 +486,7 @@ /// <param name="ResidenceName"></param> /// <param name="info"></param> /// <returns></returns> - private async void EditorResidenceName(string ResidenceName, Common.ResponseEntity.ResidenceObj info) + private async void EditorResidenceName(string ResidenceName, Common.ResponseEntity.ResidenceObj info, NormalViewControl btnHome) { //妫�娴嬭兘鍚︿繚瀛樹綇瀹� if (this.CheckIsCanSaveResidence(info.Id, ResidenceName, true) == false) @@ -321,23 +499,21 @@ var Pra = new EditorResidencePra(); Pra.HomeId = info.Id; Pra.Name = ResidenceName; - if (info.IsOthreShare == true) - { - Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - } + Pra.IsOtherAccountCtrl = false; + Pra.LoginAccessToken = Config.Instance.Token; + //缂栬緫浣忓畢 - bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", info.IsOthreShare, Pra); - if (flage == false) + bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", false, Pra); + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + + if (flage == true) { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); - return; + //鍒锋柊鍐呭瓨鐨勪綇瀹呭悕 + House.EditorHouseByHouseId(info.Id, ResidenceName); + //鏇存敼鏄剧ず鐨勫悕瀛� + btnHome.Text = ResidenceName; } - //鍒锋柊鍐呭瓨鐨勪綇瀹呭悕 - House.EditorHouseByHouseId(info.Id, ResidenceName); - //閲嶆柊鍒锋柊鍒楄〃 - this.listView.RemoveAll(); - this.SetResidenceInfo(); } #endregion @@ -404,7 +580,7 @@ House.AddHouse(newInfo[0].Id, ResidenceName, 0); //閲嶆柊鍒锋柊鍒楄〃 this.listView.RemoveAll(); - this.SetResidenceInfo(); + this.SetResidenceInfo(2); } #endregion @@ -442,7 +618,7 @@ } /// <summary> - /// 妫�娴嬭兘鍚﹀垹闄や綇瀹� + /// 妫�娴嬭兘鍚﹀垹闄や綇瀹�(鏈夌綉浣跨敤) /// </summary> /// <param name="info"></param> /// <returns></returns> @@ -468,6 +644,36 @@ } /// <summary> + /// 妫�娴嬭兘鍚﹀垹闄や綇瀹�(鏃犵綉浣跨敤) + /// </summary> + /// <param name="info"></param> + /// <returns></returns> + private bool CheckIsCanDeleteResidence(House i_house) + { + if (i_house.IsVirtually == false) + { + //闈炶櫄鎷熶綇瀹呴兘涓嶅厑璁稿垹闄�,鍙湁鍦ㄨ兘鑱旂綉鐨勬椂鍊�,鎵嶈兘鍒犻櫎 + return false; + } + + int myCount = 0; + foreach (var data in this.listLocalHouse) + { + if (data.IsVirtually == true) + { + myCount++; + } + } + //濡傛灉姝よ处鍙蜂笅鍙墿涓嬪敮涓�涓�涓櫄鎷熺殑浣忓畢锛屽垯涓嶈兘鍐嶅垹闄� + if (myCount == 1) + { + return false; + } + + return true; + } + + /// <summary> /// 妫�娴嬭兘鍚︿繚瀛樹綇瀹� /// </summary> /// <param name="residenceId">浣忓畢ID</param> @@ -476,21 +682,43 @@ /// <returns></returns> private bool CheckIsCanSaveResidence(string residenceId, string residenceName, bool isEditor) { - //浣忓畢鍚嶅瓧閲嶅妫�娴� - foreach (string strId in this.dicResidenceData.Keys) + if (this.dicResidenceData != null) { - if (this.dicResidenceData[strId].IsOthreShare == true) + //浣忓畢鍚嶅瓧閲嶅妫�娴� + foreach (string strId in this.dicResidenceData.Keys) { - //鍒嗕韩鐨勪綇瀹呬笉鑰冭檻 - continue; + if (this.dicResidenceData[strId].IsOthreShare == true) + { + //鍒嗕韩鐨勪綇瀹呬笉鑰冭檻 + continue; + } + if (residenceId != strId && residenceName == this.dicResidenceData[strId].Name) + { + //浣忓畢鍚嶅瓧宸茬粡瀛樺湪 + int msgId = isEditor == true ? R.MyInternationalizationString.EditZigbeeHome_Exist : R.MyInternationalizationString.AddZigbeeHome_Exist; + string msg = Language.StringByID(msgId); + this.ShowMassage(ShowMsgType.Error, msg); + return false; + } } - if (residenceId != strId && residenceName == this.dicResidenceData[strId].Name) + } + else + { + foreach (var myHouse in this.listLocalHouse) { - //浣忓畢鍚嶅瓧宸茬粡瀛樺湪 - int msgId = isEditor == true ? R.MyInternationalizationString.EditZigbeeHome_Exist : R.MyInternationalizationString.AddZigbeeHome_Exist; - string msg = Language.StringByID(msgId); - this.ShowMassage(ShowMsgType.Error, msg); - return false; + if (myHouse.IsOthreShare == true) + { + //鍒嗕韩鐨勪綇瀹呬笉鑰冭檻 + continue; + } + if (residenceId != myHouse.Id && residenceName == myHouse.Name) + { + //浣忓畢鍚嶅瓧宸茬粡瀛樺湪 + int msgId = isEditor == true ? R.MyInternationalizationString.EditZigbeeHome_Exist : R.MyInternationalizationString.AddZigbeeHome_Exist; + string msg = Language.StringByID(msgId); + this.ShowMassage(ShowMsgType.Error, msg); + return false; + } } } return true; @@ -505,22 +733,38 @@ /// </summary> public override int FormActionAgainEvent() { - foreach (string keys in dicResidenceData.Keys) + if (dicResidenceData != null) { - if (Config.Instance.HomeFilePathList.Contains($"House_{keys}.json") == false) + foreach (string keys in dicResidenceData.Keys) { - //淇濆瓨椤哄簭 - listResidenceSort.Remove(keys); - HdlRoomLogic.Current.SaveFloorSort(listResidenceSort); - - this.listView.RemoveAll(); - //鏁版嵁宸茬粡鍙樻洿 - HdlThreadLogic.Current.RunThread(() => + if (Config.Instance.HomeFilePathList.Contains($"House_{keys}.json") == false) { - //閲嶆柊璁剧疆浣忓畢淇℃伅 - this.SetResidenceInfo(); - }); - break; + //淇濆瓨椤哄簭 + listResidenceSort.Remove(keys); + HdlRoomLogic.Current.SaveFloorSort(listResidenceSort); + + this.listView.RemoveAll(); + //鏁版嵁宸茬粡鍙樻洿 閲嶆柊璁剧疆浣忓畢淇℃伅 + this.SetResidenceInfo(2); + break; + } + } + } + else + { + //妫�娴嬭繕鏈夎繖涓綇瀹呮枃浠跺悧 + var strPath = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid); + foreach (var myHouse in this.listLocalHouse) + { + string fullName = System.IO.Path.Combine(strPath, myHouse.FileName); + //濡傛灉涓嶅瓨鍦ㄤ簡鐨勮瘽 + if (System.IO.File.Exists(fullName) == false) + { + //鏁版嵁宸茬粡鍙樻洿 閲嶆柊璁剧疆浣忓畢淇℃伅 + this.listView.RemoveAll(); + this.SetResidenceInfo(3); + return 1; + } } } return 1; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs index b36ff40..8682058 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs @@ -728,7 +728,6 @@ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ await UserCenterLogic.InitUserCenterMenmoryAndThread(false); - HdlRoomLogic.Current.InitAllRoom(); //鍒犻櫎浣忓畢 Common.House.DeleteHouseByHouseId(deleteId); @@ -753,45 +752,49 @@ /// <param name="addresName">浣嶇疆鍚嶇О</param> private async void SaveResidenceAdrress(NormalViewControl btnLocation, double latitude, double longitude, string addresName) { - //寮�鍚繘搴︽潯 - this.ShowProgressBar(); - - var Pra = new EditorResidencePra(); - Pra.HomeId = Common.Config.Instance.Home.Id; - Pra.Name = Common.Config.Instance.Home.Name; - Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - Pra.Latitude = latitude; - Pra.Longitude = longitude; - - //缂栬緫浣忓畢 - bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", true, Pra); - if (flage == false) + //濡傛灉涓嶆槸铏氭嫙浣忓畢,鎵嶆洿鏂颁簯绔� + if (Common.Config.Instance.Home.IsVirtually == false) { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); - return; - } - //璁剧疆鍏ㄩ儴缃戝叧鐨勪綇瀹呭湴鍧� - var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); - foreach (var gateway in listGateway) - { - ZigBee.Device.ZbGateway realWay = null; - if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, gateway) == false) - { - //閿欒:缃戝叧瀵硅薄涓㈠け - continue; - } - var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude, ShowErrorMode.YES); - if (result == false) + //寮�鍚繘搴︽潯 + this.ShowProgressBar(); + + var Pra = new EditorResidencePra(); + Pra.HomeId = Common.Config.Instance.Home.Id; + Pra.Name = Common.Config.Instance.Home.Name; + Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + Pra.Latitude = latitude; + Pra.Longitude = longitude; + + //缂栬緫浣忓畢 + bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", true, Pra); + if (flage == false) { //鍏抽棴杩涘害鏉� this.CloseProgressBar(); return; } + //璁剧疆鍏ㄩ儴缃戝叧鐨勪綇瀹呭湴鍧� + var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); + foreach (var gateway in listGateway) + { + ZigBee.Device.ZbGateway realWay = null; + if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, gateway) == false) + { + //閿欒:缃戝叧瀵硅薄涓㈠け + continue; + } + var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude, ShowErrorMode.YES); + if (result == false) + { + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + return; + } + } + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); } - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); //淇濆瓨缂撳瓨 Common.Config.Instance.Home.Longitude = longitude; Common.Config.Instance.Home.Latitude = latitude; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs index 76d6357..6bafbed 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs @@ -79,7 +79,7 @@ frameBack.AddChidren(frameLayoutDraw); //瀹夐槻璁板綍(鐐瑰嚮鑼冨洿鏈夌偣灏忥紝闇�瑕佹墿澶у畠鐨勭偣鍑昏寖鍥�) - var frameLog = new FrameLayoutControl(); + var frameLog = new FrameLayoutStatuControl(); frameLog.UseClickStatu = false; frameLog.Height = Application.GetRealHeight(123); frameLog.Width = Application.GetRealWidth(273); @@ -103,7 +103,7 @@ btnLogLine.Visible = false; //浼犳劅鍣ㄧ姸鎬�(鐐瑰嚮鑼冨洿鏈夌偣灏忥紝闇�瑕佹墿澶у畠鐨勭偣鍑昏寖鍥�) - var frameSensor = new FrameLayoutControl(); + var frameSensor = new FrameLayoutStatuControl(); frameSensor.UseClickStatu = false; frameSensor.Height = frameLog.Height; frameSensor.Width = frameLog.Width; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs index 443db44..0087924 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs @@ -116,7 +116,7 @@ btnType.TextID = R.MyInternationalizationString.uSuggestionType; framType.AddChidren(btnType); //Bug - var frameBug = new FrameLayoutControl(); + var frameBug = new FrameLayoutStatuControl(); frameBug.UseClickStatu = false; frameBug.Width = Application.GetRealWidth(200); frameBug.X = Application.GetRealWidth(314); @@ -144,7 +144,7 @@ } }; //浼樺寲 - var frameOptimization = new FrameLayoutControl(); + var frameOptimization = new FrameLayoutStatuControl(); frameOptimization.UseClickStatu = false; frameOptimization.Width = Application.GetRealWidth(200); frameOptimization.X = Application.GetRealWidth(524); @@ -172,7 +172,7 @@ } }; //鏂伴渶姹� - var frameDemand = new FrameLayoutControl(); + var frameDemand = new FrameLayoutStatuControl(); frameDemand.UseClickStatu = false; frameDemand.Width = Application.GetRealWidth(200); frameDemand.X = Application.GetRealWidth(734); @@ -224,6 +224,11 @@ btnSubmit.CanClick = false; btnSubmit.ButtonClickEvent += (sender, e) => { + //濡傛灉鏄櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } //涓婁紶鎰忚 this.UploadSuggestion(txtInput.Text, txtEmail.Text); }; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/QRCodeForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/QRCodeForm.cs index ef86018..ce92e3e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/QRCodeForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/QRCodeForm.cs @@ -13,17 +13,17 @@ /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //鍒濆鍖栦腑閮ㄦ帶浠� - this.InitMiddleFrame(); + /// </summary> + public void ShowForm() + { + //鍒濆鍖栦腑閮ㄦ帶浠� + this.InitMiddleFrame(); } - /// <summary> - /// 鍒濆鍖栦腑閮ㄦ帶浠� - /// </summary> - private void InitMiddleFrame() + /// <summary> + /// 鍒濆鍖栦腑閮ㄦ帶浠� + /// </summary> + private void InitMiddleFrame() { uint roundHeigth = (uint)Application.GetRealHeight(17); @@ -64,9 +64,9 @@ //鐢ㄦ埛澶村儚 var btnIcon = new ImageView(); - btnIcon.Height = Application.GetMinRealAverage(294); - btnIcon.Width = Application.GetMinRealAverage(294); - btnIcon.Radius = (uint)Application.GetMinRealAverage(294) / 2; + btnIcon.Height = this.GetPictrueRealSize(294); + btnIcon.Width = this.GetPictrueRealSize(294); + btnIcon.Radius = (uint)this.GetPictrueRealSize(294) / 2; btnIcon.Y = Application.GetRealHeight(121); btnIcon.Gravity = Gravity.CenterHorizontal; btnIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); @@ -81,7 +81,7 @@ frameDetail.AddChidren(btnUser); //浜岀淮鐮� var btnQrCode = new PicViewControl(236, 236); - btnQrCode.ImageBytes = QRCode.BytesFromText(UserCenterResourse.UserInfo.Account, Application.GetMinRealAverage(236), Application.GetMinRealAverage(236)); + btnQrCode.ImageBytes = QRCode.BytesFromText(UserCenterResourse.UserInfo.Account, this.GetPictrueRealSize(236), this.GetPictrueRealSize(236)); btnQrCode.Gravity = Gravity.CenterHorizontal; btnQrCode.Y = Application.GetRealHeight(262); frameDetail.AddChidren(btnQrCode); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs index c1f5955..c94de76 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs @@ -392,12 +392,30 @@ dialogForm.ComfirmClickEvent += ((textValue) => { dialogForm.CloseDialog(); - if (textValue == "2887") + if (textValue.StartsWith("2887") == true) { - //寮�鍚殣钘忚彍鍗� - UserCenterResourse.HideOption.CenterHideMenu = 1; + var myTime = DateTime.Now; + string strTime1 = myTime.ToString("HHmm"); + int value1 = Convert.ToInt32(strTime1.Substring(3, 1)); + string check1 = "2887" + strTime1 + (7 + value1).ToString(); + + myTime = myTime.AddMinutes(-1); + string strTime2 = myTime.ToString("HHmm"); + int value2 = Convert.ToInt32(strTime2.Substring(3, 1)); + string check2 = "2887" + strTime2 + (7 + value2).ToString(); + + myTime = myTime.AddMinutes(2); + string strTime3 = myTime.ToString("HHmm"); + int value3 = Convert.ToInt32(strTime3.Substring(3, 1)); + string check3 = "2887" + strTime3 + (7 + value3).ToString(); + + if (textValue == check1 || textValue == check2 || textValue == check3) + { + //寮�鍚殣钘忚彍鍗� + UserCenterResourse.HideOption.CenterHideMenu = 1; + } } - if (textValue == "0001") + if (textValue == "0001a") { var form = new Guide.GuideHouseForm(); form.ShowFrom(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs index 5ad03f1..a51af14 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserInformationForm.cs @@ -55,9 +55,9 @@ //鐢ㄦ埛鍥炬爣 var btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(251); - btnUserIcon.Width = Application.GetMinRealAverage(251); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(251) / 2; + btnUserIcon.Height = this.GetPictrueRealSize(251); + btnUserIcon.Width = this.GetPictrueRealSize(251); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(251) / 2; btnUserIcon.Y = Application.GetRealHeight(46); btnUserIcon.Gravity = Gravity.CenterHorizontal; btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs index fba957b..ee92d35 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs @@ -132,15 +132,33 @@ { //鐢ㄦ埛澶村儚 this.btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(280); - btnUserIcon.Width = Application.GetMinRealAverage(280); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(280) / 2; + btnUserIcon.Height = this.GetPictrueRealSize(280); + btnUserIcon.Width = this.GetPictrueRealSize(280); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(280) / 2; btnUserIcon.X = Application.GetRealWidth(121); - btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); + if (Common.Config.Instance.Home.IsVirtually == false) + { + btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); + } + else + { + btnUserIcon.ImagePath = "Account/Cat.png"; + } bodyFrameLayout.AddChidren(btnUserIcon); btnUserIcon.Y = frameWhite.Y - Application.GetRealHeight(109); btnUserIcon.MouseUpEventHandler += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ユ彁绀�:纭畾閫�鍑哄綋鍓嶈处鍙凤紵 + string msg = Language.StringByID(R.MyInternationalizationString.uLogoutAccountMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //閫�鍑鸿处鍙� + UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account); + }); + return; + } var form = new UserInformationForm(); form.AddForm(); }; @@ -247,6 +265,11 @@ var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic); frame.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new Member.MemberListForm(); form.AddForm(); }; @@ -262,13 +285,16 @@ frame.ButtonClickEvent += (sender, e) => { HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId(); - if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == false) + //鎷ユ湁缃戝叧,鎴栬�呮槸铏氭嫙浣忓畢,鍒欒繘鍏ヨ澶囧垪琛ㄧ晫闈� + if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == false + || Common.Config.Instance.Home.IsVirtually == true) { var form = new Device.DeviceListMainForm(); form.AddForm(); } else { + //娌℃湁缃戝叧,鍒欒繘鍏ョ綉鍏冲垪琛ㄧ晫闈� var form = new GatewayManage.GatewayListForm(); form.AddForm(); } @@ -300,6 +326,11 @@ var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic); frame.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new Safety.SafetyManagementMainForm(); form.AddForm(); }; @@ -388,6 +419,11 @@ btnBackView.X -= ControlCommonResourse.XXLeft / 2; rowback.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new HdlBackup.HdlBackupListForm(); form.AddForm(); }; @@ -433,6 +469,11 @@ btnAbountView.X -= ControlCommonResourse.XXLeft / 2; rowAbount.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new Abount.AbountForm(); form.AddForm(); }; @@ -472,6 +513,11 @@ /// </summary> public override int FormActionAgainEvent() { + //铏氭嫙浣忓畢涓嶉渶瑕佸埛鏂� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return -1; + } //鐢ㄦ埛澶村儚 if (UserCenterResourse.UserInfo.UserIconFileChanged == true) { diff --git a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs index 32f75f3..5b29ee7 100755 --- a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs +++ b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs @@ -49,82 +49,47 @@ } }; + //鐩存帴鐧诲綍 if (Config.Instance.IsLogin) { - ShowLoginLoadView(); + //鏄剧ず鍚姩椤� + this.ShowLoginLoadView(); CommonPage.Loading.Start(); - Action action = async () => - { - //CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining)); - var loginSuccess = await LoginByPWDResultAsync(Config.Instance.Account, Config.Instance.Password); - if (loginSuccess == 1) - { - new System.Threading.Thread(async () => - { - //鐧诲綍鎴愬姛 - var homes = await House.GetHomeLists(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - - Application.RunOnMainThread(() => - { - CommonPage.Instance.RemoveViewByTag("Login"); - UserPage.Instance.Fresh(); - CommonPage.Loading.Hide(); - }); - }) - { IsBackground = true }.Start(); - } - else - { - //鏈櫥褰曟垚鍔熷脊鍑虹櫥褰曠晫闈� 鍚屾椂闇�瑕佹爣璁颁负鏈櫥褰曠姸鎬� - //Config.Instance.LoginDateTime = new DateTime(1970, 1, 1); - //Config.Instance.Save(); - //var accountLogin = new Device.Account.AccountLogin { }; - //CommonPage.Instance.AddChidren(accountLogin); - //accountLogin.Show(); - //CommonPage.Loading.Hide(); - - //鐧诲綍澶辫触锛屼篃鐩存帴杩涘叆涓婚〉 - new System.Threading.Thread(async () => - { - //鐧诲綍鎴愬姛 - var homes = await House.GetHomeLists(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); - //鍚姩ZigBee - ZigBee.Common.Application.Init(); - - UserCenter.HdlRoomLogic.Current.InitAllRoom(); - - Application.RunOnMainThread(() => - { - CommonPage.Instance.RemoveViewByTag("Login"); - UserPage.Instance.Fresh(); - CommonPage.Loading.Hide(); - }); - }) - { IsBackground = true }.Start(); - } - }; - //鐧诲綍杩囩洿鎺ュ悗鍙扮櫥褰� - action(); + UserCenter.HdlThreadLogic.Current.RunThread(async () => + { + //鐧诲綍 + var loginSuccess = await LoginByPWDAsync(Config.Instance.Account, Config.Instance.Password); + //鐧诲綍鎴愬姛,鎴栬�呮病鏈夌綉缁滈兘鍙互鐧诲綍 + if (loginSuccess == 1 || loginSuccess == 2) + { + var homes = await House.GetHomeLists(); + //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ + await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); + //鍚姩ZigBee + ZigBee.Common.Application.Init(); + + UserCenter.HdlThreadLogic.Current.RunMain(() => + { + CommonPage.Instance.RemoveViewByTag("Login"); + UserPage.Instance.Fresh(); + CommonPage.Loading.Hide(); + }); + } + }); } else { //鏈櫥褰曞脊鍑虹櫥褰曠晫闈� var accountLogin = new Login.AccountLogin { }; Shared.Common.CommonPage.Instance.AddChidren(accountLogin); - accountLogin.Show(); - //accountLogin.ShowForm(); + accountLogin.ShowForm(); } } - + /// <summary> + /// 鏄剧ず鍚姩椤� + /// </summary> public void ShowLoginLoadView() { var loginLoad = new LoginLoading { }; @@ -133,7 +98,7 @@ } /// <summary> - /// Logins the by PWDA sync. + /// 1:鐧诲綍鎴愬姛 0:瀵嗙爜閿欒 -1:鍏朵粬寮傚父 2:鏃犳硶鑱旂綉 /// </summary> /// <returns>The by PWDA sync.</returns> /// <param name="account">Account.</param> @@ -142,81 +107,68 @@ /// <param name="company">Company.</param> public async System.Threading.Tasks.Task<int> LoginByPWDAsync(string account, string password, string source = "", int company = 0) { - var isLoginSuccess = -1; - try - { - var requestObj = new SendDataToServer.LoginObj - { - Account = account, - Password = password, - Source = source, - Company = company - }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/Login", System.Text.Encoding.UTF8.GetBytes(requestJson)); - if (revertObj == null) - { - isLoginSuccess = -1; - return isLoginSuccess; - } - var stateCodeStr = revertObj.StateCode.ToUpper(); - //Error 涓嶈兘鐩存帴浠庢湇鍔″櫒鍙栵紝鍙兘鏍规嵁鐘舵�佺爜閫愪竴鍒ゆ柇 - if (stateCodeStr == "SUCCESS") - { - if (revertObj.ResponseData == null) - { - return -1; - } - - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString()); - var revertData = responseDataObj; - //鏍囪涓婁竴娆℃槸涓嶆槸鍚屼竴涓处鍙风櫥闄� - UserCenter.UserCenterResourse.ResidenceOption.TheSameLoginAccount = Config.Instance.Guid == revertData.Guid; - Config.Instance.Account = revertData.Account; - Config.Instance.Password = password; - Config.Instance.MD5PWD = revertData.MD5PWD; - Config.Instance.Guid = revertData.Guid; - Config.Instance.LoginDateTime = DateTime.Now; - Config.Instance.LoginToken = revertData.Token; - isLoginSuccess = 1; - var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID(); - System.Console.WriteLine($"鍚庡彴鐧诲綍鎴愬姛--{Config.Instance.LoginDateTime}"); - } - else if (stateCodeStr == "YOUDATANOISLOCALREGION") - { - isLoginSuccess = -1; - //涓嶅湪鏈尯鍩燂紝闇�瑕侀噸瀹氬悜鍖哄煙鍚庡啀娆¤姹傜櫥褰� - if (revertObj.ResponseData == null) - { - return isLoginSuccess; - } - var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginLocalRegionRes>(revertObj.ResponseData.ToString()); - CommonPage.RequestHttpsHost = responseDataObj.RegionServer; - } - else - { - isLoginSuccess = -1; - } + var isLoginSuccess = -1; + var requestObj = new SendDataToServer.LoginObj + { + Account = account, + Password = password, + Source = source, + Company = company + }; + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/Login", System.Text.Encoding.UTF8.GetBytes(requestJson)); + if (revertObj == null) + { + return 2; + } + var stateCodeStr = revertObj.StateCode.ToUpper(); + //Error 涓嶈兘鐩存帴浠庢湇鍔″櫒鍙栵紝鍙兘鏍规嵁鐘舵�佺爜閫愪竴鍒ゆ柇 + if (stateCodeStr == "SUCCESS") + { + var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString()); + var revertData = responseDataObj; + //鏍囪涓婁竴娆℃槸涓嶆槸鍚屼竴涓处鍙风櫥闄� + UserCenter.UserCenterResourse.ResidenceOption.TheSameLoginAccount = Config.Instance.Guid == revertData.Guid; + Config.Instance.Account = revertData.Account; + Config.Instance.Password = password; + Config.Instance.MD5PWD = revertData.MD5PWD; + Config.Instance.Guid = revertData.Guid; + Config.Instance.LoginDateTime = DateTime.Now; + Config.Instance.LoginToken = revertData.Token; + //涓婃姤璁惧ID + await CommonPage.Instance.PushRegID(); + isLoginSuccess = 1; + } + else if (stateCodeStr == "YOUDATANOISLOCALREGION") + { + //涓嶅湪鏈尯鍩燂紝闇�瑕侀噸瀹氬悜鍖哄煙鍚庡啀娆¤姹傜櫥褰� + var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginLocalRegionRes>(revertObj.ResponseData.ToString()); + CommonPage.RequestHttpsHost = responseDataObj.RegionServer; + //鍐嶆鐧诲綍 + return await this.LoginByPWDAsync(account, password, source, company); + } + if (stateCodeStr == "NOTVERIFY") + { + //鏈縺娲� + } + else if (stateCodeStr == "NOTENABLE") + { + //璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤 + } + else if (stateCodeStr == "PARAMETEROREMPTY") + { + //鎻愪緵鐨勫弬鏁伴敊璇� + } + else if (stateCodeStr == "USERNAMEORPWDERROR") + { + //璐﹀彿鎴栧瘑鐮侀敊璇� + isLoginSuccess = 0; + } + else if (stateCodeStr == "ACCOUNTNOEXISTS") + { + //璐﹀彿涓嶅瓨鍦� + isLoginSuccess = 0; } - catch - { - isLoginSuccess = -1; - } - return isLoginSuccess; - } - - /// <summary> - /// 鍚庡彴鐧诲綍 - /// -1 澶辫触 1 鎴愬姛 - /// </summary> - /// <returns>The by PWDA sync.</returns> - /// <param name="account">Account.</param> - /// <param name="password">Password.</param> - /// <param name="source">Source.</param> - /// <param name="company">Company.</param> - public async System.Threading.Tasks.Task<int> LoginByPWDResultAsync(string account, string password, string source = "", int company = 0) - { - var isLoginSuccess = await LoginByPWDAsync(account, password, source, company); return isLoginSuccess; } } diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs index 8df13b5..f391d26 100755 --- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs +++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using Shared.Common; using System.Text; - + namespace Shared.Phone.UserView { /// <summary> @@ -113,8 +113,8 @@ public Button homePageIMG = new Button { Y = Application.GetRealHeight(tabBarEnumIMG_Y), - Height = Application.GetMinRealAverage(tabBarEnumIMG_Height), - Width = Application.GetMinRealAverage(tabBarEnumIMG_Width), + Height = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(tabBarEnumIMG_Height), + Width = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(tabBarEnumIMG_Width), UnSelectedImagePath = "Navigation/Home.png", SelectedImagePath = "Navigation/HomeSelected.png", Gravity = Gravity.CenterHorizontal @@ -150,8 +150,8 @@ public Button categoryIMG = new Button { Y = Application.GetRealHeight(tabBarEnumIMG_Y), - Height = Application.GetMinRealAverage(tabBarEnumIMG_Height), - Width = Application.GetMinRealAverage(tabBarEnumIMG_Width), + Height = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(tabBarEnumIMG_Height), + Width = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(tabBarEnumIMG_Width), UnSelectedImagePath = "Navigation/Category.png", SelectedImagePath = "Navigation/CategorySelected.png", Gravity = Gravity.CenterHorizontal @@ -187,8 +187,8 @@ public Button settingIMG = new Button { Y = Application.GetRealHeight(tabBarEnumIMG_Y), - Height = Application.GetMinRealAverage(tabBarEnumIMG_Height), - Width = Application.GetMinRealAverage(tabBarEnumIMG_Width), + Height = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(tabBarEnumIMG_Height), + Width = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(tabBarEnumIMG_Width), UnSelectedImagePath = "Navigation/Setting.png", SelectedImagePath = "Navigation/SettingSelected.png", Gravity = Gravity.CenterHorizontal @@ -205,44 +205,44 @@ SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2, Gravity = Gravity.CenterHorizontal, TextSize = 10 - }; + }; #endregion - + #region 寮哄埗鏄剧ず鑷姩鍖栫晫闈� - /// <summary> - /// 寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈� + /// <summary> + /// 寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈� /// </summary> - public void ShowCategoryAutoListForm() - { - //鍏抽棴鍏ㄩ儴鐣岄潰,鐩村埌涓婚〉涓烘 - UserCenter.UserCenterLogic.CloseAllOpenForm(); - //寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈� - UserCenter.UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2; - BottomEventHandler(Instance.categoryIMG, null); + public void ShowCategoryAutoListForm() + { + //鍏抽棴鍏ㄩ儴鐣岄潰,鐩村埌涓婚〉涓烘 + UserCenter.UserCenterLogic.CloseAllOpenForm(); + //寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈� + UserCenter.UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2; + BottomEventHandler(Instance.categoryIMG, null); } #endregion - + EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) => { if (sender == Instance.homePageIMG || sender == Instance.homePageName) - { - if (Instance.homePageName.IsSelected == true && e != null) - { - //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊 - return; - } + { + if (Instance.homePageName.IsSelected == true && e != null) + { + //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊 + return; + } Instance.BodyView.RemoveAll(); //涓婚〉 CommonPage.Instance.IsDrawerLockMode = false; Instance.homePageName.IsSelected = true; - Instance.homePageIMG.IsSelected = true; - - Instance.categoryName.IsSelected = false; - Instance.categoryIMG.IsSelected = false; - - Instance.settingName.IsSelected = false; + Instance.homePageIMG.IsSelected = true; + + Instance.categoryName.IsSelected = false; + Instance.categoryIMG.IsSelected = false; + + Instance.settingName.IsSelected = false; Instance.settingIMG.IsSelected = false; var home = new MainPage.HomeMainPageForm(); @@ -251,23 +251,23 @@ } else if (sender == Instance.categoryIMG || sender == Instance.categoryName) - { - if (Instance.categoryName.IsSelected == true && e != null) - { - //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊 - return; - } - + { + if (Instance.categoryName.IsSelected == true && e != null) + { + //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊 + return; + } + Instance.BodyView.RemoveAll(); //鍒嗙被 CommonPage.Instance.IsDrawerLockMode = true; Instance.categoryName.IsSelected = true; - Instance.categoryIMG.IsSelected = true; - - Instance.homePageName.IsSelected = false; - Instance.homePageIMG.IsSelected = false; - - Instance.settingName.IsSelected = false; + Instance.categoryIMG.IsSelected = true; + + Instance.homePageName.IsSelected = false; + Instance.homePageIMG.IsSelected = false; + + Instance.settingName.IsSelected = false; Instance.settingIMG.IsSelected = false; var category = new Category.CategoryMainForm { }; @@ -275,21 +275,21 @@ category.ShowForm(); } else if (sender == Instance.settingIMG || sender == Instance.settingName) - { - if (Instance.settingName.IsSelected == true && e != null) - { - return; - } + { + if (Instance.settingName.IsSelected == true && e != null) + { + return; + } Instance.BodyView.RemoveAll(); //涓汉涓績 CommonPage.Instance.IsDrawerLockMode = true; Instance.settingName.IsSelected = true; - Instance.settingIMG.IsSelected = true; - - Instance.homePageName.IsSelected = false; - Instance.homePageIMG.IsSelected = false; - - Instance.categoryName.IsSelected = false; + Instance.settingIMG.IsSelected = true; + + Instance.homePageName.IsSelected = false; + Instance.homePageIMG.IsSelected = false; + + Instance.categoryName.IsSelected = false; Instance.categoryIMG.IsSelected = false; var form = new UserCenter.UserMain.UserMainForm(); diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs old mode 100644 new mode 100755 index b7661a2..cc6989d --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs @@ -35,59 +35,59 @@ /// </summary> public int currentFanStatus = 0; - /// <summary> - /// 鍏抽棴 - /// </summary> - /// <returns>The close.</returns> - public async System.Threading.Tasks.Task<SetWritableValueResponAllData> Close() - { - return await SetFanModeAsync(FanMode.Off); - } - - /// <summary> - /// 寮�鍚� - /// </summary> - /// <returns>The open.</returns> - public async System.Threading.Tasks.Task<SetWritableValueResponAllData> Open() - { - return await SetFanModeAsync(FanMode.On); + /// <summary> + /// 鍏抽棴 + /// </summary> + /// <returns>The close.</returns> + public async System.Threading.Tasks.Task<SetWritableValueResponAllData> Close() + { + return await SetFanModeAsync(FanMode.Off); } - /// <summary> - /// 楂橀 - /// </summary> - /// <returns>The close.</returns> - public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetHighSpeed() - { - return await SetFanModeAsync(FanMode.High); - } - - /// <summary> - /// 浣庨 - /// </summary> - /// <returns>The open.</returns> - public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetLowSpeed() - { - return await SetFanModeAsync(FanMode.Low); + /// <summary> + /// 寮�鍚� + /// </summary> + /// <returns>The open.</returns> + public async System.Threading.Tasks.Task<SetWritableValueResponAllData> Open() + { + return await SetFanModeAsync(FanMode.On); + } + + /// <summary> + /// 楂橀 + /// </summary> + /// <returns>The close.</returns> + public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetHighSpeed() + { + return await SetFanModeAsync(FanMode.High); + } + + /// <summary> + /// 浣庨 + /// </summary> + /// <returns>The open.</returns> + public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetLowSpeed() + { + return await SetFanModeAsync(FanMode.Low); } - /// <summary> - /// 鎵嬪姩 - /// </summary> - /// <returns>The close.</returns> - public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetManual() - { - return await SetFanModeAsync(FanMode.Manual); - } - - /// <summary> - /// 鑷姩 - /// </summary> - /// <returns>The open.</returns> - public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetAuto() - { - return await SetFanModeAsync(FanMode.Auto); + /// <summary> + /// 鎵嬪姩 + /// </summary> + /// <returns>The close.</returns> + public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetManual() + { + return await SetFanModeAsync(FanMode.Manual); + } + + /// <summary> + /// 鑷姩 + /// </summary> + /// <returns>The open.</returns> + public async System.Threading.Tasks.Task<SetWritableValueResponAllData> SetAuto() + { + return await SetFanModeAsync(FanMode.Auto); } ///<summary > @@ -225,6 +225,6 @@ /// 鎵嬪姩 /// </summary> Manual = 7, - } + } } } diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs old mode 100644 new mode 100755 diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs old mode 100644 new mode 100755 index 4f527da..2ac732f --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs @@ -1564,7 +1564,7 @@ level = temp2; break; } - + sbString2.Append(level.ToUpper()); data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + mode + time + sbString2; diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs index 6c9a52b..8aaba76 100644 --- a/ZigbeeApp/Shared/R.cs +++ b/ZigbeeApp/Shared/R.cs @@ -558,6 +558,10 @@ /// 鎵嬪姩 /// </summary> public const int Manual = 311; + /// <summary> + /// 鑳屽厜鐏鑹� + /// </summary> + public const int BackgroundLightColor = 312; public readonly static int cancel = 5097; public readonly static int confrim = 5098; @@ -815,6 +819,14 @@ public readonly static int openmode = 5380; public readonly static int addnull = 5381; public readonly static int look = 5382; + public readonly static int closeUp = 5383; + public readonly static int yearSone = 5384; + public readonly static int monthSone = 5385; + public readonly static int daySone = 5386; + public readonly static int numberSone = 5387; + public readonly static int openAutomationSone = 5388; + public readonly static int timeSetSone = 5389; + #region 鐧诲綍娉ㄥ唽 /// <summary> @@ -1141,9 +1153,9 @@ /// </summary> public const int BelongZone = 11015; /// <summary> - /// 鎵�灞炴ā鍧� + /// 鎵�灞炶澶� /// </summary> - public const int BelongModel = 11016; + public const int BelongDevice = 11016; /// <summary> /// 鏈煡 /// </summary> @@ -5611,11 +5623,11 @@ /// </summary> public const int uEditorSceneNameFail = 16087; /// <summary> - /// 闂ㄩ攣鎶ヨ淇℃伅8锛氬父寮�妯″紡寮�鍚�(缃戝叧瑙﹀彂) + /// 闂ㄩ攣鎶ヨ淇℃伅9锛氬父寮�妯″紡寮�鍚�(缃戝叧瑙﹀彂) /// </summary> public const int uDoorLockAlarmMsg9 = 16088; /// <summary> - /// 闂ㄩ攣鎶ヨ淇℃伅8锛氬父寮�妯″紡缁撴潫(缃戝叧瑙﹀彂) + /// 闂ㄩ攣鎶ヨ淇℃伅10锛氬父寮�妯″紡缁撴潫(缃戝叧瑙﹀彂) /// </summary> public const int uDoorLockAlarmMsg10 = 16089; /// <summary> @@ -5658,6 +5670,66 @@ /// 璇峰厛闃呰骞跺悓鎰忋�婇殣绉佹潈鏀跨瓥銆嬪拰銆婃湇鍔℃潯娆俱�� /// </summary> public const int uPleaseReadAndAgreePrivacyPolicyMsg = 16099; + /// <summary> + /// 闂ㄩ攣鎶ヨ淇℃伅11锛氬父寮�妯″紡寮�鍚�(鑷姩鍖栬Е鍙�) + /// </summary> + public const int uDoorLockAlarmMsg11 = 16100; + /// <summary> + /// 闂ㄩ攣鎶ヨ淇℃伅12锛氬父寮�妯″紡缁撴潫(鑷姩鍖栬Е鍙�) + /// </summary> + public const int uDoorLockAlarmMsg12 = 16101; + /// <summary> + /// 闂ㄩ攣鎶ヨ淇℃伅13锛氫复鏃跺瘑鐮佸紑閿佹垚鍔� + /// </summary> + public const int uDoorLockAlarmMsg13 = 16102; + /// <summary> + /// 闂ㄩ攣鎶ヨ淇℃伅14锛氫复鏃跺瘑鐮佸紑閿佸け璐� + /// </summary> + public const int uDoorLockAlarmMsg14 = 16103; + /// <summary> + /// 鐢垫満绌鸿皟妯″潡 + /// </summary> + public const int uSaecAirConditioningModule = 16104; + /// <summary> + /// 涓滆姖绌鸿皟妯″潡 + /// </summary> + public const int uToshibaAirConditioningModule = 16105; + /// <summary> + /// 鏍煎姏绌鸿皟妯″潡 + /// </summary> + public const int uGreeAirConditioningModule = 16106; + /// <summary> + /// 缇庣殑绌鸿皟妯″潡 + /// </summary> + public const int uMideaAirConditioningModule = 16107; + /// <summary> + /// 铏氭嫙缃戝叧 + /// </summary> + public const int uVirtualGateway = 16108; + /// <summary> + /// 鐜勫叧 + /// </summary> + public const int uVestibule = 16109; + /// <summary> + /// 鍘ㄦ埧 + /// </summary> + public const int uKitchen = 16110; + /// <summary> + /// 璧板粖 + /// </summary> + public const int uCorridor = 16111; + /// <summary> + /// 铏氭嫙璐﹀彿 + /// </summary> + public const int uVirtualAccount = 16112; + /// <summary> + /// 鐏叏寮� + /// </summary> + public const int uAllLightOpen = 16113; + /// <summary> + /// 鐏叏鍏� + /// </summary> + public const int uAllLightClose = 16114; //鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� /// <summary> @@ -6120,11 +6192,7 @@ /// <summary> /// 鑷畾涔夎澶囨墍灞濱D涓�16鐨勭炕璇戝悕瀛楋細骞叉帴鐐� /// </summary> - public const int uDeviceBelongId16 = 40017; - /// <summary> - /// 鑷畾涔夎澶囨墍灞濱D涓�2310鐨勭炕璇戝悕瀛楋細鏂伴 - /// </summary> - public const int uDeviceBelongId2310 = 40018; + public const int uDeviceBelongId16 = 40017; //鈽呪槄鈽呪槄妯″潡ID鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�,杩欓噷涓嶉渶瑕佸畾涔�,鍙啓鍦↙anguage.ini鏂囦欢閲岄潰鈽呪槄鈽呪槄 //鈽呪槄鈽呪槄妯″潡ID鐨勮澶囩被鍨嬪悕瀛�,浠�60000寮�濮�,杩欓噷涓嶉渶瑕佸畾涔�,鍙啓鍦↙anguage.ini鏂囦欢閲岄潰鈽呪槄鈽呪槄 diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems old mode 100644 new mode 100755 index 87dd7b3..6c3a1c5 --- a/ZigbeeApp/Shared/Shared.projitems +++ b/ZigbeeApp/Shared/Shared.projitems @@ -14,11 +14,9 @@ <Compile Include="$(MSBuildThisFileDirectory)Common\Logic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\ApkInfoOBJ.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\AuthUserRes.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\FirmwareManaRes.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\GetAppVersionCode.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\ResultPack.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\UserLoginLocalRegionRes.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Pad\MainPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\AddOrEditorSceneForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\AdjustTargetAddDelayTimeForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\AdjustTargetAddDeviceForm.cs" /> @@ -30,6 +28,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceColorLightRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceCurtainRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceDoorLockRowControl.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceFreshAirRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceRelayRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceSensorRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceTemperatureRowControl.cs" /> @@ -50,6 +49,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\OneTimePoint.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\RoomAndDeviceView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SkipView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SoneLogicList.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountForgetPWD.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountRegister.cs" /> @@ -58,22 +58,17 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\Controls\PhoneEmailSelectControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\PhoneEmailForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\PhoneZone.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\AC\ACControlBase.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectFloor.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectHouse.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceAcDetailCardMethord.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\SelectFloorForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\SelectHouseForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CommonEnum.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CommonFormResouce.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CompleteButton.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\DeviceIconSelectedIMGByLocal.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\DeviceInfoRow.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\FunctionIconButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\LeftIconButtonRow.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RoomView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SceneCategoryView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectTime.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectZone.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\TopFrameLayout.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\DeviceLogic\ReadDeviceAttributeLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\AddLogicPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\AddScenePage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\CustomText.cs" /> @@ -99,9 +94,11 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceAcDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceColorLightDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceCurtainDetailCardForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceFreshAirDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceRelayDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceFunctionUnallocatedControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceSelectUnallocatedControl.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\SelectLocalDeviceImageForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\DeviceDetailInfoForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\UnallocatedRoomForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\Base\DeviceCardCommon.cs" /> @@ -121,6 +118,8 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Abount\SLAForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\AccountOption.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\ResidenceOption.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\BaseCommonControl\Base\FrameLayoutBase.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\BaseCommonControl\Base\RowLayoutBase.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ClickButtonControls\BottomLeftClickButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ClickButtonControls\BottomRightClickButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\BelongAreaControl.cs" /> @@ -138,6 +137,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\NormalControls\IconBigViewControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\NormalControls\LoadingControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\NormalControls\MessageManagementControl.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\RowLayoutControls\DeviceFunctionTypeRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\SceneControls\ScenePictrueControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Form\BottomMenuSelectForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Form\NumberPswInputDialogForm.cs" /> @@ -150,6 +150,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceCurtainLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceDoorLockLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceOtherLogic.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlExperienceAccountLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlGatewayBackupLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlGatewayUpdateLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlLogLogic.cs" /> @@ -249,6 +250,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionFileListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionGatewayListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionMainForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionSearchAllFile.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Member\MemberNotEsixtForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Password\CheckNewPhoneForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Password\CheckOldPhoneForm.cs" /> @@ -287,7 +289,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\DeviceControls\GatewayRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\FrameLayoutControls\FrameListControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ClickButtonControls\BottomClickButton.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\FrameLayoutControls\FrameLayoutControl.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\FrameLayoutControls\FrameLayoutStatuControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ListViewLayoutControls\VerticalFrameControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ListViewLayoutControls\VerticalListControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\NormalControls\NormalViewControl.cs" /> @@ -416,16 +418,11 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Add\WiredGatewaySearchForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Manage\GatewayInfoEditorForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountLogin.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountLoginByCode.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\CommonPage.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\BackupInfoRes.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\FolderRes.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\GatewayRes.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\GetAreaCode.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\ResidenceRes.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\ResponsePack.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\UserLoginRes.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\UserRegisterReqDto.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\SendDataToServer.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\Room.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ListRoomViewFrom.cs" /> @@ -440,8 +437,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Safety\SafetyManagementMainForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\FrameLayoutControls\FrameRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Common\SceneUI.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Common\SceneTargetDeviceUI.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Common\SceneRoomUI.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Common\Application.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Common\BigInteger.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Common\CloudMqttResponsePack.cs" /> @@ -479,12 +474,8 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\IO\LocalFileUtils.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlSafeguardLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlAlarmsLogic.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceFreshAirRowControl.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceFreshAirDetailCardForm.cs" /> </ItemGroup> <ItemGroup> - <Folder Include="$(MSBuildThisFileDirectory)Pad\" /> - <Folder Include="$(MSBuildThisFileDirectory)Pad\Home\" /> <Folder Include="$(MSBuildThisFileDirectory)Phone\CommonForm\" /> <Folder Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\Base\" /> </ItemGroup> -- Gitblit v1.8.0