From dce6c3481a37216292724013ff9d2b75ceb82f86 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 10 六月 2020 15:47:28 +0800
Subject: [PATCH] 添加小度的代码
---
ZigbeeApp/Home.Ios/AppDelegate.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 39
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs | 36
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 2
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs | 61
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayHistoryFirmwareVersionForm.cs | 19
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs | 26
ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 6
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaodu.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedContentForm.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 10
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs | 39
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs | 44
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs | 10
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs | 11
ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs | 12
ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs | 22
ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs | 40
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs | 113
ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs | 16
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs | 4
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxSel.png | 0
ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlForm.cs | 385 ++
ZigbeeApp/Shared/Phone/SmartSound/Util/MyHttpWebResponse.cs | 125
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs | 5
ZigbeeApp/Home.Ios/Info.plist | 4
ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlContentForm.cs | 662 ++++
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs | 8
ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs | 1
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs | 548 +--
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Nickname.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs | 57
ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Tianmao.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs | 12
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs | 2
ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs | 4
ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 30
ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs | 4
ZigbeeApp/Shared/Common/CommonPage.cs | 2
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 12
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 2
ZigbeeApp/Shared/Phone/SmartSound/SmartSoundInfo.cs | 74
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs | 14
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs | 7
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs | 6
ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs | 49
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs | 22
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewayDirection2Form.cs | 8
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 69
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs | 80
ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs | 72
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayBackupLogic.cs | 6
ZigbeeApp/Shared/Phone/UserView/HomePage.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs | 4
ZigbeeApp/Home.Ios/Home.IOS.csproj | 14
ZigbeeApp/Shared/R.cs | 724 ++--
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs | 28
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayCoordinatorInfoForm.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs | 12
ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 38
ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs | 16
ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedContentForm.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs | 35
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs | 12
ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs | 479 +++
ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs | 14
ZigbeeApp/Shared/Common/House.cs | 347 --
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperatureSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Language.ini | 36
ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs | 8
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaoai.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneRoomControl.cs | 4
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs | 6
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs | 11
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs | 4
ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 17
ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs | 8
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/SoundIcon.png | 0
ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 15
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaodu.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs | 12
ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs | 4
ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs | 2
ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs | 6
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs | 21
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs | 14
ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs | 6
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs | 4
ZigbeeApp/Shared/Phone/SmartSound/SmartSoundDataInfo.cs | 21
ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs | 10
ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs | 445 +-
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs | 2
ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs | 17
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs | 4
ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs | 7
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs | 12
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs | 2
ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperatureSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/PullDown.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 75
ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperatureSelected2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs | 11
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Nickname.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs | 6
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayLinuxInfoForm.cs | 8
ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundListForm.cs | 305 ++
ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs | 6
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs | 32
ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs | 88
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs | 116
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs | 8
ZigbeeApp/Shared/Shared.projitems | 18
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/SoundIcon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 319 +-
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Tianmao.png | 0
ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs | 16
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxDef.png | 0
ZigbeeApp/Shared/Phone/SmartSound/Widget/TextDialog.cs | 143
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxSel.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs | 4
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs | 21
ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs | 1
ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 24
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs | 86
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs | 2
ZigbeeApp/Shared/Phone/SmartSound/Widget/SoundRowLayout.cs | 62
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs | 8
ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs | 11
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs | 86
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs | 399 ++
ZigbeeApp/Shared/Phone/SmartSound/SmartSound.cs | 90
ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxDef.png | 0
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/PullDown.png | 0
ZigbeeApp/Shared/Phone/UserCenter/OtherParty/OtherPartyAccountMenuForm.cs | 8
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs | 10
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs | 476 +-
ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs | 14
ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperature.png | 0
ZigbeeApp/Home.Ios/Resources/Language.ini | 36
ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaoai.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperature.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs | 2
ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs | 4
ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs | 583 +++
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs | 2
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs | 6
ZigbeeApp/Shared/Common/Device.cs | 87
ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 60
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs | 14
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterEnumCommon.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs | 64
/dev/null | 121
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs | 5
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 11
ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 20
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperatureSelected.png | 0
ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs | 2
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs | 118
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayGeneralInformationForm.cs | 13
ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordMenuForm.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs | 14
193 files changed, 6,053 insertions(+), 2,913 deletions(-)
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
index 90368fb..e4643f9 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini
+++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -648,50 +648,32 @@
10131=璐﹀彿鎴栧瘑鐮侀敊璇�
10132=璐﹀彿涓嶅瓨鍦紝璇锋敞鍐岀敤鎴�
10133=璇疯緭鍏ラ獙璇佺爜
-10134=鍗冲皢閫氳繃寰俊鎺堟潈鐧诲綍
10135=鐧诲綍涓�...
10136=褰撳墠浣忓畢涓虹┖锛岃鍏堝缓绔嬩綇瀹�
-10137=浣忓畢鍚嶇О涓虹┖
10138=閭閿欒锛岃閲嶆柊杈撳叆
10139=鎵嬫満鍙烽敊璇紝璇烽噸鏂拌緭鍏�
10140=璇疯緭鍏ラ暱搴︿负6-13涓瓧绗︾殑瀵嗙爜
-10141=浣犲凡琚己鍒朵笅绾匡紒
10142=鏂板瘑鐮佸拰鍘熷瘑鐮佷竴鑷�
10143=璇峰厛鑾峰彇楠岃瘉鐮�
10144=蹇樿瀵嗙爜锛�
10145=宸叉湁璐﹀彿锛熺櫥褰�
-
-
-
10150=鎴块棿鍚嶇О宸插瓨鍦�
10151=鍦烘櫙鍚嶄笉鑳戒负绌�
10152=鎺у埗鍦烘櫙澶辫触
-10153=鍦烘櫙涓虹┖
-10154=璇ュ満鏅腑娌℃湁鎵ц鐩爣
10155=鎿嶄綔澶辫触
10156=鍙戦�侀獙璇佺爜澶辫触
-10157=缃戝叧涓嶅湪绾�
-10158=涓嬩竴姝�
-
10160=宸叉槸鏈�鏂扮増鏈�
10161=鏇存柊鏈�鏂扮増
-10162=鏇存柊鍐呭
10163=鏇存柊澶辫触
10164=姝e湪鏇存柊涓�...
-10165=鍙栨秷鏇存柊
10166=鐗堟湰鍙�
10167=鏈嶅姟鍗忚
10168=鐗堟湰鏇存柊
-10169=鍗忚鏂囨湰淇℃伅鍐呭
-10170=鍙兘鐢变簬褰撳墠缃戠粶杈冨樊鎴栬澶囧凡琚粬浜虹粦瀹氥�倇\r\n}1.璇风‘淇濇墜鏈轰笌璁惧涔嬮棿鐨勮窛绂昏冻澶熻繎锛屽苟涓斿懆鍥寸綉缁滅幆澧冩病鏈夊己骞叉壈銆倇\r\n}2.鍚屾椂闇�纭搴旂敤鐨勫畾浣嶆潈闄愭湭琚叧闂�傝嫢鎵嬪姩鍏抽棴浜嗗簲鐢ㄥ畾浣嶆潈闄愬彲鑳藉鑷存棤娉曞彂鐜拌澶囥�倇\r\n}3.濡傛灉浠嶅缁堟棤娉曞彂鐜拌澶囷紝鍙兘鍥犱负璁惧宸茬粡琚粬浜虹粦瀹氫簡銆� 濡傛灉浣犲苟涓嶆竻妤氭槸璋佽繛鎺ヤ簡璁惧锛屽彲浠ヨ繘琛岄噸缃紝閲嶇疆鏂瑰紡璇� 鏌ラ槄璇存槑涔︼紝鏍规嵁鎸囧紩鎿嶄綔銆�
-
-
11000=鍔熻兘
11001=鍦烘櫙
11002=鑷姩鍖�
-
11010=娌℃湁鍔熻兘{0}璇峰湪涓汉涓績--璁惧绠$悊澶勬坊鍔�
11011=缂栬緫
11012=鍔熻兘璁剧疆
@@ -723,18 +705,8 @@
12100=鏈煡璁惧
-12101=鎺у埗闈㈡澘
-12102=缁х數鍣�
-12103=璋冨厜鐏�
-12104=绐楀笜
-12105=绌鸿皟
-12106=浼犳劅鍣�
-12107=绌烘皵寮�鍏�
-12108=褰╃伅
-12109=涓户鍣�
12110=娓╁害浼犳劅鍣�
12111=婀垮害浼犳劅鍣�
-12112=娓╂箍搴︿紶鎰熷櫒
12500=鏈変汉
12501=鏃犱汉
@@ -1869,10 +1841,10 @@
16123=Mini缃戝叧
16124=娣诲姞Mini缃戝叧
16125=鎻掔數鍚�,闀挎寜缃戝叧HID/WCFG鎸夐敭5绉抺0}绯荤粺鐏父浜�60绉掑悗鍒欒繘鍏ラ厤缃戠姸鎬�
-16126=璇烽�夋嫨widora-xxxx缃戠粶
-16127=鎵嬫満鍘昏缃繛鎺ョ綉鍏崇儹鐐箋0}閫夋嫨widora-xxxx缃戠粶
16128=鑹叉俯
16129=Mini澶滅伅
+16130=鐕冩皵娉勯湶
+16131=蹇界暐
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -2005,6 +1977,7 @@
30041=绠�绾﹀鍔熻兘闈㈡澘
30042=绠�绾︾幆澧冮潰鏉�
30043=Mini缃戝叧
+30044=鑹叉俯鐏�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
40000=閬槼
@@ -2031,7 +2004,7 @@
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽�
50000=绱ф�ユ寜閽�
50001=Zigbee鐕冩皵浼犳劅鍣�
-50002=Zigbee鐕冩皵浼犳劅鍣�
+50002=Zigbee鐑熼浘浼犳劅鍣�
50003=Zigbee姘存蹈浼犳劅鍣�
50004=閽ュ寵鎵�
50005=Zigbee闂ㄧ獥浼犳劅鍣�
@@ -2073,6 +2046,7 @@
50041=绠�绾﹀鍔熻兘闈㈡澘
50042=绠�绾︾幆澧冮潰鏉�
50043=Mini缃戝叧
+50044=鑹叉俯鐏�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囩被鍨嬪悕瀛�,浠�60000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽�
60000=浼犳劅鍣�
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/MiniNightLight.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperature.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/MiniNightLight.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperature.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/MiniNightLightSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperatureSelected.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/MiniNightLightSelected.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperatureSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/MiniNightLightSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperatureSelected2.png
similarity index 100%
rename from ZigbeeApp/GateWay.Droid/Assets/Phone/Device/MiniNightLightSelected2.png
rename to ZigbeeApp/GateWay.Droid/Assets/Phone/Device/ColorLightTemperatureSelected2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxDef.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxDef.png
new file mode 100755
index 0000000..69275db
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxDef.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxSel.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxSel.png
new file mode 100755
index 0000000..1a75f53
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/CheckBoxSel.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Nickname.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Nickname.png
new file mode 100755
index 0000000..98168de
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Nickname.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/PullDown.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/PullDown.png
new file mode 100755
index 0000000..7c827fa
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/PullDown.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/SoundIcon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/SoundIcon.png
new file mode 100755
index 0000000..a8d18bc
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/SoundIcon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Tianmao.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Tianmao.png
new file mode 100755
index 0000000..fbd1e71
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Tianmao.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaoai.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaoai.png
new file mode 100755
index 0000000..c0cdfbf
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaoai.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaodu.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaodu.png
new file mode 100755
index 0000000..fa4a294
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/SmartSound/Xiaodu.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
index 631fa08..3401b54 100644
--- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
+++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
@@ -2180,13 +2180,13 @@
<AndroidAsset Include="Assets\Phone\DeviceItem\MiniNightLightDevice.png" />
</ItemGroup>
<ItemGroup>
- <AndroidAsset Include="Assets\Phone\Device\MiniNightLight.png" />
+ <AndroidAsset Include="Assets\Phone\Device\ColorLightTemperature.png" />
</ItemGroup>
<ItemGroup>
- <AndroidAsset Include="Assets\Phone\Device\MiniNightLightSelected.png" />
+ <AndroidAsset Include="Assets\Phone\Device\ColorLightTemperatureSelected.png" />
</ItemGroup>
<ItemGroup>
- <AndroidAsset Include="Assets\Phone\Device\MiniNightLightSelected2.png" />
+ <AndroidAsset Include="Assets\Phone\Device\ColorLightTemperatureSelected2.png" />
</ItemGroup>
<ItemGroup>
<AndroidAsset Include="Assets\Phone\Device\ButtonPanelCurtainSelected2.png" />
@@ -2230,6 +2230,30 @@
<ItemGroup>
<AndroidAsset Include="Assets\Phone\RealDevice\ButtonPanelSimpleMultifunction.png" />
</ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\CheckBoxDef.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\CheckBoxSel.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\Nickname.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\PullDown.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\SoundIcon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\Tianmao.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\Xiaoai.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SmartSound\Xiaodu.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 47ae5c7..a129a39 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="2020060101" android:installLocation="auto" android:versionName="1.1.0.2020060101">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120061001" android:installLocation="auto" android:versionName="1.1.0120061001">
<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 219e0b2..0498c00 100644
--- a/ZigbeeApp/Home.Ios/AppDelegate.cs
+++ b/ZigbeeApp/Home.Ios/AppDelegate.cs
@@ -118,7 +118,7 @@
{
//寮哄埗涓嬬嚎
CommonPage.Instance.SingOut();
- CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.YouHaveBeenSignOut);
+ CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.uHadBeenLoginAndOffLine);
}
}
}
@@ -208,7 +208,7 @@
{
//寮哄埗涓嬬嚎
CommonPage.Instance.SingOut();
- CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.YouHaveBeenSignOut);
+ CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.uHadBeenLoginAndOffLine);
}
//妫�鏌ヨ繛鎺ヨ繙绋�
//浠g爜
diff --git a/ZigbeeApp/Home.Ios/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj
index b35a4ba..104b4b6 100644
--- a/ZigbeeApp/Home.Ios/Home.IOS.csproj
+++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj
@@ -371,6 +371,14 @@
<BundleResource Include="Resources\Phone\Navigation\Home.png" />
<BundleResource Include="Resources\Phone\Navigation\Setting.png" />
<BundleResource Include="Resources\Phone\Navigation\SettingSelected.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\PullDown.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\Xiaodu.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\Xiaoai.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\Nickname.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\SoundIcon.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\Tianmao.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\CheckBoxDef.png" />
+ <BundleResource Include="Resources\Phone\SmartSound\CheckBoxSel.png" />
<BundleResource Include="Resources\Phone\RollerShade\Stop.png" />
<BundleResource Include="Resources\Phone\RollerShade\DownSelected.png" />
<BundleResource Include="Resources\Phone\RollerShade\Up.png" />
@@ -693,6 +701,7 @@
<BundleResource Include="Resources\Phone\Device\CurtainSiphonate.png" />
<BundleResource Include="Resources\Phone\Device\Socket1Selected2.png" />
<BundleResource Include="Resources\Phone\Device\DimmableLight.png" />
+ <BundleResource Include="Resources\Phone\Device\ColorLightTemperatureSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelTwo.png" />
<BundleResource Include="Resources\Phone\Device\RelayEpointSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ConverterZb485Selected2.png" />
@@ -704,6 +713,8 @@
<BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueEnvironmentSelected.png" />
<BundleResource Include="Resources\Phone\Device\LightSelected.png" />
<BundleResource Include="Resources\Phone\Device\RelaySelected2.png" />
+ <BundleResource Include="Resources\Phone\Device\ColorLightTemperatureSelected.png" />
+ <BundleResource Include="Resources\Phone\Device\ColorLightTemperature.png" />
<BundleResource Include="Resources\Phone\Device\SensorWaterSelected2.png" />
<BundleResource Include="Resources\Phone\Device\SensorHumiditySelected.png" />
<BundleResource Include="Resources\Phone\Device\RelayThreeLoad.png" />
@@ -778,13 +789,10 @@
<BundleResource Include="Resources\Phone\Device\SensorPMTwoPointFiveSelected2.png" />
<BundleResource Include="Resources\Phone\Device\DryContactSelected.png" />
<BundleResource Include="Resources\Phone\Device\CurtainSelected.png" />
- <BundleResource Include="Resources\Phone\Device\MiniNightLight.png" />
<BundleResource Include="Resources\Phone\Device\ButtonPanelSimpleEnvironmentSelected.png" />
<BundleResource Include="Resources\Phone\Device\Converter.png" />
- <BundleResource Include="Resources\Phone\Device\MiniNightLightSelected.png" />
<BundleResource Include="Resources\Phone\Device\AirConditioner.png" />
<BundleResource Include="Resources\Phone\Device\SensorFireSelected.png" />
- <BundleResource Include="Resources\Phone\Device\MiniNightLightSelected2.png" />
<BundleResource Include="Resources\Phone\Device\ColorLight.png" />
<BundleResource Include="Resources\Phone\Device\AirConditionerZbGatewaySelected.png" />
<BundleResource Include="Resources\Phone\Device\AirQualitySensorEpointSelected2.png" />
diff --git a/ZigbeeApp/Home.Ios/Info.plist b/ZigbeeApp/Home.Ios/Info.plist
index 16a3e1d..b18409b 100755
--- a/ZigbeeApp/Home.Ios/Info.plist
+++ b/ZigbeeApp/Home.Ios/Info.plist
@@ -54,9 +54,9 @@
<key>aps-environment</key>
<string>development</string>
<key>CFBundleShortVersionString</key>
- <string>1.0.20042601</string>
+ <string>1.1.012006042</string>
<key>CFBundleVersion</key>
- <string>2</string>
+ <string>202006042</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini
index 90368fb..e4643f9 100755
--- a/ZigbeeApp/Home.Ios/Resources/Language.ini
+++ b/ZigbeeApp/Home.Ios/Resources/Language.ini
@@ -648,50 +648,32 @@
10131=璐﹀彿鎴栧瘑鐮侀敊璇�
10132=璐﹀彿涓嶅瓨鍦紝璇锋敞鍐岀敤鎴�
10133=璇疯緭鍏ラ獙璇佺爜
-10134=鍗冲皢閫氳繃寰俊鎺堟潈鐧诲綍
10135=鐧诲綍涓�...
10136=褰撳墠浣忓畢涓虹┖锛岃鍏堝缓绔嬩綇瀹�
-10137=浣忓畢鍚嶇О涓虹┖
10138=閭閿欒锛岃閲嶆柊杈撳叆
10139=鎵嬫満鍙烽敊璇紝璇烽噸鏂拌緭鍏�
10140=璇疯緭鍏ラ暱搴︿负6-13涓瓧绗︾殑瀵嗙爜
-10141=浣犲凡琚己鍒朵笅绾匡紒
10142=鏂板瘑鐮佸拰鍘熷瘑鐮佷竴鑷�
10143=璇峰厛鑾峰彇楠岃瘉鐮�
10144=蹇樿瀵嗙爜锛�
10145=宸叉湁璐﹀彿锛熺櫥褰�
-
-
-
10150=鎴块棿鍚嶇О宸插瓨鍦�
10151=鍦烘櫙鍚嶄笉鑳戒负绌�
10152=鎺у埗鍦烘櫙澶辫触
-10153=鍦烘櫙涓虹┖
-10154=璇ュ満鏅腑娌℃湁鎵ц鐩爣
10155=鎿嶄綔澶辫触
10156=鍙戦�侀獙璇佺爜澶辫触
-10157=缃戝叧涓嶅湪绾�
-10158=涓嬩竴姝�
-
10160=宸叉槸鏈�鏂扮増鏈�
10161=鏇存柊鏈�鏂扮増
-10162=鏇存柊鍐呭
10163=鏇存柊澶辫触
10164=姝e湪鏇存柊涓�...
-10165=鍙栨秷鏇存柊
10166=鐗堟湰鍙�
10167=鏈嶅姟鍗忚
10168=鐗堟湰鏇存柊
-10169=鍗忚鏂囨湰淇℃伅鍐呭
-10170=鍙兘鐢变簬褰撳墠缃戠粶杈冨樊鎴栬澶囧凡琚粬浜虹粦瀹氥�倇\r\n}1.璇风‘淇濇墜鏈轰笌璁惧涔嬮棿鐨勮窛绂昏冻澶熻繎锛屽苟涓斿懆鍥寸綉缁滅幆澧冩病鏈夊己骞叉壈銆倇\r\n}2.鍚屾椂闇�纭搴旂敤鐨勫畾浣嶆潈闄愭湭琚叧闂�傝嫢鎵嬪姩鍏抽棴浜嗗簲鐢ㄥ畾浣嶆潈闄愬彲鑳藉鑷存棤娉曞彂鐜拌澶囥�倇\r\n}3.濡傛灉浠嶅缁堟棤娉曞彂鐜拌澶囷紝鍙兘鍥犱负璁惧宸茬粡琚粬浜虹粦瀹氫簡銆� 濡傛灉浣犲苟涓嶆竻妤氭槸璋佽繛鎺ヤ簡璁惧锛屽彲浠ヨ繘琛岄噸缃紝閲嶇疆鏂瑰紡璇� 鏌ラ槄璇存槑涔︼紝鏍规嵁鎸囧紩鎿嶄綔銆�
-
-
11000=鍔熻兘
11001=鍦烘櫙
11002=鑷姩鍖�
-
11010=娌℃湁鍔熻兘{0}璇峰湪涓汉涓績--璁惧绠$悊澶勬坊鍔�
11011=缂栬緫
11012=鍔熻兘璁剧疆
@@ -723,18 +705,8 @@
12100=鏈煡璁惧
-12101=鎺у埗闈㈡澘
-12102=缁х數鍣�
-12103=璋冨厜鐏�
-12104=绐楀笜
-12105=绌鸿皟
-12106=浼犳劅鍣�
-12107=绌烘皵寮�鍏�
-12108=褰╃伅
-12109=涓户鍣�
12110=娓╁害浼犳劅鍣�
12111=婀垮害浼犳劅鍣�
-12112=娓╂箍搴︿紶鎰熷櫒
12500=鏈変汉
12501=鏃犱汉
@@ -1869,10 +1841,10 @@
16123=Mini缃戝叧
16124=娣诲姞Mini缃戝叧
16125=鎻掔數鍚�,闀挎寜缃戝叧HID/WCFG鎸夐敭5绉抺0}绯荤粺鐏父浜�60绉掑悗鍒欒繘鍏ラ厤缃戠姸鎬�
-16126=璇烽�夋嫨widora-xxxx缃戠粶
-16127=鎵嬫満鍘昏缃繛鎺ョ綉鍏崇儹鐐箋0}閫夋嫨widora-xxxx缃戠粶
16128=鑹叉俯
16129=Mini澶滅伅
+16130=鐕冩皵娉勯湶
+16131=蹇界暐
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -2005,6 +1977,7 @@
30041=绠�绾﹀鍔熻兘闈㈡澘
30042=绠�绾︾幆澧冮潰鏉�
30043=Mini缃戝叧
+30044=鑹叉俯鐏�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
40000=閬槼
@@ -2031,7 +2004,7 @@
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽�
50000=绱ф�ユ寜閽�
50001=Zigbee鐕冩皵浼犳劅鍣�
-50002=Zigbee鐕冩皵浼犳劅鍣�
+50002=Zigbee鐑熼浘浼犳劅鍣�
50003=Zigbee姘存蹈浼犳劅鍣�
50004=閽ュ寵鎵�
50005=Zigbee闂ㄧ獥浼犳劅鍣�
@@ -2073,6 +2046,7 @@
50041=绠�绾﹀鍔熻兘闈㈡澘
50042=绠�绾︾幆澧冮潰鏉�
50043=Mini缃戝叧
+50044=鑹叉俯鐏�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囩被鍨嬪悕瀛�,浠�60000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽�
60000=浼犳劅鍣�
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/MiniNightLight.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperature.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/MiniNightLight.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperature.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/MiniNightLightSelected.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperatureSelected.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/MiniNightLightSelected.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperatureSelected.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Device/MiniNightLightSelected2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperatureSelected2.png
similarity index 100%
rename from ZigbeeApp/Home.Ios/Resources/Phone/Device/MiniNightLightSelected2.png
rename to ZigbeeApp/Home.Ios/Resources/Phone/Device/ColorLightTemperatureSelected2.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxDef.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxDef.png
new file mode 100755
index 0000000..69275db
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxDef.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxSel.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxSel.png
new file mode 100755
index 0000000..1a75f53
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/CheckBoxSel.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Nickname.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Nickname.png
new file mode 100755
index 0000000..98168de
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Nickname.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/PullDown.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/PullDown.png
new file mode 100755
index 0000000..7c827fa
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/PullDown.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/SoundIcon.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/SoundIcon.png
new file mode 100755
index 0000000..a8d18bc
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/SoundIcon.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Tianmao.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Tianmao.png
new file mode 100755
index 0000000..fbd1e71
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Tianmao.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaoai.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaoai.png
new file mode 100755
index 0000000..c0cdfbf
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaoai.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaodu.png b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaodu.png
new file mode 100755
index 0000000..fa4a294
--- /dev/null
+++ b/ZigbeeApp/Home.Ios/Resources/Phone/SmartSound/Xiaodu.png
Binary files differ
diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs
index 1c7957a..bc830bf 100755
--- a/ZigbeeApp/Shared/Common/CommonPage.cs
+++ b/ZigbeeApp/Shared/Common/CommonPage.cs
@@ -50,7 +50,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string CodeIDString = "1.1.0.2020060101";
+ public static string CodeIDString = "1.1.0120061001";
/// <summary>
/// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee)
/// </summary>
diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs
index 3bc9e9e..e3891f6 100755
--- a/ZigbeeApp/Shared/Common/Device.cs
+++ b/ZigbeeApp/Shared/Common/Device.cs
@@ -123,12 +123,6 @@
if (device == null || device.CurrentGateWayId == null)
{
-#if DEBUG
- //璋冩煡,涓轰粈涔堝畠浼氭妸鍏ㄩ儴璁惧鍒犳帀锛�
- string file1 = UserCenterLogic.CombinePath(file);
- string file2 = UserCenterLogic.CombinePath("Back_" + file);
- System.IO.File.Copy(file1, file2, true);
-#endif
//澶辨晥鐨勬枃浠讹紝娌℃湁缃戝叧id鐨勯兘鍒犻櫎鎺�
Global.DeleteFilebyHomeId(file);
continue;
@@ -143,12 +137,6 @@
}
else
{
-#if DEBUG
- //璋冩煡,涓轰粈涔堝畠浼氭妸鍏ㄩ儴璁惧鍒犳帀锛�
- string file1 = UserCenterLogic.CombinePath(file);
- string file2 = UserCenterLogic.CombinePath("Back_" + file);
- System.IO.File.Copy(file1, file2, true);
-#endif
//濡傛灉鏄富浜�,鎴栬�呯鐞嗗憳,閭d箞杩欎釜鏂囦欢鏄潪娉曠殑,鐩存帴鍒犻櫎
Global.DeleteFilebyHomeId(file);
continue;
@@ -211,7 +199,7 @@
var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway();
foreach (var gateway in listGateway)
{
- string gwId = HdlGatewayLogic.Current.GetGatewayId(gateway);
+ string gwId = gateway.GwId;
if (listId.Contains(gwId) == false)
{
//杩欎釜缃戝叧瀵逛簬褰撳墠杩欎釜鎴愬憳鏉ヨ鏄潪娉曠殑
@@ -242,7 +230,7 @@
listDevice.AddRange(list);
//鑾峰彇杩欎釜缃戝叧鐨勬湰鍦版墍鏈夎澶�
- string gwID = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ string gwID = zbGateway.GwId;
List<CommonDevice> listLocalDevices = this.GetDeviceByGatewayID(gwID);
//鑾峰彇ota璁惧
foreach (var ota in this.dicOTADevice.Values)
@@ -1182,7 +1170,9 @@
}
if (device.Type == DeviceType.OnOffOutput
- || device.Type == DeviceType.DimmableLight || device.Type == DeviceType.ColorDimmableLight)
+ || device.Type == DeviceType.DimmableLight
+ || device.Type == DeviceType.ColorDimmableLight
+ || device.Type == DeviceType.ColorTemperatureLight)
{
//缁х數鍣�,鎺夊厜鍣ㄩ兘鍙洖璺�
return Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + epointNo;
@@ -1246,6 +1236,11 @@
if (string.IsNullOrEmpty(dName) == false)
{
return dName;
+ }
+ if (this.IsMiniLight(device) == true)
+ {
+ //Mini澶滅伅
+ return Language.StringByID(R.MyInternationalizationString.uMiniNightLight);
}
//鑾峰彇璁惧绫诲瀷
@@ -1996,6 +1991,14 @@
info.ConcreteType = DeviceConcreteType.Sensor_PMTwoPointFive;
info.ObjectTypeNameId = 60000;//浼犳劅鍣�
}
+ //16鑹叉俯鐏�
+ else if (dicType.ContainsKey(DeviceType.ColorTemperatureLight) == true)
+ {
+ info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId20000;
+ info.BeloneType = DeviceBeloneType.A褰╃伅;
+ info.ConcreteType = DeviceConcreteType.ColorLight_Temperature;
+ info.ObjectTypeNameId = 60007;//璋冨厜妯″潡
+ }
int value = (int)info.BeloneType;
if (dicDeviceAllNameID.ContainsKey("uDeviceBelongId" + value) == true)
@@ -2380,7 +2383,8 @@
if (i_device.Type == DeviceType.OnOffOutput || i_device.Type == DeviceType.AirSwitch)
{
//2020.03.23杩藉姞寮忔牱:鏈寚瀹氱被鍨嬬殑缁х數鍣�,涓嶆樉绀�
- if (i_device.DfunctionType == DeviceFunctionType.A鏈畾涔�)
+ if (i_device.DfunctionType == DeviceFunctionType.A鏈畾涔�
+ || i_device.DfunctionType == DeviceFunctionType.A涓嶆寚瀹�)
{
return false;
}
@@ -2402,6 +2406,11 @@
{
return false;
}
+ }
+ else if (i_device.Type == DeviceType.FreshAirHumiditySensor)
+ {
+ //鏂伴鐨勬箍搴︿紶鎰熷櫒涓嶆樉绀�
+ return false;
}
return true;
}
@@ -2470,16 +2479,22 @@
/// <returns></returns>
public string AppendVersion(int versionValue)
{
+ //10101 3涓猙yte 鏄剧ず涓猴細ver.1.01.01
+ //涓棿閭d釜byte涓哄鏁版椂锛屼唬琛ㄦ槸娴嬭瘯鐗堟湰,鍦ㄦ樉绀烘渶鏂扮増鏈椂,涓嶉渶瑕佹樉绀猴紝浣嗘槸鍦ㄥ巻鍙茬増鏈偅閲屽彲浠ユ樉绀�
+ //涓棿閭d釜byte涓哄伓鏁版椂, 浠h〃鏄寮忕増鏈�
+
//鐩存帴鏄�10杩涘埗
- string txt10 = Convert.ToString(versionValue).PadLeft(4, '0');
- //杩欎釜鏄皬鏁扮偣鍓嶉潰鐨勫��
- int value1 = Convert.ToInt32(txt10.Substring(0, txt10.Length - 2));
- //杩欎釜鏄皬鏁扮偣鍚庨潰鐨勫��
- int value2 = Convert.ToInt32(txt10.Substring(txt10.Length - 2, 2));
+ string txt10 = Convert.ToString(versionValue).PadLeft(6, '0');
+ //杩欎釜鏄涓�浣�
+ int value1 = Convert.ToInt32(txt10.Substring(0, 2));
+ //杩欎釜鏄浜屼綅
+ string value2 = txt10.Substring(2, 2);
+ //杩欎釜鏄涓変綅
+ string value3 = txt10.Substring(4, 2);
//Ver.
string ver = Language.StringByID(R.MyInternationalizationString.uVersionAbbreviation);
- return ver + value1 + "." + value2.ToString().PadLeft(2, '0');
+ return ver + value1 + "." + value2 + "." + value3;
}
/// <summary>
@@ -2531,7 +2546,7 @@
{
//涓嶆棤瑙嗘椂闂�,杩斿洖鏈湴璁惧鍒楄〃
statu = 1;
- return this.GetDeviceByGatewayID(HdlGatewayLogic.Current.GetGatewayId(zbGateway));
+ return this.GetDeviceByGatewayID(zbGateway.GwId);
}
}
zbGateway.LastDateTime = DateTime.Now;
@@ -2555,7 +2570,7 @@
//鏄惁杈炬垚涓柇鐨勬椂鏈�
bool canBreak = false;
//缃戝叧ID
- string gatewayID = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ string gatewayID = zbGateway.GwId;
//瓒呮椂鏃堕棿
int TimeOut = 0;
//璁惧鎬绘暟
@@ -2692,7 +2707,7 @@
/// <returns></returns>
private CommonDevice NewDeviceObjectByDeviceId(DeviceType deviceType, Newtonsoft.Json.Linq.JObject jobject, ZbGateway zbGateway)
{
- string gwId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ string gwId = zbGateway.GwId;
//鏍规嵁璁惧绫诲瀷鍒涘缓璁惧瀵硅薄鐨勫疄渚�
CommonDevice device = this.NewDeviceObjectByDeviceId(deviceType);
@@ -2784,11 +2799,15 @@
if (mainDevice.IsCustomizeImage == false)
{
mainDevice.IconPath = "Device/Light.png";
- if (this.IsMiniLight(mainDevice) == true)
- {
- //mini澶滅伅
- mainDevice.IconPath = "Device/MiniNightLight.png";
- }
+ }
+ }
+ //濡傛灉鏄壊娓╃伅
+ else if (mainDevice.Type == DeviceType.ColorTemperatureLight)
+ {
+ mainDevice.DfunctionType = DeviceFunctionType.A鐏厜;
+ if (mainDevice.IsCustomizeImage == false)
+ {
+ mainDevice.IconPath = "Device/ColorLightTemperature.png";
}
}
//濡傛灉鏄笁璺户鐢靛櫒鐨勫洖璺殑璇�,榛樿涓虹伅鍏�
@@ -2856,6 +2875,7 @@
else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); }
else if (deviceType == DeviceType.PMSensor) { device = new PMSensor(); }
else if (deviceType == DeviceType.FreshAirHumiditySensor) { device = new HumiditySensor(); }
+ else if (deviceType == DeviceType.ColorTemperatureLight) { device = new ColorTemperatureLight(); }
else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); }
else { return null; }
@@ -2960,7 +2980,7 @@
this.dicDeviceModelIdEnum["MSPIR01/M-ZB.10"] = "1303-1200-60000";//绾㈠浼犳劅鍣�
this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1304-1200-60000";//姘存蹈浼犳劅鍣�
this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1200-60000";//绱ф�ユ寜閿�
- this.dicDeviceModelIdEnum["MGCD01/ZB.10"] = "1306-1200-60000";//鍚搁《鐕冩皵浼犳劅鍣�
+ this.dicDeviceModelIdEnum["MGCD01/M-ZB.10"] = "1306-1200-60000";//鍚搁《鐕冩皵浼犳劅鍣�
//PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� 銆愯璁惧灞炰簬绗笁鏂硅澶囷紝娌℃湁闀滃儚ID銆�
this.dicDeviceModelIdEnum["MSPM25/M-ZB.10"] = "1307-1200-60000";//PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
@@ -3123,6 +3143,7 @@
/// 绠�绾︾幆澧冮潰鏉�
/// </summary>
ButtonPanel_SimpleEnvironment = 230,
+
//=========鈽呪槄PIR浼犳劅鍣ㄧ被(1200-1299)鈽呪槄=========
/// <summary>
/// 浼犳劅鍣�
@@ -3231,6 +3252,10 @@
/// 褰╃伅
/// </summary>
ColorLight = -10,
+ /// <summary>
+ /// 鑹叉俯鐏�(瀹冪殑闀滃儚ID鏈畾,鏆傚畾20000)
+ /// </summary>
+ ColorLight_Temperature = 20000,
//=========鈽呪槄绌鸿皟(3600-3899)鈽呪槄=========
/// <summary>
diff --git a/ZigbeeApp/Shared/Common/House.cs b/ZigbeeApp/Shared/Common/House.cs
index 96aeddc..d368109 100755
--- a/ZigbeeApp/Shared/Common/House.cs
+++ b/ZigbeeApp/Shared/Common/House.cs
@@ -76,325 +76,6 @@
#endregion
- #region 鈼� 浣忓畢____________________________
-
- #region 鈼� 娣诲姞浣忓畢_________________________
-
- /// <summary>
- /// 娣诲姞浣忓畢
- /// </summary>
- /// <param name="houseId">浣忓畢id</param>
- /// <param name="houseName">浣忓畢鍚嶇О.</param>
- /// <param name="numHomeId">浣忓畢鏁板瓧鍨媔d</param>
- public static void AddHouse(string houseId, string houseName, int numHomeId)
- {
- AddHouse(houseId, houseName, false, 0);
- }
-
- /// <summary>
- /// 娣诲姞浣忓畢
- /// </summary>
- /// <param name="houseId">浣忓畢id</param>
- /// <param name="houseName">浣忓畢鍚嶇О.</param>
- /// <param name="isOthreShare">鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹�</param>
- /// <param name="accountType">浠呭瓙璐﹀彿鐧婚檰鐨勬椂鍊欎娇鐢�,褰撱�怚sOthreShare銆戜负"true"锛屽苟涓斻�怉ccountType銆戜负"1"鏃讹紝璇ヨ处鍙锋嫢鏈夌鐞嗗憳鏉冮檺</param>
- public static void AddHouse(string houseId, string houseName, bool isOthreShare, int accountType)
- {
- var home = new House
- {
- Id = houseId,
- Name = houseName,
- IsOthreShare = isOthreShare,
- AccountType = accountType
- };
- //鍒涘缓鏂囦欢澶�
- Global.CreateHomeDirectory(houseId);
- home.Save();
- Config.Instance.HomeFilePathList.Add(home.FileName);
- Config.Instance.Save();
- }
-
-
- #endregion
-
- #region 鈼� 鍒犻櫎浣忓畢_________________________
-
- /// <summary>
- /// 鍒犻櫎浣忓畢
- /// </summary>
- /// <param name="filePath">File path.</param>
- public static void DeleteHouse(string filePath)
- {
- var delPath = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, GetHouseIdByFilePath(filePath));
- if (System.IO.Directory.Exists(delPath) == false)
- {
- return;
- }
- var fileList = GetHouseFileListByFilePath(filePath);
- foreach (var file in fileList)
- {
- //鍒犻櫎鏂囦欢
- System.IO.File.Delete(System.IO.Path.Combine(delPath, file));
- }
- //鍒犻櫎鏂囦欢澶�
- System.IO.Directory.Delete(delPath, true);
- //HomeFilePathList涓垹闄よ鍒楄〃
- Common.Config.Instance.HomeFilePathList.RemoveAll((obj) => obj == filePath);
- Config.Instance.Save();
- }
-
- /// <summary>
- /// 鍒犻櫎浣忓畢
- /// </summary>
- /// <param name="houseId">House identifier.</param>
- public static void DeleteHouseByHouseId(string houseId)
- {
- DeleteHouse(GetHouseFilePathByHouseId(houseId));
- }
-
- #endregion
-
- #region 鈼� 淇敼浣忓畢_________________________
-
- /// <summary>
- /// 淇敼浣忓畢.
- /// </summary>
- /// <param name="houseId">House identifier.</param>
- /// <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)
- {
- return;
- }
- home.Name = houseName;
- home.Save();
- //浣忓畢淇敼鍚嶇О鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂�
- Phone.UserView.UserPage.Instance.RefreshForm = true;
- }
-
- #endregion
-
- #region 鈼� 鑾峰彇浣忓畢_________________________
- /// <summary>
- /// 閫氳繃銆恑d銆戣幏鍙栦綇瀹�
- /// </summary>
- /// <returns>The house by house identifier.</returns>
- /// <param name="houseId">浣忓畢id</param>
- public static House GetHouseByHouseId(string houseId)
- {
- var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, houseId, $"House_{houseId}.json");
- var file = Shared.IO.FileUtils.ReadFile(path);
- if (file == null)
- {
- return null;
- }
- return Newtonsoft.Json.JsonConvert.DeserializeObject<House>(System.Text.Encoding.UTF8.GetString(file));
- }
-
- /// <summary>
- /// 閫氳繃銆愭枃浠惰矾寰勩�戣幏鍙栦綇瀹�
- /// </summary>
- /// <returns>The house by file path.</returns>
- /// <param name="filePath">鏂囦欢璺緞</param>
- public static House GetHouseByFilePath(string filePath)
- {
- var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, GetHouseIdByFilePath(filePath), filePath);
- var file = Shared.IO.FileUtils.ReadFile(path);
- if (file == null)
- {
- return null;
- }
- return Newtonsoft.Json.JsonConvert.DeserializeObject<House>(System.Text.Encoding.UTF8.GetString(file));
- }
-
- #endregion
-
- #region 鈼� 鑾峰彇浣忓畢鍒楄〃_____________________
- /// <summary>
- /// Gets the home lists.鑾峰彇浣忓畢鍒楄〃
- /// </summary>
- public static async System.Threading.Tasks.Task<List<string>> GetHomeLists()
- {
- var pageSetting = new SendDataToServer.ResidenceListPageSettingObj()
- {
- PageSize = CommonPage.PageSize
- };
-
- var reqDto = new SendDataToServer.ResidenceListObj()
- {
- LoginAccessToken = Config.Instance.Token,
- PageSetting = pageSetting
- };
- var requestObj = new SendDataToServer.ResidenceListReqDto()
- {
- ReqDto = reqDto,
- RequestVersion = CommonPage.RequestVersion,
- };
- try
- {
- var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
- var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("App/GetHomePager", System.Text.Encoding.UTF8.GetBytes(requestJson));
- if (revertObj == null)
- {
- return null;
- }
- if (revertObj.StateCode.ToUpper() == "SUCCESS")
- {
- var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.ResidenceRes>(revertObj.ResponseData.ToString());
- if (responseDataObj.TotalCount == 0)
- {
- //褰撲綇瀹呬负绌烘椂鍏堟彁绀虹敤鎴锋柊寤轰綇瀹�
- var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst), Language.StringByID(R.MyInternationalizationString.Close), Language.StringByID(R.MyInternationalizationString.Confrim));
- alert.Show();
- }
- else
- {
- //娓呯┖褰撳墠浣忓畢鍒楄〃
- Config.Instance.HomeFilePathList.Clear();
- var listHouse = new List<House>();
- foreach (var residence in responseDataObj.PageData)
- {
- Config.Instance.HomeFilePathList.Add($"House_{residence.Id}.json");
- var house = GetHouseByHouseId(residence.Id);
- if (house == null)
- {
- house = new House
- {
- Id = residence.Id,
- Name = residence.Name,
- IsOthreShare = residence.IsOthreShare,
- AccountType = residence.AccountType,
- MainUserDistributedMark = residence.MainUserDistributedMark,
- Longitude = residence.Longitude,
- Latitude = residence.Latitude
- };
- }
- else
- {
- house.Id = residence.Id;
- house.Name = residence.Name;
- house.IsOthreShare = residence.IsOthreShare;
- house.AccountType = residence.AccountType;
- house.MainUserDistributedMark = residence.MainUserDistributedMark;
- house.Longitude = residence.Longitude;
- house.Latitude = residence.Latitude;
- }
- Global.CreateHomeDirectory(residence.Id);
- house.Save(false);
- listHouse.Add(house);
- }
- //濡傛灉鍒囨崲浜嗚处鍙�,鎴栬�呭師鏉ョ殑id涓嶅瓨鍦�,鍒欓噸缃綇瀹匢D
- if (Config.Instance.TheSameLoginAccount == false ||
- Config.Instance.HomeFilePathList.Find((obj) => obj == $"House_{Config.Instance.HomeId}.json") == null)
- {
- Config.Instance.HomeId = listHouse[0].Id;
- foreach (var house in listHouse)
- {
- //鍒濆閫夋嫨瀹冭嚜宸辩殑浣忓畢
- if (house.IsOthreShare == false)
- {
- Config.Instance.HomeId = house.Id;
- Config.Instance.Home = House.GetHouseByHouseId(house.Id);
- break;
- }
- }
- }
- Config.Instance.Save();
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"鑾峰彇澶辫触{ex.Message}");
- }
- finally
- {
- }
- return Config.Instance.HomeFilePathList;
- }
-
- #endregion
-
- #region 鈼� 鑾峰彇浣忓畢id_______________________
- /// <summary>
- /// 閫氳繃銆愭枃浠惰矾寰勩�戣幏鍙栦綇瀹卛d
- /// </summary>
- /// <returns>The house identifier by file path.</returns>
- /// <param name="filePath">鏂囦欢璺緞</param>
- public static string GetHouseIdByFilePath(string filePath)
- {
- string[] sArray = filePath.Split(new string[] { "House_", ".json" }, StringSplitOptions.RemoveEmptyEntries);
- if (sArray.Length >= 1)
- {
- return sArray[0];
- }
- return null;
- }
-
- #endregion
-
- #region 鈼� 鑾峰彇浣忓畢璺緞_____________________
- /// <summary>
- /// 閫氳繃銆愪綇瀹卛d銆戣幏鍙栦綇瀹呰矾寰�
- /// </summary>
- /// <returns>The house identifier by file path.</returns>
- /// <param name="houseId">浣忓畢id</param>
- public static string GetHouseFilePathByHouseId(string houseId)
- {
- if (string.IsNullOrEmpty(houseId))
- {
- return null;
- }
- return $"House_{houseId}.json";
- }
-
- #endregion
-
- #region 鈼� 鑾峰彇璇ヤ綇瀹呯殑鏂囦欢鍒楄〃______________
-
- /// <summary>
- /// 閫氳繃銆恏ouseId銆戣幏鍙栬浣忓畢鐨勬枃浠跺垪琛�
- /// </summary>
- /// <returns>The house file list by home identifier.</returns>
- /// <param name="houseId">House identifier.</param>
- public static List<string> GetHouseFileListByHomeId(string houseId)
- {
- var list = new List<string> { };
- var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, houseId);
- if (!System.IO.Directory.Exists(path))
- {
- return new List<string> { };
- }
- var files = System.IO.Directory.GetFiles(path);
- foreach (var file in files)
- {
- var f = file.Substring(path.Length + 1);
- System.Console.WriteLine(f);
- list.Add(f);
- }
- return list;
- }
-
- /// <summary>
- /// 閫氳繃銆愭枃浠惰矾寰勩�戣幏鍙栦綇瀹呬笅鏂囦欢鍒楄〃
- /// </summary>
- /// <returns>The house file list by file path.</returns>
- /// <param name="filePath">File path.</param>
- public static List<string> GetHouseFileListByFilePath(string filePath)
- {
- return GetHouseFileListByHomeId(GetHouseIdByFilePath(filePath));
- }
-
- #endregion
-
- #endregion
-
#region 鈼� 妤煎眰____________________________
/// <summary>
@@ -406,30 +87,8 @@
{
get
{
- return GetFloorNameById(CurrentFloorId);
+ return HdlResidenceLogic.Current.GetFloorNameById(CurrentFloorId);
}
- }
-
- /// <summary>
- /// 鑾峰彇妤煎眰鍚嶇О
- /// </summary>
- /// <param name="floorId"></param>
- /// <returns></returns>
- public string GetFloorNameById(string floorId)
- {
- if (Config.Instance.Home.FloorDics.Count == 0)
- {
- return string.Empty;
- }
-
- foreach (var floor in Config.Instance.Home.FloorDics)
- {
- if (floorId == floor.Key)
- {
- return floor.Value;
- }
- }
- return string.Empty;
}
/// <summary>
@@ -449,8 +108,6 @@
}
#endregion
-
- #region 鈼� 鎴块棿____________________________
#region 鈼� 娣诲姞鎴块棿璺緞_________________________
@@ -485,8 +142,6 @@
Save();
}
}
-
- #endregion
#endregion
diff --git a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
index 0c86547..a51a0e1 100755
--- a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
@@ -676,7 +676,7 @@
//閭d釜鐗规畩鐨勬帶浠�
this.frameBottomTemp = new FrameLayout();
frameBottomTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(23);
- this.listBodyControl.AddChidrenFrame(frameBottomTemp);
+ this.listBodyControl.AddChidren(frameBottomTemp);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs
index df30573..9e3167a 100755
--- a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs
@@ -348,14 +348,14 @@
Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, device);
frameIconBackGroud.AddChidren(btnDeviceIcon);
//閲嶆柊缁戝畾浜嬩欢
- rowDevice.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEventOnly);
+ rowDevice.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEvent);
//璁惧鍚嶅瓧
var btnDeviceName = new NormalViewControl(600, 60, true);
btnDeviceName.X = Application.GetRealWidth(181);
btnDeviceName.Gravity = Gravity.CenterVertical;
btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
- rowDevice.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ rowDevice.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
btnDeviceName.Y += rowDevice.chidrenYaxis;
//搴曠嚎
var btnBottomLine = new NormalViewControl(Application.GetRealWidth(841), ControlCommonResourse.BottomLineHeight, false);
diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
index 0828d24..5c0822a 100755
--- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -54,6 +54,7 @@
/// </summary>
public CategoryMainForm()
{
+ this.FormID = "CategoryMainForm";
BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
instance = this;
}
@@ -161,7 +162,7 @@
floors.changeFloor = true;
floors.FloorAction += (floorId) =>
{
- btnFloorName.Text = Config.Instance.Home.GetFloorNameById(floorId);
+ btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(floorId);
HdlRoomLogic.Current.NowCategoryRoom = HdlRoomLogic.Current.GetLoveRoom();
//鍒锋柊bodyView
this.RefreshBodyView();
@@ -532,6 +533,11 @@
{
cardContr = new Controls.DeviceDoorLockRowControl();
}
+ //鑹叉俯鐏�
+ else if (device.Type == DeviceType.ColorTemperatureLight)
+ {
+ cardContr = new Controls.DeviceColorTemperatureRowControl();
+ }
//鏃犳硶璇嗗埆
else
{
@@ -797,7 +803,7 @@
private void AddNormalDeviceReportEvent()
{
//璁惧灞炴�т笂鎶�(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceStatus", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormDeviceStatus", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
{
HdlThreadLogic.Current.RunMain(() =>
{
@@ -816,7 +822,7 @@
});
//璁惧鍦ㄧ嚎涓婃姤(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceOnline", ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤, (report) =>
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormDeviceOnline", ReceiveComandDiv.A璁惧鍦ㄧ嚎涓婃姤, (report) =>
{
HdlThreadLogic.Current.RunMain(() =>
{
@@ -843,7 +849,7 @@
private void AddSensorDeviceReportEvent()
{
//浼犳劅鍣ㄤ笂鎶�(缂撳瓨鐨勪慨鏀逛氦鐢� HdlGatewayReceiveLogic 澶勭悊)
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewSensor", ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�, (report) =>
+ HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormSensor", ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�, (report) =>
{
HdlThreadLogic.Current.RunMain(() =>
{
@@ -918,6 +924,9 @@
{
//鎶婇潤鎬佸彉閲忕殑杩欎釜涓滆タ缃┖
instance = null;
+ HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormDeviceStatus");
+ HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormDeviceOnline");
+ HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormSensor");
base.CloseFormBefore();
}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
index 72003f2..8a72cc1 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
@@ -100,16 +100,21 @@
Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
frameIconBackGroud.AddChidren(btnDeviceIcon);
//閲嶆柊缁戝畾浜嬩欢
- this.frameTable.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEventOnly);
+ this.frameTable.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEvent);
//璁惧鍚嶅瓧
this.btnDeviceName = new NormalViewControl(600, 60, true);
+ if (this.device.Type == DeviceType.WindowCoveringDevice)
+ {
+ //绐楀笜鍥犱负鍙宠竟鏈変笁涓寜閽�,鎵�浠ラ渶瑕佹墍鏈夊悕瀛楃殑瀹藉害
+ this.btnDeviceName.Width = Application.GetRealWidth(360);
+ }
btnDeviceName.X = Application.GetRealWidth(181);
//褰撴寚瀹氬疄闄呭潗鏍囨椂,杩欓噷闇�瑕佺殑鍋忕Щ閲忎负2鍊�
btnDeviceName.Y = Application.GetRealHeight(16) + this.chidrenYaxis * 2;
btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
- this.frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ this.frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
if (this.hadStatuFunction == false)
{
@@ -127,7 +132,7 @@
btnStatu.Y = Application.GetRealHeight(70) + this.chidrenYaxis * 2;
btnStatu.TextSize = 10;
btnStatu.TextColor = UserCenterColor.Current.TextGrayColor1;
- this.frameTable.AddChidren(btnStatu, ChidrenBindMode.BindEventOnly);
+ this.frameTable.AddChidren(btnStatu, ChidrenBindMode.BindEvent);
}
//搴曠嚎
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
index ab3ad5e..f087c86 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
@@ -69,22 +69,11 @@
//娣卞害鍗$墖淇℃伅
this.frameTable.ButtonClickEvent += (sender, e) =>
{
- //濡傛灉鏄疢ini澶滅伅
- if (Common.LocalDevice.Current.IsMiniLight(i_device) == true)
- {
- var form = new MainPage.ControlForm.DeviceMiniLightDetailCardForm();
- form.RowOrCardControl = this;
- form.AddForm(i_device, this.nowSelectRoom, 965, 1466);
- form.FormCloseEvent += this.CardDetailInfoBackEvent;
- }
- else
- {
- //褰╃伅,璋冨厜鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰
- var form = new MainPage.ControlForm.DeviceColorLightDetailCardForm();
- form.RowOrCardControl = this;
- form.AddForm(i_device, this.nowSelectRoom, 965, 1316);
- form.FormCloseEvent += this.CardDetailInfoBackEvent;
- }
+ //褰╃伅,璋冨厜鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰
+ var form = new MainPage.ControlForm.DeviceColorLightDetailCardForm();
+ form.RowOrCardControl = this;
+ form.AddForm(i_device, this.nowSelectRoom, 965, 1316);
+ form.FormCloseEvent += this.CardDetailInfoBackEvent;
};
}
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
new file mode 100755
index 0000000..ec9f128
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
@@ -0,0 +1,116 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.Category.Controls
+{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰鐨勮壊娓╃伅璁惧琛屾帶浠�
+ /// </summary>
+ public class DeviceColorTemperatureRowControl : DeviceRowCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom)
+ {
+ base.InitControl(i_device, i_nowSelectRoom);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+
+ //娣诲姞寮�鍏虫帶浠�
+ 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);
+ //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
+ this.StartCheckResponeResult(!setStatu);
+
+ if (setStatu == true)
+ {
+ //鎵撳紑
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
+ i_device.SwitchControl(1);
+ }
+ else
+ {
+ //鍏抽棴
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close));
+ i_device.SwitchControl(0);
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new MainPage.ControlForm.DeviceColorTemperatureLightDetailCardForm();
+ form.RowOrCardControl = this;
+ form.AddForm(i_device, this.nowSelectRoom, 965, 1466);
+ form.FormCloseEvent += this.CardDetailInfoBackEvent;
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return ((LightBase)i_device).OnOffStatus == 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁�
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ return;
+ }
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ HdlDeviceAttributeLogic.Current.SendColorTemperatureLightStatuComand(this.device);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs b/ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs
index 1383415..7c70c74 100755
--- a/ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/SelectHouseForm.cs
@@ -90,7 +90,7 @@
foreach (var housePath in Config.Instance.HomeFilePathList)
{
- var home = House.GetHouseByFilePath(housePath);
+ var home = UserCenter.HdlResidenceLogic.Current.GetHouseByFilePath(housePath);
if (home == null)
{
continue;
@@ -128,7 +128,7 @@
private void SelectFloor_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
{
(sender as Device.CommonForm.LeftIconButtonRow).IsSelected = true;
- var home = House.GetHouseByFilePath((sender as Device.CommonForm.LeftIconButtonRow).Tag.ToString());
+ var home = UserCenter.HdlResidenceLogic.Current.GetHouseByFilePath((sender as Device.CommonForm.LeftIconButtonRow).Tag.ToString());
RemoveView();
HouseAction?.Invoke(home.Id);
}
diff --git a/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs b/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
index e6cc62c..c24d305 100755
--- a/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
+++ b/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
@@ -288,6 +288,16 @@
return HdlControlLogic.Current.GetPictrueRealSize(i_size);
}
+ /// <summary>
+ /// 鍒ゆ柇鎸囧畾鐨勭晫闈㈡槸鍚︽墦寮�
+ /// </summary>
+ /// <param name="formId"></param>
+ /// <returns></returns>
+ public bool IsFormOpen(string formId)
+ {
+ return UserCenterResourse.DicActionForm.ContainsKey(formId);
+ }
+
#endregion
#region 鈻� 妫�娴嬮敊璇痏__________________________
diff --git a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
index f7b2221..f3f32b9 100755
--- a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
@@ -121,6 +121,7 @@
btnLine.BackgroundColor = 0x40000000;
btnLine.Y = topFrameLayout.Height - 1;
topFrameLayout.AddChidren(btnLine);
+ topFrameLayout.AddTag("btnLine", btnLine);
//杩斿洖閿�
var btnBack = new BackViewControl();
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs
index 44418be..8dc6a90 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: UserCenter.FrameLayoutBase
+ public class LeftIconButtonRow: FrameLayout
{
#region 鈼� 鍙橀噺__________________________
/// <summary>
@@ -70,8 +70,8 @@
IconButton = new Button()
{
X = Application.GetRealWidth(80),
- Height = this.GetPictrueRealSize(80),
- Width = this.GetPictrueRealSize(80),
+ Height = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(80),
+ Width = UserCenter.HdlControlLogic.Current.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 9a5f16c..ee7df2a 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs
@@ -233,14 +233,15 @@
if (report.DeviceAddr == humidDevice.DeviceAddr && report.DeviceEpoint == humidDevice.DeviceEpoint)
{
HdlThreadLogic.Current.RunMain(() =>
- {
- if (((TemperatureSensor)temperDevice).Humidity == 0)
+ {
+ decimal humidity = (decimal)humidDevice.GetType().InvokeMember("Humidity", System.Reflection.BindingFlags.GetField, null, humidDevice, null);
+ if (humidity == 0)
{
humidityText.Text = "--%";
}
else
{
- humidityText.Text = ((TemperatureSensor)temperDevice).Humidity + "%";
+ humidityText.Text = humidity + "%";
}
}, ShowErrorMode.NO);
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs
index 88bf472..a292f9d 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs
@@ -275,7 +275,7 @@
ShowErrorTip(Language.StringByID(R.MyInternationalizationString.timeNull),true);
return;
}
- if (int.Parse(editTime.Text) < 1 || int.Parse(editTime.Text) > 12)
+ if (int.Parse(editTime.Text) < 1 || int.Parse(editTime.Text) > 12|| int.Parse(editTime.Text)>(int.MaxValue-1))
{ ///闄愬埗杈撳叆鏁板瓧鑼冨洿;
string str = Language.StringByID(R.MyInternationalizationString.less) + Language.StringByID(R.MyInternationalizationString.or) + Language.StringByID(R.MyInternationalizationString.more);
ShowErrorTip(str, true);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
index e33ecd0..da81d33 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -873,8 +873,18 @@
//鏈嶅姟杩斿洖鏉ユ病鏈夐棬閿佹垚鍛樹俊鎭紝娌℃湁蹇呰鍐嶅幓璇锋眰鎴愬憳鍒楄〃锛�
//鍘熷洜锛氳妭绾︽椂闂达紝浣撻獙鏁堟灉濂斤紱
result = await UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
+ }
+ if (string.IsNullOrEmpty(result))
+ {
+ //闃叉涓虹┖鎶涘紓甯革紱
+ return userlist;
}
- var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserCenter.MemberInfoRes>>(result);
+ var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserCenter.MemberInfoRes>>(result);
+ if (listInfo == null)
+ {
+ //闃叉涓虹┖鎶涘紓甯革紱
+ return userlist;
+ }
for (int i = 0; i < listInfo.Count; i++)
{
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
index dc21175..0aee184 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
@@ -225,6 +225,7 @@
updateCurrentDoorlockActionTemp = (DoorlockKey, _bool) =>
{
+
var key = Send.CurrentDoorLock.DeviceAddr;
if (DoorlockKey == key)
{
@@ -349,13 +350,11 @@
var datetime = GetLocalTime(timeLong);
///鏈夋椂鏁堟�у父寮�鎵嶆樉绀烘椂闂存潯浠舵枃鏈�
year = datetime.Year.ToString();//閭d竴骞�
- month = datetime.Month.ToString();//閭d竴鏈�
- var d = int.Parse(datetime.ToString("dd"));//閭d竴澶�
- var h = int.Parse(datetime.ToString("HH"));//灏忔椂
- int dayInt = (h + timeValue) / 24;//璁剧疆鏃堕棿+褰撳墠绯荤粺鏃堕棿鏄惁瓒呭嚭24灏忔椂
- hour = (h + timeValue) % 24;//璁剧疆鏃堕棿+褰撳墠绯荤粺鏃堕棿鏄惁瓒呭嚭24灏忔椂鍓╀笅澶氬皯灏忔椂
- days = d + dayInt;//褰撳墠绯荤粺澶╂暟+鎵ц鍚庡ぉ鏁�
+ month = datetime.Month.ToString();//閭d竴鏈�
+ days = int.Parse(datetime.ToString("dd"));//閭d竴澶�
+ hour = int.Parse(datetime.ToString("HH"));//灏忔椂
minute = datetime.Minute;//鍒嗛挓
+ timeLong = 0;
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
index 2b8608a..e0fe24b 100755
--- a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
@@ -842,7 +842,7 @@
HomePage.Instance.ShowLoginLoadView();
});
var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID();
- var homes = await House.GetHomeLists();
+ var homes = await HdlResidenceLogic.Current.GetHomeListsFromDb();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
//鍚姩ZigBee
@@ -1105,7 +1105,7 @@
Config.Instance.Save();
var resultRegID = await CommonPage.Instance.PushRegID();
- var homes = await House.GetHomeLists();
+ var homes = await HdlResidenceLogic.Current.GetHomeListsFromDb();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenterLogic.InitUserCenterMenmoryAndThread();
//鍚姩ZigBee
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
index 9e28391..d23f24b 100755
--- a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
@@ -112,7 +112,7 @@
//缁戝畾绗笁鏂�
await BindAuthUser(Config.Instance.Guid, OpenID);
}
- var homes = await House.GetHomeLists();
+ var homes = await HdlResidenceLogic.Current.GetHomeListsFromDb();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenterLogic.InitUserCenterMenmoryAndThread();
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
similarity index 92%
rename from ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
rename to ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
index 66122d1..6408315 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
@@ -8,9 +8,9 @@
namespace Shared.Phone.MainPage.ControlForm
{
/// <summary>
- /// 褰╃伅(璋冨厜鍣�)绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈�
+ /// 鑹叉俯鐏被鍨嬬殑娣卞害鍗$墖鐣岄潰
/// </summary>
- public class DeviceMiniLightDetailCardForm : DeviceDetailCardCommonForm
+ public class DeviceColorTemperatureLightDetailCardForm : DeviceDetailCardCommonForm
{
#region 鈻� 鍙橀噺澹版槑___________________________
@@ -73,7 +73,7 @@
waveSeekBar.Gravity = Gravity.CenterHorizontal;
waveSeekBar.WavePadding = Application.GetRealWidth(8);
waveSeekBar.MaxValue = 100;
- waveSeekBar.Progress = (int)(((DimmableLight)this.device).Level * 1.0 / MaxLevel * 100);
+ waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
waveSeekBar.CornerRadius = Application.GetRealHeight(58);
frameWhiteBack.AddChidren(waveSeekBar);
@@ -157,7 +157,7 @@
else
{
//濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛�
- ((DimmableLight)this.device).Level = value * MaxLevel / 100;
+ ((ColorTemperatureLight)this.device).Level = value * MaxLevel / 100;
//浜害 XX
this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
}
@@ -200,8 +200,10 @@
}
};
//璁剧疆鍒濆鍊�
- seekBar1.Progress = 34;
- btnColorView.Text = 34 * 100 + "K";
+ int colorValue = ((ColorTemperatureLight)this.device).ColorTemperature;
+ if (colorValue == 0) { colorValue = 3400; }
+ seekBar1.Progress = colorValue / 100;
+ btnColorView.Text = colorValue + "K";
//寮�涓�涓嚎绋�,鐩戣鏄惁婊戝姩鐨勬粦鍔ㄦ潯,姣忕妫�娴嬩竴娆�
HdlThreadLogic.Current.RunThread(() =>
@@ -216,12 +218,13 @@
if (nowProgressValue != oldProgressValue)
{
oldProgressValue = nowProgressValue;
- ((DimmableLight)this.device).SetLevel((int)(oldProgressValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel((int)(oldProgressValue * MaxLevel / 100.0));
}
//鍙戦�佽壊娓╁��
if (nowColorValue != oldColorValue)
{
oldColorValue = nowColorValue;
+ ((ColorTemperatureLight)this.device).SetColorTemperature(oldColorValue * 100);
}
}
}
@@ -229,11 +232,12 @@
if (nowProgressValue != oldProgressValue)
{
//鍙戦�佷寒搴﹀��
- ((DimmableLight)this.device).SetLevel((int)(nowProgressValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel((int)(nowProgressValue * MaxLevel / 100.0));
}
if (nowColorValue != oldColorValue)
{
//鍙戦�佽壊娓╁��
+ ((ColorTemperatureLight)this.device).SetColorTemperature(nowColorValue * 100);
}
});
}
@@ -337,7 +341,7 @@
if (this.isProgressing == false)
{
//褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
- waveSeekBar.Progress = (int)(((DimmableLight)this.device).Level * 1.0 / MaxLevel * 100);
+ waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
}
}
if (isOpen == false && this.IsLightOpen == true)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
index 4bab981..d3cc6fc 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
@@ -93,7 +93,7 @@
btnBackGroud.UnSelectedImagePath = "Item/FunctionCardView.png";
btnBackGroud.SelectedImagePath = "Item/FunctionCardViewSelected.png";
btnBackGroud.Gravity = Gravity.CenterHorizontal;
- this.AddChidren(btnBackGroud, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnBackGroud, ChidrenBindMode.BindEvent);
//璁惧鍚嶇О鎺т欢
this.btnDeviceName = new NormalViewControl(320, 63, true);
@@ -103,7 +103,7 @@
btnDeviceName.TextColor = UserCenterColor.Current.TextGrayColor1;
btnDeviceName.SelectedTextColor = UserCenterColor.Current.White;
btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
- this.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
//鏀堕泦鎺т欢
this.btnCollect = new IconViewControl(107);
@@ -142,13 +142,13 @@
fraDeviceRound.X = HdlControlLogic.Current.GetPictrueRealSize(44);
fraDeviceRound.Y = HdlControlLogic.Current.GetPictrueRealSize(101);
fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor;
- this.AddChidren(fraDeviceRound, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(fraDeviceRound, ChidrenBindMode.BindEvent);
//璁惧鍥炬爣鎺т欢
this.btnDeviceIcon = new IconViewControl(86);
btnDeviceIcon.Gravity = Gravity.Center;
fraDeviceRound.AddChidren(btnDeviceIcon);
- this.ChangedChidrenBindMode(fraDeviceRound, ChidrenBindMode.BindEventOnly);
+ this.ChangedChidrenBindMode(fraDeviceRound, ChidrenBindMode.BindEvent);
//鐘舵�佹枃鏈帶浠�
this.btnStatu = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(300), HdlControlLogic.Current.GetPictrueRealSize(63), false);
@@ -157,7 +157,7 @@
btnStatu.TextColor = UserCenterColor.Current.TextColor1;
btnStatu.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
btnStatu.IsBold = true;
- this.AddChidren(btnStatu, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnStatu, ChidrenBindMode.BindEvent);
//寮�鍏虫帶浠�(涓嶅姞鍏ョ埗鎺т欢涓�)
this.btnSwitch = new PicViewControl(109, 104);
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
index 9e3b374..0fda2b2 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
@@ -71,22 +71,11 @@
{
Common.CommonPage.Instance.IsDrawerLockMode = true;
- //濡傛灉鏄疢ini澶滅伅
- if (Common.LocalDevice.Current.IsMiniLight(i_device) == true)
- {
- var form = new ControlForm.DeviceMiniLightDetailCardForm();
- form.RowOrCardControl = this;
- form.AddForm(i_device, this.nowSelectRoom, 965, 1466);
- form.FormCloseEvent += this.CardDetailInfoBackEvent;
- }
- else
- {
- //褰╃伅,璋冨厜鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰
- var form = new ControlForm.DeviceColorLightDetailCardForm();
- form.RowOrCardControl = this;
- form.AddForm(i_device, this.nowSelectRoom, 965, 1316);
- form.FormCloseEvent += this.CardDetailInfoBackEvent;
- }
+ //褰╃伅,璋冨厜鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰
+ var form = new ControlForm.DeviceColorLightDetailCardForm();
+ form.RowOrCardControl = this;
+ form.AddForm(i_device, this.nowSelectRoom, 965, 1316);
+ form.FormCloseEvent += this.CardDetailInfoBackEvent;
};
}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
new file mode 100755
index 0000000..a5d24f0
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
@@ -0,0 +1,118 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.MainPage.Controls
+{
+ /// <summary>
+ /// 鑹叉俯鐏崱鐗囨帶浠�
+ /// </summary>
+ public class DeviceColorTemperatureCardControl : DeviceCardCommon
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_device"></param>
+ public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom)
+ {
+ base.InitControl(i_device, i_nowSelectRoom);
+
+ //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ this.AddDetailInfoEvent(i_device);
+
+ //娣诲姞寮�鍏虫帶浠�
+ 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);
+ //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
+ this.StartCheckResponeResult(!setStatu);
+
+ if (setStatu == true)
+ {
+ //鎵撳紑
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
+ i_device.SwitchControl(1);
+ }
+ else
+ {
+ //鍏抽棴
+ this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.Close));
+ i_device.SwitchControl(0);
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 娣卞害鍗$墖淇℃伅_______________________
+
+ /// <summary>
+ /// 娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢
+ /// </summary>
+ private void AddDetailInfoEvent(CommonDevice i_device)
+ {
+ //娣卞害鍗$墖淇℃伅
+ this.ButtonClickEvent += (sender, e) =>
+ {
+ Common.CommonPage.Instance.IsDrawerLockMode = true;
+
+ var form = new ControlForm.DeviceColorTemperatureLightDetailCardForm();
+ form.RowOrCardControl = this;
+ form.AddForm(i_device, this.nowSelectRoom, 965, 1466);
+ form.FormCloseEvent += this.CardDetailInfoBackEvent;
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 妫�娴嬭澶囨墦寮�鐘舵�乢__________________
+
+ /// <summary>
+ /// 妫�娴嬭澶囨墦寮�鐘舵��
+ /// </summary>
+ /// <param name="i_device"></param>
+ /// <returns></returns>
+ public override bool CheckIsOpenStatu(CommonDevice i_device)
+ {
+ return ((LightBase)i_device).OnOffStatus == 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佽幏鍙栫姸鎬佸懡浠__________________
+
+ /// <summary>
+ /// 鍙戦�佽幏鍙栫姸鎬佸懡浠�
+ /// </summary>
+ public override void SendStatuComand()
+ {
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥
+ return;
+ }
+ //妫�娴嬭兘鍚﹀彂閫佽幏鍙栫姸鎬佸懡浠�
+ if (this.CheckCanSendStatuComand() == true)
+ {
+ HdlDeviceAttributeLogic.Current.SendColorTemperatureLightStatuComand(this.device);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs
index 3bd2403..ede1a4a 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionUnallocatedControl.cs
@@ -54,7 +54,7 @@
btnBackGroud.Gravity = Gravity.CenterHorizontal;
btnBackGroud.UnSelectedImagePath = "Item/Category_FunctionBG.png";
btnBackGroud.SelectedImagePath = "Item/Category_FunctionBGSelected.png";
- this.AddChidren(btnBackGroud, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnBackGroud, ChidrenBindMode.BindEvent);
//璁惧鍥炬爣
this.btnDeviceIcon = new IconViewControl(84);
@@ -62,7 +62,7 @@
btnDeviceIcon.UnSelectedImagePath = unSelectPath;
btnDeviceIcon.SelectedImagePath = selectPath;
btnDeviceIcon.Gravity = Gravity.CenterHorizontal;
- this.AddChidren(btnDeviceIcon, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnDeviceIcon, ChidrenBindMode.BindEvent);
//鏂囨湰
this.btnDeviceName = new NormalViewControl(170, 60, true);
@@ -73,7 +73,7 @@
btnDeviceName.TextSize = 11;
btnDeviceName.Text = text;
btnDeviceName.TextAlignment = TextAlignment.Center;
- this.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs
index a778781..b513392 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceSelectUnallocatedControl.cs
@@ -97,7 +97,7 @@
Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
frameIconBackGroud.AddChidren(btnDeviceIcon);
//閲嶆柊缁戝畾浜嬩欢
- this.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEventOnly);
+ this.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEvent);
//璁惧鍚嶅瓧
this.btnDeviceName = new NormalViewControl(Application.GetRealWidth(600), this.Height, false);
@@ -105,7 +105,7 @@
btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
btnDeviceName.Gravity = Gravity.CenterVertical;
- this.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
btnDeviceName.Y += chidrenYaxis;
@@ -120,7 +120,7 @@
this.AddChidren(btnSelect, ChidrenBindMode.NotBind);
btnSelect.InitControl();
//澶嶅悎鎺т欢闇�瑕佺壒娈婂鐞�
- this.ChangedChidrenBindMode(btnSelect, ChidrenBindMode.BindEventOnly);
+ this.ChangedChidrenBindMode(btnSelect, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
btnSelect.btnIcon.Y += chidrenYaxis;
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
index 02125b8..6c4e949 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
@@ -68,13 +68,13 @@
frameBack.Gravity = picRoom.Gravity;
frameBack.Radius = picRoom.Radius;
frameBack.BackgroundColor = 0x33000000;
- this.AddChidren(picRoom, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(picRoom, ChidrenBindMode.BindEvent);
//鎴块棿鍚嶅瓧鐨勮儗鏅�
this.btnRoomNameBackGroud = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(141), Application.GetRealHeight(84), false);
btnRoomNameBackGroud.X = HdlControlLogic.Current.GetPictrueRealSize(14);
btnRoomNameBackGroud.BackgroundColor = 0x80000000;
- this.AddChidren(btnRoomNameBackGroud, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnRoomNameBackGroud, ChidrenBindMode.BindEvent);
//鎴块棿鍚嶅瓧
this.btnRoomName = new NormalViewControl(50, Application.GetRealHeight(84), false);
@@ -83,7 +83,7 @@
btnRoomName.IsBold = true;
btnRoomName.TextAlignment = TextAlignment.Center;
btnRoomName.TextColor = UserCenterColor.Current.White;
- this.AddChidren(btnRoomName, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnRoomName, ChidrenBindMode.BindEvent);
//鍒锋柊鎺т欢淇℃伅
this.RefreshControl();
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs
index 604a490..645b3dc 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs
@@ -86,7 +86,7 @@
//鍦烘櫙鑳屾櫙鍥炬帶浠�
this.btnSceneBackGroud = new PicViewControl(this.Width, this.Height, false);
btnSceneBackGroud.UnSelectedImagePath = "Scene/Background.png";
- this.AddChidren(btnSceneBackGroud, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnSceneBackGroud, ChidrenBindMode.BindEvent);
//寤舵椂鏃堕棿鏄剧ず鎺т欢
this.btnTimeView = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(280), HdlControlLogic.Current.GetPictrueRealSize(63), false);
@@ -98,7 +98,7 @@
{
btnTimeView.Text= this.GetTimeString(i_scene.SceneDelayTime, hourText, minuText, secondText);
}
- this.AddChidren(btnTimeView, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnTimeView, ChidrenBindMode.BindEvent);
//鏃堕棿鍥炬爣鎺т欢
this.btnTimeIcon = new IconViewControl(63);
@@ -169,7 +169,7 @@
btnSceneName.Y = HdlControlLogic.Current.GetPictrueRealSize(236);
btnSceneName.IsBold = true;
btnSceneName.TextColor = UserCenterColor.Current.White;
- this.AddChidren(btnSceneName, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnSceneName, ChidrenBindMode.BindEvent);
//鍒锋柊鎺т欢鐘舵��
this.RefreshControlInfo(i_scene);
diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
index 13b308f..9d9ac37 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
@@ -16,6 +16,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// The instance.
+ /// </summary>
+ public static HomeMainPageForm Instance;
+ /// <summary>
/// 鏁翠釜鐣岄潰鐨勪笂涓嬫粦鍔ㄦ帶浠�
/// </summary>
private VerticalFrameControl listBodyContr = null;
@@ -49,6 +53,9 @@
/// </summary>
public void ShowForm()
{
+ this.FormID = "HomeMainPageForm";
+ Instance = this;
+
//鍏堝垵濮嬪寲宸︽粦鎴块棿鍒楄〃鐣岄潰(鍦ㄥ弽灏勯噷闈㈠垵濮嬪寲)
if (ListRoomViewFrom.Instance == null) { }
@@ -75,8 +82,6 @@
this.AddNormalDeviceReportEvent();
//娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠�
this.AddSensorDeviceReportEvent();
- //灏嗗綋鍓嶇殑鐢婚潰淇濆瓨鍒板唴瀛樺綋涓�
- UserCenterLogic.AddActionForm(this);
}
/// <summary>
@@ -165,7 +170,7 @@
selectHouse.Init();
selectHouse.HouseAction = (houseId) =>
{
- ChangeResidence(House.GetHouseByHouseId(houseId));
+ ChangeResidence(HdlResidenceLogic.Current.GetHouseByHouseId(houseId));
};
}
};
@@ -635,6 +640,11 @@
{
cardContr = new Controls.DeviceDoorLockCardControl();
}
+ //鑹叉俯鐏�
+ else if (device.Type == DeviceType.ColorTemperatureLight)
+ {
+ cardContr = new Controls.DeviceColorTemperatureCardControl();
+ }
//鏃犳硶璇嗗埆
else
{
@@ -1051,7 +1061,7 @@
new System.Threading.Thread(async () =>
{
Config.Instance.HomeId = home.Id;
- Config.Instance.Home = House.GetHouseByFilePath(home.FileName);
+ Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(home.Id);
Global.CreateHomeDirectory(home.Id);
Config.Instance.Save();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
@@ -1166,7 +1176,7 @@
floorFL.changeFloor = true;
floorFL.FloorAction = (floorId) =>
{
- btnFloor.Text = Config.Instance.Home.GetFloorNameById(floorId);
+ btnFloor.Text = HdlResidenceLogic.Current.GetFloorNameById(floorId);
HdlRoomLogic.Current.NowMainPageRoom = HdlRoomLogic.Current.GetLoveRoom();
this.ShowForm();
};
@@ -1181,8 +1191,10 @@
/// </summary>
public override void CloseFormBefore()
{
+ //鎶婇潤鎬佸彉閲忕殑杩欎釜涓滆タ缃┖
+ Instance = null;
+
HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceOnline");
- HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceRespone");
HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceStatus");
HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewSensor");
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
index 6846d70..3b2d07d 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
@@ -233,7 +233,7 @@
}
}
//濡傛灉鍙槸鍒囨崲褰撳墠妤煎眰鐨勫叾浠栨埧闂�,鍒欏彧婊戝姩涓婚〉鐨勬粦鍔ㄦ帶浠�
- this.LoadFormMethodByName("HomeMainPageForm", "SetRoomPageViewSelect", room);
+ HomeMainPageForm.Instance?.SetRoomPageViewSelect(room);
});
});
};
@@ -271,14 +271,14 @@
picBackGroud.Gravity = Gravity.CenterHorizontal;
picBackGroud.Radius = (uint)this.GetPictrueRealSize(29);
picBackGroud.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor3;
- frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEvent);
//鏈垎閰嶅浘鏍�
var btnIcon = new PicViewControl(92, 72);
btnIcon.X = this.GetPictrueRealSize(129);
btnIcon.Y = this.GetPictrueRealSize(141);
btnIcon.UnSelectedImagePath = "Room/NoNameRoom.png";
- frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
//鏈垎閰�
var btnName = new NormalViewControl(141, 84, true);
@@ -287,7 +287,7 @@
btnName.IsBold = true;
btnName.TextColor = UserCenterColor.Current.White;
btnName.TextID = R.MyInternationalizationString.Unallocated;
- frameBack.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(btnName, ChidrenBindMode.BindEvent);
frameBack.ButtonClickEvent += (sender, e) =>
{
if (this.CanClick == false)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs
index 6b03468..04156b3 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/SelectLocalDeviceImageForm.cs
@@ -82,7 +82,7 @@
btnIcon.UnSelectedImagePath = $"FunctionIcon/{i + 1}Icon.png";
btnIcon.SelectedImagePath = $"FunctionIcon/{i + 1}IconSelected.png";
btnIcon.Gravity = Gravity.Center;
- frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
frameBack.ButtonClickEvent += (sender, e) =>
{
diff --git a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs
index e6b064b..f97e4f8 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs
@@ -182,7 +182,7 @@
{
//鍦烘櫙鍥剧墖
var frameContr = new ScenePictrueControl();
- listSceneView.AddChidrenFrame(frameContr);
+ listSceneView.AddChidren(frameContr);
frameContr.InitControl(data);
//娣诲姞閫夋嫨鎺т欢
@@ -218,7 +218,7 @@
//淇冧娇瀹冭秴杩囨椂,鑳藉寰�涓婃粦
var frameTemp = new FrameLayout();
frameTemp.Height = Application.GetRealHeight(202 + 23);
- listSceneView.AddChidrenFrame(frameTemp);
+ listSceneView.AddChidren(frameTemp);
});
}
@@ -527,7 +527,7 @@
btnAdd.TextID = R.MyInternationalizationString.AddTo;
btnAdd.TextSize = 17;
btnAdd.Radius = (uint)Application.GetRealHeight(35);
- frameAddBackGroud.AddChidren(btnAdd, ChidrenBindMode.BindEventOnly);
+ frameAddBackGroud.AddChidren(btnAdd, ChidrenBindMode.BindEvent);
frameAddBackGroud.ButtonClickEvent += (sender, e) =>
{
var selectZone = new SelectZone();
@@ -659,7 +659,7 @@
HdlThreadLogic.Current.RunMainInThread(() =>
{
//鍒锋柊涓婚〉
- this.LoadFormMethodByName("HomeMainPageForm", "RefreshBodyView");
+ HomeMainPageForm.Instance?.RefreshBodyView();
});
}
base.CloseFormBefore();
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs
new file mode 100755
index 0000000..052b1bd
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs
@@ -0,0 +1,479 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+namespace Shared.Phone.UserCenter.SmartSound.Forms
+{
+ public class SmartSoundContentForDevice : EditorCommonForm
+ {
+ /// <summary>
+ /// 褰撳墠閫変腑鐨勬埧闂�
+ /// </summary>
+ private SmartSound.Room CurrentRoom = null;
+
+ private FrameLayout ContentLayout = null;
+
+ private VerticalListControl listView = null;
+
+ /// <summary>
+ /// 娌℃湁鏁版嵁鐨勬椂鍊欙紝鎻愮ず鐢�
+ /// </summary>
+ private FrameLayout TipLayout = null;
+
+ private List<string> TabList = new List<string>() { "鐏厜", "绐楀笜" };
+
+ private int CurrentSelectIndex = 0;
+
+ private int imageWith = 683;
+ private int imageHeight = 392;
+
+ /// <summary>
+ /// 閫夋嫨鎴块棿涓殑璁惧
+ /// </summary>
+ /// <param name="_room"> 褰撳墠鎴块棿</param>
+ public SmartSoundContentForDevice(SmartSound.Room _room)
+ {
+ this.CurrentRoom = _room;
+ }
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(CurrentRoom.RoomName);
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+
+ }
+
+ private void InitMiddleFrame()
+ {
+ //1.鍦烘櫙銆佸姛鑳藉鑸潯
+ var switchContr = new SceneFunctionSwitchControl();
+ this.bodyFrameLayout.AddChidren(switchContr);
+ switchContr.Gravity = Gravity.CenterVertical;
+ switchContr.Width = Application.GetRealWidth(650);
+ switchContr.Y = Application.GetRealHeight(40);
+
+ ContentLayout = new FrameLayout();
+ this.bodyFrameLayout.AddChidren(ContentLayout);
+ ContentLayout.Height = this.bodyFrameLayout.Height - switchContr.Height - Application.GetRealHeight(40);
+ ContentLayout.Y = switchContr.Height + Application.GetRealHeight(40);
+
+ var listTitle = new List<string>();
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uScence));
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction));
+
+ //璁剧疆鍒濆鍊�
+ switchContr.SetDefultIndex(0);
+
+ //閫夋嫨浜嬩欢
+ switchContr.SelectTabEvent += (selectIndex) =>
+ {
+ //鍒锋柊bodyView
+ if (selectIndex == 0)
+ {
+ LoadSceneView();
+ }
+ else
+ {
+ LoadFunction();
+ }
+ };
+
+ //寮�濮嬪垵濮嬪寲
+ switchContr.InitControl(listTitle);
+
+ //娣诲姞纭鎸夐挳
+ BottomClickButton bottomClickButton = new BottomClickButton();
+ this.bodyFrameLayout.AddChidren(bottomClickButton);
+ bottomClickButton.Text = "纭";
+ bottomClickButton.ButtonClickEvent += (sender, e) =>
+ {
+ //淇濆瓨鏁版嵁
+ base.CloseForm();
+ };
+ }
+
+ /// <summary>
+ /// 鍔犺浇鍦烘櫙鐣岄潰
+ /// </summary>
+ private void LoadSceneView()
+ {
+ try
+ {
+ //3.璁惧鍒楄〃 ListView
+ ContentLayout.RemoveAll();
+
+ var tipLayout = new FrameLayout();
+ ContentLayout.AddChidren(tipLayout);
+ tipLayout.Visible = false;
+ ShowNoFunctionTip(tipLayout);
+
+ listView = new VerticalListControl();
+ ContentLayout.AddChidren(listView);
+ listView.Y = Application.GetRealHeight(40);
+ listView.RemoveAll();
+
+ for (int i = 0; i < CurrentRoom.SceneList.Count; i++)
+ {
+ SmartSound.Scene scene = CurrentRoom.SceneList[i];
+ var roomRowLayout = new SceneRowLayout(this, scene);
+ listView.AddChidren(roomRowLayout);
+ roomRowLayout.InitControl();
+ }
+
+ if (listView.ChildrenCount == 0)
+ {
+ tipLayout.Visible = true;
+ }
+ else
+ {
+ tipLayout.Visible = false;
+ }
+ }
+ catch (Exception ex)
+ {
+ string eoor = ex.Message;
+ }
+ }
+
+ private void LoadFunction()
+ {
+ try
+ {
+ //2.鍔熻兘绫诲瀷閫夋嫨锛堢伅鍏夈�侀伄闃炽�佺┖璋冿級
+ //3.璁惧鍒楄〃 ListView
+ this.ContentLayout.RemoveAll();
+
+ FrameLayout tab_layout = new FrameLayout();
+ ContentLayout.AddChidren(tab_layout);
+ tab_layout.Height = Application.GetRealHeight(170);
+ tab_layout.Y = 0;
+
+ //娣诲姞 ListView 鎻愮ず
+ TipLayout = new FrameLayout();
+ ContentLayout.AddChidren(TipLayout);
+ TipLayout.Visible = false;
+ TipLayout.Y= tab_layout.Height;
+ ShowNoFunctionTip(TipLayout);
+
+ //娣诲姞 ListView
+ listView = new VerticalListControl();
+ ContentLayout.AddChidren(listView);
+ listView.Y= tab_layout.Height;
+ listView.Height=ContentLayout.Height- tab_layout.Height;
+
+
+
+ Buttons.Clear();
+
+ //娣诲姞鍔熻兘椤�
+ for (int i = 0; i < TabList.Count; i++)
+ {
+ Button button = new Button();
+ tab_layout.AddChidren(button);
+ button.Width = Application.GetRealWidth(250);
+ button.Text = TabList[i];
+ button.X = ControlCommonResourse.XXLeft/2 + i * button.Width;
+ button.AddTag("Index", i);
+ Buttons.Add(button);
+
+ button.MouseUpEventHandler += (sender, e) =>
+ {
+ Button btn = sender as Button;
+ CurrentSelectIndex = (int)btn.GetTagByKey("Index");
+ RefreshButtonState();
+ RefreshFunctionListView();
+ };
+ }
+
+ RefreshButtonState();
+ RefreshFunctionListView();
+ }
+ catch (Exception ex)
+ {
+ string error = ex.Message;
+ }
+ }
+
+ private void RefreshFunctionListView()
+ {
+ try
+ {
+ listView.RemoveAll();
+
+ switch (CurrentSelectIndex)
+ {
+ case 0:// 鐏厜
+ {
+ for (int i = 0; i < CurrentRoom.DeviceList.Count; i++)
+ {
+ SmartSound.Device device = CurrentRoom.DeviceList[i];
+ //鐏厜
+ if (device.DeviceType == 1 || device.DeviceType == 2 || device.DeviceType == 3)
+ {
+ var deviceRowLayout = new DeviceRowLayout(this, device);
+ listView.AddChidren(deviceRowLayout);
+ deviceRowLayout.InitControl();
+ }
+ }
+ }
+ break;
+ case 1: // 绐楀笜
+ {
+ for (int i = 0; i < CurrentRoom.DeviceList.Count; i++)
+ {
+ SmartSound.Device device = CurrentRoom.DeviceList[i];
+ //
+ if (device.DeviceType == 4 || device.DeviceType == 5 || device.DeviceType == 6)
+ {
+ var deviceRowLayout = new DeviceRowLayout(this, device);
+ listView.AddChidren(deviceRowLayout);
+ deviceRowLayout.InitControl();
+ }
+ }
+ }
+ break;
+ }
+
+ if (listView.ChildrenCount == 0)
+ {
+ TipLayout.Visible = true;
+ }
+ else
+ {
+ TipLayout.Visible = false;
+ }
+ }
+ catch (Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ /// <summary>
+ /// 鎻愮ず娌℃湁鍔熻兘
+ /// </summary>
+ private void ShowNoFunctionTip(FrameLayout layout,string tip="娌℃湁鏁版嵁鍝�")
+ {
+ var noFunction = new Button()
+ {
+ Y = Application.GetRealHeight(320),
+ Width = Application.GetMinRealAverage(757),
+ Height = Application.GetMinRealAverage(435),
+ UnSelectedImagePath = "Item/NoFunction.png",
+ Gravity = Gravity.CenterHorizontal
+ };
+ layout.AddChidren(noFunction);
+
+ var noFunctionTip = new Button()
+ {
+ Y = noFunction.Bottom + Application.GetRealHeight(32),
+ Height = Application.GetRealHeight(200),
+ Width = Application.GetRealWidth(700),
+ Gravity = Gravity.CenterHorizontal,
+ Text = tip,
+ TextColor = UserCenterColor.Current.TextGrayColor1,
+ TextAlignment = TextAlignment.Center,
+ IsMoreLines = true
+ };
+ layout.AddChidren(noFunctionTip);
+ }
+
+ //涓轰簡鏂逛究鏇存柊鐘舵�侊紝瀛樿捣鏉�
+ private List<Button> Buttons = new List<Button>();
+ private void RefreshButtonState()
+ {
+ try
+ {
+ for (int i = 0; i < Buttons.Count; i++)
+ {
+ Button btn = Buttons[i];
+ if (i == CurrentSelectIndex)
+ {
+ btn.SelectedImagePath = "Item/RoomIconBackgroundSelected.png";
+ btn.UnSelectedImagePath = "Item/RoomIconBackgroundSelected.png";
+ btn.TextColor = UserCenterColor.Current.White;
+ }
+ else
+ {
+ btn.SelectedImagePath = "Item/RoomIconBackground.png";
+ btn.UnSelectedImagePath = "Item/RoomIconBackground.png";
+ btn.TextColor=UserCenterColor.Current.TextGrayColor1;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ #region 鈻� 鑷畾涔夊満鏅�夋嫨鎺т欢_____________________
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ private class SceneRowLayout : FrameRowControl
+ {
+ private SmartSoundContentForDevice smartSoundControlForDevice = null;
+
+ private SmartSound.Scene scene = null;
+ /// <summary>
+ /// 鎴块棿鍚嶇О
+ /// </summary>
+ private NormalViewControl btnName = null;
+
+ private IconViewControl Right_icon = null;
+
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ public SceneRowLayout(SmartSoundContentForDevice _smartSoundControlForDevice, SmartSound.Scene _scene)
+ {
+ this.smartSoundControlForDevice = _smartSoundControlForDevice;
+ this.scene = _scene;
+ this.UseClickStatu = false;
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(170);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ //鏄剧ず鏂囨湰
+ btnName = this.AddLeftCaption(string.Empty, 700);
+ btnName.Height = Application.GetRealHeight(60);
+ btnName.TextSize = 17;
+ btnName.Y = Application.GetRealHeight(57);
+ btnName.Text = scene.SceneName;
+ Right_icon = this.AddRightArrow();
+ Right_icon.Width = Application.GetRealWidth(115);
+ Right_icon.Height = Application.GetRealHeight(115);
+ Right_icon.Gravity = Gravity.CenterVertical;
+ Right_icon.X = Right_icon.X - Application.GetRealWidth(60);
+
+ this.ButtonClickEvent += (sender, e) =>
+ {
+ scene.Checked = !scene.Checked;
+ RefreshRightIconState(scene.Checked);
+ };
+
+ RefreshRightIconState(scene.Checked);
+ AddBottomLine();
+
+ }
+
+ private void RefreshRightIconState(bool bol = false)
+ {
+ try
+ {
+ if (bol)
+ {
+ Right_icon.SelectedImagePath = "SmartSound/CheckBoxSel.png";
+ Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxSel.png";
+ }
+ else
+ {
+ Right_icon.SelectedImagePath = "SmartSound/CheckBoxDef.png";
+ Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxDef.png";
+ }
+ }
+ catch (Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ }
+ #endregion
+
+ #region 鈻� 鑷畾鐏厜閫夋嫨鎺т欢_____________________
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ private class DeviceRowLayout : FrameRowControl
+ {
+ private SmartSoundContentForDevice smartSoundControlForDevice = null;
+
+ private SmartSound.Device device = null;
+ /// <summary>
+ /// 鎴块棿鍚嶇О
+ /// </summary>
+ private NormalViewControl btnName = null;
+
+ private IconViewControl Right_icon = null;
+
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ public DeviceRowLayout(SmartSoundContentForDevice _smartSoundControlForDevice, SmartSound.Device _device)
+ {
+ this.smartSoundControlForDevice = _smartSoundControlForDevice;
+ this.device = _device;
+ this.UseClickStatu = false;
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(170);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ //鏄剧ず鏂囨湰
+ btnName = this.AddLeftCaption(string.Empty, 700);
+ btnName.Height = Application.GetRealHeight(60);
+ btnName.TextSize = 17;
+ btnName.Y = Application.GetRealHeight(57);
+ btnName.Text = device.DeviceName;
+ Right_icon = this.AddRightArrow();
+ Right_icon.Width = Application.GetRealWidth(115);
+ Right_icon.Height = Application.GetRealHeight(115);
+ Right_icon.Gravity = Gravity.CenterVertical;
+ Right_icon.X = Right_icon.X - Application.GetRealWidth(60);
+
+ this.ButtonClickEvent += (sender, e) =>
+ {
+ device.Checked = !device.Checked;
+ RefreshRightIconState(device.Checked);
+ };
+
+ RefreshRightIconState(device.Checked);
+ AddBottomLine();
+
+ }
+
+ private void RefreshRightIconState(bool bol = false)
+ {
+ try
+ {
+ if (bol)
+ {
+ Right_icon.SelectedImagePath = "SmartSound/CheckBoxSel.png";
+ Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxSel.png";
+ }
+ else
+ {
+ Right_icon.SelectedImagePath = "SmartSound/CheckBoxDef.png";
+ Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxDef.png";
+ }
+ }
+ catch (Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+ }
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs
new file mode 100755
index 0000000..e9168d3
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs
@@ -0,0 +1,583 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Shared.Phone.UserCenter.SmartSound.Util;
+
+namespace Shared.Phone.UserCenter.SmartSound.Forms
+{
+ public class SmartSoundContentForDeviceChange : EditorCommonForm
+ {
+
+ /// <summary>
+ /// 褰撳墠閫変腑鐨勬埧闂�
+ /// </summary>
+ private SmartSound.Room CurrentRoom = null;
+
+ private FrameLayout ContentLayout = null;
+
+ private FrameLayout DeviceListViewFrameLayout = null;
+ /// <summary>
+ /// 鍦烘櫙 listView
+ /// </summary>
+ private VerticalListControl SceneListView = null;
+ /// <summary>
+ /// 璁惧 listView
+ /// </summary>
+ private VerticalListControl DeviceListView = null;
+ /// <summary>
+ /// 娌℃湁鏁版嵁鐨勬椂鍊欙紝鎻愮ず鐢�
+ /// </summary>
+ private FrameLayout TipLayout = null;
+
+ private List<string> TabList = new List<string>() { Language.StringByID(R.MyInternationalizationString.uLight), Language.StringByID(R.MyInternationalizationString.uDeviceBelongId100) };
+
+ private int CurrentSelectIndex = 0;
+ private int imageWith = 683;
+ private int imageHeight = 392;
+
+ /// <summary>
+ /// 閫夋嫨鎴块棿涓殑璁惧
+ /// </summary>
+ /// <param name="_room"> 褰撳墠鎴块棿</param>
+ public SmartSoundContentForDeviceChange(SmartSound.Room _room)
+ {
+ this.CurrentRoom = _room;
+ }
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(CurrentRoom.RoomName);
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ }
+
+ private void InitMiddleFrame()
+ {
+ //1.鍦烘櫙銆佸姛鑳藉鑸潯
+ var switchContr = new SceneFunctionSwitchControl();
+ this.bodyFrameLayout.AddChidren(switchContr);
+ switchContr.Gravity = Gravity.CenterVertical;
+ switchContr.Width = Application.GetRealWidth(650);
+ switchContr.Y = Application.GetRealHeight(40);
+
+ ContentLayout = new FrameLayout();
+ this.bodyFrameLayout.AddChidren(ContentLayout);
+ ContentLayout.Height = this.bodyFrameLayout.Height - switchContr.Height - Application.GetRealHeight(40);
+ ContentLayout.Y = switchContr.Height + Application.GetRealHeight(40);
+
+ var listTitle = new List<string>();
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uScence));
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction));
+
+ //璁剧疆鍒濆鍊�
+ switchContr.SetDefultIndex(0);
+
+ //閫夋嫨浜嬩欢
+ switchContr.SelectTabEvent += (selectIndex) =>
+ {
+ //鍒锋柊bodyView
+ if (selectIndex == 0)
+ {
+ LoadSceneView();
+ }
+ else
+ {
+ LoadFunction();
+ }
+ };
+
+ //寮�濮嬪垵濮嬪寲
+ switchContr.InitControl(listTitle);
+
+ }
+
+ /// <summary>
+ /// 鍔犺浇鍦烘櫙鐣岄潰
+ /// </summary>
+ private void LoadSceneView()
+ {
+ try
+ {
+ //3.璁惧鍒楄〃 ListView
+ ContentLayout.RemoveAll();
+
+ var tipLayout = new FrameLayout();
+ ContentLayout.AddChidren(tipLayout);
+ tipLayout.Visible = false;
+ ShowNoFunctionTip(tipLayout);
+
+ SceneListView = new VerticalListControl();
+ ContentLayout.AddChidren(SceneListView);
+ SceneListView.Y = Application.GetRealHeight(40);
+ SceneListView.RemoveAll();
+
+ for (int i = 0; i < CurrentRoom.SceneList.Count; i++)
+ {
+ SmartSound.Scene scene = CurrentRoom.SceneList[i];
+ var roomRowLayout = new SceneRowLayout(this, scene, i);
+ SceneListView.AddChidren(roomRowLayout);
+ roomRowLayout.InitControl();
+ }
+
+ if (SceneListView.ChildrenCount > 5)
+ {
+ TextView textView = new TextView();
+ textView.Height = Application.GetRealHeight(127 * 3);
+ SceneListView.AddChidren(textView);
+ }
+
+ if (SceneListView.ChildrenCount == 0)
+ {
+ tipLayout.Visible = true;
+ }
+ else
+ {
+ tipLayout.Visible = false;
+ }
+ }
+ catch (Exception ex)
+ {
+ string eoor = ex.Message;
+ }
+ }
+
+ private void LoadFunction()
+ {
+ try
+ {
+
+ ContentLayout.RemoveAll();
+
+ FrameLayout tab_layout = new FrameLayout();
+ ContentLayout.AddChidren(tab_layout);
+ tab_layout.Height = Application.GetRealHeight(170);
+ tab_layout.Y = 0;
+
+ //娣诲姞 ListView 鎻愮ず
+ TipLayout = new FrameLayout();
+ ContentLayout.AddChidren(TipLayout);
+ TipLayout.Visible = false;
+ TipLayout.Y = tab_layout.Height;
+ ShowNoFunctionTip(TipLayout);
+
+ Buttons.Clear();
+
+ //娣诲姞鍔熻兘椤�
+ for (int i = 0; i < TabList.Count; i++)
+ {
+ Button button = new Button();
+ tab_layout.AddChidren(button);
+ button.Width = Application.GetRealWidth(250);
+ button.Text = TabList[i];
+ button.X = ControlCommonResourse.XXLeft / 2 + i * button.Width;
+ button.AddTag("Index", i);
+ Buttons.Add(button);
+
+ button.MouseUpEventHandler += (sender, e) =>
+ {
+ Button btn = sender as Button;
+ CurrentSelectIndex = (int)btn.GetTagByKey("Index");
+ RefreshButtonState();
+ RefreshFunctionListView();
+ };
+ }
+
+ //娣诲姞 ListView
+ DeviceListViewFrameLayout = new FrameLayout();
+ ContentLayout.AddChidren(DeviceListViewFrameLayout);
+ DeviceListViewFrameLayout.Y = tab_layout.Height;
+ DeviceListViewFrameLayout.Height = ContentLayout.Height - tab_layout.Height;
+
+ RefreshButtonState();
+ RefreshFunctionListView();
+ }
+ catch (Exception ex)
+ {
+ string error = ex.Message;
+ }
+ }
+
+ private void RefreshFunctionListView()
+ {
+ try
+ {
+
+ DeviceListViewFrameLayout.RemoveAll();
+
+ DeviceListView = new VerticalListControl();
+ DeviceListViewFrameLayout.AddChidren(DeviceListView);
+ DeviceListView.Height = DeviceListViewFrameLayout.Height;
+ DeviceListView.RemoveAll();
+
+ switch (CurrentSelectIndex)
+ {
+ case 0:// 鐏厜
+ {
+ int n = 0;
+ for (int i = 0; i < CurrentRoom.DeviceList.Count; i++)
+ {
+ SmartSound.Device device = CurrentRoom.DeviceList[i];
+ //鐏厜
+ if (device.DeviceType == 1 || device.DeviceType == 2 || device.DeviceType == 3)
+ {
+ var deviceRowLayout = new DeviceRowLayout(this, device, n);
+ DeviceListView.AddChidren(deviceRowLayout);
+ deviceRowLayout.InitControl();
+ n++;
+ }
+ }
+ }
+ break;
+ case 1: // 绐楀笜
+ {
+ int n = 0;
+ for (int i = 0; i < CurrentRoom.DeviceList.Count; i++)
+ {
+ SmartSound.Device device = CurrentRoom.DeviceList[i];
+ //
+ if (device.DeviceType == 4 || device.DeviceType == 5 || device.DeviceType == 6)
+ {
+ var deviceRowLayout = new DeviceRowLayout(this, device, n);
+ DeviceListView.AddChidren(deviceRowLayout);
+ deviceRowLayout.InitControl();
+ n++;
+ }
+ }
+ }
+ break;
+ }
+
+ if (DeviceListView.ChildrenCount > 5)
+ {
+ TextView textView = new TextView();
+ textView.Height = Application.GetRealHeight(127 * 3);
+ DeviceListView.AddChidren(textView);
+ }
+
+ if (DeviceListView.ChildrenCount == 0)
+ {
+ TipLayout.Visible = true;
+ }
+ else
+ {
+ TipLayout.Visible = false;
+ }
+ }
+ catch (Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ /// <summary>
+ /// 淇敼鍦烘櫙鏄电О
+ /// </summary>
+ /// <param name="scene"></param>
+ /// <param name="sceneRowLayout"></param>
+ private void ShowSetNicknameDialog(SmartSound.Scene scene, SceneRowLayout sceneRowLayout)
+ {
+ //鐢熸垚涓�涓脊绐楃敾闈�
+ var dialogForm = new DialogInputControl();
+ //缂栬緫浣忓畢
+ dialogForm.SetTitleText("鑷畾涔夊敜閱掕瘝");
+ //璇疯緭鍏ヤ綇瀹呭悕绉�
+ dialogForm.SetTipText("璇疯緭鍏ュ敜閱掕瘝");
+ dialogForm.Text = scene.NicksName;
+
+ //鎸変笅纭鎸夐挳
+ dialogForm.ComfirmClickEvent += (async (textValue) =>
+ {
+ scene.NicksName = textValue;
+ string remark = scene.SceneName;
+ if (scene.NicksName.Trim() != string.Empty)
+ {
+ remark += "(" + scene.NicksName + ")";
+ }
+ sceneRowLayout.btnCaption.Text = remark;
+ string json = await postBatchEdit();
+ //鐢婚潰鍏抽棴
+ dialogForm.CloseDialog();
+ });
+ }
+
+ /// <summary>
+ /// 淇敼璁惧鏄电О
+ /// </summary>
+ /// <param name="device"></param>
+ /// <param name="deviceRowLayout"></param>
+ private void ShowSetNicknameDialog(SmartSound.Device device, DeviceRowLayout deviceRowLayout)
+ {
+ //鐢熸垚涓�涓脊绐楃敾闈�
+ var dialogForm = new DialogInputControl();
+ //缂栬緫浣忓畢
+ dialogForm.SetTitleText("鑷畾涔夊敜閱掕瘝");
+ //璇疯緭鍏ヤ綇瀹呭悕绉�
+ dialogForm.SetTipText("璇疯緭鍏ュ敜閱掕瘝");
+ dialogForm.Text = device.NicksName;
+
+ //鎸変笅纭鎸夐挳
+ dialogForm.ComfirmClickEvent += (async (textValue) =>
+ {
+ device.NicksName = textValue;
+ string remark = device.DeviceName;
+ if (device.NicksName.Trim() != string.Empty)
+ {
+ remark += "(" + device.NicksName + ")";
+ }
+ deviceRowLayout.btnCaption.Text = remark;
+
+ string json = await postBatchEdit();
+
+ //鐢婚潰鍏抽棴
+ dialogForm.CloseDialog();
+ });
+ }
+
+ /// <summary>
+ /// 鍦烘櫙鍒犻櫎
+ /// </summary>
+ private void ShowSceneDelectDialog(SmartSound.Scene scene)
+ {
+ this.ShowMassage(ShowMsgType.Confirm, "纭鍒犻櫎璇ユ帶鍒跺唴瀹癸紵", async () =>
+ {
+ try
+ {
+ CurrentRoom.SceneList.Remove(scene);
+ LoadSceneView();
+ string json = await postBatchEdit();
+ }
+ catch (Exception e)
+ {
+ string sss = e.Message;
+ }
+
+ }, Language.StringByID(R.MyInternationalizationString.OkMsg));
+ }
+
+ /// <summary>
+ /// 璁惧鍒犻櫎
+ /// </summary>
+ private void ShowDeviceDelectDialog(SmartSound.Device device)
+ {
+ this.ShowMassage(ShowMsgType.Confirm, "纭鍒犻櫎璇ユ帶鍒跺唴瀹癸紵", async () =>
+ {
+ try
+ {
+ //DeviceListView.RemoveAt(index);
+ CurrentRoom.DeviceList.Remove(device);
+ RefreshFunctionListView();
+
+ string json = await postBatchEdit();
+ }
+ catch (Exception e)
+ {
+ string sss = e.Message;
+ }
+
+ }, Language.StringByID(R.MyInternationalizationString.OkMsg));
+ }
+
+ /// <summary>
+ /// 鎻愮ず娌℃湁鍔熻兘
+ /// </summary>
+ private void ShowNoFunctionTip(FrameLayout layout, string tip = "娌℃湁鏁版嵁鍝�")
+ {
+ var noFunction = new Button()
+ {
+ Y = Application.GetRealHeight(320),
+ Width = Application.GetMinRealAverage(757),
+ Height = Application.GetMinRealAverage(435),
+ UnSelectedImagePath = "Item/NoFunction.png",
+ Gravity = Gravity.CenterHorizontal
+ };
+ layout.AddChidren(noFunction);
+
+ var noFunctionTip = new Button()
+ {
+ Y = noFunction.Bottom + Application.GetRealHeight(32),
+ Height = Application.GetRealHeight(200),
+ Width = Application.GetRealWidth(700),
+ Gravity = Gravity.CenterHorizontal,
+ Text = tip,
+ TextColor = UserCenterColor.Current.TextGrayColor1,
+ TextAlignment = TextAlignment.Center,
+ IsMoreLines = true
+ };
+ layout.AddChidren(noFunctionTip);
+ }
+
+ //涓轰簡鏂逛究鏇存柊鐘舵�侊紝瀛樿捣鏉�
+ private List<Button> Buttons = new List<Button>();
+ private void RefreshButtonState()
+ {
+ try
+ {
+ for (int i = 0; i < Buttons.Count; i++)
+ {
+ Button btn = Buttons[i];
+ if (i == CurrentSelectIndex)
+ {
+ btn.SelectedImagePath = "Item/RoomIconBackgroundSelected.png";
+ btn.UnSelectedImagePath = "Item/RoomIconBackgroundSelected.png";
+ btn.TextColor = UserCenterColor.Current.White;
+ }
+ else
+ {
+ btn.SelectedImagePath = "Item/RoomIconBackground.png";
+ btn.UnSelectedImagePath = "Item/RoomIconBackground.png";
+ btn.TextColor = UserCenterColor.Current.TextGrayColor1;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ private async Task<string> postBatchEdit()
+ {
+ // 鎻愪氦鏁版嵁鑷虫湇鍔″櫒
+ string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit";
+ string json = Newtonsoft.Json.JsonConvert.SerializeObject(SmartSound.getInstantiate());
+ string response_str = await MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
+ return response_str;
+ }
+
+ #region 鈻� 鑷畾涔夊満鏅�夋嫨鎺т欢_____________________
+
+ /// <summary>
+ /// 鍦烘櫙鍒楄〃琛�
+ /// </summary>
+ private class SceneRowLayout : RowLayoutControl
+ {
+ private SmartSoundContentForDeviceChange smartSoundContentForDeviceChange = null;
+
+ private SmartSound.Scene scene = null;
+ /// <summary>
+ /// 鍒犻櫎鎸夐挳
+ /// </summary>
+ public NormalViewControl btnDelect = null;
+ public NormalViewControl btnCaption = null;
+ private int Index = 0;
+
+ public SceneRowLayout(SmartSoundContentForDeviceChange _smartSoundContentForDeviceChange, SmartSound.Scene _scene, int _index)
+ {
+ smartSoundContentForDeviceChange = _smartSoundContentForDeviceChange;
+ scene = _scene;
+ Index = _index;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧唴閮ㄦ帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(175);
+ string remark = scene.SceneName;
+ if (scene.NicksName.Trim() != string.Empty)
+ {
+ remark += " (" + scene.NicksName + ")";
+ }
+ btnCaption = frameTable.AddLeftCaption(remark, 2000);
+
+ var nicknameIcon = frameTable.AddRightArrow();//58
+ nicknameIcon.TextSize = 17;
+
+ nicknameIcon.SelectedImagePath = "SmartSound/Nickname.png";
+ nicknameIcon.UnSelectedImagePath = "SmartSound/Nickname.png";
+ nicknameIcon.AddTag("obj", scene);
+ nicknameIcon.ButtonClickEvent += (sender, e) =>
+ {
+ // 娣诲姞鏄电О
+ var btn = sender as IconViewControl;
+ SmartSound.Scene tmpScene = (SmartSound.Scene)btn.GetTagByKey("obj");
+ smartSoundContentForDeviceChange.ShowSetNicknameDialog(tmpScene, this);
+ };
+
+ //搴曠嚎
+ frameTable.AddBottomLine();
+
+ btnDelect = base.AddDeleteControl();
+ btnDelect.Text = Language.StringByID(R.MyInternationalizationString.Delete);
+ btnDelect.ButtonClickEvent += (sender, e) =>
+ {
+ //鍒犻櫎鍦烘櫙
+ smartSoundContentForDeviceChange.ShowSceneDelectDialog(scene);
+ };
+ }
+ }
+ #endregion
+
+ #region 鈻� 鑷畾鐏厜閫夋嫨鎺т欢_____________________
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ private class DeviceRowLayout : RowLayoutControl
+ {
+ private SmartSoundContentForDeviceChange smartSoundContentForDeviceChange = null;
+
+ private SmartSound.Device device = null;
+ /// <summary>
+ /// 鍒犻櫎鎸夐挳
+ /// </summary>
+ public NormalViewControl btnDelect = null;
+ public NormalViewControl btnCaption = null;
+ private int Index = 0;
+
+ public DeviceRowLayout(SmartSoundContentForDeviceChange _smartSoundContentForDeviceChange, SmartSound.Device _device, int _index)
+ {
+ smartSoundContentForDeviceChange = _smartSoundContentForDeviceChange;
+ device = _device;
+ Index = _index;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧唴閮ㄦ帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(175);
+ string remark = device.DeviceName;
+ if (device.NicksName.Trim() != string.Empty)
+ {
+ remark += " (" + device.NicksName + ")";
+ }
+ btnCaption = frameTable.AddLeftCaption(remark, 2000);
+
+ var nicknameIcon = frameTable.AddRightArrow();//58
+ nicknameIcon.TextSize = 17;
+
+ nicknameIcon.SelectedImagePath = "SmartSound/Nickname.png";
+ nicknameIcon.UnSelectedImagePath = "SmartSound/Nickname.png";
+ nicknameIcon.AddTag("obj", device);
+ nicknameIcon.ButtonClickEvent += (sender, e) =>
+ {
+ var btn = sender as IconViewControl;
+ SmartSound.Device tmpDevice = (SmartSound.Device)btn.GetTagByKey("obj");
+ smartSoundContentForDeviceChange.ShowSetNicknameDialog(tmpDevice, this);
+ };
+
+ //搴曠嚎
+ frameTable.AddBottomLine();
+
+ btnDelect = base.AddDeleteControl();
+ btnDelect.Text = "鍒犻櫎";
+ btnDelect.ButtonClickEvent += (sender, e) =>
+ {
+ smartSoundContentForDeviceChange.ShowDeviceDelectDialog(device);
+ };
+ }
+ }
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlContentForm.cs b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlContentForm.cs
new file mode 100755
index 0000000..02c58fe
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlContentForm.cs
@@ -0,0 +1,662 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Shared.Common;
+using Shared.Phone.UserCenter.SmartSound.Util;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.SmartSound.Forms
+{
+ public class SmartSoundControlContentForm : EditorCommonForm
+ {
+ /// <summary>
+ /// 涓存椂鏁版嵁
+ /// </summary>
+ private List<SmartSound.Layer> TempDatas = new List<SmartSound.Layer>();
+
+ private SmartSoundInfo.SoundInfo mSoundInfo;
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalListControl listView = null;
+
+ private FrameLayout contentLayout = null;
+ public int CurrentIndex = 0;
+ private BottomClickButton bottomClickButton = null;
+
+ public SmartSoundControlContentForm(SmartSoundInfo.SoundInfo soundInfo)
+ {
+ this.mSoundInfo = soundInfo;
+ }
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ IniFloorData();//鍏堝姞杞芥暟鎹�
+ TempDatas.Clear();
+
+ this.ScrollEnabled = false;
+ base.SetTitleText("閫夋嫨鎴块棿");//璁剧疆鏍囬淇℃伅
+
+ contentLayout = new FrameLayout();
+ this.bodyFrameLayout.AddChidren(contentLayout);
+
+ IniAllDataView();
+ }
+
+ #region 鍔犺浇鏈湴鎵�鏈夋暟鎹紝鐢熸垚渚涚敤鎴烽�夋嫨鎴块棿鐨勭晫闈�
+
+ private void IniAllDataView()
+ {
+ contentLayout.RemoveAll();
+
+ var pullLayout = new MyPullControl(this, SmartSound.LocaData);
+ contentLayout.AddChidren(pullLayout);
+ pullLayout.InitControl();
+
+ LoadAllRoomListView();
+
+ bottomClickButton = new BottomClickButton();
+ this.bodyFrameLayout.AddChidren(bottomClickButton);
+ bottomClickButton.Text = "纭";
+ bottomClickButton.ButtonClickEvent += (sender, e) =>
+ {
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+ this.ShowProgressBar();
+ //淇濆瓨鏁版嵁
+ if (SmartSound.getInstantiate().LayerList == null)
+ SmartSound.getInstantiate().LayerList = new List<SmartSound.Layer>();
+
+ SmartSound.getInstantiate().LayerList.Clear();
+ SmartSound.getInstantiate().LayerList = CollateData();
+ SmartSound.getInstantiate().TokenID = mSoundInfo.Id;
+ SmartSound.getInstantiate().UserID = mSoundInfo.UserID;
+
+ //涓婁紶鏁版嵁鍒版湇鍔″櫒
+ string str = await postBatchEdit();
+ CloseProgressBar();
+
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ CloseForm();
+ });
+ });
+ };
+
+ bottomClickButton.Visible = false;
+ }
+
+ private void LoadAllRoomListView()
+ {
+ try
+ {
+
+ if (SmartSound.LocaData == null || SmartSound.LocaData.Count < 1)
+ return;
+
+ // 鍔犺浇褰撳墠妤煎眰鐨勬墍鏈夋埧闂� ListView
+ SmartSound.Layer layer = SmartSound.LocaData[CurrentIndex];
+ if (listView == null)
+ {
+ listView = new VerticalListControl();
+ contentLayout.AddChidren(listView);
+ listView.Y = Application.GetRealHeight(173);
+ listView.Height = bodyFrameLayout.Height- Application.GetRealHeight(173);
+ }
+
+ listView.RemoveAll();
+
+ foreach(SmartSound.Room room in layer.RoomList)
+ {
+ var roomRowLayout = new RoomRowLayout(this, room);
+ listView.AddChidren(roomRowLayout);
+ roomRowLayout.InitControl();
+ }
+
+ //澶氫釜鐨勬椂鍊欙紝纭鎸夐挳浼氶伄鎸′竴閮ㄥ垎銆傝拷鍔犱笁涓┖鐨勮鐨勯珮搴︼紝鎶婂畠椤朵笂鏉�
+ if (listView.ChildrenCount > 5)
+ {
+ TextView textView = new TextView();
+ textView.Height = Application.GetRealHeight(127 * 3);
+ listView.AddChidren(textView);
+ }
+ }
+ catch { }
+ }
+
+ private async Task<string> postBatchEdit()
+ {
+ // The remote server returned an error: (400) Bad Request.
+ string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit";
+ string json = Newtonsoft.Json.JsonConvert.SerializeObject(SmartSound.getInstantiate());
+ string response_str = await MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
+ return response_str;
+ }
+
+ #endregion
+
+ /// <summary>
+ /// 灏嗘暟鎹浆鎹负鏅鸿兘闊崇浣跨敤鐨勬暟鎹�
+ /// </summary>
+ private void IniFloorData()
+ {
+
+ if (SmartSound.LocaData == null)
+ SmartSound.LocaData = new List<SmartSound.Layer>();
+
+ SmartSound.LocaData.Clear();
+
+ Dictionary<string, string> floorDictionary = Config.Instance.Home.FloorDics;//妤煎眰鍒楄〃
+
+ #region 鍒嗘ゼ灞�
+ if (floorDictionary.Count < 1)
+ {
+ //娌℃湁妤煎眰,妯℃嫙涓�涓�
+ SmartSound.Layer layer = new SmartSound.Layer();
+ layer.LayerID = DateTime.Now.ToString("yyyyMMddHHmmssms");
+ layer.LayerName = "涓�妤�";
+ layer.RoomList.Clear();
+ SmartSound.LocaData.Add(layer);
+ }
+ else
+ {
+ foreach (string layer_id in floorDictionary.Keys)
+ {
+ SmartSound.Layer layer = new SmartSound.Layer();
+ layer.LayerID = layer_id;
+ layer.LayerName = floorDictionary[layer_id];
+ layer.RoomList.Clear();
+ SmartSound.LocaData.Add(layer);
+ }
+ }
+ #endregion
+
+ #region 鎴块棿鍏ヤ綇瀵瑰簲鐨勬ゼ灞�
+ var roomList = HdlRoomLogic.Current.GetAllListRooms();//鑾峰彇鎵�鏈夋埧闂�
+
+ for (int n = 0; n < SmartSound.LocaData.Count; n++)
+ {
+ SmartSound.Layer layer = SmartSound.LocaData[n];
+
+ foreach (Room room in roomList)
+ {
+ try
+ {
+ if (layer.LayerID != room.FloorId && SmartSound.LocaData.Count > 1)
+ continue;
+
+ //娣诲姞鎴块棿
+ SmartSound.Room smartRoom = new SmartSound.Room();
+ layer.RoomList.Add(smartRoom);
+
+ smartRoom.RoomID = room.Id;
+ smartRoom.RoomName = room.Name;
+ smartRoom.DeviceList.Clear();
+ smartRoom.SceneList.Clear();
+
+ #region 娣诲姞璁惧 鐏厜銆佺獥甯樸�佸満鏅�佺┖璋�
+ for (int j = 0; j < room.ListDevice.Count; j++)
+ {
+ string key = room.ListDevice[j].ToString();
+ var device = LocalDevice.Current.GetDevice(key);
+ if (device == null)
+ continue;
+
+ SmartSound.Device smartDevice = new SmartSound.Device();
+ //smartDevice.Id = device.DeviceID.ToString();//璁惧 Id
+ smartDevice.DeviceAddress = device.DeviceAddr;//璁惧 MAC
+ smartDevice.Epoint = device.DeviceEpoint;//璁惧绔彛
+ //smartDevice.ClusterID = 0;
+ smartDevice.DeviceName = device.DeviceName;//璁惧鍚嶇О
+ smartDevice.NicksName = "";
+ smartDevice.DeviceType = GetDeviceType(device);//璁惧绫诲瀷
+ smartDevice.GatewayID = device.CurrentGateWayId;//缃戝叧 Id
+ //smartDevice.RoomID = room.Id;//鎴块棿 Id
+ if (smartDevice.DeviceName == "" || smartDevice.DeviceName == string.Empty)
+ continue;
+
+ smartRoom.DeviceList.Add(smartDevice);
+
+ }
+ #endregion
+
+ var sceneList = HdlSceneLogic.Current.GetRoomSceneList(room);
+
+ #region //娣诲姞鍦烘櫙
+ for (int k = 0; k < sceneList.Count; k++)
+ {
+ SceneUI scene = sceneList[k];
+
+ if (scene == null) continue;
+ SmartSound.Scene smartScene = new SmartSound.Scene();
+ //smartScene.Id = scene.DeviceID.ToString();
+ smartScene.SceneName = scene.Name;
+ smartScene.SceneID = scene.Id;
+ smartScene.DelayTime = scene.DelayTime;
+ //smartScene.ClusterID = 0;
+ smartScene.NicksName = "";
+ //smartScene.RoomID = room.Id;
+ smartScene.GatewayID = ZbGateway.MainGateWay.GwId;
+
+ if (smartScene.SceneName == "" || smartScene.SceneName == string.Empty)
+ continue;
+
+ smartRoom.SceneList.Add(smartScene);
+ }
+ #endregion
+
+ }
+ catch (Exception e)
+ {
+ string errpr = e.Message;
+ }
+ }
+ }
+ #endregion
+
+ }
+
+ /// <summary>
+ /// Zigbee璁惧绫诲瀷杞崲涓烘櫤鑳介煶绠变娇鐢ㄧ殑绫诲瀷
+ /// </summary>
+ /// <returns></returns>
+ private int GetDeviceType(ZigBee.Device.CommonDevice device)
+ {
+ int type = 0;//1=寮�鍏崇伅锛�2=璋冨厜鐏紝3=RGB 鐏紝4=绐楀笜妯″潡锛�5=寮�鍚堝笜锛�6=鍗峰笜锛�7=绌鸿皟锛�8=闈㈡澘锛�9=鏂伴
+
+ if (device.Type == DeviceType.OnOffOutput && device.DfunctionType == DeviceFunctionType.A鐏厜)
+ {
+ type = 1;//杩欓噷闈㈢殑灏辨槸缁х數鍣ㄧ伅鍏変簡
+ }
+ else if (device.Type == DeviceType.DimmableLight)
+ {
+ type = 2;//璋冨厜
+ }
+ else if (device.Type == DeviceType.ColorDimmableLight)
+ {
+ type = 3;
+ }
+ else if (device.Type == DeviceType.WindowCoveringDevice)
+ {
+ //绐楀笜
+ if (((Rollershade)device).WcdType == 4)//寮�鍚堝笜
+ {
+ type = 5;
+ }
+ else if (((Rollershade)device).WcdType == 0)//鍗峰笜
+ type = 6;//鍗峰笜
+ }
+ else if (device.Type == DeviceType.Thermostat)
+ {
+ type = 7;
+ }
+ else if (device.Type == DeviceType.FreshAir)
+ {
+ type = 9;
+ }
+
+ return type;
+ }
+
+ /// <summary>
+ /// 灏嗛�変腑鐨勬暟鎹坊鍔犲埌涓存椂鏁版嵁鍒楄〃涓紝渚夸簬鍚庢湡鐨�"淇濆瓨"
+ /// </summary>
+ private void AddData(SmartSound.Room room)
+ {
+ if (TempDatas == null)
+ TempDatas = new List<SmartSound.Layer>();
+
+ SmartSound.Layer tempLayer = SmartSound.LocaData[CurrentIndex];
+ if (tempLayer == null) return;
+
+
+
+ #region 娣诲姞妤煎眰
+
+ bool floor_exists = false;
+ // 杩囨护鐩稿悓鐨勬ゼ灞�
+ for (int i = 0; i < TempDatas.Count; i++)
+ {
+ if (tempLayer.LayerID == TempDatas[i].LayerID)
+ {
+ floor_exists = true;
+ break;
+ }
+ }
+
+ if (!floor_exists)
+ {
+ tempLayer.RoomList.Clear();
+ TempDatas.Add(tempLayer);
+ }
+
+
+ #endregion
+
+ #region 娣诲姞鎴块棿
+
+ for (int i = 0; i < TempDatas.Count; i++)
+ {
+ if (SmartSound.LocaData[CurrentIndex].LayerID != TempDatas[i].LayerID)
+ continue;
+
+ bool room_exists = false;
+
+ for (int n = 0; n < TempDatas[i].RoomList.Count; n++)
+ {
+ if (room.RoomID == TempDatas[i].RoomList[n].RoomID)
+ {
+ room_exists = true;
+ break;
+ }
+ }
+
+ if (!room_exists)
+ {
+ TempDatas[i].RoomList.Add(room);
+ CheckedAll(room);//娣诲姞鎴块棿鎴愬姛锛岄粯璁ら�変腑鎵�鏈夎澶�
+ break;
+ }
+ }
+
+ #endregion
+
+ }
+
+ private void RemoveData(SmartSound.Room room)
+ {
+ try
+ {
+ for (int i = 0; i < TempDatas.Count; i++)
+ {
+
+ for (int j = 0; j < TempDatas[i].RoomList.Count; j++)
+ {
+ if (TempDatas[i].RoomList[j].RoomID == room.RoomID)
+ {
+ TempDatas[i].RoomList.RemoveAt(j);
+ }
+ }
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 榛樿閫夋嫨鎵�鏈夎澶�
+ /// </summary>
+ /// <param name="room"></param>
+ private void CheckedAll(SmartSound.Room room)
+ {
+ // 鏍囪鎵�鏈夊満鏅�
+ for (int n = 0; n < room.SceneList.Count; n++)
+ {
+ SmartSound.Scene _scene = room.SceneList[n];
+ _scene.Checked = true;
+ }
+
+ //鏍囪鎵�鏈夎澶�
+ for (int k = 0; k < room.DeviceList.Count; k++)
+ {
+
+ SmartSound.Device _device = room.DeviceList[k];
+ _device.Checked = true;
+ }
+ }
+
+ /// <summary>
+ /// 閲嶆柊鏁寸悊鏁版嵁锛屾妸娌℃湁閫変腑鐨勬暟鎹兘鍓旈櫎鎺�
+ /// </summary>
+ private List<SmartSound.Layer> CollateData()
+ {
+ try
+ {
+ //绉诲嚭鏈�変腑鐨勮澶囥�佸満鏅�
+ for (int i = 0; i < TempDatas.Count; i++)
+ {
+ SmartSound.Layer _layer = TempDatas[i];
+
+ for (int j = 0; j < _layer.RoomList.Count; j++)
+ {
+ SmartSound.Room _room = _layer.RoomList[j];
+ if (_room.Checked)
+ {
+ #region 娓呴櫎鏈�変腑鐨勮澶�
+ for (int k = 0; k < _room.DeviceList.Count; k++)
+ {
+ SmartSound.Device _device = _room.DeviceList[k];
+ if (!_device.Checked)
+ {
+ _room.DeviceList.Remove(_device);
+ }
+ }
+ #endregion
+
+ #region 娓呴櫎鏈�変腑鐨勫満鏅�
+ for (int n = 0; n < _room.SceneList.Count; n++)
+ {
+ SmartSound.Scene _scene = _room.SceneList[n];
+ if (!_scene.Checked)
+ {
+ _room.SceneList.Remove(_scene);
+ }
+ }
+ #endregion
+ }
+ else
+ {
+ _layer.RoomList.Remove(_room);
+ }
+ }
+ }
+
+ //绉诲嚭娌℃湁璁惧鐨勬埧闂�
+ for (int j = 0; j < TempDatas.Count; j++)
+ {
+ SmartSound.Layer _layer = TempDatas[j];
+ if (_layer.RoomList.Count < 1)
+ {
+ TempDatas.Remove(_layer);
+ }
+ }
+ }
+ catch { }
+
+ return TempDatas;
+ }
+
+ #region 鈻� 鑷畾涔夋ゼ灞傞�夋嫨鎺т欢_____________________
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ private class MyPullControl : FrameRowControl
+ {
+
+ private SmartSoundControlContentForm smartSoundDataAdd = null;
+ private List<SmartSound.Layer> Layers = null;
+ /// <summary>
+ /// 鎴块棿鍒楄〃
+ /// </summary>
+ private NormalViewControl btnName = null;
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ public MyPullControl(SmartSoundControlContentForm _SmartSoundDataAdd,List<SmartSound.Layer> _layers)
+ {
+ this.smartSoundDataAdd = _SmartSoundDataAdd;
+ this.Layers = _layers;
+ this.UseClickStatu = false;
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(173);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ //鏄剧ず鏂囨湰
+ btnName = this.AddLeftCaption(string.Empty, 700);
+ btnName.Height = Application.GetRealHeight(60);
+ btnName.TextSize = 17;
+ btnName.Y = Application.GetRealHeight(57);
+ btnName.Text = "鎴块棿鍒楄〃";
+
+ var right_icon=this.AddRightArrow();
+ right_icon.SelectedImagePath = "SmartSound/PullDown.png";
+ right_icon.UnSelectedImagePath = "SmartSound/PullDown.png";
+ right_icon.ButtonClickEvent += (sender, e) =>
+ {
+ ShowPullList();
+ };
+
+ var layout = this.AddMostRightView(Layers[smartSoundDataAdd.CurrentIndex].LayerName, 300, false);
+ layout.Name = "pullLayout";
+ layout.ButtonClickEvent += (sender, e) =>
+ {
+ ShowPullList();
+ };
+
+ if (Layers.Count == 1)
+ {
+ right_icon.Visible = false;
+ layout.Visible = false;
+ }
+
+ }
+
+ private void ShowPullList()
+ {
+ //鎴块棿鍒楄〃琛寋鎴块棿鍒楄〃 textView锛屾ゼ灞備笅鎷夌獥}
+ //鏄剧ず鎴块棿{甯﹂�夋嫨妗嗙殑锛涘綋閫変腑浜嗘埧闂村悗闇�瑕佸湪搴曢儴寮瑰嚭纭鎸夐挳锛岀偣鍑荤‘璁よ烦杞埌鏂扮殑鐣岄潰}
+ var pull_frame = new TopRightMenuControl(Layers.Count, 2);
+ pull_frame.Y = this.Height;
+
+ for (int i = 0; i < Layers.Count; i++)
+ {
+ //鍒涘缓妤煎眰
+ pull_frame.AddRowMenu(Layers[i].LayerName, "Item/CreatFloor.png", "Item/CreatFloorSelected.png", () =>
+ {
+ smartSoundDataAdd.CurrentIndex = i;
+ smartSoundDataAdd.LoadAllRoomListView();
+ });
+ }
+ }
+ }
+ #endregion
+
+ #region 鈻� 鑷畾涔夋埧闂撮�夋嫨鎺т欢_____________________
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ private class RoomRowLayout : FrameRowControl
+ {
+ private SmartSoundControlContentForm smartSoundControlContentForm = null;
+
+ private SmartSound.Room mRoom = null;
+ /// <summary>
+ /// 鎴块棿鍚嶇О
+ /// </summary>
+ private NormalViewControl btnName = null;
+
+ private IconViewControl Right_icon = null;
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ public RoomRowLayout(SmartSoundControlContentForm _smartSoundControlContentForm,SmartSound.Room _room)
+ {
+ this.smartSoundControlContentForm = _smartSoundControlContentForm;
+ this.mRoom = _room;
+ this.UseClickStatu = false;
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(170);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ //鏄剧ず鏂囨湰
+ btnName = this.AddLeftCaption(string.Empty, 2000);
+ btnName.Height = Application.GetRealHeight(60);
+ btnName.TextSize = 17;
+ btnName.Y = Application.GetRealHeight(57);
+ btnName.Text = mRoom.RoomName;
+ Right_icon = this.AddRightArrow();
+ Right_icon.Width = Application.GetRealWidth(115);
+ Right_icon.Height = Application.GetRealHeight(115);
+ Right_icon.Gravity = Gravity.CenterVertical;
+ Right_icon.X = Right_icon.X - Application.GetRealWidth(60);
+
+ btnName.ButtonClickEvent += (sender, e) =>
+ {
+ mRoom.Checked = true;
+ RefreshRightIconState(mRoom.Checked);
+ SmartSoundContentForDevice deviceForm = new SmartSoundContentForDevice(mRoom);
+ deviceForm.AddForm();
+ };
+
+ this.Right_icon.ButtonClickEvent += (sender, e) =>
+ {
+ mRoom.Checked = !mRoom.Checked;
+ RefreshRightIconState(mRoom.Checked);
+ };
+
+ RefreshRightIconState(mRoom.Checked);
+ AddBottomLine();
+
+ }
+
+ private void RefreshRightIconState(bool bol = false)
+ {
+ try
+ {
+ if (bol)
+ {
+ Right_icon.SelectedImagePath = "SmartSound/CheckBoxSel.png";
+ Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxSel.png";
+
+ smartSoundControlContentForm.AddData(mRoom);
+ }
+ else
+ {
+ Right_icon.SelectedImagePath = "SmartSound/CheckBoxDef.png";
+ Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxDef.png";
+
+ smartSoundControlContentForm.RemoveData(mRoom);
+ }
+
+ bool isShow = false;
+
+ if(smartSoundControlContentForm==null) return;
+
+ foreach (SmartSound.Room _room in SmartSound.LocaData[smartSoundControlContentForm.CurrentIndex].RoomList)
+ {
+ if (_room.Checked)
+ {
+ isShow = true;
+ break;
+ }
+ }
+
+ smartSoundControlContentForm.bottomClickButton.Visible = isShow;
+ }
+ catch(Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ }
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlForm.cs b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlForm.cs
new file mode 100755
index 0000000..b352d26
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundControlForm.cs
@@ -0,0 +1,385 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Shared.Common;
+using Shared.Phone.UserCenter.SmartSound.Forms;
+using Shared.Phone.UserCenter.SmartSound.Util;
+using Shared.Phone.UserCenter.SmartSound.Widget;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.SmartSound
+{
+
+ public class SmartSoundControlForm : EditorCommonForm
+ {
+
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalListControl listView = null;
+ private FrameLayout contentLayout = null;
+ public int CurrentIndex = 0;
+ private MostRightIconControl btnAddDeviceIcon = null;
+ /// <summary>
+ /// 鏅鸿兘闊崇鏁版嵁
+ /// </summary>
+ private static SmartSoundInfo.SoundInfo mSoundInfo = null;
+
+ public SmartSoundControlForm(SmartSoundInfo.SoundInfo soundInfo)
+ {
+ mSoundInfo = soundInfo;
+ }
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText("璇煶鎺у埗");
+
+ //鍙充笂娣诲姞鎸夐挳
+ if (btnAddDeviceIcon == null)
+ {
+ btnAddDeviceIcon = new MostRightIconControl(69, 69);
+ btnAddDeviceIcon.UnSelectedImagePath = "Item/Add.png";
+ topFrameLayout.AddChidren(btnAddDeviceIcon);
+ btnAddDeviceIcon.InitControl();
+ btnAddDeviceIcon.ButtonClickEvent += (sender, e) =>
+ {
+ var smartSoundDataAdd = new SmartSoundControlContentForm(mSoundInfo);
+ smartSoundDataAdd.AddForm();
+ };
+ }
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ }
+
+ private void InitMiddleFrame()
+ {
+ this.ClearBodyFrame();
+
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+ this.ShowProgressBar();
+
+ string json = await GetData();//鑾峰彇鏁版嵁
+ SmartSoundDataInfo dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<SmartSoundDataInfo>(json);
+ if (dataInfo != null)
+ {
+ if (dataInfo.StateCode == "SUCCESS")
+ {
+ SmartSound.getInstantiate().LayerList = dataInfo.ResponseData.LayerList;
+ SmartSound.getInstantiate().TokenID = mSoundInfo.Id;
+ SmartSound.getInstantiate().UserID = mSoundInfo.UserID;
+ }
+ }
+
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ if (SmartSound.getInstantiate().LayerList == null || SmartSound.getInstantiate().LayerList.Count < 1)
+ {
+ this.CloseProgressBar();
+ return;
+ }
+
+ contentLayout = new FrameLayout();
+ this.bodyFrameLayout.AddChidren(contentLayout);
+ contentLayout.RemoveAll();
+
+ var pullLayout = new MyPullControl(this, SmartSound.getInstantiate().LayerList);
+ contentLayout.AddChidren(pullLayout);
+ pullLayout.InitControl();
+
+ LoadAllRoomListView();
+
+ //鏃犳暟鎹殑鏃跺�欒鍋氫竴涓彁绀�
+ {
+ bool bol = false;
+ for (int i = 0; i < SmartSound.getInstantiate().LayerList.Count; i++)
+ {
+ if (SmartSound.getInstantiate().LayerList[i].RoomList.Count > 0)
+ {
+ bol = true;
+ break;
+ }
+ }
+
+ if (!bol)
+ {
+ pullLayout.Visible = false;
+ this.ShowNotDataImage(this.bodyFrameLayout, new string[] { "杩樻病鏈夋帶鍒跺唴瀹瑰摝锛�", "鐐瑰嚮\"+\"娣诲姞" });
+ }
+ }
+
+ this.CloseProgressBar();
+
+ });
+ });
+ }
+
+ /// <summary>
+ /// 鍔犺浇鎴块棿鍒楄〃
+ /// </summary>
+ private void LoadAllRoomListView()
+ {
+ try
+ {
+ if (SmartSound.getInstantiate().LayerList == null || SmartSound.getInstantiate().LayerList.Count < 1)
+ return;
+
+ // 鍔犺浇褰撳墠妤煎眰鐨勬墍鏈夋埧闂� ListView
+ if (listView == null)
+ {
+ listView = new VerticalListControl();
+ contentLayout.AddChidren(listView);
+ listView.Y = Application.GetRealHeight(173);
+ listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(173);
+
+ }
+ else if (listView.Parent == null)
+ {
+ listView = new VerticalListControl();
+ contentLayout.AddChidren(listView);
+ listView.Y = Application.GetRealHeight(173);
+ listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(173);
+ }
+
+ listView.RemoveAll();
+
+ SmartSound.Layer layer = SmartSound.getInstantiate().LayerList[CurrentIndex];
+
+ foreach (SmartSound.Room room in layer.RoomList)
+ {
+ var roomRowLayout = new RoomRowLayout(this, room);
+ listView.AddChidren(roomRowLayout);
+ roomRowLayout.InitControl();
+
+ roomRowLayout.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ // 鐐瑰嚮鎴块棿锛岃繘鍏ラ�夋嫨璁惧鐣岄潰
+ var deviceChange = new SmartSoundContentForDeviceChange(room);
+ deviceChange.AddForm();
+ };
+
+ roomRowLayout.btnDelect.ButtonClickEvent += (sender, e) =>
+ {
+ var delBtn = sender as NormalViewControl;
+ DelectRoom(delBtn);
+ };
+ }
+ }
+ catch (Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ private void DelectRoom(NormalViewControl delBtn)
+ {
+ this.ShowMassage(ShowMsgType.Confirm, "纭鍒犻櫎璇ユ埧闂寸殑鎺у埗鍐呭锛�", async () =>
+ {
+
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+
+ this.ShowProgressBar("姝e湪鍒犻櫎鏁版嵁....");
+ //鍒犻櫎鎴块棿
+ var tag = (SmartSound.Room)delBtn.GetTagByKey("obj");
+
+ if (SmartSound.getInstantiate().LayerList == null)
+ return;
+
+ for (int i = 0; i < SmartSound.getInstantiate().LayerList.Count; i++)
+ {
+ SmartSound.Layer _layer = SmartSound.getInstantiate().LayerList[i];
+
+ for (int j = 0; j < _layer.RoomList.Count; j++)
+ {
+ SmartSound.Room _room = _layer.RoomList[j];
+
+ if (_room.RoomName == tag.RoomName)
+ {
+ _layer.RoomList.Remove(_room);
+ }
+ }
+ }
+
+ // 閲嶆柊涓婁紶鏁版嵁
+ string json = await postBatchEdit();
+
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ //this.InitMiddleFrame();
+ this.LoadAllRoomListView();
+ });
+ this.CloseProgressBar();
+ });
+
+ }, Language.StringByID(R.MyInternationalizationString.OkMsg));
+ }
+
+ private async Task<string> GetData()
+ {
+ // 浠庢湇鍔″櫒鑾峰彇鏁版嵁
+ string url = string.Format("https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit?Platform&UserID={0}&TokenID={1}", mSoundInfo.UserID, mSoundInfo.Id);
+ return await MyHttpWebResponse.GetWebRequest(url);
+ }
+
+ private async Task<string> postBatchEdit()
+ {
+ // 鎻愪氦鏁版嵁鑷虫湇鍔″櫒
+ string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit";
+ string json = Newtonsoft.Json.JsonConvert.SerializeObject(SmartSound.getInstantiate());
+ string response_str = await MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
+ return response_str;
+ }
+
+ public override int FormActionAgainEvent()
+ {
+ ShowForm();
+ return base.FormActionAgainEvent();
+ }
+
+ #region 鈻� 鑷畾涔夋ゼ灞傞�夋嫨鎺т欢_____________________
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ private class MyPullControl : FrameRowControl
+ {
+
+ private SmartSoundControlForm smartSoundControlData = null;
+ private List<SmartSound.Layer> Layers = null;
+ /// <summary>
+ /// 鎴块棿鍒楄〃
+ /// </summary>
+ private NormalViewControl btnName = null;
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃琛�
+ /// </summary>
+ public MyPullControl(SmartSoundControlForm _SmartSoundDataAdd, List<SmartSound.Layer> _layers)
+ {
+ this.smartSoundControlData = _SmartSoundDataAdd;
+ this.Layers = _layers;
+ this.UseClickStatu = false;
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(173);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ try
+ {
+ //鏄剧ず鏂囨湰
+ btnName = this.AddLeftCaption(string.Empty, 700);
+ btnName.Height = Application.GetRealHeight(60);
+ btnName.TextSize = 17;
+ btnName.Y = Application.GetRealHeight(57);
+ btnName.Text = "鎴块棿鍒楄〃";
+
+ var right_icon = this.AddRightArrow();
+ right_icon.SelectedImagePath = "SmartSound/PullDown.png";
+ right_icon.UnSelectedImagePath = "SmartSound/PullDown.png";
+ right_icon.ButtonClickEvent += (sender, e) =>
+ {
+ ShowPullList();
+ };
+
+ var layout = this.AddMostRightView(Layers[smartSoundControlData.CurrentIndex].LayerName, 300, false);
+ layout.Name = "pullLayout";
+ layout.ButtonClickEvent += (sender, e) =>
+ {
+ ShowPullList();
+ };
+
+ if (SmartSound.getInstantiate().LayerList.Count < 2)
+ {
+ right_icon.Visible = false;
+ layout.Visible = false;
+ }
+ }
+ catch(Exception e)
+ {
+ string error = e.Message;
+ }
+ }
+
+ private void ShowPullList()
+ {
+ //鎴块棿鍒楄〃琛寋鎴块棿鍒楄〃 textView锛屾ゼ灞備笅鎷夌獥}
+ //鏄剧ず鎴块棿{甯﹂�夋嫨妗嗙殑锛涘綋閫変腑浜嗘埧闂村悗闇�瑕佸湪搴曢儴寮瑰嚭纭鎸夐挳锛岀偣鍑荤‘璁よ烦杞埌鏂扮殑鐣岄潰}
+ var pull_frame = new TopRightMenuControl(Layers.Count, 2);
+ pull_frame.Y = this.Height;
+
+ for (int i = 0; i < Layers.Count; i++)
+ {
+ //鍒涘缓妤煎眰
+ pull_frame.AddRowMenu(Layers[i].LayerName, "Item/CreatFloor.png", "Item/CreatFloorSelected.png", () =>
+ {
+ smartSoundControlData.CurrentIndex = i;
+ smartSoundControlData.LoadAllRoomListView();
+ });
+ }
+ }
+ }
+ #endregion
+
+ #region 鈻� 鑷畾涔夋櫤鑳介煶绠辨帶浠禵____________________
+
+ /// <summary>
+ /// 璇煶鎺у埗鎴块棿琛�
+ /// </summary>
+ private class RoomRowLayout : RowLayoutControl
+ {
+
+ /// <summary>
+ /// 鎴块棿鍚嶅瓧
+ /// </summary>
+ private NormalViewControl btnName = null;
+
+ /// <summary>
+ /// 鍒犻櫎鎸夐挳
+ /// </summary>
+ public NormalViewControl btnDelect = null;
+
+ private SmartSoundControlForm smartSoundControlForm;
+ private SmartSound.Room room;
+
+ /// <summary>
+ /// 鑷畾闊崇鍏虫帶浠�
+ /// </summary>
+ public RoomRowLayout(SmartSoundControlForm _smartSoundControlForm, SmartSound.Room _room)
+ {
+ this.smartSoundControlForm = _smartSoundControlForm;
+ this.room = _room;
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(173);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧唴閮ㄦ帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ //璁惧
+ frameTable.AddLeftCaption(this.room.RoomName, 800);
+ frameTable.AddRightArrow();
+ //搴曠嚎
+ frameTable.AddBottomLine();
+
+ btnDelect = base.AddDeleteControl();
+ btnDelect.Text = "鍒犻櫎";
+ btnDelect.AddTag("obj", room);
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundListForm.cs b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundListForm.cs
new file mode 100755
index 0000000..54f2151
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundListForm.cs
@@ -0,0 +1,305 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+using Shared.Common;
+using Shared.Phone.UserCenter.Device;
+using Shared.Phone.UserCenter.SmartSound.Util;
+using Shared.Phone.UserCenter.SmartSound.Widget;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.SmartSound
+{
+ //鏅鸿兘闊崇鍒楄〃鐣岄潰
+ public class SmartSoundListForm : EditorCommonForm
+ {
+ public SmartSoundListForm()
+ {
+ }
+
+ private SmartSoundInfo smartSoundInfo = null;
+
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalListRefreshControl listView = null;
+ /// <summary>
+ /// 鍓嶄竴娆℃樉绀哄嚭宸︽粦鑿滃崟鐨凴owLayout
+ /// </summary>
+ private RowLayoutControl oldShowRightMuneRow = null;
+
+ private static string dataString = "";
+
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+
+ this.ScrollEnabled = false;
+
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText("鏅鸿兘闊崇");
+ Dictionary<string, string> floorDictionary = Config.Instance.Home.FloorDics;//妤煎眰鍒楄〃
+
+ var helpBtn = new MyButton();
+ helpBtn.TextColor = UserCenterColor.Current.TextOrangeColor;
+ helpBtn.Text = "甯姪";
+ helpBtn.Gravity = Gravity.CenterRight;
+ helpBtn.TextAlignment = TextAlignment.CenterRight;
+ topFrameLayout.AddChidren(helpBtn);
+ helpBtn.X -= Application.GetRealWidth(58);
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+
+ helpBtn.MouseUpEventHandler += (sernder, e) =>
+ {
+ //鐢熸垚涓�涓脊绐楃敾闈�
+ var dialogForm = new TextDialog("缁戝畾鏅鸿兘闊崇鍒扮涓夋柟 APP 杩涜鎿嶄綔", "璺宠浆鑷冲皬搴�");
+ dialogForm.SetTitleText("甯姪");
+
+ //鎸変笅纭鎸夐挳
+ dialogForm.ComfirmClickEvent += () =>
+ {
+ //鐢婚潰鍏抽棴
+ dialogForm.CloseDialog();
+ };
+ };
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄦ帶浠�(澶栭儴鍙互璋冪敤)
+ /// </summary>
+ /// <param name="i_reGetDeviceOnlineStatu">閲嶆柊鑾峰彇璁惧鐨勫湪绾跨姸鎬�</param>
+ public void InitMiddleFrame()
+ {
+ this.ClearBodyFrame();
+
+ var frame = new FrameLayout();
+ this.bodyFrameLayout.AddChidren(frame);
+ frame.BackgroundColor = UserCenterColor.Current.White;
+ frame.Y = 0;
+ frame.Height = this.bodyFrameLayout.Height;
+
+ // 鍒濆鍖� lisetView
+ listView = new VerticalListRefreshControl(29);
+ listView.Y = 0;
+ listView.Height = bodyFrameLayout.Height;
+ frame.AddChidren(listView);
+ listView.BeginHeaderRefreshingAction += () =>
+ {
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //闅愯棌涓嬫媺鍒锋柊鐗规晥
+ listView.EndHeaderRefreshing();
+ this.InitMiddleFrame();
+ });
+ });
+ };
+
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+ this.ShowProgressBar();
+ await getData();
+
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ iniView();
+
+ if (smartSoundInfo == null || smartSoundInfo.ResponseData == null || smartSoundInfo.ResponseData.RowCount == 0)
+ {
+ // show鍑烘病鏈夎澶囩殑鍥炬爣鏂囧瓧鎻愮ず
+ this.ShowNotDataImage(bodyFrameLayout, new string[] { "杩樻病鏈夐煶绠卞摝锛�", "缁戝畾鏅鸿兘闊崇璇峰墠寰�绗笁鏂� APP 杩涜鎿嶄綔" });
+ }
+
+ this.CloseProgressBar();
+ });
+ });
+ }
+
+ /// <summary>
+ /// 鑾峰彇闊崇鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ private async Task getData()
+ {
+ //SmartSoundInfo.Auth auth = new SmartSoundInfo.Auth();
+ //auth.HomeID = Common.Config.Instance.Home.Id;
+ //auth.UserID = Common.Config.Instance.Guid;
+ //auth.Platform = "";
+ string url = string.Format("https://developer.hdlcontrol.com/zigbeespeakerservice/Auth?Platform&PageSetting.PageSize=100&PageSetting.PageIndex=1&UserID={0}&HomeID={1}",
+ Common.Config.Instance.Guid,Common.Config.Instance.Home.Id);
+
+ dataString = await MyHttpWebResponse.GetWebRequest(url);
+
+ smartSoundInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<SmartSoundInfo>(dataString);
+
+ }
+
+ /// <summary>
+ /// 璁剧疆澶囨敞
+ /// </summary>
+ /// <param name="soundInfo"></param>
+ /// <param name="new_remark"></param>
+ /// <returns></returns>
+ private async Task<string> setRemark(SmartSoundInfo.SoundInfo soundInfo, string new_remark)
+ {
+
+ if (soundInfo == null)
+ return "";
+
+ string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/Auth";
+ string json = "{" +
+ "\"AuthID\":" + "\"" + soundInfo.Id + "\"" + "," +
+ "\"Remark\":" + "\"" + new_remark + "\"" + "," +
+ "\"UserID\":" + "\"" + soundInfo.UserID + "\"" + "," +
+ "\"HomeID\":" + "\"" + soundInfo.HomeID + "\"" + "}";
+
+ string response_str = await MyHttpWebResponse.PutWebRequest(url, json, Encoding.UTF8);
+ JObject jObject = JObject.Parse(response_str);
+
+ return jObject["StateCode"].ToString();
+ }
+
+ private void iniView()
+ {
+ //
+ listView.RemoveAll();
+
+ if (smartSoundInfo == null)
+ return;
+
+ for (int i = 0; i < smartSoundInfo.ResponseData.Data.Count; i++)
+ {
+ //
+ var smartSound = smartSoundInfo.ResponseData.Data[i];
+ var row = new SoundRowLayout();
+ listView.AddChidren(row);
+
+ if (smartSound.Platform == "Baidu")
+ {
+ row.Account = "灏忓害锛�" + smartSound.UserName;
+ row.ImagePath = "SmartSound/Xiaodu.png";
+ row.Remark = smartSound.Remark;
+ }
+
+ row.InitControl();
+ row.btnDelect.AddTag("index", i);
+ row.btnRename.AddTag("index", i);
+ row.frameTable.AddTag("index", i);
+
+ //閲嶅懡鍚�
+ row.btnRename.ButtonClickEvent += (sender, e) =>
+ {
+ int index = (int)((NormalViewControl)sender).GetTagByKey("index");
+ var smartSound1 = smartSoundInfo.ResponseData.Data[index];
+ ShowRenameDialog(row, smartSound1);
+ };
+
+ // 瑙i櫎缁戝畾
+ row.btnDelect.ButtonClickEvent += (sender, e) =>
+ {
+ int index = (int)(((NormalViewControl)sender).GetTagByKey("index"));
+ ShowDelectDialog(index);
+ };
+
+ //璺宠浆鍒版帶鍒跺唴瀹圭晫闈� FrameRowControl
+ row.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ int index = (int)row.frameTable.GetTagByKey("index");
+ if (SmartSound.getInstantiate().LayerList != null)
+ SmartSound.getInstantiate().LayerList.Clear();
+
+ var smartSoundControlForm = new SmartSoundControlForm(smartSoundInfo.ResponseData.Data[index]);
+ smartSoundControlForm.AddForm();
+ };
+ }
+ }
+
+ /// <summary>
+ /// 瑙i櫎缁戝畾寮圭獥
+ /// </summary>
+ private void ShowDelectDialog(int index)
+ {
+ //鐢熸垚涓�涓脊绐楃敾闈�
+ var dialogForm = new TextDialog("瑙i櫎缁戝畾闇�瑕佸埌绗笁鏂� APP 杩涜鎿嶄綔", "璺宠浆鑷冲皬搴�");
+ dialogForm.SetTitleText("瑙i櫎缁戝畾");
+
+ //鎸変笅纭鎸夐挳
+ dialogForm.ComfirmClickEvent += () =>
+ {
+ //鐢婚潰鍏抽棴
+ dialogForm.CloseDialog();
+ };
+ }
+ /// <summary>
+ /// 閲嶅懡鍚嶅脊绐�
+ /// </summary>
+ /// <returns></returns>
+ private void ShowRenameDialog(SoundRowLayout soundRowLayout, SmartSoundInfo.SoundInfo smartSound)
+ {
+ //鐢熸垚涓�涓脊绐楃敾闈�
+ var dialogForm = new DialogInputControl();
+ //娣诲姞澶囦唤
+ dialogForm.SetTitleText("閲嶅懡鍚�");
+ //璇疯緭鍏ュ浠藉悕绉�
+ dialogForm.SetTipText(smartSound.Remark);
+
+ //鎸変笅纭鎸夐挳
+ dialogForm.ComfirmClickEvent += (async (textValue) =>
+ {
+
+ //鐢婚潰鍏抽棴
+ dialogForm.CloseDialog();
+
+ string remark = textValue;
+ string str = await setRemark(smartSound, remark); //涓婁紶澶囦唤
+ if (str == "SUCCESS")
+ {
+ smartSound.Remark = remark;
+ soundRowLayout.btnRemark.Text = textValue;
+ }
+ else
+ {
+ //閿欒寮圭獥鎻愮ず
+ ShowMassage(ShowMsgType.Tip, "淇敼澶囨敞涓嶆垚鍔燂紒", null, "纭");
+ }
+ });
+ }
+
+ #endregion
+
+
+ #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________
+
+ /// <summary>
+ /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠�
+ /// </summary>
+ public override int FormActionAgainEvent()
+ {
+ return 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鍏抽棴鐣岄潰___________________________
+
+ /// <summary>
+ /// 鐢婚潰鍏抽棴
+ /// </summary>
+ public override void CloseFormBefore()
+ {
+ base.CloseFormBefore();
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/SmartSound.cs b/ZigbeeApp/Shared/Phone/SmartSound/SmartSound.cs
new file mode 100755
index 0000000..192a1db
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/SmartSound.cs
@@ -0,0 +1,90 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+namespace Shared.Phone.UserCenter.SmartSound
+{
+ public class SmartSound
+ {
+
+ /// <summary>
+ /// 鏈湴鎵�鏈夌殑鏁版嵁
+ /// </summary>
+ public static List<Layer> LocaData = new List<Layer>();
+ /// <summary>
+ /// 褰撳墠浣跨敤鐨勬暟鎹�(鏈嶅姟鍣ㄥ悓姝ヤ笅鏉ョ殑鏁版嵁/褰撳墠琚�変腑鐨勬暟鎹�)
+ /// </summary>
+ public List<Layer> LayerList = new List<Layer>();
+
+ public SmartSound()
+ {
+ }
+
+ private static SmartSound smartSound = null;
+ public string UserID;
+ public string TokenID;
+
+ public static SmartSound getInstantiate()
+ {
+ if (smartSound == null)
+ smartSound = new SmartSound();
+
+ return smartSound;
+ }
+
+ public class Layer
+ {
+ public string LayerID;
+ public string LayerName;
+ public List<Room> RoomList = new List<Room>();
+ }
+
+ public class Room
+ {
+ /// <summary>
+ /// 閫変腑鐨勬埧闂�
+ /// </summary>
+ public bool Checked = false;
+ public string RoomID;
+ public string RoomName;
+ public List<Device> DeviceList = new List<Device>();
+ public List<Scene> SceneList = new List<Scene>();
+ }
+
+ public class Device
+ {
+ /// <summary>
+ /// 閫変腑鐨勮澶�
+ /// </summary>
+ public bool Checked = false;
+ //public string Id;
+ public string DeviceAddress;
+ public int Epoint;
+ //public int ClusterID;
+ public string DeviceName;
+ public string NicksName;
+ public string GatewayID;
+ /// <summary>
+ /// 1=寮�鍏崇伅锛�2=璋冨厜鐏紝3=RGB 鐏紝4=绐楀笜妯″潡锛�5=寮�鍚堝笜锛�6=鍗峰笜锛�7=绌鸿皟锛�8=闈㈡澘锛�9=鏂伴
+ /// </summary>
+ public int DeviceType;
+ //public string RoomID;
+ }
+
+ public class Scene
+ {
+ /// <summary>
+ /// 閫変腑鐨勫満鏅�
+ /// </summary>
+ public bool Checked = false;
+ //public string Id;
+ public string SceneName;
+ public int SceneID;
+ public int DelayTime;
+ //public int ClusterID;
+ public string NicksName;
+ //public string RoomID;
+ public string GatewayID;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/SmartSoundDataInfo.cs b/ZigbeeApp/Shared/Phone/SmartSound/SmartSoundDataInfo.cs
new file mode 100755
index 0000000..dd87af7
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/SmartSoundDataInfo.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+namespace Shared.Phone.UserCenter.SmartSound
+{
+ public class SmartSoundDataInfo
+ {
+ public SmartSoundDataInfo()
+ {
+ }
+
+ public string StateCode { get; set; }
+ public string ErrorInfo { get; set; }
+ public Info ResponseData { get; set; }
+
+ public class Info
+ {
+ public List<SmartSound.Layer> LayerList { get; set; }
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/SmartSoundInfo.cs b/ZigbeeApp/Shared/Phone/SmartSound/SmartSoundInfo.cs
new file mode 100755
index 0000000..631c349
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/SmartSoundInfo.cs
@@ -0,0 +1,74 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+namespace Shared.Phone.UserCenter.SmartSound
+{
+ /// <summary>
+ /// 鏅鸿兘闊崇绫伙紝灏忓害銆佸皬鐖便�佸ぉ鐚簿鐏甸�氱敤姝ょ被
+ /// </summary>
+ public class SmartSoundInfo
+ {
+
+ public SmartSoundInfo()
+ {
+ }
+
+ public string StateCode { get; set; }
+ public string ErrorInfo { get; set; }
+ public Info ResponseData { get; set; }
+
+ public class Info
+ {
+ public int PageSize { get; set; }
+ public int PageIndex { get; set; }
+ public int RowCount { get; set; }
+ public int PageTotal { get; set; }
+ public List<SoundInfo> Data { get; set; }
+ }
+
+ public class SoundInfo
+ {
+ public string UserID { get; set; }
+ public string AuthCode { get; set; }
+ public string Token { get; set; }
+ public string RefreshToken { get; set; }
+ /// <summary>
+ /// Baidu
+ /// </summary>
+ public string Platform { get; set; }
+ public string HomeID { get; set; }
+ public string OpenUID { get; set; }
+ /// <summary>
+ /// 鏅鸿兘闊崇澶囨敞
+ /// </summary>
+ public string Remark { get; set; }
+ public string Id { get; set; }
+ public bool IsDeleted { get; set; }
+ public string CreatedOnUtc { get; set; }
+ /// <summary>
+ /// 鏅鸿兘闊崇鐨勭敤鎴峰悕锛堝皬搴︼細123456@qq.com锛�
+ /// </summary>
+ public string UserName { get; set; } = "123456@qq.com";
+ }
+
+ public class Auth
+ {
+ public string Platform { get; set; }
+ public string UserID { get; set; }
+ public string HomeID { get; set; }
+
+ public PageSetting PageSetting { get; set; }
+ public Auth()
+ {
+ this.PageSetting = new PageSetting();
+ }
+
+ }
+
+ public class PageSetting
+ {
+ public int PageSize { get; set; } = 100;
+ public int PageIndex { get; set; } = 1;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Util/MyHttpWebResponse.cs b/ZigbeeApp/Shared/Phone/SmartSound/Util/MyHttpWebResponse.cs
new file mode 100755
index 0000000..7548a3c
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Util/MyHttpWebResponse.cs
@@ -0,0 +1,125 @@
+锘縰sing System;
+using System.IO;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Shared.Phone.UserCenter.SmartSound.Util
+{
+ public class MyHttpWebResponse
+ {
+ public MyHttpWebResponse()
+ {
+ }
+
+ /// <summary>
+ /// Get鏁版嵁鎺ュ彛
+ /// </summary>
+ /// <param name="getUrl">鎺ュ彛鍦板潃</param>
+ /// <returns></returns>
+ public async static Task<string> GetWebRequest(string getUrl)
+ {
+
+ string responseContent = "";
+
+ try
+ {
+
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(getUrl);
+ request.ContentType = "application/json";
+ request.Method = "GET";
+
+ HttpWebResponse response = (HttpWebResponse)request.GetResponse();
+ //鍦ㄨ繖閲屽鎺ユ敹鍒扮殑椤甸潰鍐呭杩涜澶勭悊
+ using (Stream resStream = response.GetResponseStream())
+ {
+ using (StreamReader reader = new StreamReader(resStream, Encoding.UTF8))
+ {
+ responseContent = reader.ReadToEnd().ToString();
+ }
+ }
+ }
+ catch (Exception e) { }
+ return responseContent;
+ }
+
+ /// <summary>
+ /// Post鏁版嵁鎺ュ彛
+ /// </summary>
+ /// <param name="postUrl">鎺ュ彛鍦板潃</param>
+ /// <param name="paramData">鎻愪氦json鏁版嵁</param>
+ /// <param name="dataEncode">缂栫爜鏂瑰紡(Encoding.UTF8)</param>
+ /// <returns></returns>
+ public async static Task<string> PostWebRequest(string postUrl, string paramData, Encoding dataEncode)
+ {
+ string responseContent = string.Empty;
+ try
+ {
+ byte[] byteArray = dataEncode.GetBytes(paramData); //杞寲
+ HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(new Uri(postUrl));
+ webReq.Method = "POST";
+ webReq.ContentType = "application/json";
+ webReq.ContentLength = byteArray.Length;
+ using (Stream reqStream = webReq.GetRequestStream())
+ {
+ reqStream.Write(byteArray, 0, byteArray.Length);//鍐欏叆鍙傛暟
+ reqStream.Close();
+ }
+
+ //var ssss = webReq.GetResponse();
+
+ using (HttpWebResponse response = (HttpWebResponse)webReq.GetResponse())
+ {
+ //鍦ㄨ繖閲屽鎺ユ敹鍒扮殑椤甸潰鍐呭杩涜澶勭悊
+ using (StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
+ {
+ responseContent = sr.ReadToEnd().ToString();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ return ex.Message;
+ }
+ return responseContent;
+ }
+
+ /// <summary>
+ /// Put鏁版嵁鎺ュ彛
+ /// </summary>
+ /// <param name="postUrl">鎺ュ彛鍦板潃</param>
+ /// <param name="paramData">鎻愪氦json鏁版嵁</param>
+ /// <param name="dataEncode">缂栫爜鏂瑰紡(Encoding.UTF8)</param>
+ /// <returns></returns>
+ public async static Task<string> PutWebRequest(string postUrl, string paramData, Encoding dataEncode)
+ {
+ string responseContent = string.Empty;
+ try
+ {
+ byte[] byteArray = dataEncode.GetBytes(paramData); //杞寲
+ HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(new Uri(postUrl));
+ webReq.Method = "PUT";
+ webReq.ContentType = "application/json";
+ webReq.ContentLength = byteArray.Length;
+ using (Stream reqStream = webReq.GetRequestStream())
+ {
+ reqStream.Write(byteArray, 0, byteArray.Length);//鍐欏叆鍙傛暟
+ //reqStream.Close();
+ }
+ using (HttpWebResponse response = (HttpWebResponse)webReq.GetResponse())
+ {
+ //鍦ㄨ繖閲屽鎺ユ敹鍒扮殑椤甸潰鍐呭杩涜澶勭悊
+ using (StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.Default))
+ {
+ responseContent = sr.ReadToEnd().ToString();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ return ex.Message;
+ }
+ return responseContent;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs b/ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs
new file mode 100755
index 0000000..e9528ff
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs
@@ -0,0 +1,49 @@
+锘縰sing System;
+namespace Shared.Phone.UserCenter.SmartSound
+{
+ public class MyButton:Button
+ {
+ //榛樿瀛椾綋澶у皬
+ private float textSize = 15;
+
+ public MyButton()
+ {
+ base.TextSize = textSize;
+ }
+
+ public new float TextSize
+ {
+ get => base.TextSize;
+ set
+ {
+ textSize = value;
+ base.TextSize = textSize;
+ }
+ }
+
+ public new string Text {
+ get {
+ return base.Text;
+ }
+ set {
+ base.Text = value;
+ recalculateWidth();
+ }
+ }
+
+ public override uint BackgroundColor
+ {
+ get { return base.BackgroundColor; }
+ set
+ {
+ base.BackgroundColor = value;
+ recalculateWidth();
+ }
+ }
+
+ private void recalculateWidth() {
+
+ this.Width = this.GetTextWidth()+Application.GetRealWidth(50);
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Widget/SoundRowLayout.cs b/ZigbeeApp/Shared/Phone/SmartSound/Widget/SoundRowLayout.cs
new file mode 100755
index 0000000..d329d50
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Widget/SoundRowLayout.cs
@@ -0,0 +1,62 @@
+锘縰sing System;
+namespace Shared.Phone.UserCenter.SmartSound
+{
+ public class SoundRowLayout : RowLayoutControl
+ {
+
+ /// <summary>
+ /// 閲嶅懡鍚嶆寜閽�
+ /// </summary>
+ public NormalViewControl btnRename = null;
+ /// <summary>
+ /// 鍒犻櫎鎸夐挳
+ /// </summary>
+ public NormalViewControl btnDelect = null;
+
+ public NormalViewControl btnRemark = null;
+ /// <summary>
+ /// 鍥剧墖璺緞
+ /// </summary>
+ public string ImagePath = "SmartSound/SoundIcon.png";
+
+ /// <summary>
+ /// 鏅鸿兘闊崇璐﹀彿
+ /// </summary>
+ public string Account = "";
+ /// <summary>
+ /// 鏅鸿兘闊崇澶囨敞
+ /// </summary>
+ public string Remark = "";
+
+ public SoundRowLayout()
+ {
+ // this.Height = Application.GetRealHeight(170);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧唴閮ㄦ帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ //鍥炬爣
+ var btnIcon = frameTable.AddLeftIcon(81);
+
+ btnIcon.UnSelectedImagePath = ImagePath;
+ btnIcon.SelectedImagePath = ImagePath;
+
+ //璁惧
+ var btnAccount = frameTable.AddTopView(Account, 800);
+ //鎴块棿
+ btnRemark = frameTable.AddBottomView(Remark, 800);
+ //搴曠嚎
+ frameTable.AddBottomLine();
+
+ btnRename = base.AddEditorControl();
+ btnRename.Text = "閲嶅懡鍚�";
+
+ btnDelect = base.AddDeleteControl();
+ btnDelect.Text = "瑙i櫎缁戝畾";
+
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Widget/TextDialog.cs b/ZigbeeApp/Shared/Phone/SmartSound/Widget/TextDialog.cs
new file mode 100755
index 0000000..523da8f
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Widget/TextDialog.cs
@@ -0,0 +1,143 @@
+锘縰sing System;
+
+namespace Shared.Phone.UserCenter.SmartSound.Widget
+{
+
+ public class TextDialog : FrameLayout
+ {
+
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 纭鎸夐挳浜嬩欢
+ /// </summary>
+ public Action ComfirmClickEvent;
+
+ /// <summary>
+ /// 鏍囬鎺т欢
+ /// </summary>
+ private NormalViewControl btnTitle = null;
+ /// <summary>
+ /// 鍙栨秷鎸夐挳
+ /// </summary>
+ private BottomLeftClickButton btnCancel = null;
+ /// <summary>
+ /// 纭鎸夐挳
+ /// </summary>
+ private BottomRightClickButton btnConfirm = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="msg">鎻愮ず鍐呭</param>
+ /// <param name="btnText">纭鎸夐挳 Text</param>
+ public TextDialog(string msg,string btnText)
+ {
+ //娣诲姞鐣岄潰
+ var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
+ if (nowForm == null || (nowForm is ViewGroup) == false)
+ {
+ return;
+ }
+ this.BackgroundColor = UserCenterColor.Current.DialogBackColor;
+ ((ViewGroup)nowForm).AddChidren(this);
+
+ //鐧借壊鑳屾櫙妗�
+ var frameBack = new FrameLayout();
+ frameBack.Height = Application.GetRealHeight(507);
+ frameBack.Width = Application.GetRealWidth(792);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Y = Application.GetRealHeight(691);
+ frameBack.Gravity = Gravity.CenterHorizontal;
+ frameBack.Radius = (uint)Application.GetRealHeight(17);
+ this.AddChidren(frameBack);
+
+ //鏍囬淇℃伅
+ this.btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(65), false);
+ btnTitle.Y = Application.GetRealHeight(68);
+ btnTitle.TextColor = UserCenterColor.Current.TextColor1;
+ btnTitle.TextSize = 16;
+ btnTitle.TextAlignment = TextAlignment.Center;
+ frameBack.AddChidren(btnTitle);
+
+ //娑堟伅
+ 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;
+ btnMsg.Text = msg;
+ frameBack.AddChidren(btnMsg);
+
+ //鍙栨秷
+ this.btnCancel = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127));
+ frameBack.AddChidren(btnCancel);
+ btnCancel.InitControl(Language.StringByID(R.MyInternationalizationString.uCancel));
+ btnCancel.ButtonClickEvent += (sender, e) =>
+ {
+ //绉婚櫎鐣岄潰
+ this.CloseDialog();
+ };
+
+ //纭
+ this.btnConfirm = new BottomRightClickButton(frameBack.Width - btnCancel.Width, btnCancel.Height);
+ frameBack.AddChidren(btnConfirm);
+ btnConfirm.InitControl(btnText);
+ btnConfirm.ButtonClickEvent += (sender, e) =>
+ {
+ //鍥炶皟鍑芥暟
+ this.ComfirmClickEvent?.Invoke();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鐢婚潰鍏抽棴
+ /// </summary>
+ public void CloseDialog()
+ {
+ this.ComfirmClickEvent = null;
+ this.RemoveFromParent();
+ }
+
+ #endregion
+
+ #region 鈻� 璁剧疆淇℃伅___________________________
+
+ /// <summary>
+ /// 璁剧疆鏍囬淇℃伅
+ /// </summary>
+ /// <param name="txtValue"></param>
+ public void SetTitleText(string txtValue)
+ {
+ this.btnTitle.Text = txtValue;
+ }
+ /// <summary>
+ /// 璁剧疆鍙栨秷鎸夐挳鐨勬枃鏈俊鎭�
+ /// </summary>
+ /// <param name="txtValue"></param>
+ public void SetCancelButtonText(string txtValue)
+ {
+ this.btnCancel.SetButtonText(txtValue);
+ }
+
+ /// <summary>
+ /// 璁剧疆纭畾鎸夐挳鐨勬枃鏈俊鎭�
+ /// </summary>
+ /// <param name="txtValue"></param>
+ public void SetOkButtonText(string txtValue)
+ {
+ this.btnConfirm.SetButtonText(txtValue);
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
index 051d41a..aa44917 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
@@ -167,18 +167,6 @@
}
/// <summary>
- /// CheckVersion
- /// </summary>
- private void CheckVersion()
- {
- new System.Threading.Thread(async () =>
- {
-
- })
- { IsBackground = true }.Start();
-
- }
- /// <summary>
/// 璁剧疆杩涘害鎺т欢涓嶅彲瑙�
/// </summary>
private void SetDownLoadBtnNoVisible()
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterEnumCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterEnumCommon.cs
index d5ab323..08bd6c6 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterEnumCommon.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterEnumCommon.cs
@@ -27,17 +27,13 @@
public enum ChidrenBindMode
{
/// <summary>
- /// 缁戝畾寮硅捣浜嬩欢,璇ユ帶浠跺崟鍑诲悗锛屾樉绀洪�夋嫨鐘舵��
- /// </summary>
- BindAll = 1,
- /// <summary>
/// 缁戝畾寮硅捣浜嬩欢,浣嗚鎺т欢鍗曞嚮鍚庯紝涓嶆樉绀洪�夋嫨鐘舵��
/// </summary>
- BindEventOnly = 2,
+ BindEvent = 1,
/// <summary>
/// 涓嶇粦瀹氫簨浠讹紝涔熶笉鏄剧ず閫夋嫨鐘舵��
/// </summary>
- NotBind = 3
+ NotBind = 2
}
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs
index 659a38b..c90de98 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs
@@ -65,12 +65,12 @@
//鎶婁笂鍦嗚瑕嗙洊涓烘柟瑙�
this.btnTopTemp = new NormalViewControl(this.Width, Application.GetRealHeight(40), false);
btnTopTemp.BackgroundColor = i_backColor;
- this.AddChidren(btnTopTemp, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnTopTemp, ChidrenBindMode.BindEvent);
//鎶婂彸涓嬪渾瑙掕鐩栦负鏂硅
this.btnBomTemp = new NormalViewControl(this.Width / 2, Application.GetRealHeight(40), false);
btnBomTemp.BackgroundColor = i_backColor;
btnBomTemp.Gravity = Gravity.BottomRight;
- this.AddChidren(btnBomTemp, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnBomTemp, ChidrenBindMode.BindEvent);
//鍙栨秷鎸夐挳
this.btnButton = new NormalViewControl(this.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
btnButton.Gravity = Gravity.Center;
@@ -78,7 +78,7 @@
btnButton.Text = i_text;
btnButton.TextAlignment = TextAlignment.Center;
btnButton.BackgroundColor = i_backColor;
- this.AddChidren(btnButton, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnButton, ChidrenBindMode.BindEvent);
//閲嶅啓鎺т欢鐐瑰嚮鐘舵��
this.SelectStatuEvent += (statu) =>
@@ -108,7 +108,7 @@
btnButton.TextAlignment = TextAlignment.Center;
btnButton.BackgroundColor = i_backColor;
btnButton.oldBackgroundColor = i_backColor;
- this.AddChidren(btnButton, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnButton, ChidrenBindMode.BindEvent);
#endif
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs
index f79050c..118e697 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomRightClickButton.cs
@@ -64,12 +64,12 @@
//鎶婁笂鍦嗚瑕嗙洊涓烘柟瑙�
this.btnTopTemp = new NormalViewControl(this.Width, Application.GetRealHeight(40), false);
btnTopTemp.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- this.AddChidren(btnTopTemp, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnTopTemp, ChidrenBindMode.BindEvent);
//鎶婂乏涓嬪渾瑙掕鐩栦负鏂硅
this.btnBomTemp = new NormalViewControl(this.Width / 2, Application.GetRealHeight(40), false);
btnBomTemp.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
btnBomTemp.Gravity = Gravity.BottomLeft;
- this.AddChidren(btnBomTemp, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnBomTemp, ChidrenBindMode.BindEvent);
//纭鎸夐挳
this.btnConfirm = new NormalViewControl(this.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
btnConfirm.IsBold = true;
@@ -77,7 +77,7 @@
btnConfirm.TextColor = UserCenterColor.Current.White;
btnConfirm.Text = i_text;
btnConfirm.TextAlignment = TextAlignment.Center;
- this.AddChidren(btnConfirm, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnConfirm, ChidrenBindMode.BindEvent);
//閲嶅啓鎺т欢鐐瑰嚮鐘舵��
this.SelectStatuEvent += (statu) =>
@@ -108,7 +108,7 @@
btnConfirm.TextAlignment = TextAlignment.Center;
btnConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
btnConfirm.oldBackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- this.AddChidren(btnConfirm, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnConfirm, ChidrenBindMode.BindEvent);
#endif
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs
index 4bd0902..f667767 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs
@@ -137,7 +137,7 @@
btnCaption.X = ControlCommonResourse.XXLeft;
btnCaption.Gravity = Gravity.CenterVertical;
btnCaption.Text = i_caption + "锛�";
- this.AddChidren(btnCaption, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnCaption, ChidrenBindMode.BindEvent);
//鏄剧ず妗�
var txtView = new NormalViewControl(700, true);
@@ -145,7 +145,7 @@
txtView.Gravity = Gravity.CenterVertical;
txtView.TextColor = UserCenterColor.Current.TextGrayColor1;
txtView.Text = i_RoomName;
- this.AddChidren(txtView, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(txtView, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/DeviceInformationListControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/DeviceInformationListControl.cs
deleted file mode 100755
index 021bd32..0000000
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/DeviceInformationListControl.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Shared.Phone.UserCenter
-{
- /// <summary>
- /// 璁惧鏄庣粏淇℃伅鐨勫垪琛ㄦ帶浠�(璁惧淇℃伅鐣岄潰涓撶敤,涓嶅缓璁埆浜轰娇鐢�)
- /// </summary>
- public class DeviceInformationListControl : VerticalScrolViewLayout
- {
- /// <summary>
- /// 寮у害鐨勫渾鐨勪竴鍗婄殑楂樺害(鍥哄畾)
- /// </summary>
- public int halfRoundHeigth = Application.GetRealHeight(116) / 2;
- /// <summary>
- /// 鏄庣粏鏍囬楂樺害(鍥哄畾)
- /// </summary>
- public int titleHeight = Application.GetRealHeight(60);
- /// <summary>
- /// 鏄庣粏鍒楄〃鎺т欢鐨勬甯�
- /// </summary>
- private FrameLayout detailBackFrame = null;
-
- /// <summary>
- /// <para>璁惧鏄庣粏淇℃伅鐨勫垪琛ㄦ帶浠�(璁惧淇℃伅鐣岄潰涓撶敤,涓嶅缓璁埆浜轰娇鐢�)</para>
- /// <para>璇蜂笉瑕佹坊鍔犲埌鐖舵帶浠朵腑,璋冪敤InitControl()瀹屾垚鍒濆鍖�</para>
- /// </summary>
- public DeviceInformationListControl()
- {
- }
-
- /// <summary>
- /// 鍒濆鍖栨帶浠�
- /// </summary>
- /// <param name="frame">鐖跺鍣�,涓嶈兘涓簄ull</param>
- /// <param name="bottomWhiteFrameHeight">搴曢儴鐧借壊鑳屾櫙鎺т欢鐨勯珮搴�</param>
- /// <param name="listViewMaxHeight">鍒楄〃鎺т欢鏈�澶х殑楂樺害</param>
- /// <param name="minDetailFrameHeight">鏄庣粏Frame鐨勬渶灏忛珮搴�</param>
- /// <param name="menuRowCount">鑿滃崟鐨勮鏁�(涓嶅惈鏍囬)</param>
- /// <param name="appendHeight">鍒楄〃鎺т欢搴曢儴闄勫姞鐨勭┖鐧介珮搴�(涓嶆坊鍔犲湪杩欎釜灏佽鎺т欢涓�)</param>
- public void InitControl(FrameLayout frame, int bottomWhiteFrameHeight,
- int listViewMaxHeight, int minDetailFrameHeight, int menuRowCount, int appendHeight = 0)
- {
- //鈽呪槄鈽呪槄璁惧鏄庣粏鍒楄〃闇�瑕佺壒鏁�,浼拌浠ュ悗鎴戜篃鐪嬩笉鎳傝繖浠g爜浠�涔堟剰鎬濅簡鈽呪槄鈽呪槄
-
- //鍒楄〃鎺т欢鏈�澶х殑楂樺害
- listViewMaxHeight = listViewMaxHeight - appendHeight;
- //寮у害鐨勫渾鐨勪竴鍗婄殑楂樺害(鍥哄畾)
- int halfRoundHeigth = Application.GetRealHeight(116) / 2;
- //鏄庣粏鏍囬楂樺害(鍥哄畾)
- int titleHeight = Application.GetRealHeight(60);
- //鏄庣粏Frame鐨勬渶灏忛珮搴�
- minDetailFrameHeight = minDetailFrameHeight - appendHeight;
- //鏄庣粏Frame瀹為檯鐨勯珮搴�(鑿滃崟鏁� * 琛岀殑楂樺害 + 鏄庣粏鏍囬楂樺害)
- int realDetailHeight = menuRowCount * ControlCommonResourse.ListViewRowHeight + titleHeight;
- if (realDetailHeight < minDetailFrameHeight)
- {
- //鏄庣粏Frame瀹為檯鐨勯珮搴︿笉鑳戒綆浜庢渶灏忛珮搴︼紝涓嶇劧鐧借壊浼氶摵涓嶆弧
- realDetailHeight = minDetailFrameHeight;
- }
- //鍒楄〃鎺т欢鐨勯珮搴�
- int listViewHeight = listViewMaxHeight;
- if (realDetailHeight + halfRoundHeigth < listViewMaxHeight)
- {
- listViewHeight = realDetailHeight + halfRoundHeigth;
- }
- //鍒楄〃鎺т欢瀹為檯楂樺害涓庢槑缁嗘渶灏忛珮搴︾殑宸�(姝ゅ�煎彧鏈�0锛屾垨鑰呭ぇ浜�0)
- int differValue = listViewHeight - minDetailFrameHeight - halfRoundHeigth;
- //鍒楄〃鎺т欢
- this.Y = ControlCommonResourse.BodyFrameHeight - listViewHeight - bottomWhiteFrameHeight - appendHeight;
- this.BackgroundColor = UserCenterColor.Current.Transparent;
- this.Height = listViewHeight;
- frame.AddChidren(this);
- //鍦ㄥ垪琛ㄦ帶浠堕噷娣诲姞涓�灞傝儗鏅甯�
- var listViewBackFrame = new FrameLayout();
- listViewBackFrame.BackgroundColor = UserCenterColor.Current.Transparent;
- listViewBackFrame.Height = realDetailHeight + halfRoundHeigth + differValue;
- base.AddChidren(listViewBackFrame);
-
- if (differValue > 0)
- {
- //娣诲姞涓�涓�忔槑鐨勪笢瑗垮埌鍒楄〃椤堕儴
- var frameTransparent = new FrameLayout();
- frameTransparent.BackgroundColor = UserCenterColor.Current.Transparent;
- frameTransparent.Height = differValue;
- listViewBackFrame.AddChidren(frameTransparent);
- }
-
- //寮у害鐨勫渾
- var btnRound = new NormalViewControl(listViewBackFrame.Width, halfRoundHeigth * 2, false);
- btnRound.Y = differValue;
- btnRound.BackgroundColor = UserCenterColor.Current.White;
- btnRound.Radius = (uint)halfRoundHeigth;
- listViewBackFrame.AddChidren(btnRound);
- //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙(瑕嗙洊寮у害鐨勫渾鐨勫崐杈�)
- this.detailBackFrame = new FrameLayout();
- detailBackFrame.Y = btnRound.Bottom - btnRound.Height / 2;
- detailBackFrame.Height = realDetailHeight;
- detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
- listViewBackFrame.AddChidren(detailBackFrame);
- }
-
- /// <summary>
- /// 娣诲姞瀛愭帶浠�
- /// </summary>
- /// <param name="view"></param>
- public override void AddChidren(View view)
- {
- if (detailBackFrame != null)
- {
- var tempView = detailBackFrame.GetChildren(detailBackFrame.ChildrenCount - 1);
- if (tempView != null)
- {
- view.Y = tempView.Bottom;
- }
- detailBackFrame.AddChidren(view);
- }
- }
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
index 539ff34..3349ea3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
@@ -46,21 +46,9 @@
/// </summary>
private NormalViewControl btnText = null;
/// <summary>
- /// 杩涘害鍊兼枃鏈殑鏄剧ず鎺т欢
+ /// 杩涘害鏉℃帶浠�
/// </summary>
- private NormalViewControl btnProgressView = null;
- /// <summary>
- /// 杩涘害鍊艰兘澶熺Щ鍔ㄧ殑閭d釜妗嗘帶浠�
- /// </summary>
- private FrameLayout frameProgress = null;
- /// <summary>
- /// 杩涘害鏉�
- /// </summary>
- private FrameLayout btnProgressBar = null;
- /// <summary>
- /// 杩涘害鏉″鍣ㄧ殑鏈�澶у搴�
- /// </summary>
- private int ProRowWidth = 0;
+ private ProgressRowBar btnProgressBar = null;
/// <summary>
/// 鍘熸潵鐨勬粦鍔ㄦ爣璇�
/// </summary>
@@ -94,11 +82,6 @@
bodyFrameLayout = new FrameLayout();
bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor;
Common.CommonPage.Instance.AddChidren(bodyFrameLayout);
- //var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
- //if (nowForm != null && (nowForm is ViewGroup) == true)
- //{
- // ((ViewGroup)nowForm).AddChidren(bodyFrameLayout);
- //}
var frameBack = new FrameLayout();
frameBack.Width = Application.GetRealWidth(674);
@@ -121,38 +104,11 @@
};
//杩涘害鏉�
- var btnProRow = new FrameLayout();
- btnProRow.Gravity = Gravity.CenterHorizontal;
- btnProRow.Y = Application.GetRealHeight(161);
- btnProRow.Width = Application.GetRealWidth(559);
- btnProRow.Height = Application.GetRealHeight(29);
- btnProRow.BackgroundColor = 0xfff5f5f5;
- btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2;
- frameBack.AddChidren(btnProRow);
- this.btnProgressBar = new FrameLayout();
- btnProgressBar.Width = 0;
- btnProgressBar.Height = btnProRow.Height;
- btnProgressBar.BackgroundColor = 0xfffb744a;
- btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
- btnProRow.AddChidren(btnProgressBar);
-
- //杩涘害鍊兼枃鏈�
- this.frameProgress = new FrameLayout();
- frameProgress.Width = Application.GetRealWidth(84);
- frameProgress.Height = Application.GetRealHeight(60);
- frameProgress.Y = Application.GetRealHeight(86);
- frameBack.AddChidren(frameProgress);
- frameProgress.X = btnProRow.X + btnProgressBar.Right - frameProgress.Width / 2;
- var btnProgressPic = new PicViewControl(84, 60);
- btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
- frameProgress.AddChidren(btnProgressPic);
- this.btnProgressView = new NormalViewControl(84, 45, true);
- btnProgressView.TextSize = 10;
- btnProgressView.TextAlignment = TextAlignment.Center;
- btnProgressView.Text = "0%";
- frameProgress.AddChidren(btnProgressView);
-
- this.ProRowWidth = btnProRow.Width;
+ this.btnProgressBar = new ProgressRowBar(559, 29);
+ btnProgressBar.Gravity = Gravity.CenterHorizontal;
+ btnProgressBar.Y = Application.GetRealHeight(161);
+ frameBack.AddChidren(btnProgressBar);
+ btnProgressBar.StartMode1(true);
}
#endregion
@@ -181,7 +137,7 @@
/// <param name="value">姝ゅ�间负鐧惧垎姣斿��(涔熷氨鏄皬浜庢垨鑰呯瓑浜�1鐨�)</param>
public void SetValue(decimal value)
{
- this.SetValueEx(value);
+ this.btnProgressBar.SetValue(value);
}
/// <summary>
@@ -191,29 +147,7 @@
/// <param name="maxValue">鏈�澶у��</param>
public void SetValue(decimal value, decimal maxValue)
{
- decimal result = value / maxValue;
- this.SetValueEx(result);
- }
-
- /// <summary>
- /// 璁剧疆杩涘害鍊�
- /// </summary>
- /// <param name="value"></param>
- private void SetValueEx(decimal value)
- {
- if (btnProgressBar == null)
- {
- return;
- }
- HdlThreadLogic.Current.RunMain(() =>
- {
- int width = (int)(value * ProRowWidth);
- btnProgressBar.Width = width;
- //鏂囨湰鏄剧ず
- btnProgressView.Text = ((int)(value * 100)) + "%";
- //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩
- frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2;
- });
+ this.btnProgressBar.SetValue(value, maxValue);
}
#endregion
@@ -261,8 +195,6 @@
bodyFrameLayout?.RemoveFromParent();
bodyFrameLayout = null;
btnText = null;
- btnProgressView = null;
- frameProgress = null;
btnProgressBar = null;
this.MsgClickEvent = null;
//鍏抽棴浜嬩欢
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs
index aebe897..5cd4dcd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs
@@ -39,8 +39,14 @@
/// <summary>
/// 琛屾潯绫诲瀷鐨勮繘搴︽潯鎺т欢
/// </summary>
- /// <param name="width">闈炵湡瀹炲��</param>
- /// <param name="height">闈炵湡瀹炲��</param>
+ /// <param name="width">
+ /// <para>妯″紡1:浼氬姩鐨勯偅涓繘搴︽潯鐨勫搴�(闈炵湡瀹炲��)</para>
+ /// <para>妯″紡2:杩涘害鏉″湪鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔ㄧ殑鍖哄煙瀹藉害(闈炵湡瀹炲��)</para>
+ /// </param>
+ /// <param name="height">
+ /// <para>妯″紡1:浼氬姩鐨勯偅涓繘搴︽潯鐨勯珮搴�(闈炵湡瀹炲��)</para>
+ /// <para>妯″紡2:杩涘害鏉″湪鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔ㄧ殑楂樺害(闈炵湡瀹炲��)</para>
+ /// </param>
public ProgressRowBar(int width, int height)
{
this.Height = Application.GetRealHeight(height);
@@ -56,7 +62,10 @@
/// <summary>
/// 妯″紡1 璇ユā寮忎负锛氭墜鍔ㄥ~鍐欒繘搴﹀��
/// </summary>
- /// <param name="showText">鏄惁鍦ㄨ繘搴︽潯涓婃柟鏄剧ず鏁板�肩櫨鍒嗘瘮</param>
+ /// <param name="showText">
+ /// <para>鏄惁鍦ㄨ繘搴︽潯涓婃柟鏄剧ず鏁板�肩櫨鍒嗘瘮</para>
+ /// <para>璇风‘淇濇帶浠剁殑涓婃柟鏈夎冻澶熺殑鍖哄煙(娉�:璇蜂笉瑕佹墿澶ф鎺т欢鐨勯珮搴�)</para>
+ /// </param>
public void StartMode1(bool showText = false)
{
if (m_ModeDiv != -1) { return; }
@@ -74,7 +83,7 @@
{
//杩涘害鍊兼枃鏈�
this.frameProgressBack = new FrameLayout();
- frameProgressBack.Width = Application.GetRealWidth(84);
+ frameProgressBack.Width = Application.GetRealWidth(120);
frameProgressBack.Height = Application.GetRealHeight(60);
frameProgressBack.Y = this.Y - Application.GetRealHeight(60);
frameProgressBack.X = this.X - Application.GetRealWidth(84) / 2;
@@ -82,12 +91,25 @@
var btnProgressPic = new PicViewControl(84, 60);
btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
+ btnProgressPic.Gravity = Gravity.CenterHorizontal;
frameProgressBack.AddChidren(btnProgressPic);
- this.btnProgressTextView = new NormalViewControl(84, 45, true);
+ this.btnProgressTextView = new NormalViewControl(120, 45, true);
btnProgressTextView.TextSize = 10;
btnProgressTextView.TextAlignment = TextAlignment.Center;
btnProgressTextView.Text = "0%";
+ btnProgressTextView.Gravity = Gravity.CenterHorizontal;
frameProgressBack.AddChidren(btnProgressTextView);
+ }
+ }
+
+ /// <summary>
+ /// 閲嶇疆杩涘害鏉�(鍙妯″紡1鏈夋晥)
+ /// </summary>
+ public void ResetProgressBar()
+ {
+ if (this.m_ModeDiv == 1 && this.btnProgressBar != null)
+ {
+ this.btnProgressBar.Width = 0;
}
}
@@ -124,6 +146,11 @@
HdlThreadLogic.Current.RunMain(() =>
{
int width = (int)(value * this.Width);
+ if (btnProgressBar.Width >= width)
+ {
+ //涓嶈兘璁╄繘搴︽潯寰�鍥炶蛋
+ return;
+ }
btnProgressBar.Width = width;
if (this.btnProgressTextView != null)
{
@@ -142,7 +169,7 @@
/// <summary>
/// 妯″紡2 璇ユā寮忎负锛氫笉鑳芥墜鍔ㄦ寚瀹氳繘搴﹀��,鐢卞唴閮ㄧ嚎绋嬪鐞�,杩涘害鏉″湪鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔�
/// </summary>
- /// <param name="proWidth">浼氱Щ鍔ㄧ殑杩涘害鏉$殑瀹藉害(闈炵湡瀹炲��)</param>
+ /// <param name="proWidth">鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔ㄧ殑杩涘害鏉$殑瀹藉害(闈炵湡瀹炲��)</param>
public void StartMode2(int proWidth = 100)
{
if (m_ModeDiv != -1) { return; }
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
index 2b18246..79a91eb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
@@ -193,7 +193,7 @@
{
btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
}
- frameBack.AddChidren(btnText, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(btnText, ChidrenBindMode.BindEvent);
frameBack.ButtonClickEvent += (sender, e) =>
{
@@ -287,7 +287,7 @@
{
btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
}
- frameBack.AddChidren(btnText, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(btnText, ChidrenBindMode.BindEvent);
frameBack.ButtonClickEvent += (sender, e) =>
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs
index 736f59c..5dd649b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetyMasterControl.cs
@@ -355,13 +355,13 @@
btnBack.Gravity = Gravity.CenterHorizontal;
btnBack.Radius = (uint)backHeight / 2;
btnBack.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
- this.AddChidren(btnBack, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnBack, ChidrenBindMode.BindEvent);
//鍥炬爣
btnIcon = new IconViewControl(81);
btnIcon.Y = Application.GetRealHeight(26);
btnIcon.Gravity = Gravity.CenterHorizontal;
- this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
//鏂囨湰
btnText = new NormalViewControl(this.Width, Application.GetRealHeight(58), false);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs
index 6010e81..d02b8e4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SceneFunctionSwitchControl.cs
@@ -121,7 +121,7 @@
{
btnName.TextColor = UserCenterColor.Current.TextGrayColor3;
}
- frameBack.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(btnName, ChidrenBindMode.BindEvent);
//娣诲姞缂撳瓨
this.listNameControl.Add(btnName);
@@ -131,7 +131,7 @@
btnLine.X = btnName.X + btnName.Width / 2 - Application.GetRealWidth(40) / 2;
btnLine.Radius = (uint)Application.GetRealHeight(10) / 2;
btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
- frameBack.AddChidren(btnLine, ChidrenBindMode.BindEventOnly);
+ frameBack.AddChidren(btnLine, ChidrenBindMode.BindEvent);
if (m_nowSelectIndex != i_index)
{
btnLine.Visible = false;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
index 561b5b3..863d55a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
@@ -60,7 +60,7 @@
btnIcon2.BackgroundColor = 0xfffef1ed;
btnIcon2.Radius = (uint)iconWidth / 2;
btnIcon2.Gravity = Gravity.Center;
- this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon2, ChidrenBindMode.BindEvent);
//璁惧鍥炬爣
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
@@ -72,7 +72,7 @@
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);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
}
/// <summary>
@@ -90,13 +90,13 @@
btnIcon2.BackgroundColor = 0xfffef1ed;
btnIcon2.Radius = (uint)iconWidth / 2;
btnIcon2.Gravity = Gravity.Center;
- this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon2, ChidrenBindMode.BindEvent);
//璁惧鍥炬爣
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);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
}
/// <summary>
@@ -113,13 +113,13 @@
btnIcon2.BackgroundColor = 0xfffef1ed;
btnIcon2.Radius = (uint)iconWidth / 2;
btnIcon2.Gravity = Gravity.Center;
- this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon2, ChidrenBindMode.BindEvent);
//璁惧鍥炬爣
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);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
index e9c72d8..5609b22 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
@@ -89,7 +89,7 @@
//璁惧
string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
btnDeviceName = frameTable.AddTopView(deviceName, 800);
- frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
//鎴块棿
string roomName = Common.LocalDevice.Current.GeteRealDeviceRoomName(listDevice[0]);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs
index f72e13c..373ef5d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs
@@ -96,7 +96,7 @@
btnDevie.TextSize = 15;
//杩欎釜鍧愭爣鏈夌偣鐗规畩
btnDevie.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
- frameTable.AddChidren(btnDevie, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnDevie, ChidrenBindMode.BindEvent);
if (tempDevice != null)
{
btnDevie.Text = Common.LocalDevice.Current.GetDeviceEpointName(tempDevice);
@@ -114,7 +114,7 @@
btnRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
btnRoom.TextSize = 12;
btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
- frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEvent);
if (tempDevice != null)
{
btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(tempDevice);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
index eaa2e2a..414fc0d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
@@ -77,7 +77,7 @@
/// <param name="ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(銆愬垪琛ㄦ帶浠剁殑rowSpace/2銆戝嵆鍙�,涓嶆噦榛樿涓�0鍗冲彲)</param>
public GatewayRowControl(ZbGateway i_zbGateway, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
{
- this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway);
+ this.zbGatewayId = i_zbGateway.GwId;
}
/// <summary>
@@ -121,20 +121,20 @@
btnName.TextSize = 15;
//杩欎釜鍧愭爣鏈夌偣鐗规畩
btnName.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
- frameTable.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnName, ChidrenBindMode.BindEvent);
//鎴块棿
string strIp = string.Empty;
if (tempWay != null)
{
- strIp = tempWay.getGatewayBaseInfo.IpAddress;
+ strIp = tempWay.GwIP;
}
this.btnIp = frameTable.AddLeftCaption(strIp, 600, 50, true);
//杩欎釜鍧愭爣鏈夌偣鐗规畩
btnIp.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
btnIp.TextSize = 12;
btnIp.TextColor = UserCenterColor.Current.TextGrayColor1;
- frameTable.AddChidren(btnIp, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnIp, ChidrenBindMode.BindEvent);
//鍒濆鍊煎湪绾�
this.IsOnline = true;
@@ -152,7 +152,7 @@
{
if (zbway != null)
{
- this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(zbway);
+ this.zbGatewayId = zbway.GwId;
}
bool bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs
index 9844dcb..fdd38be 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameCaptionViewControl.cs
@@ -60,9 +60,9 @@
/// <param name="text">鏂囨湰妗嗙殑鍊�</param>
public virtual void InitControl()
{
- this.AddChidren(btnCaption, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnCaption, ChidrenBindMode.BindEvent);
- this.AddChidren(txtView, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(txtView, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
btnCaption.Y += chidrenYaxis;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs
index 1c9264e..8c482c3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutStatuControl.cs
@@ -180,7 +180,7 @@
/// </summary>
/// <param name="view">瀛愭帶浠�</param>
/// <param name="chidrenBindMode">缁戝畾妯″紡</param>
- public void AddChidren(View view, ChidrenBindMode chidrenBindMode = ChidrenBindMode.BindAll)
+ public void AddChidren(View view, ChidrenBindMode chidrenBindMode = ChidrenBindMode.BindEvent)
{
this.oldBackColor = this.BackgroundColor;
@@ -334,11 +334,6 @@
#endregion
#region 鈻� Log鍑哄姏____________________________
-
- /// <summary>
- /// 璇ユ帶浠舵墍灞炵殑鐣岄潰鍚嶅瓧
- /// </summary>
- private string formName = null;
/// <summary>
/// Log鍑哄姏
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs
index 8905b4b..037155f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs
@@ -98,7 +98,7 @@
i_width = Application.GetRealWidth(i_width);
}
var contr = this.AddLeftCaption(i_caption, i_width, this.Height, false);
- this.AddChidren(contr, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(contr, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
contr.Y += chidrenYaxis;
@@ -179,7 +179,7 @@
var btnIcon = new IconViewControl(i_Iconsize);
btnIcon.X = ControlCommonResourse.XXLeft + LeftOffset;
btnIcon.Gravity = Gravity.CenterVertical;
- this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
btnIcon.Y += chidrenYaxis;
@@ -202,7 +202,7 @@
btnRight.Gravity = Gravity.CenterVertical;
btnRight.X =this.Width - btnRight.IconSize - ControlCommonResourse.XXLeft + RightOffset;
btnRight.UnSelectedImagePath = "Item/RightNext.png";
- this.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnRight, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
@@ -227,7 +227,7 @@
this.AddChidren(btnContr, ChidrenBindMode.NotBind);
btnContr.InitControl();
//澶嶅悎鎺т欢闇�瑕佺壒娈婂鐞�
- this.ChangedChidrenBindMode(btnContr, ChidrenBindMode.BindEventOnly);
+ this.ChangedChidrenBindMode(btnContr, ChidrenBindMode.BindEvent);
if (RightOffset != 0)
{
btnContr.X += RightOffset;
@@ -278,7 +278,7 @@
i_width = Application.GetRealWidth(i_width);
}
var btnContr = AddMostRightView(i_text, i_width, this.Height, false);
- this.AddChidren(btnContr, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnContr, ChidrenBindMode.BindEvent);
if (chidrenYaxis != 0)
{
btnContr.Y += chidrenYaxis;
@@ -333,7 +333,7 @@
contr.TextSize = 15;
//褰撴寚瀹氬疄闄呭潗鏍囨椂,杩欓噷闇�瑕佺殑鍋忕Щ閲忎负2鍊�
contr.Y = Application.GetRealHeight(12) + this.chidrenYaxis * 2;
- this.AddChidren(contr, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(contr, ChidrenBindMode.BindEvent);
return contr;
}
@@ -360,7 +360,7 @@
contr.Y = Application.GetRealHeight(72) + this.chidrenYaxis * 2;
contr.TextSize = 12;
contr.TextColor = UserCenterColor.Current.TextGrayColor1;
- this.AddChidren(contr, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(contr, ChidrenBindMode.BindEvent);
return contr;
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
index 0063924..d307b28 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
@@ -68,7 +68,7 @@
this.m_frameTable = new FrameLayout();
this.m_frameTable.Width = this.Width;
this.m_frameTable.Height = this.Height;
- this.AddChidren(this.m_frameTable);
+ base.AddChidren(this.m_frameTable);
}
#endregion
@@ -76,10 +76,10 @@
#region 鈻� 娣诲姞瀛愭帶浠禵________________________
/// <summary>
- /// 娣诲姞Frame瀛愭帶浠�
+ /// 娣诲姞Frame瀛愭帶浠�(娉ㄦ剰,瀹冩槸寰�涓嬪姞鎺т欢,鍙細鏀瑰彉鍧愭爣,妗屽竷澶у皬浼氬鍔�)
/// </summary>
/// <param name="view"></param>
- public void AddChidrenFrame(FrameLayout frame)
+ public override void AddChidren(View view)
{
//鍒濆鍖栨甯冩帶浠�
this.InitFrameTable();
@@ -88,13 +88,13 @@
int value = this.GetLocationMostLastViewBottom(this.m_frameTable);
if (value != -1)
{
- frame.Y = value + rowSpace;
+ view.Y = value + rowSpace;
}
- this.m_frameTable.AddChidren(frame);
+ this.m_frameTable.AddChidren(view);
//璋冩暣妗屽竷楂樺害
- if (this.m_frameTable.Height < frame.Bottom)
+ if (this.m_frameTable.Height < view.Bottom)
{
- this.m_frameTable.Height = frame.Bottom;
+ this.m_frameTable.Height = view.Bottom;
}
}
@@ -185,7 +185,7 @@
this.frameBackTemp = new FrameLayout();
frameBackTemp.Height = ControlCommonResourse.BodyFrameHeight - btnTemp.Yaxis + Application.GetRealHeight(23);
- this.AddChidrenFrame(frameBackTemp);
+ this.AddChidren(frameBackTemp);
this.rowSpace = oldRowSpace;
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs
index 2ed4d25..f67e435 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs
@@ -69,7 +69,7 @@
this.m_frameTable = new FrameLayout();
this.m_frameTable.Width = this.Width;
this.m_frameTable.Height = this.Height;
- this.AddChidren(this.m_frameTable);
+ base.AddChidren(this.m_frameTable);
}
#endregion
@@ -77,10 +77,10 @@
#region 鈻� 娣诲姞瀛愭帶浠禵________________________
/// <summary>
- /// 娣诲姞Frame瀛愭帶浠�(姝ゆ柟娉曟槸鏀瑰彉Y杞�)
+ /// 娣诲姞瀛愭帶浠�(娉ㄦ剰,瀹冩槸寰�涓嬪姞鎺т欢,姝ゆ柟娉曟槸鍙敼鍙榊杞�)
/// </summary>
/// <param name="view"></param>
- public void AddChidrenFrame(FrameLayout frame)
+ public override void AddChidren(View view)
{
//鍒濆鍖栨甯冩帶浠�
this.InitFrameTable();
@@ -88,21 +88,21 @@
int value = this.GetLocationMostLastViewBottom(this.m_frameTable);
if (value != -1)
{
- frame.Y = value + rowSpace;
+ view.Y = value + rowSpace;
}
- this.m_frameTable.AddChidren(frame);
+ this.m_frameTable.AddChidren(view);
//璋冩暣妗屽竷楂樺害
- if (this.m_frameTable.Height < frame.Bottom)
+ if (this.m_frameTable.Height < view.Bottom)
{
- this.m_frameTable.Height = frame.Bottom;
+ this.m_frameTable.Height = view.Bottom;
}
}
/// <summary>
- /// 娣诲姞Frame瀛愭帶浠�(姝ゆ柟娉曟槸鏀瑰彉楂樺害)
+ /// 娣诲姞瀛愭帶浠�(娉ㄦ剰,瀹冩槸寰�涓嬪姞鎺т欢,姝ゆ柟娉曟槸鏀瑰彉楂樺害)
/// </summary>
/// <param name="view"></param>
- public void AddChidrenFrame2(FrameLayout frame)
+ public void AddChidren2(View view)
{
//鍒濆鍖栨甯冩帶浠�
this.InitFrameTable();
@@ -111,44 +111,17 @@
int value = this.GetLocationMostLastViewBottom(this.m_frameTable);
if (value != -1)
{
- frame.Y = value;
+ view.Y = value;
}
- this.m_frameTable.AddChidren(frame);
+ this.m_frameTable.AddChidren(view);
if (rowSpace > 0)
{
- frame.Height += rowSpace;
+ view.Height += rowSpace;
}
//璋冩暣妗屽竷楂樺害
- if (this.m_frameTable.Height < frame.Bottom)
+ if (this.m_frameTable.Height < view.Bottom)
{
- this.m_frameTable.Height = frame.Bottom;
- }
- }
-
- /// <summary>
- /// 娣诲姞Frame瀛愭帶浠�(姝ゆ柟娉曟槸鏀瑰彉楂樺害)
- /// </summary>
- /// <param name="row"></param>
- public void AddChidrenRow(RowLayout row)
- {
- //鍒濆鍖栨甯冩帶浠�
- this.InitFrameTable();
-
- //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣
- int value = this.GetLocationMostLastViewBottom(this.m_frameTable);
- if (value != -1)
- {
- row.Y = value;
- }
- this.m_frameTable.AddChidren(row);
- if (rowSpace > 0)
- {
- row.Height += rowSpace;
- }
- //璋冩暣妗屽竷楂樺害
- if (this.m_frameTable.Height < row.Bottom)
- {
- this.m_frameTable.Height = row.Bottom;
+ this.m_frameTable.Height = view.Bottom;
}
}
@@ -219,7 +192,7 @@
this.frameBackTemp = new FrameLayout();
frameBackTemp.Height = ControlCommonResourse.BodyFrameHeight - btnTemp.Yaxis + Application.GetRealHeight(23);
- this.AddChidrenFrame(frameBackTemp);
+ this.AddChidren(frameBackTemp);
this.rowSpace = oldRowSpace;
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs
index 25cbd29..c4d31b4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/MessageControls/ShowMsgControl.cs
@@ -15,6 +15,10 @@
/// </summary>
public Action ConfirmClickEvent = null;
/// <summary>
+ /// 鐐瑰嚮鍙栨秷鐨勪簨浠�
+ /// </summary>
+ public Action CancelClickEvent = null;
+ /// <summary>
/// 淇℃伅绫诲瀷
/// </summary>
private ShowMsgType msgType = ShowMsgType.Confirm;
@@ -26,6 +30,10 @@
/// 纭鎸夐挳鐨勬枃鏈�
/// </summary>
private string buttonOkText = null;
+ /// <summary>
+ /// 鍙栨秷鎸夐挳鐨勬枃鏈�
+ /// </summary>
+ private string buttonCancelText = null;
/// <summary>
/// 鎻愮ず鎺т欢
/// </summary>
@@ -40,11 +48,13 @@
/// </summary>
/// <param name="i_msgType">淇℃伅绫诲瀷</param>
/// <param name="i_msg">淇℃伅</param>
- /// <param name="buttonText">纭鎸夐挳鐨勬枃鏈�</param>
- public ShowMsgControl(ShowMsgType i_msgType, string i_msg, string buttonText = null)
+ /// <param name="i_buttonOkText">纭鎸夐挳鐨勬枃鏈�</param>
+ /// <param name="i_buttonCancelText">鍙栨秷鎸夐挳鐨勬枃鏈�</param>
+ public ShowMsgControl(ShowMsgType i_msgType, string i_msg, string i_buttonOkText = null, string i_buttonCancelText = null)
{
//纭鎸夐挳鏂囨湰
- this.buttonOkText = buttonText == null ? Language.StringByID(R.MyInternationalizationString.OkMsg) : buttonText;
+ this.buttonOkText = i_buttonOkText == null ? Language.StringByID(R.MyInternationalizationString.OkMsg) : i_buttonOkText;
+ this.buttonCancelText = i_buttonCancelText == null ? Language.StringByID(R.MyInternationalizationString.uCancel) : i_buttonCancelText;
this.msgType = i_msgType;
this.msgText = i_msg;
@@ -165,18 +175,21 @@
//鍙栨秷鎸夐挳
var btnCancel = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127));
frameBack.AddChidren(btnCancel);
- btnCancel.InitControl(Language.StringByID(R.MyInternationalizationString.uCancel));
+ btnCancel.InitControl(this.buttonCancelText);
btnCancel.ButtonClickEvent += (sender, e) =>
{
//绉婚櫎鐣岄潰
frameMain.RemoveFromParent();
+ //鍥炶皟鍑芥暟
+ this.CancelClickEvent?.Invoke();
this.ConfirmClickEvent = null;
+ this.CancelClickEvent = null;
};
//纭畾鎸夐挳
var btnConfirm = new BottomRightClickButton(frameBack.Width - btnCancel.Width, btnCancel.Height);
frameBack.AddChidren(btnConfirm);
- btnConfirm.InitControl(buttonOkText);
+ btnConfirm.InitControl(this.buttonOkText);
btnConfirm.ButtonClickEvent += (sender, e) =>
{
//绉婚櫎鐣岄潰
@@ -184,6 +197,7 @@
//鍥炶皟鍑芥暟
this.ConfirmClickEvent?.Invoke();
this.ConfirmClickEvent = null;
+ this.CancelClickEvent = null;
};
}
@@ -206,14 +220,14 @@
//鎶婁笂鍦嗚瑕嗙洊涓烘柟瑙�
var btnTopTemp2 = new NormalViewControl(frameConfirm.Width, Application.GetRealHeight(35), false);
btnTopTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- frameConfirm.AddChidren(btnTopTemp2, ChidrenBindMode.BindEventOnly);
+ frameConfirm.AddChidren(btnTopTemp2, ChidrenBindMode.BindEvent);
//纭鎸夐挳
var btnConfirm = new NormalViewControl(frameConfirm.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
btnConfirm.Gravity = Gravity.Center;
btnConfirm.TextColor = UserCenterColor.Current.White;
btnConfirm.Text = buttonOkText;
btnConfirm.TextAlignment = TextAlignment.Center;
- frameConfirm.AddChidren(btnConfirm, ChidrenBindMode.BindEventOnly);
+ frameConfirm.AddChidren(btnConfirm, ChidrenBindMode.BindEvent);
frameConfirm.ButtonClickEvent += (sender, e) =>
{
//绉婚櫎鐣岄潰
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs
index 369fa2e..ed4989c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/BackViewControl.cs
@@ -38,7 +38,7 @@
btnIcon.UnSelectedImagePath = "Item/Back.png";
btnIcon.Gravity = Gravity.Center;
- this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
//杩欏紶鍥剧墖濂藉儚寰堢壒娈�,鏃犳硶灞呬腑
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 c63d817..298afd5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconBigViewControl.cs
@@ -75,7 +75,7 @@
/// </summary>
public void InitControl()
{
- this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs
index 0d777ab..a4de505 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MostRightIconControl.cs
@@ -73,7 +73,7 @@
/// </summary>
public void InitControl()
{
- this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs
index 1e53f96..601e1bd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs
@@ -40,7 +40,7 @@
/// </summary>
private CommonDevice device = null;
/// <summary>
- /// 褰撳墠閫夋嫨鐨勫姛鑳界被鍨嬬储寮�
+ /// 褰撳墠閫夋嫨鐨勫姛鑳界被鍨嬬储寮� -1:杩樻病鏈夎缃繃 0:涓嶆寚瀹� 1:寮�鍏� 2:鐏厜 3:鎻掑骇
/// </summary>
private int nowSelectNo = -1;
@@ -108,17 +108,17 @@
var form = new BottomItemSelectForm();
form.CancelCallEvent = true;//鍏佽鍙栨秷
- form.AddForm(title, listText, nowSelectNo);
+ form.AddForm(title, listText, nowSelectNo - 1);
form.FinishSelectEvent += (selectNo) =>
{
- if (selectNo == nowSelectNo)
+ if (selectNo == nowSelectNo - 1)
{
//閫夋嫨鐨勬槸鐩稿悓鐨�
return;
}
//-1:閫夋嫨鍙栨秷
this.Text = selectNo == -1 ? string.Empty : listText[selectNo];
- nowSelectNo = selectNo;
+ nowSelectNo = selectNo + 1;
//璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨�
this.RefreshDfunctionType();
@@ -145,28 +145,34 @@
var myFunType = this.device.DfunctionType;
//鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛�
string strType = string.Empty;
- if (myFunType == DeviceFunctionType.A鐏厜)
+
+ if (this.device.DfunctionType == DeviceFunctionType.A涓嶆寚瀹�)
{
- strType = Language.StringByID(R.MyInternationalizationString.uLight);
- nowSelectNo = 1;
+ nowSelectNo = 0;
}
else if (this.device.DfunctionType == DeviceFunctionType.A寮�鍏�)
{
strType = Language.StringByID(R.MyInternationalizationString.uSwitch);
- nowSelectNo = 0;
+ nowSelectNo = 1;
+ }
+ else if (myFunType == DeviceFunctionType.A鐏厜)
+ {
+ strType = Language.StringByID(R.MyInternationalizationString.uLight);
+ nowSelectNo = 2;
}
else if (this.device.DfunctionType == DeviceFunctionType.A鎻掑骇)
{
strType = Language.StringByID(R.MyInternationalizationString.uSocket1);
- nowSelectNo = 2;
+ nowSelectNo = 3;
}
if (this.device.Type == DeviceType.ColorDimmableLight
+ || this.device.Type == DeviceType.ColorTemperatureLight
|| this.device.Type == DeviceType.DimmableLight)
{
//鐏厜绫诲浐瀹氫负 鐏厜
strType = Language.StringByID(R.MyInternationalizationString.uLight);
- nowSelectNo = 1;
+ nowSelectNo = 2;
}
else if (this.device.Type == DeviceType.WindowCoveringDevice)
{
@@ -223,6 +229,7 @@
|| this.device.Type == DeviceType.Thermostat//绌鸿皟
|| this.device.Type == DeviceType.FreshAir//鏂伴
|| this.device.Type == DeviceType.PMSensor //PM2.5
+ || this.device.Type == DeviceType.ColorTemperatureLight //鑹叉俯鐏�
|| this.device.Type == DeviceType.WindowCoveringDevice)//绐楀笜
{
return true;
@@ -253,7 +260,7 @@
/// </summary>
private void RefreshDfunctionType()
{
- if (this.nowSelectNo == 0)
+ if (this.nowSelectNo == 1)
{
this.device.DfunctionType = DeviceFunctionType.A寮�鍏�;
if (this.device.IsCustomizeImage == false)
@@ -262,7 +269,7 @@
this.device.IconPath = "Device/Switch.png";
}
}
- else if (this.nowSelectNo == 1)
+ else if (this.nowSelectNo == 2)
{
this.device.DfunctionType = DeviceFunctionType.A鐏厜;
if (this.device.IsCustomizeImage == false)
@@ -271,7 +278,7 @@
this.device.IconPath = "Device/Light.png";
}
}
- else if (this.nowSelectNo == 2)
+ else if (this.nowSelectNo == 3)
{
this.device.DfunctionType = DeviceFunctionType.A鎻掑骇;
if (this.device.IsCustomizeImage == false)
@@ -282,7 +289,7 @@
}
else
{
- this.device.DfunctionType = DeviceFunctionType.A鏈畾涔�;
+ this.device.DfunctionType = DeviceFunctionType.A涓嶆寚瀹�;
if (this.device.IsCustomizeImage == false)
{
//閲嶆柊璁剧疆鍥剧墖
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs
index d3448cd..fc2bc98 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/ScenePictrueControl.cs
@@ -86,7 +86,7 @@
var btnShadow = new PicViewControl(btnScenePic.Width + Application.GetRealWidth(14 * 2), btnScenePic.Height + Application.GetRealHeight(43), false);
btnShadow.X = btnScenePic.X - Application.GetRealWidth(14);
btnShadow.UnSelectedImagePath = "Scene/SceneShadow.png";
- this.AddChidren(btnShadow, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnShadow, ChidrenBindMode.BindEvent);
this.btnSceneName = new NormalViewControl(251, 282, true);
btnSceneName.IsMoreLines = true;
@@ -115,7 +115,7 @@
btnSelect.SelectedImagePath = "Item/ItemSelected.png";
btnSelect.X = Application.GetRealWidth(887);
btnSelect.Y = Application.GetRealHeight(35);
- this.AddChidren(btnSelect, ChidrenBindMode.BindEventOnly);
+ this.AddChidren(btnSelect, ChidrenBindMode.BindEvent);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneRoomControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneRoomControl.cs
index a1719ae..5582faa 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneRoomControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/SceneControls/SceneRoomControl.cs
@@ -66,7 +66,7 @@
btnSceneName.TextSize = 15;
//杩欎釜鍧愭爣鏈夌偣鐗规畩
btnSceneName.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
- frameTable.AddChidren(btnSceneName, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnSceneName, ChidrenBindMode.BindEvent);
//鎴块棿
var btnRoom = frameTable.AddLeftCaption("", 600, 50, true);
@@ -74,7 +74,7 @@
btnRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
btnRoom.TextSize = 12;
btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
- frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEvent);
var room = HdlRoomLogic.Current.GetRoomBySceneId(this.SceneId);
if (room != null)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
index 20854f6..9c94480 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
@@ -398,6 +398,32 @@
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 SendColorTemperatureLightStatuComand(CommonDevice device)
+ {
+ if (device == null)
+ {
+ return;
+ }
+ var colorDevice = (ColorTemperatureLight)device;
+ new System.Threading.Thread(() =>
+ {
+ colorDevice.ReadOnOffStatus();
+ System.Threading.Thread.Sleep(300);
+ colorDevice.ReadLevel();
+ System.Threading.Thread.Sleep(300);
+ colorDevice.ReadColorTemperature();
+ })
+ { IsBackground = true }.Start();
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs
index 97a36c8..24b9780 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs
@@ -533,7 +533,7 @@
return reResult;
}
//缃戝叧ID
- string gatewayID = HdlGatewayLogic.Current.GetGatewayId(device.Gateway);
+ string gatewayID = device.Gateway.GwId;
//閿欒涓婚
string errorTopic = gatewayID + "/" + "Error_Respon";
//妫�娴嬪璞$殑涓婚
@@ -543,6 +543,9 @@
}
bool canbreak = false;
+ BindObj.DelDeviceBindResponseData delDeviceBindData = null;
+ BindObj.RemoveBindResultResponseData removeBindResult = null;
+
Action<string, string> receiptAction = (topic, message) =>
{
var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
@@ -571,9 +574,38 @@
return;
}
reResult.listReceiptData[i] = jobject["Data"].ToString();
+
if (i == 0)
{
- //鍙湁鏄疊ind/RemoveBind_Respon涓婚,鎵嶈兘涓柇
+ //"Bind/RemoveBind_Respon"涓婚
+ delDeviceBindData = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.DelDeviceBindResponseData>(reResult.listReceiptData[i]);
+ }
+ else if (i == 1)
+ {
+ //"Bind/RemoveBindResult"涓婚
+ removeBindResult = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.RemoveBindResultResponseData>(reResult.listReceiptData[i]);
+ }
+
+ if (0 < delDeviceBindData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count)
+ {
+ canbreak = true;
+ }
+ else if (0 < delDeviceBindData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count)
+ {
+ if (removeBindResult != null)
+ {
+ canbreak = true;
+ }
+ }
+ else if (0 < delDeviceBindData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count)
+ {
+ if (removeBindResult != null)
+ {
+ canbreak = true;
+ }
+ }
+ else
+ {
canbreak = true;
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
index f3aa1f4..1cd0f07 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
@@ -76,7 +76,7 @@
return reResult;
}
//缃戝叧ID
- string gatewayID = HdlGatewayLogic.Current.GetGatewayId(device.Gateway);
+ string gatewayID = device.Gateway.GwId;
//閿欒涓婚
string errorTopic = gatewayID + "/" + "Error_Respon";
//妫�娴嬪璞$殑涓婚
@@ -179,7 +179,7 @@
return reResult;
}
//缃戝叧ID
- string gatewayID = HdlGatewayLogic.Current.GetGatewayId(device.Gateway);
+ string gatewayID = device.Gateway.GwId;
//閿欒涓婚
string errorTopic = gatewayID + "/" + "Error_Respon";
//妫�娴嬪璞$殑涓婚
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs
index 56207a7..9f21fd5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs
@@ -46,6 +46,11 @@
{
//鑾峰彇闂ㄩ攣鐨勪富閿甀D
var DoorLockId = await this.GetDoorHistoryDoorLockId(i_doorLock);
+ if (DoorLockId == null)
+ {
+ //缃戠粶涓嶉��
+ return;
+ }
var pra = new AddDoorHistoryLogPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
index c2a0213..c2b0eba 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
@@ -32,48 +32,6 @@
}
}
- /// <summary>
- /// 鎺у埗寤舵椂榛樿鍙嶉鐨勭嚎绋嬪垪琛�
- /// </summary>
- private List<System.Threading.Thread> ListThreads = new List<System.Threading.Thread> { };
-
- #endregion
-
- #region 鈻� 鍙戦�佹帶鍒跺懡浠ゅ欢鏃跺弽棣坃______________
-
- /// <summary>
- /// 鍙戦�佹帶鍒跺懡浠ゅ欢鏃跺弽棣�
- /// </summary>
- /// <param name="commonDevice">Common device.</param>
- /// <param name="action">Action.</param>
- /// <param name="delayTime">Delay time.</param>
- public void SendCommandDelayAction(CommonDevice commonDevice, Action action, int delayTime = 3)
- {
- var threadName = commonDevice.GetHashCode().ToString();
- if (ListThreads.Find((obj) => obj.Name == threadName) == null)
- {
- var thread = new System.Threading.Thread(() =>
- {
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalSeconds < delayTime)
- {
- System.Threading.Thread.Sleep(100);
- }
- lock (ListThreads)
- {
- ListThreads.RemoveAll((obj) => obj.Name == threadName);
- }
- action?.Invoke();
- })
- { IsBackground = true, Name = threadName };
- lock (ListThreads)
- {
- ListThreads.Add(thread);
- }
- thread.Start();
- }
- }
-
#endregion
#region 鈻� 鏄剧ず鎺у埗璁惧鏄惁鎴愬姛鐨勬彁绀篲________
@@ -140,6 +98,19 @@
return Language.StringByID(R.MyInternationalizationString.Close);
}
return $"{(int)((device as DimmableLight).Level * 1.0 / 254 * 100)}%";
+ }
+ else if (device.Type == DeviceType.ColorTemperatureLight)
+ {
+ //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
+ if (device.HadReadDeviceStatu == false)
+ {
+ return Language.StringByID(R.MyInternationalizationString.uOffLine);
+ }
+ if ((device as ColorTemperatureLight).OnOffStatus == 0)
+ {
+ return Language.StringByID(R.MyInternationalizationString.Close);
+ }
+ return $"{(int)((device as ColorTemperatureLight).Level * 1.0 / 254 * 100)}%";
}
else if (device.Type == DeviceType.WindowCoveringDevice)
{
@@ -333,9 +304,9 @@
//鐕冩皵
if (ias.iASInfo?.Alarm1 == 1)
{
- return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm);
+ return Language.StringByID(R.MyInternationalizationString.uGasLeakage);
}
- return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe);
+ return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
}
else if (info.ConcreteType == DeviceConcreteType.Sensor_Fire)
{
@@ -382,7 +353,15 @@
}
return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
}
- return null;
+ else
+ {
+ //鍏朵粬浼犳劅鍣�
+ if (ias.iASInfo?.Alarm1 == 1)
+ {
+ return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm);
+ }
+ return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
+ }
}
else if (device.Type == DeviceType.TemperatureSensor)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
index bfb0ab6..0420de5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
@@ -204,7 +204,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway))
+ if (tempZb.GwId != this.zbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
@@ -363,7 +363,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway))
+ if (tempZb.GwId != this.zbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs
index f02e380..198b656 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs
@@ -106,7 +106,7 @@
house.IsVirtually = true;
house.Save(false);
Config.Instance.HomeId = house.Id;
- Config.Instance.Home = House.GetHouseByHouseId(house.Id);
+ Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(house.Id);
//棰勫垱寤轰釜浜轰腑蹇冨叏閮ㄧ殑鏂囦欢澶�
UserCenterLogic.CreatAllUserCenterDirectory();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
index 75f38c3..d98fca7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
@@ -151,6 +151,13 @@
foreach (var data in verResult.PageData)
{
+ //鍥轰欢鐗堟湰鏄剧ず锛�
+ //10101 3涓猙yte 鏄剧ず涓猴細ver.1.01.01
+ if (data.FirmwareVersion.Length != 6 && data.FirmwareVersion.Length != 5)
+ {
+ //闈炴瑙勭殑鍥轰欢鐗堟湰,涓嶅啀鑰冭檻鑼冨洿鍐�
+ continue;
+ }
//纭欢鍒嗙被
FirmwareHardInfo hardInfo = null;
string hardCode = data.HardwareVersion;
@@ -219,6 +226,14 @@
//瀹冧笉鏄崌绾у浐浠�, .bin鏄壒娈婄殑
continue;
}
+ int testVersion = Convert.ToInt32(verInfo.FirmwareVersion.ToString().PadLeft(6, '0').Substring(2, 2));
+ if (testVersion % 2 != 0)
+ {
+ //涓棿閭d釜byte涓哄鏁版椂锛屼唬琛ㄦ槸娴嬭瘯鐗堟湰,鍦ㄦ樉绀烘渶鏂扮増鏈椂,涓嶉渶瑕佹樉绀猴紝浣嗘槸鍦ㄥ巻鍙茬増鏈偅閲屽彲浠ユ樉绀�
+ //涓棿閭d釜byte涓哄伓鏁版椂,浠h〃鏄寮忕増鏈�
+ continue;
+ }
+
if (verInfo.FirmwareVersion > nowVersion)
{
nowVersion = verInfo.FirmwareVersion;
@@ -341,23 +356,6 @@
Info.UpdateContent.AddRange(Arry);
}
- /// <summary>
- /// 灏嗗崄鍏繘鍒惰浆涓哄崄杩涘埗
- /// </summary>
- /// <param name="text"></param>
- /// <returns></returns>
- private static int ConvertHexToInt(string text)
- {
- if (text.StartsWith("0x"))
- {
- text = text.Substring(2);
- }
- try
- {
- return Convert.ToInt32(text, 16);
- }
- catch { return -1; }
- }
#endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayBackupLogic.cs
index cc5bdf5..c7706df 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayBackupLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayBackupLogic.cs
@@ -49,7 +49,7 @@
await System.Threading.Tasks.Task.Delay(1000);
//鍒涘缓涓�涓浠藉悕瀛�
- string backupClassId = await HdlBackupLogic.Current.CreatNewBackupNameToDB(backupName, 2, HdlGatewayLogic.Current.GetGatewayId(realGateway));
+ string backupClassId = await HdlBackupLogic.Current.CreatNewBackupNameToDB(backupName, 2, realGateway.GwId);
if (backupClassId == null)
{
//鍏抽棴杩涘害鏉�
@@ -423,7 +423,7 @@
var data = new Newtonsoft.Json.Linq.JObject {
{ "url", fullUrl }, { "RequestVersion", Common.CommonPage.RequestVersion },
{ "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", isAutoBack },
- { "BackupClassId", backupClassId },{ "GatewayUniqueId",HdlGatewayLogic.Current.GetGatewayId(realGateway)},
+ { "BackupClassId", backupClassId },{ "GatewayUniqueId",realGateway.GwId},
{ "IsOtherAccountCtrl",connectMode == HttpConnectMode.Admin?1:0}
};
jObject.Add("Data", data);
@@ -521,7 +521,7 @@
var data = new Newtonsoft.Json.Linq.JObject {
{ "url", fullUrl }, { "RequestVersion", Common.CommonPage.RequestVersion },
{ "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", isAutoBack },
- { "BackupClassId", backupClassId },{ "GatewayUniqueId",HdlGatewayLogic.Current.GetGatewayId(realGateway)},
+ { "BackupClassId", backupClassId },{ "GatewayUniqueId",realGateway.GwId},
{ "IsOtherAccountCtrl",connectMode == HttpConnectMode.Admin?1:0}
};
jObject.Add("Data", data);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
index c10dfa4..21a9022 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -69,8 +69,7 @@
continue;
}
//娣诲姞缂撳瓨
- string gwID = HdlGatewayLogic.Current.GetGatewayId(gateway);
- dicGateway[gwID] = gateway;
+ dicGateway[gateway.GwId] = gateway;
}
}
}
@@ -185,6 +184,16 @@
byte[] filebyte = Global.ReadFileByHomeId(file);
string strvalue = System.Text.Encoding.UTF8.GetString(filebyte);
var gateway = JsonConvert.DeserializeObject<ZbGateway>(strvalue);
+ if (gateway.GwId == string.Empty)
+ {
+ //杩欐槸鏃ф暟鎹�,闇�瑕佺壒娈婂鐞�
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(strvalue);
+ string gwInfo = jobject["getGwInfo"].ToString();
+
+ var result = JsonConvert.DeserializeObject<ZbGatewayData.GetGwData>(gwInfo);
+ //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ this.SetGatewayDataToLocalMemmory(gateway, result);
+ }
return gateway;
}
catch (Exception ex)
@@ -242,8 +251,8 @@
public void AddVirtualGateway(string gatewayId)
{
var gateWay = new ZbGateway { IsVirtual = true };
- gateWay.getGatewayBaseInfo.gwID = gatewayId;
- gateWay.getGatewayBaseInfo.HomeId = Shared.Common.Config.Instance.HomeId;
+ gateWay.GwId = gatewayId;
+ gateWay.HomeId = Shared.Common.Config.Instance.HomeId;
gateWay.ReSave();
this.dicGateway[gatewayId] = gateWay;
}
@@ -328,7 +337,7 @@
}
//鏄惁宸茬粡瀛樺湪
- string gwID = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ string gwID = zbGateway.GwId;
bool isEsist = HdlGatewayLogic.Current.IsGatewayExist(zbGateway);
if (isEsist == false)
{
@@ -340,11 +349,11 @@
//鍒锋柊鐨勬槸缂撳瓨,涓嶅埛鏂扮湡瀹炵墿鐞嗙綉鍏�
this.dicGateway[gwID].GatewayOnlineFlage = zbGateway.GatewayOnlineFlage;
- this.dicGateway[gwID].getGwInfo = result.getGwData;
- this.dicGateway[gwID].getGatewayBaseInfo.GwName = result.getGwData.GwName;
- this.dicGateway[gwID].getGatewayBaseInfo.IpAddress = result.getGwData.GwIP;
- this.dicGateway[gwID].getGatewayBaseInfo.HomeId = Common.Config.Instance.HomeId;
- this.dicGateway[gwID].ReSave();
+ //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ this.SetGatewayDataToLocalMemmory(this.dicGateway[gwID], result.getGwData);
+ //椤轰究杩欎釜鍙橀噺涔熻缃竴涓�
+ this.SetGatewayDataToLocalMemmory(zbGateway, result.getGwData, false);
+
if (isEsist == false)
{
//娣诲姞澶囦唤
@@ -379,8 +388,7 @@
{
//璋冪敤鎺ュ彛锛岀粦瀹氱綉鍏�(鍗充娇澶辫触锛屼篃杩斿洖true寰�涓嬭蛋)
var bindGateway = new BindGatewayPra();
- string gwID = this.GetGatewayId(zbGateway);
- bindGateway.BindGateways.Add(gwID);
+ bindGateway.BindGateways.Add(zbGateway.GwId);
//鑾峰彇鎺у埗涓讳汉璐﹀彿鐨凾oken
bindGateway.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
@@ -406,7 +414,7 @@
/// <returns></returns>
public bool HomeIdIsEmpty(ZbGateway zbGateway)
{
- return this.HomeIdIsEmpty(zbGateway.getGatewayBaseInfo.HomeId);
+ return this.HomeIdIsEmpty(zbGateway.HomeId);
}
/// <summary>
@@ -505,7 +513,7 @@
}
//鏄惁宸茬粡瀛樺湪
- string gwID = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ string gwID = zbGateway.GwId;
bool isEsist = HdlGatewayLogic.Current.IsGatewayExist(zbGateway);
if (isEsist == false)
{
@@ -517,11 +525,11 @@
//鍒锋柊鐨勬槸缂撳瓨,涓嶅埛鏂扮湡瀹炵墿鐞嗙綉鍏�
this.dicGateway[gwID].GatewayOnlineFlage = zbGateway.GatewayOnlineFlage;
- this.dicGateway[gwID].getGwInfo = result.getGwData;
- this.dicGateway[gwID].getGatewayBaseInfo.GwName = result.getGwData.GwName;
- this.dicGateway[gwID].getGatewayBaseInfo.IpAddress = result.getGwData.GwIP;
- this.dicGateway[gwID].getGatewayBaseInfo.HomeId = Common.Config.Instance.HomeId;
- this.dicGateway[gwID].ReSave();
+ //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ this.SetGatewayDataToLocalMemmory(this.dicGateway[gwID], result.getGwData);
+ //椤轰究杩欎釜鍙橀噺涔熻缃竴涓�
+ this.SetGatewayDataToLocalMemmory(zbGateway, result.getGwData, false);
+
if (isEsist == false)
{
//娣诲姞澶囦唤
@@ -579,8 +587,8 @@
}
//淇敼缂撳瓨
- string gwID = this.GetGatewayId(zbGateway);
- this.dicGateway[gwID].getGatewayBaseInfo.GwName = gatewayName;
+ string gwID = zbGateway.GwId;
+ this.dicGateway[gwID].GwName = gatewayName;
this.dicGateway[gwID].ReSave();
//娣诲姞鑷姩澶囦唤
@@ -633,7 +641,7 @@
if (this.GetRealGateway(ref realWay, gatewayId) == true)
{
//閲嶆柊璁剧疆浣忓畢ID(杩欎釜搴旇鏄笉缁忚繃APP,鐩存帴鎶婄綉鍏虫仮澶嶄簡鍑哄巶璁剧疆)
- if (this.HomeIdIsEmpty(realWay.getGatewayBaseInfo.HomeId) == true)
+ if (this.HomeIdIsEmpty(realWay.HomeId) == true)
{
int result2 = await this.ReBindNewGateway(realWay);
if (result2 == 0)
@@ -698,9 +706,8 @@
/// <param name="zbGateway"></param>
public async Task<bool> DeleteGateway(ZbGateway zbGateway)
{
- string gwID = this.GetGatewayId(zbGateway);
//绉婚櫎鏈湴缃戝叧淇℃伅
- return await this.DeleteGateway(gwID);
+ return await this.DeleteGateway(zbGateway.GwId);
}
/// <summary>
@@ -733,7 +740,7 @@
this.DeleteGatewayFile(zbGatewayID);
//绉婚櫎
- ZbGateway.GateWayList.RemoveAll((obj) => this.GetGatewayId(obj) == zbGatewayID);
+ ZbGateway.GateWayList.RemoveAll((obj) => obj.GwId == zbGatewayID);
//鏂紑mqtt杩炴帴
realWay.DisConnectLocalMqttClient("GD");
@@ -830,7 +837,7 @@
//鍒锋柊缂撳瓨鐨勫湪绾挎爣璇�
foreach (var zbway in listRealWay)
{
- string gwID = this.GetGatewayId(zbway);
+ string gwID = zbway.GwId;
if (this.dicGateway.ContainsKey(gwID) == false)
{
continue;
@@ -872,11 +879,11 @@
}
foreach (var way in listGateway)
{
- if (way == null || way.getGatewayBaseInfo == null)
+ if (way == null)
{
continue;
}
- string strId = this.GetGatewayId(way);
+ string strId = way.GwId;
if (dicDbGateway.ContainsKey(strId) == true) //濡傛灉浜戠涓婇潰鏈夎繖涓綉鍏�
{
way.GatewayOnlineFlage = dicDbGateway[strId].MqttOnlineStatus;
@@ -896,7 +903,7 @@
return false;
}
//浣跨敤缂撳瓨鐨勶紝鍥犱负鍒锋柊鍦ㄧ嚎鐘舵�佺殑鏃跺�欙紝鍒锋柊鐨勫氨鏄紦瀛橈紝鑰屼笉鏄湡瀹炵墿鐞嗙綉鍏�
- string gwID = this.GetGatewayId(zbGateway);
+ string gwID = zbGateway.GwId;
if (this.dicGateway.ContainsKey(gwID) == true)
{
return this.dicGateway[gwID].GatewayOnlineFlage;
@@ -922,12 +929,12 @@
List<ZbGateway> newlist = new List<ZbGateway>();
foreach (var way in list)
{
- if (Config.Instance.HomeId != way.getGatewayBaseInfo.HomeId)
+ if (Config.Instance.HomeId != way.HomeId)
{
//濡傛灉涓嶆槸褰撳墠浣忓畢
continue;
}
- string gwID = this.GetGatewayId(way);
+ string gwID = way.GwId;
if (this.dicGateway.ContainsKey(gwID) == false)
{
//濡傛灉鏈湴骞舵病鏈夎繖涓綉鍏�
@@ -997,11 +1004,11 @@
/// <returns></returns>
public bool GetRealGateway(ref ZbGateway zbGateway, ZbGateway tagartWay)
{
- if (tagartWay == null || tagartWay.getGatewayBaseInfo == null)
+ if (tagartWay == null)
{
return false;
}
- return this.GetRealGateway(ref zbGateway, this.GetGatewayId(tagartWay));
+ return this.GetRealGateway(ref zbGateway, tagartWay.GwId);
}
/// <summary>
@@ -1014,14 +1021,14 @@
{
var realWay = ZbGateway.GateWayList.Find((obj) =>
{
- return this.GetGatewayId(obj) == gwId;
+ return obj.GwId == gwId;
});
if (realWay == null)
{
//濡傛灉缃戝叧瀵硅薄涓㈠け浜�,鍒欏垱寤轰釜鏂扮殑
realWay = new ZbGateway { IsVirtual = true, };
- realWay.getGatewayBaseInfo.gwID = gwId;
- realWay.getGatewayBaseInfo.HomeId = Shared.Common.Config.Instance.HomeId;
+ realWay.GwId = gwId;
+ realWay.HomeId = Shared.Common.Config.Instance.HomeId;
ZbGateway.GateWayList.Add(realWay);
}
zbGateway = realWay;
@@ -1292,63 +1299,6 @@
#endregion
- #region 鈻� 鑾峰彇缃戝叧GwInfo閲岄潰鐨勫睘鎬__________
-
- /// <summary>
- /// 鑾峰彇缃戝叧GwInfo閲岄潰鐨勫睘鎬�
- /// </summary>
- /// <param name="zbGateway">缃戝叧瀵硅薄</param>
- /// <param name="attributeName">getGwInfo閲岄潰灞炴�х殑鍚嶅瓧</param>
- /// <param name="defult">濡傛灉鑾峰彇涓嶅埌鏃讹紝璁剧疆鐨勯粯璁ゅ��</param>
- /// <returns></returns>
- public object GetGwInfoAttribute(ZbGateway zbGateway, string attributeName, string defult = "")
- {
- string gwID = this.GetGatewayId(zbGateway);
- var localWay = this.GetLocalGateway(gwID);
-
- object objValue = null;
- if (localWay == null || localWay.getGwInfo == null)
- {
- //鏈湴娌℃湁璁板綍鏈夎繖涓笢瑗�,鍒欑洿鎺ヨ繑鍥炲弬鏁扮殑鏁版嵁
- if (zbGateway.getGwInfo != null)
- {
- objValue = zbGateway.getGwInfo.GetType().InvokeMember(attributeName, System.Reflection.BindingFlags.GetField, null, zbGateway.getGwInfo, null);
- }
- else
- {
- return defult;
- }
- }
- else
- {
- //鑾峰彇鏈湴鐨勫睘鎬�
- objValue = localWay.getGwInfo.GetType().InvokeMember(attributeName, System.Reflection.BindingFlags.GetField, null, localWay.getGwInfo, null);
- }
-
- if (objValue == null)
- {
- return defult;
- }
- return objValue;
- }
-
- #endregion
-
- #region 鈻� 鑾峰彇缃戝叧ID(鏈夌壒娈婃剰涔�)_____________
-
- /// <summary>
- /// 鑾峰彇缃戝叧瀵硅薄閲岄潰鐨勭綉鍏矷D(灏佽杩欎釜鏂规硶鏈夌壒娈婃剰涔�)
- /// </summary>
- /// <param name="zbGateway">缃戝叧瀵硅薄</param>
- /// <returns></returns>
- public string GetGatewayId(ZbGateway zbGateway)
- {
- //杩欎釜涓滆タ涓嶄細涓虹┖
- return zbGateway.getGatewayBaseInfo.gwID;
- }
-
- #endregion
-
#region 鈻� 鑾峰彇鍚嶇О___________________________
/// <summary>
@@ -1359,10 +1309,10 @@
/// <returns></returns>
public string GetGatewayName(ZbGateway zbGateway, GetNameMode mode = GetNameMode.SpecialGateway)
{
- string gwId = this.GetGatewayId(zbGateway);
+ string gwId = zbGateway.GwId;
if (this.dicGateway.ContainsKey(gwId) == false)
{
- return zbGateway.getGatewayBaseInfo.GwName == null ? string.Empty : zbGateway.getGatewayBaseInfo.GwName;
+ return zbGateway.GwName;
}
var localWay = this.dicGateway[gwId];
@@ -1372,9 +1322,9 @@
return name;
}
- if (mode == GetNameMode.SpecialGateway && localWay.getGwInfo != null)
+ if (mode == GetNameMode.SpecialGateway)
{
- string keyName = Common.LocalDevice.deviceModelIdName + this.GetGwInfoAttribute(localWay, "LinuxImageType").ToString();
+ string keyName = Common.LocalDevice.deviceModelIdName + localWay.LinuxImageType;
if (LocalDevice.Current.dicDeviceAllNameID.ContainsKey(keyName) == true)
{
//娌℃湁鍚嶇О鏃讹紝鍒欎娇鐢≧鏂囦欢閲岄潰璁剧疆鐨勯粯璁よ澶囧悕绉�
@@ -1396,7 +1346,7 @@
{
return string.Empty;
}
- return zbGateway.getGatewayBaseInfo.GwName;
+ return zbGateway.GwName;
}
/// <summary>
@@ -1410,13 +1360,13 @@
//鍒濆鍊�:鏃犳硶璇嗗埆鐨勭綉鍏宠澶�
button.TextID = R.MyInternationalizationString.uUnDistinguishTheGatewayDevice;
- string gwId = this.GetGatewayId(zbGateway);
- if (this.dicGateway.ContainsKey(gwId) == false || this.dicGateway[gwId].getGwInfo == null)
+ string gwId = zbGateway.GwId;
+ if (this.dicGateway.ContainsKey(gwId) == false)
{
//濡傛灉杩欎釜缃戝叧娌℃湁淇℃伅锛屽垯浠庢柊鑾峰彇
- if (zbGateway.getGwInfo != null && zbGateway.getGwInfo.LinuxImageType != 0)
+ if (zbGateway.LinuxImageType != -1)
{
- string keyName = Common.LocalDevice.deviceModelIdName + zbGateway.getGwInfo.LinuxImageType;
+ string keyName = Common.LocalDevice.deviceModelIdName + zbGateway.LinuxImageType;
if (Common.LocalDevice.Current.dicDeviceAllNameID.ContainsKey(keyName) == true)
{
//浣跨敤R鏂囦欢閲岄潰璁剧疆鐨勪笢瑗�
@@ -1431,10 +1381,12 @@
var result = await this.GetGatewayNewInfoAsync(zbGateway, ShowErrorMode.NO);
if (result != null)
{
- zbGateway.getGwInfo = result;
+ //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ this.SetGatewayDataToLocalMemmory(zbGateway, result, false);
+
HdlThreadLogic.Current.RunMain(() =>
{
- string keyName = Common.LocalDevice.deviceModelIdName + zbGateway.getGwInfo.LinuxImageType;
+ string keyName = Common.LocalDevice.deviceModelIdName + zbGateway.LinuxImageType;
if (Common.LocalDevice.Current.dicDeviceAllNameID.ContainsKey(keyName) == true)
{
//浣跨敤R鏂囦欢閲岄潰璁剧疆鐨勪笢瑗�
@@ -1447,7 +1399,7 @@
}
else
{
- string keyName = Common.LocalDevice.deviceModelIdName + this.dicGateway[gwId].getGwInfo.LinuxImageType;
+ string keyName = Common.LocalDevice.deviceModelIdName + this.dicGateway[gwId].LinuxImageType;
if (Common.LocalDevice.Current.dicDeviceAllNameID.ContainsKey(keyName) == true)
{
//浣跨敤R鏂囦欢閲岄潰璁剧疆鐨勪笢瑗�
@@ -1504,17 +1456,16 @@
return null;
}
- string gwID = this.GetGatewayId(zbGateway);
+ string gwID = zbGateway.GwId;
if (this.dicGateway.ContainsKey(gwID) == true)
{
//鍒锋柊缂撳瓨
ZbGateway localWay = this.dicGateway[gwID];
- localWay.getGwInfo = imageTypeResult.getGwData;
- localWay.getGatewayBaseInfo.GwName = imageTypeResult.getGwData.GwName;
- localWay.getGatewayBaseInfo.IpAddress = imageTypeResult.getGwData.GwIP;
-
- localWay.ReSave();
+ //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ this.SetGatewayDataToLocalMemmory(localWay, imageTypeResult.getGwData);
}
+ //椤轰究杩欎釜鍙橀噺涔熻缃竴涓�
+ this.SetGatewayDataToLocalMemmory(zbGateway, imageTypeResult.getGwData, false);
return imageTypeResult.getGwData;
}
@@ -1542,6 +1493,32 @@
return result;
}
+ /// <summary>
+ /// 灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ /// </summary>
+ /// <param name="localWay">鏈湴缃戝叧</param>
+ /// <param name="data">缃戝叧鏁版嵁</param>
+ /// <param name="saveFile">鏄惁淇濆瓨鏂囦欢</param>
+ private void SetGatewayDataToLocalMemmory(ZbGateway localWay, ZbGatewayData.GetGwData data, bool saveFile = true)
+ {
+ localWay.GwId = data.GwId;
+ localWay.GwName = data.GwName;
+ localWay.GwSerialNum = data.GWSN;
+ localWay.IsMainGateWay = data.IsDominant == 1 ? true : false;
+ localWay.GwIP = data.GwIP;
+ localWay.LinuxImageType = data.LinuxImageType;
+ localWay.LinuxHardVersion = data.LinuxHWVersion;
+ localWay.LinuxFirmwareVersion = data.LinuxFWVersion;
+ localWay.CoordinatorHardVersion = data.ZbHWVersion;
+ localWay.CoordinatorFirmwareVersion = data.ZbFWVersion;
+ localWay.CoordinatorImageId = data.ZbImageType;
+ localWay.DriveCodeList = data.DriveCodeList;
+ if (saveFile == true)
+ {
+ localWay.ReSave();
+ }
+ }
+
#endregion
#region 鈻� 缃戝叧鎴块棿鐩稿叧_______________________
@@ -1553,8 +1530,7 @@
/// <returns></returns>
public Room GetRoomByGateway(ZbGateway zbGateway)
{
- var gatewayId = this.GetGatewayId(zbGateway);
- return this.GetRoomByGateway(gatewayId);
+ return this.GetRoomByGateway(zbGateway.GwId);
}
/// <summary>
@@ -1579,8 +1555,7 @@
/// <param name="roomId">鎴块棿ID</param>
public void ChangedGatewayRoom(ZbGateway zbGateway, string roomId)
{
- var gatewayId = this.GetGatewayId(zbGateway);
- var localGateway = this.GetLocalGateway(gatewayId);
+ var localGateway = this.GetLocalGateway(zbGateway.GwId);
if (localGateway != null)
{
localGateway.RoomId = roomId;
@@ -1631,65 +1606,59 @@
return null;
}
//浣跨敤鏈湴缂撳瓨瀵硅薄
- string gwID = this.GetGatewayId(zbGateway);
- var localWay = this.GetLocalGateway(gwID);
+ var localWay = this.GetLocalGateway(zbGateway.GwId);
if (localWay == null)
{
return null;
}
//娣诲姞缃戝叧鐨勫崌绾у浐浠�(鎴愪笉鎴愬姛閮芥棤鎵�璋�)
- var flage = await HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.Linux,
- this.GetGwInfoAttribute(localWay, "LinuxHWVersion").ToString(),
- this.GetGwInfoAttribute(localWay, "LinuxImageType").ToString());
+ var flage = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.Linux,
+ localWay.LinuxHardVersion.ToString(),
+ localWay.LinuxImageType.ToString());
//娣诲姞鍗忚皟鍣ㄧ殑鍗囩骇鍥轰欢(鎴愪笉鎴愬姛閮芥棤鎵�璋�)
- flage = await HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.Coordinator,
- this.GetGwInfoAttribute(localWay, "ZbHWVersion").ToString(),
- this.GetGwInfoAttribute(localWay, "ZbImageType").ToString());
+ flage = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.Coordinator,
+ localWay.CoordinatorHardVersion.ToString(),
+ localWay.CoordinatorImageId.ToString());
//缃戝叧鐨勭増鏈�
var gatewayFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.Linux,
- this.GetGwInfoAttribute(localWay, "LinuxHWVersion").ToString(),
- this.GetGwInfoAttribute(localWay, "LinuxImageType").ToString(),
- Convert.ToInt32(this.GetGwInfoAttribute(localWay, "LinuxFWVersion")));
+ localWay.LinuxHardVersion.ToString(),
+ localWay.LinuxImageType.ToString(),
+ localWay.LinuxFirmwareVersion);
//鍗忚皟鍣ㄧ増鏈�
var coordinatorFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.Coordinator,
- this.GetGwInfoAttribute(localWay, "ZbHWVersion").ToString(),
- this.GetGwInfoAttribute(localWay, "ZbImageType").ToString(),
- Convert.ToInt32(this.GetGwInfoAttribute(localWay, "ZbFWVersion")));
+ localWay.CoordinatorHardVersion.ToString(),
+ localWay.CoordinatorImageId.ToString(),
+ localWay.CoordinatorFirmwareVersion);
var list = new List<FirmwareVersionInfo>();
list.Add(gatewayFirmware);
list.Add(coordinatorFirmware);
//杩欎釜缃戝叧闇�瑕佹湁铏氭嫙椹卞姩杩欎釜涓滆タ鎵嶈
- string linImage = this.GetGwInfoAttribute(localWay, "LinuxImageType").ToString();
- if (linImage != "6")
+ if (localWay.LinuxImageType != 6)
{
//铏氭嫙椹卞姩鍙�
- var listvVode = await HdlGatewayLogic.Current.GetListVDDriveCode(localWay);
- if (listvVode != null && listvVode.Count > 0)
+ foreach (var data in localWay.DriveCodeList)
{
- foreach (var data in listvVode)
+ //娣诲姞铏氭嫙椹卞姩鐨勫崌绾у浐浠�(鎴愪笉鎴愬姛閮芥棤鎵�璋�)
+ flage = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.VirtualDevice,
+ data.DriveHwVersion.ToString(),
+ data.DriveImageType.ToString());
+
+ //铏氭嫙椹卞姩
+ var virtualFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.VirtualDevice,
+ data.DriveHwVersion.ToString(),
+ data.DriveImageType.ToString(),
+ data.DriveFwVersion);
+
+ if (virtualFirmware != null)
{
- //娣诲姞铏氭嫙椹卞姩鐨勫崌绾у浐浠�(鎴愪笉鎴愬姛閮芥棤鎵�璋�)
- flage = await HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.VirtualDevice,
- data.DriveHwVersion.ToString(),
- data.DriveImageType.ToString());
-
- //铏氭嫙椹卞姩
- var virtualFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.VirtualDevice,
- data.DriveHwVersion.ToString(),
- data.DriveImageType.ToString(),
- data.DriveFwVersion);
-
- if (virtualFirmware != null)
- {
- virtualFirmware.VirtualCode = data.DriveCode;
- list.Add(virtualFirmware);
- }
+ virtualFirmware.VirtualCode = data.DriveCode;
+ list.Add(virtualFirmware);
}
}
}
@@ -1706,31 +1675,20 @@
/// </summary>
/// <param name="zbGateway"></param>
/// <returns></returns>
- public async Task<List<ZbGatewayData.DriveCodeObj>> GetListVDDriveCode(ZbGateway zbGateway)
+ public List<ZbGatewayData.DriveCodeObj> GetListVDDriveCode(ZbGateway zbGateway)
{
- ZbGateway zbTemp = null;
- if (this.GetRealGateway(ref zbTemp, zbGateway) == false)
+ var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 505 } };
+ var result = this.SendJobjectDataToGateway(zbGateway, "VirtualDrive/CatDriveCode", jObject.ToString(), "VirtualDrive/CatDriveCode_Respon");
+ if (result.ErrorMsg != null)
+ {
+ this.ShowTipMsg(result.ErrorMsg);
+ }
+ if (result.ErrorMsgDiv == 0)
{
return null;
}
- var result = await zbTemp.CheckVDDriveCodeAsync();
- //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
- string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
- if (error != null)
- {
- this.ShowTipMsg(error);
- return null;
- }
-
- if (result == null || result.vDriveDriveCodeResponData == null || result.vDriveDriveCodeResponData.DriveCodeList == null)
- {
- return null;
- }
- if (result.vDriveDriveCodeResponData.DriveCodeList.Count > 0)
- {
- return result.vDriveDriveCodeResponData.DriveCodeList;
- }
- return null;
+ var dataInfo = JsonConvert.DeserializeObject<ZbGatewayData.VDriveDriveCodeResponData>(result.ReceiptData);
+ return dataInfo.DriveCodeList;
}
#endregion
@@ -1744,8 +1702,7 @@
/// <returns></returns>
public int IsMainGateway(ZbGateway zbGateway)
{
- string gwID = this.GetGatewayId(zbGateway);
- return this.IsMainGateway(gwID);
+ return this.IsMainGateway(zbGateway.GwId);
}
/// <summary>
@@ -1774,13 +1731,12 @@
/// <param name="zbGateway"></param>
public void SetRealGatewayPictrue(Button button, ZbGateway zbGateway)
{
- string gwID = this.GetGatewayId(zbGateway);
- var localWay = this.GetLocalGateway(gwID);
- if (localWay == null || localWay.getGwInfo == null)
+ var localWay = this.GetLocalGateway(zbGateway.GwId);
+ if (localWay == null)
{
- if (zbGateway.getGwInfo != null && zbGateway.getGwInfo.LinuxImageType != 0)
+ if (zbGateway.LinuxImageType != -1)
{
- button.UnSelectedImagePath = "Gateway/RealGateway" + zbGateway.getGwInfo.LinuxImageType + ".png";
+ button.UnSelectedImagePath = "Gateway/RealGateway" + zbGateway.LinuxImageType + ".png";
}
else
{
@@ -1790,7 +1746,8 @@
var result = await this.GetGatewayNewInfoAsync(zbGateway, ShowErrorMode.NO);
if (result != null)
{
- zbGateway.getGwInfo = result;
+ //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ this.SetGatewayDataToLocalMemmory(zbGateway, result, false);
HdlThreadLogic.Current.RunMain(() =>
{
button.UnSelectedImagePath = "Gateway/RealGateway" + result.LinuxImageType + ".png";
@@ -1801,7 +1758,7 @@
}
else
{
- button.UnSelectedImagePath = "Gateway/RealGateway" + localWay.getGwInfo.LinuxImageType + ".png";
+ button.UnSelectedImagePath = "Gateway/RealGateway" + localWay.LinuxImageType + ".png";
}
}
@@ -1812,13 +1769,12 @@
/// <param name="zbGateway"></param>
public void SetGatewayIcon(Button button, ZbGateway zbGateway)
{
- string gwID = this.GetGatewayId(zbGateway);
- var localWay = this.GetLocalGateway(gwID);
- if (localWay == null || localWay.getGwInfo == null)
+ var localWay = this.GetLocalGateway(zbGateway.GwId);
+ if (localWay == null)
{
- if (zbGateway.getGwInfo != null && zbGateway.getGwInfo.LinuxImageType != 0)
+ if (zbGateway.LinuxImageType != -1)
{
- button.UnSelectedImagePath = "Gateway/GatewayIcon" + zbGateway.getGwInfo.LinuxImageType + ".png";
+ button.UnSelectedImagePath = "Gateway/GatewayIcon" + zbGateway.LinuxImageType + ".png";
}
else
{
@@ -1828,7 +1784,8 @@
var result = await this.GetGatewayNewInfoAsync(zbGateway, ShowErrorMode.NO);
if (result != null)
{
- zbGateway.getGwInfo = result;
+ //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
+ this.SetGatewayDataToLocalMemmory(zbGateway, result, false);
HdlThreadLogic.Current.RunMain(() =>
{
button.UnSelectedImagePath = "Gateway/GatewayIcon" + result.LinuxImageType + ".png";
@@ -1839,7 +1796,7 @@
}
else
{
- button.UnSelectedImagePath = "Gateway/GatewayIcon" + localWay.getGwInfo.LinuxImageType + ".png";
+ button.UnSelectedImagePath = "Gateway/GatewayIcon" + localWay.LinuxImageType + ".png";
}
}
@@ -1854,8 +1811,7 @@
/// <returns></returns>
public bool IsGatewayExist(ZbGateway zbGateway)
{
- string gwID = this.GetGatewayId(zbGateway);
- return this.IsGatewayExist(gwID);
+ return this.IsGatewayExist(zbGateway.GwId);
}
/// <summary>
@@ -2078,7 +2034,7 @@
/// <param name="zbGateway"></param>
public void BackupGatewayIdOnNotNetwork(ZbGateway zbGateway)
{
- var strId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ var strId = zbGateway.GwId;
if (listBackupGwId.Contains(strId) == false)
{
listBackupGwId.Add(strId);
@@ -2149,39 +2105,73 @@
#endregion
- #region 鈻� 涓婁紶璁惧澶囦唤鍒扮綉鍏砡________________
+ #region 鈻� 鍙戦�佺綉鍏冲懡浠ょ粰缃戝叧_________________
/// <summary>
- /// 涓婁紶璁惧澶囦唤鍒扮綉鍏�(搴熷純)
+ /// 鍙戦�佹暟鎹埌缃戝叧锛屽苟鎺ュ彈缃戝叧杩斿洖鐨勬暟鎹�(ReceiptData涓鸿繑鍥炲��)
/// </summary>
- /// <param name="device">璁惧瀵硅薄</param>
- /// <param name="backupEnum">澶囦唤绫诲瀷</param>
- /// <param name="upLaodData">澶囦唤鐨勬暟鎹�</param>
- /// <returns></returns>
- public async Task<bool> UpLoadDeviceBackupDataToGateway(CommonDevice device, object upLaodData)
+ /// <param name="gateway">缃戝叧瀵硅薄</param>
+ /// <param name="sendTopic">鍙戦�佺殑涓婚</param>
+ /// <param name="sendData">闇�瑕佸彂閫佺殑鏁版嵁 JObject.ToString()鐨勪笢瑗�</param>
+ /// <param name="receiptTopic">鎸囧畾鎺ユ敹鍝釜涓婚</param>
+ /// <param name="waitTime">瓒呮椂鏃堕棿(绉�)</param>
+ /// <returns>缃戝叧杩斿洖鐨勬暟鎹�</returns>
+ public ReceiptGatewayResult SendJobjectDataToGateway(ZbGateway gateway, string sendTopic, string sendData, string receiptTopic, int waitTime = 5)
{
- //ZbGateway realWay = null;
- //if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, device.CurrentGateWayId) == false)
- //{
- // //娌℃湁鎵惧埌鐪熷疄鐗╃悊缃戝叧
- // return false;
- //}
- //string fileName = device.FilePath + ((int)backupEnum).ToString().PadLeft(5, '0');
- ////鍒涘缓鏂囦欢瀵硅薄
- //var result = await realWay.CreateFileAsync(fileName);
- //if (result == null || result.Result != 0)
- //{
- // return false;
- //}
- ////鍙戦�佹暟鎹祦
- //var data = Newtonsoft.Json.JsonConvert.SerializeObject(upLaodData);
- //var byteData = System.Text.Encoding.UTF8.GetBytes(data);
- //var result2 = await realWay.SendFileAsync(byteData);
- //if (result2 == null || result2.Result != 0)
- //{
- // return false;
- //}
- return true;
+ var reResult = new ReceiptGatewayResult();
+
+ ZbGateway myGateway = null;
+ if (this.GetRealGateway(ref myGateway, gateway) == false)
+ {
+ //鑾峰彇缃戝叧瀵硅薄澶辫触
+ reResult.ErrorMsg = Language.StringByID(R.MyInternationalizationString.uGetGatewayTagartFail);
+ reResult.ErrorMsgDiv = -1;
+ return reResult;
+ }
+ //缃戝叧ID
+ string gatewayID = gateway.GwId;
+ //閿欒涓婚
+ string errorTopic = gatewayID + "/" + "Error_Respon";
+ //妫�娴嬪璞$殑涓婚
+ string checkTopic = gatewayID + "/" + receiptTopic;
+
+ Action<string, string> receiptAction = (topic, message) =>
+ {
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
+
+ //缃戝叧鍥炲閿欒
+ if (topic == errorTopic)
+ {
+ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
+ reResult.ErrorMsg = HdlCheckLogic.Current.CheckCommonErrorCode(temp.Error);
+ }
+ //濡傛灉鏄寚瀹氱殑涓婚
+ if (topic == checkTopic)
+ {
+ reResult.ReceiptData = jobject["Data"].ToString();
+ }
+ };
+ myGateway.Actions += receiptAction;
+ //鍙戦�佹暟鎹�
+ myGateway.Send(sendTopic, sendData);
+
+ //瓒呮椂鏃堕棿
+ int TimeOut = 0;
+ waitTime = 20 * waitTime;
+ while (reResult.ReceiptData == null && TimeOut < waitTime)
+ {
+ //鍏ㄩ儴鎺ユ敹鎵嶉��鍑�
+ System.Threading.Thread.Sleep(50);
+ TimeOut++;
+ }
+ myGateway.Actions -= receiptAction;
+ receiptAction = null;
+ if (reResult.ReceiptData == null)
+ {
+ reResult.ErrorMsgDiv = 0;
+ }
+
+ return reResult;
}
#endregion
@@ -2280,8 +2270,7 @@
var hadGwOnline = false;
foreach (var way in list)
{
- string gwId = this.GetGatewayId(way);
- if (dicOldOnline.ContainsKey(gwId) == true)
+ if (dicOldOnline.ContainsKey(way.GwId) == true)
{
if (way.GatewayOnlineFlage == true)
{
@@ -2294,7 +2283,7 @@
foreach (var way in list)
{
- string gwId = this.GetGatewayId(way);
+ string gwId = way.GwId;
if (dicOldOnline.ContainsKey(gwId) == true)
{
//缃戝叧涔熶笉澶�,鐩存帴鎺ㄩ�佸惂
@@ -2370,8 +2359,7 @@
foreach (var zbway in this.dicGateway.Values)
{
//鑾峰彇鍓嶅洖鐨勫湪绾跨姸鎬�
- string gwId = this.GetGatewayId(zbway);
- dicOldOnline[gwId] = zbway.GatewayOnlineFlage;
+ dicOldOnline[zbway.GwId] = zbway.GatewayOnlineFlage;
}
return dicOldOnline;
}
@@ -2397,9 +2385,12 @@
}
//缃戝叧鍦ㄧ嚎鎺ㄩ��
var zbway = this.GetLocalGateway(gwId);
- zbway.GatewayOnlineFlage = online;
-
- UserCenterResourse.DicActionForm[formId]?.GatewayOnlinePush(zbway, online, hadGwOnline);
+ if (zbway != null)
+ {
+ //鍒囨崲浣忓畢鏃�,杩欎釜涓滆タ鏈夊彲鑳芥槸null
+ zbway.GatewayOnlineFlage = online;
+ UserCenterResourse.DicActionForm[formId]?.GatewayOnlinePush(zbway, online, hadGwOnline);
+ }
}
}
catch { }
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
index f7cd9b4..48f59b9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -406,10 +406,36 @@
else if (report.DeviceStatusReport.CluterID == 8)
{
locadevice.DeviceStatusReport = report.DeviceStatusReport;
- if (locadevice.Type == DeviceType.DimmableLight && report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+ if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
{
- //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
- ((DimmableLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ if (locadevice.Type == DeviceType.DimmableLight)
+ {
+ //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
+ ((DimmableLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ }
+ else if (locadevice.Type == DeviceType.ColorTemperatureLight)
+ {
+ //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
+ ((ColorTemperatureLight)locadevice).Level = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ }
+ //宸茬粡鎺ユ敹鍒扮姸鎬�
+ locadevice.HadReadDeviceStatu = true;
+ }
+ }
+ #endregion
+
+ #region 鈻� 鑹叉俯鏁版嵁
+ //鑹叉俯鏁版嵁
+ else if (report.DeviceStatusReport.CluterID == 768)
+ {
+ locadevice.DeviceStatusReport = report.DeviceStatusReport;
+ if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+ {
+ if (locadevice.Type == DeviceType.ColorTemperatureLight)
+ {
+ //姝ゅ睘鎬ц〃鏄庡綋鍓嶈壊娓�
+ ((ColorTemperatureLight)locadevice).ColorTemperature = report.DeviceStatusReport.AttriBute[0].AttriButeData;
+ }
//宸茬粡鎺ユ敹鍒扮姸鎬�
locadevice.HadReadDeviceStatu = true;
}
@@ -510,11 +536,16 @@
strValue = strValue.Substring(0, strValue.Length - 1);
humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
}
- //娓╁害浼犳劅鍣�
+ //婀垮害浼犳劅鍣�
if (locadevice is TemperatureSensor)
{
((TemperatureSensor)locadevice).Humidity = humidity;
}
+ //鏂伴鐨勬箍搴︿紶鎰熷櫒
+ else if (locadevice is HumiditySensor)
+ {
+ ((HumiditySensor)locadevice).Humidity = humidity;
+ }
//PM2.5浼犳劅鍣�
else if (locadevice is PMSensor)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs
index 82b77b8..36fc2e9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs
@@ -82,7 +82,7 @@
if (this.UpdateStatu == UpdateStatuMode.Wait)
{
//濡傛灉鏄瓑寰呮ā寮忥紝鍐嶆鐐瑰嚮鏃讹紝绉婚櫎鍒楄〃
- string gwId = HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway);
+ string gwId = this.upDatezbGateway.GwId;
if (FirmwareUpdateResourse.dicUpdateList.ContainsKey(gwId) == true)
{
FirmwareUpdateResourse.dicUpdateList.Remove(gwId);
@@ -101,7 +101,7 @@
//杩涘叆绛夊緟妯″紡
this.UpdateStatu = UpdateStatuMode.Wait;
- string gwId2 = HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway);
+ string gwId2 = this.upDatezbGateway.GwId;
FirmwareUpdateResourse.dicUpdateList[gwId2] = this;
//绛夊緟涓��
this.UpdateStatuChangedEvent?.Invoke(0, Language.StringByID(R.MyInternationalizationString.uWaitting));
@@ -240,7 +240,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway))
+ if (tempZb.GwId != this.upDatezbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
@@ -343,7 +343,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway))
+ if (tempZb.GwId != this.upDatezbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
@@ -445,7 +445,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway))
+ if (tempZb.GwId != this.upDatezbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
@@ -543,7 +543,7 @@
}
var tempZb = (ZbGateway)objValue;
- if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway))
+ if (tempZb.GwId != this.upDatezbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
@@ -643,7 +643,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway))
+ if (tempZb.GwId != this.upDatezbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs
index 997240b..c60d868 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing Shared.Common;
+using System;
using System.Collections.Generic;
using System.Text;
@@ -32,6 +33,272 @@
#endregion
+ #region 鈻� 鍒涘缓鏂颁綇瀹卂________________________
+
+ /// <summary>
+ /// 鍒涘缓鏂扮殑浣忓畢(杩斿洖浣忓畢id,null浠h〃澶辫触)
+ /// </summary>
+ /// <param name="residenceName">浣忓畢鍚嶇О</param>
+ public async System.Threading.Tasks.Task<string> CreatNewResidence(string residenceName)
+ {
+ var Pra = new AddResidencePra();
+ Pra.Name = residenceName;
+ //娣诲姞浣忓畢
+ string resultData = await UserCenterLogic.GetResponseDataByRequestHttps("App/AddHome", false, Pra);
+ if (resultData == null)
+ {
+ return null;
+ }
+ var newInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<NewResidenceInfo>>(resultData);
+
+ //娣诲姞浣忓畢鍒扮紦瀛�
+ this.AddHouseToMemmory(newInfo[0].Id, residenceName);
+
+ return newInfo[0].Id;
+ }
+
+ /// <summary>
+ /// 娣诲姞浣忓畢鍒扮紦瀛�
+ /// </summary>
+ /// <param name="houseId">浣忓畢id</param>
+ /// <param name="houseName">浣忓畢鍚嶇О.</param>
+ /// <param name="isOthreShare">鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹�</param>
+ /// <param name="accountType">浠呭瓙璐﹀彿鐧婚檰鐨勬椂鍊欎娇鐢�,褰撱�怚sOthreShare銆戜负"true"锛屽苟涓斻�怉ccountType銆戜负"1"鏃讹紝璇ヨ处鍙锋嫢鏈夌鐞嗗憳鏉冮檺</param>
+ public void AddHouseToMemmory(string houseId, string houseName,
+ bool isOthreShare = false, int accountType = 0)
+ {
+ var home = new Common.House();
+ home.Id = houseId;
+ home.Name = houseName;
+ home.IsOthreShare = isOthreShare;
+ home.AccountType = accountType;
+
+ //鍒涘缓鏂囦欢澶�
+ Common.Global.CreateHomeDirectory(houseId);
+ home.Save();
+ Common.Config.Instance.HomeFilePathList.Add(home.FileName);
+ Common.Config.Instance.Save();
+ //濡傛灉褰撳墠娌℃湁浣忓畢鐨勮瘽
+ if (Common.Config.Instance.Home.Id == string.Empty)
+ {
+ Common.Config.Instance.Home = this.GetHouseByFilePath(home.FileName);
+ Common.Config.Instance.HomeId = home.Id;
+ }
+ }
+
+
+ #endregion
+
+ #region 鈻� 鍒囨崲浣忓畢___________________________
+
+ /// <summary>
+ /// 鍒囨崲浣忓畢(娉�:瀹冨彧鍒囨崲鍐呭瓨,鐣岄潰骞舵湭澶勭悊)
+ /// </summary>
+ /// <param name="residenceId"></param>
+ /// <returns></returns>
+ public async System.Threading.Tasks.Task SwitchResidence(string residenceId)
+ {
+ //鎵撳紑杩涘害鏉�
+ ProgressBar.Show();
+
+ Config.Instance.HomeId = residenceId;
+ //閲嶆柊鍒濆鍖栦綇瀹呭璞�
+ Config.Instance.Home = this.GetHouseByHouseId(residenceId);
+ Config.Instance.Save();
+ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
+ await UserCenterLogic.InitUserCenterMenmoryAndThread(false);
+
+ //鍏抽棴杩涘害鏉�
+ ProgressBar.Close();
+ }
+
+ #endregion
+
+ #region 鈻� 缂栬緫浣忓畢___________________________
+
+ /// <summary>
+ /// 缂栬緫浣忓畢
+ /// </summary>
+ /// <param name="residenceId">浣忓畢id</param>
+ /// <param name="residenceName">浣忓畢鍚嶇О</param>
+ /// <returns></returns>
+ public async System.Threading.Tasks.Task<bool> EditorResidenceName(string residenceId, string residenceName)
+ {
+ var Pra = new EditorResidencePra();
+ Pra.HomeId = residenceId;
+ Pra.Name = residenceName;
+ Pra.IsOtherAccountCtrl = false;
+ Pra.LoginAccessToken = Config.Instance.Token;
+
+ //缂栬緫浣忓畢
+ bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", false, Pra);
+ if (flage == true)
+ {
+ //鍒锋柊鍐呭瓨鐨勪綇瀹呭悕
+ this.EditorHouseByHouseId(residenceId, residenceName);
+ }
+ return flage;
+ }
+
+ /// <summary>
+ /// 缂栬緫缂撳瓨浣忓畢
+ /// </summary>
+ /// <param name="residenceId">浣忓畢id</param>
+ /// <param name="residenceName">浣忓畢鍚嶇О</param>
+ public void EditorHouseByHouseId(string residenceId, string residenceName)
+ {
+ if (Config.Instance.Home.Id == residenceId)
+ {
+ Config.Instance.Home.Name = residenceName;
+ }
+
+ var home = GetHouseByHouseId(residenceId);
+ if (home == null)
+ {
+ return;
+ }
+ home.Name = residenceName;
+ home.Save();
+ //浣忓畢淇敼鍚嶇О鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂�
+ UserView.UserPage.Instance.RefreshForm = true;
+ }
+
+
+ #endregion
+
+ #region 鈻� 鑾峰彇浣忓畢___________________________
+
+ /// <summary>
+ /// 閫氳繃銆恑d銆戣幏鍙栦綇瀹�
+ /// </summary>
+ /// <returns>The house by house identifier.</returns>
+ /// <param name="houseId">浣忓畢id</param>
+ public House GetHouseByHouseId(string houseId)
+ {
+ var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, houseId, $"House_{houseId}.json");
+ var file = Shared.IO.FileUtils.ReadFile(path);
+ if (file == null)
+ {
+ return null;
+ }
+ return Newtonsoft.Json.JsonConvert.DeserializeObject<House>(System.Text.Encoding.UTF8.GetString(file));
+ }
+
+ /// <summary>
+ /// 閫氳繃銆愭枃浠惰矾寰勩�戣幏鍙栦綇瀹�
+ /// </summary>
+ /// <returns>The house by file path.</returns>
+ /// <param name="filePath">鏂囦欢璺緞</param>
+ public House GetHouseByFilePath(string filePath)
+ {
+ var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, GetHouseIdByFilePath(filePath), filePath);
+ var file = Shared.IO.FileUtils.ReadFile(path);
+ if (file == null)
+ {
+ return null;
+ }
+ return Newtonsoft.Json.JsonConvert.DeserializeObject<House>(System.Text.Encoding.UTF8.GetString(file));
+ }
+
+ #endregion
+
+ #region 鈻� 鑾峰彇浜戠浣忓畢鍒楄〃___________________
+ /// <summary>
+ /// 鑾峰彇浜戠浣忓畢鍒楄〃
+ /// </summary>
+ public async System.Threading.Tasks.Task<List<string>> GetHomeListsFromDb()
+ {
+ var pageSetting = new SendDataToServer.ResidenceListPageSettingObj()
+ {
+ PageSize = CommonPage.PageSize
+ };
+
+ var reqDto = new SendDataToServer.ResidenceListObj()
+ {
+ LoginAccessToken = Config.Instance.Token,
+ PageSetting = pageSetting
+ };
+ var requestObj = new SendDataToServer.ResidenceListReqDto()
+ {
+ ReqDto = reqDto,
+ RequestVersion = CommonPage.RequestVersion,
+ };
+ try
+ {
+ var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
+ var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("App/GetHomePager", System.Text.Encoding.UTF8.GetBytes(requestJson));
+ if (revertObj == null)
+ {
+ return null;
+ }
+ if (revertObj.StateCode.ToUpper() == "SUCCESS")
+ {
+ var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.ResidenceRes>(revertObj.ResponseData.ToString());
+ if(responseDataObj.TotalCount>0)
+ {
+ //娓呯┖褰撳墠浣忓畢鍒楄〃
+ Config.Instance.HomeFilePathList.Clear();
+ var listHouse = new List<House>();
+ foreach (var residence in responseDataObj.PageData)
+ {
+ Config.Instance.HomeFilePathList.Add($"House_{residence.Id}.json");
+ var house = GetHouseByHouseId(residence.Id);
+ if (house == null)
+ {
+ house = new House
+ {
+ Id = residence.Id,
+ Name = residence.Name,
+ IsOthreShare = residence.IsOthreShare,
+ AccountType = residence.AccountType,
+ MainUserDistributedMark = residence.MainUserDistributedMark,
+ Longitude = residence.Longitude,
+ Latitude = residence.Latitude
+ };
+ }
+ else
+ {
+ house.Id = residence.Id;
+ house.Name = residence.Name;
+ house.IsOthreShare = residence.IsOthreShare;
+ house.AccountType = residence.AccountType;
+ house.MainUserDistributedMark = residence.MainUserDistributedMark;
+ house.Longitude = residence.Longitude;
+ house.Latitude = residence.Latitude;
+ }
+ Global.CreateHomeDirectory(residence.Id);
+ house.Save(false);
+ listHouse.Add(house);
+ }
+ //濡傛灉鍒囨崲浜嗚处鍙�,鎴栬�呭師鏉ョ殑id涓嶅瓨鍦�,鍒欓噸缃綇瀹匢D
+ if (Config.Instance.TheSameLoginAccount == false ||
+ Config.Instance.HomeFilePathList.Find((obj) => obj == $"House_{Config.Instance.HomeId}.json") == null)
+ {
+ Config.Instance.HomeId = listHouse[0].Id;
+ foreach (var house in listHouse)
+ {
+ //鍒濆閫夋嫨瀹冭嚜宸辩殑浣忓畢
+ if (house.IsOthreShare == false)
+ {
+ Config.Instance.HomeId = house.Id;
+ Config.Instance.Home = GetHouseByHouseId(house.Id);
+ break;
+ }
+ }
+ }
+ Config.Instance.Save();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ HdlLogLogic.Current.WriteLog(ex);
+ }
+ return Config.Instance.HomeFilePathList;
+ }
+
+ #endregion
+
#region 鈻� 鑾峰彇鏈湴浣忓畢鍒楄〃___________________
/// <summary>
@@ -50,7 +317,7 @@
var listHome = new List<Common.House>();
foreach (var housePath in Common.Config.Instance.HomeFilePathList)
{
- var home = Common.House.GetHouseByFilePath(housePath);
+ var home =this.GetHouseByFilePath(housePath);
if (home == null)
{
continue;
@@ -85,14 +352,71 @@
{
//璇诲彇鏂囦欢鍐呭
var textValue = UserCenterLogic.LoadFileContent(System.IO.Path.Combine(nowPath, arryHouse[0]));
- if (textValue != null)
+ if (textValue == null)
{
- var myHouse = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.House>(textValue);
- listHome.Add(myHouse);
+ continue;
}
+ var myHouse = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.House>(textValue);
+ listHome.Add(myHouse);
}
}
return listHome;
+ }
+
+ #endregion
+
+ #region 鈻� 鍒犻櫎浣忓畢___________________________
+
+ /// <summary>
+ /// 鍒犻櫎浣忓畢
+ /// </summary>
+ /// <param name="filePath">File path.</param>
+ public void DeleteHouseMemmory(string houseId)
+ {
+ string filePath = this.GetHouseFilePathByHouseId(houseId);
+ var delPath = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, GetHouseIdByFilePath(filePath));
+ if (System.IO.Directory.Exists(delPath) == false)
+ {
+ return;
+ }
+ var fileList = GetHouseFileListByHomeId(houseId);
+ foreach (var file in fileList)
+ {
+ //鍒犻櫎鏂囦欢
+ System.IO.File.Delete(System.IO.Path.Combine(delPath, file));
+ }
+ //鍒犻櫎鏂囦欢澶�
+ System.IO.Directory.Delete(delPath, true);
+ //HomeFilePathList涓垹闄よ鍒楄〃
+ Common.Config.Instance.HomeFilePathList.RemoveAll((obj) => obj == filePath);
+ Config.Instance.Save();
+ }
+
+ #endregion
+
+ #region 鈻� 鑾峰彇璇ヤ綇瀹呯殑鏂囦欢鍒楄〃_______________
+
+ /// <summary>
+ /// 閫氳繃銆恏ouseId銆戣幏鍙栬浣忓畢鐨勬枃浠跺垪琛�
+ /// </summary>
+ /// <returns>The house file list by home identifier.</returns>
+ /// <param name="houseId">House identifier.</param>
+ public List<string> GetHouseFileListByHomeId(string houseId)
+ {
+ var list = new List<string> { };
+ var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, houseId);
+ if (!System.IO.Directory.Exists(path))
+ {
+ return new List<string> { };
+ }
+ var files = System.IO.Directory.GetFiles(path);
+ foreach (var file in files)
+ {
+ var f = file.Substring(path.Length + 1);
+ System.Console.WriteLine(f);
+ list.Add(f);
+ }
+ return list;
}
#endregion
@@ -106,9 +430,72 @@
/// <returns></returns>
public string GetFloorNameById(string i_FloorId)
{
- return Common.Config.Instance.Home.GetFloorNameById(i_FloorId);
+ if (i_FloorId == null) { return string.Empty; }
+ if (Config.Instance.Home.FloorDics.ContainsKey(i_FloorId) == false)
+ {
+ return string.Empty;
+ }
+ return Config.Instance.Home.FloorDics[i_FloorId];
}
+ /// <summary>
+ /// 閫氳繃銆愭枃浠惰矾寰勩�戣幏鍙栦綇瀹卛d
+ /// </summary>
+ /// <returns>The house identifier by file path.</returns>
+ /// <param name="filePath">鏂囦欢璺緞</param>
+ public string GetHouseIdByFilePath(string filePath)
+ {
+ string[] sArray = filePath.Split(new string[] { "House_", ".json" }, StringSplitOptions.RemoveEmptyEntries);
+ if (sArray.Length >= 1)
+ {
+ return sArray[0];
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// 閫氳繃銆愪綇瀹卛d銆戣幏鍙栦綇瀹呰矾寰�
+ /// </summary>
+ /// <returns>The house identifier by file path.</returns>
+ /// <param name="houseId">浣忓畢id</param>
+ public string GetHouseFilePathByHouseId(string houseId)
+ {
+ return $"House_{houseId}.json";
+ }
+
+ #endregion
+
+ #region 鈻� 缁撴瀯浣揰____________________________
+
+ /// <summary>
+ /// 娣诲姞浣忓畢鐨勫惎鍔ㄥ弬鏁�
+ /// </summary>
+ private class AddResidencePra : IfacePraCommon
+ {
+ /// <summary>
+ /// RequestVersion
+ /// </summary>
+ public string RequestVersion = Common.CommonPage.RequestVersion;
+ /// <summary>
+ /// LoginAccessToken
+ /// </summary>
+ public string LoginAccessToken = Common.Config.Instance.Token;
+ /// <summary>
+ /// Name
+ /// </summary>
+ public string Name = string.Empty;
+ }
+
+ /// <summary>
+ /// 鏂颁綇瀹呯殑淇℃伅
+ /// </summary>
+ private class NewResidenceInfo
+ {
+ /// <summary>
+ /// ZigbeeHomeGuid
+ /// </summary>
+ public string Id = string.Empty;
+ }
#endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
index 042d257..790da10 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
@@ -620,7 +620,7 @@
{
return i_room.Name;
}
- var floorName = Config.Instance.Home.GetFloorNameById(i_room.FloorId);
+ var floorName = HdlResidenceLogic.Current.GetFloorNameById(i_room.FloorId);
if (floorName == null)
{
return i_room.Name;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
index 0dcb055..afe0b4c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
@@ -77,7 +77,7 @@
this.ShowTipMsg(msg);
return false;
}
- var mainWayId = HdlGatewayLogic.Current.GetGatewayId(mainGateway);
+ var mainWayId = mainGateway.GwId;
//涓婚鏁板浐瀹�5+3+1
int topicCount = 9;
@@ -2154,7 +2154,7 @@
bool success = false;
//瓒呮椂鏃堕棿
int TimeOut = 0;
- string checkTopic = HdlGatewayLogic.Current.GetGatewayId(realWay) + "/Security/AdminSetNewPassword_Respon";
+ string checkTopic = realWay.GwId + "/Security/AdminSetNewPassword_Respon";
Action<string, string> getResultAction = (topic, message) =>
{
try
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
index fca010c..b7c17d8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
@@ -689,7 +689,7 @@
{
return null;
}
- var floorName = Shared.Common.Config.Instance.Home.GetFloorNameById(room.FloorId);
+ var floorName = HdlResidenceLogic.Current.GetFloorNameById(room.FloorId);
//鏇存敼浠g爜锛氬鏋渇loorName=鈥溾�濅篃瑕佸垽鏂紝鍚﹀垯鏈夆�滐紝鈥�
if (string.IsNullOrEmpty(floorName))
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
index 8c68ded..0f40b6d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
@@ -57,7 +57,7 @@
{
string myId = this.SSID;
- if (myId != null && myId.StartsWith("Widora-") == true)
+ if (myId != null && myId.StartsWith("hdlZigbeeGW-") == true)
{
return true;
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index 3d10478..c78a7f6 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -95,6 +95,10 @@
}
}
var revertObj = JsonConvert.DeserializeObject<ResponsePack>(Encoding.UTF8.GetString(byteData));
+ if (revertObj == null)
+ {
+ return "Error";
+ }
return revertObj.StateCode;
}
@@ -143,7 +147,7 @@
}
if (revertObj == null || revertObj.ResponseData == null)
{
- return string.Empty;
+ return null;
}
return revertObj.ResponseData.ToString();
}
@@ -423,9 +427,10 @@
int index = UserCenterResourse.listActionFormId.IndexOf(UserCenterResourse.NowActionFormID) - 1;
//鍒濆鍊�
UserCenterResourse.NowActionFormID = string.Empty;
+ var actionForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
+
if (index >= 0)
{
- var actionForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
if (actionForm != null && actionForm is CommonFormBase)
{
string formId = ((CommonFormBase)actionForm).FormID;
@@ -436,16 +441,12 @@
CallFormActionAgainEvent(form, index);
}
}
- else if (actionForm != null && actionForm is UserView.UserPage)
- {
- //杩欓噷瀹冨凡缁忛��鍒颁富椤典簡
- if (UserCenterResourse.listActionFormId.Contains("UserMainForm") == true//涓汉涓績
- || UserCenterResourse.listActionFormId.Contains("HomeMainPageForm") == true)//
- {
- //璋冪敤鐣岄潰閲嶆柊婵�娲荤殑鍑芥暟
- CallFormActionAgainEvent(form, index);
- }
- }
+ }
+ else if (actionForm != null && actionForm is UserView.UserPage)
+ {
+ //杩欓噷瀹冨凡缁忛��鍒颁富椤典簡
+ var nowForm = UserView.UserPage.Instance.GetNowActionForm();
+ nowForm?.FormActionAgainEvent();
}
}
//绉婚櫎ID
@@ -559,7 +560,7 @@
double Longitude = Config.Instance.Home.Longitude;
double Latitude = Config.Instance.Home.Latitude;
//杩樺師浣忓畢瀵硅薄
- Config.Instance.Home = House.GetHouseByHouseId(Config.Instance.Home.Id);
+ Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(Config.Instance.Home.Id);
Config.Instance.Home.IsOthreShare = isOthreShare;
Config.Instance.Home.AccountType = accountType;
Config.Instance.Home.MainUserDistributedMark = mainMark;
@@ -677,12 +678,12 @@
//娓呯┖褰撳墠浣忓畢id
Config.Instance.HomeId = string.Empty;
HdlGatewayLogic.Current.ClearAllRealGateway();
- try
+
+ //鏂紑杩滅▼Mqtt杩炴帴
+ HdlThreadLogic.Current.RunThread(async () =>
{
- //鏂紑杩滅▼Mqtt杩炴帴
- ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
- }
- catch { }
+ await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
+ }, ShowErrorMode.NO);
HdlThreadLogic.Current.RunMain(() =>
{
@@ -872,12 +873,11 @@
if (Common.Config.Instance.HomeId != UserCenterResourse.AccountOption.OldHomeStringId
|| Common.Config.Instance.Account != UserCenterResourse.AccountOption.OldAccountId)
{
- try
+ //鏂紑杩滅▼Mqtt杩炴帴
+ HdlThreadLogic.Current.RunThread(async () =>
{
- //鏂紑杩滅▼Mqtt杩炴帴
await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
- }
- catch { }
+ }, ShowErrorMode.NO);
//娓呯┖鎵�鏈夋垚鍛樼紦瀛�
ClearAllMemberMemory();
@@ -929,7 +929,7 @@
//鍒濆鍖栨湰鍦扮殑缃戝叧淇℃伅
HdlGatewayLogic.Current.ReFreshByLocal();
//鍒濆鍖栨湰鍦扮殑璁惧淇℃伅
- Common.LocalDevice.Current.ReFreshByLocal();
+ LocalDevice.Current.ReFreshByLocal();
//鍒濆鍖栨埧闂�(閮洩鍩庨偅杈逛笉鍋氬鐞�,闇�瑕佽繖閲岀壒娈婃墽琛屼竴姝�)
HdlRoomLogic.Current.RefreshAllRoomByLocation();
@@ -1501,14 +1501,24 @@
#region 鈻� 鏂囦欢淇濆瓨鍜岃鍙朹____________________
/// <summary>
- /// 鏂囦欢淇濆瓨,浠呴檺褰撳墠浣忓畢(鏁村ぉ蹇樿,鎵�浠ュ缓涓�涓嚱鏁版潵鐜╃帺)
+ /// 鏂囦欢淇濆瓨(鏁村ぉ蹇樿,鎵�浠ュ缓涓�涓嚱鏁版潵鐜╃帺)
/// </summary>
/// <param name="fullName">鍏ㄨ矾寰�</param>
/// <param name="obj">闇�瑕佸簭鍒楀寲鐨勪笢瑗�</param>
public static void SaveFileContent(string fullName, object obj)
{
var data = JsonConvert.SerializeObject(obj);
- var byteData = Encoding.UTF8.GetBytes(data);
+ SaveTexToFile(fullName, data);
+ }
+
+ /// <summary>
+ /// 鏂囦欢淇濆瓨(鏁村ぉ蹇樿,鎵�浠ュ缓涓�涓嚱鏁版潵鐜╃帺)
+ /// </summary>
+ /// <param name="fullName">鍏ㄨ矾寰�</param>
+ /// <param name="obj">闇�瑕佸簭鍒楀寲鐨勪笢瑗�</param>
+ public static void SaveTexToFile(string fullName, string textValue)
+ {
+ var byteData = Encoding.UTF8.GetBytes(textValue);
//鍐欏叆鍐呭
System.IO.FileStream fileStream = null;
try
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs
index 381c07e..876de3c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs
@@ -95,10 +95,6 @@
/// </summary>
public const string ResidenceOptionFile = "b79583bed6909a52849eaea268449aee15f29d3bdf8b5ca3";
/// <summary>
- /// 淇濆瓨浣忓畢椤哄簭鐨勩�愭枃浠躲��
- /// </summary>
- public const string ResidenceSortFile = "b79583bed6909a524e81e2461474f8dcc7a45bf99cecee93";
- /// <summary>
/// 淇濆瓨妤煎眰椤哄簭鐨勩�愭枃浠躲��
/// </summary>
public const string FloorSortFile = "2b156ce95c29de53578282f4d7228f60";
@@ -106,10 +102,6 @@
/// 淇濆瓨鎴块棿椤哄簭鐨勩�愭枃浠躲��
/// </summary>
public const string RoomSortFile = "b1b9f1a50064016f62dea3f160703de2";
- /// <summary>
- /// 淇濆瓨璁惧椤哄簭鐨勩�愭枃浠躲��
- /// </summary>
- public const string DeviceSortFile = "9887fffbee29c2566351e3ef2ddea279";
/// <summary>
/// 淇濆瓨Log鐨勩�愭枃浠跺す銆�
/// </summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs
index ba2f8cd..08c8ac4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs
@@ -75,7 +75,7 @@
btnNewVersion.Visible = hadNewVersion;
btnNewVersion.X = Application.GetRealWidth(242);
btnNewVersion.Y = Application.GetRealHeight(23);
- rowComunication.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
+ rowComunication.AddChidren(btnNewVersion, ChidrenBindMode.BindEvent);
//绌鸿皟妯″潡
var rowModel = new FrameRowControl(listView.rowSpace / 2);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
index 85634c4..5d48933 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
@@ -57,7 +57,7 @@
var frameTemp = new FrameLayout();
frameTemp.Height = Application.GetRealHeight(69);
- listView.AddChidrenFrame(frameTemp);
+ listView.AddChidren(frameTemp);
HdlThreadLogic.Current.RunMainInThread(() =>
{
@@ -68,7 +68,7 @@
}
var frameTemp2 = new FrameLayout();
frameTemp2.Height = Application.GetRealHeight(29);
- listView.AddChidrenFrame(frameTemp2);
+ listView.AddChidren(frameTemp2);
//鏁版嵁鎺ユ敹
this.StartReceiveDataEvent();
@@ -92,7 +92,7 @@
frameTable.Height = Application.GetRealHeight(337);
frameTable.BackgroundImagePath = "Item/IndoorUnitGround.png";
frameTable.Gravity = Gravity.CenterHorizontal;
- listView.AddChidrenFrame(frameTable);
+ listView.AddChidren(frameTable);
//璁惧鍥炬爣
var btnIconBack = new FrameLayout();
@@ -109,7 +109,7 @@
btnIcon.Gravity = Gravity.Center;
Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
btnIconBack.AddChidren(btnIcon);
- frameTable.ChangedChidrenBindMode(btnIconBack, ChidrenBindMode.BindEventOnly);
+ frameTable.ChangedChidrenBindMode(btnIconBack, ChidrenBindMode.BindEvent);
rowInfo.btnIcon = btnIcon;
//璁惧鍚嶇О
@@ -117,7 +117,7 @@
btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
btnDeviceName.X = Application.GetRealWidth(193);
btnDeviceName.Y = Application.GetRealHeight(45);
- frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
rowInfo.btnDeviceName = btnDeviceName;
//鎴块棿
var btnRoom = new NormalViewControl(400, 50, true);
@@ -126,7 +126,7 @@
btnRoom.TextSize = 12;
btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(device);
- frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEvent);
rowInfo.btnRoom = btnRoom;
//鎽勬皬搴�
var btnValue = new NormalViewControl(300, 60, true);
@@ -134,7 +134,7 @@
btnValue.X = frameTable.Width - Application.GetRealWidth(300 + 58);
btnValue.TextAlignment = TextAlignment.CenterRight;
btnValue.TextID = R.MyInternationalizationString.uGetting;
- frameTable.AddChidren(btnValue, ChidrenBindMode.BindEventOnly);
+ frameTable.AddChidren(btnValue, ChidrenBindMode.BindEvent);
rowInfo.btnValue = btnValue;
//璀﹀憡鍥炬爣
var btnWarningIcon = new IconViewControl(69);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
index 647af1d..5f6a110 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -254,50 +254,72 @@
btnFinifh.Enable = true;
btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
}
- btnFinifh.MouseUpEventHandler += async (sender, e) =>
+ btnFinifh.MouseUpEventHandler += (sender, e) =>
{
bool isFinish = false;
- try
+ System.Threading.Tasks.Task.Run(() =>
{
- if (targetListDevice.Count == 0 && targetListScene.Count == 0)
+ try
{
- Application.RunOnMainThread(() =>
- {
- var myTip = new Tip();
- myTip.Direction = AMPopTipDirection.None;
- myTip.CloseTime = 2;
- myTip.Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty);
- myTip.Show(Common.CommonPage.Instance);
- });
- return;
- }
-
- Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
- if (currentKey.bindList.Count != 0)
- {
- var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
- if (bindResult != null && bindResult.clearBindInfoResponseData != null)
- {
- if (bindResult.clearBindInfoResponseData.Result != 0)
- {
- Application.RunOnMainThread(() =>
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- CommonPage.Loading.Hide();
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- else
- {
- currentKey.bindList.Clear();
- }
- }
- else
+ if (targetListDevice.Count == 0 && targetListScene.Count == 0)
{
Application.RunOnMainThread(() =>
{
+ var myTip = new Tip();
+ myTip.Direction = AMPopTipDirection.None;
+ myTip.CloseTime = 2;
+ myTip.Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty);
+ myTip.Show(Common.CommonPage.Instance);
+ });
+ return;
+ }
+
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
+ if (currentKey.bindList.Count != 0)
+ {
+ var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
+ if (bindResult != null && bindResult.clearBindInfoResponseData != null)
+ {
+ if (bindResult.clearBindInfoResponseData.Result != 0)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ CommonPage.Loading.Hide();
+ });
+ return;
+ }
+ else
+ {
+ currentKey.bindList.Clear();
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ var myTip = new Tip();
+ myTip.Direction = AMPopTipDirection.None;
+ myTip.CloseTime = 2;
+ myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+ myTip.Show(Common.CommonPage.Instance);
+ });
+ return;
+ }
+ }
+
+ var temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Scene_Trigger);
+ if (temp == null || temp.setWritableValueResponData == null)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
CommonPage.Loading.Hide();
var myTip = new Tip();
myTip.Direction = AMPopTipDirection.None;
@@ -305,148 +327,131 @@
myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
myTip.Show(Common.CommonPage.Instance);
});
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
return;
}
- }
-
- var temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Scene_Trigger);
- if (temp == null || temp.setWritableValueResponData == null)
- {
- Application.RunOnMainThread(() =>
+ if (temp.setWritableValueResponData.Status != 0)
{
- CommonPage.Loading.Hide();
- var myTip = new Tip();
- myTip.Direction = AMPopTipDirection.None;
- myTip.CloseTime = 2;
- myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
- myTip.Show(Common.CommonPage.Instance);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- if (temp.setWritableValueResponData.Status != 0)
- {
- Application.RunOnMainThread(() =>
- {
- var myTip = new Tip();
- myTip.Direction = AMPopTipDirection.None;
- myTip.CloseTime = 2;
- myTip.Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode);
- myTip.Show(Common.CommonPage.Instance);
- CommonPage.Loading.Hide();
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- else
- {
- currentKey.panelMode = 1;
- var addBindeDev = new AddBindData();
- addBindeDev.DeviceAddr = currentKey.DeviceAddr;
- addBindeDev.Epoint = currentKey.DeviceEpoint;
- foreach (var de in targetListDevice)
- {
- if (de.DeviceAddr != null)
+ Application.RunOnMainThread(() =>
{
- var addBindInfo = new AddBindListObj();
- addBindInfo.BindType = 0;
- addBindInfo.BindCluster = 6;
- addBindInfo.BindMacAddr = de.DeviceAddr;
- addBindInfo.BindEpoint = de.DeviceEpoint;
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ var myTip = new Tip();
+ myTip.Direction = AMPopTipDirection.None;
+ myTip.CloseTime = 2;
+ myTip.Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode);
+ myTip.Show(Common.CommonPage.Instance);
+ CommonPage.Loading.Hide();
+ });
+ return;
+ }
+ else
+ {
+ currentKey.panelMode = 1;
+ var addBindeDev = new AddBindData();
+ addBindeDev.DeviceAddr = currentKey.DeviceAddr;
+ addBindeDev.Epoint = currentKey.DeviceEpoint;
+ foreach (var de in targetListDevice)
+ {
+ if (de.DeviceAddr != null)
+ {
+ var addBindInfo = new AddBindListObj();
+ addBindInfo.BindType = 0;
+ addBindInfo.BindCluster = 6;
+ addBindInfo.BindMacAddr = de.DeviceAddr;
+ addBindInfo.BindEpoint = de.DeviceEpoint;
+ addBindeDev.BindList.Add(addBindInfo);
+ }
+ }
+ foreach (var de in targetListScene)
+ {
+ var addBindInfo = new AddBindListObj();
+ addBindInfo.BindType = 1;
+ addBindInfo.BindCluster = 6;
+ addBindInfo.BindScenesId = de.Id;
addBindeDev.BindList.Add(addBindInfo);
}
- }
- foreach (var de in targetListScene)
- {
- var addBindInfo = new AddBindListObj();
- addBindInfo.BindType = 1;
- addBindInfo.BindCluster = 6;
- addBindInfo.BindScenesId = de.Id;
- addBindeDev.BindList.Add(addBindInfo);
- }
- var dev = new AddedDeviceBindResponseAllData();
- dev = HdlDeviceBindLogic.Current.AddDeviceBindAsync(addBindeDev);
- if (dev != null && dev.addedDeviceBindResponseData != null)
- {
- if (dev.addedDeviceBindResponseData.Result == 0)
+ var dev = new AddedDeviceBindResponseAllData();
+ dev = HdlDeviceBindLogic.Current.AddDeviceBindAsync(addBindeDev);
+ if (dev != null && dev.addedDeviceBindResponseData != null)
{
- currentKey.bindList = dev.addedDeviceBindResponseData.BindList;
- targetListDevice.Clear();
- targetListScene.Clear();
- isFinish = true;
- if (isFinish)
+ if (dev.addedDeviceBindResponseData.Result == 0)
{
- if (action != null)
+ currentKey.bindList = dev.addedDeviceBindResponseData.BindList;
+ targetListDevice.Clear();
+ targetListScene.Clear();
+ isFinish = true;
+ Application.RunOnMainThread(() =>
{
- action(currentKey.bindList);
- }
- this.RemoveFromParent();
+ if (isFinish)
+ {
+ if (action != null)
+ {
+ action(currentKey.bindList);
+ }
+ this.RemoveFromParent();
+ }
+ else
+ {
+ this.RemoveFromParent();
+ }
+ CommonPage.Loading.Hide();
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ });
+ }
+ else if (dev.addedDeviceBindResponseData.Result == 1)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip()
+ {
+ MaxWidth = 150,
+ Text = Language.StringByID(R.MyInternationalizationString.BindFailed),
+ Direction = AMPopTipDirection.Up,
+ CloseTime = 1
+ }.Show(btnFinifh);
+ });
+ return;
}
else
{
- this.RemoveFromParent();
- }
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- });
- }
- else if (dev.addedDeviceBindResponseData.Result == 1)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip()
+ Application.RunOnMainThread(() =>
{
- MaxWidth = 150,
- Text = Language.StringByID(R.MyInternationalizationString.BindFailed),
- Direction = AMPopTipDirection.Up,
- CloseTime = 1
- }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip()
+ {
+ MaxWidth = 150,
+ Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError),
+ Direction = AMPopTipDirection.Up,
+ CloseTime = 1
+ }.Show(btnFinifh);
+ });
+
+ return;
+ }
}
else
{
Application.RunOnMainThread(() =>
{
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
CommonPage.Loading.Hide();
- new Tip()
- {
- MaxWidth = 150,
- Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError),
- Direction = AMPopTipDirection.Up,
- CloseTime = 1
- }.Show(btnFinifh);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
});
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+
return;
}
}
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
}
- }
- catch { }
+ catch { }
+ });
};
#endregion
}
@@ -704,16 +709,10 @@
}
}
- bool IsTip = false;
EventHandler<MouseEventArgs> hander = (sender, e) =>
{
if (currentKey.bindList.Count != 0)
{
- if (IsTip)
- {
- return;
- }
- IsTip = true;
if (btnChoose.IsSelected)
{
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindExist), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnBindName);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
index 720426a..9524092 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
@@ -132,7 +132,6 @@
{
//绗竴涓ゼ灞�
return dicFloor[floorId];
- break;
}
return null;
}
@@ -148,7 +147,6 @@
{
//绗竴涓ゼ灞�
return floorId;
- break;
}
return null;
}
@@ -164,7 +162,6 @@
{
//绗竴涓ゼ灞�
return dicFloor[floorId];
- break;
}
return null;
}
@@ -183,7 +180,6 @@
if (curFllodID == floorId)
{
return dicFloor[floorId];
- break;
}
}
return null;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
index 32eb48b..fdba54a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -434,7 +434,7 @@
var rowLayout = new RowLayoutControl(midVerticalRefreshLayout.rowSpace / 2);
rowLayout.BackgroundColor = ZigbeeColor.Current.XMWhite;
- midVerticalRefreshLayout.AddChidrenRow(rowLayout);
+ midVerticalRefreshLayout.AddChidren2(rowLayout);
rowLayout.frameTable.UseClickStatu = false;
var devicePic = rowLayout.frameTable.AddLeftIcon();
devicePic.Y = Application.GetRealHeight(49);
@@ -501,7 +501,7 @@
//鑾峰彇鎴块棿鐨勫悕瀛�
var tempDevRoomName = tempDevRoom.Name;
//鑾峰彇妤煎眰鐨勫悕瀛�
- var tempDevFloorName = Common.Config.Instance.Home.GetFloorNameById(tempDevFloorId);
+ var tempDevFloorName = HdlResidenceLogic.Current.GetFloorNameById(tempDevFloorId);
if (string.IsNullOrEmpty(tempDevFloorName))
{
if (string.IsNullOrEmpty(tempDevRoomName))
@@ -552,9 +552,9 @@
var btnFloorRoomName = rowLayout.frameTable.AddBottomView(btnFloorRoomNameText, 800);
rowLayout.frameTable.AddBottomLine();
var btnDel = rowLayout.AddDeleteControl();
- btnDel.ButtonClickEvent += async (sender, e) =>
- {
- RemoveTargets(bindDevice, btnDel);
+ btnDel.ButtonClickEvent += (sender, e) =>
+ {
+ RemoveTargets(bindDevice, btnDel);
};
#endregion
}
@@ -570,7 +570,7 @@
{
var modeRowLayout = new RowLayoutControl(midVerticalRefreshLayout.rowSpace / 2);
modeRowLayout.BackgroundColor = ZigbeeColor.Current.XMWhite;
- midVerticalRefreshLayout.AddChidrenRow(modeRowLayout);
+ midVerticalRefreshLayout.AddChidren2(modeRowLayout);
modeRowLayout.frameTable.UseClickStatu = false;
modeRowLayout.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.keyMode), 400);
var btnKeyModeTipText = "";
@@ -628,60 +628,79 @@
var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm));
alert.Show();
//浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
- alert.ConfirmClickEvent += async () =>
+ alert.ConfirmClickEvent += () =>
{
bool isDelSuccess = false;
- try
+ System.Threading.Tasks.Task.Run(() =>
{
- CommonPage.Loading.Start("");
- var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
- if (bindResult != null && bindResult.clearBindInfoResponseData != null)
+ try
{
- if (bindResult.clearBindInfoResponseData.Result != 0)
+ Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDel);
- CommonPage.Loading.Hide();
- return;
- }
- else
+ CommonPage.Loading.Start("");
+ });
+ var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
+ if (bindResult != null && bindResult.clearBindInfoResponseData != null)
{
- var temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Default);
- if (temp != null && temp.setWritableValueResponData?.Status != 0)
+ if (bindResult.clearBindInfoResponseData.Result != 0)
{
- var temp1 = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Default);
- if (temp1 != null && temp1.setWritableValueResponData?.Status != 0)
+ Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDel);
+ CommonPage.Loading.Hide();
+ });
+ return;
+ }
+ else
+ {
+ var temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Default);
+ if (temp != null && temp.setWritableValueResponData?.Status != 0)
+ {
+ var temp1 = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Default);
+ if (temp1 != null && temp1.setWritableValueResponData?.Status != 0)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+
+ });
+ }
+ else
+ {
+ isDelSuccess = true;
+ }
}
else
{
isDelSuccess = true;
}
}
- else
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
{
- isDelSuccess = true;
- }
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+ });
}
}
- else
+ catch { }
+ finally
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+ Application.RunOnMainThread(() =>
+ {
+ if (isDelSuccess)
+ {
+ currentKey.panelMode = 65535;
+ currentKey.bindList.Clear();
+ RefreshList();
+ //濡傛灉鏄満鏅紝鐢ㄦ埛鍒犻櫎娓呯┖褰撳墠鍒版埧闂村垪琛�
+ currentKey.ReSave();
+ }
+ CommonPage.Loading.Hide();
+ });
}
- }
- catch { }
- finally
- {
- if (isDelSuccess)
- {
- currentKey.panelMode = 65535;
- currentKey.bindList.Clear();
- RefreshList();
- //濡傛灉鏄満鏅紝鐢ㄦ埛鍒犻櫎娓呯┖褰撳墠鍒版埧闂村垪琛�
- currentKey.ReSave();
- }
- CommonPage.Loading.Hide();
- }
+ });
};
};
}
@@ -875,234 +894,63 @@
}
if (currentKey.currentKeySelectModeText == Language.StringByID(R.MyInternationalizationString.AddScene))
{
- if (currentKey.bindList.Count != 0)
- {
- var bindSc = currentKey.bindList.Find(obj => (obj.BindType == 2));
- if (bindSc != null)
- {
- string msg = Language.StringByID(R.MyInternationalizationString.DelLocalBindListThenAddAgain);
- var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm));
- alert.Show();
- //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
- alert.ConfirmClickEvent += async () =>
- {
- var result = await RemoveTargets(bindSc, line2);
- if (result == 0)
- {
- var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addScenePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addScenePage.Show();
+ var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addScenePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addScenePage.Show();
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addScenePage.action += action;
- dialog.Close();
- }
- else
- {
- currentKey.currentKeySelectModeText = oldKeySelectModeText;
- dialog.Close();
- }
- };
- }
- }
- else
+ Action<List<BindListResponseObj>> action = (obj) =>
{
- var addScenePage = new Shared.Phone.UserCenter.DeviceBind.AddScenePage(currentKey);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addScenePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addScenePage.Show();
-
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addScenePage.action += action;
- dialog.Close();
- }
+ currentKey.bindList = obj;
+ RefreshList();
+ };
+ addScenePage.action += action;
+ dialog.Close();
}
if (currentKey.currentKeySelectModeText == Language.StringByID(R.MyInternationalizationString.AddSwitch))
{
- if (currentKey.bindList.Count != 0)
- {
- var bindSc = currentKey.bindList.Find(obj => (obj.BindType == 2));
- if (bindSc != null)
- {
- string msg = Language.StringByID(R.MyInternationalizationString.DelLocalBindListThenAddAgain1);
- var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm));
- alert.Show();
- //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
- alert.ConfirmClickEvent += async () =>
- {
- var result = await RemoveTargets(bindSc, line2);
- if (result == 0)
- {
- var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddSwitch");
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addDevicePage.Show();
+ var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddSwitch");
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addDevicePage.Show();
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addDevicePage.actionAddDevicePage += action;
- dialog.Close();
- }
- else
- {
- currentKey.currentKeySelectModeText = oldKeySelectModeText;
- dialog.Close();
- }
- };
- }
- }
- else
+ Action<List<BindListResponseObj>> action = (obj) =>
{
- var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddSwitch");
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addDevicePage.Show();
-
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addDevicePage.actionAddDevicePage += action;
- dialog.Close();
- }
+ currentKey.bindList = obj;
+ RefreshList();
+ };
+ addDevicePage.actionAddDevicePage += action;
+ dialog.Close();
}
if (currentKey.currentKeySelectModeText == Language.StringByID(R.MyInternationalizationString.AddDimmer))
{
- if (currentKey.bindList.Count != 0)
+ var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddDimmer");
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addDevicePage.Show();
+
+ Action<List<BindListResponseObj>> action = (obj) =>
{
- var bindSc = currentKey.bindList.Find(obj => (obj.BindType == 2));
- if (bindSc != null)
- {
- var dialog1 = new Dialog { };
- var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog1, Language.StringByID(R.MyInternationalizationString.Tip));
- doorDialog.Show();
- doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58);
- doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(0);
- doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202);
- doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
- doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.DelLocalBindListThenAddAgain2);
- doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
- doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.DoorlockConfirm);
- doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) =>
- {
- currentKey.currentKeySelectModeText = oldKeySelectModeText;
- dialog.Close();
- dialog1.Close();
- };
- doorDialog.dialogBtnConfirm.MouseUpEventHandler += async (sender1, e1) =>
- {
- var result = await RemoveTargets(bindSc, line2);
- if (result == 0)
- {
- var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddDimmer");
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addDevicePage.Show();
-
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addDevicePage.actionAddDevicePage += action;
- dialog.Close();
- dialog1.Close();
- }
- else
- {
- currentKey.currentKeySelectModeText = oldKeySelectModeText;
- dialog.Close();
- dialog1.Close();
- }
-
- };
- }
- }
- else
- {
- var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddDimmer");
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addDevicePage.Show();
-
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addDevicePage.actionAddDevicePage += action;
- dialog.Close();
- }
+ currentKey.bindList = obj;
+ RefreshList();
+ };
+ addDevicePage.actionAddDevicePage += action;
+ dialog.Close();
}
if (currentKey.currentKeySelectModeText == Language.StringByID(R.MyInternationalizationString.AddCurtain))
{
- if (currentKey.bindList.Count != 0)
- {
- var bindSc = currentKey.bindList.Find(obj => (obj.BindType == 2));
- if (bindSc != null)
- {
- var dialog1 = new Dialog { };
- var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog1, Language.StringByID(R.MyInternationalizationString.Tip));
- doorDialog.Show();
- doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58);
- doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(0);
- doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202);
- doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
- doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.DelLocalBindListThenAddAgain3);
- doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
- doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.DoorlockConfirm);
- doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) =>
- {
- currentKey.currentKeySelectModeText = oldKeySelectModeText;
- dialog.Close();
- dialog1.Close();
- };
- doorDialog.dialogBtnConfirm.MouseUpEventHandler += async (sender1, e1) =>
- {
- var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddCurtain");
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addDevicePage.Show();
+ var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddCurtain");
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addDevicePage.Show();
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addDevicePage.actionAddDevicePage += action;
- dialog.Close();
- dialog1.Close();
- };
- }
- }
- else
+ Action<List<BindListResponseObj>> action = (obj) =>
{
- var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.AddDevicePage(currentKey, "AddCurtain");
- Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- addDevicePage.Show();
-
- Action<List<BindListResponseObj>> action = (obj) =>
- {
- currentKey.bindList = obj;
- RefreshList();
- };
- addDevicePage.actionAddDevicePage += action;
- dialog.Close();
- }
+ currentKey.bindList = obj;
+ RefreshList();
+ };
+ addDevicePage.actionAddDevicePage += action;
+ dialog.Close();
}
};
btnMethodText.MouseUpEventHandler += eHandler;
@@ -1150,8 +998,9 @@
/// <param name="bindDevice"></param>
/// <param name="btnDel"></param>
/// <returns></returns>
- private async System.Threading.Tasks.Task<int> RemoveTargets(BindListResponseObj bindDevice, Button btnDel)
- {
+ private int RemoveTargets(BindListResponseObj bindDevice, Button btnDel)
+ {
+ int result = -1;
var delDevice = new DelDeviceBindData();
delDevice.DeviceAddr = currentKey.DeviceAddr;
delDevice.Epoint = currentKey.DeviceEpoint;
@@ -1184,119 +1033,148 @@
delDevice.RemoveBindList.Add(removeDevice);
}
- try
+ System.Threading.Tasks.Task.Run(() =>
{
- CommonPage.Loading.Start("");
- var delResult = new DelDeviceBindResponseAllData();
- delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
- if (delResult != null && delResult.delDeviceBindResponseData != null)
+ try
{
- if (delResult.delDeviceBindResponseData?.RemoveBindList != null)
+ Application.RunOnMainThread(() =>
{
- foreach (var re in delResult.delDeviceBindResponseData.RemoveBindList)
+ CommonPage.Loading.Start("");
+ });
+ var delResult = new DelDeviceBindResponseAllData();
+ delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
+ if (delResult != null && delResult.delDeviceBindResponseData != null)
+ {
+ if (delResult.delDeviceBindResponseData?.RemoveBindList != null)
{
- switch (re.Result)
+ foreach (var re in delResult.delDeviceBindResponseData.RemoveBindList)
{
- case 0:
- currentKey.bindList.Remove(bindDevice);
- RefreshList();
- //濡傛灉鏄満鏅紝鐢ㄦ埛鍒犻櫎娓呯┖褰撳墠鍒版埧闂村垪琛�
- if (re.BindType == 2)
- {
- currentKey.panelMode = 65535;
- }
- currentKey.ReSave();
- return 0;
- break;
- case 1:
- currentKey.bindList.Clear();
- try
- {
- CommonPage.Loading.Start("");
-
- var getBindList = HdlDeviceBindLogic.Current.GetDeviceBindAsync(currentKey);
- var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
- var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
- if (getBindList != null)
+ switch (re.Result)
+ {
+ case 0:
+ currentKey.bindList.Remove(bindDevice);
+ Application.RunOnMainThread(() =>
{
- if (getBindList.getAllBindResponseData != null)
+ RefreshList();
+ //濡傛灉鏄満鏅紝鐢ㄦ埛鍒犻櫎娓呯┖褰撳墠鍒版埧闂村垪琛�
+ if (re.BindType == 2)
{
- foreach (var b in getBindList.getAllBindResponseData.BindList)
+ currentKey.panelMode = 65535;
+ }
+ currentKey.ReSave();
+ });
+ result = 0;
+ break;
+ case 1:
+ currentKey.bindList.Clear();
+ try
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Start("");
+ });
+ var getBindList = HdlDeviceBindLogic.Current.GetDeviceBindAsync(currentKey);
+ var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
+ var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { };
+ if (getBindList != null)
+ {
+ if (getBindList.getAllBindResponseData != null)
{
- if (b.BindCluster == currentClusterID)
+ foreach (var b in getBindList.getAllBindResponseData.BindList)
{
- if (b.BindCluster == 6)
+ if (b.BindCluster == currentClusterID)
{
-
- if (b.BindType == 2)
+ if (b.BindCluster == 6)
{
- bindSceneListTemp.Add(b);
+
+ if (b.BindType == 2)
+ {
+ bindSceneListTemp.Add(b);
+ }
+ else
+ {
+ bindDeviceListTemp.Add(b);
+ }
}
else
{
- bindDeviceListTemp.Add(b);
+ currentKey.bindList.Add(b);
}
- }
- else
- {
- currentKey.bindList.Add(b);
}
}
}
}
+ if (currentKey.panelMode == 1)
+ {
+ currentKey.bindList = bindSceneListTemp;
+ }
+ else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102)
+ {
+ currentKey.bindList = bindDeviceListTemp;
+ }
}
- if (currentKey.panelMode == 1)
+ catch { }
+ finally
{
- currentKey.bindList = bindSceneListTemp;
+ Application.RunOnMainThread(() =>
+ {
+ RefreshList();
+ CommonPage.Loading.Hide();
+ });
}
- else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102)
+ break;
+ case 2:
+ if (delResult.removeBindResultResponseData != null)
{
- currentKey.bindList = bindDeviceListTemp;
+ if (delResult.removeBindResultResponseData.Result == 0)
+ {
+ currentKey.bindList.Remove(bindDevice);
+ Application.RunOnMainThread(() =>
+ {
+ RefreshList();
+ });
+ result = 0;
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+ });
+ }
}
- }
- catch { }
- finally
- {
- RefreshList();
- CommonPage.Loading.Hide();
- }
- break;
- case 2:
- if (delResult.removeBindResultResponseData != null)
- {
- if (delResult.removeBindResultResponseData.Result == 0)
- {
- currentKey.bindList.Remove(bindDevice);
- RefreshList();
- return 0;
- }
- else
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
- }
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
+ }
}
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+ });
}
}
else
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
+ });
}
}
- else
+ catch { }
+ finally
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ });
}
- }
- catch { }
- finally
- {
- CommonPage.Loading.Hide();
- }
- return -1;
+ });
+ return result;
}
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
index 730ce66..31e7fb7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
@@ -115,241 +115,255 @@
#region 鏁版嵁澶勭悊
KeyModeList();
- btnFinifh.MouseUpEventHandler += async (sender, e) =>
- {
- oldTargetList.Clear();
- bool isFinish = false;
- btnFinifh.Enable = false;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
- try
- {
- CommonPage.Loading.Start("");
- //1銆佹竻绌烘墍鏈夌洰鏍�
- if (currentKey.bindList != null)
- {
- var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
- if (bindResult != null && bindResult.clearBindInfoResponseData != null)
- {
- if (bindResult.clearBindInfoResponseData.Result != 0)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- else
- {
- currentKey.bindList.Clear();
- }
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
+ btnFinifh.MouseUpEventHandler += (sender, e) =>
+ {
+ oldTargetList.Clear();
+ btnFinifh.Enable = false;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
+ System.Threading.Tasks.Task.Run(() =>
+ {
+ try
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Start("");
+ });
+ //1銆佹竻绌烘墍鏈夌洰鏍�
+ if (currentKey.bindList != null)
+ {
+ var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
+ if (bindResult != null && bindResult.clearBindInfoResponseData != null)
+ {
+ if (bindResult.clearBindInfoResponseData.Result != 0)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
+ else
+ {
+ currentKey.bindList.Clear();
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
- //2銆侀厤缃ā寮�
- Panel.SetWritableValueResponAllData temp = null;
- switch (currentModeID)
- {
- case 100:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_On);
- break;
- case 101:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_oFF);
- break;
- case 102:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_OnOff);
- break;
- case 200:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Step_Up);
- break;
- case 201:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Step_Down);
- break;
- case 203:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Up);
- break;
- case 204:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Down);
- break;
- case 205:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Up_Down);
- break;
- case 300:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Up);
- break;
- case 301:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Down);
- break;
- case 302:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Stop);
- break;
- case 303:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Up_Stop);
- break;
- case 304:
- temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Down_Stop);
- break;
- }
- if (temp != null && temp.setWritableValueResponData != null)
- {
- if (temp.setWritableValueResponData.Status == 0)
- {
- //3銆佺粦瀹氭柊鐨勬暟鎹�
- var addBindeDev = new AddBindData();
- addBindeDev.DeviceAddr = currentKey.DeviceAddr;
- addBindeDev.Epoint = currentKey.DeviceEpoint;
+ //2銆侀厤缃ā寮�
+ Panel.SetWritableValueResponAllData temp = null;
+ switch (currentModeID)
+ {
+ case 100:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_On);
+ break;
+ case 101:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_oFF);
+ break;
+ case 102:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_OnOff);
+ break;
+ case 200:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Step_Up);
+ break;
+ case 201:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Step_Down);
+ break;
+ case 203:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Up);
+ break;
+ case 204:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Down);
+ break;
+ case 205:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Up_Down);
+ break;
+ case 300:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Up);
+ break;
+ case 301:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Down);
+ break;
+ case 302:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Stop);
+ break;
+ case 303:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Up_Stop);
+ break;
+ case 304:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Down_Stop);
+ break;
+ }
+ if (temp != null && temp.setWritableValueResponData != null)
+ {
+ if (temp.setWritableValueResponData.Status == 0)
+ {
+ //3銆佺粦瀹氭柊鐨勬暟鎹�
+ var addBindeDev = new AddBindData();
+ addBindeDev.DeviceAddr = currentKey.DeviceAddr;
+ addBindeDev.Epoint = currentKey.DeviceEpoint;
- foreach (var de in targetList)
- {
- if (de.DeviceAddr != null)
- {
- var addBindInfo = new AddBindListObj();
- addBindInfo.BindType = 0;
- addBindInfo.BindCluster = currentClusterID;
- addBindInfo.BindMacAddr = de.DeviceAddr;
- addBindInfo.BindEpoint = de.DeviceEpoint;
- addBindeDev.BindList.Add(addBindInfo);
- }
- }
+ foreach (var de in targetList)
+ {
+ if (de.DeviceAddr != null)
+ {
+ var addBindInfo = new AddBindListObj();
+ addBindInfo.BindType = 0;
+ addBindInfo.BindCluster = currentClusterID;
+ addBindInfo.BindMacAddr = de.DeviceAddr;
+ addBindInfo.BindEpoint = de.DeviceEpoint;
+ addBindeDev.BindList.Add(addBindInfo);
+ }
+ }
- //鏄寒搴﹀啀娆″彂6鍛戒护
- if (currentClusterID == 8)
- {
- foreach (var de in targetList)
- {
- if (de.DeviceAddr != null)
- {
- var addBindInfo = new AddBindListObj();
- addBindInfo.BindType = 0;
- addBindInfo.BindCluster = 6;
- addBindInfo.BindMacAddr = de.DeviceAddr;
- addBindInfo.BindEpoint = de.DeviceEpoint;
- addBindeDev.BindList.Add(addBindInfo);
- }
- }
- }
+ //鏄寒搴﹀啀娆″彂6鍛戒护
+ if (currentClusterID == 8)
+ {
+ foreach (var de in targetList)
+ {
+ if (de.DeviceAddr != null)
+ {
+ var addBindInfo = new AddBindListObj();
+ addBindInfo.BindType = 0;
+ addBindInfo.BindCluster = 6;
+ addBindInfo.BindMacAddr = de.DeviceAddr;
+ addBindInfo.BindEpoint = de.DeviceEpoint;
+ addBindeDev.BindList.Add(addBindInfo);
+ }
+ }
+ }
- var dev = new AddedDeviceBindResponseAllData();
- dev = HdlDeviceBindLogic.Current.AddDeviceBindAsync(addBindeDev);
- if (dev != null && dev.addedDeviceBindResponseData != null)
- {
- if (dev.addedDeviceBindResponseData.Result == 0)
- {
- if (currentClusterID == 8)
- {
- foreach (var de in dev.addedDeviceBindResponseData.BindList)
- {
- if (de.BindCluster == 8)
- {
- currentKey.bindList.Add(de);
- }
- }
- }
- else
- {
- currentKey.bindList = dev.addedDeviceBindResponseData.BindList;
- }
- if (action != null)
- {
- action(currentKey.bindList);
- }
- this.RemoveFromParent();
- targetList.Clear();
- CommonPage.Loading.Hide();
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- }
- else if (dev.addedDeviceBindResponseData.Result == 1)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip()
- {
- MaxWidth = 150,
- Text = Language.StringByID(R.MyInternationalizationString.BindFailed),
- Direction = AMPopTipDirection.Up,
- CloseTime = 1
- }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip()
- {
- MaxWidth = 150,
- Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError),
- Direction = AMPopTipDirection.Up,
- CloseTime = 1
- }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
- catch
- {
- CommonPage.Loading.Hide();
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- }
- };
+ var dev = new AddedDeviceBindResponseAllData();
+ dev = HdlDeviceBindLogic.Current.AddDeviceBindAsync(addBindeDev);
+ if (dev != null && dev.addedDeviceBindResponseData != null)
+ {
+ if (dev.addedDeviceBindResponseData.Result == 0)
+ {
+ if (currentClusterID == 8)
+ {
+ foreach (var de in dev.addedDeviceBindResponseData.BindList)
+ {
+ if (de.BindCluster == 8)
+ {
+ currentKey.bindList.Add(de);
+ }
+ }
+ }
+ else
+ {
+ currentKey.bindList = dev.addedDeviceBindResponseData.BindList;
+ }
+
+ Application.RunOnMainThread(() =>
+ {
+ if (action != null)
+ {
+ action(currentKey.bindList);
+ }
+ targetList.Clear();
+ this.RemoveFromParent();
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ });
+
+ }
+ else if (dev.addedDeviceBindResponseData.Result == 1)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip()
+ {
+ MaxWidth = 150,
+ Text = Language.StringByID(R.MyInternationalizationString.BindFailed),
+ Direction = AMPopTipDirection.Up,
+ CloseTime = 1
+ }.Show(btnFinifh);
+ });
+ return;
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip()
+ {
+ MaxWidth = 150,
+ Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError),
+ Direction = AMPopTipDirection.Up,
+ CloseTime = 1
+ }.Show(btnFinifh);
+ });
+
+ return;
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
+ catch
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ });
+ }
+ });
+ };
#endregion
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs
index b63e2c3..2c022f5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/SiphonateDirectionAndLimitSettionForm.cs
@@ -201,7 +201,7 @@
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);
+ frameIconback.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
var frameText = new FrameLayoutStatuControl();
frameText.Y= this.GetPictrueRealSize(265);
@@ -213,7 +213,7 @@
btnOk.TextID = R.MyInternationalizationString.uConfirm1;
btnOk.TextAlignment = TextAlignment.Center;
btnOk.TextColor = UserCenterColor.Current.TextOrangeColor;
- frameText.AddChidren(btnOk, ChidrenBindMode.BindEventOnly);
+ frameText.AddChidren(btnOk, ChidrenBindMode.BindEvent);
//搴曠嚎
var btnLine1 = new NormalViewControl(this.GetPictrueRealSize(100), ControlCommonResourse.BottomLineHeight, false);
btnLine1.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
@@ -227,7 +227,7 @@
btnDown.Y = btnOk.Bottom;
btnDown.TextAlignment = TextAlignment.Center;
btnDown.TextColor = UserCenterColor.Current.TextOrangeColor;
- frameText.AddChidren(btnDown, ChidrenBindMode.BindEventOnly);
+ frameText.AddChidren(btnDown, ChidrenBindMode.BindEvent);
//搴曠嚎
var btnLine2 = new NormalViewControl(this.GetPictrueRealSize(124), ControlCommonResourse.BottomLineHeight, false);
@@ -310,7 +310,7 @@
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);
+ frameIconback.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
var frameText = new FrameLayoutStatuControl();
frameText.Y = this.GetPictrueRealSize(265);
@@ -322,7 +322,7 @@
btnOk.TextID = R.MyInternationalizationString.uConfirm1;
btnOk.TextAlignment = TextAlignment.Center;
btnOk.TextColor = UserCenterColor.Current.TextOrangeColor;
- frameText.AddChidren(btnOk, ChidrenBindMode.BindEventOnly);
+ frameText.AddChidren(btnOk, ChidrenBindMode.BindEvent);
//搴曠嚎
var btnLine1 = new NormalViewControl(this.GetPictrueRealSize(100), ControlCommonResourse.BottomLineHeight, false);
btnLine1.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
@@ -336,7 +336,7 @@
btnDown.Y = btnOk.Bottom;
btnDown.TextAlignment = TextAlignment.Center;
btnDown.TextColor = UserCenterColor.Current.TextOrangeColor;
- frameText.AddChidren(btnDown, ChidrenBindMode.BindEventOnly);
+ frameText.AddChidren(btnDown, ChidrenBindMode.BindEvent);
//搴曠嚎
var btnLine2 = new NormalViewControl(this.GetPictrueRealSize(124), ControlCommonResourse.BottomLineHeight, false);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
index 4462aa1..2575716 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
@@ -55,8 +55,16 @@
var rowName = new FrameRowControl(listView.rowSpace / 2);
rowName.UseClickStatu = false;
listView.AddChidren(rowName);
- rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 400);
- rowName.AddMostRightView(Language.StringByID(myInfoType.ConcreteTextId), 600);
+ rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 400);
+ if (Common.LocalDevice.Current.IsMiniLight(listDevice[0]) == true)
+ {
+ //mini澶滅伅
+ rowName.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uMiniNightLight), 600);
+ }
+ else
+ {
+ rowName.AddMostRightView(Language.StringByID(myInfoType.ConcreteTextId), 600);
+ }
rowName.AddBottomLine();
//璁惧鍨嬪彿
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index 187bdb5..a4417a0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -1,4 +1,5 @@
锘縰sing Shared.Common;
+using Shared.Phone.UserCenter.SmartSound;
using System;
using System.Collections.Generic;
using System.Text;
@@ -12,7 +13,10 @@
public class DeviceListMainForm : EditorCommonForm
{
#region 鈻� 鍙橀噺澹版槑___________________________
-
+ /// <summary>
+ /// 鏅鸿兘闊崇
+ /// </summary>
+ private MySmartSoundControl smmartSoundView = null;
/// <summary>
/// 缃戝叧鎺т欢
/// </summary>
@@ -86,6 +90,18 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ smmartSoundView = new MySmartSoundControl();
+ bodyFrameLayout.AddChidren(smmartSoundView);
+ smmartSoundView.InitControl();
+ //褰撳墠涓嶆槸铏氭嫙浣忓畢鐨勮瘽
+ if (Config.Instance.Home.IsVirtually == false)
+ {
+ smmartSoundView.ButtonClickEvent += (sernder, e) =>
+ {
+ var form = new SmartSoundListForm();
+ form.AddForm();
+ };
+ }
//鍒濆鍖栫綉鍏宠鎺т欢
GatewayResourse.NowSelectGatewayId = GatewayResourse.AppOldSelectGatewayId;
var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId);
@@ -232,7 +248,7 @@
//鎻愮ず鏂扮増鏈�
var btnNew = new InformationTipView(rowMenu.btnIcon);
btnNew.Visible = false;
- rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEventOnly);
+ rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
rowMenu.AddTag("btnNew", btnNew);
//妫�娴嬭澶囨槸鍚︽嫢鏈夊畾浣嶇殑鍔熻兘
@@ -643,7 +659,7 @@
if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, nowGateway) == true)
{
//閲嶆柊璁剧疆浣忓畢ID(杩欎釜搴旇鏄笉缁忚繃APP,鐩存帴鎶婄綉鍏虫仮澶嶄簡鍑哄巶璁剧疆)
- if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.getGatewayBaseInfo.HomeId) == true)
+ if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.HomeId) == true)
{
//鏄剧ず杩涘害鏉�
ProgressBar.Show();
@@ -726,7 +742,7 @@
{
return;
}
- if (HdlGatewayLogic.Current.GetGatewayId(gateWay) == this.gatewayViewRow.zbGatewayId)
+ if (gateWay.GwId == this.gatewayViewRow.zbGatewayId)
{
Application.RunOnMainThread(() =>
{
@@ -1145,9 +1161,10 @@
this.UseClickStatu = false;
if (i_zbGateway != null)
{
- this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway);
+ this.zbGatewayId = i_zbGateway.GwId;
}
this.BackgroundColor = UserCenterColor.Current.White;
+ this.Y = Application.GetRealHeight(174);
this.Height = Application.GetRealHeight(173);
}
@@ -1262,7 +1279,55 @@
}
}
}
+ #endregion
+ #region 鈻� 鑷畾涔夋櫤鑳介煶绠辨帶浠禵____________________
+
+ /// <summary>
+ /// 鑷畾涔夌綉鍏虫帶浠�
+ /// </summary>
+ private class MySmartSoundControl : FrameRowControl
+ {
+
+ /// <summary>
+ /// 缃戝叧鍚嶅瓧鎺т欢
+ /// </summary>
+ private NormalViewControl btnName = null;
+
+ /// <summary>
+ /// 鑷畾闊崇鍏虫帶浠�
+ /// </summary>
+ public MySmartSoundControl()
+ {
+ this.UseClickStatu = false;
+ this.BackgroundColor = UserCenterColor.Current.White;
+ this.Height = Application.GetRealHeight(173);
+
+ //this.InitControl();
+ }
+
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ //鍥炬爣
+ var btnIcon = this.AddLeftIcon(81);
+ btnIcon.UnSelectedImagePath = "SmartSound/SoundIcon.png";
+
+ //鏄剧ず鏂囨湰
+ btnName = this.AddLeftCaption(string.Empty, 700);
+ btnName.Height = Application.GetRealHeight(60);
+ btnName.TextSize = 15;
+ btnName.Y = Application.GetRealHeight(57);
+ btnName.Text = "灏忓害灏忓害";
+
+ this.AddRightArrow();
+ this.AddMostRightView("", 300, false).Name = "smartSoundLayout";
+ this.AddBottomLine();
+ }
+ }
#endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
index f16f099..c4a9f56 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -1182,7 +1182,7 @@
btnNewVersion.Visible = false;
btnNewVersion.X = Application.GetRealWidth(242);
btnNewVersion.Y = Application.GetRealHeight(23);
- rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
+ rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEvent);
rowUpDate.ButtonClickEvent += (sender, e) =>
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
index c399fee..7af7f6f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
@@ -49,17 +49,9 @@
/// </summary>
private ZbGateway realGateway = null;
/// <summary>
- /// 杩涘害鏉�
+ /// 杩涘害鏉℃帶浠�
/// </summary>
- private FrameLayout btnProgressBar = null;
- /// <summary>
- /// 杩涘害鍊兼樉绀烘枃鏈殑鏁翠綋
- /// </summary>
- private FrameLayout frameProgress = null;
- /// <summary>
- /// 杩涘害鍊肩殑鏄剧ず鏂囨湰
- /// </summary>
- private NormalViewControl btnProgressView = null;
+ private ProgressRowBar btnProgressBar = null;
/// <summary>
/// 缃戝叧鏄惁鍏佽鍏ョ綉鐨勬爣璇�
/// </summary>
@@ -113,36 +105,11 @@
bodyFrameLayout.AddChidren(btnSearch);
//杩涘害鏉�
- var btnProRow = new FrameLayout();
- btnProRow.Gravity = Gravity.CenterHorizontal;
- btnProRow.Y = Application.GetRealHeight(861);
- btnProRow.Width = Application.GetRealWidth(559);
- btnProRow.Height = Application.GetRealHeight(29);
- btnProRow.BackgroundColor = 0xffe6e6e6;
- btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2;
- bodyFrameLayout.AddChidren(btnProRow);
- this.btnProgressBar = new FrameLayout();
- btnProgressBar.Width = 0;
- btnProgressBar.Height = btnProRow.Height;
- btnProgressBar.BackgroundColor = 0xfffb744a;
- btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
- btnProRow.AddChidren(btnProgressBar);
-
- //杩涘害鍊兼枃鏈�
- this.frameProgress = new FrameLayout();
- frameProgress.Width = Application.GetRealWidth(84);
- frameProgress.Height = Application.GetRealHeight(60);
- frameProgress.Y = Application.GetRealHeight(772);
- bodyFrameLayout.AddChidren(frameProgress);
- frameProgress.X = btnProRow.X + btnProgressBar.Right - frameProgress.Width / 2;
- var btnProgressPic = new PicViewControl(84, 60);
- btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
- frameProgress.AddChidren(btnProgressPic);
- this.btnProgressView = new NormalViewControl(84, 32, true);
- btnProgressView.TextSize = 10;
- btnProgressView.TextAlignment = TextAlignment.Center;
- btnProgressView.Text = "0%";
- frameProgress.AddChidren(btnProgressView);
+ this.btnProgressBar = new ProgressRowBar(559, 29);
+ btnProgressBar.Gravity = Gravity.CenterHorizontal;
+ btnProgressBar.Y = Application.GetRealHeight(861);
+ bodyFrameLayout.AddChidren(btnProgressBar);
+ btnProgressBar.StartMode1(true);
if (this.realGateway != null)
{
@@ -206,7 +173,7 @@
//缁欐柊璁惧璁剧疆涓婚敭灞炴��
Common.LocalDevice.Current.SetNewDeviceMainKeys(device, jobject);
- device.CurrentGateWayId = HdlGatewayLogic.Current.GetGatewayId(this.realGateway);
+ device.CurrentGateWayId = this.realGateway.GwId;
//灏咲eviceInfo鐨勫睘鎬ц缃埌涓诲睘鎬т腑
Common.LocalDevice.Current.SetDeviceInfoToMain(device, device);
@@ -402,7 +369,7 @@
return 0;
}
//缃戝叧鍛婄煡瀹㈡埛绔湁璁惧澹版槑
- this.SetDeviceProgressValue(1);
+ this.btnProgressBar.SetValue(1, 6);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceGetActiveEP_Respon")
@@ -419,7 +386,7 @@
return 2;
}
//璁剧疆杩涘害鍊�
- this.SetDeviceProgressValue(2);
+ this.btnProgressBar.SetValue(2, 6);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceGetActiveEPSimpleDesc_Respon")
@@ -436,7 +403,7 @@
return 2;
}
//璁剧疆杩涘害鍊�
- this.SetDeviceProgressValue(3);
+ this.btnProgressBar.SetValue(3, 6);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceGetDefaultBind_Respon")
@@ -453,7 +420,7 @@
return 2;
}
//璁剧疆杩涘害鍊�
- this.SetDeviceProgressValue(4);
+ this.btnProgressBar.SetValue(4, 6);
return 2;
}
else if (topic == gatewayId + "/Device/DeviceAutoBindZBCoord_Respon")
@@ -470,42 +437,17 @@
return 2;
}
//璁剧疆杩涘害鍊�
- this.SetDeviceProgressValue(5);
+ this.btnProgressBar.SetValue(5, 6);
return 2;
}
else if (topic == gatewayId + "/DeviceInComingRespon")
{
this.topTimeOut = topMaxTime;
//缃戝叧鏈�缁堜笂鎶ヨ妭鐐硅澶囦俊鎭�
- this.SetDeviceProgressValue(6);
+ this.btnProgressBar.SetValue(6, 6);
return 1;
}
return 0;
- }
-
- /// <summary>
- /// 璁剧疆璁惧鐨勮繘搴﹀��
- /// </summary>
- /// <param name="value"></param>
- private void SetDeviceProgressValue(decimal value)
- {
- Application.RunOnMainThread(() =>
- {
- //杩涘害鏉�
- decimal result = value / 6;
- int width = (int)(result * Application.GetRealWidth(559));
- if (btnProgressBar.Width >= width)
- {
- //鏈変簺璁惧浼氫笂鎶ヤ袱娆�,杩欓噷涓嶈兘璁╁畠鐨勮繘搴︽潯寰�鍥炶蛋
- return;
- }
- btnProgressBar.Width = width;
-
- //鏂囨湰鏄剧ず
- btnProgressView.Text = ((int)(result * 100)) + "%";
- //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩
- frameProgress.X = Application.GetRealWidth(262) + btnProgressBar.Right - frameProgress.Width / 2;
- });
}
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
index d3de465..dc06e7d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
@@ -332,7 +332,7 @@
{
var frameTable = new FrameRowControl(listView.rowSpace / 2);
frameTable.UseClickStatu = false;
- this.listView.AddChidrenFrame2(frameTable);
+ this.listView.AddChidren2(frameTable);
//鍥炬爣
var btnIcon = frameTable.AddLeftIcon();
//淇℃伅
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs
index 74c6a61..b2814b2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs
@@ -315,7 +315,7 @@
btnColorView.Y = Application.GetRealHeight(5);
btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnColorView.TextID = R.MyInternationalizationString.uColor;
- frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
int R1 = Convert.ToInt32(this.keyColorData.CloseColorR, 16);
int G1 = Convert.ToInt32(this.keyColorData.CloseColorG, 16);
@@ -330,13 +330,13 @@
btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
btnColorLine.BorderWidth = 1;
btnColorLine.BorderColor = 0xffcccccc;
- frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEvent);
var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
btnColor.Gravity = Gravity.Center;
btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
btnColor.BackgroundColor = backColor;
- btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
+ btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEvent);
//鍙樻洿婊戝姩鏉$殑棰滆壊
seekBar1.ProgressBarColor = backColor;
@@ -345,7 +345,7 @@
btnRight.UnSelectedImagePath = "Item/RightNext.png";
btnRight.Y = Application.GetRealHeight(5);
btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
- frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
btnRight.Y += this.GetPictrueRealSize(8);
frameColor.ButtonClickEvent += (sender, e) =>
@@ -477,7 +477,7 @@
btnColorView.Y = Application.GetRealHeight(5);
btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnColorView.TextID = R.MyInternationalizationString.uColor;
- frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16);
int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16);
@@ -492,13 +492,13 @@
btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
btnColorLine.BorderWidth = 1;
btnColorLine.BorderColor = 0xffcccccc;
- frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEvent);
var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
btnColor.Gravity = Gravity.Center;
btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
btnColor.BackgroundColor = backColor;
- btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
+ btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEvent);
//鍙樻洿婊戝姩鏉$殑棰滆壊
seekBar1.ProgressBarColor = backColor;
@@ -507,7 +507,7 @@
btnRight.UnSelectedImagePath = "Item/RightNext.png";
btnRight.Y = Application.GetRealHeight(5);
btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
- frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
btnRight.Y += this.GetPictrueRealSize(8);
frameColor.ButtonClickEvent += (sender, e) =>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs
index 4613059..b0bccec 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLightSettionForm.cs
@@ -288,7 +288,7 @@
btnColorView.Y = Application.GetRealHeight(5);
btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnColorView.TextID = R.MyInternationalizationString.uColor;
- frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
int R1 = Convert.ToInt32(this.keyColorData.CloseColorR, 16);
int G1 = Convert.ToInt32(this.keyColorData.CloseColorG, 16);
@@ -313,7 +313,7 @@
btnColor.Radius = (uint)btnColorWidth / 2;
btnColor.BackgroundColor = backColor;
frameColorLine.AddChidren(btnColor, ChidrenBindMode.NotBind);
- frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEventOnly);
+ frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEvent);
//鍙樻洿婊戝姩鏉$殑棰滆壊
seekBar1.ProgressBarColor = backColor;
@@ -322,7 +322,7 @@
btnRight.UnSelectedImagePath = "Item/RightNext.png";
btnRight.Y = Application.GetRealHeight(5);
btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
- frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
btnRight.Y += this.GetPictrueRealSize(8);
frameColor.ButtonClickEvent += (sender, e) =>
@@ -430,7 +430,7 @@
btnColorView.Y = Application.GetRealHeight(5);
btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnColorView.TextID = R.MyInternationalizationString.uColor;
- frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16);
int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16);
@@ -455,7 +455,7 @@
btnColor.Radius = (uint)btnColorWidth / 2;
btnColor.BackgroundColor = backColor;
frameColorLine.AddChidren(btnColor, ChidrenBindMode.NotBind);
- frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEventOnly);
+ frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEvent);
//鍙樻洿婊戝姩鏉$殑棰滆壊
seekBar1.ProgressBarColor = backColor;
@@ -464,7 +464,7 @@
btnRight.UnSelectedImagePath = "Item/RightNext.png";
btnRight.Y = Application.GetRealHeight(5);
btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
- frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
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 7f2f4d4..fb3e925 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
@@ -481,7 +481,7 @@
btnIcon.RadiusEx = 16;
btnIcon.BorderWidth = 2;
btnIcon.BorderColor = 0xff979797;
- frame.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ frame.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
//鐐瑰嚮浜嬩欢
frame.ButtonClickEvent += (sender, e) =>
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs
index b1cbd81..304bd26 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs
@@ -184,7 +184,7 @@
var btnIcon = new IconViewControl(iconWidth, false);
btnIcon.Gravity = Gravity.Center;
btnIcon.Radius = (uint)btnIcon.IconSize / 2;
- btnFrame.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ btnFrame.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
if (dataColor != null)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
index fee7e2a..1c7e010 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
@@ -383,7 +383,7 @@
btnIcon.IsBold = true;
if (frame is FrameLayoutStatuControl)
{
- ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEvent);
((FrameLayoutStatuControl)frame).ButtonClickEvent += (sender, e) =>
{
//鎸夐敭鐐瑰嚮
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs
index d70ff25..aabf9f1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentLightSettionForm.cs
@@ -227,7 +227,7 @@
btnColorView.Y = Application.GetRealHeight(5);
btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnColorView.TextID = R.MyInternationalizationString.uColor;
- frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
int R1 = Convert.ToInt32("d8", 16);
int G1 = Convert.ToInt32("95", 16);
@@ -251,7 +251,7 @@
btnColor.Radius = (uint)btnColorWidth / 2;
btnColor.BackgroundColor = UserCenterColor.Current.ErrorColor;
frameColorLine.AddChidren(btnColor, ChidrenBindMode.NotBind);
- frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEventOnly);
+ frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEvent);
//鍙樻洿婊戝姩鏉$殑棰滆壊
seekBar1.ProgressBarColor = backColor;
@@ -260,7 +260,7 @@
btnRight.UnSelectedImagePath = "Item/RightNext.png";
btnRight.Y = Application.GetRealHeight(5);
btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
- frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
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 643fcd0..45d82b8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
@@ -298,7 +298,7 @@
btnColorView.Y = Application.GetRealHeight(5);
btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnColorView.TextID = R.MyInternationalizationString.uColor;
- frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16);
int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16);
@@ -313,19 +313,19 @@
btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
btnColorLine.BorderWidth = 1;
btnColorLine.BorderColor = 0xffcccccc;
- frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEvent);
var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
btnColor.Gravity = Gravity.Center;
btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
btnColor.BackgroundColor = backColor;
- btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
+ btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEvent);
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 - this.GetPictrueRealSize(58);
- frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
+ frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
btnRight.Y += this.GetPictrueRealSize(8);
frameColor.ButtonClickEvent += (sender, e) =>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
index f646435..bebb777 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
@@ -343,7 +343,7 @@
btnIcon.IsBold = true;
if (frame is FrameLayoutStatuControl)
{
- ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEvent);
((FrameLayoutStatuControl)frame).ButtonClickEvent += (sender, e) =>
{
//鎸夐敭鐐瑰嚮
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
index b15ad79..2b149e4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
@@ -337,7 +337,7 @@
btnIcon.RadiusEx = 16;
btnIcon.BorderWidth = 2;
btnIcon.BorderColor = 0xff979797;
- frame.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+ frame.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
//鐐瑰嚮浜嬩欢
frame.ButtonClickEvent += (sender, e) =>
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs
index 0964bf2..39ffcf6 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs
@@ -41,10 +41,10 @@
//璁剧疆澶撮儴淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uWorkMode));
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//鑾峰彇鍒濆鏁版嵁
- var result = await this.GetDeviceAllDefultData();
+ var result = this.GetDeviceAllDefultData();
if (result == false)
{
return;
@@ -237,7 +237,7 @@
/// 鑾峰彇鍒濆鏁版嵁
/// </summary>
/// <returns></returns>
- private async Task<bool> GetDeviceAllDefultData()
+ private bool GetDeviceAllDefultData()
{
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
index b89d1e5..61e1041 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
@@ -607,26 +607,28 @@
var SubAccounListTemp = await ZigBee.Device.DoorLock.GetSubAccountByDistributedMark();
var SubAccounListDictionary = new Dictionary<string, Shared.Phone.UserCenter.MemberInfoRes> { };
- foreach (var member in SubAccounListTemp)
- {
- //鍒ゆ柇涓�涓处鎴风粦瀹氫簡閭鐨勬儏鍐�
- if (SubAccounListDictionary.ContainsKey(member.DistributedMark) == true
- || member.Account == UserCenterResourse.UserInfo.Phone
- || member.Account == UserCenterResourse.UserInfo.Email)
- {
- //濡傛灉鏄畠鑷繁鐨勮瘽锛屼笉鏄剧ず,璐︽埛鍜岀粦瀹氱殑閭鍙樉绀哄叾涓箣涓�
- continue;
+ if (SubAccounListTemp != null)
+ {
+ foreach (var member in SubAccounListTemp)
+ {
+ //鍒ゆ柇涓�涓处鎴风粦瀹氫簡閭鐨勬儏鍐�
+ if (SubAccounListDictionary.ContainsKey(member.DistributedMark) == true
+ || member.Account == UserCenterResourse.UserInfo.Phone
+ || member.Account == UserCenterResourse.UserInfo.Email)
+ {
+ //濡傛灉鏄畠鑷繁鐨勮瘽锛屼笉鏄剧ず,璐︽埛鍜岀粦瀹氱殑閭鍙樉绀哄叾涓箣涓�
+ continue;
+ }
+ //鍘绘帀瀛愯处鎴蜂腑鏅�氭垚鍛橈紝鐣欎笅鎷ユ湁绠$悊鍛樻潈闄愮殑鎴愬憳
+ //锛堝洜涓哄垎閰嶈处鎴风粰鏅�氭垚鍛橈紝鏅�氭垚鍛樺湪app涓笉鑳借繘鍏ヨ澶囩鐞嗛偅閲岋紝鎵�浠ユ病鍙戞煡鐪嬩富浜哄垎閰嶅璐︽埛锛�
+ if (member.AccountType != 1)
+ {
+ continue;
+ }
+
+ SubAccounListDictionary.Add(member.DistributedMark, member);
}
- //鍘绘帀瀛愯处鎴蜂腑鏅�氭垚鍛橈紝鐣欎笅鎷ユ湁绠$悊鍛樻潈闄愮殑鎴愬憳
- //锛堝洜涓哄垎閰嶈处鎴风粰鏅�氭垚鍛橈紝鏅�氭垚鍛樺湪app涓笉鑳借繘鍏ヨ澶囩鐞嗛偅閲岋紝鎵�浠ユ病鍙戞煡鐪嬩富浜哄垎閰嶅璐︽埛锛�
- if (member.AccountType != 1)
- {
- continue;
- }
-
- SubAccounListDictionary.Add(member.DistributedMark, member);
}
-
foreach (var addMemberID in SubAccounListDictionary.Keys)
{
SubAccounList.Add(SubAccounListDictionary[addMemberID]);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
index 1c10f51..1632ec7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -14,7 +14,7 @@
{
}
#region 鍙橀噺鐢虫槑
- public FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout };
+ public new FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout };
public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1925 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout };
#region 搴曢儴鏈夊渾瑙掑竷灞�
/// 鑳屾櫙闃村奖鐣岄潰
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewayDirection2Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewayDirection2Form.cs
index 3a9e737..6163a3c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewayDirection2Form.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewayDirection2Form.cs
@@ -40,8 +40,8 @@
//濡傛灉涓嶆槸鐑偣妯″紡
if (HdlWifiLogic.Current.IsMiniGatewayHotspot == false)
{
- //璇烽�夋嫨widora-xxxx缃戠粶
- this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uPleaseSelectWidoraXXNet));
+ //璇烽�夋嫨hdlZigbeeGW-xxxx缃戠粶
+ this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uPleaseSelectGatewayXXNet));
return;
}
var errorMsg = HdlWifiLogic.Current.StartApTcpConnection();
@@ -70,8 +70,8 @@
framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
bodyFrameLayout.AddChidren(framePic);
- //鎵嬫満鍘昏缃繛鎺ョ綉鍏崇儹鐐箋0}閫夋嫨widora-xxxx缃戠粶
- string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddMiniGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+ //鎵嬫満鍘昏缃繛鎺ョ綉鍏崇儹鐐箋0}鍗砲dlZigbeeGW-xxxx,瀵嗙爜hdl123456{0}鍙煡鐪嬬綉鍏宠儗闈㈡爣绛炬煡鐪嬬儹鐐瑰悕瀛楀拰瀵嗙爜
+ string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
int yy = framePic.Bottom + Application.GetRealHeight(213);
foreach (var msg in ArryMsg)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs
index 0afbf47..7102037 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs
@@ -160,7 +160,7 @@
btnReDo.Gravity = Gravity.CenterHorizontal;
btnReDo.TextAlignment = TextAlignment.Center;
btnReDo.TextID = R.MyInternationalizationString.uReDoAgain;
- frameback.AddChidren(btnReDo, ChidrenBindMode.BindEventOnly);
+ frameback.AddChidren(btnReDo, ChidrenBindMode.BindEvent);
frameback.ButtonClickEvent += (sender, e) =>
{
//鍒濆鍖栧垵濮嬩腑閮ㄦ帶浠�
@@ -331,7 +331,7 @@
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
var way = ZbGateway.GateWayList[i];
- var wayId = HdlGatewayLogic.Current.GetGatewayId(way);
+ var wayId = way.GwId;
if (dicZbGatewayDiv.ContainsKey(wayId) == true)
{
//宸茬粡澶勭悊浜�
@@ -342,9 +342,9 @@
GatewayBindMode mode = GatewayBindMode.BindAgain;
//濡傛灉鏄涓�娆$粦瀹�,鎴栬�呮槸浠ュ墠宸茬粡缁戝畾杩囦簡鐨�
if (HdlGatewayLogic.Current.HomeIdIsEmpty(way) == true
- || way.getGatewayBaseInfo.HomeId == Common.Config.Instance.HomeId)
+ || way.HomeId == Common.Config.Instance.HomeId)
{
- if (way.getGatewayBaseInfo.HomeId != Common.Config.Instance.HomeId)
+ if (way.HomeId != Common.Config.Instance.HomeId)
{
//绗竴娆$粦瀹�,涔熷氨鏄綉鍏充綇瀹匢D涓虹┖
mode = GatewayBindMode.First;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs
index 3b4222c..7c9024b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs
@@ -57,13 +57,8 @@
row1.AddBottomLine();
row1.ButtonClickEvent += (sender, e) =>
{
- //妫�娴嬩綇瀹呯粡绾害
- if (this.CheckResidencePoint() == false)
- {
- return;
- }
- var form = new WiredGatewayDirectionForm();
- form.AddForm();
+ //鑿滃崟鎸夐挳鐨勭偣鍑讳簨浠�
+ this.MenuButtonClickEvent(1);
};
//鏃犵嚎缃戝叧
@@ -77,25 +72,8 @@
row2.AddBottomLine();
row2.ButtonClickEvent += (sender, e) =>
{
- //妫�娴嬩綇瀹呯粡绾害
- if (this.CheckResidencePoint() == false)
- {
- return;
- }
- var menuContr = new BottomMenuSelectForm();
- menuContr.AddForm(2);
- //UDP妯″紡(鎺ㄨ崘)
- menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uUdpModeRecommend), () =>
- {
- var form = new WirelessUdpDirectionForm();
- form.AddForm();
- });
- //AP妯″紡
- menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uApMode), () =>
- {
- var form = new WirelessApDirection1Form();
- form.AddForm();
- });
+ //鑿滃崟鎸夐挳鐨勭偣鍑讳簨浠�
+ this.MenuButtonClickEvent(2);
};
//Mini缃戝叧
@@ -108,13 +86,8 @@
row3.AddRightArrow();
row3.ButtonClickEvent += (sender, e) =>
{
- //妫�娴嬩綇瀹呯粡绾害
- if (this.CheckResidencePoint() == false)
- {
- return;
- }
- var form = new MiniGatewayDirection1Form();
- form.AddForm();
+ //鑿滃崟鎸夐挳鐨勭偣鍑讳簨浠�
+ this.MenuButtonClickEvent(3);
};
listView.AdjustRealHeight(Application.GetRealHeight(23));
@@ -142,6 +115,80 @@
btnTip.Text = Language.StringByID(R.MyInternationalizationString.uNotSetLocationWillAffectTheAutomaticGeofencingFunction);
frameTip.AddChidren(btnTip);
}
+ }
+
+ #endregion
+
+ #region 鈻� 鎸夐敭鐐瑰嚮___________________________
+
+ /// <summary>
+ /// 鑿滃崟鎸夐挳鐨勭偣鍑讳簨浠�
+ /// </summary>
+ /// <param name="menuDiv">1:鏈夌嚎缃戝叧 2:鏃犵嚎缃戝叧 3:mini缃戝叧</param>
+ private void MenuButtonClickEvent(int menuDiv)
+ {
+ //鍙脊涓�娆�
+ if (this.showSettion == true && Common.Config.Instance.Home.Latitude == 0 && Common.Config.Instance.Home.Longitude == 0)
+ {
+ this.showSettion = false;
+ //璇峰墠寰�浣忓畢绠$悊{0}璁剧疆浣忓畢鐨勫湴鐞嗕綅缃�
+ string msg = Language.StringByID(R.MyInternationalizationString.uGotoResidenceAndSetLocation).Replace("{0}", "\r\n");
+ var alert = new ShowMsgControl(ShowMsgType.Confirm, msg,
+ Language.StringByID(R.MyInternationalizationString.uGotoSettion),
+ Language.StringByID(R.MyInternationalizationString.uNeglect));
+ alert.Show();
+
+ //蹇界暐
+ alert.CancelClickEvent += () =>
+ {
+ //鏄剧ず鎸囧畾鐨勭晫闈�
+ this.ShowFormByMenuDiv(menuDiv);
+ };
+ //鍘昏缃�
+ alert.ConfirmClickEvent += () =>
+ {
+ var form = new Residence.ResidenceManagementForm();
+ form.AddForm(false);
+ };
+ return;
+ }
+ //鏄剧ず鎸囧畾鐨勭晫闈�
+ this.ShowFormByMenuDiv(menuDiv);
+ }
+
+ /// <summary>
+ /// 鏄剧ず鎸囧畾鐨勭晫闈�
+ /// </summary>
+ /// <param name="menuDiv">1:鏈夌嚎缃戝叧 2:鏃犵嚎缃戝叧 3:mini缃戝叧</param>
+ private void ShowFormByMenuDiv(int menuDiv)
+ {
+ if (menuDiv == 1)
+ {
+ var form = new WiredGatewayDirectionForm();
+ form.AddForm();
+ }
+ else if (menuDiv == 2)
+ {
+ var menuContr = new BottomMenuSelectForm();
+ menuContr.AddForm(2);
+ //UDP妯″紡(鎺ㄨ崘)
+ menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uUdpModeRecommend), () =>
+ {
+ var form = new WirelessUdpDirectionForm();
+ form.AddForm();
+ });
+ //AP妯″紡
+ menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uApMode), () =>
+ {
+ var form = new WirelessApDirection1Form();
+ form.AddForm();
+ });
+ }
+ else if (menuDiv == 3)
+ {
+ var form = new MiniGatewayDirection1Form();
+ form.AddForm();
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
index c6d8d0a..74d9ccb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
@@ -167,7 +167,7 @@
btnReDo.Gravity = Gravity.CenterHorizontal;
btnReDo.TextAlignment = TextAlignment.Center;
btnReDo.TextID = R.MyInternationalizationString.uReDoAgain;
- frameback.AddChidren(btnReDo, ChidrenBindMode.BindEventOnly);
+ frameback.AddChidren(btnReDo, ChidrenBindMode.BindEvent);
frameback.ButtonClickEvent += (sender, e) =>
{
//鍒濆鍖栧垵濮嬩腑閮ㄦ帶浠�
@@ -315,12 +315,12 @@
List<string> listId = new List<string>();
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
- if (ZbGateway.GateWayList[i].getGatewayBaseInfo.IpAddress == string.Empty)
+ if (ZbGateway.GateWayList[i].GwIP == string.Empty)
{
//IP娌℃湁鐨勭綉鍏筹紝鎴戜篃涓嶇煡閬撳畠鏄共鍢涚殑
continue;
}
- string gwId = HdlGatewayLogic.Current.GetGatewayId(ZbGateway.GateWayList[i]);
+ string gwId = ZbGateway.GateWayList[i].GwId;
//閲嶅娣诲姞妫�娴�
if (this.dicIdCheckCount.ContainsKey(gwId) == false)
{
@@ -342,7 +342,7 @@
}
for (int i = 0; i < listId.Count; i++)
{
- ZbGateway way = ZbGateway.GateWayList.Find((obj) => HdlGatewayLogic.Current.GetGatewayId(obj) == listId[i]);
+ ZbGateway way = ZbGateway.GateWayList.Find((obj) => obj.GwId == listId[i]);
if (way == null)
{
continue;
@@ -352,9 +352,9 @@
GatewayBindMode mode = GatewayBindMode.BindAgain;
//濡傛灉鏄涓�娆$粦瀹�,鎴栬�呮槸浠ュ墠宸茬粡缁戝畾杩囦簡鐨�
if (HdlGatewayLogic.Current.HomeIdIsEmpty(way) == true
- || way.getGatewayBaseInfo.HomeId == Common.Config.Instance.HomeId)
+ || way.HomeId == Common.Config.Instance.HomeId)
{
- if (way.getGatewayBaseInfo.HomeId != Common.Config.Instance.HomeId)
+ if (way.HomeId != Common.Config.Instance.HomeId)
{
//绗竴娆$粦瀹�,涔熷氨鏄綉鍏充綇瀹匢D涓虹┖
mode = GatewayBindMode.First;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs
index b721d1b..a4ba623 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs
@@ -160,7 +160,7 @@
btnReDo.Gravity = Gravity.CenterHorizontal;
btnReDo.TextAlignment = TextAlignment.Center;
btnReDo.TextID = R.MyInternationalizationString.uReDoAgain;
- frameback.AddChidren(btnReDo, ChidrenBindMode.BindEventOnly);
+ frameback.AddChidren(btnReDo, ChidrenBindMode.BindEvent);
frameback.ButtonClickEvent += (sender, e) =>
{
//鍒濆鍖栧垵濮嬩腑閮ㄦ帶浠�
@@ -332,7 +332,7 @@
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
var way = ZbGateway.GateWayList[i];
- var wayId = HdlGatewayLogic.Current.GetGatewayId(way);
+ var wayId = way.GwId;
if (dicZbGatewayDiv.ContainsKey(wayId) == true)
{
//宸茬粡澶勭悊浜�
@@ -343,9 +343,9 @@
GatewayBindMode mode = GatewayBindMode.BindAgain;
//濡傛灉鏄涓�娆$粦瀹�,鎴栬�呮槸浠ュ墠宸茬粡缁戝畾杩囦簡鐨�
if (HdlGatewayLogic.Current.HomeIdIsEmpty(way) == true
- || way.getGatewayBaseInfo.HomeId == Common.Config.Instance.HomeId)
+ || way.HomeId == Common.Config.Instance.HomeId)
{
- if (way.getGatewayBaseInfo.HomeId != Common.Config.Instance.HomeId)
+ if (way.HomeId != Common.Config.Instance.HomeId)
{
//绗竴娆$粦瀹�,涔熷氨鏄綉鍏充綇瀹匢D涓虹┖
mode = GatewayBindMode.First;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs
index 9b41e07..a54bbe8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs
@@ -160,7 +160,7 @@
btnReDo.Gravity = Gravity.CenterHorizontal;
btnReDo.TextAlignment = TextAlignment.Center;
btnReDo.TextID = R.MyInternationalizationString.uReDoAgain;
- frameback.AddChidren(btnReDo, ChidrenBindMode.BindEventOnly);
+ frameback.AddChidren(btnReDo, ChidrenBindMode.BindEvent);
frameback.ButtonClickEvent += (sender, e) =>
{
//鍒濆鍖栧垵濮嬩腑閮ㄦ帶浠�
@@ -332,7 +332,7 @@
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
var way = ZbGateway.GateWayList[i];
- var wayId = HdlGatewayLogic.Current.GetGatewayId(way);
+ var wayId = way.GwId;
if (dicZbGatewayDiv.ContainsKey(wayId) == true)
{
//宸茬粡澶勭悊浜�
@@ -343,9 +343,9 @@
GatewayBindMode mode = GatewayBindMode.BindAgain;
//濡傛灉鏄涓�娆$粦瀹�,鎴栬�呮槸浠ュ墠宸茬粡缁戝畾杩囦簡鐨�
if (HdlGatewayLogic.Current.HomeIdIsEmpty(way) == true
- || way.getGatewayBaseInfo.HomeId == Common.Config.Instance.HomeId)
+ || way.HomeId == Common.Config.Instance.HomeId)
{
- if (way.getGatewayBaseInfo.HomeId != Common.Config.Instance.HomeId)
+ if (way.HomeId != Common.Config.Instance.HomeId)
{
//绗竴娆$粦瀹�,涔熷氨鏄綉鍏充綇瀹匢D涓虹┖
mode = GatewayBindMode.First;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs
index de5e249..5bf5f94 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayAddSuccessForm.cs
@@ -75,7 +75,7 @@
btnAdd.Gravity = Gravity.CenterHorizontal;
btnAdd.TextAlignment = TextAlignment.Center;
btnAdd.TextID = R.MyInternationalizationString.uContinuteToAddGateway;
- frameAdd.AddChidren(btnAdd, ChidrenBindMode.BindEventOnly);
+ frameAdd.AddChidren(btnAdd, ChidrenBindMode.BindEvent);
frameAdd.ButtonClickEvent += (sender, e) =>
{
//璁╁畠閫�鍒拌彍鍗曢�夋嫨鐣岄潰
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs
index e334f30..1f1b42d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs
@@ -94,7 +94,7 @@
this.ShowProgressBar();
//鑾峰彇鑷姩澶囦唤鐨勬暟鎹�
- var pageAuto = await HdlBackupLogic.Current.GetBackupListNameFromDB(3, HdlGatewayLogic.Current.GetGatewayId(realGateway));
+ var pageAuto = await HdlBackupLogic.Current.GetBackupListNameFromDB(3, realGateway.GwId);
if (pageAuto == null)
{
//鍏抽棴杩涘害鏉�
@@ -103,7 +103,7 @@
}
//浠庝簯绔幏鍙栨暟鎹�
- var pageData = await HdlBackupLogic.Current.GetBackupListNameFromDB(2, HdlGatewayLogic.Current.GetGatewayId(realGateway));
+ var pageData = await HdlBackupLogic.Current.GetBackupListNameFromDB(2, realGateway.GwId);
if (pageData == null)
{
//鍏抽棴杩涘害鏉�
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayGeneralInformationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayGeneralInformationForm.cs
index e9cd431..55cce79 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayGeneralInformationForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayGeneralInformationForm.cs
@@ -65,14 +65,7 @@
rowSerial.UseClickStatu = false;
listView.AddChidren(rowSerial);
rowSerial.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSerialNumber), 300);
- if (i_gateway.getGwInfo == null)
- {
- rowSerial.AddMostRightView("000000000000", 600);
- }
- else
- {
- rowSerial.AddMostRightView(string.IsNullOrEmpty(i_gateway.getGwInfo.GWSN) == false ? i_gateway.getGwInfo.GWSN : "000000000000", 600);
- }
+ rowSerial.AddMostRightView(string.IsNullOrEmpty(i_gateway.GwSerialNum) == false ? i_gateway.GwSerialNum : "000000000000", 600);
rowSerial.AddBottomLine();
//缃戝叧ID
@@ -80,7 +73,7 @@
rowGatewayID.UseClickStatu = false;
listView.AddChidren(rowGatewayID);
rowGatewayID.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uGatewayID), 300);
- rowGatewayID.AddMostRightView(HdlGatewayLogic.Current.GetGatewayId(i_gateway), 600);
+ rowGatewayID.AddMostRightView(i_gateway.GwId, 600);
rowGatewayID.AddBottomLine();
//缃戝叧IP
@@ -88,7 +81,7 @@
rowGatewayIP.UseClickStatu = false;
listView.AddChidren(rowGatewayIP);
rowGatewayIP.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uGatewayIP), 300);
- rowGatewayIP.AddMostRightView(i_gateway.getGatewayBaseInfo.IpAddress, 600);
+ rowGatewayIP.AddMostRightView(i_gateway.GwIP, 600);
rowGatewayIP.AddBottomLine();
//鍗忚鍣∕AC
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index db710c9..ff1fb33 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -119,9 +119,10 @@
btnBeloneArea.AddBottomLine();
//mini缃戝叧鏈変釜鍔熻兘璁剧疆
- if (this.zbGateway.getGwInfo != null && this.zbGateway.getGwInfo.LinuxImageType == 11)
+ var linuxImageType = this.zbGateway.LinuxImageType;
+ if (linuxImageType == 11)
{
- var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
CommonDevice miniDevice = null;
foreach (var device in listDevice)
{
@@ -162,7 +163,7 @@
rowData.frameTable.ButtonClickEvent += (sender, e) =>
{
var form = new GatewayUploadAndDownLoadForm();
- form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ form.AddForm(this.zbGateway.GwId);
};
//閫氱敤淇℃伅
@@ -193,7 +194,7 @@
btnNewVersion.Visible = false;
btnNewVersion.X = Application.GetRealWidth(242);
btnNewVersion.Y = Application.GetRealHeight(23);
- rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
+ rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEvent);
rowUpDate.ButtonClickEvent += (sender, e) =>
{
btnNewVersion.Visible = false;
@@ -219,7 +220,7 @@
if (oldName != btnNote.Text)
{
//淇敼鍚嶅瓧
- this.SetGatewayName(btnNote.Text, false);
+ this.SetGatewayName(btnNote.Text, true);
}
else
{
@@ -277,7 +278,7 @@
//鍒囨崲
MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1);
- string strWayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+ string strWayId = this.zbGateway.GwId;
if (strWayId == GatewayResourse.AppOldSelectGatewayId)
{
MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh);
@@ -348,34 +349,6 @@
#endregion
- #region 鈻� 瀹屾垚鎸夐挳鎸変笅_______________________
-
- /// <summary>
- /// 瀹屾垚鎸夐挳鎸変笅
- /// </summary>
- /// <param name="gatewayName">缃戝叧鍚�</param>
- private void FinishButtonClick(string gatewayName)
- {
- if (string.IsNullOrEmpty(gatewayName) == true)
- {
- //璇疯緭鍏ョ綉鍏冲悕绉�
- string msg = Language.StringByID(R.MyInternationalizationString.uGatewayNameMastInput);
- this.ShowMassage(ShowMsgType.Error, msg);
- return;
- }
- string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
- if (nameValue == gatewayName)
- {
- //鍚屽悕涓嶉渶瑕佸鐞�
- this.CloseForm();
- return;
- }
- //淇敼鍚嶅瓧
- this.SetGatewayName(gatewayName, true);
- }
-
- #endregion
-
#region 鈻� 淇敼鍚嶅瓧___________________________
/// <summary>
@@ -408,8 +381,7 @@
/// <param name="online"></param>
private async void DoSwitchGateway()
{
- string gatewayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
- var result = await HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
+ var result = await HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
if (result == false)
{
return;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
index 8ab794a..74055ac 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -95,8 +95,7 @@
for (int i = 0; i < listway.Count; i++)
{
//娣诲姞琛�
- var gwId = HdlGatewayLogic.Current.GetGatewayId(listway[i]);
- this.AddRowLayout(gwId, i != listway.Count - 1);
+ this.AddRowLayout(listway[i].GwId, i != listway.Count - 1);
}
//璋冩暣鍒楄〃鎺т欢鐨勯珮搴�
@@ -131,7 +130,7 @@
//鎻愮ず鏂扮増鏈�
var btnNew = new InformationTipView(gatewayRow.btnIcon);
btnNew.Visible = false;
- gatewayRow.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEventOnly);
+ gatewayRow.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
gatewayRow.AddTag("btnNew", btnNew);
//鍗曞嚮浜嬩欢
gatewayRow.frameTable.ButtonClickEvent += (sender, e) =>
@@ -226,7 +225,7 @@
btnNow.Y = Application.GetMinReal(23) + gatewayRow.frameTable.chidrenYaxis;
btnNow.UnSelectedImagePath = "Item/NowAcctionTip.png";
btnNow.X = gatewayRow.btnName.X + gatewayRow.btnName.GetRealWidthByText();
- gatewayRow.frameTable.AddChidren(btnNow, ChidrenBindMode.BindEventOnly);
+ gatewayRow.frameTable.AddChidren(btnNow, ChidrenBindMode.BindEvent);
}
}
@@ -361,7 +360,7 @@
{
return;
}
- string gwid = HdlGatewayLogic.Current.GetGatewayId(gateWay);
+ string gwid = gateWay.GwId;
if (this.dicRowContr.ContainsKey(gwid) == true && this.dicRowContr[gwid] != null)
{
this.dicRowContr[gwid].IsOnline = online;
@@ -399,7 +398,7 @@
if (result[0] != null || result[1] != null || result[2] != null)
{
//鏈夋柊鐗堟湰
- string gwid = HdlGatewayLogic.Current.GetGatewayId(way);
+ string gwid = way.GwId;
Application.RunOnMainThread(() =>
{
if (this.dicRowContr.ContainsKey(gwid) == true && this.dicRowContr[gwid] != null)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
index d19b1ff..b509b41 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
@@ -57,22 +57,22 @@
framePic.Y = Application.GetRealHeight(58);
listBackControl.frameTable.AddChidren(framePic);
- var imageFile = "Gateway/RealGateway" + this.zbGateway.getGwInfo.LinuxImageType + ".png";
- string fullName = IO.FileUtils.GetImageFilePath(imageFile);
- if (fullName == string.Empty)
+ var linuxImageType = this.zbGateway.LinuxImageType.ToString();
+ var imageFile = "Gateway/RealGateway" + linuxImageType + ".png";
+ imageFile = IO.FileUtils.GetImageFilePath(imageFile);
+ if (imageFile == string.Empty)
{
//濡傛灉娌℃湁鎸囧畾鐨勭綉鍏崇殑鐪熷疄鍥剧墖鐨勮瘽,鍒欑敤鍏遍�氬浘鐗�
- imageFile = "Gateway/RealGateway.png";
-
+ imageFile = IO.FileUtils.GetImageFilePath("Gateway/RealGateway.png");
}
#if Android
//璁惧鍥剧墖
- var bim = Android.Graphics.BitmapFactory.DecodeFile(fullName);
+ var bim = Android.Graphics.BitmapFactory.DecodeFile(imageFile);
var btnpictrue = new PicViewControl(bim.Width, bim.Height);
#endif
#if iOS
//璁惧鍥剧墖
- var bim = UIKit.UIImage.FromFile(fullName);
+ var bim = UIKit.UIImage.FromFile(imageFile);
var btnpictrue = new PicViewControl((int)bim.Size.Width, (int)bim.Size.Height);
#endif
bim.Dispose();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
index 262558f..eea6e72 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
@@ -47,7 +47,7 @@
if (value == 1)
{
//鎴愬姛
- i_dicZbGatewayDiv[HdlGatewayLogic.Current.GetGatewayId(i_gateway)] = 1;
+ i_dicZbGatewayDiv[i_gateway.GwId] = 1;
}
else if (value == 0)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
index c91a3c2..03fad5d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
@@ -84,7 +84,7 @@
/// <param name="addLine"></param>
private void AddGatewayRow(VerticalListControl listView, ZbGateway gateway, bool addLine)
{
- string gwid = HdlGatewayLogic.Current.GetGatewayId(gateway);
+ string gwid = gateway.GwId;
if (this.dicZbGatewayDiv[gwid] != 2)
{
//濡傛灉鏈湴娌℃湁,閭d箞搴旇鏄湪涔嬪悗鐨勭紪杈戠晫闈㈠垹闄や簡
@@ -180,7 +180,8 @@
/// </summary>
public override void CloseFormBefore()
{
- if (UserCenterResourse.listActionFormId.Contains("UserMainForm") == false)
+ var userPageForm = UserView.UserPage.Instance.GetNowActionForm();
+ if (userPageForm != null && userPageForm.FormID == "UserMainForm")
{
//鍒锋柊涓婚〉
UserView.UserPage.Instance.ReFreshControl();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayCoordinatorInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayCoordinatorInfoForm.cs
index 1fb7f2e..1384ba1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayCoordinatorInfoForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayCoordinatorInfoForm.cs
@@ -86,7 +86,7 @@
//闀滃儚ID
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uImageId), 300);
- row1.AddMostRightView(zbGateway.getGwInfo.ZbImageType.ToString(), 400);
+ row1.AddMostRightView(zbGateway.CoordinatorImageId.ToString(), 400);
row1.AddBottomLine();
}
@@ -105,7 +105,7 @@
//鍥轰欢鐗堟湰
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 300);
- row1.AddMostRightView(Common.LocalDevice.Current.AppendVersion(zbGateway.getGwInfo.ZbFWVersion), 400);
+ row1.AddMostRightView(Common.LocalDevice.Current.AppendVersion(zbGateway.CoordinatorFirmwareVersion), 400);
row1.AddBottomLine();
}
@@ -124,7 +124,7 @@
//鍥轰欢鏃ユ湡
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareDate), 300);
- row1.AddMostRightView(zbGateway.getGwInfo.AppVersion.ToString(), 400);
+ row1.AddMostRightView(zbGateway.GwVersionDate.ToString(), 400);
row1.AddBottomLine();
}
@@ -143,7 +143,7 @@
//纭欢鐗堟湰
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareVersion), 300);
- row1.AddMostRightView(zbGateway.getGwInfo.ZbHWVersion.ToString(), 400);
+ row1.AddMostRightView(zbGateway.CoordinatorHardVersion.ToString(), 400);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
index 409fe85..4121ceb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
@@ -69,7 +69,7 @@
return;
}
//铏氭嫙椹卞姩鍙�
- this.listVode = await HdlGatewayLogic.Current.GetListVDDriveCode(this.zbGateway);
+ this.listVode = HdlGatewayLogic.Current.GetListVDDriveCode(this.zbGateway);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
@@ -119,7 +119,7 @@
rowLinux.ButtonClickEvent += (sender, e) =>
{
var form = new GatewayLinuxInfoForm();
- form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ form.AddForm(this.zbGateway.GwId);
};
//鍗忚皟鍣�
@@ -130,7 +130,7 @@
rowCoordinator.ButtonClickEvent += (sender, e) =>
{
var form = new GatewayCoordinatorInfoForm();
- form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ form.AddForm(this.zbGateway.GwId);
};
if (this.listVode != null)
@@ -405,7 +405,7 @@
ProgressFormBar.Current.CloseEvent += () =>
{
//鍗囩骇瀵硅薄
- string gwId = HdlGatewayLogic.Current.GetGatewayId(realway);
+ string gwId = realway.GwId;
if (FirmwareUpdateResourse.dicUpdateList.ContainsKey(gwId) == true
&& FirmwareUpdateResourse.dicUpdateList[gwId].IsFinishUpdate == true)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayHistoryFirmwareVersionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayHistoryFirmwareVersionForm.cs
index 1730e43..ae56315 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayHistoryFirmwareVersionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayHistoryFirmwareVersionForm.cs
@@ -78,13 +78,13 @@
//缃戝叧
var listData1 = HdlFirmwareUpdateLogic.GetFirmwareVersionListInfo(FirmwareLevelType.Linux,
- upDatezbGateway.getGwInfo.LinuxHWVersion.ToString(),
- upDatezbGateway.getGwInfo.LinuxImageType.ToString());
+ upDatezbGateway.LinuxHardVersion.ToString(),
+ upDatezbGateway.LinuxImageType.ToString());
//鍗忚皟鍣�
var listData2 = HdlFirmwareUpdateLogic.GetFirmwareVersionListInfo(FirmwareLevelType.Coordinator,
- upDatezbGateway.getGwInfo.ZbHWVersion.ToString(),
- upDatezbGateway.getGwInfo.ZbImageType.ToString());
+ upDatezbGateway.CoordinatorHardVersion.ToString(),
+ upDatezbGateway.CoordinatorImageId.ToString());
//铏氭嫙椹卞姩
var listData3 = new List<FirmwareVersionInfo>();
@@ -99,8 +99,8 @@
HdlThreadLogic.Current.RunMainInThread(() =>
{
bool canAddTitle = true;
- int fVersion1 = upDatezbGateway.getGwInfo.LinuxFWVersion;
- string imageType1 = upDatezbGateway.getGwInfo.LinuxImageType.ToString();
+ int fVersion1 = upDatezbGateway.LinuxFirmwareVersion;
+ string imageType1 = upDatezbGateway.LinuxImageType.ToString();
foreach (var data in listData1)
{
if (data.ImagType == imageType1 && fVersion1 == data.FirmwareVersion)
@@ -117,8 +117,8 @@
}
canAddTitle = true;
- int fVersion2 = upDatezbGateway.getGwInfo.ZbFWVersion;
- string imageType2 = upDatezbGateway.getGwInfo.ZbImageType.ToString();
+ int fVersion2 = upDatezbGateway.CoordinatorFirmwareVersion;
+ string imageType2 = upDatezbGateway.CoordinatorImageId.ToString();
foreach (var data in listData2)
{
if (data.ImagType == imageType2 && fVersion2 == data.FirmwareVersion)
@@ -183,8 +183,7 @@
rowlayout.ButtonClickEvent += (sender, e) =>
{
- string gwID = HdlGatewayLogic.Current.GetGatewayId(upDatezbGateway);
- if (FirmwareUpdateResourse.dicUpdateList.ContainsKey(gwID) == true)
+ if (FirmwareUpdateResourse.dicUpdateList.ContainsKey(upDatezbGateway.GwId) == true)
{
this.CloseForm();
return;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayLinuxInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayLinuxInfoForm.cs
index 40787ed..f0cb4b0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayLinuxInfoForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayLinuxInfoForm.cs
@@ -86,7 +86,7 @@
//闀滃儚ID
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uImageId), 300);
- row1.AddMostRightView(zbGateway.getGwInfo.LinuxImageType.ToString(), 400);
+ row1.AddMostRightView(zbGateway.LinuxImageType.ToString(), 400);
row1.AddBottomLine();
}
@@ -105,7 +105,7 @@
//鍥轰欢鐗堟湰
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 300);
- row1.AddMostRightView(Common.LocalDevice.Current.AppendVersion(zbGateway.getGwInfo.LinuxFWVersion), 400);
+ row1.AddMostRightView(Common.LocalDevice.Current.AppendVersion(zbGateway.LinuxFirmwareVersion), 400);
row1.AddBottomLine();
}
@@ -124,7 +124,7 @@
//鍥轰欢鏃ユ湡
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareDate), 300);
- row1.AddMostRightView(zbGateway.getGwInfo.AppVersion.ToString(), 400);
+ row1.AddMostRightView(zbGateway.GwVersionDate.ToString(), 400);
row1.AddBottomLine();
}
@@ -143,7 +143,7 @@
//纭欢鐗堟湰
row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareVersion), 300);
- row1.AddMostRightView(zbGateway.getGwInfo.LinuxHWVersion.ToString(), 400);
+ row1.AddMostRightView(zbGateway.LinuxHardVersion.ToString(), 400);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs
index 2d30198..0fc6ba8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HdlBackup/HdlAutoBackupForm.cs
@@ -76,7 +76,7 @@
btnBackup.Gravity = Gravity.CenterHorizontal;
btnBackup.TextAlignment = TextAlignment.Center;
btnBackup.Text = Language.StringByID(R.MyInternationalizationString.uImmediatelyBackup) + "(" + Language.StringByID(R.MyInternationalizationString.uRecommendation) + ")";
- frameback.AddChidren(btnBackup, ChidrenBindMode.BindEventOnly);
+ frameback.AddChidren(btnBackup, ChidrenBindMode.BindEvent);
frameback.ButtonClickEvent += (sender, e) =>
{
HdlThreadLogic.Current.RunThread(() =>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
index cd42286..2526f82 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
@@ -117,7 +117,7 @@
row1 = new FrameRowControl(listView.rowSpace / 2);
listView.AddChidren(row1);
- row1.AddLeftCaption("娓呴櫎缂撳瓨鏂囦欢", 500);
+ row1.AddLeftCaption("鏌ョ湅缂撳瓨鏂囦欢", 500);
row1.AddRightArrow();
row1.AddBottomLine();
row1.ButtonClickEvent += (sender, e) =>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/OtherParty/OtherPartyAccountMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/OtherParty/OtherPartyAccountMenuForm.cs
index f49441e..7ccbfb4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/OtherParty/OtherPartyAccountMenuForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/OtherParty/OtherPartyAccountMenuForm.cs
@@ -91,13 +91,13 @@
var btnChat = rowChat.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uWebChat), 400, 60);
btnChat.Y = Application.GetRealHeight(12) + rowChat.chidrenYaxis;
btnChat.TextSize = 15;
- rowChat.AddChidren(btnChat, ChidrenBindMode.BindEventOnly);
+ rowChat.AddChidren(btnChat, ChidrenBindMode.BindEvent);
//鏈巿鏉� OR 鍚嶅瓧
var btnTip1 = rowChat.AddLeftCaption(bindNameText == null ? string.Empty : bindNameText, 400, 50);
btnTip1.Y = Application.GetRealHeight(72) + rowChat.chidrenYaxis;
btnTip1.TextSize = 12;
btnTip1.TextColor = UserCenterColor.Current.TextGrayColor1;
- rowChat.AddChidren(btnTip1, ChidrenBindMode.BindEventOnly);
+ rowChat.AddChidren(btnTip1, ChidrenBindMode.BindEvent);
//鍚戝彸鍥炬爣
rowChat.AddRightArrow();
//搴曠嚎
@@ -141,13 +141,13 @@
//var btnQQ = rowQQ.AddLeftCaption("QQ", 400, 60);
//btnQQ.Y = Application.GetRealHeight(12) + rowQQ.chidrenYaxis;
//btnQQ.TextSize = 15;
- //rowQQ.AddChidren(btnQQ, ChidrenBindMode.BindEventOnly);
+ //rowQQ.AddChidren(btnQQ, ChidrenBindMode.BindEvent);
////鏈巿鏉� OR 鍚嶅瓧
//var btnTip2 = rowQQ.AddLeftCaption(bindNameText, 400, 49);
//btnTip2.Y = Application.GetRealHeight(72) + rowQQ.chidrenYaxis;
//btnTip2.TextSize = 12;
//btnTip2.TextColor = UserCenterColor.Current.TextGrayColor1;
- //rowQQ.AddChidren(btnTip2, ChidrenBindMode.BindEventOnly);
+ //rowQQ.AddChidren(btnTip2, ChidrenBindMode.BindEvent);
////鍚戝彸鍥炬爣
//rowQQ.AddRightArrow();
////璇风粦瀹� OR 瑙i櫎缁戝畾
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
index 911745a..4798b97 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
@@ -385,6 +385,10 @@
{
listDevice.Add(device);
}
+ else if (device.Type == ZigBee.Device.DeviceType.FreshAirHumiditySensor)
+ {
+ listDevice.Add(device);
+ }
}
var listSelect = new List<string>() { newRoom.HumidityDevice };
var form = new SelectDeviceForm();
@@ -440,7 +444,8 @@
{
HdlThreadLogic.Current.RunMain(() =>
{
- if (data.AttriButeData == 0)
+ decimal humidity = (decimal)device.GetType().InvokeMember("Humidity", System.Reflection.BindingFlags.GetField, null, device, null);
+ if (humidity == 0)
{
//0
btnHumi.Text = "0.0%";
@@ -448,11 +453,8 @@
}
else
{
- //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
//璁板綍婀垮害
- this.newRoom.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
+ this.newRoom.Humidity = humidity;
btnHumi.Text = this.newRoom.Humidity.ToString() + "%";
}
});
@@ -460,7 +462,7 @@
}
});
//鍙戦�佽幏鍙栨箍搴︾殑鍛戒护
- ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity();
+ device.GetType().InvokeMember("ReadTemperatureOrHumidity", System.Reflection.BindingFlags.InvokeMethod, null, device, null);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
index b6ddfc2..cd14c9d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -463,6 +463,10 @@
{
listDevice.Add(device);
}
+ else if (device.Type == ZigBee.Device.DeviceType.FreshAirHumiditySensor)
+ {
+ listDevice.Add(device);
+ }
}
var listSelect = new List<string>() { cloneRoom.HumidityDevice };
var form = new SelectDeviceForm();
@@ -515,7 +519,8 @@
var localDevice = Common.LocalDevice.Current.GetDevice(mainKeys);
HdlThreadLogic.Current.RunMain(() =>
{
- if (((ZigBee.Device.TemperatureSensor)localDevice).Humidity == 0)
+ decimal humidity = (decimal)localDevice.GetType().InvokeMember("Humidity", System.Reflection.BindingFlags.GetField, null, localDevice, null);
+ if (humidity == 0)
{
//0
btnHumi.Text = "0.0%";
@@ -524,13 +529,13 @@
else
{
//璁板綍婀垮害
- this.cloneRoom.Humidity = ((ZigBee.Device.TemperatureSensor)localDevice).Humidity;
+ this.cloneRoom.Humidity = humidity;
btnHumi.Text = this.cloneRoom.Humidity.ToString() + "%";
}
}, ShowErrorMode.NO);
});
//鍙戦�佽幏鍙栨箍搴︾殑鍛戒护
- ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity();
+ device.GetType().InvokeMember("ReadTemperatureOrHumidity", System.Reflection.BindingFlags.InvokeMethod, null, device, null);
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
index a32a3e9..dc07bcb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
@@ -118,7 +118,7 @@
}
//鍦烘櫙鎺т欢
var frameContr = new ScenePictrueControl();
- listView.AddChidrenFrame(frameContr);
+ listView.AddChidren(frameContr);
frameContr.InitControl(data);
}
});
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
index f50091f..2ac9c0a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
@@ -23,10 +23,6 @@
/// 浣忓畢鏁版嵁(鏃犵綉鏃朵娇鐢�)
/// </summary>
private List<House> listLocalHouse = null;
- /// <summary>
- /// 浣忓畢椤哄簭
- /// </summary>
- private List<string> listResidenceSort = new List<string>();
#endregion
@@ -66,13 +62,6 @@
{
//娓呯┖bodyFrame
this.ClearBodyFrame();
-
- //璇诲彇浣忓畢椤哄簭
- var strData = UserCenterLogic.LoadFileContent(UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ResidenceSortFile));
- if (strData != null)
- {
- listResidenceSort = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(strData);
- }
listView = new VerticalListControl(29);
listView.Height = bodyFrameLayout.Height + Application.GetRealHeight(6);
@@ -145,27 +134,12 @@
//鏆傛椂瀛樺偍鏁版嵁
var dicData = new Dictionary<string, Common.ResponseEntity.ResidenceObj>();
+ var listResidenceSort = new List<string>();
for (int i = 0; i < pageData.PageData.Count; i++)
{
dicData[pageData.PageData[i].Id] = pageData.PageData[i];
- if (listResidenceSort.Contains(pageData.PageData[i].Id) == false)
- {
- //鏂版坊鍔犵殑浣忓畢
- listResidenceSort.Add(pageData.PageData[i].Id);
- }
+ listResidenceSort.Add(pageData.PageData[i].Id);
}
- for (int i = 0; i < listResidenceSort.Count; i++)
- {
- //绉婚櫎鎺変笉瀛樺湪浜嗙殑椤哄簭
- if (dicData.ContainsKey(listResidenceSort[i]) == false)
- {
- listResidenceSort.RemoveAt(i);
- i--;
- }
- }
- //淇濆瓨椤哄簭
- string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ResidenceSortFile);
- UserCenterLogic.SaveFileContent(fullName, listResidenceSort);
HdlThreadLogic.Current.RunMain(() =>
{
@@ -215,14 +189,14 @@
btnHome = rowLayout.frameTable.AddLeftCaption(info.Name, 800, 60, true);
btnHome.TextSize = 15;
btnHome.Y = Application.GetRealHeight(12) + rowLayout.chidrenYaxis;
- rowLayout.frameTable.AddChidren(btnHome, ChidrenBindMode.BindEventOnly);
+ rowLayout.frameTable.AddChidren(btnHome, ChidrenBindMode.BindEvent);
//褰撳墠浣忓畢
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);
+ rowLayout.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEvent);
}
else
{
@@ -258,12 +232,7 @@
//妫�娴嬫湰鍦版湁娌℃湁杩欎釜浣忓畢
this.CheckIsExsitResidence(info);
- Config.Instance.HomeId = info.Id;
- //閲嶆柊鍒濆鍖栦綇瀹呭璞�
- Config.Instance.Home = House.GetHouseByHouseId(info.Id);
- Config.Instance.Save();
- //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
- await UserCenterLogic.InitUserCenterMenmoryAndThread(false);
+ await HdlResidenceLogic.Current.SwitchResidence(info.Id);
HdlThreadLogic.Current.RunMain(() =>
{
@@ -350,14 +319,14 @@
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);
+ rowLayout.frameTable.AddChidren(btnHome, ChidrenBindMode.BindEvent);
//褰撳墠浣忓畢
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);
+ rowLayout.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEvent);
}
else
{
@@ -387,14 +356,7 @@
{
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);
+ await HdlResidenceLogic.Current.SwitchResidence(i_home.Id);
HdlThreadLogic.Current.RunMain(() =>
{
@@ -472,7 +434,7 @@
return;
}
//鍒锋柊鍐呭瓨鐨勪綇瀹呭悕
- House.EditorHouseByHouseId(i_house.Id, textValue);
+ HdlResidenceLogic.Current.EditorHouseByHouseId(i_house.Id, textValue);
//鏇存敼鏄剧ず鐨勫悕瀛�
btnHome.Text = textValue;
}
@@ -510,7 +472,7 @@
if (flage == true)
{
//鍒锋柊鍐呭瓨鐨勪綇瀹呭悕
- House.EditorHouseByHouseId(info.Id, ResidenceName);
+ HdlResidenceLogic.Current.EditorHouseByHouseId(info.Id, ResidenceName);
//鏇存敼鏄剧ず鐨勫悕瀛�
btnHome.Text = ResidenceName;
info.Name = ResidenceName;
@@ -578,7 +540,7 @@
var newInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<NewResidenceInfo>>(resultData);
- House.AddHouse(newInfo[0].Id, ResidenceName, 0);
+ HdlResidenceLogic.Current.AddHouseToMemmory(newInfo[0].Id, ResidenceName);
//閲嶆柊鍒锋柊鍒楄〃
this.listView.RemoveAll();
this.SetResidenceInfo(2);
@@ -740,10 +702,6 @@
{
if (Config.Instance.HomeFilePathList.Contains($"House_{keys}.json") == false)
{
- //淇濆瓨椤哄簭
- listResidenceSort.Remove(keys);
- HdlRoomLogic.Current.SaveFloorSort(listResidenceSort);
-
this.listView.RemoveAll();
//鏁版嵁宸茬粡鍙樻洿 閲嶆柊璁剧疆浣忓畢淇℃伅
this.SetResidenceInfo(2);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index 91d1c5e..1fdf829 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -87,13 +87,13 @@
var btnHomeName = rowHome.frameTable.AddLeftCaption(Common.Config.Instance.Home.Name, 700, 60);
btnHomeName.TextSize = 15;
btnHomeName.Y = Application.GetRealHeight(35);
- rowHome.frameTable.AddChidren(btnHomeName, ChidrenBindMode.BindEventOnly);
+ rowHome.frameTable.AddChidren(btnHomeName, ChidrenBindMode.BindEvent);
//褰撳墠浣忓畢
var btnNowView = rowHome.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowResidence), 700, 49);
btnNowView.TextSize = 12;
btnNowView.Y = Application.GetRealHeight(95);
btnNowView.TextColor = UserCenterColor.Current.TextGrayColor1;
- rowHome.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEventOnly);
+ rowHome.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEvent);
//涓讳汉鎴栬�呯鐞嗗憳鎵嶄細鍑虹幇杩欎釜鑿滃崟
if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
{
@@ -102,6 +102,8 @@
}
//缁忕含搴�
var btnLocation = rowHome.frameTable.AddMostRightView(string.Empty, 500);
+ btnLocation.IsMoreLines = true;
+ btnLocation.TextSize = 10;
btnLocation.Text = Common.Config.Instance.Home.ResidenceAddressName;
//涓讳汉鎴栬�呯鐞嗗憳鎵嶄細鍑虹幇杩欎釜鑿滃崟
@@ -716,7 +718,7 @@
}
}
- var myHouse = Common.House.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]);
+ var myHouse = HdlResidenceLogic.Current.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]);
//鍒囨崲浣忓畢
Common.Config.Instance.HomeId = myHouse.Id;
Common.Global.CreateHomeDirectory(myHouse.Id);
@@ -726,7 +728,7 @@
await UserCenterLogic.InitUserCenterMenmoryAndThread(false);
//鍒犻櫎浣忓畢
- Common.House.DeleteHouseByHouseId(deleteId);
+ HdlResidenceLogic.Current.DeleteHouseMemmory(deleteId);
Application.RunOnMainThread(() =>
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordMenuForm.cs
index a0950d7..cbe0f24 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordMenuForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordMenuForm.cs
@@ -50,14 +50,14 @@
var btnUserPswText = rowUserPsw.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSafetyPassword), 700, 60);
btnUserPswText.TextSize = 15;
btnUserPswText.Y = Application.GetRealHeight(12) + rowUserPsw.chidrenYaxis;
- rowUserPsw.AddChidren(btnUserPswText, ChidrenBindMode.BindEventOnly);
+ rowUserPsw.AddChidren(btnUserPswText, ChidrenBindMode.BindEvent);
//鐢ㄤ簬鍦ㄥ甯冮槻銆佺瀹跺竷闃层�佹挙闃叉搷浣�
var btnTip1 = rowUserPsw.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uUserInGarrisonAndWithdrawGarrison), 700, 50, true);
//杩欎釜鍧愭爣鏈夌偣鐗规畩
btnTip1.Y = Application.GetRealHeight(72) + rowUserPsw.chidrenYaxis;
btnTip1.TextSize = 12;
btnTip1.TextColor = UserCenterColor.Current.TextGrayColor1;
- rowUserPsw.AddChidren(btnTip1, ChidrenBindMode.BindEventOnly);
+ rowUserPsw.AddChidren(btnTip1, ChidrenBindMode.BindEvent);
//鍚戝彸鐨勫浘鏍�
rowUserPsw.AddRightArrow();
//搴曠嚎
@@ -84,14 +84,14 @@
var btnCoercePswText = rowCoercePsw.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCoercePassword), 700, 60);
btnCoercePswText.TextSize = 15;
btnCoercePswText.Y = Application.GetRealHeight(12) + rowCoercePsw.chidrenYaxis;
- rowCoercePsw.AddChidren(btnCoercePswText, ChidrenBindMode.BindEventOnly);
+ rowCoercePsw.AddChidren(btnCoercePswText, ChidrenBindMode.BindEvent);
//杈撳叆璇ュ瘑鐮侊紝绔嬪嵆閫氱煡浠栦汉
var btnTip2 = rowCoercePsw.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uEnterPasswordToNotifyOthersImmediately), 700, 50, true);
//杩欎釜鍧愭爣鏈夌偣鐗规畩
btnTip2.Y = Application.GetRealHeight(72) + rowCoercePsw.chidrenYaxis;
btnTip2.TextSize = 12;
btnTip2.TextColor = UserCenterColor.Current.TextGrayColor1;
- rowCoercePsw.AddChidren(btnTip2, ChidrenBindMode.BindEventOnly);
+ rowCoercePsw.AddChidren(btnTip2, ChidrenBindMode.BindEvent);
//鍚戝彸鐨勫浘鏍�
rowCoercePsw.AddRightArrow();
rowCoercePsw.ButtonClickEvent += async (sender, e) =>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 1347a57..777464d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -92,14 +92,14 @@
btnLog.TextAlignment = TextAlignment.Center;
btnLog.TextID = R.MyInternationalizationString.uSecurityLog;
btnLog.TextColor = UserCenterColor.Current.TextGrayColor3;
- frameLog.AddChidren(btnLog, ChidrenBindMode.BindEventOnly);
+ frameLog.AddChidren(btnLog, ChidrenBindMode.BindEvent);
//搴曠嚎
var btnLogLine = new NormalViewControl(40, 10, true);
btnLogLine.Y = Application.GetRealHeight(86);
btnLogLine.X = btnLog.X + btnLog.Width / 2 - Application.GetRealWidth(40) / 2;
btnLogLine.Radius = (uint)Application.GetRealHeight(10) / 2;
btnLogLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
- frameLog.AddChidren(btnLogLine, ChidrenBindMode.BindEventOnly);
+ frameLog.AddChidren(btnLogLine, ChidrenBindMode.BindEvent);
btnLogLine.Visible = false;
//浼犳劅鍣ㄧ姸鎬�(鐐瑰嚮鑼冨洿鏈夌偣灏忥紝闇�瑕佹墿澶у畠鐨勭偣鍑昏寖鍥�)
@@ -118,14 +118,14 @@
btnSensor.TextAlignment = TextAlignment.Center;
btnSensor.TextColor = UserCenterColor.Current.TextColor2;
btnSensor.IsBold = true;
- frameSensor.AddChidren(btnSensor, ChidrenBindMode.BindEventOnly);
+ frameSensor.AddChidren(btnSensor, ChidrenBindMode.BindEvent);
//搴曠嚎
var btnSensorLine = new NormalViewControl(40, 10, true);
btnSensorLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
btnSensorLine.Y = btnLogLine.Y;
btnSensorLine.X = btnSensor.X + btnSensor.Width / 2 - Application.GetRealWidth(40) / 2;
btnSensorLine.Radius = (uint)Application.GetRealHeight(10) / 2;
- frameSensor.AddChidren(btnSensorLine, ChidrenBindMode.BindEventOnly);
+ frameSensor.AddChidren(btnSensorLine, ChidrenBindMode.BindEvent);
//瀹夐槻璁板綍Tab
frameLog.ButtonClickEvent += (sender, e) =>
@@ -458,7 +458,7 @@
//鑷畾涔変紶鎰熷櫒鐘舵�佹帶浠�
var frameDevice = new SafetySensorStatuControl();
- listView.AddChidrenFrame(frameDevice);
+ listView.AddChidren(frameDevice);
frameDevice.InitControl(device);
//娣诲姞闃村奖鐗规晥
frameDevice.SetViewShadow(true);
@@ -690,7 +690,7 @@
//鎵ц鍒濆鍖�
TodaySafeguardFrame = new SafeguardLogControl();
TodaySafeguardFrame.Y = Application.GetRealHeight(10);
- listView.AddChidrenFrame(TodaySafeguardFrame);
+ listView.AddChidren(TodaySafeguardFrame);
TodaySafeguardFrame.InitControl(nowDayKey, nowDayData);
//鍒濆鍖栧叾浠栨棩鏈熺殑瀹夐槻璁板綍鎺т欢
@@ -698,7 +698,7 @@
{
otherDaySafeguardFrame = new FrameLayout();
otherDaySafeguardFrame.Height = Application.GetRealHeight(10);
- listView.AddChidrenFrame(otherDaySafeguardFrame);
+ listView.AddChidren(otherDaySafeguardFrame);
foreach (var dayText in dicInfo.Keys)
{
//鎵ц鍒濆鍖�
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedContentForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedContentForm.cs
index a4bb7c6..4cb2bab 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedContentForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedContentForm.cs
@@ -206,7 +206,7 @@
}
//鍦烘櫙鍥剧墖
var frameContr = new ScenePictrueControl();
- listView.AddChidrenFrame(frameContr);
+ listView.AddChidren(frameContr);
frameContr.InitControl(data);
var btnSelect = new IconViewControl(58);
@@ -214,7 +214,7 @@
btnSelect.SelectedImagePath = "Item/ItemSelected.png";
btnSelect.X = Application.GetRealWidth(887);
btnSelect.Y = Application.GetRealHeight(35);
- frameContr.AddChidren(btnSelect, ChidrenBindMode.BindEventOnly);
+ frameContr.AddChidren(btnSelect, ChidrenBindMode.BindEvent);
if (dicSelectScene.ContainsKey(data.Id) == true)
{
btnSelect.IsSelected = true;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedContentForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedContentForm.cs
index 36270f7..bb545c2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedContentForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedContentForm.cs
@@ -187,7 +187,7 @@
{
//鍦烘櫙鎺т欢
var frameContr = new ScenePictrueControl();
- listView.AddChidrenFrame(frameContr);
+ listView.AddChidren(frameContr);
frameContr.InitControl(data);
var btnSelect = new IconViewControl(58);
@@ -195,7 +195,7 @@
btnSelect.SelectedImagePath = "Item/ItemSelected.png";
btnSelect.X = Application.GetRealWidth(887);
btnSelect.Y = Application.GetRealHeight(35);
- frameContr.AddChidren(btnSelect, ChidrenBindMode.BindEventOnly);
+ frameContr.AddChidren(btnSelect, ChidrenBindMode.BindEvent);
if (dicSelectScene.ContainsKey(data.Id) == true)
{
btnSelect.IsSelected = true;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs
index 6e954e4..b4cd0ff 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs
@@ -154,7 +154,7 @@
var frameBack = new FrameListControl(29);
frameBack.BackgroundColor = UserCenterColor.Current.White;
frameBack.Height = 10;
- this.listView.AddChidrenFrame(frameBack);
+ this.listView.AddChidren(frameBack);
//妤煎眰
if (string.IsNullOrEmpty(floorId) == false)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs
index 7a129f1..5baf04c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs
@@ -157,7 +157,7 @@
framBack.Name = dateIndex.ToString();
framBack.Height = Application.GetRealHeight(100);
framBack.BackgroundColor = UserCenterColor.Current.White;
- listView.AddChidrenFrame(framBack);
+ listView.AddChidren(framBack);
//鏃ユ湡
string strMonth = Language.StringByID(R.MyInternationalizationString.Month);
@@ -279,14 +279,14 @@
var btnMsg = rowControl.frameTable.AddMostRightView(recordInfo.listMsg[msgIndex], 600, 60);
btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
btnMsg.Y = Application.GetRealHeight(5) + rowControl.frameTable.chidrenYaxis;
- rowControl.frameTable.AddChidren(btnMsg, ChidrenBindMode.BindEventOnly);
+ rowControl.frameTable.AddChidren(btnMsg, ChidrenBindMode.BindEvent);
//鏃堕棿
var btnTime = rowControl.frameTable.AddMostRightView("", 200, 50);
btnTime.TextColor = UserCenterColor.Current.TextGrayColor1;
btnTime.Y = btnMsg.Bottom + Application.GetRealHeight(12);
var convertTime = UserCenterLogic.ConvertUtcTimeToLocalTime(recordInfo.CreatedOnUtc);
btnTime.Text = convertTime.ToString("HH锛歮m");
- rowControl.frameTable.AddChidren(btnTime, ChidrenBindMode.BindEventOnly);
+ rowControl.frameTable.AddChidren(btnTime, ChidrenBindMode.BindEvent);
//搴曠嚎
if (addLine == true)
{
@@ -312,7 +312,7 @@
btnNewTip.UnSelectedImagePath = "Item/NewVersion.png";
btnNewTip.Y = Application.GetRealHeight(9) + rowControl.frameTable.chidrenYaxis;
btnNewTip.X = btnMsgObject.Right + Application.GetRealWidth(10);
- rowControl.frameTable.AddChidren(btnNewTip, ChidrenBindMode.BindEventOnly);
+ rowControl.frameTable.AddChidren(btnNewTip, ChidrenBindMode.BindEvent);
}
//涓昏涓讳汉鍜岀鐞嗗憳鑳藉鍒犻櫎
@@ -964,7 +964,8 @@
/// </summary>
public override void CloseFormBefore()
{
- if (UserCenterResourse.DicActionForm.ContainsKey("UserMainForm") == false)
+ var userPageForm = UserView.UserPage.Instance.GetNowActionForm();
+ if (userPageForm != null && userPageForm.FormID == "UserMainForm")
{
Common.CommonPage.Instance.IsDrawerLockMode = false;
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
index a82b06d..5043272 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
@@ -428,8 +428,10 @@
UserCenterResourse.HideOption.CenterHideMenu = 1;
}
}
- if (textValue == "1")
+ if (textValue == "84651666")
{
+ //鏄剧ず璁惧鍘嗗彶鐗堟湰
+ UserCenterResourse.HideOption.DeviceHistory = 1;
}
if (textValue == "12349")
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
index 0f13170..f8976bc 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
@@ -50,10 +50,14 @@
/// </summary>
public void ShowForm()
{
+ this.FormID = "UserMainForm";
+
//鐗规畩澶勭悊锛氭仮澶嶅彲鍏抽棴杩涘害鏉★紝鍒棶涓轰粈涔堬紝鎴戜篃涓嶇煡閬撲负浠�涔堬紝浠ラ槻涓囦竴鑰屽凡
ProgressBar.SetCloseBarFlag(false);
- //鍒濆鍖栨鏋�
- this.InitForm();
+ //鍒濆鍖栧ご閮ㄦ帶浠�
+ this.InitTopFrameLayout();
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitBodyFrameLayout();
//绉婚櫎杩斿洖閿�
base.RemoveBackButton();
diff --git a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
index 4b02bba..960d44d 100755
--- a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
@@ -63,7 +63,7 @@
//鐧诲綍鎴愬姛,鎴栬�呮病鏈夌綉缁滈兘鍙互鐧诲綍
if (loginSuccess == 1 || loginSuccess == 2)
{
- var homes = await House.GetHomeLists();
+ var homes = await UserCenter.HdlResidenceLogic.Current.GetHomeListsFromDb();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
//鍚姩ZigBee
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
index f143967..908cda3 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
@@ -351,6 +351,21 @@
this.SetAllControlStatu();
}
+ /// <summary>
+ /// 鑾峰彇褰撳墠婵�娲荤殑鐣岄潰
+ /// </summary>
+ /// <returns></returns>
+ public EditorCommonForm GetNowActionForm()
+ {
+ int index = ((int)this.nowSelectMenu) - 1;
+ if (index != -1)
+ {
+ //璋冪敤姝ょ晫闈㈢殑婵�娲诲嚱鏁�
+ return this.listForm[index];
+ }
+ return null;
+ }
+
#endregion
#region 鈻� 缁撴瀯浣揰____________________________
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
index 367c79d..f2f87b9 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
@@ -13,7 +13,6 @@
public static class Application
{
public static bool isInited;
- static bool isEncry;
/// <summary>
/// 鏄惁姝e湪鎼滅储缃戝叧
/// </summary>
@@ -84,12 +83,12 @@
if (paths.Length < 3)
continue;
- var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.getGatewayBaseInfo != null) && (obj.getGatewayBaseInfo.gwID == paths[2]));
+ var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.GwId == paths[2]));
if (gateWay == null)
{
gateWay = new ZbGateway { IsVirtual = true };
- gateWay.getGatewayBaseInfo.gwID = paths[2];
- gateWay.getGatewayBaseInfo.HomeId = Shared.Common.Config.Instance.HomeId;
+ gateWay.GwId = paths[2];
+ gateWay.HomeId = Shared.Common.Config.Instance.HomeId;
ZbGateway.GateWayList.Add(gateWay);
}
}
@@ -144,7 +143,7 @@
//鐐瑰鐐瑰彂閫�(鍏堝彂涓�鏉″凡鏈夌殑鐐规挱锛屽洖澶嶅嚑鐜囬珮涓�鐐癸級
for (int i = 0; i < gateWayList.Count; i++)
{
- FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(System.Net.IPAddress.Parse(gateWayList[i].getGatewayBaseInfo.IpAddress), 7624), broadBytes);
+ FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(System.Net.IPAddress.Parse(gateWayList[i].GwIP), 7624), broadBytes);
}
//骞挎挱鍙戦��
if (broadcastIpAddress.ToString() != "0.0.0.0")
@@ -193,19 +192,16 @@
var pubKey = Encoding.UTF8.GetString(bytes, 49 + gwNameLength + 1 + gwIdLength + 2 + 1, pubKeyLength);
var zbGateWay = new ZbGateway
{
- getGatewayBaseInfo = new ZbGateway.GatewayBaseInfo
- {
- IpAddress = ipAddress,
- GwName = gwName,
- HomeId = homeID,
- IsMainGateWay = isMainGateWay,
- gwID = id,
- },
+ GwIP = ipAddress,
+ GwName = gwName,
+ HomeId = homeID,
+ IsMainGateWay = isMainGateWay,
+ GwId = id,
GatewayOnlineFlage = true,
PubKey = pubKey
};
//閫氳鍒扮綉鍏冲垪琛�
- if (gateWayList.Find(obj => obj.getGatewayBaseInfo.gwID == zbGateWay.getGatewayBaseInfo.gwID) == null)
+ if (gateWayList.Find(obj => obj.GwId == zbGateWay.GwId) == null)
{
//缃戝叧鍖归厤褰撳墠浣忓畢涓埌缃戝叧
if (Shared.Common.Config.Instance.HomeId == homeID)
@@ -224,7 +220,7 @@
//}
}
//缃戝叧鍒楄〃瀛樺偍澶勭悊
- var gateWay = ZbGateway.GateWayList.Find(obj => obj.getGatewayBaseInfo != null && obj.getGatewayBaseInfo.gwID == zbGateWay.getGatewayBaseInfo.gwID);
+ var gateWay = ZbGateway.GateWayList.Find(obj => obj.GwId == zbGateWay.GwId);
if (gateWay == null)
{
ZbGateway.GateWayList.Add(zbGateWay);
@@ -236,7 +232,7 @@
gateWay.IsVirtual = false;
//灏嗚缃戝叧鏍囪瘑涓恒�愬彲鎼滅储鍒帮紝鍗筹細鍦ㄧ嚎銆�
gateWay.GatewayOnlineFlage = true;
- if (gateWay.getGatewayBaseInfo.IpAddress != ipAddress)
+ if (gateWay.GwIP != ipAddress)
{
await gateWay.DisConnectLocalMqttClient("2");
ZbGateway.GateWayList.Remove(gateWay);
@@ -247,25 +243,25 @@
else
{
gateWay.PubKey = pubKey;
- gateWay.getGatewayBaseInfo.GwName = gwName;
- gateWay.getGatewayBaseInfo.HomeId = homeID;
+ gateWay.GwName = gwName;
+ gateWay.HomeId = homeID;
await gateWay.StartLocalMqtt(ipAddress);
}
//涓荤綉鍏宠缃�
- if (isMainGateWay && oldHomeID == gateWay.getGatewayBaseInfo.HomeId)
+ if (isMainGateWay && oldHomeID == gateWay.HomeId)
{
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
var gw = ZbGateway.GateWayList[i];
//缃戝叧ID涓嶆槸褰撳墠鐨勭綉鍏筹紝鍒欐妸缃戝叧鍒楄〃涓叾浠栫綉鍏虫爣璁颁负涓嶆槸涓荤綉鍏�
- if (gw.getGatewayBaseInfo.gwID != id && oldHomeID == gw.getGatewayBaseInfo.HomeId)
+ if (gw.GwId != id && oldHomeID == gw.HomeId)
{
- gw.getGatewayBaseInfo.IsMainGateWay = false;
+ gw.IsMainGateWay = false;
}
}
//鏍囪褰撳墠缃戝叧鏄富缃戝叧
- gateWay.getGatewayBaseInfo.IsMainGateWay = true;
+ gateWay.IsMainGateWay = true;
}
}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs
index ed03e42..0e9c605 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs
@@ -159,7 +159,7 @@
{
return m_Home;
}
- m_Home = House.GetHouseByHouseId(HomeId);
+ m_Home = Phone.UserCenter.HdlResidenceLogic.Current.GetHouseByHouseId(HomeId);
if (m_Home == null)
{
m_Home = new House();
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs
new file mode 100755
index 0000000..950b2fa
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs
@@ -0,0 +1,88 @@
+锘縰sing Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ZigBee.Device
+{
+ /// <summary>
+ /// 鑹叉俯鐏�
+ /// </summary>
+ public class ColorTemperatureLight : LightBase
+ {
+ public ColorTemperatureLight()
+ {
+ this.Type = DeviceType.ColorTemperatureLight;
+ }
+
+ /// <summary>
+ ///浜害锛屾暣褰紝鍙栧�艰寖鍥达細0-254琛ㄧず0%-100%
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public int Level = 0;
+
+ /// <summary>
+ ///鑹叉俯锛屽彇鍊艰寖鍥达細3400~6000
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public int ColorTemperature = 0;
+
+ /// <summary>
+ /// 璇诲彇浜害
+ /// </summary>
+ public void ReadLevel()
+ {
+ ReadAttri(Device.Cluster_ID.LevelControl, AttriButeId.LevelControl);
+ }
+
+ /// <summary>
+ /// 璇诲彇鑹叉俯
+ /// </summary>
+ public void ReadColorTemperature()
+ {
+ ReadAttri(Device.Cluster_ID.ColorControl, AttriButeId.LevelControl);
+ }
+
+ ///<summary >
+ ///璁剧疆璁惧浜害锛圠evel锛�
+ ///<para>value:浜害鍊煎彇鍊艰寖鍥达細0-254</para>
+ /// </summary>
+ public void SetLevel(int value)
+ {
+ var jObject = new JObject {
+ { "DeviceAddr", DeviceAddr},
+ { "Epoint", DeviceEpoint},
+ { "Cluster_ID", 8 },
+ { "Command", 4},
+ { "SendMode", 2 }
+ };
+ var data = new JObject {
+ { "Level", value },
+ { "TransitionTime", 0 }
+ };
+ jObject.Add("Data", data);
+ Gateway?.Send("DeviceControl", jObject.ToString());
+ }
+
+ ///<summary >
+ ///璁剧疆璁惧鑹叉俯
+ ///<para>value:鑹叉俯鍊煎彇鍊艰寖鍥达細3400-6000</para>
+ /// </summary>
+ public void SetColorTemperature(int value)
+ {
+ var jObject = new JObject {
+ { "DeviceAddr", DeviceAddr},
+ { "Epoint", DeviceEpoint},
+ { "Cluster_ID", 768 },
+ { "Command", 10},
+ { "SendMode", 2 }
+ };
+ var data = new JObject {
+ { "ColorTemperature", value },
+ { "TransitionTime", 0 }
+ };
+ jObject.Add("Data", data);
+ Gateway?.Send("DeviceControl", jObject.ToString());
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
index 43ae483..2e80273 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -199,12 +199,12 @@
{
return null;
}
- var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.getGatewayBaseInfo != null) && (obj.getGatewayBaseInfo.gwID == CurrentGateWayId));
+ var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.GwId == CurrentGateWayId));
if (gateWay == null)
{
gateWay = new ZbGateway { IsVirtual = true, };
- gateWay.getGatewayBaseInfo.gwID = CurrentGateWayId;
- gateWay.getGatewayBaseInfo.HomeId = Shared.Common.Config.Instance.HomeId;
+ gateWay.GwId = CurrentGateWayId;
+ gateWay.HomeId = Shared.Common.Config.Instance.HomeId;
ZbGateway.GateWayList.Add(gateWay);
}
@@ -300,6 +300,10 @@
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte);
}
+ else if (strDeviceType == ZigBee.Device.DeviceType.ColorTemperatureLight.ToString())
+ {
+ return Newtonsoft.Json.JsonConvert.DeserializeObject<ColorTemperatureLight>(strDeviceByte);
+ }
else { return null; }
//鑳藉皯瀛樹竴涓彉閲忓氨灏戝瓨涓�涓�
device.Type = (DeviceType)device.DeviceID;
@@ -369,11 +373,11 @@
{
//璋冨厜鍣�
IconPath = "Device/Light.png";
- if (Shared.Common.LocalDevice.Current.IsMiniLight(this) == true)
- {
- //mini澶滅伅
- IconPath = "Device/MiniNightLight.png";
- }
+ }
+ else if (this.Type == DeviceType.ColorTemperatureLight)
+ {
+ //鑹叉俯鐏�
+ IconPath = "Device/ColorLightTemperature.png";
}
else if (this.Type == DeviceType.OnOffOutput)
{
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs
index 90768b9..3cecda8 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DeviceType.cs
@@ -28,7 +28,12 @@
/// <para>璋冨厜鐏細鏀寔浜害</para>
/// <para>璋冨厜璁惧</para>
/// </summary>
- DimmableLight = 257,
+ DimmableLight = 257,
+ /// <summary>
+ /// 璁惧ID涓�258鐨勮澶�
+ /// <para>鑹叉俯鐏�</para>
+ /// </summary>
+ ColorTemperatureLight = 258,
/// <summary>
/// 绐楀笜璁惧ID
/// <para>Rollershade:鍗峰笜</para>
@@ -80,7 +85,7 @@
/// <summary>
/// <para>鏂伴婀垮害浼犳劅鍣�</para>
/// <para>璁惧ID涓�53760</para>
- /// <para>瀹氫箟瀵硅薄锛歍emperatureSensor</para>
+ /// <para>瀹氫箟瀵硅薄锛欻umiditySensor</para>
/// </summary>
FreshAirHumiditySensor = 0xD200,
/// 杞崲鍣�
@@ -108,9 +113,13 @@
public enum DeviceFunctionType
{
/// <summary>
- /// 娌℃湁鎸囧畾涓轰粈涔堢被鍨�
+ /// 杩樻病鏈夋寚瀹氫负浠�涔堢被鍨�
/// </summary>
- A鏈畾涔� = 0,
+ A鏈畾涔� = -1,
+ /// <summary>
+ /// 鎵嬪姩鎸囧畾瀹冧负涓嶆寚鍚戜换浣曠被鍨�
+ /// </summary>
+ A涓嶆寚瀹� = 0,
/// <summary>
/// 寮�鍏�
/// </summary>
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
index d893657..f10262e 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
@@ -662,7 +662,11 @@
return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<Shared.Phone.UserCenter.MemberInfoRes>>>)(async () =>
{
var pra = new Shared.Phone.UserCenter.MemberListInfoPra();
- string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
+ string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
+ if (result == null)
+ {
+ return null;
+ }
var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result);
return listInfo;
}));
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs
index 3646638..9176537 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/HumiditySensor.cs
@@ -6,9 +6,25 @@
[System.Serializable]
public class HumiditySensor : CommonDevice
{
+ /// <summary>
+ /// 鏂伴鐨勬箍搴︿紶鎰熷櫒
+ /// </summary>
public HumiditySensor()
{
this.Type = DeviceType.FreshAirHumiditySensor;
}
+
+ /// <summary>
+ /// 婀垮害
+ /// </summary>
+ public decimal Humidity;
+
+ /// <summary>
+ /// 璇诲彇娓�/婀垮害
+ /// </summary>
+ public void ReadTemperatureOrHumidity()
+ {
+ ReadAttri(Device.Cluster_ID.RelativeHumidityMeasurement, AttriButeId.MeasuredValue);
+ }
}
}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs
index d9fc339..b408bbd 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs
@@ -773,7 +773,6 @@
string dataSerialNum = "01";
string addDataLength = "03";
string kStatus = "";
- string kNum = "";
int attributeData = 0;
try
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs
index c716216..8b2603c 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs
@@ -27,7 +27,7 @@
/// 璇诲彇褰撳墠绐楀笜鐨勬ā寮�
/// <para>AttriButeId=0 (鍏堣皟鐢ㄥ彂鐜板睘鎬ф帴鍙o紝鏌ョ湅璁惧鏄惁鏀寔璇ユ帴鍙g殑灞炴�э級</para>
/// </summary>
- public void ReadWcdType()
+ public new void ReadWcdType()
{
ReadAttri(Device.Cluster_ID.WindowCovering, AttriButeId.WindowCoveringType);
}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs
index 4c28218..04f6b80 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs
@@ -527,7 +527,7 @@
if (topic == gatewayID + "/" + "Security/Error_Respon")
{
- var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID };
+ var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.GwId };
var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
d = new SetDelayTimeResponseAllData { };
if (temp == null)
@@ -853,7 +853,7 @@
if (topic == gatewayID + "/" + "Security/Error_Respon")
{
- var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID };
+ var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.GwId };
var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
d = new SetUserPasswordResponseAllData { };
if (temp == null)
@@ -980,7 +980,7 @@
if (topic == gatewayID + "/" + "Security/Error_Respon")
{
- var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID };
+ var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.GwId };
var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
d = new SetUserPasswordResponseAllData { };
if (temp == null)
@@ -1285,7 +1285,7 @@
// if (topic == gatewayID + "/" + "Error_Respon")
// {
- // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
+ // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.GwId };
// var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
// if (temp == null)
@@ -1527,7 +1527,7 @@
if (topic == gatewayID + "/" + "Security/Error_Respon")
{
- var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID };
+ var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.GwId };
var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
d = new AddDeviceToZoneResponseAllData { };
if (temp == null)
@@ -1802,7 +1802,7 @@
if (topic == gatewayID + "/" + "Security/Error_Respon")
{
- var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID };
+ var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.GwId };
var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
d = new AddNewModeResponseAllData { };
@@ -2191,7 +2191,10 @@
/// <para>涓嶅寘鎷�24灏忔椂闃插尯銆佸拰24灏忔椂闈欓煶闃插尯銆�24灏忔椂闃插尯鍜�24灏忔椂闈欓煶闃插尯鏄劚绂诲竷闃叉ā寮忎笉鍙楀竷鎾ら槻褰卞搷鐨勮繍琛岋紝涓嶅姞鍏ヤ换浣曚竴绉嶆ā寮忋��</para>
/// </summary>
public List<ZoneListObj> ZoneList = new List<ZoneListObj>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
@@ -2425,7 +2428,10 @@
/// <para>涓嶅寘鎷�24灏忔椂闃插尯銆佸拰24灏忔椂闈欓煶闃插尯銆�24灏忔椂闃插尯鍜�24灏忔椂闈欓煶闃插尯鏄劚绂诲竷闃叉ā寮忎笉鍙楀竷鎾ら槻褰卞搷鐨勮繍琛岋紝涓嶅姞鍏ヤ换浣曚竴绉嶆ā寮忋��</para>
/// </summary>
public List<ZoneListObj> ZoneList = new List<ZoneListObj>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
#endregion
@@ -2710,7 +2716,10 @@
///<para>濡傛灉涓嶉渶瑕佷慨鏀规垨鏂板鏃跺�欏彲蹇界暐璇ュ瓧娈点��</para>
/// </summary>
public List<ActionsData> Actions = new List<ActionsData>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
/// <summary>
/// 甯冮槻鎴愬姛鎸囩ず鍔ㄤ綔鏁版嵁
@@ -3056,7 +3065,10 @@
/// 鍔ㄤ綔鍒楄〃
/// </summary>
public List<RemoveActionsData> Actions = new List<RemoveActionsData>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
/// <summary>
/// 鍔ㄤ綔鍒楄〃鐨勬暟鎹�
@@ -4146,7 +4158,11 @@
/// 妯″紡鍚� (褰揜esult=0鏃跺瓨鍦�)銆�
/// </summary>
public string ModeName;
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;鈥�
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
+
}
#endregion
@@ -4360,7 +4376,10 @@
/// 瀹夐槻璁惧鍒楄〃
/// </summary>
public List<RemoveDeviceListObj> RemoveDeviceList = new List<RemoveDeviceListObj>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
/// <summary>
@@ -4402,7 +4421,7 @@
// if (topic == gatewayID + "/" + "Error_Respon")
// {
- // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
+ // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.GwId };
// var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
// if (temp == null)
@@ -4781,7 +4800,7 @@
if (topic == gatewayID + "/" + "Security/Error_Respon")
{
- var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID };
+ var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.GwId };
var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
d = new ActionTestResponseAllData { };
if (temp == null)
@@ -5289,7 +5308,10 @@
///<para>1锛氭梺璺澶�</para>
/// </summary>
public int IsByPass = 999;
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
#endregion
@@ -5551,7 +5573,10 @@
/// 鎶ヨ鐩爣鍒楄〃
/// </summary>
public List<AlarmActionObj> Actions = new List<AlarmActionObj>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
@@ -5827,7 +5852,10 @@
/// 鎶ヨ鐩爣鍒楄〃
/// </summary>
public List<DelAlarmActionObj> Actions = new List<DelAlarmActionObj>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
/// <summary>
@@ -6334,7 +6362,10 @@
/// </summary>
public List<PushTargetActionObj> Actions = new List<PushTargetActionObj>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
@@ -6550,7 +6581,10 @@
/// </summary>
public List<PushTargetActionObj> Actions = new List<PushTargetActionObj>();
- /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;
+ /// <summary>
+ /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��
+ /// </summary>
+ public string LoginToken;
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs
index baa735d..2e985f5 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs
@@ -435,7 +435,7 @@
//if (topic == gatewayID + "/" + "Error_Respon")
//{
- // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
+ // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.GwId };
// var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString());
// if (temp == null)
@@ -1009,7 +1009,7 @@
}
};
mainGateway.Actions += action;
- System.Console.WriteLine("Scene/RemoveMember_Actions 鍚姩" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/RemoveMember_Actions 鍚姩" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
try{
if (sceneRemoveMemberData != null)
@@ -1076,7 +1076,7 @@
d = new RemoveSceneMemberResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
}
mainGateway.Actions -= action;
- System.Console.WriteLine("Scene/RemoveMember_Actions 閫�鍑�" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/RemoveMember_Actions 閫�鍑�" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
return d;
});
@@ -1275,7 +1275,7 @@
}
};
mainGateway.Actions += action;
- System.Console.WriteLine("Scene/Rename_Actions 鍚姩" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/Rename_Actions 鍚姩" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
try{
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 804 } };
var data = new JObject { { "ScenesId", scenesId }, { "ScenesName", scenesName } };
@@ -1298,7 +1298,7 @@
d = new SceneRenameResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
}
mainGateway.Actions -= action;
- System.Console.WriteLine("Scene/Rename_Actions 閫�鍑�" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/Rename_Actions 閫�鍑�" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
return d;
});
@@ -1404,7 +1404,7 @@
}
};
mainGateway.Actions += action;
- System.Console.WriteLine("Scene/Remove_Actions 鍚姩" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/Remove_Actions 鍚姩" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
try{
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 803 } };
var data = new JObject { { "ScenesId", scenesId } };
@@ -1427,7 +1427,7 @@
d = new RemoveSceneAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
}
mainGateway.Actions -= action;
- System.Console.WriteLine("Scene/Remove_Actions 閫�鍑�" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/Remove_Actions 閫�鍑�" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
return d;
});
@@ -1524,7 +1524,7 @@
}
};
mainGateway.Actions += action;
- System.Console.WriteLine("Scene/Open_Actions 鍚姩" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/Open_Actions 鍚姩" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
try{
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 821 } };
var data = new JObject { { "ScenesId", ScenesId }, { "DelayTime", delayTime } };
@@ -1547,7 +1547,7 @@
d = new SceneOpenAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
}
mainGateway.Actions -= action;
- System.Console.WriteLine("Scene/Open_Actions閫�鍑�" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/Open_Actions閫�鍑�" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
return d;
});
@@ -1649,7 +1649,7 @@
}
};
mainGateway.Actions += action;
- System.Console.WriteLine("Scene/CatDelayScene_Actions 鍚姩" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/CatDelayScene_Actions 鍚姩" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
try
{
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 811 } };
@@ -1669,7 +1669,7 @@
d = new CatDelaySceneResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
}
mainGateway.Actions -= action;
- System.Console.WriteLine("Scene/CatDelayScene_Actions 閫�鍑�" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
+ System.Console.WriteLine("Scene/CatDelayScene_Actions 閫�鍑�" + "_" + mainGateway.GwId + System.DateTime.Now.ToString());
return d;
});
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
index f8b36df..e7b139f 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -31,19 +31,7 @@
{
get
{
- return GateWayList.Find((obj) => { return obj.getGatewayBaseInfo.HomeId == Shared.Common.Config.Instance.HomeId && obj.getGatewayBaseInfo.IsMainGateWay; });
- }
- }
-
- /// <summary>
- /// 涓荤綉鍏�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public bool IsMainGateWay
- {
- get
- {
- return getGatewayBaseInfo != null && getGatewayBaseInfo.IsMainGateWay;
+ return GateWayList.Find((obj) => { return obj.HomeId == Shared.Common.Config.Instance.HomeId && obj.IsMainGateWay; });
}
}
@@ -68,7 +56,7 @@
{
get
{
- var fileName = "Gateway_" + DeviceType.ZbGateway.ToString() + "_" + this.getGatewayBaseInfo?.gwID;
+ var fileName = "Gateway_" + DeviceType.ZbGateway.ToString() + "_" + this.GwId;
return fileName;
}
}
@@ -551,7 +539,6 @@
{
await System.Threading.Tasks.Task.Run(async () =>
{
- CommonDevice commonDev = null;
Action<string, string> action1 = (topic, message) => { };
Actions += action1;
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 94 } };
@@ -2652,12 +2639,12 @@
await initGateWayBaseInfomation();
//娌℃湁涓荤綉鍏虫椂涓诲姩璇诲彇锛岃幏鍙栦富缃戝叧淇℃伅
- var gateWayList = GateWayList.FindAll(obj => obj.getGatewayBaseInfo.HomeId == Shared.Common.Config.Instance.HomeId);
- if (gateWayList.Find(obj => obj.getGatewayBaseInfo.IsMainGateWay == true) == null)
+ var gateWayList = GateWayList.FindAll(obj => obj.HomeId == Shared.Common.Config.Instance.HomeId);
+ if (gateWayList.Find(obj => obj.IsMainGateWay == true) == null)
{
if (gateWayList.Count == 1)
{
- gateWayList[0].getGatewayBaseInfo.IsMainGateWay = true;
+ gateWayList[0].IsMainGateWay = true;
}
else
{
@@ -2673,13 +2660,13 @@
{
for (int j = 0; j < gateWayList.Count; j++)
{
- if (gateWayList[i].getGatewayBaseInfo.gwID == info.getGwData.GwId)
+ if (gateWayList[i].GwId == info.getGwData.GwId)
{
- gateWayList[i].getGatewayBaseInfo.IsMainGateWay = true;
+ gateWayList[i].IsMainGateWay = true;
}
else
{
- gateWayList[i].getGatewayBaseInfo.IsMainGateWay = false;
+ gateWayList[i].IsMainGateWay = false;
}
}
break;
@@ -2858,11 +2845,11 @@
{
try
{
- if (this.getGatewayBaseInfo?.gwID == null || !GateWayBaseInfomations.ContainsKey(this.getGatewayBaseInfo?.gwID))
+ if (this.GwId == string.Empty || !GateWayBaseInfomations.ContainsKey(this.GwId))
{
return;
}
- var gateWayBaseInfomation = GateWayBaseInfomations[this.getGatewayBaseInfo?.gwID];
+ var gateWayBaseInfomation = GateWayBaseInfomations[this.GwId];
message = SecuritySet.AesEncryptBytes(message, gateWayBaseInfomation.AesKey);
var topicEncStr = $"/ClientToZigbeeGateWay/{gateWayBaseInfomation.MacMark}/Common/{topicName}";
//(6)鏋勫缓Mqtt闇�瑕佸彂甯冪殑鏁版嵁鍖�,鍙戝竷缁欎簯绔殑MqttBroker
@@ -3155,7 +3142,7 @@
//鍏ㄥ眬鎺ユ敹缃戝叧鎺ㄩ�佺殑鐨勯�昏緫(涓轰簡鎵ц閫熷害,灏藉彲鑳界殑鍒姞鑰楁椂鐨勬搷浣�)
Shared.Phone.UserCenter.HdlGatewayReceiveLogic.Current.GatewayOverallMsgReceive(gatewayID, topic, reportStatus, message);
- var gwa = GateWayList.Find(obj => obj.getGatewayBaseInfo.gwID == gatewayID);
+ var gwa = GateWayList.Find(obj => obj.GwId == gatewayID);
if (gwa == null)
{
return;
@@ -3193,16 +3180,16 @@
var gwData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.GetGwData>(jobject["Data"].ToString());
if (gwData != null)
{
- var gwList = GateWayList.FindAll(obj => obj.getGatewayBaseInfo.HomeId == Shared.Common.Config.Instance.HomeId);
+ var gwList = GateWayList.FindAll(obj => obj.HomeId == Shared.Common.Config.Instance.HomeId);
for (int i = 0; i < gwList.Count; i++)
{
- if (gwList[i].getGatewayBaseInfo.gwID == gatewayID)
+ if (gwList[i].GwId == gatewayID)
{
- gwList[i].getGatewayBaseInfo.IsMainGateWay = true;
+ gwList[i].IsMainGateWay = true;
}
else
{
- gwList[i].getGatewayBaseInfo.IsMainGateWay = false;
+ gwList[i].IsMainGateWay = false;
}
}
}
@@ -3237,7 +3224,7 @@
switch ((DeviceType)(deviceID))
{
case DeviceType.DoorLock:
- var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID };
+ var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = gwa.GwId };
var OperatingEventNotificationDatad = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockOperatingEventNotificationCommand>(jobject["Data"].ToString());
if (OperatingEventNotificationDatad != null)
{
@@ -3260,7 +3247,7 @@
switch ((DeviceType)(deviceID))
{
case DeviceType.DoorLock:
- var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID };
+ var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = gwa.GwId };
var ProgrammingEventNotificationData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockProgrammingEventNotificationCommand>(jobject["Data"].ToString());
if (ProgrammingEventNotificationData != null)
{
@@ -3362,7 +3349,7 @@
#region 闃插尯琚Е鍙戞椂鎶ュ憡
else if (topic == gatewayID + "/" + "Security/ZoneTriggerReport")
{
- var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.GwId };
ias.zoneTriggerReportData = Newtonsoft.Json.JsonConvert.DeserializeObject<Safeguard.ZoneTriggerReportData>(jobject["Data"].ToString());
if (ias.zoneTriggerReportData == null)
@@ -3380,7 +3367,7 @@
#region 閫昏緫琚皟鐢ㄥ弽棣�
else if (topic == gatewayID + "/" + "Logic/Execute_Respon")
{
- //var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ //var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.GwId };
//logic.logicExecuteRespo = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.ExecuteResponse>(jobject["Data"].ToString());
//if (logic.logicExecuteRespo == null)
@@ -3398,7 +3385,7 @@
#region 鏃堕棿鐐规潯浠舵帹杩熸墽琛�
else if (topic == gatewayID + "/" + "Logic/TimingWillArrive")
{
- //var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ //var logic = new Logic() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.GwId };
//logic.timingWillArriveData = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic.TimingWillArriveData>(jobject["Data"].ToString());
//if (logic.timingWillArriveData == null)
@@ -3416,7 +3403,7 @@
#region 妯″紡瀹夐槻鍔ㄤ綔琚渶缁堟縺娲绘椂鍙戦�佹姤璀︿俊鎭�
else if (topic == gatewayID + "/" + "Security/ModeTriggerReport")
{
- var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.GwId };
ias.modeTriggerReportData = Newtonsoft.Json.JsonConvert.DeserializeObject<Safeguard.ModeTriggerReportData>(jobject["Data"].ToString());
if (ias.modeTriggerReportData == null)
{
@@ -3433,7 +3420,7 @@
#region 閫氳繃澶栭儴鏂瑰紡甯冮槻鎾ら槻鎴愬姛鏃舵姤鍛婃伅
else if (topic == gatewayID + "/" + "Security/EnOrWithdrawSucceedReport")
{
- var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.GwId };
ias.enOrWithdrawSucceedReportData = Newtonsoft.Json.JsonConvert.DeserializeObject<Safeguard.EnOrWithdrawSucceedReportData>(jobject["Data"].ToString());
if (ias.enOrWithdrawSucceedReportData == null)
{
@@ -3450,7 +3437,7 @@
#region 鑳佽揩瀵嗙爜鎾ら槻鏃剁煭淇℃帹閫�
else if (topic == gatewayID + "/" + "Security/PushTargetInfo")
{
- var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.getGatewayBaseInfo.gwID };
+ var ias = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = gwa.GwId };
ias.coercedPWDWithdrawReportData = Newtonsoft.Json.JsonConvert.DeserializeObject<Safeguard.CoercedPWDWithdrawReportData>(jobject["Data"].ToString());
if (ias.coercedPWDWithdrawReportData == null)
{
@@ -3513,7 +3500,7 @@
#if DEBUG
if (flage == true)
{
- if (msg.Contains("DeviceStatusReport") == false)
+ //if (msg.Contains("DeviceStatusReport") == false)
{
System.Console.WriteLine(msg + " " + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond);
}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs
index c4b44cc..f7b8d43 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs
@@ -12,9 +12,68 @@
/// </summary>
public bool GatewayOnlineFlage = false;
/// <summary>
+ /// 浣忓畢ID
+ /// </summary>
+ public string HomeId = string.Empty;
+ /// <summary>
/// 缃戝叧鎵�鍦ㄧ殑鎴块棿ID
/// </summary>
public string RoomId = string.Empty;
+ ///<summary>
+ ///缃戝叧搴忓垪鍙凤紝璇ョ綉鍏冲敮涓�鏍囪瘑
+ /// </summary>
+ public string GwId = string.Empty;
+ /// <summary>
+ ///缃戝叧鍚嶇О
+ /// </summary>
+ public string GwName = string.Empty;
+ /// <summary>
+ /// 缃戝叧鐨勫簭鍒楀彿
+ /// </summary>
+ public string GwSerialNum = string.Empty;
+ /// <summary>
+ ///鏄惁涓轰富缃戝叧銆�(鍥犱负鍦ㄥ缃戠殑鎯呭喌涓嬶紝杩欎釜瀛楁鍙互鑾峰彇鍒帮紝鐢ㄦ潵鏇存柊灞�鍩熺綉涓熀鏈俊鎭殑瀵硅薄涓殑涓荤綉鍏充俊鎭級
+ ///<para>0锛氬惁</para>
+ ///<para>1锛氭槸</para>
+ /// </summary>
+ public bool IsMainGateWay;
+ /// <summary>
+ ///缃戝叧鎵�鍦ㄥ眬鍩熺綉鐨刬p鍦板潃
+ /// </summary>
+ public string GwIP = string.Empty;
+ /// <summary>
+ /// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈�(缃戝叧鍥轰欢鏃ユ湡锛燂紵)
+ /// </summary>
+ public long GwVersionDate = 0;
+ /// <summary>
+ ///Linux缃戝叧绫诲瀷
+ /// </summary>
+ public int LinuxImageType = -1;
+ /// <summary>
+ ///Linux缃戝叧纭欢鐗堟湰
+ /// </summary>
+ public int LinuxHardVersion = -1;
+ /// <summary>
+ /// Linux缃戝叧鍥轰欢鐗堟湰
+ /// </summary>
+ public int LinuxFirmwareVersion = -1;
+ /// <summary>
+ /// 鍗忚皟鍣ㄧ‖浠剁増鏈�
+ /// </summary>
+ public int CoordinatorHardVersion = -1;
+ /// <summary>
+ /// 鍗忚皟鍣ㄥ浐浠剁増鏈�
+ /// </summary>
+ public int CoordinatorFirmwareVersion = -1;
+ /// <summary>
+ /// 鍗忚皟鍣ㄩ暅鍍廔D(涔熷彨缃戝叧闀滃儚绫诲瀷)
+ /// </summary>
+ public int CoordinatorImageId = -1;
+ /// <summary>
+ /// 铏氭嫙椹卞姩淇℃伅
+ /// </summary>
+ public List<DriveCodeListObj> DriveCodeList = new List<DriveCodeListObj>();
+
/// <summary>
/// 铏氭嫙缃戝叧
/// </summary>
@@ -73,10 +132,6 @@
}
/// <summary>
- /// 缃戝叧淇℃伅.
- /// </summary>
- public GetGwData getGwInfo;
- /// <summary>
/// 缃戝叧淇℃伅(灞忚斀鎺変簡涓�浜涚洰鍓嶄笉浣跨敤鐨勫彉閲�)
/// </summary>
[System.Serializable]
@@ -89,7 +144,6 @@
/// <summary>
///缃戝叧缁戝畾缃戝崱鐨刴ac鍦板潃
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public string GwMac;
/// <summary>
///缃戝叧鍚嶇О
@@ -108,7 +162,6 @@
///<summary>
///utc鏃堕棿鎴筹紝绋嬪簭鍚姩鏃剁綉鍏崇殑绯荤粺鏃堕棿
///</summary>
- [Newtonsoft.Json.JsonIgnore]
public long StartTime;
/// <summary>
///鍔犲叆灞�鍩熺綉妯″紡
@@ -116,7 +169,6 @@
///<para>1锛氭湁绾胯繛鎺ュ眬鍩熺綉</para>
///<para>2锛氭湭鍔犲叆灞�鍩熺綉</para>
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public int JoinMode;
/// <summary>
///缃戝叧鎵�鍦ㄥ眬鍩熺綉鐨刬p鍦板潃
@@ -125,23 +177,19 @@
/// <summary>
/// 涓讳汉鐨凣uid(鍗充娇鏄鐞嗗憳,杩欓噷涔熸槸涓讳汉鐨凣uid)
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public string AccountId;
/// <summary>
///褰撳墠灞�鍩熺綉缃戠粶鍙峰崰鐢ㄤ綅鏁帮紝鐢ㄤ簬璁$畻瀛愮綉鎺╃爜锛屽Mask=32锛屽垯瀛愮綉鎺╃爜涓�255.255.255.0
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public int Mask;
/// <summary>
///涓婄骇璺敱鍣ㄦ棤绾垮悕绉�
///<para>褰� JoinMode = 0鏃跺瓨鍦� </para>
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public string RouteESSID;
/// <summary>
///DNS鏈嶅姟鍣ㄥ湴鍧�
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public string DNSServer;
/// <summary>
/// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈�(缃戝叧鍥轰欢鏃ユ湡锛燂紵)
@@ -150,24 +198,20 @@
/// <summary>
/// Zigbee鍗忚鍣ㄧ▼搴忕増鏈�
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public int ZigbeeVersion;
/// <summary>
///鍗忚皟鍣╩ac鍦板潃
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public string ZigbeeMacAddr;
/// <summary>
///缃戝叧瀹卛d
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public string HomeId;
/// <summary>
///鏄惁宸茬粡杩炴帴浜戠mqtt
///<para>0锛氬惁</para>
///<para>1锛氭槸</para>
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public int IsConnectCloud;
/// <summary>
///锛堢敤浜庣綉鍏崇▼搴忚皟璇曪級
@@ -177,7 +221,6 @@
///<para>(3)NoBind,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭痆鎮ㄦ墍鎻愪氦鐨刐GatewayUniqueId 缃戝叧鍞竴Id(MAC)]鍜孾浣忓畢涓婚敭Id]涓嶅瓨鍦ㄧ粦瀹氱殑鍏崇郴]</para>
///<para>(4)YouDataNoIsLocalRegion,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭痆鎮ㄧ殑鐨勬暟鎹苟涓嶅湪姝DL鍖哄煙鏈嶅姟鍣�, 璇烽噸瀹氬悜鍒板涓婬DL鍖哄煙鏈嶅姟鍣ㄨ繘琛屽鐞�.]</para>
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public string StateCode;
/// <summary>
///Linux缃戝叧绫诲瀷
@@ -206,7 +249,6 @@
/// <summary>
/// 铏氭嫙椹卞姩淇℃伅
/// </summary>
- [Newtonsoft.Json.JsonIgnore]
public List<DriveCodeListObj> DriveCodeList = new List<DriveCodeListObj>();
}
@@ -286,10 +328,6 @@
public string HomeId;
}
- /// <summary>
- /// 骞挎挱鍙戠幇鍗忚(灞忚斀鎺変簡涓�浜涚洰鍓嶄笉鐢ㄧ殑鍙橀噺)
- /// </summary>
- public GatewayBaseInfo getGatewayBaseInfo = new GatewayBaseInfo();
/// <summary>
/// 骞挎挱鍙戠幇鍗忚(灞忚斀鎺変簡涓�浜涚洰鍓嶄笉鐢ㄧ殑鍙橀噺)
/// </summary>
diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs
index 02bf071..673c1a5 100755
--- a/ZigbeeApp/Shared/R.cs
+++ b/ZigbeeApp/Shared/R.cs
@@ -663,7 +663,7 @@
public readonly static int Sunrisesunset = 5134;
public readonly static int cycle = 5135;
public readonly static int completeNext = 5136;
- public readonly static int Selectedtimetype= 5137;
+ public readonly static int Selectedtimetype = 5137;
public readonly static int Timecondition = 5138;
public readonly static int condition = 5139;
public readonly static int pushset = 5140;
@@ -721,7 +721,7 @@
public readonly static int addtime = 5192;
public readonly static int selectcommontimetype = 5193;
public readonly static int newautomation = 5194;
- public readonly static int editautomation= 5195;
+ public readonly static int editautomation = 5195;
public readonly static int open1 = 5196;
public readonly static int disable = 5197;
public readonly static int selectsavedautomationstate = 5198;
@@ -857,10 +857,10 @@
public readonly static int logictemplate = 5358;
public readonly static int onlight = 5359;
public readonly static int offlight = 5360;
- public readonly static int OnOffSwitch=5361;
+ public readonly static int OnOffSwitch = 5361;
public readonly static int addlinkageevent = 5362;
public readonly static int editlinkageevent = 5363;
- public readonly static int selectunlockingmode=5364;
+ public readonly static int selectunlockingmode = 5364;
public readonly static int lockaddaction = 5365;
public readonly static int linkageevent = 5366;
public readonly static int current = 5367;
@@ -885,7 +885,7 @@
public readonly static int daySone = 5386;
public readonly static int numberSone = 5387;
public readonly static int openAutomationSone = 5388;
- public readonly static int timeSetSone= 5389;
+ public readonly static int timeSetSone = 5389;
public readonly static int invalidSetting = 5390;
public readonly static int hour = 5391;
public readonly static int lockOpen = 5392;
@@ -904,8 +904,6 @@
public readonly static int mi = 5405;
-
- #region 鐧诲綍娉ㄥ唽
/// <summary>
/// HDL Home
/// </summary>
@@ -914,117 +912,114 @@
/// 甯哥敤
/// </summary>
public const int Favorite = 10001;
-
-
-
- /// <summary>
- /// 鎵嬫満鍙�
- /// </summary>
- public const int PhoneNum = 10100;
- /// <summary>
- /// 閭
- /// </summary>
- public const int Email = 10101;
- /// <summary>
- /// 璇疯緭鍏ユ墜鏈哄彿
- /// </summary>
- public const int PleaseInputPhoneNum = 10102;
- /// <summary>
- /// 璇疯緭鍏ヤ笉灏戜簬6浣嶇殑瀵嗙爜
- /// </summary>
- public const int PleaseInputPWD = 10103;
- /// <summary>
- /// 鐧诲綍
- /// </summary>
- public const int Login = 10104;
- /// <summary>
- /// 楠岃瘉鐮佺櫥褰�
- /// </summary>
- public const int LoginByCode = 10105;
- /// <summary>
- /// 娉ㄥ唽鐢ㄦ埛
- /// </summary>
- public const int Register = 10106;
- /// <summary>
- /// 璇疯緭鍏ラ偖绠�
- /// </summary>
- public const int PleaseInputEmail = 10107;
- /// <summary>
- /// 鎼滅储
- /// </summary>
- public const int Search = 10108;
- /// <summary>
- /// 瀹屾垚
- /// </summary>
- public const int Complete = 10109;
- /// <summary>
- /// 璐﹀彿鐧诲綍
- /// </summary>
- public const int LoginByAccountPWD = 10110;
- /// <summary>
- /// 鑾峰彇楠岃瘉鐮�
- /// </summary>
- public const int SendVerificationCode = 10111;
- /// <summary>
- /// 鍚庨噸鍙�
- /// </summary>
- public const int SendVerificationCodeAgain = 10112;
- /// <summary>
- /// 璇峰啀娆¤緭鍏ュ瘑鐮�
- /// </summary>
- public const int PleaseComfirePWD = 10113;
- /// <summary>
- /// 鍙戦�侀獙璇佺爜鎴愬姛锛岃娉ㄦ剰鏌ユ敹
- /// </summary>
- public const int SendVerificationCodeSuccess = 10114;
- /// <summary>
- /// 纭畾
- /// </summary>
- public const int Confrim = 10115;
+ /// <summary>
+ /// 鎵嬫満鍙�
+ /// </summary>
+ public const int PhoneNum = 10100;
+ /// <summary>
+ /// 閭
+ /// </summary>
+ public const int Email = 10101;
+ /// <summary>
+ /// 璇疯緭鍏ユ墜鏈哄彿
+ /// </summary>
+ public const int PleaseInputPhoneNum = 10102;
+ /// <summary>
+ /// 璇疯緭鍏ヤ笉灏戜簬6浣嶇殑瀵嗙爜
+ /// </summary>
+ public const int PleaseInputPWD = 10103;
+ /// <summary>
+ /// 鐧诲綍
+ /// </summary>
+ public const int Login = 10104;
+ /// <summary>
+ /// 楠岃瘉鐮佺櫥褰�
+ /// </summary>
+ public const int LoginByCode = 10105;
+ /// <summary>
+ /// 娉ㄥ唽鐢ㄦ埛
+ /// </summary>
+ public const int Register = 10106;
+ /// <summary>
+ /// 璇疯緭鍏ラ偖绠�
+ /// </summary>
+ public const int PleaseInputEmail = 10107;
+ /// <summary>
+ /// 鎼滅储
+ /// </summary>
+ public const int Search = 10108;
+ /// <summary>
+ /// 瀹屾垚
+ /// </summary>
+ public const int Complete = 10109;
+ /// <summary>
+ /// 璐﹀彿鐧诲綍
+ /// </summary>
+ public const int LoginByAccountPWD = 10110;
+ /// <summary>
+ /// 鑾峰彇楠岃瘉鐮�
+ /// </summary>
+ public const int SendVerificationCode = 10111;
+ /// <summary>
+ /// 鍚庨噸鍙�
+ /// </summary>
+ public const int SendVerificationCodeAgain = 10112;
+ /// <summary>
+ /// 璇峰啀娆¤緭鍏ュ瘑鐮�
+ /// </summary>
+ public const int PleaseComfirePWD = 10113;
+ /// <summary>
+ /// 鍙戦�侀獙璇佺爜鎴愬姛锛岃娉ㄦ剰鏌ユ敹
+ /// </summary>
+ public const int SendVerificationCodeSuccess = 10114;
+ /// <summary>
+ /// 纭畾
+ /// </summary>
+ public const int Confrim = 10115;
/// <summary>
/// 璇ョ敤鎴峰凡瀛樺湪锛屽彲鐩存帴鐧诲綍
/// </summary>
public const int AccountHasBeenRegistered = 10116;
- /// <summary>
- /// 鎻愪緵鐨勫弬鏁伴敊璇�
- /// </summary>
- public const int PARAMETEROREMPTY = 10117;
+ /// <summary>
+ /// 鎻愪緵鐨勫弬鏁伴敊璇�
+ /// </summary>
+ public const int PARAMETEROREMPTY = 10117;
/// <summary>
/// 纭瀵嗙爜涓嶄竴鑷达紝璇烽噸鏂拌緭鍏�
/// </summary>
public const int TwoPasswordInconsistency = 10118;
- /// <summary>
- /// 楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏�
- /// </summary>
- public const int VALIDCODEANDPHONENOEQUAL = 10119;
- /// <summary>
- /// 璇锋眰鏈嶅姟鍣ㄥけ璐�
- /// </summary>
- public const int RequestServerFailed = 10120;
- /// <summary>
- /// 鎭枩娉ㄥ唽鎴愬姛锛�
- /// </summary>
- public const int RegisterSuccessTip = 10121;
- /// <summary>
- /// 鍗冲皢鑷姩鐧诲綍
- /// </summary>
- public const int WillAutoLogin = 10122;
- /// <summary>
- /// 蹇樿瀵嗙爜
- /// </summary>
- public const int ForgotPWD = 10123;
- /// <summary>
- /// 纭閲嶇疆
- /// </summary>
- public const int ComfirmReset = 10124;
- /// <summary>
- /// 淇敼鎴愬姛
- /// </summary>
- public const int ResetSuccess = 10125;
- /// <summary>
- /// 浣犵殑瀵嗙爜淇敼鎴愬姛锛岃閲嶆柊鐧诲綍
- /// </summary>
- public const int ResetScucessPleaseLogin = 10126;
+ /// <summary>
+ /// 楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏�
+ /// </summary>
+ public const int VALIDCODEANDPHONENOEQUAL = 10119;
+ /// <summary>
+ /// 璇锋眰鏈嶅姟鍣ㄥけ璐�
+ /// </summary>
+ public const int RequestServerFailed = 10120;
+ /// <summary>
+ /// 鎭枩娉ㄥ唽鎴愬姛锛�
+ /// </summary>
+ public const int RegisterSuccessTip = 10121;
+ /// <summary>
+ /// 鍗冲皢鑷姩鐧诲綍
+ /// </summary>
+ public const int WillAutoLogin = 10122;
+ /// <summary>
+ /// 蹇樿瀵嗙爜
+ /// </summary>
+ public const int ForgotPWD = 10123;
+ /// <summary>
+ /// 纭閲嶇疆
+ /// </summary>
+ public const int ComfirmReset = 10124;
+ /// <summary>
+ /// 淇敼鎴愬姛
+ /// </summary>
+ public const int ResetSuccess = 10125;
+ /// <summary>
+ /// 浣犵殑瀵嗙爜淇敼鎴愬姛锛岃閲嶆柊鐧诲綍
+ /// </summary>
+ public const int ResetScucessPleaseLogin = 10126;
/// <summary>
/// 璇烽�夋嫨鍖哄彿
/// </summary>
@@ -1054,10 +1049,6 @@
/// </summary>
public const int PleaseInputVerificationCode = 10133;
/// <summary>
- /// 鍗冲皢閫氳繃寰俊鎺堟潈鐧诲綍
- /// </summary>
- public const int LoginByWechat = 10134;
- /// <summary>
/// 鐧诲綍涓�...
/// </summary>
public const int Logining = 10135;
@@ -1065,10 +1056,6 @@
/// 褰撳墠浣忓畢涓虹┖锛岃鍏堝缓绔嬩綇瀹�
/// </summary>
public const int CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst = 10136;
- /// <summary>
- /// 浣忓畢鍚嶇О涓虹┖
- /// </summary>
- public const int TheResidenceNameNull = 10137;
/// <summary>
/// 閭閿欒锛岃閲嶆柊杈撳叆
/// </summary>
@@ -1081,10 +1068,6 @@
/// 璇疯緭鍏ラ暱搴︿负6-13涓瓧绗︾殑瀵嗙爜
/// </summary>
public const int ThePWDLengthError = 10140;
- /// <summary>
- /// 浣犲凡琚己鍒朵笅绾匡紒
- /// </summary>
- public const int YouHaveBeenSignOut = 10141;
/// <summary>
/// 鏂板瘑鐮佸拰鍘熷瘑鐮佷竴鑷�
/// </summary>
@@ -1101,10 +1084,8 @@
/// 宸叉湁璐﹀彿锛熺櫥褰�
/// </summary>
public const int LoginByAccountPWD_1 = 10145;
-
-
/// <summary>
- /// 鏀规埧闂村悕绉板凡瀛樺湪
+ /// 璇ユ埧闂村悕绉板凡瀛樺湪
/// </summary>
public const int HadSameRoom = 10150;
/// <summary>
@@ -1116,14 +1097,6 @@
/// </summary>
public const int ControlSceneFail = 10152;
/// <summary>
- /// 鍦烘櫙涓虹┖
- /// </summary>
- public const int TheSceneIsNull = 10153;
- /// <summary>
- /// 璇ュ満鏅腑娌℃湁鎵ц鐩爣
- /// </summary>
- public const int ThisSceneHaveNoDevice = 10154;
- /// <summary>
/// 鎿嶄綔澶辫触
/// </summary>
public const int FAIL = 10155;
@@ -1131,16 +1104,6 @@
/// 鍙戦�侀獙璇佺爜澶辫触
/// </summary>
public const int SENDFAIL = 10156;
- /// <summary>
- /// 缃戝叧涓嶅湪绾�
- /// </summary>
- public const int TheMainGatewayIsNotOnLine = 10157;
- /// <summary>
- /// 涓嬩竴姝�
- /// </summary>
- public const int Next = 10158;
-
-
/// <summary>
/// 宸叉槸鏈�鏂扮増鏈�
/// </summary>
@@ -1150,10 +1113,6 @@
/// </summary>
public const int Update = 10161;
/// <summary>
- /// 鏇存柊鍐呭
- /// </summary>
- public const int UpdateContent = 10162;
- /// <summary>
/// 鏇存柊澶辫触
/// </summary>
public const int UpdateAppFail = 10163;
@@ -1161,10 +1120,6 @@
/// 姝e湪鏇存柊涓�...
/// </summary>
public const int Updating = 10164;
- /// <summary>
- /// 鍙栨秷鏇存柊
- /// </summary>
- public const int CancelUpdating = 10165;
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
@@ -1178,129 +1133,113 @@
/// </summary>
public const int UpdateVersion = 10168;
/// <summary>
- /// 鍗忚鏂囨湰淇℃伅鍐呭
- /// </summary>
- public const int SLA_Title = 10169;
- /// <summary>
- /// 鍗忚璇︾粏
- /// </summary>
- public const int SLA_Detail = 10170;
-
-
- #endregion
-
- #region 鍒嗙被
-
- /// <summary>
/// 鍔熻兘
/// </summary>
public const int Function = 11000;
- /// <summary>
- /// 鍦烘櫙
- /// </summary>
- public const int Scence = 11001;
- /// <summary>
- /// 鑷姩鍖�
- /// </summary>
- public const int Automation = 11002;
-
-
- /// <summary>
- /// 娌℃湁鍔熻兘 璇峰湪涓汉涓績--璁惧绠$悊澶勬坊鍔�
- /// </summary>
- public const int NoFunction = 11010;
- /// <summary>
- /// 缂栬緫
- /// </summary>
- public const int Edit = 11011;
+ /// <summary>
+ /// 鍦烘櫙
+ /// </summary>
+ public const int Scence = 11001;
+ /// <summary>
+ /// 鑷姩鍖�
+ /// </summary>
+ public const int Automation = 11002;
+ /// <summary>
+ /// 娌℃湁鍔熻兘 璇峰湪涓汉涓績--璁惧绠$悊澶勬坊鍔�
+ /// </summary>
+ public const int NoFunction = 11010;
+ /// <summary>
+ /// 缂栬緫
+ /// </summary>
+ public const int Edit = 11011;
/// <summary>
/// 鍔熻兘璁剧疆
/// </summary>
public const int FunctionSetting = 11012;
- /// <summary>
- /// 淇℃伅缂栬緫
- /// </summary>
- public const int EditInfo = 11013;
- /// <summary>
- /// 鍔熻兘鍚嶇О
- /// </summary>
- public const int FunctionName = 11014;
- /// <summary>
- /// 鎵�灞炲尯鍩�
- /// </summary>
- public const int BelongZone = 11015;
- /// <summary>
- /// 鎵�灞炶澶�
- /// </summary>
- public const int BelongDevice = 11016;
- /// <summary>
- /// 鏈煡
- /// </summary>
- public const int UNKnown = 11017;
- /// <summary>
- /// 鍒嗕韩
- /// </summary>
- public const int Share = 11018;
- /// <summary>
- /// 鍒嗕韩鐨�
- /// </summary>
- public const int Shared = 11019;
- /// <summary>
- /// 閫夋嫨鍥炬爣
- /// </summary>
- public const int SelectIcon = 11020;
- /// <summary>
- /// 淇濆瓨
- /// </summary>
- public const int Save = 11021;
- /// <summary>
- /// 鎻愰啋
- /// </summary>
- public const int TIP = 11022;
- /// <summary>
- /// 鍙栨秷
- /// </summary>
- public const int Cancel = 11023;
- /// <summary>
- /// 娌℃湁鍦烘櫙{0}璇风偣鍑诲彸涓婅娣诲姞
- /// </summary>
- public const int NoScene = 11024;
- /// <summary>
- /// 璁剧疆
- /// </summary>
- public const int Setting = 11025;
- /// <summary>
- /// 寤舵椂
- /// </summary>
- public const int Delay = 11026;
- /// <summary>
- /// 纭畾鍒犻櫎鍚楋紵
- /// </summary>
- public const int ConfirmDelete = 11027;
- /// <summary>
- /// 娣诲姞鍦烘櫙
- /// </summary>
- public const int AddScence = 11028;
- /// <summary>
- /// 鍦烘櫙鍚嶇О
- /// </summary>
- public const int SceneName = 11029;
- /// <summary>
- /// 璇疯緭鍏ュ満鏅悕绉�
- /// </summary>
- public const int PleaseInputSceneName = 11030;
- /// <summary>
- /// 娣诲姞鎵ц鐩爣
- /// </summary>
- public const int AddScentTargetAction = 11031;
- /// <summary>
- /// 閫夋嫨鍖哄煙
- /// </summary>
- public const int SelectZone = 11032;
- /// <summary>
- /// 閫夋嫨鍦烘櫙鍥剧墖
- /// </summary>
- public const int SelectScenePic = 11033;
+ /// <summary>
+ /// 淇℃伅缂栬緫
+ /// </summary>
+ public const int EditInfo = 11013;
+ /// <summary>
+ /// 鍔熻兘鍚嶇О
+ /// </summary>
+ public const int FunctionName = 11014;
+ /// <summary>
+ /// 鎵�灞炲尯鍩�
+ /// </summary>
+ public const int BelongZone = 11015;
+ /// <summary>
+ /// 鎵�灞炶澶�
+ /// </summary>
+ public const int BelongDevice = 11016;
+ /// <summary>
+ /// 鏈煡
+ /// </summary>
+ public const int UNKnown = 11017;
+ /// <summary>
+ /// 鍒嗕韩
+ /// </summary>
+ public const int Share = 11018;
+ /// <summary>
+ /// 鍒嗕韩鐨�
+ /// </summary>
+ public const int Shared = 11019;
+ /// <summary>
+ /// 閫夋嫨鍥炬爣
+ /// </summary>
+ public const int SelectIcon = 11020;
+ /// <summary>
+ /// 淇濆瓨
+ /// </summary>
+ public const int Save = 11021;
+ /// <summary>
+ /// 鎻愰啋
+ /// </summary>
+ public const int TIP = 11022;
+ /// <summary>
+ /// 鍙栨秷
+ /// </summary>
+ public const int Cancel = 11023;
+ /// <summary>
+ /// 娌℃湁鍦烘櫙{0}璇风偣鍑诲彸涓婅娣诲姞
+ /// </summary>
+ public const int NoScene = 11024;
+ /// <summary>
+ /// 璁剧疆
+ /// </summary>
+ public const int Setting = 11025;
+ /// <summary>
+ /// 寤舵椂
+ /// </summary>
+ public const int Delay = 11026;
+ /// <summary>
+ /// 纭畾鍒犻櫎鍚楋紵
+ /// </summary>
+ public const int ConfirmDelete = 11027;
+ /// <summary>
+ /// 娣诲姞鍦烘櫙
+ /// </summary>
+ public const int AddScence = 11028;
+ /// <summary>
+ /// 鍦烘櫙鍚嶇О
+ /// </summary>
+ public const int SceneName = 11029;
+ /// <summary>
+ /// 璇疯緭鍏ュ満鏅悕绉�
+ /// </summary>
+ public const int PleaseInputSceneName = 11030;
+ /// <summary>
+ /// 娣诲姞鎵ц鐩爣
+ /// </summary>
+ public const int AddScentTargetAction = 11031;
+ /// <summary>
+ /// 閫夋嫨鍖哄煙
+ /// </summary>
+ public const int SelectZone = 11032;
+ /// <summary>
+ /// 閫夋嫨鍦烘櫙鍥剧墖
+ /// </summary>
+ public const int SelectScenePic = 11033;
/// <summary>
/// 纭畾瑕佺Щ闄よ鍔熻兘锛�
/// </summary>
@@ -1317,45 +1256,10 @@
/// 绌鸿皟妯″紡涓虹┖锛岃鍏堥厤缃�
/// </summary>
public const int AC_Model_None = 11037;
-
-
- #region 璁惧绫诲瀷
/// <summary>
/// 鏈煡璁惧
/// </summary>
public const int UnknowDevice = 12100;
- /// <summary>
- /// 缁х數鍣�
- /// </summary>
- public const int OnOffOutput = 12102;
- /// <summary>
- /// 璋冨厜鐏�
- /// </summary>
- public const int DimmableLight = 12103;
- /// <summary>
- /// 绐楀笜
- /// </summary>
- public const int WindowCoveringDevice = 12104;
- /// <summary>
- /// 绌鸿皟
- /// </summary>
- public const int Thermostat = 12105;
- /// <summary>
- /// 浼犳劅鍣�
- /// </summary>
- public const int IASZone = 12106;
- /// <summary>
- /// 绌烘皵寮�鍏�
- /// </summary>
- public const int AirSwitch = 12107;
- /// <summary>
- /// 褰╃伅
- /// </summary>
- public const int ColorDimmableLight = 12108;
- /// <summary>
- /// 涓户鍣�
- /// </summary>
- public const int Repeater = 12109;
/// <summary>
/// 娓╁害浼犳劅鍣�
/// </summary>
@@ -1364,12 +1268,6 @@
/// 婀垮害浼犳劅鍣�
/// </summary>
public const int HumiditySensor = 12111;
- /// <summary>
- /// 娓╂箍搴︿紶鎰熷櫒
- /// </summary>
- public const int TemperatureAndHumiditySensor = 12112;
-
-
/// <summary>
/// 鏈変汉
/// </summary>
@@ -1402,96 +1300,86 @@
/// 瀹夊叏
/// </summary>
public const int IASZone_Statu_Safe = 12507;
-
-
- #endregion
-
-
- #endregion
-
- #region 涓婚〉
-
/// <summary>
/// 鎴块棿鍒楄〃
/// </summary>
public const int RoomList = 13100;
-
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- public const int SelectFloor = 13101;
- /// <summary>
- /// 閫夋嫨浣忓畢
- /// </summary>
- public const int ChangeHome = 13102;
- /// <summary>
- /// 鏂扮敤鎴风櫥褰曪紝璇峰厛缁戝畾缃戝叧
- /// </summary>
- public const int NewAccountNeedBingGW = 13103;
- /// <summary>
- /// 娣诲姞鏅鸿兘缃戝叧
- /// </summary>
- public const int AddSmartGW = 13104;
- /// <summary>
- /// 缂栬緫鎴块棿
- /// </summary>
- public const int EditRoom = 13105;
- /// <summary>
- /// 鎴块棿鍚嶇О
- /// </summary>
- public const int RoomName = 13106;
- /// <summary>
- /// 鎵�灞炴ゼ灞�
- /// </summary>
- public const int BelongFloor = 13107;
- /// <summary>
- /// 娓╁害
- /// </summary>
- public const int Temperature = 13108;
- /// <summary>
- /// 婀垮害
- /// </summary>
- public const int Humidity = 13109;
- /// <summary>
- /// 褰撳墠
- /// </summary>
- public const int Current = 13110;
- /// <summary>
- /// 寮�
- /// </summary>
- public const int Open = 13111;
- /// <summary>
- /// 鍏抽棴
- /// </summary>
- public const int Close = 13112;
- /// <summary>
- /// 涓嶅紑鍚�
- /// </summary>
- public const int NotOpen = 13113;
- /// <summary>
- /// 绉�
- /// </summary>
- public const int Second = 13114;
- /// <summary>
- /// 鍒嗛挓
- /// </summary>
- public const int Minute = 13115;
- /// <summary>
- /// 灏忔椂
- /// </summary>
- public const int Hour = 13116;
- /// <summary>
- /// 鏈垎閰�
- /// </summary>
- public const int Unallocated = 13117;
- /// <summary>
- /// 鍏ㄩ��
- /// </summary>
- public const int AllSelect = 13118;
- /// <summary>
- /// 娣诲姞鍒�
- /// </summary>
- public const int AddTo = 13119;
+ /// <summary>
+ /// 閫夋嫨妤煎眰
+ /// </summary>
+ public const int SelectFloor = 13101;
+ /// <summary>
+ /// 閫夋嫨浣忓畢
+ /// </summary>
+ public const int ChangeHome = 13102;
+ /// <summary>
+ /// 鏂扮敤鎴风櫥褰曪紝璇峰厛缁戝畾缃戝叧
+ /// </summary>
+ public const int NewAccountNeedBingGW = 13103;
+ /// <summary>
+ /// 娣诲姞鏅鸿兘缃戝叧
+ /// </summary>
+ public const int AddSmartGW = 13104;
+ /// <summary>
+ /// 缂栬緫鎴块棿
+ /// </summary>
+ public const int EditRoom = 13105;
+ /// <summary>
+ /// 鎴块棿鍚嶇О
+ /// </summary>
+ public const int RoomName = 13106;
+ /// <summary>
+ /// 鎵�灞炴ゼ灞�
+ /// </summary>
+ public const int BelongFloor = 13107;
+ /// <summary>
+ /// 娓╁害
+ /// </summary>
+ public const int Temperature = 13108;
+ /// <summary>
+ /// 婀垮害
+ /// </summary>
+ public const int Humidity = 13109;
+ /// <summary>
+ /// 褰撳墠
+ /// </summary>
+ public const int Current = 13110;
+ /// <summary>
+ /// 寮�
+ /// </summary>
+ public const int Open = 13111;
+ /// <summary>
+ /// 鍏抽棴
+ /// </summary>
+ public const int Close = 13112;
+ /// <summary>
+ /// 涓嶅紑鍚�
+ /// </summary>
+ public const int NotOpen = 13113;
+ /// <summary>
+ /// 绉�
+ /// </summary>
+ public const int Second = 13114;
+ /// <summary>
+ /// 鍒嗛挓
+ /// </summary>
+ public const int Minute = 13115;
+ /// <summary>
+ /// 灏忔椂
+ /// </summary>
+ public const int Hour = 13116;
+ /// <summary>
+ /// 鏈垎閰�
+ /// </summary>
+ public const int Unallocated = 13117;
+ /// <summary>
+ /// 鍏ㄩ��
+ /// </summary>
+ public const int AllSelect = 13118;
+ /// <summary>
+ /// 娣诲姞鍒�
+ /// </summary>
+ public const int AddTo = 13119;
/// <summary>
/// 璇ユ埧闂存槸鍒嗕韩杩囨潵鐨勶紝涓嶅厑璁歌繘琛岃鎿嶄綔
/// </summary>
@@ -1612,13 +1500,10 @@
/// 璇ュ満鏅鍦ㄥ欢鏃讹紝璇风◢鍚�
/// </summary>
public const int TheSceneIsDelaying = 13149;
-
-
-
/// <summary>
/// 閫夋嫨鎽嗛
/// </summary>
- public const int SelectSwing=13500;
+ public const int SelectSwing = 13500;
/// <summary>
/// 鑷姩
/// </summary>
@@ -1668,21 +1553,15 @@
/// 褰撳墠 浜害
/// </summary>
public const int CurrentLightLevel = 13604;
-
-
-
- #endregion
-
-
- /// <summary>
- /// 瀵嗙爜闀垮害涓簕0}涓瓧绗�
- /// </summary>
- public const int PswLengthMsg = 15000;
+ /// <summary>
+ /// 瀵嗙爜闀垮害涓簕0}涓瓧绗�
+ /// </summary>
+ public const int PswLengthMsg = 15000;
/// <summary>
/// 1涓皬鍐欏瓧姣�
/// </summary>
@@ -3486,7 +3365,7 @@
/// <summary>
/// 鍗忚皟鍣�
/// </summary>
- public const int uCoordinator= 15514;
+ public const int uCoordinator = 15514;
/// <summary>
/// 铏氭嫙椹卞姩
/// </summary>
@@ -4978,7 +4857,7 @@
/// <summary>
/// 璺宠浆鍒扮Щ鍔ㄨ澶�
/// </summary>
- public const int uJumpToMobileDevice= 15905;
+ public const int uJumpToMobileDevice = 15905;
/// <summary>
/// WLAN璁剧疆杩炴帴瀹跺涵WiFi
/// </summary>
@@ -5852,14 +5731,6 @@
/// </summary>
public const int uAddMiniGatewayMsg1 = 16125;
/// <summary>
- /// 璇烽�夋嫨widora-xxxx缃戠粶
- /// </summary>
- public const int uPleaseSelectWidoraXXNet = 16126;
- /// <summary>
- /// 鎵嬫満鍘昏缃繛鎺ョ綉鍏崇儹鐐箋0}閫夋嫨widora-xxxx缃戠粶
- /// </summary>
- public const int uAddMiniGatewayMsg2 = 16127;
- /// <summary>
/// 鑹叉俯
/// </summary>
public const int uColorTemperature = 16128;
@@ -5867,6 +5738,15 @@
/// Mini澶滅伅
/// </summary>
public const int uMiniNightLight = 16129;
+ /// <summary>
+ /// 鐕冩皵娉勯湶
+ /// </summary>
+ public const int uGasLeakage = 16130;
+ /// <summary>
+ /// 蹇界暐
+ /// </summary>
+ public const int uNeglect = 16131;
+
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
@@ -6280,8 +6160,12 @@
/// <summary>
/// 闀滃儚ID涓�11鐨勮澶囩殑瀹樻柟鍚嶅瓧锛歁ini缃戝叧
/// </summary>
- public const int uDeviceModelId11 = 30043;
-
+ public const int uDeviceModelId11 = 30043;
+ /// <summary>
+ /// 闀滃儚ID涓�20000鐨勮澶囩殑瀹樻柟鍚嶅瓧锛氳壊娓╃伅
+ /// </summary>
+ public const int uDeviceModelId20000 = 30044;
+
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
/// <summary>
/// 鑷畾涔夎澶囨墍灞濱D涓�100鐨勭炕璇戝悕瀛楋細閬槼
diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems
index 9e3fd2c..05a5b7a 100755
--- a/ZigbeeApp/Shared/Shared.projitems
+++ b/ZigbeeApp/Shared/Shared.projitems
@@ -26,6 +26,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceAcRowControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceAirSwitchRowControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceColorLightRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceColorTemperatureRowControl.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" />
@@ -97,9 +98,10 @@
<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\DeviceMiniLightDetailCardForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceColorTemperatureLightDetailCardForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DevicePmSensorDetailCardForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceRelayDetailCardForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceColorTemperatureCardControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceFreshAirCardControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceFunctionUnallocatedControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceSelectUnallocatedControl.cs" />
@@ -121,6 +123,18 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\HomeMainPageForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ModelData\DeviceModelDataLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ModelData\ModelDataCommon.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundContentForDevice.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundContentForDeviceChange.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundControlContentForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundControlForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundListForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\SmartSound.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\SmartSoundDataInfo.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\SmartSoundInfo.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Util\MyHttpWebResponse.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Widget\MyButton.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Widget\SoundRowLayout.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Widget\TextDialog.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Abount\AbountForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Abount\SLAForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\AccountOption.cs" />
@@ -302,7 +316,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\NormalControls\DateSelectControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceUpdateLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ClickButtonControls\NormalClickButton.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\DeviceInformationListControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\PswNumberInputControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\SafetyMasterControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\SafetySensorStatuControl.cs" />
@@ -416,6 +429,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\UserMain\SecondAuthenticationForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserView\LoginLoading.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\AC.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\ColorTemperatureLight.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\DimmableLight.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\DoorLock.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\FreshAir.cs" />
--
Gitblit v1.8.0