From bff8993501334c4f3c5f902216fe03253be747f8 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 15 四月 2020 16:59:01 +0800
Subject: [PATCH] 合并新代码
---
ZigbeeApp20200414/Shared/Phone/CommonForm/CommonFormBase.cs | 10
ZigbeeApp20200414/Shared/Phone/MainPage/Controls/SceneCardControl.cs | 38
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs | 11
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/1.png | 0
ZigbeeApp20200414/GateWay.Droid/Resources/drawable/Loading.png | 0
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/7.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/828*1792_XR.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208*1242.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136-1.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Language.ini | 54
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Item/NormallyOpen.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/13.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs | 22
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750*1334.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs | 12
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs | 22
ZigbeeApp20200414/Shared/Phone/CommonForm/EditorCommonForm.cs | 12
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlControlLogic.cs | 84
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs | 9
ZigbeeApp20200414/Shared/DLL/Android/Shared.Droid.dll | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536-1.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs | 4
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*2732-1.png | 0
ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs | 32
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048-1.png | 0
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/5.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960-1.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs | 136
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960.png | 0
ZigbeeApp20200414/Shared/Phone/Device/Logic/OneLogic.cs | 45
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/3.png | 0
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/HumiditySensor.cs | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/DateSelectControl.cs | 7
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs | 30
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs | 18
ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs | 40
ZigbeeApp20200414/Shared/Common/Device.cs | 66
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792*828.png | 0
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/13.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs | 7
ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.TBL.dll | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs | 30
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs | 1
ZigbeeApp20200414/Shared/Phone/Device/Logic/Send.cs | 8
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024-1.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 1
ZigbeeApp20200414/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs | 12
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/6.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs | 42
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DoorLock.cs | 0
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DeviceType.cs | 8
ZigbeeApp20200414/Shared/Phone/Device/Logic/TimePage.cs | 269 +-
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 29
ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordAddNewForm.cs | 20
ZigbeeApp20200414/Shared/Phone/Category/SelectLocalSceneImageForm.cs | 119
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320*480.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterColor.cs | 4
ZigbeeApp20200414/GateWay.Droid/GateWay.Droid.csproj | 51
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/2.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs | 0
ZigbeeApp20200414/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs | 18
ZigbeeApp20200414/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs | 39
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/11.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688*1242.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/8.png | 0
ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 16
ZigbeeApp20200414/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs | 5
ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddNewForm.cs | 19
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/0.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordUserEditorForm.cs | 57
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs | 108
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*748.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/11.png | 0
ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.dll | 0
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/9.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs | 8
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs | 174 +
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs | 50
ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2688_XS Max.png | 0
ZigbeeApp20200414/Shared/Phone/Category/AddOrEditorSceneForm.cs | 15
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/CommonDevice.cs | 748 -----
ZigbeeApp20200414/GateWay.Droid/Properties/AndroidManifest.xml | 2
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2208-1.png | 0
ZigbeeApp20200414/Home.Ios/Home.IOS.csproj | 77
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs | 16
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768-1.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs | 135 +
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs | 16
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/0.png | 0
ZigbeeApp20200414/Shared/Phone/Login/Controls/PhoneEmailSelectControl.cs | 129 +
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs | 2
ZigbeeApp20200414/Shared/Phone/MainPage/HomeMainPageForm.cs | 77
ZigbeeApp20200414/Shared/Phone/MainPage/ListRoomViewFrom.cs | 24
ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436*1125.png | 0
ZigbeeApp20200414/Home.Ios/Info.plist | 4
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs | 2
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/2.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/9.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 35
ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 4
ZigbeeApp20200414/Shared/R.cs | 159 +
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/6.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/Logo/2.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/12.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs | 29
ZigbeeApp20200414/Shared/Common/CommonPage.cs | 2
ZigbeeApp20200414/Shared/Phone/Device/Logic/CustomText.cs | 4
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs | 15
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024.png | 0
ZigbeeApp20200414/Shared/Phone/MainPage/DeviceDetailInfoForm.cs | 26
ZigbeeApp20200414/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs | 7
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs | 24
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/4.png | 0
ZigbeeApp20200414/Shared/Shared.projitems | 59
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs | 498 ++-
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136.png | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/4.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs | 0
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Logo/2.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs | 16
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockScreeningTypeForm.cs | 17
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/3.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768.png | 0
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/FreshAir.cs | 5
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/5.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs | 99
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/12.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1004.png | 0
ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomView.cs | 4
ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs | 170 +
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1496.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs | 12
ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs | 118
ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs | 7
ZigbeeApp20200414/Shared/Phone/Device/Logic/OneTimePoint.cs | 106
ZigbeeApp20200414/Shared/Phone/Device/Logic/SkipView.cs | 211
ZigbeeApp20200414/Shared/Phone/UserView/LoginLoading.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs | 191 +
ZigbeeApp20200414/Home.Ios/Resources/Phone/Item/NormallyOpen.png | 0
ZigbeeApp20200414/GateWay.Droid/Assets/Language.ini | 58
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1125*2436.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs | 1
ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs | 16
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs | 12
ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 139
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json | 56
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 26
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/Panel.cs | 2
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs | 24
ZigbeeApp20200414/Shared/Phone/Login/AccountLogin.cs | 292 ++
ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs | 14
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/1.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs | 33
/dev/null | 1912 ---------------
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2008.png | 0
ZigbeeApp20200414/Shared/Phone/Category/CategoryMainForm.cs | 5
ZigbeeApp20200414/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs | 3
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/10.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/PicViewControl.cs | 6
ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 0
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/7.png | 0
ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 13
ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs | 16
ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/8.png | 0
ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536.png | 0
ZigbeeApp20200414/Shared/Phone/Device/Logic/AddLogicPage.cs | 26
ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/10.png | 0
179 files changed, 3,509 insertions(+), 3,973 deletions(-)
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Language.ini b/ZigbeeApp20200414/GateWay.Droid/Assets/Language.ini
index ab34f65..f66d440 100755
--- a/ZigbeeApp20200414/GateWay.Droid/Assets/Language.ini
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Language.ini
@@ -152,8 +152,8 @@
147=鎵嬪娍寮�閿�
148=璇风粦瀹氳繙绋嬪紑閿佺殑闂ㄩ攣
149=鍘昏缃�
-150=璇峰墠寰�涓汉涓績{0}璁剧疆浜屾瀹夊叏楠岃瘉鏂瑰紡
-151=璁剧疆浜屾瀹夊叏楠岃瘉鏂瑰紡
+150=璇峰墠寰�涓汉涓績{0}寮�鍚繙绋嬪紑閿侀獙璇�
+151=璇峰墠寰�涓汉涓績{0}璁剧疆浜屾瀹夊叏楠岃瘉鏂瑰紡
152=寮�鍚繙绋嬪紑閿侀獙璇�
153=闂ㄩ攣
154=杩滅▼寮�閿�
@@ -273,7 +273,6 @@
266=褰撳墠璁惧涓嶅湪绾�
267=鑾峰彇闊抽噺澶辫触
268=纭畾鍙栨秷璇ユ垚鍛樼殑杩滅▼寮�閿佹潈闄�
-269=甯稿紑妯″紡灏嗕簬{0}鍙栨秷
269=闆舵椂鍖�
270=涓滀竴鍖�
271=涓滀簩鍖�
@@ -303,8 +302,14 @@
295= 鐢熸晥鏃堕棿涓嶈兘澶т簬澶辨晥鏃堕棿
296= 澶辨晥鏃堕棿涓嶈兘灏忎簬鐢熸晥鏃堕棿
297= 澶辨晥鏃堕棿涓嶈兘鐪佺暐
-298= 澶辨晥鏃堕棿涓嶈兘澶т簬36灏忔椂
+298= 澶辨晥鏃堕棿涓嶈兘澶т簬72灏忔椂
299= 澶辨晥鏃堕棿涓嶈兘灏忎簬1灏忔椂
+300=鏂伴
+301=闈炵鐞嗗憳涓嶈兘鍦ㄥ父寮�妯″紡涓嬫搷浣�
+302=缁戝畾鏂伴
+303=娓╁害鏉ユ簮
+304=婀垮害鏉ユ簮
+305=PM2.5鏉ユ簮
@@ -1403,9 +1408,9 @@
15697=妯″潡鏇存崲鐢垫睜
15698=閿欒灏濊瘯寮�閿佽鎶�
15699=鏆村姏寮�闂�
-15700=甯稿紑妯″紡寮�鍚�
-15701=甯稿紑妯″紡缁撴潫
-15702=闂ㄩ搩瑙﹀彂
+15700=甯稿紑妯″紡寮�鍚�(闂ㄩ攣瑙﹀彂)
+15701=甯稿紑妯″紡缁撴潫(闂ㄩ攣瑙﹀彂)
+15702=鏈変汉璁块棶
15703=鍘嗗彶璁板綍
15704=绫诲瀷绛涢��
15705=娓呯┖璁板綍
@@ -1789,6 +1794,12 @@
16085=涓埆鎵ц鐩爣娣诲姞澶辫触
16086=鍒濆鍖栨墽琛岀洰鏍囧け璐�
16087=淇敼鍦烘櫙鍚嶇О澶辫触
+16088=甯稿紑妯″紡寮�鍚�(缃戝叧瑙﹀彂)
+16089=甯稿紑妯″紡缁撴潫(缃戝叧瑙﹀彂)
+16090=甯稿紑妯″紡
+16091=甯稿紑妯″紡鎵嬪姩寮�鍚�
+16092=甯稿紑妯″紡鎵嬪姩鍙栨秷
+16093=甯稿紑妯″紡鍚敤{0}灏忔椂
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1895,7 +1906,7 @@
30017=zigbee涓户鍣�
30018=12鎸夐敭瑙︽懜闈㈡澘(1璺户鐢靛櫒搴曞骇)
30019=4鎸夐敭瑙︽懜闈㈡澘(鍙甫鐢垫簮搴曞骇)
-30020=绾㈠浼犳劅鍣�
+30020=Zigbee浜轰綋绉诲姩浼犳劅鍣�(鐞冨舰)
30021=1璺皟鍏夊櫒灏忔ā鍧�
30022=zigbee杞珺uspro鍗忚杞崲鍣�
30023=zigbee杞�485鍗忚杞崲鍣�
@@ -1923,7 +1934,7 @@
40005=闂ㄩ攣
40006=绌鸿皟
40007=涓户鍣�
-40008=鏅鸿兘绌哄叧
+40008=鏅鸿兘绌哄紑
40009=杞崲鍣�
40010=褰╃伅
40011=娓╂箍搴︿紶鎰熷櫒
@@ -1985,4 +1996,31 @@
60007=璋冨厜妯″潡
60008=杞崲鍣�
60009=绌鸿皟妯″潡
-60010=鏅鸿兘闂ㄩ攣
\ No newline at end of file
+60010=鏅鸿兘闂ㄩ攣
+
+;//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄坊鍔犳柊璁惧鐣岄潰閭i噷鏄剧ず鐨勫悕瀛�,浠�70000寮�濮嬧槄鈽呪槄鈽�
+70000=2鎸夐敭闈㈡澘
+70001=3鎸夐敭闈㈡澘
+70002=4鎸夐敭闈㈡澘
+70003=鏂规偊鍗曞紑鍙屾帶闈㈡澘
+70004=鏂规偊鍙屽紑鍥涙帶闈㈡澘
+70005=鏂规偊鍥涘紑鍏帶闈㈡澘
+70006=鏂规偊鏂伴灏忔ā鍧�
+70007=鏂规偊鏂伴闈㈡澘
+70008=鏂规偊鐜闈㈡澘
+70009=绐楀笜闈㈡澘
+70010=3璺户鐢靛櫒
+70011=1璺皟鍏夊櫒
+70012=绐楀笜鐢垫満
+70013=鍗峰笜鐢垫満
+70014=绌鸿皟缃戝叧
+70015=闂ㄩ攣
+70016=PIR浼犳劅鍣�
+70017=绾㈠浼犳劅鍣�
+70018=鐕冩皵浼犳劅鍣�
+70019=鐑熼浘浼犳劅鍣�
+70020=姘存蹈浼犳劅鍣�
+70021=闂ㄧ獥浼犳劅鍣�
+70022=娓╂箍搴︿紶鎰熷櫒
+70023=涓户鍣�
+70024=鏅鸿兘绌哄紑
\ No newline at end of file
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Item/NormallyOpen.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Item/NormallyOpen.png
new file mode 100755
index 0000000..079c5db
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Item/NormallyOpen.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Logo/2.jpg b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Logo/2.jpg
deleted file mode 100755
index c0c53ac..0000000
--- a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Logo/2.jpg
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Logo/2.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Logo/2.png
new file mode 100755
index 0000000..7a07804
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/Logo/2.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/0.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/0.png
new file mode 100755
index 0000000..b58dd77
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/0.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/1.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/1.png
new file mode 100755
index 0000000..8a1ddc7
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/1.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/10.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/10.png
new file mode 100755
index 0000000..d1f0d95
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/10.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/11.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/11.png
new file mode 100755
index 0000000..bb9e8b0
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/11.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/12.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/12.png
new file mode 100755
index 0000000..443e809
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/12.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/13.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/13.png
new file mode 100755
index 0000000..2f94a2e
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/13.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/2.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/2.png
new file mode 100755
index 0000000..919c660
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/2.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/3.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/3.png
new file mode 100755
index 0000000..471a280
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/3.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/4.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/4.png
new file mode 100755
index 0000000..5d5ff68
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/4.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/5.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/5.png
new file mode 100755
index 0000000..7ac9263
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/5.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/6.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/6.png
new file mode 100755
index 0000000..3a184d7
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/6.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/7.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/7.png
new file mode 100755
index 0000000..fa0050a
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/7.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/8.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/8.png
new file mode 100755
index 0000000..4bb2fdd
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/8.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/9.png b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/9.png
new file mode 100755
index 0000000..1242838
--- /dev/null
+++ b/ZigbeeApp20200414/GateWay.Droid/Assets/Phone/SceneCardIcon/9.png
Binary files differ
diff --git a/ZigbeeApp20200414/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp20200414/GateWay.Droid/GateWay.Droid.csproj
index 08606e7..b932e19 100644
--- a/ZigbeeApp20200414/GateWay.Droid/GateWay.Droid.csproj
+++ b/ZigbeeApp20200414/GateWay.Droid/GateWay.Droid.csproj
@@ -1413,9 +1413,6 @@
<AndroidAsset Include="Assets\Phone\Device\SwitchSelected.png" />
</ItemGroup>
<ItemGroup>
- <AndroidAsset Include="Assets\Phone\Logo\2.jpg" />
- </ItemGroup>
- <ItemGroup>
<AndroidAsset Include="Assets\Phone\Room\AddBackground.png" />
</ItemGroup>
<ItemGroup>
@@ -2045,6 +2042,54 @@
<ItemGroup>
<AndroidAsset Include="Assets\Phone\RealDevice\ButtonPanelFangyueFreshAir.png" />
</ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\0.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\1.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\3.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\4.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\5.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\6.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\7.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\8.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\9.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\10.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\11.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\12.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\SceneCardIcon\13.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Item\NormallyOpen.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Logo\2.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/ZigbeeApp20200414/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp20200414/GateWay.Droid/Properties/AndroidManifest.xml
index d97db01..7d6b000 100644
--- a/ZigbeeApp20200414/GateWay.Droid/Properties/AndroidManifest.xml
+++ b/ZigbeeApp20200414/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="2020040801" android:installLocation="auto" android:versionName="1.0.20040801">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020041301" android:installLocation="auto" android:versionName="1.0.20041301">
<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/ZigbeeApp20200414/GateWay.Droid/Resources/drawable/Loading.png b/ZigbeeApp20200414/GateWay.Droid/Resources/drawable/Loading.png
index 8121837..68960e6 100755
--- a/ZigbeeApp20200414/GateWay.Droid/Resources/drawable/Loading.png
+++ b/ZigbeeApp20200414/GateWay.Droid/Resources/drawable/Loading.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*748.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*748.png
new file mode 100644
index 0000000..78c5f84
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*748.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768-1.png
new file mode 100644
index 0000000..c2c8ed9
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768.png
new file mode 100644
index 0000000..c2c8ed9
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024*768.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_748.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_748.png
deleted file mode 100755
index f9b76f8..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_748.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-1.png
deleted file mode 100755
index 23bb0e1..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-1.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768.png
deleted file mode 100755
index 23bb0e1..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11 Pro Max.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11 Pro Max.png
deleted file mode 100755
index 86a7f91..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11 Pro Max.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11.png
deleted file mode 100755
index 5949696..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1125*2436.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1125*2436.png
new file mode 100644
index 0000000..ed5abe7
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1125*2436.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11pro.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11pro.png
deleted file mode 100755
index 2bac436..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/11pro.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2208-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2208-1.png
new file mode 100644
index 0000000..cacd31f
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2208-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2688_XS Max.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2688_XS Max.png
new file mode 100644
index 0000000..73a6627
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242*2688_XS Max.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2208.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2208.png
deleted file mode 100755
index 4be6fa4..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2208.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2008.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2008.png
new file mode 100644
index 0000000..4942e4a
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2008.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048-1.png
new file mode 100644
index 0000000..3aa9190
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048.png
new file mode 100644
index 0000000..3aa9190
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536*2048.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2008.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2008.png
deleted file mode 100755
index adab731..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2008.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-1.png
deleted file mode 100755
index 6fffb09..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-1.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048.png
deleted file mode 100755
index 6fffb09..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792*828.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792*828.png
new file mode 100644
index 0000000..23abb10
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792*828.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792_828.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792_828.png
deleted file mode 100755
index 522acce..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792_828.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1496.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1496.png
new file mode 100644
index 0000000..6d32881
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1496.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536-1.png
new file mode 100644
index 0000000..f1db73f
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536.png
new file mode 100644
index 0000000..f1db73f
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*1536.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*2732-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*2732-1.png
new file mode 100644
index 0000000..c7b53b1
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048*2732-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1496.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1496.png
deleted file mode 100755
index 92c23a8..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1496.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-1.png
deleted file mode 100755
index ae0258e..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-1.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536.png
deleted file mode 100755
index ae0258e..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_2732.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_2732.png
deleted file mode 100755
index 946a965..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_2732.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208*1242.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208*1242.png
new file mode 100644
index 0000000..4092649
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208*1242.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208_1242.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208_1242.png
deleted file mode 100755
index 083312e..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208_1242.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436*1125.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436*1125.png
new file mode 100644
index 0000000..e4ea893
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436*1125.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436_1125.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436_1125.png
deleted file mode 100755
index 979f726..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436_1125.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688*1242.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688*1242.png
new file mode 100644
index 0000000..98dc1c1
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688*1242.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688_1242.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688_1242.png
deleted file mode 100755
index da11cf8..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688_1242.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320*480.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320*480.png
new file mode 100644
index 0000000..75b2896
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320*480.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320_480.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320_480.png
deleted file mode 100755
index 30d820c..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320_480.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136-1.png
new file mode 100644
index 0000000..dee0605
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136.png
new file mode 100644
index 0000000..dee0605
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*1136.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960-1.png
new file mode 100644
index 0000000..68ece8a
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960.png
new file mode 100644
index 0000000..68ece8a
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640*960.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-1.png
deleted file mode 100755
index cdcc25a..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-1.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136.png
deleted file mode 100755
index cdcc25a..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-1.png
deleted file mode 100755
index c66f1f9..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-1.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960.png
deleted file mode 100755
index c66f1f9..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750*1334.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750*1334.png
new file mode 100644
index 0000000..c746b45
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750*1334.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750_1334.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750_1334.png
deleted file mode 100755
index 597b374..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750_1334.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1004.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1004.png
new file mode 100644
index 0000000..526911f
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1004.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024-1.png
new file mode 100644
index 0000000..42fdc74
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024-1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024.png
new file mode 100644
index 0000000..42fdc74
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768*1024.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1004.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1004.png
deleted file mode 100755
index 266d439..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1004.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-1.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-1.png
deleted file mode 100755
index 0241dc5..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-1.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024.png
deleted file mode 100755
index 0241dc5..0000000
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/828*1792_XR.png b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/828*1792_XR.png
new file mode 100644
index 0000000..d85b362
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/828*1792_XR.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json
index 92ff60a..ce96303 100755
--- a/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json
+++ b/ZigbeeApp20200414/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json
@@ -3,7 +3,6 @@
{
"orientation": "landscape",
"extent": "full-screen",
- "filename": "1920_1080.png",
"size": "1920x1080",
"scale": "1x",
"idiom": "tv",
@@ -12,7 +11,6 @@
{
"orientation": "landscape",
"extent": "full-screen",
- "filename": "3840_2160.png",
"size": "1920x1080",
"scale": "2x",
"idiom": "tv",
@@ -22,7 +20,7 @@
"minimum-system-version": "12.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "11 Pro Max.png",
+ "filename": "1242*2688_XS Max.png",
"size": "414x896",
"subtype": "1792",
"scale": "3x",
@@ -32,7 +30,7 @@
"minimum-system-version": "12.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "11.png",
+ "filename": "828*1792_XR.png",
"size": "276x597.3",
"subtype": "2688",
"scale": "3x",
@@ -42,7 +40,7 @@
"minimum-system-version": "12.0",
"orientation": "landscape",
"extent": "full-screen",
- "filename": "2688_1242.png",
+ "filename": "2688*1242.png",
"size": "896x414",
"subtype": "1792",
"scale": "3x",
@@ -52,7 +50,7 @@
"minimum-system-version": "12.0",
"orientation": "landscape",
"extent": "full-screen",
- "filename": "1792_828.png",
+ "filename": "1792*828.png",
"size": "597.3x276",
"subtype": "2688",
"scale": "3x",
@@ -62,7 +60,7 @@
"minimum-system-version": "11.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "11pro.png",
+ "filename": "1125*2436.png",
"size": "375x812",
"subtype": "2436h",
"scale": "3x",
@@ -72,7 +70,7 @@
"minimum-system-version": "11.0",
"orientation": "landscape",
"extent": "full-screen",
- "filename": "2436_1125.png",
+ "filename": "2436*1125.png",
"size": "812x375",
"subtype": "2436h",
"scale": "3x",
@@ -82,7 +80,7 @@
"minimum-system-version": "8.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "1242_2208.png",
+ "filename": "1242*2208-1.png",
"size": "414x736",
"subtype": "736h",
"scale": "3x",
@@ -92,7 +90,7 @@
"minimum-system-version": "8.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "750_1334.png",
+ "filename": "750*1334.png",
"size": "375x667",
"subtype": "667h",
"scale": "2x",
@@ -102,7 +100,7 @@
"minimum-system-version": "8.0",
"orientation": "landscape",
"extent": "full-screen",
- "filename": "2208_1242.png",
+ "filename": "2208*1242.png",
"size": "736x414",
"subtype": "736h",
"scale": "3x",
@@ -112,7 +110,7 @@
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "2048_2732.png",
+ "filename": "2048*2732-1.png",
"size": "1024x1366",
"scale": "2x",
"idiom": "ipad"
@@ -121,7 +119,7 @@
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "640_960.png",
+ "filename": "640*960.png",
"size": "320x480",
"scale": "2x",
"idiom": "iphone"
@@ -130,7 +128,7 @@
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "640_1136.png",
+ "filename": "640*1136.png",
"size": "320x568",
"subtype": "retina4",
"scale": "2x",
@@ -140,7 +138,7 @@
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "768_1024.png",
+ "filename": "768*1024.png",
"size": "768x1024",
"scale": "1x",
"idiom": "ipad"
@@ -149,7 +147,7 @@
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
- "filename": "1536_2048.png",
+ "filename": "1536*2048.png",
"size": "768x1024",
"scale": "2x",
"idiom": "ipad"
@@ -158,7 +156,7 @@
"minimum-system-version": "7.0",
"orientation": "landscape",
"extent": "full-screen",
- "filename": "1024_768.png",
+ "filename": "1024*768.png",
"size": "1024x768",
"scale": "1x",
"idiom": "ipad"
@@ -167,7 +165,7 @@
"minimum-system-version": "7.0",
"orientation": "landscape",
"extent": "full-screen",
- "filename": "2048_1536.png",
+ "filename": "2048*1536.png",
"size": "1024x768",
"scale": "2x",
"idiom": "ipad"
@@ -175,7 +173,7 @@
{
"orientation": "portrait",
"extent": "full-screen",
- "filename": "320_480.png",
+ "filename": "320*480.png",
"size": "320x480",
"scale": "1x",
"idiom": "iphone"
@@ -183,7 +181,7 @@
{
"orientation": "portrait",
"extent": "full-screen",
- "filename": "640_960-1.png",
+ "filename": "640*960-1.png",
"size": "320x480",
"scale": "2x",
"idiom": "iphone"
@@ -191,7 +189,7 @@
{
"orientation": "portrait",
"extent": "full-screen",
- "filename": "640_1136-1.png",
+ "filename": "640*1136-1.png",
"size": "320x568",
"subtype": "retina4",
"scale": "2x",
@@ -200,7 +198,7 @@
{
"orientation": "portrait",
"extent": "to-status-bar",
- "filename": "768_1004.png",
+ "filename": "768*1004.png",
"size": "768x1004",
"scale": "1x",
"idiom": "ipad"
@@ -208,7 +206,7 @@
{
"orientation": "portrait",
"extent": "to-status-bar",
- "filename": "1536_2008.png",
+ "filename": "1536*2008.png",
"size": "768x1004",
"scale": "2x",
"idiom": "ipad"
@@ -216,7 +214,7 @@
{
"orientation": "portrait",
"extent": "full-screen",
- "filename": "768_1024-1.png",
+ "filename": "768*1024-1.png",
"size": "768x1024",
"scale": "1x",
"idiom": "ipad"
@@ -224,7 +222,7 @@
{
"orientation": "portrait",
"extent": "full-screen",
- "filename": "1536_2048-1.png",
+ "filename": "1536*2048-1.png",
"size": "768x1024",
"scale": "2x",
"idiom": "ipad"
@@ -232,7 +230,7 @@
{
"orientation": "landscape",
"extent": "to-status-bar",
- "filename": "1024_748.png",
+ "filename": "1024*748.png",
"size": "1024x748",
"scale": "1x",
"idiom": "ipad"
@@ -240,7 +238,7 @@
{
"orientation": "landscape",
"extent": "to-status-bar",
- "filename": "2048_1496.png",
+ "filename": "2048*1496.png",
"size": "1024x748",
"scale": "2x",
"idiom": "ipad"
@@ -248,7 +246,7 @@
{
"orientation": "landscape",
"extent": "full-screen",
- "filename": "1024_768-1.png",
+ "filename": "1024*768-1.png",
"size": "1024x768",
"scale": "1x",
"idiom": "ipad"
@@ -256,7 +254,7 @@
{
"orientation": "landscape",
"extent": "full-screen",
- "filename": "2048_1536-1.png",
+ "filename": "2048*1536-1.png",
"size": "1024x768",
"scale": "2x",
"idiom": "ipad"
diff --git a/ZigbeeApp20200414/Home.Ios/Home.IOS.csproj b/ZigbeeApp20200414/Home.Ios/Home.IOS.csproj
index a4285db..ebef266 100644
--- a/ZigbeeApp20200414/Home.Ios/Home.IOS.csproj
+++ b/ZigbeeApp20200414/Home.Ios/Home.IOS.csproj
@@ -77,6 +77,9 @@
<Reference Include="Shared.IOS">
<HintPath>..\Shared\DLL\IOS\Shared.IOS.dll</HintPath>
</Reference>
+ <Reference Include="Shared.IOS.TBL">
+ <HintPath>..\Shared\DLL\IOS\Shared.IOS.TBL.dll</HintPath>
+ </Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\Shared\DLL\Newtonsoft.Json.dll</HintPath>
</Reference>
@@ -84,9 +87,6 @@
<HintPath>..\packages\BouncyCastle.Crypto.dll.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
- <Reference Include="Shared.IOS.TBL">
- <HintPath>..\Shared\DLL\IOS\Shared.IOS.TBL.dll</HintPath>
- </Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
@@ -148,33 +148,6 @@
<ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\Contents.json" />
<ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1920_1080.png" />
<ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\3840_2160.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\11 Pro Max.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\11.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2688_1242.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1792_828.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\11pro.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2436_1125.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242_2208.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\750_1334.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2208_1242.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_2732.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\320_480.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960-1.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136-1.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1004.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2008.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024-1.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048-1.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_748.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1496.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768-1.png" />
- <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536-1.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40*40.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\60*60.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58*58.png" />
@@ -193,6 +166,33 @@
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120*120.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120*120-1.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\180*180.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242*2688_XS Max.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\828*1792_XR.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2688*1242.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1792*828.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1125*2436.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2436*1125.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\750*1334.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242*2208-1.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2208*1242.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048*2732-1.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640*960.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640*1136.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768*1024.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536*2048.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024*768.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048*1536.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\320*480.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640*960-1.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640*1136-1.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768*1004.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536*2008.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768*1024-1.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536*2048-1.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024*748.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048*1496.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024*768-1.png" />
+ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048*1536-1.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Language.ini" />
@@ -328,6 +328,20 @@
<BundleResource Include="Resources\Phone\MenuGroud\TopRightMenu2_5.png" />
<BundleResource Include="Resources\Phone\MenuGroud\TopRightMenu2_4.png" />
<BundleResource Include="Resources\Phone\MenuGroud\TopRightMenu2_6.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\8.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\9.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\12.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\13.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\11.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\10.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\4.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\5.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\7.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\6.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\2.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\3.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\1.png" />
+ <BundleResource Include="Resources\Phone\SceneCardIcon\0.png" />
<BundleResource Include="Resources\Phone\DeviceItem\PanelFangyueTwoButtonTable.png" />
<BundleResource Include="Resources\Phone\DeviceItem\PanelTable.png" />
<BundleResource Include="Resources\Phone\DeviceItem\PanelFangyueEightButtonTable.png" />
@@ -449,7 +463,7 @@
<BundleResource Include="Resources\Phone\DoorLock\UnLockSideslipIcon.png" />
<BundleResource Include="Resources\Phone\DoorLock\UndistributeIcon.png" />
<BundleResource Include="Resources\Phone\Logo\Logo.png" />
- <BundleResource Include="Resources\Phone\Logo\2.jpg" />
+ <BundleResource Include="Resources\Phone\Logo\2.png" />
<BundleResource Include="Resources\Phone\Item\Shared.png" />
<BundleResource Include="Resources\Phone\Item\RoomIcon.png" />
<BundleResource Include="Resources\Phone\Item\Add.png" />
@@ -480,6 +494,7 @@
<BundleResource Include="Resources\Phone\Item\ScanQRcodeIcon.png" />
<BundleResource Include="Resources\Phone\Item\LogicMsgIcon.png" />
<BundleResource Include="Resources\Phone\Item\InputAccountIcon.png" />
+ <BundleResource Include="Resources\Phone\Item\NormallyOpen.png" />
<BundleResource Include="Resources\Phone\Item\ItemSelected.png" />
<BundleResource Include="Resources\Phone\Item\UnLockSuccess.png" />
<BundleResource Include="Resources\Phone\Item\GarrisonList.png" />
diff --git a/ZigbeeApp20200414/Home.Ios/Info.plist b/ZigbeeApp20200414/Home.Ios/Info.plist
index 61e3e18..b1f348e 100755
--- a/ZigbeeApp20200414/Home.Ios/Info.plist
+++ b/ZigbeeApp20200414/Home.Ios/Info.plist
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>NSContactsUsageDescription</key>
+ <string>闇�瑕佽鍙栭�氳褰�,鐢ㄤ簬娣诲姞鑳佽揩鑱旂郴浜�</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>浣跨敤鏈熼棿闇�瑕佷娇鐢ㄥ湴鐞嗕綅缃紝浠ヤ究鎻愪緵鏈嶅姟锛屽澶╂皵</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
@@ -55,7 +57,7 @@
<string>remote-notification</string>
</array>
<key>CFBundleShortVersionString</key>
- <string>1.0.20031601</string>
+ <string>1.0.20040901</string>
<key>CFBundleVersion</key>
<string>2</string>
<key>CFBundleURLTypes</key>
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Language.ini b/ZigbeeApp20200414/Home.Ios/Resources/Language.ini
index dc4a993..cb720fa 100755
--- a/ZigbeeApp20200414/Home.Ios/Resources/Language.ini
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Language.ini
@@ -310,6 +310,8 @@
303=娓╁害鏉ユ簮
304=婀垮害鏉ユ簮
305=PM2.5鏉ユ簮
+307=涓嶈兘鍒涘缓鑷姩鍖栧父寮�妯″紡
+308=涓嶈兘鍒涘缓鑷姩鍖栧父寮�妯″紡
@@ -1408,9 +1410,9 @@
15697=妯″潡鏇存崲鐢垫睜
15698=閿欒灏濊瘯寮�閿佽鎶�
15699=鏆村姏寮�闂�
-15700=甯稿紑妯″紡寮�鍚�
-15701=甯稿紑妯″紡缁撴潫
-15702=闂ㄩ搩瑙﹀彂
+15700=甯稿紑妯″紡寮�鍚�(闂ㄩ攣瑙﹀彂)
+15701=甯稿紑妯″紡缁撴潫(闂ㄩ攣瑙﹀彂)
+15702=鏈変汉璁块棶
15703=鍘嗗彶璁板綍
15704=绫诲瀷绛涢��
15705=娓呯┖璁板綍
@@ -1794,6 +1796,12 @@
16085=涓埆鎵ц鐩爣娣诲姞澶辫触
16086=鍒濆鍖栨墽琛岀洰鏍囧け璐�
16087=淇敼鍦烘櫙鍚嶇О澶辫触
+16088=甯稿紑妯″紡寮�鍚�(缃戝叧瑙﹀彂)
+16089=甯稿紑妯″紡缁撴潫(缃戝叧瑙﹀彂)
+16090=甯稿紑妯″紡
+16091=甯稿紑妯″紡鎵嬪姩寮�鍚�
+16092=甯稿紑妯″紡鎵嬪姩鍙栨秷
+16093=甯稿紑妯″紡鍚敤{0}灏忔椂
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1900,7 +1908,7 @@
30017=zigbee涓户鍣�
30018=12鎸夐敭瑙︽懜闈㈡澘(1璺户鐢靛櫒搴曞骇)
30019=4鎸夐敭瑙︽懜闈㈡澘(鍙甫鐢垫簮搴曞骇)
-30020=绾㈠浼犳劅鍣�
+30020=Zigbee浜轰綋绉诲姩浼犳劅鍣�(鐞冨舰)
30021=1璺皟鍏夊櫒灏忔ā鍧�
30022=zigbee杞珺uspro鍗忚杞崲鍣�
30023=zigbee杞�485鍗忚杞崲鍣�
@@ -1912,13 +1920,13 @@
30029=鏂规偊鍗曞紑鍙屾帶闈㈡澘
30030=鏂规偊鍙屽紑鍥涙帶闈㈡澘
30031=鏂规偊鍥涘紑鍏帶闈㈡澘
-30032=Zigbee鏂规偊鏂伴闈㈡澘
+30032=鏂规偊鏂伴闈㈡澘
30033=鏂规偊鐜闈㈡澘
30034=绠�绾�4鎸夐敭鍦烘櫙闈㈡澘
30035=绠�绾�2璺獥甯橀潰鏉�
30036=鏂规偊/2璺獥甯橀潰鏉�-Z
30037=S-one
-
+
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
40000=閬槼
40001=鎸夐敭闈㈡澘
@@ -1928,7 +1936,7 @@
40005=闂ㄩ攣
40006=绌鸿皟
40007=涓户鍣�
-40008=鏅鸿兘绌哄叧
+40008=鏅鸿兘绌哄紑
40009=杞崲鍣�
40010=褰╃伅
40011=娓╂箍搴︿紶鎰熷櫒
@@ -1938,7 +1946,6 @@
40015=鎻掑骇
40016=鐏厜
40017=骞叉帴鐐�
-40018=鏂伴
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽�
50000=绱ф�ユ寜閽�
@@ -1978,7 +1985,7 @@
50034=Zigbee绠�绾�4鎸夐敭闈㈡澘
50035=Zigbee绠�绾�2璺潰鏉�
50036=Zigbee鏂规偊2璺獥甯橀潰鏉�
-50037=Zigbee鏅鸿兘闂ㄩ攣
+50037=Zigbee鏅鸿兘闂ㄩ攣
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囩被鍨嬪悕瀛�,浠�60000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽�
60000=浼犳劅鍣�
@@ -1992,4 +1999,31 @@
60008=杞崲鍣�
60009=绌鸿皟妯″潡
60010=鏅鸿兘闂ㄩ攣
-60011=鏂伴
\ No newline at end of file
+60011=鏂伴妯″潡
+
+;//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄坊鍔犳柊璁惧鐣岄潰閭i噷鏄剧ず鐨勫悕瀛�,浠�70000寮�濮嬧槄鈽呪槄鈽�
+70000=2鎸夐敭闈㈡澘
+70001=3鎸夐敭闈㈡澘
+70002=4鎸夐敭闈㈡澘
+70003=鏂规偊鍗曞紑鍙屾帶闈㈡澘
+70004=鏂规偊鍙屽紑鍥涙帶闈㈡澘
+70005=鏂规偊鍥涘紑鍏帶闈㈡澘
+70006=鏂规偊鏂伴灏忔ā鍧�
+70007=鏂规偊鏂伴闈㈡澘
+70008=鏂规偊鐜闈㈡澘
+70009=绐楀笜闈㈡澘
+70010=3璺户鐢靛櫒
+70011=1璺皟鍏夊櫒
+70012=绐楀笜鐢垫満
+70013=鍗峰笜鐢垫満
+70014=绌鸿皟缃戝叧
+70015=闂ㄩ攣
+70016=PIR浼犳劅鍣�
+70017=绾㈠浼犳劅鍣�
+70018=鐕冩皵浼犳劅鍣�
+70019=鐑熼浘浼犳劅鍣�
+70020=姘存蹈浼犳劅鍣�
+70021=闂ㄧ獥浼犳劅鍣�
+70022=娓╂箍搴︿紶鎰熷櫒
+70023=涓户鍣�
+70024=鏅鸿兘绌哄紑
\ No newline at end of file
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/Item/NormallyOpen.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/Item/NormallyOpen.png
new file mode 100755
index 0000000..079c5db
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/Item/NormallyOpen.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/Logo/2.jpg b/ZigbeeApp20200414/Home.Ios/Resources/Phone/Logo/2.jpg
deleted file mode 100755
index c0c53ac..0000000
--- a/ZigbeeApp20200414/Home.Ios/Resources/Phone/Logo/2.jpg
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/Logo/2.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/Logo/2.png
new file mode 100755
index 0000000..7a07804
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/Logo/2.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/0.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/0.png
new file mode 100755
index 0000000..b58dd77
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/0.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/1.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/1.png
new file mode 100755
index 0000000..8a1ddc7
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/1.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/10.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/10.png
new file mode 100755
index 0000000..d1f0d95
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/10.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/11.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/11.png
new file mode 100755
index 0000000..bb9e8b0
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/11.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/12.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/12.png
new file mode 100755
index 0000000..443e809
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/12.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/13.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/13.png
new file mode 100755
index 0000000..2f94a2e
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/13.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/2.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/2.png
new file mode 100755
index 0000000..919c660
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/2.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/3.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/3.png
new file mode 100755
index 0000000..471a280
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/3.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/4.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/4.png
new file mode 100755
index 0000000..5d5ff68
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/4.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/5.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/5.png
new file mode 100755
index 0000000..7ac9263
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/5.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/6.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/6.png
new file mode 100755
index 0000000..3a184d7
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/6.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/7.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/7.png
new file mode 100755
index 0000000..fa0050a
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/7.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/8.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/8.png
new file mode 100755
index 0000000..4bb2fdd
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/8.png
Binary files differ
diff --git a/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/9.png b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/9.png
new file mode 100755
index 0000000..1242838
--- /dev/null
+++ b/ZigbeeApp20200414/Home.Ios/Resources/Phone/SceneCardIcon/9.png
Binary files differ
diff --git a/ZigbeeApp20200414/Shared/Common/CommonPage.cs b/ZigbeeApp20200414/Shared/Common/CommonPage.cs
old mode 100755
new mode 100644
index ba3efd9..46c39a7
--- a/ZigbeeApp20200414/Shared/Common/CommonPage.cs
+++ b/ZigbeeApp20200414/Shared/Common/CommonPage.cs
@@ -57,7 +57,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string CodeIDString = "1.0.20040801";
+ public static string CodeIDString = "1.0.20041301";
/// <summary>
/// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee)
/// </summary>
diff --git a/ZigbeeApp20200414/Shared/Common/Device.cs b/ZigbeeApp20200414/Shared/Common/Device.cs
index 614dbb6..494100f 100644
--- a/ZigbeeApp20200414/Shared/Common/Device.cs
+++ b/ZigbeeApp20200414/Shared/Common/Device.cs
@@ -968,7 +968,7 @@
/// <param name="device">璁惧瀵硅薄</param>
/// <returns></returns>
public string GetDeviceEpointName(CommonDevice device)
- {
+ {
string dName = this.GetSimpleEpointName(device);
if (string.IsNullOrEmpty(dName) == false)
{
@@ -1587,7 +1587,7 @@
{
//榛樿鍊�
info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId4100;
- info.BeloneType = DeviceBeloneType.A鏅鸿兘绌哄紑;
+ info.BeloneType = DeviceBeloneType.A寮�鍏�;
info.ConcreteType = DeviceConcreteType.AirSwitch;
info.ObjectTypeNameId = 60001;//寮�鍏虫ā鍧�
@@ -1741,22 +1741,15 @@
info.ConcreteType = DeviceConcreteType.Sensor_Humidity;
}
info.ObjectTypeNameId = 60000;//浼犳劅鍣�
- }
-
- //14鏂伴
- //else if (dicType.ContainsKey(DeviceType.FreshAir) == true)
- //{
- // info. = R.MyInternationalizationString.uDeviceBelongId18;
- // info.BeloneType = DeviceBeloneType.;//鏂伴闈㈡澘涓殑绗竴鍥炶矾鏄柊椋庤澶�
- // info.ConcreteType = DeviceConcreteType.ButtonPanel_FangyueFreshAir;
- // info.ObjectTypeNameId = 60011;//鏂伴
- //}
- //int value = (int)info.BeloneType;
- //if (dicDeviceAllNameID.ContainsKey("uDeviceBelongId" + value) == true)
- //{
- // //璁惧鎵�灞炵被鍨嬬殑缈昏瘧鍚嶅瓧
- // info.BeloneTextId = dicDeviceAllNameID["uDeviceBelongId" + value];
- //}
+ }
+
+ int value = (int)info.BeloneType;
+ if (dicDeviceAllNameID.ContainsKey("uDeviceBelongId" + value) == true)
+ {
+ //璁惧鎵�灞炵被鍨嬬殑缈昏瘧鍚嶅瓧
+ info.BeloneTextId = dicDeviceAllNameID["uDeviceBelongId" + value];
+ }
+
return info;
}
@@ -1892,12 +1885,7 @@
return Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom);
}
var room = HdlRoomLogic.Current.GetRoomById(this.dicDeviceRoomId[device.DeviceAddr]);
- if (room != null)
- {
- return room.Name;
- }
- //鏈垎閰嶅尯鍩�
- return Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom);
+ return HdlRoomLogic.Current.GetFloorRoomName(room);
}
/// <summary>
@@ -2032,12 +2020,15 @@
//杩欎釜璁惧涓嶈浜�
return false;
}
- if (i_device.Type == DeviceType.OnOffOutput && i_device.DfunctionType == DeviceFunctionType.A鏈畾涔�)
+ if (i_device.Type == DeviceType.OnOffOutput || i_device.Type == DeviceType.AirSwitch)
{
//2020.03.23杩藉姞寮忔牱:鏈寚瀹氱被鍨嬬殑缁х數鍣�,涓嶆樉绀�
- return false;
- }
- //濡傛灉鏄柊椋庨潰鏉跨殑鏂伴璁惧,鍒欎笉鏄剧ず
+ if (i_device.DfunctionType == DeviceFunctionType.A鏈畾涔�)
+ {
+ return false;
+ }
+ }
+ //濡傛灉鏄柊椋庨潰鏉跨殑鏂伴璁惧,鍒欎笉鏄剧ず
else if (i_device.Type == DeviceType.FreshAir)
{
var myInfoType = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
@@ -2210,7 +2201,7 @@
var listCheck = new HashSet<string>();
Action<string, string> getDeviceAction = (topic, message) =>
{
- if (topic == gatewayID + "/" + "DeviceInfoRespon")
+ if (topic == gatewayID + "/DeviceInfoRespon")
{
try
{
@@ -2258,6 +2249,9 @@
//璁惧鍏ㄩ儴鎺ユ敹瀹屾垚
canBreak = true;
}
+ }
+ else if (topic == gatewayID + "/DeviceInfoResponEnd")
+ {
}
};
@@ -2478,10 +2472,10 @@
else if (deviceType == DeviceType.WindowCoveringDevice) { device = new Rollershade(); }
else if (deviceType == DeviceType.IASZone) { device = new IASZone(); }
else if (deviceType == DeviceType.Repeater) { device = new Repeater(); }
- else if (deviceType == DeviceType.Thermostat) { device = new AC(); }
+ else if (deviceType == DeviceType.Thermostat) { device = new AC(); }
else if (deviceType == DeviceType.FreshAir) { device = new FreshAir(); }
else if (deviceType == DeviceType.DoorLock) { device = new DoorLock(); }
- else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); }
+ else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); }
else if (deviceType == DeviceType.FreshAirHumiditySensor) { device = new HumiditySensor(); }
else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); }
else { return null; }
@@ -2572,16 +2566,24 @@
this.dicDeviceModelIdEnum["MSPIR01-ZB.10"] = "1200-1200-60000";//pir浼犳劅鍣�220
//=========鈽呪槄瀹夐槻绫讳紶鎰熷櫒绫�(1300-2299)鈽呪槄=========
+ //杩欓噷鏄害涔愬厠鐨�
this.dicDeviceModelIdEnum["MULTI-GASE--EA07"] = "1300-1300-60000";//鐕冩皵浼犳劅鍣�
this.dicDeviceModelIdEnum["MULTI-MECI--EA01"] = "1301-1300-60000";//闂ㄧ獥纾佷紶鎰熷櫒
this.dicDeviceModelIdEnum["MULTI-FIRE--EA05"] = "1302-1300-60000";//鐑熼浘浼犳劅鍣�
this.dicDeviceModelIdEnum["MULTI-MOTI--EA04"] = "1303-1300-60000";//绾㈠浼犳劅鍣�
this.dicDeviceModelIdEnum["MULTI-WATE--EA02"] = "1304-1300-60000";//姘存蹈浼犳劅鍣�
this.dicDeviceModelIdEnum["MULTI-BURO--EA06"] = "1305-1300-60000";//绱ф�ユ寜閿�
+ //杩欓噷鏄渤涓滅殑
+ this.dicDeviceModelIdEnum["MSG01/M-ZB.10"] = "1300-1300-60000";//鐕冩皵浼犳劅鍣�
+ this.dicDeviceModelIdEnum["MSDC01/M-ZB.10"] = "1301-1300-60000";//闂ㄧ獥纾佷紶鎰熷櫒
+ this.dicDeviceModelIdEnum["MSS01/M-ZB.10"] = "1302-1300-60000";//鐑熼浘浼犳劅鍣�
+ this.dicDeviceModelIdEnum["MSPIR01/M-ZB.10"] = "1303-1300-60000";//绾㈠浼犳劅鍣�
+ this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1304-1300-60000";//姘存蹈浼犳劅鍣�
+ this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1300-60000";//绱ф�ユ寜閿�
//=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄=========
this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3璺户鐢靛櫒灏忔ā鍧�
- this.dicDeviceModelIdEnum["MFA01-ZB1.0"] = "2310-2300-60001";//鏂规偊鏂伴灏忔ā鍧�
+ this.dicDeviceModelIdEnum["MFA01-ZB.10"] = "2310-2300-60011";//鏂规偊鏂伴灏忔ā鍧�
//=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄=========
this.dicDeviceModelIdEnum["MPD0101-ZB.10"] = "2500-2500-60007";//1璺皟鍏夊櫒灏忔ā鍧�
diff --git a/ZigbeeApp20200414/Shared/Common/ResultStatus.cs b/ZigbeeApp20200414/Shared/Common/ResultStatus.cs
deleted file mode 100755
index e1c8d98..0000000
--- a/ZigbeeApp20200414/Shared/Common/ResultStatus.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-锘縰sing System;
-namespace Shared.Common
-{
- [System.Serializable]
- public class ResultStatus
- {
- /// <summary>
- /// 鐘舵�佺爜
- /// </summary>
- public int Code;
-
- /// <summary>
- /// 鐘舵��
- /// </summary>
- public string Status;
-
- /// <summary>
- /// 褰撳墠璐︽埛ID
- /// </summary>
- public int ID;
-
- /// <summary>
- /// 淇″彿鍊�
- /// </summary>
- public int Flag;
-
- /// <summary>
- /// 璐︽埛绫诲瀷
- /// </summary>
- public int AccountType;
-
- /// <summary>
- /// 涓昏处鍙稩D
- /// </summary>
- public int MasterID;
- }
-}
diff --git a/ZigbeeApp20200414/Shared/DLL/Android/Shared.Droid.dll b/ZigbeeApp20200414/Shared/DLL/Android/Shared.Droid.dll
index 6c93098..81ac7d9 100755
--- a/ZigbeeApp20200414/Shared/DLL/Android/Shared.Droid.dll
+++ b/ZigbeeApp20200414/Shared/DLL/Android/Shared.Droid.dll
Binary files differ
diff --git a/ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.TBL.dll b/ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.TBL.dll
old mode 100644
new mode 100755
Binary files differ
diff --git a/ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.dll b/ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.dll
index bdcee20..0705722 100755
--- a/ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.dll
+++ b/ZigbeeApp20200414/Shared/DLL/IOS/Shared.IOS.dll
Binary files differ
diff --git a/ZigbeeApp20200414/Shared/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp20200414/Shared/Phone/Category/AddOrEditorSceneForm.cs
index 220a7d5..2e2916f 100755
--- a/ZigbeeApp20200414/Shared/Phone/Category/AddOrEditorSceneForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Category/AddOrEditorSceneForm.cs
@@ -182,7 +182,8 @@
btnZhezhao.Height = btnScenePic.Height;
btnZhezhao.Y = btnScenePic.Y;
btnZhezhao.Gravity = Gravity.CenterHorizontal;
- btnZhezhao.Radius = btnScenePic.Radius;
+ btnZhezhao.Radius = (uint)Application.GetRealHeight(17);
+ btnZhezhao.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor;
framePicBack.AddChidren(btnZhezhao);
//鍒嗕韩鐨勫満鏅笉鑳界紪杈�
@@ -399,8 +400,6 @@
var btnEditor = rowDevice.AddEditorControl();
btnEditor.ButtonClickEvent += (sender, e) =>
{
- //闅愯棌鍙虫粦鑿滃崟
- rowDevice.HideMenu();
if (device.Type == DeviceType.DimmableLight//璋冨厜鍣�
|| device.Type == DeviceType.ColorDimmableLight)//褰╃伅
{
@@ -590,8 +589,6 @@
var btnEditor = rowDelay.AddEditorControl();
btnEditor.ButtonClickEvent += (sender, e) =>
{
- //闅愯棌鍙虫粦鑿滃崟
- rowDelay.HideMenu();
//寤舵椂鏃堕棿閫夋嫨
var form = new AdjustTargetAddDelayTimeForm();
form.AddForm(data.DelayTime);
@@ -942,11 +939,9 @@
//榛樿鍥惧簱
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.LocalPicture), () =>
{
- var localPic = new Device.Room.AddRoomSelectPicByLocal();
- UserView.HomePage.Instance.AddChidren(localPic);
- UserView.HomePage.Instance.PageIndex += 1;
- localPic.Show();
- localPic.action = (imgPath) =>
+ var form = new SelectLocalSceneImageForm();
+ form.AddForm();
+ form.FinishSelectEvent = (imgPath) =>
{
if (string.IsNullOrEmpty(imgPath) == true)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs b/ZigbeeApp20200414/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs
index 5f1d3e6..c88d512 100755
--- a/ZigbeeApp20200414/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs
@@ -39,6 +39,11 @@
private void InitMiddleFrame(int i_delayTime)
{
int selectTime = i_delayTime;
+ if (selectTime == 0)
+ {
+ //榛樿1绉�
+ selectTime = 1;
+ }
//鍥炬爣绗竴灞傚簳鑹�
var frameFirstBack = new FrameLayout();
@@ -110,8 +115,13 @@
var listTemp2 = new List<string>() { "00" + strSecond };
listSecond.Add(listTemp2);
+ int firstIndex = selectTime / 60;
+ int secondIndex = selectTime % 60;
+ //鍥犱负0鍒嗙殑鏃跺�欙紝瀹冩槸浠�1绉掑紑濮嬬殑锛屾墍浠ュ畠鐨勭储寮曢渶瑕�-1
+ if (firstIndex == 0) { secondIndex--; }
+
pickView.setPicker(listfirst, listSecond);
- pickView.setCurrentItems(selectTime / 60, selectTime % 60, 0);
+ pickView.setCurrentItems(firstIndex, secondIndex, 0);
pickView.OnSelectChangeEvent += (value1, value2, value3) =>
{
int minute = Convert.ToInt32(listfirst[value1].Substring(0, 2));
diff --git a/ZigbeeApp20200414/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp20200414/Shared/Phone/Category/CategoryMainForm.cs
old mode 100644
new mode 100755
index e91ac48..6af7fad
--- a/ZigbeeApp20200414/Shared/Phone/Category/CategoryMainForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Category/CategoryMainForm.cs
@@ -514,11 +514,6 @@
{
cardContr = new Controls.DeviceAcRowControl(listView.rowSpace / 2);
}
- //鏂伴
- //else if (device.Type == DeviceType.FreshAir)
- //{
- // cardContr = new Controls.DeviceAcRowControl(listView.rowSpace / 2);
- //}
//褰╃伅(璋冨厜鍣�)
else if (device.Type == DeviceType.DimmableLight)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs b/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
index 4dc0ec2..04dc6ed 100755
--- a/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
@@ -142,8 +142,6 @@
var btnEditor = this.AddEditorControl();
btnEditor.ButtonClickEvent += (sender, e) =>
{
- //鍏抽棴宸︽粦鑿滃崟
- this.HideMenu();
var detailInfo = new MainPage.DeviceDetailInfoForm();
detailInfo.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom);
detailInfo.FormCloseEvent += (curDevice, curRoom) =>
diff --git a/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs b/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
index b23860a..325d9ac 100755
--- a/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs
@@ -122,7 +122,7 @@
/// <returns></returns>
public override bool CheckIsOpenStatu(CommonDevice i_device)
{
- return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 10;
+ return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 0;
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/Category/SelectLocalSceneImageForm.cs b/ZigbeeApp20200414/Shared/Phone/Category/SelectLocalSceneImageForm.cs
new file mode 100755
index 0000000..b2de711
--- /dev/null
+++ b/ZigbeeApp20200414/Shared/Phone/Category/SelectLocalSceneImageForm.cs
@@ -0,0 +1,119 @@
+锘縰sing Shared.Common;
+using Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.Category
+{
+ /// <summary>
+ /// 閫夋嫨鏈湴鍦烘櫙鍥剧墖鐨勭晫闈�
+ /// </summary>
+ public class SelectLocalSceneImageForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 缁撴潫閫夋嫨鐨勪簨浠�(鍥剧墖鍚嶅瓧)
+ /// </summary>
+ public Action<string> FinishSelectEvent = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ //鍒楄〃鎺т欢
+ var listView = new VerticalListControl();
+ listView.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listView);
+
+ int picHeight = this.GetPictrueRealSize(220);
+ int picWidth = this.GetPictrueRealSize(463);
+ int leftRightSpace = this.GetPictrueRealSize(40);
+ int space = listView.Width - leftRightSpace * 2 - picWidth * 2;
+
+ //涓�鍏�14寮犲浘鐗�
+ FrameLayout frameRow = null;
+ for (int i = 0; i < 14; i++)
+ {
+ //鍥剧墖
+ var btnIcon = new ImageView();
+ btnIcon.Y = Application.GetRealHeight(58);
+ btnIcon.Width = picWidth;
+ btnIcon.Height = picHeight;
+ btnIcon.ImagePath = $"SceneIcon/{i}.png";
+ btnIcon.Radius = (uint)Application.GetRealHeight(17);
+
+ if (i % 2 == 0)
+ {
+ btnIcon.X = leftRightSpace;
+
+ //琛屾帶浠�
+ frameRow = new FrameLayout();
+ frameRow.Height = picHeight + Application.GetRealHeight(58);
+ listView.AddChidren(frameRow);
+ }
+ else
+ {
+ btnIcon.X = leftRightSpace + picWidth + space;
+ }
+ frameRow.AddChidren(btnIcon);
+
+ //鍥剧墖閬僵
+ var btnZhezhao = new FrameLayout();
+ btnZhezhao.Width = btnIcon.Width;
+ btnZhezhao.Height = btnIcon.Height;
+ btnZhezhao.Y = btnIcon.Y;
+ btnZhezhao.X = btnIcon.X;
+ btnZhezhao.Radius = (uint)Application.GetRealHeight(17);
+ btnZhezhao.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor;
+ frameRow.AddChidren(btnZhezhao);
+ btnZhezhao.SetViewShadow(true);
+ btnZhezhao.MouseUpEventHandler += (sender, e) =>
+ {
+ //缁撴潫閫夋嫨鐨勪簨浠�
+ this.FinishSelectEvent?.Invoke(btnIcon.ImagePath);
+ this.CloseForm();
+ };
+ }
+
+ //搴曢儴闂磋窛
+ var frameTemp = new FrameLayout();
+ frameTemp.Height = Application.GetRealHeight(58);
+ listView.AddChidren(frameTemp);
+ }
+
+ #endregion
+
+ #region 鈻� 鐣岄潰鍏抽棴___________________________
+
+ /// <summary>
+ /// 鐣岄潰鍏抽棴
+ /// </summary>
+ public override void CloseFormBefore()
+ {
+ this.FinishSelectEvent = null;
+
+ base.CloseFormBefore();
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp20200414/Shared/Phone/CommonForm/CommonFormBase.cs b/ZigbeeApp20200414/Shared/Phone/CommonForm/CommonFormBase.cs
index 6a909a9..5c002e7 100755
--- a/ZigbeeApp20200414/Shared/Phone/CommonForm/CommonFormBase.cs
+++ b/ZigbeeApp20200414/Shared/Phone/CommonForm/CommonFormBase.cs
@@ -277,6 +277,16 @@
{
}
+ /// <summary>
+ /// 璁$畻鍥剧墖鐨勭湡瀹為珮瀹藉害
+ /// </summary>
+ /// <param name="i_size"></param>
+ /// <returns></returns>
+ public int GetPictrueRealSize(int i_size)
+ {
+ return HdlControlLogic.Current.GetPictrueRealSize(i_size);
+ }
+
#endregion
#region 鈻� 鍙嶅皠鏂规硶___________________________
diff --git a/ZigbeeApp20200414/Shared/Phone/CommonForm/EditorCommonForm.cs b/ZigbeeApp20200414/Shared/Phone/CommonForm/EditorCommonForm.cs
index 92435b1..d0417ce 100755
--- a/ZigbeeApp20200414/Shared/Phone/CommonForm/EditorCommonForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/CommonForm/EditorCommonForm.cs
@@ -15,6 +15,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 杩斿洖鎸夐敭鐨勭偣鍑讳簨浠�(濡傛灉瀹炵幇姝や簨浠�,鍒欏簳灞傜殑浜嬩欢灏嗕笉浼氬啀瑙﹀彂)
+ /// </summary>
+ public Action<BackViewControl> BackButtonClickEvent = null;
+ /// <summary>
/// TopMenuFrameLayout
/// </summary>
public FrameLayout topMenuFrameLayout = null;
@@ -124,6 +128,12 @@
btnBack.InitControl();
btnBack.ButtonClickEvent += (sender, e) =>
{
+ if (this.BackButtonClickEvent != null)
+ {
+ //濡傛灉瀹炵幇姝や簨浠�,鍒欏簳灞傜殑浜嬩欢灏嗕笉浼氬啀瑙﹀彂
+ BackButtonClickEvent(btnBack);
+ return;
+ }
//鐢婚潰鍏抽棴
this.CloseForm();
};
@@ -210,6 +220,8 @@
//宸︽粦浣胯兘
this.ScrollEnabled = true;
+ this.BackButtonClickEvent = null;
+
this.m_parameter = null;
//娓呯┖bodyFrame
this.ClearBodyFrame();
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp20200414/Shared/Phone/Device/AC/ACControl.cs
deleted file mode 100755
index 04908bc..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/AC/ACControl.cs
+++ /dev/null
@@ -1,1467 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using ZigBee.Device;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.UserView;
-using Shared.Phone.Device.DeviceLogic;
-
-namespace Shared.Phone.Device.AC
-{
- public class ACControl : FrameLayout,ZigBee.Common.IStatus
- {
- #region 鈼� 鍙橀噺__________________________
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice, Common.Room> action;
-
- /// <summary>
- /// 鏀惰棌鎸夐挳
- /// </summary>
- private Button collectionBtn;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private CommonDevice device;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
-
- /// <summary>
- /// 鎴块棿
- /// </summary>
- private Button roomBtn;
- /// <summary>
- /// 鎴块棿鍚�
- /// </summary>
- private Button roomName;
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
-
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// 瀹ゆ俯
- /// </summary>
- private Button indoorTemperatureBtn;
-
- /// <summary>
- /// OpenOrUpBtn
- /// </summary>
- public Button OpenOrUpBtn;
- /// <summary>
- /// OpenOrUpBtn
- /// </summary>
- public Button CloseOrDownBtn;
- /// <summary>
- /// StopBtn
- /// </summary>
- public Button StopBtn;
-
-
- /// <summary>
- /// 褰撳墠妯″紡
- /// </summary>
- private Button currentModeBtn;
- /// <summary>
- /// 娣诲姞娓╁害
- /// </summary>
- private Button addTemperatureBtn;
- /// <summary>
- /// 闄嶄綆娓╁害
- /// </summary>
- private Button reduceTemperatureBtn;
- /// <summary>
- /// 绌鸿皟妯″紡
- /// </summary>
- private Button modeBtn;
- /// <summary>
- /// 寮�鍚垨鍏抽棴
- /// </summary>
- private Button switchBtn;
- /// <summary>
- /// 椋庨�熸ā寮�
- /// </summary>
- private Button fanModeBtn;
- /// <summary>
- /// 鎵妯″紡
- /// </summary>
- private Button FanSwingModeBtn;
- /// <summary>
- /// 椋庨�熼�夋嫨瑙嗗浘
- /// </summary>
- private Dialog fanModeDialog;
- /// <summary>
- /// 妯″紡閫夋嫨瑙嗗浘
- /// </summary>
- private Dialog acModeDialog;
-
- /// <summary>
- /// 浼犺繃鏉ョ殑ac
- /// </summary>
- private ZigBee.Device.AC ac;
- /// <summary>
- /// mArcScaleSeekBar
- /// </summary>
- private ArcScaleSeekBar mArcScaleSeekBar = new ArcScaleSeekBar { };
- /// <summary>
- /// 娓呮磥鐘舵��
- /// </summary>
- private LeftIconButtonRow cleanStatu;
-
- /// <summary>
- /// IsDrawerLockMode
- /// </summary>
- public bool IsDrawerLockMode;
- #endregion
-
- #region 鈼� 鎺ュ彛___________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- if (deviceUI == null)
- {
- return;
- }
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
-
- if (common.DeviceStatusReport.CluterID == 513)
- {
- var attriButeList = common.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
- deviceUI.DeviceStatusReport = common.DeviceStatusReport;
- foreach(var attList in attriButeList)
- {
- switch (attList.AttributeId)
- {
- case 0:
- ac.currentLocalTemperature = attList.AttriButeData / 100;
- ac.LastDateTime = DateTime.Now;
- indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} 鈩�";
- break;
- case 17:
- ac.currentCoolingSetpoint = attList.AttriButeData / 100;
- if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
- {
- mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
- }
- ac.LastDateTime = DateTime.Now;
- break;
- case 18:
- ac.currentHeatingSetpoint = attList.AttriButeData / 100;
- if (ac.currentSystemMode == 4)
- {
- mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
- }
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentAutoSetpoint = attList.AttriButeData / 100;
- if (ac.currentSystemMode == 1)
- {
- mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
- }
- ac.LastDateTime = DateTime.Now;
- break;
- case 28:
- //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
- //Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8
- ac.currentSystemMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- if (ac.currentSystemMode == 0)
- {
- switchBtn.IsSelected = false;
- modeBtn.IsSelected = false;
- fanModeBtn.IsSelected = false;
- FanSwingModeBtn.IsSelected = false;
- mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
- //濡傛灉鏄叧闂┖璋冪殑璇�,鐩存帴鍙樻殫鍗冲彲
- return;
- }
- else if (ac.currentSystemMode == 1 || ac.currentSystemMode == 3 || ac.currentSystemMode == 4 || ac.currentSystemMode == 7 || ac.currentSystemMode == 8)
- {
- switchBtn.IsSelected = true;
- modeBtn.IsSelected = true;
- fanModeBtn.IsSelected = true;
- FanSwingModeBtn.IsSelected = true;
- mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
- }
- modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode);
- modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode);
- currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode);
- mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
- mArcScaleSeekBar.IsClickable = ACControlBase.IsOpen(ac);
- break;
- case 4097:
- //杩囪檻缃戞竻娲楁爣蹇�:42
- ac.CleanStatu = attList.AttriButeData == 42;
- cleanStatu.Visible = ac.CleanStatu;
- break;
- }
- }
- }
-
- if (common.DeviceStatusReport.CluterID == 514)
- {
- var attriButeList = common.DeviceStatusReport.AttriBute;
- ac.DeviceStatusReport = common.DeviceStatusReport;
- foreach(var attList in attriButeList)
- {
- switch (attList.AttributeId)
- {
- case 0:
- //椋庢墖褰撳墠鐨勫伐浣滄ā寮� 1=Low 2=Medium 3=High
- ac.currentFanMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- fanModeBtn.IsSelected = true;
- fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode);
- fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode);
- break;
- case 4096:
- //椋庢墖褰撳墠鐨勬壂椋庢ā寮�
- ac.currentFanSwingMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- FanSwingModeBtn.IsSelected = true;
- FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
- FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
- break;
- }
- }
- }
- //***鏂版敼 * **璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID = 3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- else if (common.DeviceStatusReport.CluterID == 3)
- {
- ac.IsOnline = 1;
- switchBtn.IsSelected = true;
- ac.LastDateTime = DateTime.Now;
- }
-
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- if (deviceUI.Type == DeviceType.Thermostat)
- {
- ac.IsOnline = common.IsOnline;
- ac.LastDateTime = DateTime.Now;
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- }
-
- #endregion
-
- #region 鈼� 鏋勯�犳柟娉昣_______________________
-
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public ACControl()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- ZigBee.Device.ZbGateway.StatusList.Add(this);
- HomePage.Instance.ScrollEnabled = false;
-
- }
-
- #endregion
-
- #region 鈼� 閲嶅啓绉婚櫎鏂规硶____________________
-
- /// <summary>
- /// Removes from parent.
- /// </summary>
- public override void RemoveFromParent()
- {
- ZigBee.Device.ZbGateway.StatusList.Remove(this);
- action(device, room);
- action = null;
- RemoveUpdateControlDeviceStatuAction();
- HomePage.Instance.ScrollEnabled = true;
- if (IsDrawerLockMode)
- {
- CommonPage.Instance.IsDrawerLockMode = false;
- }
- base.RemoveFromParent();
- }
-
- #endregion
-
- #region 鈼� 鏄剧ず鐣岄潰________________________
-
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="dev">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(CommonDevice dev, Shared.Common.Room room)
- {
- device = dev;
- zbGateway = this.device.Gateway;
- this.room = room;
- this.ac = device as ZigBee.Device.AC;
- AddTop();
-
- AddBodyView(device);
-
- if (ac.Gateway == null)
- {
- return;
- }
- if (ac.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- UserView.UserHomeView.ReadStatus(ac, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(device);
- }
- }
-
- if (UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device)==false)
- {
- collectionBtn.IsSelected = false;
- }
- else
- {
- collectionBtn.IsSelected = true;
- }
-
- BindEvent();
- }
-
- #endregion
-
- #region 鈼� Add____________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var moreBtn = new Button
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png"
- };
- top.topView.AddChidren(moreBtn);
-
- moreBtn.MouseUpEventHandler += More;
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var itemView = new FrameLayout()
- {
- Y = Application.GetRealHeight(115),
- Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1457),
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(itemView);
-
- cleanStatu = new LeftIconButtonRow(400, 80, 0, 20);
- itemView.AddChidren(cleanStatu);
- cleanStatu.Init("AC/AC_TIP.png", "AC/AC_TIP.png", Language.StringByID(R.MyInternationalizationString.NeedCleanAC), false);
- cleanStatu.Visible = false;
-
- collectionBtn = new Button()
- {
- X = Application.GetRealWidth(850),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- itemView.AddChidren(collectionBtn);
-
- var deviceNameBtn = new Button()
- {
- Y = Application.GetRealHeight(184),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15,
- IsBold=true
- };
- itemView.AddChidren(deviceNameBtn);
-
- indoorTemperatureBtn = new Button
- {
- Y = Application.GetRealHeight(256),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} 鈩�",
- TextSize=10
- };
- itemView.AddChidren(indoorTemperatureBtn);
-
- var mArcScaleSeekBarFL = new FrameLayout
- {
- Y = Application.GetRealHeight(412),
- Width = Application.GetMinRealAverage(671),
- Height = Application.GetMinRealAverage(671),
- Gravity = Gravity.CenterHorizontal
- };
- itemView.AddChidren(mArcScaleSeekBarFL);
-
- mArcScaleSeekBar = new ArcScaleSeekBar
- {
- Width = Application.GetMinRealAverage(671),
- Height = Application.GetMinRealAverage(671),
- Gravity = Gravity.CenterHorizontal,
- MinValue = ACControlBase.Temperature_Low,
- MaxValue = ACControlBase.Temperature_High,
- Progress = ACControlBase.GetCurrentModeTemperature(ac),
- IsClickable = ACControlBase.IsOpen(ac),
- ProgressBarUnitSring = string.Empty
- };
- mArcScaleSeekBarFL.AddChidren(mArcScaleSeekBar);
- if(ACControlBase.IsOpen(ac))
- {
- mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
- }
- else
- {
- mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
- }
- mArcScaleSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
- {
- if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
- {
- ac.currentCoolingSetpoint = e;
- ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
- }
- else if (ac.currentSystemMode == 4)
- {
- ac.currentHeatingSetpoint = e;
- ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
- }
- else if (ac.currentSystemMode == 1)
- {
- ac.currentAutoSetpoint = e;
- ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
- }
- };
-
- currentModeBtn = new Button()
- {
- Y = Application.GetMinRealAverage(187),
- Height = Application.GetRealHeight(50),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- Gravity = Gravity.CenterHorizontal,
- Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode),
- TextSize = 12
- };
- mArcScaleSeekBarFL.AddChidren(currentModeBtn);
-
- reduceTemperatureBtn = new Button()
- {
- X = Application.GetMinRealAverage(132),
- Y = Application.GetMinRealAverage(268),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- UnSelectedImagePath = "AC/Reduce.png"
- };
- mArcScaleSeekBarFL.AddChidren(reduceTemperatureBtn);
-
- addTemperatureBtn = new Button()
- {
- X = Application.GetMinRealAverage(452),
- Y = Application.GetMinRealAverage(268),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- UnSelectedImagePath = "AC/Add.png"
- };
- mArcScaleSeekBarFL.AddChidren(addTemperatureBtn);
-
- var uintBtn = new Button
- {
- Y = Application.GetMinRealAverage(369),
- Height = Application.GetRealHeight(60),
- Width = Application.GetRealWidth(100),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- Gravity = Gravity.CenterHorizontal,
- Text = "鈩�",
- TextSize = 18
- };
- mArcScaleSeekBarFL.AddChidren(uintBtn);
-
- FanSwingModeBtn = new Button()
- {
- X = Application.GetRealWidth(156),
- Y = Application.GetRealHeight(1086),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode),
- SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode),
- IsSelected = ACControlBase.IsOpen(ac)
- };
-
- modeBtn = new Button()
- {
- X = Application.GetRealWidth(346),
- Y = Application.GetRealHeight(1086),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode),
- SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode),
- IsSelected = ACControlBase.IsOpen(ac)
- };
- itemView.AddChidren(modeBtn);
-
- switchBtn = new Button()
- {
- X = Application.GetRealWidth(536),
- Y = Application.GetRealHeight(1086),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- UnSelectedImagePath = "AC/OpenOrClose.png",
- SelectedImagePath = "AC/OpenOrCloseSelected.png",
- IsSelected = ACControlBase.IsOpen(ac)
- };
- itemView.AddChidren(switchBtn);
-
- fanModeBtn = new Button()
- {
- X = Application.GetRealWidth(729),
- Y = Application.GetRealHeight(1086),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode),
- SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode),
- IsSelected = ACControlBase.IsOpen(ac)
- };
- itemView.AddChidren(fanModeBtn);
-
- if (ac.UseSwingFunction)
- {
- itemView.AddChidren(FanSwingModeBtn);
- }
- else
- {
- modeBtn.X = Application.GetRealWidth(207);
- switchBtn.X = Application.GetRealWidth(444);
- fanModeBtn.X = Application.GetRealWidth(677);
- }
-
-
- var roomBG = new Button
- {
- Y = Application.GetRealHeight(1322 - 50),
- Height = Application.GetRealHeight(138 + 50),
- BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
- };
- itemView.AddChidren(roomBG);
-
- var roomBG2 = new Button
- {
- Y = Application.GetRealHeight(1322 - 50),
- Height = Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- itemView.AddChidren(roomBG2);
-
- roomBtn = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(1351),
- Width = Application.GetMinReal(80),
- Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png"
- };
- itemView.AddChidren(roomBtn);
-
- roomName = new Button()
- {
- X = Application.GetRealWidth(150),
- Y = Application.GetRealHeight(1368),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(50),
- Text = room.Name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize=12
- };
- itemView.AddChidren(roomName);
- }
-
- #endregion
-
- #region 鈼� 缁戝畾浜嬩欢________________________
-
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- switchBtn.MouseUpEventHandler += Switch_MouseUpEvent;
- collectionBtn.MouseUpEventHandler += Collection;
- fanModeBtn.MouseUpEventHandler += ShowChangeFan_MouseUpEvent;
- modeBtn.MouseUpEventHandler += ShowChangeMode_MouseUpEvent;
- FanSwingModeBtn.MouseUpEventHandler += ShowChangeFanSwing_MouseUpEvent;
- reduceTemperatureBtn.MouseUpEventHandler += Reduce_MouseUpEvent;
- addTemperatureBtn.MouseUpEventHandler += Add_MouseUpEvent;
- }
-
- #endregion
-
- #region 鈼� 寮�鍏砡_________________________
-
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void Switch_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- switchBtn.IsSelected = !switchBtn.IsSelected;
- mArcScaleSeekBar.IsClickable = switchBtn.IsSelected;
- if (switchBtn.IsSelected == true)
- {
- ac.Open();
- modeBtn.IsSelected = true;
- fanModeBtn.IsSelected = true;
- FanSwingModeBtn.IsSelected = true;
- mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
- }
- else
- {
- ac.Close();
- modeBtn.IsSelected = false;
- fanModeBtn.IsSelected = false;
- FanSwingModeBtn.IsSelected = false;
- mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
- }
- }
-
- #endregion
-
- #region 鈼� 鍒囨崲椋庨�焈______________________
-
- /// <summary>
- /// 鍒囨崲椋庨��
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ShowChangeFan_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- int fanItem_X = 80;
- int fanItem_Height = 150;
- int fanItem_Width = 449;
-
- fanModeDialog = new Dialog();
- fanModeDialog.Show();
- var closeBGview = new FrameLayout();
- fanModeDialog.AddChidren(closeBGview);
- closeBGview.MouseUpEventHandler += (send1, e1) =>
- {
- fanModeDialog.Close();
- };
-
- var changeFanModeBG = new Button()
- {
- X = Application.GetRealWidth(600),
- Y = Application.GetRealHeight(750),
- Height = Application.GetRealHeight(625),
- Width = Application.GetRealWidth(fanItem_Width),
- UnSelectedImagePath = "AC/SelectedFanModeBG.png"
- };
- closeBGview.AddChidren(changeFanModeBG);
-
- var changeFanModeFL = new VerticalScrolViewLayout()
- {
- X = Application.GetRealWidth(600),
- Y = Application.GetRealHeight(750),
- Height = Application.GetRealHeight(600),
- Width = Application.GetRealWidth(fanItem_Width),
- ScrollEnabled=false,
- VerticalScrollBarEnabled=false
- };
- closeBGview.AddChidren(changeFanModeFL);
-
- var changeFanBtn = new Button()
- {
- X = Application.GetRealWidth(fanItem_X),
- Width = Application.GetRealWidth(fanItem_Width - fanItem_X),
- Height = Application.GetRealHeight(fanItem_Height),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextID = R.MyInternationalizationString.SelectFanMode,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=14,
- IsBold=true
- };
- changeFanModeFL.AddChidren(changeFanBtn);
-
- var fan_Low = new LeftIconButtonRow();
- fan_Low.Tag = ZigBee.Device.AC.FanMode.Low;
- fan_Low.Init("AC/Fan_Low.png", "AC/Fan_LowSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Low));
- fan_Low.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_FanModel);
- changeFanModeFL.AddChidren(fan_Low);
-
- var fan_Middle = new LeftIconButtonRow();
- fan_Middle.Tag = ZigBee.Device.AC.FanMode.Medium;
- fan_Middle.Init("AC/Fan_Middle.png", "AC/Fan_MiddleSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Middle));
- fan_Middle.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_FanModel);
- changeFanModeFL.AddChidren(fan_Middle);
-
- var fan_Height = new LeftIconButtonRow();
- fan_Height.Tag = ZigBee.Device.AC.FanMode.High;
- fan_Height.Init("AC/Fan_Height.png", "AC/Fan_HeightSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Height), false);
- fan_Height.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_FanModel);
- changeFanModeFL.AddChidren(fan_Height);
-
- fan_Low.ButtonClickEvent += ChangeFan_MouseUpEvent;
- fan_Middle.ButtonClickEvent += ChangeFan_MouseUpEvent;
- fan_Height.ButtonClickEvent += ChangeFan_MouseUpEvent;
-
- if (ACControlBase.IsOpen(ac))
- {
- if (ac.currentFanMode == 1)
- {
- fan_Low.IsSelected=true;
- }
- else if (ac.currentFanMode == 2)
- {
- fan_Middle.IsSelected=true;
- }
- else
- {
- fan_Height.IsSelected=true;
- }
- }
- }
-
- /// <summary>
- /// 鍒囨崲椋庨��
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ChangeFan_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- var tag = (sender as LeftIconButtonRow).Tag.ToString();
- ZigBee.Device.AC.FanMode mode = ZigBee.Device.AC.FanMode.Low;
- if (tag == "Low")
- {
- mode = ZigBee.Device.AC.FanMode.Low;
- }
- else if (tag == "Medium")
- {
- mode = ZigBee.Device.AC.FanMode.Medium;
- }
- else if (tag == "High")
- {
- mode = ZigBee.Device.AC.FanMode.High;
- }
-
- ChangeFan(mode);
- }
-
- /// <summary>
- /// 鍒囨崲椋庨��
- /// </summary>
- /// <param name="fanMode">Fan mode.</param>
- private void ChangeFan(ZigBee.Device.AC.FanMode fanMode)
- {
- fanModeDialog.Close();
- if (ACControlBase.IsOpen(ac) == false)
- {
- ACControlBase.ShowACIsCloseTip();
- return;
- }
- fanModeBtn.IsSelected = true;
- fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanMode(fanMode);
- fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanMode(fanMode);
- ac.currentFanMode = (int)(fanMode);
-
- ac.SetFanModeAsync(fanMode);
- }
-
- #endregion
-
- #region 鈼� 鍒囨崲妯″紡_______________________
- /// <summary>
- /// 鍒囨崲妯″紡
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ShowChangeMode_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- if (HadSupportModel() == false)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.AC_Model_None));
- return;
- }
-
- int modeItem_X = 80;
- int modeItem_Height = 150;
- int modeItem_Width = 449;
-
- acModeDialog = new Dialog();
- acModeDialog.Show();
- var closeBGview = new FrameLayout();
- acModeDialog.AddChidren(closeBGview);
- closeBGview.MouseUpEventHandler += (send1, e1) =>
- {
- acModeDialog.Close();
- };
-
- var changeModeBG = new Button()
- {
- X = Application.GetRealWidth(230),
- Y = Application.GetRealHeight(450),
- Height = Application.GetRealHeight(933),
- Width = Application.GetRealWidth(modeItem_Width),
- UnSelectedImagePath = "AC/SelectedModeBG.png"
- };
- closeBGview.AddChidren(changeModeBG);
-
- var changeModeFL = new VerticalScrolViewLayout()
- {
- X = Application.GetRealWidth(230),
- Y = Application.GetRealHeight(450),
- Height = Application.GetRealHeight(900),
- Width = Application.GetRealWidth(modeItem_Width),
- ScrollEnabled = false,
- VerticalScrollBarEnabled = false
- };
- closeBGview.AddChidren(changeModeFL);
-
- var changeModeBtn = new Button()
- {
- X = Application.GetRealWidth(modeItem_X),
- Width = Application.GetRealWidth(modeItem_Width - modeItem_X),
- Height = Application.GetRealHeight(modeItem_Height),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextID = R.MyInternationalizationString.SelectMode,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = 14,
- IsBold = true
- };
- changeModeFL.AddChidren(changeModeBtn);
-
- var mode_Auto = new LeftIconButtonRow();
- mode_Auto.Tag = ZigBee.Device.AC.AcMode.Auto;
- mode_Auto.Init("AC/Mode_Auto.png", "AC/Mode_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Auto));
- mode_Auto.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCTextBlackColor);
- if (ac.listSupportMode[4] == 1)
- {
- changeModeFL.AddChidren(mode_Auto);
- }
-
- var mode_Cool = new LeftIconButtonRow();
- mode_Cool.Tag = ZigBee.Device.AC.AcMode.Cool;
- mode_Cool.Init("AC/Mode_Cool.png", "AC/Mode_CoolSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Cool));
- mode_Cool.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Cool);
- if (ac.listSupportMode[0] == 1)
- {
- changeModeFL.AddChidren(mode_Cool);
- }
-
- var mode_Heat = new LeftIconButtonRow();
- mode_Heat.Tag = ZigBee.Device.AC.AcMode.Heat;
- mode_Heat.Init("AC/Mode_Heat.png", "AC/Mode_HeatSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Heat));
- mode_Heat.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Heat);
- if (ac.listSupportMode[1] == 1)
- {
- changeModeFL.AddChidren(mode_Heat);
- }
-
- var mode_Dry = new LeftIconButtonRow();
- mode_Dry.Tag = ZigBee.Device.AC.AcMode.Dry;
- mode_Dry.Init("AC/Mode_Dry.png", "AC/Mode_DrySelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Dry));
- mode_Dry.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Dry);
- if (ac.listSupportMode[3] == 1)
- {
- changeModeFL.AddChidren(mode_Dry);
- }
-
- var mode_Fan = new LeftIconButtonRow();
- mode_Fan.Tag = ZigBee.Device.AC.AcMode.FanOnly;
- mode_Fan.Init("AC/Mode_Fan.png", "AC/Mode_FanSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_FanOnly), false);
- mode_Fan.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor_Fan);
- if (ac.listSupportMode[2] == 1)
- {
- changeModeFL.AddChidren(mode_Fan);
- }
-
-
- mode_Auto.ButtonClickEvent += ChangeMode_MouseUpEvent;
- mode_Cool.ButtonClickEvent += ChangeMode_MouseUpEvent;
- mode_Heat.ButtonClickEvent += ChangeMode_MouseUpEvent;
- mode_Dry.ButtonClickEvent += ChangeMode_MouseUpEvent;
- mode_Fan.ButtonClickEvent += ChangeMode_MouseUpEvent;
-
- if (ACControlBase.IsOpen(ac))
- {
- if (ac.currentSystemMode == 1)
- {
- mode_Auto.IsSelected = true;
- }
- else if (ac.currentSystemMode == 3)
- {
- mode_Cool.IsSelected = true;
- }
- else if (ac.currentSystemMode == 4)
- {
- mode_Heat.IsSelected = true;
- }
- else if (ac.currentSystemMode == 8)
- {
- mode_Dry.IsSelected = true;
- }
- else if (ac.currentSystemMode == 7)
- {
- mode_Fan.IsSelected = true;
- }
- }
- }
-
- /// <summary>
- /// 鍒囨崲妯″紡
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ChangeMode_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- var tag = (sender as LeftIconButtonRow).Tag.ToString();
- ZigBee.Device.AC.AcMode mode = ZigBee.Device.AC.AcMode.Cool;
-
- if (tag == "Auto")
- {
- mode = ZigBee.Device.AC.AcMode.Auto;
- }
- else if (tag == "Cool")
- {
- mode = ZigBee.Device.AC.AcMode.Cool;
- }
- else if (tag == "Heat")
- {
- mode = ZigBee.Device.AC.AcMode.Heat;
- }
- else if (tag == "Dry")
- {
- mode = ZigBee.Device.AC.AcMode.Dry;
- }
- else if (tag == "FanOnly")
- {
- mode = ZigBee.Device.AC.AcMode.FanOnly;
- }
-
- ChangeMode(mode);
- }
-
- /// <summary>
- /// 鍒囨崲妯″紡
- /// </summary>
- /// <param name="acMode">Ac mode.</param>
- private void ChangeMode(ZigBee.Device.AC.AcMode acMode)
- {
- acModeDialog.Close();
- if (ACControlBase.IsOpen(ac) == false)
- {
- ACControlBase.ShowACIsCloseTip();
- return;
- }
-
- modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByMode(acMode);
- modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByMode(acMode);
- modeBtn.IsSelected = true;
- currentModeBtn.Text = ACControlBase.GetModeNameByMode(acMode);
- ac.currentSystemMode = (int)acMode;
- mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
- ac.SetSystemModeAsync(acMode);
- }
-
- /// <summary>
- /// 鏄惁閰嶇疆浜嗘ā寮�
- /// </summary>
- /// <returns></returns>
- private bool HadSupportModel()
- {
- bool hadMode = false;
- foreach (var m in ac.listSupportMode)
- {
- if (m == 1)
- {
- hadMode = true;
- break;
- }
- }
- return hadMode;
- }
-
- #endregion
-
- #region 鈼� 鍒囨崲鎵______________________
-
-
- /// <summary>
- /// 鍒囨崲鎵
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ShowChangeFanSwing_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- int fanItem_X = 80;
- int fanItem_Height = 150;
- int fanItem_Width = 449;
-
- fanModeDialog = new Dialog();
- fanModeDialog.Show();
- var closeBGview = new FrameLayout();
- fanModeDialog.AddChidren(closeBGview);
- closeBGview.MouseUpEventHandler += (send1, e1) =>
- {
- fanModeDialog.Close();
- };
-
- var changeFanModeBG = new Button()
- {
- X = Application.GetRealWidth(35),
- Y = Application.GetRealHeight(297),
- Height = Application.GetRealHeight(1089),
- Width = Application.GetRealWidth(fanItem_Width),
- UnSelectedImagePath = "AC/SwingBackground.png"
- };
- closeBGview.AddChidren(changeFanModeBG);
-
- var changeFanModeFL = new VerticalScrolViewLayout()
- {
- X = Application.GetRealWidth(35),
- Y = Application.GetRealHeight(297),
- Height = Application.GetRealHeight(1050),
- Width = Application.GetRealWidth(fanItem_Width),
- VerticalScrollBarEnabled = false,
- ScrollEnabled = false
- };
- closeBGview.AddChidren(changeFanModeFL);
-
- var changeFanBtn = new Button()
- {
- X = Application.GetRealWidth(fanItem_X),
- Width = Application.GetRealWidth(fanItem_Width - fanItem_X),
- Height = Application.GetRealHeight(fanItem_Height),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextID = R.MyInternationalizationString.SelectSwing,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = 14,
- IsBold = true
- };
- changeFanModeFL.AddChidren(changeFanBtn);
-
- var swing_First = new LeftIconButtonRow { };
- swing_First.Tag = ZigBee.Device.AC.FanSwingMode.First;
- swing_First.Init("AC/Swing_1.png", "AC/Swing_1Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_First));
- swing_First.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2);
- changeFanModeFL.AddChidren(swing_First);
-
- var swing_Second = new LeftIconButtonRow();
- swing_Second.Tag = ZigBee.Device.AC.FanSwingMode.Second;
- swing_Second.Init("AC/Swing_2.png", "AC/Swing_2Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Second));
- swing_Second.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2);
- changeFanModeFL.AddChidren(swing_Second);
-
- var swing_Thrid = new LeftIconButtonRow();
- swing_Thrid.Tag = ZigBee.Device.AC.FanSwingMode.Thrid;
- swing_Thrid.Init("AC/Swing_3.png", "AC/Swing_3Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Thrid));
- swing_Thrid.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2);
- changeFanModeFL.AddChidren(swing_Thrid);
-
- var swing_Fourth = new LeftIconButtonRow();
- swing_Fourth.Tag = ZigBee.Device.AC.FanSwingMode.Fourth;
- swing_Fourth.Init("AC/Swing_4.png", "AC/Swing_4Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Fourth));
- swing_Fourth.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2);
- changeFanModeFL.AddChidren(swing_Fourth);
-
- var swing_Fifth = new LeftIconButtonRow();
- swing_Fifth.Tag = ZigBee.Device.AC.FanSwingMode.Fifth;
- swing_Fifth.Init("AC/Swing_5.png", "AC/Swing_5Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Fifth));
- swing_Fifth.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2);
- changeFanModeFL.AddChidren(swing_Fifth);
-
- var swing_Auto = new LeftIconButtonRow();
- swing_Auto.Tag = ZigBee.Device.AC.FanSwingMode.Auto;
- swing_Auto.Init("AC/Swing_Auto.png", "AC/Swing_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Swing_Auto), false);
- swing_Auto.SetTitleColor(ZigbeeColor.Current.GXCTextGrayColor, ZigbeeColor.Current.GXCACSelectedTextColor2);
- changeFanModeFL.AddChidren(swing_Auto);
-
- swing_First.ButtonClickEvent += ChangeFanSwing_MouseUpEvent;
- swing_Second.ButtonClickEvent += ChangeFanSwing_MouseUpEvent;
- swing_Thrid.ButtonClickEvent += ChangeFanSwing_MouseUpEvent;
- swing_Fourth.ButtonClickEvent += ChangeFanSwing_MouseUpEvent;
- swing_Fifth.ButtonClickEvent += ChangeFanSwing_MouseUpEvent;
- swing_Auto.ButtonClickEvent += ChangeFanSwing_MouseUpEvent;
-
- if (ACControlBase.IsOpen(ac))
- {
- if (ac.currentFanSwingMode == 0)
- {
- swing_First.IsSelected = true;
- }
- else if (ac.currentFanSwingMode == 1)
- {
- swing_Second.IsSelected = true;
- }
- else if (ac.currentFanSwingMode == 2)
- {
- swing_Thrid.IsSelected = true;
- }
- else if (ac.currentFanSwingMode == 3)
- {
- swing_Fourth.IsSelected = true;
- }
- else if (ac.currentFanSwingMode == 4)
- {
- swing_Fifth.IsSelected = true;
- }
- else if (ac.currentFanSwingMode == 7)
- {
- swing_Auto.IsSelected = true;
- }
- }
- }
-
- /// <summary>
- /// 鍒囨崲鎵
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ChangeFanSwing_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- var tag = (sender as LeftIconButtonRow).Tag.ToString();
- ZigBee.Device.AC.FanSwingMode mode = ZigBee.Device.AC.FanSwingMode.Auto;
- if (tag == "First")
- {
- mode = ZigBee.Device.AC.FanSwingMode.First;
- }
- else if (tag == "Second")
- {
- mode = ZigBee.Device.AC.FanSwingMode.Second;
- }
- else if (tag == "Thrid")
- {
- mode = ZigBee.Device.AC.FanSwingMode.Thrid;
- }
- else if(tag=="Fourth")
- {
- mode = ZigBee.Device.AC.FanSwingMode.Fourth;
- }
- else if (tag == "Fifth")
- {
- mode = ZigBee.Device.AC.FanSwingMode.Fifth;
- }
-
- ChangeFanSwing(mode);
- }
-
- /// <summary>
- /// 鍒囨崲鎵
- /// </summary>
- /// <param name="fanSwingMode">Fan mode.</param>
- private void ChangeFanSwing(ZigBee.Device.AC.FanSwingMode fanSwingMode)
- {
- fanModeDialog.Close();
- if (ACControlBase.IsOpen(ac) == false)
- {
- ACControlBase.ShowACIsCloseTip();
- return;
- }
- FanSwingModeBtn.IsSelected = true;
- FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingMode(fanSwingMode);
- FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingMode(fanSwingMode);
- ac.currentFanSwingMode = (int)fanSwingMode;
-
- ac.SetFanSwingAsyncMode(fanSwingMode);
- }
-
-
- #endregion
-
- #region 鈼� 鍗囨俯__________________________
- /// <summary>
- /// 鍗囨俯
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void Add_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- if (ACControlBase.IsOpen(ac) == false)
- {
- ACControlBase.ShowACIsCloseTip();
- return;
- }
- if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
- {
- if (ac.currentCoolingSetpoint >= ACControlBase.Temperature_High)
- {
- return;
- }
- ac.currentCoolingSetpoint += 1;
- ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
- mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
- }
- else if (ac.currentSystemMode == 4)
- {
- if (ac.currentHeatingSetpoint >= ACControlBase.Temperature_High)
- {
- return;
- }
- ac.currentHeatingSetpoint += 1;
- ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
- mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
- }
- else if (ac.currentSystemMode == 1)
- {
- if (ac.currentAutoSetpoint >= ACControlBase.Temperature_High)
- {
- return;
- }
- ac.currentAutoSetpoint += 1;
- ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
- mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
- }
- }
-
- #endregion
-
- #region 鈼� 闄嶆俯__________________________
-
- /// <summary>
- /// 闄嶆俯
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void Reduce_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- if (ACControlBase.IsOpen(ac) == false)
- {
- ACControlBase.ShowACIsCloseTip();
- return;
- }
- if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
- {
- if (ac.currentCoolingSetpoint <= ACControlBase.Temperature_Low)
- {
- return;
- }
- ac.currentCoolingSetpoint -= 1;
- ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
- mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
- }
- else if (ac.currentSystemMode == 4)
- {
- if (ac.currentHeatingSetpoint <= ACControlBase.Temperature_Low)
- {
- return;
- }
- ac.currentHeatingSetpoint -= 1;
- ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
- mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
- }
- else if (ac.currentSystemMode == 1)
- {
- if (ac.currentAutoSetpoint <= ACControlBase.Temperature_Low)
- {
- return;
- }
- ac.currentAutoSetpoint -= 1;
- ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
- mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
- }
- }
-
- #endregion
-
- #region 鈼� 鎺у埗鍙嶉_________________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (tempDevice.DeviceEpoint != this.device.DeviceEpoint || tempDevice.DeviceAddr != this.device.DeviceAddr)
- {
- //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //鎴愬姛涓嶆彁绀�
- //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveUpdateControlDeviceStatuAction()
- {
- if (zbGateway != null)
- {
- zbGateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- #endregion
-
- #region 鈼� 鏇村璁剧疆________________________
-
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void More(object sender, MouseEventArgs e)
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.EditAction += (curDev, curRoom) =>
- {
- Show(curDev, curRoom);
- };
- }
-
- #endregion
-
- #region 鈼� 鏀惰棌鍒颁富椤礯______________________
-
- /// <summary>
- /// 鏀惰棌鍒颁富椤�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void Collection(object sender, MouseEventArgs e)
- {
- if (collectionBtn.IsSelected)
- {
- UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
- collectionBtn.IsSelected = false;
- }
- else
- {
- UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
- collectionBtn.IsSelected = true;
- }
- }
-
- #endregion
-
- #region 鈼� 鍥炲埌涓婚〉________________________
-
- /// <summary>
- /// 鍥炲埌涓婚〉
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void BackToRoomHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- //backToRoom
- }
-
- #endregion
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp20200414/Shared/Phone/Device/Category/Category.cs
deleted file mode 100644
index 0bedf7d..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Category/Category.cs
+++ /dev/null
@@ -1,2907 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.UserView;
-using Shared.R;
-using ZigBee.Device;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.AC;
-using Shared.Phone.UserCenter.DoorLock;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserCenter;
-
-namespace Shared.Phone.Device.Category
-{
- /// <summary>
- /// Category.
- /// </summary>
- public class Category : FrameLayout, ZigBee.Common.IStatus
- {
-
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// The instance.
- /// </summary>
- public static Category instance;
- /// <summary>
- /// low_High
- /// </summary>
- private const int low_High = 127;
- /// <summary>
- /// 鍔熻兘
- /// </summary>
- private ButtonLineForm functionBtn;
- /// <summary>
- /// 鍦烘櫙
- /// </summary>
- private ButtonLineForm sceneBtn;
- /// <summary>
- /// 鑷姩鍖�
- /// </summary>
- private ButtonLineForm automationBtn;
- /// <summary>
- /// 鍦烘櫙鍔熻兘涓儴鑳屾櫙bodyView
- /// </summary>
- public FrameLayout functionSceneBodyView;
- /// <summary>
- /// 涓儴鑳屾櫙bodyView
- /// </summary>
- public FrameLayout functionSceneAutoBodyView;
- /// <summary>
- /// 鐩稿悓鐨勮澶囧垪琛�
- /// </summary>
- public VerticalScrolViewLayout deviceListScrolView;
- /// <summary>
- /// 璁惧鏄惁鍦ㄧ嚎鏍囪瘑--Online
- /// </summary>
- private readonly string deviceStatus_Online = "Online";
- /// <summary>
- /// 璁惧鐘舵�佸紑鍏虫爣璇�--Switch
- /// </summary>
- private readonly string deviceStatus_OnOffStatus = "Switch";
- /// <summary>
- /// 鍙充笂瑙掓坊鍔犳寜閽�
- /// </summary>
- private Device.CommonForm.SelectedStatuButton addBtn;
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 缃戝叧鍒楄〃
- /// </summary>
- private List<ZbGateway> zbGatewayList = new List<ZbGateway> { };
- /// <summary>
- /// 璁惧鍒楄〃
- /// </summary>
- private List<CommonDevice> commonDeviceList = new List<CommonDevice> { };
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
- /// <summary>
- /// 褰撳墠鍔熻兘绫诲瀷鎸夐挳
- /// </summary>
- private FunctionButton tempFunctionTypeBtn;
- /// <summary>
- /// 鍔熻兘绫诲瀷鎸夐挳
- /// </summary>
- //private FunctionButton functionTypeIMG;
- /// <summary>
- /// 鍔熻兘绫诲瀷
- /// </summary>
- private HorizontalScrolViewLayout functionTypeScrowView;
- /// <summary>
- /// 璁惧绫诲瀷RowLayout
- /// </summary>
- //private FrameLayout typeRowLayout;
- /// <summary>
- /// 妤煎眰
- /// </summary>
- private Button floorBtn;
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- private Button selectFloorBtn;
-
- /// <summary>
- /// 鐩稿悓绫诲瀷鐨勮澶囧垪琛�
- /// </summary>
- private Dictionary<int, List<CommonDevice>> typeDeviceDic;
- /// <summary>
- /// 璁惧绫诲瀷鐨勫浘id
- /// </summary>
- private Dictionary<int, DeviceConcreteType> typeIdDic;
- /// <summary>
- /// dList
- /// </summary>
- private List<CommonDevice> devList;
- /// <summary>
- /// sceneList
- /// </summary>
- private List<SceneUI> sceneList;
- #endregion
-
- #region 鈼� 鎺ュ彛____________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- //璁惧涓婃姤鐘舵�佷腑 褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- if (common.DeviceStatusReport.AttriBute == null || common.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- for (int i = 0; deviceListScrolView != null && i < deviceListScrolView.ChildrenCount; i++)
- {
- var rowLayout = deviceListScrolView.GetChildren(i) as RowLayout;
- var deviceUI = LocalDevice.Current.GetDevice(rowLayout.Tag.ToString());
- if (deviceUI == null)
- {
- continue;
- }
- if (deviceUI.DeviceAddr != common.DeviceAddr || deviceUI.DeviceEpoint != common.DeviceEpoint)
- {
- continue;
- }
- switch (deviceUI.Type)
- {
- case DeviceType.OnOffOutput:
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var light = deviceUI as ToggleLight;
- light.DeviceStatusReport = common.DeviceStatusReport;
- light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.IsSelected = light.OnOffStatus == 1;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- light.LastDateTime = DateTime.Now;
- }
- if (common.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.IsOnline = 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.AirSwitch:
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var airSwitch = deviceUI as ZigBee.Device.AirSwitch;
- airSwitch.DeviceStatusReport = common.DeviceStatusReport;
- airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData;
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.IsSelected = airSwitch.OnOffStatus == 1;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- airSwitch.LastDateTime = DateTime.Now;
- }
- if (common.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.IsOnline = 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- break;
- case DeviceType.WindowCoveringDevice:
-
- if (common.DeviceStatusReport.CluterID == 258)
- {
- if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
- {
- //绐楀笜绫诲瀷
- var rollerShade = deviceUI as Rollershade;
- rollerShade.DeviceStatusReport = common.DeviceStatusReport;
- rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData;
- rollerShade.LastDateTime = DateTime.Now;
- }
- if (common.DeviceStatusReport.AttriBute[0].AttributeId == 8)
- {
- var row = rowLayout.GetChildren(0) as CategoryFunctionForWinRow;
- //绐楀笜鐧惧垎姣�
- var rollerShade = deviceUI as Rollershade;
- rollerShade.DeviceStatusReport = common.DeviceStatusReport;
- rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData;
- row.SetStatuText($"{Language.StringByID(R.MyInternationalizationString.Current)} { HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI)}");
- row.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage != 0;
- rollerShade.LastDateTime = DateTime.Now;
- }
- }
- if (common.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.IsOnline = 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.Thermostat:
- //AC鍔熻兘
- if (common.DeviceStatusReport.CluterID == 513)
- {
- var attriButeList = common.DeviceStatusReport.AttriBute;
- var ac = deviceUI as ZigBee.Device.AC;
- ac.DeviceStatusReport = common.DeviceStatusReport;
- foreach (var attList in attriButeList)
- {
- var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
- switch (attList.AttributeId)
- {
- case 0:
- ac.currentLocalTemperature = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 17:
- ac.currentCoolingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 18:
- ac.currentHeatingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentAutoSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 28:
- ac.currentSystemMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4097:
- //杩囪檻缃戞竻娲楁爣蹇�:42
- ac.CleanStatu = attList.AttriButeData == 42;
- break;
- }
- }
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.IsSelected = ac.currentSystemMode != 0;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- }
-
- if (common.DeviceStatusReport.CluterID == 514)
- {
- var ac = deviceUI as ZigBee.Device.AC;
- var attriButeList = common.DeviceStatusReport.AttriBute;
- ac.DeviceStatusReport = common.DeviceStatusReport;
- foreach (var attList in attriButeList)
- {
- switch (attList.AttributeId)
- {
- case 0:
- ac.currentFanMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentFanSwingMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- }
- }
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.IsSelected = ac.currentSystemMode != 0;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- }
-
- if (common.DeviceStatusReport.CluterID == 3)
- {
- var ac = deviceUI as ZigBee.Device.AC;
- ac.IsOnline = 1;
- ac.LastDateTime = DateTime.Now;
- }
- break;
- case DeviceType.DimmableLight:
- //璋冨厜鐏姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var dimmableLight = deviceUI as DimmableLight;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.IsSelected = dimmableLight.OnOffStatus == 1;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- dimmableLight.LastDateTime = DateTime.Now;
- }
- if (common.DeviceStatusReport.CluterID == 8)
- {
- var dimmableLight = deviceUI as DimmableLight;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- dimmableLight.Level = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.IsSelected = dimmableLight.OnOffStatus == 1;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- dimmableLight.LastDateTime = DateTime.Now;
- }
- if (common.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.IsOnline = 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.TemperatureSensor:
- //娓╁害
- if (common.DeviceStatusReport.CluterID == 1026)
- {
- var tempera = deviceUI as TemperatureSensor;
- foreach (var data in common.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- tempera.Temperatrue = 0;
- }
- else if (data.AttriButeData > 32767)
- {
- //璐熸暟(鐗规畩澶勭悊)
- string strValue = (data.AttriButeData - 65536).ToString();
- //灏忔暟鐐归渶瑕佷竴浣�
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- }
- }
- }
- //婀垮害
- if (common.DeviceStatusReport.CluterID == 1029)
- {
- var tempera = deviceUI as TemperatureSensor;
- foreach (var data in common.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- tempera.Humidity = 0;
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- tempera.LastDateTime = DateTime.Now;
- }
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- }
- }
- }
- break;
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"鍒嗙被璁惧鐘舵��-Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- for (int i = 0; deviceListScrolView != null && i < deviceListScrolView.ChildrenCount; i++)
- {
- var rowLayout = deviceListScrolView.GetChildren(i) as RowLayout;
- var deviceUI = LocalDevice.Current.GetDevice(rowLayout.Tag.ToString());
- if (deviceUI == null)
- {
- continue;
- }
- if (deviceUI.DeviceAddr != common.DeviceAddr || deviceUI.DeviceEpoint != common.DeviceEpoint)
- {
- continue;
- }
- switch (deviceUI.Type)
- {
- case DeviceType.OnOffOutput:
- deviceUI.IsOnline = common.IsOnline;
- deviceUI.LastDateTime = DateTime.Now;
- break;
-
- case DeviceType.AirSwitch:
- deviceUI.IsOnline = common.IsOnline;
- deviceUI.LastDateTime = DateTime.Now;
- break;
-
- case DeviceType.WindowCoveringDevice:
- deviceUI.LastDateTime = DateTime.Now;
- deviceUI.IsOnline = common.IsOnline;
- break;
-
- case DeviceType.DimmableLight:
- deviceUI.LastDateTime = DateTime.Now;
- deviceUI.IsOnline = common.IsOnline;
- break;
-
- case DeviceType.Thermostat:
- deviceUI.LastDateTime = DateTime.Now;
- deviceUI.IsOnline = common.IsOnline;
- break;
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"鍒嗙被璁惧鐘舵��-Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "IASInfoReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- for (int i = 0; deviceListScrolView != null && i < deviceListScrolView.ChildrenCount; i++)
- {
- var rowLayout = deviceListScrolView.GetChildren(i) as RowLayout;
- var deviceUI = LocalDevice.Current.GetDevice(rowLayout.Tag.ToString());
- if (deviceUI == null)
- {
- continue;
- }
- if (deviceUI.DeviceAddr != common.DeviceAddr || deviceUI.DeviceEpoint != common.DeviceEpoint)
- {
- continue;
- }
- switch (deviceUI.Type)
- {
- case DeviceType.IASZone:
- //寮�鍏冲姛鑳�
- var ias = common as IASZone;
- var iAS = deviceUI as ZigBee.Device.IASZone;
- iAS.iASInfo = ias.iASInfo;
- var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
- row.IsSelected = iAS.iASInfo?.Alarm1 == 1;
- row.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- iAS.LastDateTime = DateTime.Now;
- break;
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"鍒嗙被璁惧鐘舵��-Error:{ex.Message}");
- }
- });
- }
- }
- #endregion
-
- #region 鈼� 鍒濆鍖朹_________________________
- /// <summary>
- /// Removes from parent.
- /// </summary>
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- RemoveAllUpdateControlDeviceStatuAction();
- base.RemoveFromParent();
- }
-
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public Category()
- {
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
- instance = this;
- ZbGateway.StatusList.Add(this);
- }
-
- /// <summary>
- /// 鏄剧ず鐣岄潰--榛樿鍦烘櫙鐣岄潰
- /// </summary>
- /// <param name="selectedBtn">閫変腑閭d釜鐣岄潰 0--鍔熻兘 1--鍦烘櫙 2--鑷姩鍖� </param>
- public void Show(int selectedBtn = 1)
- {
- InitData();
-
- RemoveAll();
-
- #region topview
- var topView = new FrameLayout()
- {
- Y = Application.GetRealHeight(104),
- Height = Application.GetRealHeight(low_High),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- this.AddChidren(topView);
-
- var title = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(95),
- Width = Application.GetRealWidth(CommonFormResouce.TopTitle_Width),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Category,
- TextSize = 24,
- TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor,
- IsBold = true
- };
- topView.AddChidren(title);
-
- addBtn = new SelectedStatuButton()
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(104),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Add_Category.png",
- SelectedImagePath = "Item/Add_Category.png"
- };
- topView.AddChidren(addBtn);
- #endregion
-
- #region midFL
- var midFL = new FrameLayout
- {
- Y = topView.Bottom,
- Height = Application.GetRealHeight(1549),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- AddChidren(midFL);
-
- var functionSceneAutoBG = new FrameLayout()
- {
- Height = Application.GetRealHeight(low_High),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- midFL.AddChidren(functionSceneAutoBG);
-
- //鍦烘櫙
- sceneBtn = new ButtonLineForm(CommonFormResouce.X_Left, 34);
- functionSceneAutoBG.AddChidren(sceneBtn);
- sceneBtn.Init();
- sceneBtn.SetTitle(R.MyInternationalizationString.Scence);
- //鍔熻兘
- functionBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 + 20, 34);
- functionSceneAutoBG.AddChidren(functionBtn);
- functionBtn.Init();
- functionBtn.SetTitle(R.MyInternationalizationString.Function);
- functionBtn.X = sceneBtn.Right;
- //鑷姩鍖�
- automationBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 * 2 + 20 + 50, 34);
- automationBtn.Init();
- automationBtn.SetTitle(R.MyInternationalizationString.Automation);
- automationBtn.X = functionBtn.Right;
- //闅愯棌鑷姩鍖�
- if (UserCenter.UserCenterResourse.UserInfo.AuthorityNo != 3)
- {
- functionSceneAutoBG.AddChidren(automationBtn);
- }
-
- floorBtn = new Button()
- {
- X = Application.GetRealWidth(750),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 14,
- IsBold = true
- };
-
- selectFloorBtn = new Button()
- {
- X = Application.GetRealWidth(950),
- Width = Application.GetMinRealAverage(69),
- Height = Application.GetMinRealAverage(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Drop_Down.png"
- };
-
- if (Config.Instance.Home.FloorDics.Count > 0)
- {
- floorBtn.Text = Config.Instance.Home.GetCurrentFloorName;
- functionSceneAutoBG.AddChidren(floorBtn);
- functionSceneAutoBG.AddChidren(selectFloorBtn);
- }
-
- functionSceneAutoBodyView = new FrameLayout
- {
- Y = functionSceneAutoBG.Bottom,
- Height = Application.GetRealHeight(1423),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- midFL.AddChidren(functionSceneAutoBodyView);
-
- if (selectedBtn == 0)
- {
- addBtn.Visible = false;
- functionBtn.IsSelected = true;
- }
- else if (selectedBtn == 1)
- {
- addBtn.Visible = true;
- sceneBtn.IsSelected = true;
- }
- else if (selectedBtn == 2)
- {
- addBtn.Visible = true;
- automationBtn.IsSelected = true;
- }
- RefreshBodyView();
-
- #endregion
- //缁戝畾鎸夐挳浜嬩欢
- BindEvent();
-
- }
- #endregion
-
- #region 鈼� 鍒囨崲/娣诲姞 鍔熻兘銆佸満鏅�佽嚜鍔ㄥ寲________
-
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- //閫夋嫨鍔熻兘鍒嗘爮
- functionBtn.NameBtn.MouseUpEventHandler += FunctionBtn_MouseUpEventHandler;
- //閫夋嫨鍦烘櫙鍒嗘爮
- sceneBtn.NameBtn.MouseUpEventHandler += SceneBtn_MouseUpEventHandler;
- //閫変腑鑷姩鍖�
- automationBtn.NameBtn.MouseUpEventHandler += AutomationBtn_MouseUpEventHandler;
- //鍙充笂瑙掓坊鍔犳寜閽�
- addBtn.MouseUpEventHandler += AddBtn_MouseUpEventHandler;
-
- selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
-
- }
-
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- var floors = new SelectFloor();
- AddChidren(floors);
- floors.Init(580, 330, Direction.Right);
- floors.changeFloor = true;
- floors.FloorAction += (floorId) =>
- {
- floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
- HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
- RefreshBodyView();
- };
- }
-
- /// <summary>
- /// 閫夋嫨鍔熻兘鍒嗘爮
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void FunctionBtn_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- functionBtn.IsSelected = true;
- sceneBtn.IsSelected = false;
- automationBtn.IsSelected = false;
- addBtn.Visible = false;
- RefreshBodyView();
- }
-
- /// <summary>
- /// 閫夋嫨鍦烘櫙鍒嗘爮
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void SceneBtn_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- functionBtn.IsSelected = false;
- sceneBtn.IsSelected = true;
- automationBtn.IsSelected = false;
- addBtn.Visible = true;
- RefreshBodyView();
- }
-
- /// <summary>
- /// 閫変腑鑷姩鍖�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void AutomationBtn_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- Common.Logic.LogicDviceList.Clear();
- if (Common.Logic.LogicDviceList.Count == 0)
- {
- Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
- }
- functionBtn.IsSelected = false;
- sceneBtn.IsSelected = false;
- automationBtn.IsSelected = true;
- addBtn.Visible = true;
- RefreshBodyView();
- }
-
- /// <summary>
- /// 鍙充笂瑙掓坊鍔犳寜閽簨浠�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void AddBtn_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- if (functionBtn.IsSelected)
- {
- //鍔熻兘
- }
- else if (sceneBtn.IsSelected)
- {
- //娣诲姞鍦烘櫙
- Add_Scene();
- }
- else if (automationBtn.IsSelected)
- {
- //娣诲姞鑷姩鍖�
- Add_Automation();
- }
- }
-
- /// <summary>
- /// 娣诲姞鍦烘櫙
- /// </summary>
- private void Add_Scene()
- {
- var scene = new CategoryAddScene();
- UserView.HomePage.Instance.AddChidren(scene);
- UserView.HomePage.Instance.PageIndex += 1;
- scene.Show();
- scene.AddAction = () =>
- {
- ShowScene();
- };
- }
-
- /// <summary>
- /// 娣诲姞鑷姩鍖�
- /// </summary>
- private void Add_Automation()
- {
- //new涓�涓柊閫昏緫瀵硅薄锛�
- Common.Logic.CurrentLogic = new Common.Logic();
- Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
- Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
- var addLogicPage = new Shared.Phone.Device.Logic.AddLogicPage();
- UserView.HomePage.Instance.AddChidren(addLogicPage);
- UserView.HomePage.Instance.PageIndex += 1;
- addLogicPage.Show();
- }
- /// <summary>
- /// HidenFloor
- /// </summary>
- /// <param name="statu"></param>
- private void HidenFloor(bool statu)
- {
- selectFloorBtn.Visible = !statu;
- floorBtn.Visible = !statu;
- }
-
- #endregion
-
- #region 鈼� 鍒锋柊____________________________
- /// <summary>
- /// 鍒锋柊bodyView
- /// </summary>
- public void RefreshBodyView()
- {
- functionSceneAutoBodyView.RemoveAll();
- if (functionBtn.IsSelected)
- {
- HidenFloor(false);
- ShowFunction();
- }
- else if (sceneBtn.IsSelected)
- {
- HidenFloor(false);
- ShowScene();
- }
- else if (automationBtn.IsSelected)
- {
- HidenFloor(true);
- ShowAutotion();
- }
- }
-
- /// <summary>
- /// InitData
- /// </summary>
- private void InitData()
- {
- typeDeviceDic = new Dictionary<int, List<CommonDevice>> { };
- typeIdDic = new Dictionary<int, DeviceConcreteType> { };
- }
-
- /// <summary>
- /// RefreshData
- /// </summary>
- private void RefreshData(Common.Room room)
- {
- devList = HdlRoomLogic.Current.GetRoomListDevice(room);
- sceneList = HdlSceneLogic.Current.GetRoomSceneList(room);
- typeDeviceDic.Clear();
- typeIdDic.Clear();
- foreach (var device in devList)
- {
- var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
- if (info.BeloneType == DeviceBeloneType.A骞叉帴鐐� || info.BeloneType == DeviceBeloneType.A涓户鍣�)
- {
- continue;
- }
- if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false)
- {
- var sameDevList = new List<CommonDevice> { };
- sameDevList.Add(device);
- typeDeviceDic[info.BeloneTextId] = sameDevList;
- }
- else
- {
- typeDeviceDic[info.BeloneTextId].Add(device);
- }
- typeIdDic[info.BeloneTextId] = info.ConcreteType;
- }
- }
-
- #endregion
-
- #region 鈼� 鍔熻兘____________________________
- /// <summary>
- /// 鍔熻兘
- /// </summary>
- public void ShowFunction()
- {
- AddRoomView();
- }
-
- /// <summary>
- /// 鎻愮ず娌℃湁鍔熻兘
- /// </summary>
- private void ShowNoFunctionTip()
- {
- var noFunction = new Button()
- {
- Y = Application.GetRealHeight(320),
- Width = Application.GetMinRealAverage(757),
- Height = Application.GetMinRealAverage(435),
- UnSelectedImagePath = "Item/NoFunction.png",
- Gravity = Gravity.CenterHorizontal
- };
- functionSceneBodyView.AddChidren(noFunction);
-
- var noFunctionTip = new Button()
- {
- Y = noFunction.Bottom + Application.GetRealHeight(32),
- Height = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(700),
- Gravity = Gravity.CenterHorizontal,
- Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noFunctionTip);
- }
-
- /// <summary>
- /// RefreshFunction
- /// </summary>
- /// <param name="room"></param>
- private void RefreshFunction(Common.Room room)
- {
- RefreshData(room);
- //绉婚櫎鐩戝惉
- RemoveAllUpdateControlDeviceStatuAction();
- functionSceneBodyView.RemoveAll();
-
- if (typeDeviceDic.Count == 0)
- {
- ShowNoFunctionTip();
- }
- else
- {
- var functionTypeView1 = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(160),
- Width = Application.GetRealWidth(1028),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(functionTypeView1);
- functionTypeView1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft);
-
- var functionTypeView2 = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(150),
- Height = Application.GetRealHeight(279 - 150),
- Width = Application.GetRealWidth(1028),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(functionTypeView2);
- functionTypeView2.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
-
- functionTypeScrowView = new HorizontalScrolViewLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(279),
- Width = Application.GetRealWidth(1028),
- };
- functionSceneBodyView.AddChidren(functionTypeScrowView);
-
- deviceListScrolView = new VerticalScrolViewLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(35 + 279),
- Width = Application.GetRealWidth(1028),
- Height = Application.GetRealHeight(942),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(deviceListScrolView);
- deviceListScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-
- tempFunctionTypeBtn = new FunctionButton();
- tempFunctionTypeBtn.Init("", "");
-
- foreach (var deviceType in typeIdDic)
- {
- var typeRowLayout = new FrameLayout()
- {
- Width = Application.GetRealWidth(220),
- };
- functionTypeScrowView.AddChidren(typeRowLayout);
-
- var functionTypeIMG = new FunctionButton()
- {
- Tag = deviceType.Key
- };
- string imgPath = string.Empty;
- string imgSeletedPath = string.Empty;
- Common.LocalDevice.Current.GetDeviceObjectIcon(deviceType.Value, ref imgPath, ref imgSeletedPath);
- functionTypeIMG.Init(imgPath, imgSeletedPath);
- functionTypeIMG.SetTitle(deviceType.Key);
- typeRowLayout.AddChidren(functionTypeIMG);
-
- functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
-
- if (functionTypeScrowView.ChildrenCount == 1)
- {
- ShowSameTypeFunction(functionTypeIMG.ImageBtn, null);
- }
- }
- }
- }
-
- /// <summary>
- /// 鏄剧ず鐩稿悓绫诲瀷鐨勫姛鑳�
- /// </summary>
- /// <param name="typeSender">typeSender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ShowSameTypeFunction(object typeSender, MouseEventArgs mouseEventArgs)
- {
- tempFunctionTypeBtn.IsSelected = false;
- tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton;
- ((typeSender as Button).Parent as FunctionButton).IsSelected = true;
-
- deviceListScrolView.RemoveAll();
-
- var sameTypeList = new List<CommonDevice> { };
- sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
-
- for (int i = 0; i < sameTypeList.Count; i++)
- {
- var deviceUI = sameTypeList[i];
- new System.Threading.Thread(() =>
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(127 + 35),
- LineColor = ZigbeeColor.Current.GXCClearColor,
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI),
- SubViewWidth = Application.GetRealWidth(184)
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- if (deviceUI.Type == DeviceType.OnOffOutput)
- {
- //鐏�
- var light = deviceUI as ToggleLight;
- if (light.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (light.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.IsSelected = light.OnOffStatus == 1;
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI);
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- deviceRow.IsSelected = (send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- light.SwitchControl(1);
- }
- else
- {
- light.SwitchControl(0);
- }
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(deviceUI, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var lightControl = new Phone.Device.Light.OnOffControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- lightControl.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- lightControl.action += (curDev, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- }
- else if (deviceUI.Type == DeviceType.AirSwitch)
- {
- //绌烘皵寮�鍏�
- var airSwitch = deviceUI as AirSwitch;
- if (airSwitch.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (airSwitch.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(airSwitch, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI);
- });
- }
- else
- {
- if ((DateTime.Now - airSwitch.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.IsSelected = airSwitch.OnOffStatus == 1;
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceTypeRowLayout.AddChidren(deviceRow);
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI);
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- deviceRow.IsSelected = (send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- airSwitch.SwitchControl(1);
- }
- else
- {
- airSwitch.SwitchControl(0);
- }
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(deviceUI, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
-
- var lightControl = new Phone.Device.Light.AirSwitchControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- lightControl.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- lightControl.action += (curDev, curRoom) =>
- {
-
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
-
- };
- };
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
-
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- }
- else if (deviceUI.Type == DeviceType.DimmableLight)
- {
- //璋冨厜鐏�
- var dimmableLight = deviceUI as ZigBee.Device.DimmableLight;
- if (dimmableLight.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (dimmableLight.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(dimmableLight, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(deviceUI);
- });
- }
- else
- {
- if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(deviceUI);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.IsSelected = dimmableLight.OnOffStatus == 1;
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI);
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- deviceRow.IsSelected = (send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- dimmableLight.SwitchControl(1);
- }
- else
- {
- dimmableLight.SwitchControl(0);
- }
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(deviceUI, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
-
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
- UserView.HomePage.Instance.AddChidren(dimmableLightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- dimmableLightControl.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- dimmableLightControl.action += (curDev, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
-
- };
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- }
- else if (deviceUI.Type == DeviceType.Thermostat)
- {
- //绌鸿皟
- var ac = deviceUI as ZigBee.Device.AC;
- if (ac.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (ac.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- UserView.UserHomeView.ReadStatus(ac, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(deviceUI);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(deviceUI);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.IsSelected = ac.currentSystemMode != 1;
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI);
-
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- deviceRow.IsSelected = (send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- ac.Open();
- }
- else
- {
- ac.Close();
- }
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(deviceUI, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var acControl = new Phone.Device.AC.ACControl();
- UserView.HomePage.Instance.AddChidren(acControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- acControl.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- acControl.action += (curDev, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
-
- };
- };
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
-
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- }
- else if (deviceUI.Type == DeviceType.WindowCoveringDevice)
- {
- //鍗峰笜
- var rollerShade = deviceUI as ZigBee.Device.Rollershade;
- if (rollerShade.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (rollerShade.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(rollerShade, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(deviceUI);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇
- if ((DateTime.Now - rollerShade.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(deviceUI);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var deviceRow = new CategoryFunctionForWinRow(0, 35);
- deviceRow.Init(deviceUI);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage != 0;
- deviceRow.SetRollerShadeIcon(rollerShade.WcdType);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- if (rollerShade.WcdType == -1)
- {
- CommonPage.Loading.Start();
- new System.Threading.Thread(() =>
- {
- Rollershade.ReadWcdTypeAction(rollerShade, () =>
- {
- Application.RunOnMainThread(() =>
- {
- deviceRow.SetRollerShadeIcon(rollerShade.WcdType);
- CommonPage.Loading.Hide();
- });
- });
- })
- { IsBackground = true }.Start();
- }
-
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
- UserView.HomePage.Instance.AddChidren(rollerShadeControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- rollerShadeControl.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- rollerShadeControl.action += (curDev, curRoom) =>
- {
- ReFreshDeviceActionForWin(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceActionForWin(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- }
- else if (deviceUI.Type == DeviceType.DoorLock)
- {
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.HideSwitchBtn(true);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var userDoorLockPage = new UserDoorLockPage(HdlRoomLogic.Current.CurrentRoom, deviceUI);
- HomePage.Instance.AddChidren(userDoorLockPage);
- HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
- };
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- else if (deviceUI.Type == DeviceType.IASZone)
- {
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.IsSelected = (deviceUI as IASZone).iASInfo?.Alarm1 == 1;
- deviceRow.HideSwitchBtn(true);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- else if (deviceUI.Type == DeviceType.TemperatureSensor)
- {
- var tempera = deviceUI as TemperatureSensor;
- if (tempera.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (tempera.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(tempera, () =>
- {
- if (tempera.SensorDiv == 1)
- {
- ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(deviceUI);
- }
- else if (tempera.SensorDiv == 2)
- {
- ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(deviceUI);
- }
- });
- }
- else
- {
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - tempera.LastDateTime).TotalSeconds)
- {
- if (tempera.SensorDiv == 1)
- {
- ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(deviceUI);
- }
- else if (tempera.SensorDiv == 2)
- {
- ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(deviceUI);
- }
- }
- }
- })
- { IsBackground = true }.Start();
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.IsSelected = false;
- deviceRow.HideSwitchBtn(true);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
- }
- else
- {
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- deviceRow.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI));
- deviceRow.HideSwitchBtn(true);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, HdlRoomLogic.Current.CurrentRoom);
- detailInfo.EditAction += (curDevice, curRoom) =>
- {
- ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
- };
- };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- }
- }
-
- //鍒犻櫎璁惧
- EventHandler<MouseEventArgs> delEvent = (delSender, delE) =>
- {
- var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.DeleteFunction));
- alert.Show();
- alert.ConfirmClickEvent += () =>
- {
- if (HdlRoomLogic.Current.CurrentRoom.IsLove)
- {
- HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);
- deviceListScrolView.RemoveViewByTag((delSender as Button).Tag);
- sameTypeList.Remove(deviceUI);
- }
- else
- {
- HdlRoomLogic.Current.DeleteDevice(deviceUI);
- deviceListScrolView.RemoveViewByTag((delSender as Button).Tag);
- sameTypeList.Remove(deviceUI);
-
- HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);
- }
- if (sameTypeList.Count == 0)
- {
- RefreshBodyView();
- }
- };
- };
- var delBtn = new CommonForm.RowLayoutDeleteButton()
- {
- Tag = LocalDevice.Current.GetDeviceMainKeys(deviceUI)
- };
- if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
- }
- catch { }
- });
- })
- { IsBackground = true }.Start();
- }
- }
-
- /// <summary>
- /// ReFreshDeviceAction
- /// </summary>
- /// <param name="curRoom"></param>
- /// <param name="sameTypeList"></param>
- /// <param name="devListScrolView"></param>
- /// <param name="deviceRow"></param>
- private void ReFreshDeviceAction(CommonDevice deviceUI, Common.Room curRoom, List<CommonDevice> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionRow deviceRow)
- {
- if (HdlRoomLogic.Current.CurrentRoom.IsLove)
- {
- deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- if (HdlRoomLogic.Current.IsCollectInRoom(deviceUI) == false)
- {
- devListScrolView.RemoveViewByTag(deviceUI);
- sameTypeList.Remove(deviceUI);
- if (sameTypeList.Count == 0)
- {
- RefreshFunction(HdlRoomLogic.Current.CurrentRoom);
- }
- }
- }
- else
- {
- if (curRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id)
- {
- HdlRoomLogic.Current.DeleteDevice(deviceUI);
- devListScrolView.RemoveViewByTag(deviceUI);
- sameTypeList.Remove(deviceUI);
- if (sameTypeList.Count == 0)
- {
- RefreshFunction(HdlRoomLogic.Current.CurrentRoom);
- }
- }
- else
- {
- deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- }
- }
- }
-
- /// <summary>
- /// ReFreshDeviceAction
- /// </summary>
- /// <param name="curRoom"></param>
- /// <param name="sameTypeList"></param>
- /// <param name="devListScrolView"></param>
- /// <param name="deviceRow"></param>
- private void ReFreshDeviceActionForWin(CommonDevice deviceUI, Common.Room curRoom, List<CommonDevice> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionForWinRow deviceRow)
- {
- if (HdlRoomLogic.Current.CurrentRoom.IsLove)
- {
- deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- if (HdlRoomLogic.Current.IsCollectInRoom(deviceUI) == false)
- {
- devListScrolView.RemoveViewByTag(deviceUI);
- sameTypeList.Remove(deviceUI);
- if (sameTypeList.Count == 0)
- {
- RefreshFunction(HdlRoomLogic.Current.CurrentRoom);
- }
- }
- }
- else
- {
- if (curRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id)
- {
- HdlRoomLogic.Current.DeleteDevice(deviceUI);
- devListScrolView.RemoveViewByTag(deviceUI);
- sameTypeList.Remove(deviceUI);
- if (sameTypeList.Count == 0)
- {
- RefreshFunction(HdlRoomLogic.Current.CurrentRoom);
- }
- }
- else
- {
- deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(deviceUI));
- }
- }
- }
-
-
- /// <summary>
- /// AddRoomView
- /// </summary>
- private void AddRoomView()
- {
- var roomFL = new HorizontalScrolViewLayout()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(170),
- Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonFormResouce.X_Left),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- functionSceneAutoBodyView.AddChidren(roomFL);
-
- //鍔熻兘鍜屽満鏅痓odyView
- functionSceneBodyView = new FrameLayout()
- {
- Y = roomFL.Bottom,
- Height = Application.GetRealHeight(973 + 279),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- functionSceneAutoBodyView.AddChidren(functionSceneBodyView);
-
- RoomButton curBtn = new RoomButton(0, 0);
- var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
- foreach (var room in lisrRoom)
- {
- var row = new FrameLayout()
- {
- Width = Application.GetRealWidth(255),
- Height = Application.GetRealHeight(167)
- };
- roomFL.AddChidren(row);
-
- RoomButton roomBtn = new RoomButton(0, 0);
- roomBtn.Gravity = Gravity.Center;
- roomBtn.Init();
- roomBtn.SetTitle(room.Name);
- row.AddChidren(roomBtn);
-
- if (room.Id == HdlRoomLogic.Current.CurrentRoom.Id)
- {
- roomBtn.IsSelected = true;
- curBtn = roomBtn;
- if (sceneBtn.IsSelected)
- {
- RefreshScene(room);
- }
- else
- {
- RefreshFunction(room);
- }
- }
-
- roomBtn.ButtonClickEvent += (sender, e) =>
- {
- if (sender == curBtn)
- {
- return;
- }
- sender.IsSelected = true;
- curBtn.IsSelected = false;
- curBtn = sender;
- HdlRoomLogic.Current.CurrentRoom = room;
- if (sceneBtn.IsSelected)
- {
- RefreshScene(room);
- }
- else
- {
- RefreshFunction(room);
- }
- };
- }
- }
-
- #endregion
-
- #region 鈼� 鍦烘櫙____________________________
- /// <summary>
- /// 閫夋嫨鍦烘櫙--鎵�鏈夋埧闂寸殑鎵�鏈夊満鏅�
- /// </summary>
- public void ShowScene()
- {
- AddRoomView();
- }
-
- /// <summary>
- /// RefreshScene
- /// </summary>
- /// <param name="room"></param>
- public void RefreshScene(Common.Room room)
- {
- RefreshData(room);
- functionSceneBodyView.RemoveAll();
- if (sceneList.Count == 0)
- {
- ShowNoSceneTip();
- }
- else
- {
- var sceneScrolView = new VerticalScrolViewLayout { };
- functionSceneBodyView.AddChidren(sceneScrolView);
- foreach (var scene in sceneList)
- {
- var sceneView = new SceneCategoryView();
- sceneScrolView.AddChidren(sceneView);
- sceneView.InitControl(scene, room);
- }
- GetDelayScene(sceneScrolView);
- }
- }
-
- /// <summary>
- /// 鏄剧ず娌℃湁鍦烘櫙
- /// </summary>
- private void ShowNoSceneTip()
- {
- var noFunction = new Button()
- {
- Y = Application.GetRealHeight(320),
- Width = Application.GetMinRealAverage(757),
- Height = Application.GetMinRealAverage(435),
- UnSelectedImagePath = "Item/NoFunction.png",
- Gravity = Gravity.CenterHorizontal
- };
- functionSceneBodyView.AddChidren(noFunction);
-
- var noScenceTip = new Button()
- {
- Y = noFunction.Bottom + Application.GetRealHeight(32),
- Height = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(700),
- Gravity = Gravity.CenterHorizontal,
- Text = Language.StringByID(R.MyInternationalizationString.NoScene).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noScenceTip);
- }
-
-
- /// <summary>
- /// GetDelayScene
- /// </summary>
- /// <param name="scrolViewLayout"></param>
- private async void GetDelayScene(VerticalScrolViewLayout scrolViewLayout)
- {
- var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync();
- if (catDelaySceneResponseAllData == null)
- {
- return;
- }
- var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData;
- if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0)
- {
- return;
- }
- var delayList = catDelaySceneResponseData.DelayScenesList;
-
- for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
- {
- var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView;
- if (sceneView == null)
- {
- continue;
- }
- foreach (var delayScenesListResponseInfo in delayList)
- {
- if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
- {
- sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime;
- var remainTime = delayScenesListResponseInfo.RemainTime;
- if (remainTime > 0)
- {
- //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾)
- HdlSceneLogic.Current.StartDelayTimeThread(sceneView.scene);
- new System.Threading.Thread(() =>
- {
- while (remainTime > 0 && this.Parent != null)
- {
- System.Threading.Thread.Sleep(1000);
- Application.RunOnMainThread(() =>
- {
- sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime));
- });
- remainTime--;
- }
- Application.RunOnMainThread(() =>
- {
- if (this.Parent != null)
- {
- sceneView.SetTimeImage();
- }
- });
- })
- { IsBackground = true }.Start();
- }
- break;
- }
- }
- }
- }
-
- #endregion
-
- #region 鈼� 鑷姩鍖朹_________________________
-
- /// <summary>
- /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
- /// </summary>
- private void ShowAutotion()
- {
- // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-
- var bjFrameLayout = new FrameLayout
- {
- Width = Application.GetRealWidth(1080 - 58),
- Height = Application.GetRealHeight(170),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- X = Application.GetRealWidth(58),
- //Radius = (uint)Application.GetRealHeight(50),
- Y = Application.GetRealHeight(30),
- };
- functionSceneAutoBodyView.AddChidren(bjFrameLayout);
- bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
- var sigBtn = new Button
- {
- Width = Application.GetMinRealAverage(84),
- Height = Application.GetMinRealAverage(84),
- UnSelectedImagePath = "ZigeeLogic/sign.png",
- X = Application.GetRealWidth(58),
- Gravity = Gravity.CenterVertical,
- };
- bjFrameLayout.AddChidren(sigBtn);
-
- var recommendtextBtn = new Button
- {
- Width = Application.GetMinRealAverage(300),
- Height = Application.GetMinRealAverage(84),
- X = sigBtn.Right + Application.GetRealWidth(35),
- TextAlignment = TextAlignment.CenterLeft,
- //Text = "鎺ㄨ崘妯℃澘",
- TextID = MyInternationalizationString.logictemplate,
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.LogicBtnSelectedColor,
- TextSize = 15,
- };
- bjFrameLayout.AddChidren(recommendtextBtn);
-
- var recommendswitchBtn = new Button
- {
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(63),
- UnSelectedImagePath = "ZigeeLogic/logicclose.png",
- SelectedImagePath = "ZigeeLogic/logicopen.png",
- X = bjFrameLayout.Width - Application.GetRealWidth(104 + 58),
- Gravity = Gravity.CenterVertical,
- };
- bjFrameLayout.AddChidren(recommendswitchBtn);
-
-
- var scenehorizontalScrol = new HorizontalScrolViewLayout
- {
- Width = Application.GetRealWidth(1080 - 58),
- X = Application.GetRealWidth(58),
- Y = bjFrameLayout.Bottom + Application.GetRealHeight(30),
- Height = Application.GetRealHeight(0),
- };
- functionSceneAutoBodyView.AddChidren(scenehorizontalScrol);
-
- var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
- {
- Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
- //BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,/
- X = Application.GetRealWidth(58),
- Y = scenehorizontalScrol.Bottom,
- };
- functionSceneAutoBodyView.AddChidren(logicScrolView);
- logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
- bool no = false;
- recommendswitchBtn.MouseUpEventHandler += (sender, e) =>
- {
- int Yheight = 0;
- recommendswitchBtn.IsSelected = !recommendswitchBtn.IsSelected;
- scenehorizontalScrol.RemoveAll();
- if (recommendswitchBtn.IsSelected)
- {
- no = true;
- scenehorizontalScrol.Height = Application.GetRealHeight(246);
- Yheight = 20;
- for (int i = 1; i < 4; i++)
- {
-
- var frameLayout = new FrameLayout
- {
- Width = Application.GetMinRealAverage(369 + 46),
- Height = Application.GetMinRealAverage(246),
- };
- scenehorizontalScrol.AddChidren(frameLayout);
- var logiciocnBtn = new Button
- {
- Width = Application.GetMinRealAverage(369),
- Height = Application.GetMinRealAverage(246),
- UnSelectedImagePath = "ZigeeLogic/" + i + ".png",
- Tag = i,
- };
- frameLayout.AddChidren(logiciocnBtn);
-
- var logicnameBtn = new Button
- {
- Width = Application.GetMinRealAverage(250),
- Height = Application.GetMinRealAverage(80),
- X = Application.GetRealWidth(23),
- Y = Application.GetRealHeight(246 - 23 - 80),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize = 14,
- };
- frameLayout.AddChidren(logicnameBtn);
-
- if (i == 1)
- {
- logicnameBtn.Text = Language.StringByID(MyInternationalizationString.onlight);
- }
- else if (i == 2)
- {
- logicnameBtn.Text = Language.StringByID(MyInternationalizationString.offlight);
- }
- else if (i == 3)
- {
- logicnameBtn.Text = Language.StringByID(MyInternationalizationString.automation1);
- }
-
-
- EventHandler<MouseEventArgs> iconclick = (sender1, e1) =>
- {
- Common.Logic.CurrentLogic = new Common.Logic();
- Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
- if (logiciocnBtn.Tag.ToString() == "3")
- {
- Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;
- //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
- var addLogicPage = new Logic.AddLogicPage();
- HomePage.Instance.AddChidren(addLogicPage);
- HomePage.Instance.PageIndex += 1;
- addLogicPage.Show();
- }
- else
- {
-
- Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;
- //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
- Logic.TemplatePage templatePage = new Logic.TemplatePage();
- Logic.TemplatePage.s = logiciocnBtn.Tag.ToString();
- HomePage.Instance.AddChidren(templatePage);
- HomePage.Instance.PageIndex += 1;
- templatePage.Show();
- }
- };
- logiciocnBtn.MouseUpEventHandler += iconclick;
- logicnameBtn.MouseUpEventHandler += iconclick;
- }
- }
- else
- {
- no = false;
- scenehorizontalScrol.Height = Application.GetRealHeight(0);
- Yheight = 0;
- }
- logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight;
- logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
- Automationview(logicScrolView, no);
- };
- logicScrolView.BeginHeaderRefreshingAction += () =>
- {
- //閲嶆柊鍒锋柊logic鍒楄〃
- Common.Logic.LogicList.Clear();
- Read(logicScrolView, no);
- //鍏抽棴鍒锋柊View锛�
- logicScrolView.EndHeaderRefreshing();
- };
-
- Read(logicScrolView, no);
-
- }
- /// <summary>
- /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱
- /// </summary>
- /// <param name="logicScrolView"></param>
- private async void Read(VerticalRefreshLayout logicScrolView, bool no)
- {
- CommonPage.Loading.Start();
- if (Common.Logic.LogicList.Count == 0)
- {
- var Idlist = await Logic.Send.GetLogicId(0);
- if (Idlist.Count != 0)
- {
- var listlogic = await Logic.Send.ReadList(Idlist.Count, 0);
- //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆�
- for (int j = 0; j < listlogic.Count; j++)
- {
- var logic = listlogic[j];
- if (logic.LogicType != 0)
- {
- continue;
- }
- Common.Logic.LogicList.Add(logic);
- }
- }
- }
- //鑷姩鍖�
- Automationview(logicScrolView, no);
- CommonPage.Loading.Hide();
- }
- /// <summary>
- /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
- /// </summary>
- /// <param name="refresview">Refresview.</param>
- private async void Automationview(VerticalRefreshLayout refresview, bool no)
- {
- refresview.RemoveAll();
- if (Common.Logic.LogicList.Count == 0 && no == false)
- {
- //灏辨槸涓轰簡鏄剧ず寮曞娣诲姞鍥炬爣;
- refresview.BackgroundColor = 0x00000000;
- var noFrameLayout = new FrameLayout
- {
- Height = Application.GetRealHeight(434 + 200 + 32 + 160),
- //BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- refresview.AddChidren(noFrameLayout);
-
-
- var noIconBtn = new Button
- {
- Y = Application.GetRealHeight(160),
- Width = Application.GetMinRealAverage(756),
- Height = Application.GetMinRealAverage(434),
- UnSelectedImagePath = "Item/NoFunction.png",
- X = Application.GetRealWidth(104),
- };
- noFrameLayout.AddChidren(noIconBtn);
-
- var noTextBtn = new Button()
- {
- Y = noIconBtn.Bottom,
- Height = Application.GetRealHeight(200) + Application.GetRealHeight(32),
- Width = Application.GetRealWidth(700),
- //Gravity = Gravity.CenterHorizontal,
- Text = Language.StringByID(MyInternationalizationString.automationaddtext).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true,
- X = Application.GetRealWidth(190 - 58),
- };
- noFrameLayout.AddChidren(noTextBtn);
-
- }
- else
- {
-
- if (Common.Logic.LogicList.Count == 0 && no == true)
- {
- ///鏀瑰彉婊戝姩view鐨勯鑹诧紱
- refresview.BackgroundColor = 0x00000000;
- }
- else
- {
- refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
- }
- }
- foreach (var logic in Common.Logic.LogicList)
- {
-
-
- var logicRowlayout = new RowLayout
- {
- Height = Application.GetRealHeight(190 + 30),
- Width = Application.GetRealWidth(1080 - 58),
- LineColor = ZigbeeColor.Current.LogicBackgroundColor,
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-
- };
- refresview.AddChidren(logicRowlayout);
-
-
-
- var logicnameBtn = new Button
- {
- Height = Application.GetRealHeight(58),
- Width = Application.GetRealWidth(350),
- Text = logic.LogicName,
- X = Application.GetRealWidth(12 + 46),
- Y = Application.GetRealHeight(30),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextSize = 14,
- };
- logicRowlayout.AddChidren(logicnameBtn);
-
-
- var logicswitchBtn = new Button
- {
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(63),
- UnSelectedImagePath = "ZigeeLogic/logicclose.png",
- SelectedImagePath = "ZigeeLogic/logicopen.png",
- X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
- Y = Application.GetRealHeight(58 + 30 + 9 + 30),
- };
- logicRowlayout.AddChidren(logicswitchBtn);
-
-
-
- logicswitchBtn.MouseUpEventHandler += (sender1, e1) =>
- {
- logicswitchBtn.IsSelected = !logicswitchBtn.IsSelected;
- if (logicswitchBtn.IsSelected)
- {
- //閫昏緫寮�
- logic.IsEnable = 1;
- StatusColor(logic, logicRowlayout, 1);
- }
- else
- {
- //閫昏緫鍏�
- logic.IsEnable = 0;
- StatusColor(logic, logicRowlayout, 0);
- }
- Logic.Send.LogicControlSwitch(logic);
- //Logic.Send.AddModifyLogic(logic);
- };
- if (logic.IsEnable == 1)
- {
- logicswitchBtn.IsSelected = true;
- StatusColor(logic, logicRowlayout, 1);
- }
- else if (logic.IsEnable == 0)
- {
- logicswitchBtn.IsSelected = false;
- StatusColor(logic, logicRowlayout, 0);
- }
- ///缂栬緫
- var edit = new Button
- {
- BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
- Text = Language.StringByID(MyInternationalizationString.edit),
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- };
- logicRowlayout.AddRightView(edit);
- edit.MouseUpEventHandler += (sender, e) =>
- {
- Common.Logic.CurrentLogic = logic;
- var logicCommunalPage = new Logic.LogicCommunalPage();
- HomePage.Instance.AddChidren(logicCommunalPage);
- HomePage.Instance.PageIndex += 1;
- logicCommunalPage.Show(() =>
- {
- logicnameBtn.Text = logic.LogicName;
- Automationview(refresview, no);
- });
-
- };
-
-
- ///鍒犻櫎
- var del = new Button
- {
- BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
- Text = Language.StringByID(MyInternationalizationString.del),
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- };
- logicRowlayout.AddRightView(del);
- del.MouseUpEventHandler += (sender, e) =>
- {
- var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
- Language.StringByID(MyInternationalizationString.doyouwanttodelete),
- Language.StringByID(MyInternationalizationString.confrim));
- alert.Show();
- alert.ConfirmClickEvent += () =>
- {
- Common.Logic.LogicList.Remove(logic);
- Automationview(refresview, no);
- Logic.Send.DelLogic(logic.LogicId);
- };
-
- };
- var line = new Button
- {
- Y = Application.GetRealHeight(215),
- Height = Application.GetRealHeight(5),
- Width = Application.GetRealWidth(1080 - 58),
- BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- X = Application.GetRealWidth(58),
- };
- logicRowlayout.AddChidren(line);
- }
-
- }
- /// <summary>
- /// 鏄剧ず鑷姩鍖栬緭鍑哄姛鑳芥ā鍧楀浘鏍囩殑棰滆壊
- /// </summary>
- /// <param name="logic"></param>
- /// <param name="logicRowlayout"></param>
- /// <param name="intvalue"></param>
- private void StatusColor(Common.Logic logic, RowLayout logicRowlayout, int intvalue)
- {
-
- var logictimeBtn = new Button
- {
- Height = Application.GetRealHeight(58),
- Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350),
- Y = Application.GetRealHeight(30),
- X = Application.GetRealWidth(365),
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.LogicListWeekTextColor,
- };
- logicRowlayout.AddChidren(logictimeBtn);
-
- ///鏄剧ず鎵ц鍛ㄦ湡
- switch (logic.TimeAttribute.Repeat)
- {
- ///0:鍙墽琛屼竴娆★紝鎵ц鍚嶪sEnable鍊肩疆;1,浠婂勾鍐呮墽琛�;2锛氭瘡澶╂墽琛�;3锛氭瘡鏈堟墽琛�;4锛氭瘡骞存墽琛�;5锛氬懆閲嶅銆�
- case 0:
- {
- logictimeBtn.Text = Language.StringByID(MyInternationalizationString.executeonce);
- }; break;
- case 1: { }; break;
- case 2:
- {
- logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyday);
- }; break;
- case 3:
- {
-
- string len = "", value = "";
- var stringvalue = Convert.ToString(logic.TimeAttribute.MonthDate, 2);
- var str = stringvalue.Insert(0, new string('0', 32 - stringvalue.Length));
- for (int j = 31; j >= 0; j--)
- {
- len += str.Substring(j, 1);
- }
- for (int j = 0; j < len.Length; j++)
- {
- var strvalue = len.Substring(j, 1);
- if (strvalue == "1")
- {
- value += (j + 1).ToString() + ",";
- }
- }
- logictimeBtn.Text = Language.StringByID(MyInternationalizationString.monthly) + value.TrimEnd(',') + Language.StringByID(MyInternationalizationString.day);
-
- }; break;
- case 4:
- {
-
- Dictionary<int, int> dictionary = new Dictionary<int, int>();
- ///鎵惧嚭鎵ц鐨勬湀浠藉拰澶╂暟
- if (logic.TimeAttribute.SelectMonDate.Count != 0)
- {
- for (int i = 0; i < logic.TimeAttribute.SelectMonDate.Count; i++)
- {
- var dayvalue = logic.TimeAttribute.SelectMonDate[i];
- if (dayvalue != 0)
- {
- dictionary.Add(i + 1, dayvalue);
- }
- }
- }
- if (dictionary.Count != 0 && dictionary.Count == 1)
- {
- string len = "", leng = "";
- int minvalue = 0, Maximum = 0;
- foreach (var value in dictionary)
- {
- ///鍙栧嚭鏈堜唤
- var month = value.Key;
- ///鍙栧嚭鏃ユ暟
- var day = value.Value;
- var maxvalue = Convert.ToString(day, 2);
- var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
- for (int j = 31; j >= 0; j--)
- {
- len += str.Substring(j, 1);
- }
-
- for (int j = 0; j < len.Length; j++)
- {
- var strvalue = len.Substring(j, 1);
- if (strvalue == "1")
- {
- minvalue = j + 1;
- break;
- }
- }
- for (int j = 0; j < len.Length; j++)
- {
- var strvalue = len.Substring(j, 1);
- if (strvalue == "1")
- {
- Maximum = j + 1;
- }
- }
-
- if (month.ToString().Length < 2)
- {
- leng = "0" + month.ToString();
- }
- else
- {
- leng = month.ToString();
- }
- if (minvalue == Maximum)
- {
- logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString());
- }
- else
- {
- logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-" + leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
- }
- }
-
- }
- else
- {
- int b = 0;
- string stringtext = "";
- foreach (var value in dictionary)
- {
- string len = "", leng = "";
- int minvalue = 0, Maximum = 0;
- ///鍙栧嚭鏈堜唤
- var month = value.Key;
- ///鍙栧嚭鏃ユ暟
- var day = value.Value;
- var maxvalue = Convert.ToString(day, 2);
- var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
- for (int j = 31; j >= 0; j--)
- {
- len += str.Substring(j, 1);
- }
-
-
- if (month.ToString().Length < 2)
- {
- leng = "0" + month.ToString();
- }
- else
- {
- leng = month.ToString();
- }
-
-
-
- if (b == 0)
- {
- for (int j = 0; j < len.Length; j++)
- {
- var strvalue = len.Substring(j, 1);
- if (strvalue == "1")
- {
- minvalue = j + 1;
- break;
- }
- }
- stringtext += leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-";
-
- }
-
- if (b == dictionary.Count - 1)
- {
- for (int j = 0; j < len.Length; j++)
- {
- var strvalue = len.Substring(j, 1);
- if (strvalue == "1")
- {
- Maximum = j + 1;
- }
- }
- stringtext += leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-
- }
- b++;
- }
- logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + stringtext;
- }
-
- }; break;
- case 5:
- {
- string len = "", text = "";
- List<int> listvalueInt = new List<int>();
- listvalueInt.Clear();
- var maxvalue = Convert.ToString(logic.TimeAttribute.WeekDay, 2);
- var str = maxvalue.Insert(0, new string('0', 8 - maxvalue.Length));
- for (int j = 7; j >= 0; j--)
- {
- len += str.Substring(j, 1);
- }
-
- for (int j = 0; j < len.Length; j++)
- {
- var strvalue = len.Substring(j, 1);
- if (strvalue == "1")
- {
- listvalueInt.Add(j + 1);
-
-
- if ((j + 1) == 1)
- {
- text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.mon1) + ",";
- //text += Language.StringByID(MyInternationalizationString.mon) + ",";
- }
- else if ((j + 1) == 2)
- {
- text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.tue1) + ",";
- //text += Language.StringByID(MyInternationalizationString.tue) + ",";
- }
- else if ((j + 1) == 3)
- {
- text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.wed1) + ",";
- //text += Language.StringByID(MyInternationalizationString.wed) + ",";
- }
- else if ((j + 1) == 4)
- {
- text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.thu1) + ",";
- //text += Language.StringByID(MyInternationalizationString.thu) + ",";
- }
- else if ((j + 1) == 5)
- {
- text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.frl1) + ",";
- //text += Language.StringByID(MyInternationalizationString.frl) + ",";
- }
- else if ((j + 1) == 6)
- {
- text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sat1) + ",";
- //text += Language.StringByID(MyInternationalizationString.sat) + ",";
- }
- else if ((j + 1) == 7)
- {
- text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sun1) + ",";
- //text += Language.StringByID(MyInternationalizationString.sun) + ",";
- }
-
-
- }
- }
- //鏆傛椂闅愯棌鎺夛紝闇�瑕佹樉绀哄懆鏈拰宸ヤ綔鏃ュ啀鏀惧紑锛�
- //if (listvalueInt.Count == 5 && !listvalueInt.Contains(6) && !listvalueInt.Contains(7))
- //{
- // btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.workingday);
- //}
- //else if (listvalueInt.Count == 2 && listvalueInt.Contains(6) && listvalueInt.Contains(7))
- //{
- // btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.weekend);
- //}
- //else if (listvalueInt.Count == 7)
- //{
- // btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
- //}
- //else
- //{
- // btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
- //}
- logictimeBtn.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
- //btndisplaycycle.Text = text.TrimEnd(',');
- }; break;
- }
-
- List<string> indexlist = new List<string>();
- List<string> iconIndexlist = new List<string>();
- for (int i = 0; i < logic.Actions.Count; i++)
- {
- var linkType = logic.Actions[i]["LinkType"].ToString();
- var d = indexlist.Find((value) => { return value == linkType; });
- if (d == null)
- {
- indexlist.Add(linkType);
- }
- }
- if (indexlist.Contains("0"))
- {
- iconIndexlist.Add("0");
- }
- if (indexlist.Contains("2"))
- {
- iconIndexlist.Add("2");
- }
- if (indexlist.Contains("6"))
- {
- iconIndexlist.Add("6");
- }
- if (indexlist.Contains("7"))
- {
- iconIndexlist.Add("7");
- }
- for (int i = 0; i < iconIndexlist.Count; i++)
- {
- var iconindex = iconIndexlist[i];
- var typebjBtn = new FrameLayout
- {
- Width = Application.GetRealWidth(82),
- Height = Application.GetRealHeight(82),
- X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i),
- Y = Application.GetRealHeight(58 + 30 + 30),
- Radius = (uint)Application.GetRealHeight(41),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- logicRowlayout.AddChidren(typebjBtn);
-
- var typeIconBtn = new Button
- {
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
- Gravity = Gravity.Center,
-
- };
- typebjBtn.AddChidren(typeIconBtn);
-
- var connectIconBtn = new Button
- {
- Y = typebjBtn.Y + Application.GetRealHeight(35),
- X = Application.GetRealWidth(58) + Application.GetRealWidth((12 + 82 + 12) + (12 + 45 + 82 + 12) * i),
- Width = Application.GetRealWidth(48),
- Height = Application.GetRealHeight(15),
- UnSelectedImagePath = "ZigeeLogic/connect.png",
- };
- logicRowlayout.AddChidren(connectIconBtn);
- if (iconIndexlist.Count - 1 == i)
- {
- connectIconBtn.Visible = false;
- }
- switch (iconindex)
- {
- case "0":
- {
- if (intvalue == 1)
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/function1.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicFunction1Color;
- }
- else
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nofunction.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
- }
- }
- break;
- case "2":
- {
-
- if (intvalue == 1)
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/scene1.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicScene1Color;
- }
- else
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/noscene.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
- }
-
- }
- break;
- case "6":
- {
- if (intvalue == 1)
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/security1.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicSecurity1Color;
-
- }
- else
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nosecurity.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
- }
-
- }
- break;
- case "7":
- {
- if (intvalue == 1)
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/delay1.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicDelay1Color;
- }
- else
- {
- typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nodelay.png";
- typebjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
- }
-
- }
- break;
-
- }
- }
- }
-
- #endregion
-
- #region 鈼� 鎺у埗鐘舵�乢________________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == tempDevice.DeviceEpoint && obj.DeviceAddr == tempDevice.DeviceAddr))
- {
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鍏ㄩ儴鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveAllUpdateControlDeviceStatuAction()
- {
- foreach (var gateway in zbGatewayList)
- {
- //绉婚櫎action
- if (gateway != null)
- {
- gateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
- }
-
- /// <summary>
- /// 绉婚櫎鍗曚釜鎺у埗璁惧鐨勬洿鏂扮姸鎬乤ction
- /// </summary>
- /// <param name="gateway">Gateway.</param>
- private void RemoveUpdateControlDeviceStatuAction(ZbGateway gateway)
- {
- //绉婚櫎action
- if (gateway != null)
- {
- gateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- /// <summary>
- /// 娣诲姞闇�瑕佺洃鎺у洖璋冪姸鎬佺殑缃戝叧鍜岃澶�
- /// </summary>
- /// <param name="gatewayList">Gateway list.</param>
- /// <param name="gateway">Gateway.</param>
- /// <param name="deviceList">Device list.</param>
- /// <param name="common">Common.</param>
- private void AddZbGateway(List<ZbGateway> gatewayList, ZbGateway gateway, List<CommonDevice> deviceList, CommonDevice common)
- {
- if (null == gatewayList.Find((obj) => obj.getGatewayBaseInfo.gwID == gateway.getGatewayBaseInfo.gwID))
- {
- gatewayList.Add(gateway);
- }
- if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == common.DeviceEpoint && obj.DeviceAddr == common.DeviceAddr))
- {
- commonDeviceList.Add(common);
- }
- }
-
- #endregion
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp20200414/Shared/Phone/Device/Category/CategoryAddScene.cs
deleted file mode 100755
index 4da2ebb..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Category/CategoryAddScene.cs
+++ /dev/null
@@ -1,1912 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Globalization;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.Room;
-using Shared.Phone.UserCenter;
-using ZigBee.Device;
-using static ZigBee.Device.Scene;
-
-namespace Shared.Phone.Device.Category
-{
- public class CategoryAddScene : FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- ///// <summary>
- ///// floorIds
- ///// </summary>
- //List<string> floorIds = new List<string> { };
- ///// <summary>
- ///// floorNames
- ///// </summary>
- //List<string> floorNames = new List<string> { };
- ///// <summary>
- ///// roomNames
- ///// </summary>
- //List<List<string>> roomNames = new List<List<string>> { };
- ///// <summary>
- ///// roomNames
- ///// </summary>
- //List<List<Common.Room>> rooms = new List<List<Common.Room>> { };
- /// <summary>
- /// ImagePath
- /// </summary>
- private string ImagePath = "SceneIcon/1.png";
- /// <summary>
- /// 鍥剧墖鏉ユ簮 0--鏈湴鍥惧簱 1--鎷嶇収 2--绯荤粺鍥惧簱
- /// </summary>
- public int IconPathType = 0;
- /// <summary>
- /// curRoom
- /// </summary>
- private Common.Room curRoom;
- /// <summary>
- /// sceneTargetDevicesList
- /// </summary>
- private List<SceneTargetDeviceUI> sceneTargetDevicesList = new List<SceneTargetDeviceUI> { };
- /// <summary>
- /// 娣诲姞鐩爣鍚庣殑灞曠ず鍒楄〃
- /// </summary>
- public FrameLayout TargetListScrolView;
- /// <summary>
- /// The confirm button.
- /// </summary>
- private CommonForm.CompleteButton confirmBtn;
-
- /// <summary>
- /// backGround
- /// </summary>
- private ImageView backGround;
-
- /// <summary>
- /// 鏄惁淇敼
- /// </summary>
- public bool isModify;
- /// <summary>
- /// 淇敼鐨勫満鏅�
- /// </summary>
- public SceneUI modifySceneUI;
- /// <summary>
- /// 璁板綍缂栬緫鍓嶇殑璁惧鍒楄〃
- /// </summary>
- public List<SceneTargetDeviceUI> modifySceneTargetDevicesList;
- /// <summary>
- /// modifyRoom
- /// </summary>
- public Common.Room modifyRoom;
-
- /// <summary>
- /// OldBackgroundImagePath
- /// </summary>
- private string OldBackgroundImagePath;
- /// <summary>
- /// OldIconPathType
- /// </summary>
- public int OldIconPathType;
-
- /// <summary>
- /// selectedTimeAction
- /// </summary>
- private Action<SceneTargetDeviceUI> selectedAction;
- /// <summary>
- /// 淇敼鍦烘櫙action
- /// </summary>
- public Action<SceneUI, Common.Room> EditorAction;
- /// <summary>
- /// 娣诲姞鍦烘櫙action
- /// </summary>
- public Action AddAction;
-
- #endregion
-
- /// <summary>
- /// CategoryAddScene
- /// </summary>
- public CategoryAddScene()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
- /// <summary>
- /// RemoveFromParent
- /// </summary>
- public override void RemoveFromParent()
- {
- UserView.HomePage.Instance.ScrollEnabled = true;
- base.RemoveFromParent();
- }
- /// <summary>
- ///鍒锋柊娣诲姞鐩爣鍚庣殑灞曠ず鍒楄〃
- /// </summary>
- public void RefreshTargetListView()
- {
- UserView.HomePage.Instance.ScrollEnabled = false;
- TargetListScrolView.RemoveAll();
- TargetListScrolView.Height = Application.GetRealHeight(173);
- var TargetListScrolBackView = new FrameLayout()
- {
- Height = Application.GetRealHeight(173),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- TargetListScrolView.AddChidren(TargetListScrolBackView);
-
- if (sceneTargetDevicesList.Count > 0)
- {
- if (sceneTargetDevicesList.Count > 1)
- {
- TargetListScrolView.Height = Application.GetRealHeight(140 * sceneTargetDevicesList.Count) + Application.GetRealHeight(200);
- TargetListScrolBackView.Height = Application.GetRealHeight(140 * sceneTargetDevicesList.Count + 13);
- }
-
- for (int i = 0; i < sceneTargetDevicesList.Count; i++)
- {
- var targetDevice = sceneTargetDevicesList[i];
- var targetRowLayout = new RowLayout()
- {
- Y = Application.GetRealHeight(i * 140),
- Height = Application.GetRealHeight(140),
- LineColor = ZigbeeColor.Current.GXCClearColor,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- SubViewWidth = Application.GetRealWidth(184)
- };
- TargetListScrolView.AddChidren(targetRowLayout);
- string devImgPath = string.Empty;
- string devNameText = string.Empty;
- if (targetDevice.Type == 0)
- {
- if (targetDevice.DeviceUI == null) continue;
- devImgPath = targetDevice.DeviceUI.IconPath;
- devNameText = Common.LocalDevice.Current.GetDeviceEpointName(targetDevice.DeviceUI);
-
- var targetRow = new SceneTargetFunctionRow(13);
- targetRow.Init();
- targetRow.SetIcon(devImgPath);
- targetRow.SetNameText(devNameText);
- targetRow.SetZoneText(HdlRoomLogic.Current.GetRoomNameByDevice(targetDevice.DeviceUI, ","));
- targetRow.SetStatuText(targetDevice.GetDeviceStatu());
- targetRowLayout.AddChidren(targetRow);
- if (i == sceneTargetDevicesList.Count - 1)
- {
- targetRow.HideLine(true);
- }
- }
- else if (targetDevice.Type == 2)
- {
- devNameText = CommonFormResouce.GetTimeString(targetDevice.DelayTime);
- devNameText += Language.StringByID(R.MyInternationalizationString.Later);
- var targetRow = new SceneTargetTimeRow(13);
- targetRow.Init();
- targetRow.SetTitle(devNameText);
- targetRowLayout.AddChidren(targetRow);
- if (i == sceneTargetDevicesList.Count - 1)
- {
- targetRow.HideLine(true);
- }
- }
- else if (targetDevice.Type == 1)
- {
- devImgPath = "Scene/SceneIcon.png";
- devNameText = targetDevice.SceneName;
-
- var targetRow = new SceneTargetFunctionRow(13);
- targetRow.Init();
- targetRow.SetIcon(devImgPath);
- targetRow.SetNameText(devNameText);
- targetRow.SetZoneText(HdlSceneLogic.Current.GetZoneById(targetDevice.SceneUI.Id));
- targetRowLayout.AddChidren(targetRow);
- if (i == sceneTargetDevicesList.Count - 1)
- {
- targetRow.HideLine(true);
- }
- }
-
- var editBtn = new RowLayoutEditButton();
- targetRowLayout.AddRightView(editBtn);
- //缂栬緫璁惧
- editBtn.MouseUpEventHandler += detailMouseUpEventHandler;
- var delBtn = new RowLayoutDeleteButton();
- targetRowLayout.AddRightView(delBtn);
- //鍒犻櫎璁惧
- delBtn.MouseUpEventHandler += (sender, e) =>
- {
- sceneTargetDevicesList.Remove(targetDevice);
- RefreshTargetListView();
- };
-
- //璁惧璇︾粏璁剧疆鐣岄潰
- void detailMouseUpEventHandler(object sender, MouseEventArgs e)
- {
- if (targetDevice.Type == 0)
- {
- if (targetDevice.DeviceUI == null)
- {
- return;
- }
-
- ShowSelectAction(targetDevice.DeviceUI, targetDevice);
- selectedAction = (selectedDevice) =>
- {
- var targetDeviceUI = sceneTargetDevicesList.Find((obj) => obj.SceneTargetDeviceUIID == selectedDevice.SceneTargetDeviceUIID);
- if (targetDeviceUI != null)
- {
- targetDeviceUI.DeviceUI = selectedDevice.DeviceUI;
- targetDeviceUI.TaskList = selectedDevice.TaskList;
- }
- RefreshTargetListView();
- };
-
- }
- else if (targetDevice.Type == 2)
- {
- var delayTimeView = new SelectDelayTime();
- UserView.HomePage.Instance.AddChidren(delayTimeView);
- UserView.HomePage.Instance.PageIndex += 1;
- delayTimeView.sceneTargetDevice = targetDevice;
- delayTimeView.totalSecond = targetDevice.DelayTime;
- delayTimeView.Show();
- delayTimeView.selectedTimeAction = (second) =>
- {
- var targetDeviceUI = sceneTargetDevicesList.Find((obj) => obj.SceneTargetDeviceUIID == second.SceneTargetDeviceUIID);
- if (targetDeviceUI != null)
- {
- targetDeviceUI.DelayTime = second.DelayTime;
- }
- RefreshTargetListView();
- };
- }
- else if (targetDevice.Type == 1)
- {
- var sceneView = new SelectScene();
- UserView.HomePage.Instance.AddChidren(sceneView);
- UserView.HomePage.Instance.PageIndex += 1;
- sceneView.sceneTargetDevice = targetDevice;
- sceneView.sceneUI = targetDevice.SceneUI;
- sceneView.currentSceneUI = modifySceneUI;
- sceneView.Show();
- sceneView.selectedAction = (selectedScene) =>
- {
- var targetDeviceUI = sceneTargetDevicesList.Find((obj) => obj.SceneTargetDeviceUIID == selectedScene.SceneTargetDeviceUIID);
- if (targetDeviceUI != null)
- {
- targetDeviceUI.SceneName = selectedScene.SceneName;
- targetDevice.SceneUI = selectedScene.SceneUI;
- targetDevice.ElseScenesId = selectedScene.ElseScenesId;
- }
- RefreshTargetListView();
- };
- }
- }
- }
- }
- }
- /// <summary>
- /// Show this instance.
- /// </summary>
- public void Show()
- {
- Init();
-
- AddTop();
-
- AddBodyView();
-
- }
-
- #region Add____________________________________
-
- /// <summary>
- /// Init
- /// </summary>
- private void Init()
- {
-
- }
-
- /// <summary>
- /// AddTop
- /// </summary>
- private void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- if (isModify)
- {
- top.SetTopTitle(R.MyInternationalizationString.EditorScene);
- }
- else
- {
- top.SetTopTitle(R.MyInternationalizationString.AddScence);
- }
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- private void AddBodyView()
- {
- var bodyScrolView = new VerticalScrolViewLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyScrolView);
-
- bodyFrameLayout = new FrameLayout()
- {
- Height = Application.GetRealHeight(1086 + 127),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- bodyScrolView.AddChidren(bodyFrameLayout);
-
- var imgFL = new FrameLayout
- {
- Height = Application.GetRealHeight(559),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(imgFL);
-
- var backGround1 = new ImageView()
- {
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinRealAverage(916),
- Height = Application.GetMinRealAverage(487),
- Gravity = Gravity.CenterHorizontal,
- ImagePath = "Room/Room_Rectangle.png"
- };
- imgFL.AddChidren(backGround1);
-
- backGround = new ImageView()
- {
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinRealAverage(887),
- Height = Application.GetMinRealAverage(444),
- Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius),
- ImagePath = "SceneIcon/3.png"
- };
- imgFL.AddChidren(backGround);
-
- var infoFL = new FrameLayout
- {
- Y = imgFL.Bottom + Application.GetRealHeight(23),
- Height = Application.GetRealHeight(418),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(infoFL);
-
- var infoEdit = new Button
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(130),
- Width = Application.GetRealWidth(700),
- TextID = R.MyInternationalizationString.EditInfo,
- TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = 15,
- //IsBold=true
- };
- infoFL.AddChidren(infoEdit);
-
-
- var nameRow = new DeviceInfoEditRow(130);
- nameRow.Init();
- nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.SceneName)}:");
- nameRow.SetPlaceHoldText(R.MyInternationalizationString.PleaseInputSceneName);
- infoFL.AddChidren(nameRow);
-
- var zoneRow = new DeviceInfoRow(257);
- zoneRow.Y = nameRow.Bottom + Application.GetRealHeight(14);
- zoneRow.Init();
- zoneRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongZone)}:");
- //zoneRow.SetTitle(curRoom.Name);
- infoFL.AddChidren(zoneRow);
- zoneRow.HideLine(true);
-
- var targetFL = new FrameLayout()
- {
- Y = infoFL.Bottom + Application.GetRealHeight(23),
- Height = Application.GetRealHeight(346)
- };
- bodyFrameLayout.AddChidren(targetFL);
-
- var targetBG = new FrameLayout
- {
- Height = Application.GetRealHeight(334),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- targetFL.AddChidren(targetBG);
-
- var addTargetFL = new FrameLayout
- {
- Y = Application.GetRealHeight(46),
- Height = Application.GetRealHeight(127),
- };
- targetFL.AddChidren(addTargetFL);
-
- var target = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(127) - 1,
- Width = Application.GetRealWidth(600),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextID = R.MyInternationalizationString.AddScentTargetAction,
- Gravity = Gravity.CenterVertical,
- TextSize = 15
- };
- addTargetFL.AddChidren(target);
-
- var targetAdd = new Button
- {
- X = Application.GetRealWidth(950),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinRealAverage(72),
- Height = Application.GetMinRealAverage(72),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Add.png",
- };
- addTargetFL.AddChidren(targetAdd);
- var targetLine = new Button()
- {
- Y = target.Bottom,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- addTargetFL.AddChidren(targetLine);
-
- TargetListScrolView = new FrameLayout()
- {
- Height = Application.GetRealHeight(173)
- };
- bodyScrolView.AddChidren(TargetListScrolView);
-
-
-
- confirmBtn = new CommonForm.CompleteButton(1656, 907, 127);
- confirmBtn.TextID = R.MyInternationalizationString.uFinish;
- AddChidren(confirmBtn);
-
- if (isModify)
- {
- IconPathType = modifySceneUI.IconPathType;
- OldIconPathType = modifySceneUI.IconPathType;
- if (IconPathType != 0)
- {
- OldBackgroundImagePath = modifySceneUI.IconPath;
- }
- if (modifySceneUI.IconPathType == 0)
- {
- backGround.ImagePath = modifySceneUI.IconPath;
- }
- else
- {
- backGround.ImagePath = System.IO.Path.Combine(Config.Instance.FullPath, modifySceneUI.IconPath);
- }
- nameRow.SetTitle(modifySceneUI.Name);
- if (Config.Instance.Home.FloorDics.Count == 0)
- {
- zoneRow.SetTitle($"{modifyRoom.Name}");
- }
- else
- {
- zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(modifyRoom.FloorId)}锛寋modifyRoom.Name}");
- }
- curRoom = modifyRoom;
- sceneTargetDevicesList.AddRange(modifySceneTargetDevicesList);
- }
-
- RefreshTargetListView();
-
- #region event
-
- EventHandler<MouseEventArgs> backGroundIMGHander = (sender, e) =>
- {
- if (curRoom != null && curRoom.IsSharedRoom)
- {
- RoomCommon.ShowTipRoomIsShared();
- return;
- }
-
- int selectRow_Height = 150;
- int selectRow_Width = 1034;
- var selectFL = new FrameLayout()
- {
- BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
- };
- AddChidren(selectFL);
-
- var itemFL = new FrameLayout()
- {
- Y = Application.GetRealHeight(1276),
- Height = Application.GetRealHeight(450),
- Width = Application.GetRealWidth(selectRow_Width),
- Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetRealHeight(35),
- BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor
- };
- selectFL.AddChidren(itemFL);
- //itemFL.Animate = Animate.DownToUp;
-
- var selectLocalPicture = new Button()
- {
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.LocalPicture,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectLocalPicture);
- var selectLocalLine = new Button()
- {
- Y = selectLocalPicture.Bottom,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- itemFL.AddChidren(selectLocalLine);
-
- var selectPhotographBtn = new Button()
- {
- Y = selectLocalLine.Bottom,
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.Photograph,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectPhotographBtn);
- var selectPhotographLine = new Button()
- {
- Y = selectPhotographBtn.Bottom,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- itemFL.AddChidren(selectPhotographLine);
-
- var selectAblumsBtn = new Button()
- {
- Y = selectPhotographLine.Bottom,
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.MyAblums,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectAblumsBtn);
-
- var cancelBtn = new Button()
- {
- Y = Application.GetRealHeight(1742),
- Height = Application.GetRealHeight(selectRow_Height),
- Width = Application.GetRealWidth(selectRow_Width),
- Gravity = Gravity.CenterHorizontal,
- TextID = R.MyInternationalizationString.Cancel,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor,
- Radius = (uint)Application.GetRealHeight(35),
- TextSize = 17
- };
- selectFL.AddChidren(cancelBtn);
-
- selectLocalPicture.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var localPic = new CategorySceneSelectImgByLocal();
- Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- localPic.Show();
- localPic.action = (imgPath) =>
- {
- IconPathType = 0;
- backGround.ImageBytes = null;
- backGround.ImagePath = imgPath;
- };
- };
- selectPhotographBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
- var fileName = $"SceneIcon_{tradeTime}.png";
- //閫氳繃鐩告満鎷嶇収瑁佸壀
- CropImage.TakePicture((imagePath) =>
- {
- if (string.IsNullOrEmpty(imagePath))
- {
- return;
- }
- if (isModify)
- {
- if (IconPathType != 0)
- {
- Global.DeleteFilebyHomeId(backGround.ImagePath);
- HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
- }
- }
-
- IconPathType = 1;
- backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
- backGround.ImagePath = imagePath;
- System.IO.File.Delete(imagePath);
-
- }, fileName, 2, 1);
- };
-
- selectAblumsBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
- var fileName = $"SceneIcon_{tradeTime}.png";
- //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
- CropImage.SelectPicture((imagePath) =>
- {
- if (string.IsNullOrEmpty(imagePath))
- {
- return;
- }
- if (isModify)
- {
- if (IconPathType != 0)
- {
- Global.DeleteFilebyHomeId(backGround.ImagePath);
- HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
- }
- }
-
- IconPathType = 2;
- backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
- backGround.ImagePath = imagePath;
- System.IO.File.Delete(imagePath);
-
- }, fileName, 2, 1);
- };
-
- cancelBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- };
- selectFL.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- };
- };
- backGround.MouseUpEventHandler += backGroundIMGHander;
-
- //鍖哄煙
- EventHandler<MouseEventArgs> zoneHander = (sender, e) =>
- {
- var zone = new SelectZone();
- zone.Init();
- zone.ZoneAction += (selectRoom) =>
- {
- curRoom = selectRoom;
- zoneRow.SetTitle(HdlRoomLogic.Current.GetZoneName(selectRoom));
- };
- };
- zoneRow.ClickBtn.MouseUpEventHandler += zoneHander;
-
- //鎵ц鐩爣-娣诲姞鎵ц璁惧
- EventHandler<MouseEventArgs> targetAddHander = (sender, e) =>
- {
-
- //if (curRoom == null)
- //{
- // RoomCommon.ShowTipNoRoom();
- // return;
- //}
- if (curRoom != null)
- {
- if (curRoom.IsSharedRoom)
- {
- RoomCommon.ShowTipRoomIsShared();
- return;
- }
- }
-
- int selectRow_Height = 150;
- int selectRow_Width = 1034;
- var selectFL = new FrameLayout()
- {
- BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
- };
- AddChidren(selectFL);
-
- var itemFL = new FrameLayout()
- {
- Y = Application.GetRealHeight(1276),
- Height = Application.GetRealHeight(450),
- Width = Application.GetRealWidth(selectRow_Width),
- Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetRealHeight(35),
- BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor
- };
- selectFL.AddChidren(itemFL);
- //itemFL.Animate = Animate.DownToUp;
-
- var selectedFunctionBtn = new Button()
- {
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.Function,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectedFunctionBtn);
- var selectedFunctionLine = new Button()
- {
- Y = selectedFunctionBtn.Bottom,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- itemFL.AddChidren(selectedFunctionLine);
-
- var selectedSceneBtn = new Button()
- {
- Y = selectedFunctionLine.Bottom,
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.Scence,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectedSceneBtn);
- var selectedSceneLine = new Button()
- {
- Y = selectedSceneBtn.Bottom,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- itemFL.AddChidren(selectedSceneLine);
-
- var selectedTimerBtn = new Button()
- {
- Y = selectedSceneLine.Bottom,
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.Delay,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectedTimerBtn);
-
-
- var cancelBtn = new Button()
- {
- Y = Application.GetRealHeight(1742),
- Height = Application.GetRealHeight(selectRow_Height),
- Width = Application.GetRealWidth(selectRow_Width),
- Gravity = Gravity.CenterHorizontal,
- TextID = R.MyInternationalizationString.Cancel,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor,
- Radius = (uint)Application.GetRealHeight(35),
- TextSize = 17
- };
- selectFL.AddChidren(cancelBtn);
-
- //娣诲姞鍔熻兘
- selectedFunctionBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var deviceView = new SelectDevice();
- UserView.HomePage.Instance.AddChidren(deviceView);
- UserView.HomePage.Instance.PageIndex += 1;
- deviceView.beforeSceneTargetDeviceUIs = sceneTargetDevicesList;
- deviceView.Show();
- deviceView.selectedAction = (selectedDevice) =>
- {
- sceneTargetDevicesList.Add(selectedDevice);
- RefreshTargetListView();
- };
- };
- //娣诲姞鍦烘櫙
- selectedSceneBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var sceneView = new SelectScene();
- UserView.HomePage.Instance.AddChidren(sceneView);
- UserView.HomePage.Instance.PageIndex += 1;
- sceneView.beforeSceneTargetDeviceUIs = sceneTargetDevicesList;
- sceneView.currentSceneUI = modifySceneUI;
- sceneView.Show();
- sceneView.selectedAction = (selectedScene) =>
- {
- sceneTargetDevicesList.Add(selectedScene);
- RefreshTargetListView();
- };
-
- };
- //娣诲姞鏃堕棿闂撮殧
- selectedTimerBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var delayTimeView = new SelectDelayTime();
- UserView.HomePage.Instance.AddChidren(delayTimeView);
- UserView.HomePage.Instance.PageIndex += 1;
- delayTimeView.Show();
- delayTimeView.selectedTimeAction = (second) =>
- {
- sceneTargetDevicesList.Add(second);
- RefreshTargetListView();
- };
- };
-
- cancelBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- };
- selectFL.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- };
- };
- targetAdd.MouseUpEventHandler += targetAddHander;
- targetFL.MouseUpEventHandler += targetAddHander;
- target.MouseUpEventHandler += targetAddHander;
- addTargetFL.MouseUpEventHandler += targetAddHander;
- //纭畾娣诲姞鐩爣
- confirmBtn.MouseUpEventHandler += async (sender, e) =>
- {
- if (curRoom == null)
- {
- RoomCommon.ShowTipNoRoom();
- return;
- }
- if (curRoom.IsSharedRoom)
- {
- RoomCommon.ShowTipRoomIsShared();
- return;
- }
-
- if (isModify)
- {
- if (string.IsNullOrEmpty(nameRow.NameText.Text))
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull));
- return;
- }
- else
- {
- try
- {
- var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
- var fileName = $"SceneIcon_{tradeTime}.png";
- if (modifySceneUI.Name != nameRow.NameText.Text.Trim())
- {
- if (HdlSceneLogic.Current.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist));
- return;
- }
- var r = await ZigBee.Device.Scene.RenameSceneAsync(modifySceneUI.Id, nameRow.NameText.Text.Trim());
- var reName = r.sceneRenameResponseData.Result;
- if (reName == 0)
- {
- return;
- }
- else if (reName == 1)
- {
- modifySceneUI.Name = nameRow.NameText.Text.Trim();
-
- }
- else if (reName == 2)
- {
- return;
- }
- }
- if (OldIconPathType != 0)
- {
- Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
- HdlAutoBackupLogic.DeleteFile(OldBackgroundImagePath);
- }
- if (IconPathType == 1 || IconPathType == 2)
- {
- Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
- HdlAutoBackupLogic.AddOrEditorFile(fileName);
- modifySceneUI.IconPath = fileName;
- }
- else
- {
- modifySceneUI.IconPath = backGround.ImagePath;
- }
- modifySceneUI.IconPathType = IconPathType;
-
- CommonPage.Loading.Start();
- var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>();
- for (int i = 0; i < sceneTargetDevicesList.Count; i++)
- {
- var sceneTarget = sceneTargetDevicesList[i];
-
- if (sceneTarget.Type == 0)
- {
- if (sceneTarget.DeviceUI == null)
- {
- continue;
- }
- var memberData = new AddSceneMemberData
- {
- Type = 0,
- ScenesId = 0,
- DeviceAddr = sceneTarget.DeviceUI.DeviceAddr,
- Epoint = sceneTarget.DeviceUI.DeviceEpoint,
- TaskList = sceneTarget.TaskList,
- DelayTime = 0,
- MemberNumber = i + 1
- };
- memberDataList.Add(memberData);
- }
- else if (sceneTarget.Type == 1)
- {
- var memberData = new AddSceneMemberData
- {
- Type = 1,
- ScenesId = 0,
- ElseScenesId = sceneTarget.ElseScenesId,
- DelayTime = 0,
- MemberNumber = i + 1
- };
- memberDataList.Add(memberData);
- }
- else if (sceneTarget.Type == 2)
- {
- var memberData = new AddSceneMemberData
- {
- Type = 2,
- ScenesId = 0,
- DelayTime = sceneTarget.DelayTime,
- MemberNumber = i + 1
- };
- memberDataList.Add(memberData);
- }
- }
-
- var sceneRemoveMemberData = new SceneRemoveMemberData { };
- var removeSceneDeviceListInfoList = new List<RemoveSceneDeviceListInfo> { };
- for (int i = 0; i < modifySceneTargetDevicesList.Count; i++)
- {
- var sceneTarget = modifySceneTargetDevicesList[i];
- if (sceneTarget.Type == 0)
- {
- if (sceneTarget.DeviceUI == null)
- {
- continue;
- }
- var removeDevice = new RemoveSceneDeviceListInfo
- {
- Type = 0,
- DeviceAddr = sceneTarget.DeviceUI.DeviceAddr,
- Epoint = sceneTarget.DeviceUI.DeviceEpoint,
- MemberNumber = sceneTarget.DelayTimeSerialNumber
- };
- removeSceneDeviceListInfoList.Add(removeDevice);
- }
- else if (sceneTarget.Type == 1)
- {
- var removeDevice = new ZigBee.Device.Scene.RemoveSceneDeviceListInfo
- {
- Type = 1,
- ElseScenesId = sceneTarget.ElseScenesId,
- MemberNumber = sceneTarget.DelayTimeSerialNumber
- };
- removeSceneDeviceListInfoList.Add(removeDevice);
- }
- else
- {
- var removeDevice = new ZigBee.Device.Scene.RemoveSceneDeviceListInfo
- {
- Type = 2,
- DelayTime = sceneTarget.DelayTime,
- MemberNumber = sceneTarget.DelayTimeSerialNumber
- };
- removeSceneDeviceListInfoList.Add(removeDevice);
- }
- }
- sceneRemoveMemberData.DeviceList = removeSceneDeviceListInfoList;
- sceneRemoveMemberData.ScenesId = modifySceneUI.Id;
- //var result = await HdlSceneLogic.Current.ModifyScene(modifySceneUI, sceneRemoveMemberData, memberDataList);
- //if (result == 1)
- //{
- // if (modifyRoom != curRoom)
- // {
- // modifyRoom.ListSceneId.Remove(modifySceneUI.Id);
- // curRoom.ListSceneId.Add(modifySceneUI.Id);
- // modifyRoom.Save();
- // curRoom.Save();
- // }
- // EditorAction?.Invoke(modifySceneUI, curRoom);
- // RemoveFromParent();
- //}
- //else if (result == 0)
- //{
- // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain));
- //}
- //else if (result == -1)
- //{
- // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist));
- //}
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"鍒嗙被娣诲姞鍦烘櫙鍑洪敊{ex.Message}");
- }
- finally
- {
- CommonPage.Loading.Hide();
- }
- }
- }
- else
- {
- //鏂板
- if (string.IsNullOrEmpty(nameRow.NameText.Text))
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull));
- return;
- }
- else
- {
- try
- {
- var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
- var fileName = $"SceneIcon_{tradeTime}.png";
- string imgPath;
- if (IconPathType == 1 || IconPathType == 2)
- {
- Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
- HdlAutoBackupLogic.AddOrEditorFile(fileName);
- imgPath = fileName;
- }
- else
- {
- imgPath = backGround.ImagePath;
- }
- //if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
- //{
- // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist));
- // return;
- //}
- CommonPage.Loading.Start();
- var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>();
- for (int i = 0; i < sceneTargetDevicesList.Count; i++)
- {
- var sceneTarget = sceneTargetDevicesList[i];
-
- if (sceneTarget.Type == 0)
- {
- if (sceneTarget.DeviceUI == null)
- {
- continue;
- }
- var memberData = new AddSceneMemberData
- {
- Type = 0,
- ScenesId = 0,
- DeviceAddr = sceneTarget.DeviceUI.DeviceAddr,
- Epoint = sceneTarget.DeviceUI.DeviceEpoint,
- TaskList = sceneTarget.TaskList,
- DelayTime = 0,
- MemberNumber = i + 1
- };
- memberDataList.Add(memberData);
- }
- else if (sceneTarget.Type == 1)
- {
- var memberData = new AddSceneMemberData
- {
- Type = 1,
- ScenesId = 0,
- ElseScenesId = sceneTarget.ElseScenesId,
- DelayTime = 0,
- MemberNumber = i + 1
- };
- memberDataList.Add(memberData);
- }
- else if (sceneTarget.Type == 2)
- {
- var memberData = new AddSceneMemberData
- {
- Type = 2,
- ScenesId = 0,
- DelayTime = sceneTarget.DelayTime,
- MemberNumber = i + 1
- };
- memberDataList.Add(memberData);
- }
- }
-
- //var result = await HdlSceneLogic.Current.AddScene(curRoom, nameRow.NameText.Text, imgPath, memberDataList, IconPathType);
- //if (result == 1)
- //{
- // AddAction?.Invoke();
- // RemoveFromParent();
- //}
- //else if (result == 0)
- //{
- // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.AddSceneFail));
- //}
- //else if (result == -1)
- //{
- // CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist));
- //}
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"鍒嗙被娣诲姞鍦烘櫙鍑洪敊{ex.Message}");
- }
- finally
- {
- CommonPage.Loading.Hide();
- }
- }
- }
-
- };
- #endregion
- }
-
- #endregion
-
- #region 缂栬緫璁惧____________________________________
-
- /// <summary>
- /// ShowSelectAction
- /// </summary>
- /// <param name="device"></param>
- private void ShowSelectAction(CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var dialog = new FrameLayout()
- {
- BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
- };
- AddChidren(dialog);
-
- dialog.MouseUpEventHandler += (sender, e) =>
- {
- dialog.RemoveFromParent();
- };
-
- if (device.Type == ZigBee.Device.DeviceType.OnOffOutput)
- {
- SelectOnoffOutput(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.AirSwitch)
- {
- SelectOnoffOutput(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.DimmableLight)
- {
- SelectDimmableLight(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
- {
- SelectWindowCoveringDevice(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.Thermostat)
- {
- SelectThermostat(dialog, device, sceneTarget);
- }
- }
-
- /// <summary>
- /// 鐏厜
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectOnoffOutput(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(1391),
- Height = Application.GetRealHeight(530),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(392),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectSceneStatuRow(0, 60);
- itemFL.AddChidren(open);
- open.Init();
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
-
-
- var shut = new SelectSceneStatuRow(0, 60 + 127 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList[0].Data1 == 1)
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- }
- else
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
- var taskList = new List<Safeguard.TaskListInfo> { };
- int taskType = 1;
- int data1 = 0;
- int data2 = 0;
-
- if (open.IsSelected)
- {
- //寮�
- data1 = 1;
- data2 = 0;
- }
- else
- {
- //鍏�
- data1 = 0;
- data2 = 0;
- }
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
-
- sceneTarget.TaskList = taskList;
- sceneTarget.DeviceUI = device;
- selectedAction?.Invoke(sceneTarget);
- dialog.RemoveFromParent();
- };
- }
- /// <summary>
- /// 绐楀笜
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectWindowCoveringDevice(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(1169),
- Height = Application.GetRealHeight(752),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(613),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectDeviceWithSeekBarRow(0, 60);
- itemFL.AddChidren(open);
- open.Init();
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
-
- var shut = new SelectSceneStatuRow(0, 60 + 348 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- open.SeekBar.OnProgressChangedEvent += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarTitle();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList[0].Data1 == 1)
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- else
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarProgress(sceneTarget.TaskList[0].Data2);
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
- var taskList = new List<Safeguard.TaskListInfo> { };
-
- int taskType = 6;
- int data1 = 0;
- int data2 = 0;
-
- if (shut.IsSelected)
- {
- //鍏�
- data1 = 1;
- data2 = 0;
- }
- else
- {
- //鐧惧垎姣�
- data1 = 5;
- data2 = open.SeekBar.Progress;
- }
-
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
-
- sceneTarget.TaskList = taskList;
- sceneTarget.DeviceUI = device;
- selectedAction?.Invoke(sceneTarget);
- dialog.RemoveFromParent();
- };
- }
- /// <summary>
- /// 璋冨厜鐏�
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectDimmableLight(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(1169),
- Height = Application.GetRealHeight(752),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- TextAlignment = TextAlignment.CenterLeft,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(613),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectDeviceWithSeekBarRow(0, 60);
- itemFL.AddChidren(open);
- open.Init(254);
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
-
- var shut = new SelectSceneStatuRow(0, 60 + 348 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- open.SeekBar.OnProgressChangedEvent += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarTitle();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList[0].Data1 == 0)
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- else
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarProgress(sceneTarget.TaskList[0].Data1);
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
- var taskList = new List<Safeguard.TaskListInfo> { };
-
- int taskType = 3;
- int data1 = 0;
- int data2 = 0;
-
- if (shut.IsSelected)
- {
- //鍏�
- data1 = 0;
- data2 = 0;
- }
- else
- {
- //鐧惧垎姣�
- data1 = open.SeekBar.Progress;
- data2 = 0;
- }
-
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
-
- sceneTarget.TaskList = taskList;
- sceneTarget.DeviceUI = device;
- selectedAction?.Invoke(sceneTarget);
- dialog.RemoveFromParent();
- };
- }
- /// <summary>
- /// 绌鸿皟
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectThermostat(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- /// 娓╁害
- int tempId = 0;
- /// 妯″紡
- int modelId = 0;
- /// 椋庨��
- int fanid = 0;
-
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(815),
- Height = Application.GetRealHeight(1106),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- TextAlignment = TextAlignment.CenterLeft,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(968),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectDeviceWithPickViewRow(0, 60);
- itemFL.AddChidren(open);
- open.Init();
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
-
- open.pickerView.OnSelectChangeEvent = (l1, l2, l3) =>
- {
- tempId = l1;
- modelId = l2;
- fanid = l3;
- };
-
- var shut = new SelectSceneStatuRow(0, 60 + 703 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList.Count == 1)
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- else
- {
- open.IsSelected = true;
- shut.IsSelected = false;
-
- for (int i = 0; i < sceneTarget.TaskList.Count; i++)
- {
- var tasklist = sceneTarget.TaskList[i];
- if (tasklist.Data1 == 6)
- {
- fanid = open.fanList.IndexOf(tasklist.Data2);
- }
- if (tasklist.Data1 == 3)
- {
- modelId = open.modeList.IndexOf(tasklist.Data2);
- }
- if (tasklist.Data1 == 4 || tasklist.Data1 == 5)
- {
- tempId = open.temperatureList.IndexOf(tasklist.Data2 / 100);
- }
- }
- open.pickerView.setCurrentItems(tempId, modelId, fanid);
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
-
- var taskList = new List<Safeguard.TaskListInfo> { };
-
- int taskType = 5;
- int data1 = 0;
- int data2 = 0;
-
- if (shut.IsSelected)
- {
- //鍏�
- data1 = 3;
- data2 = 0;
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
- }
- else
- {
- //fan
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 6,
- Data2 = open.fanList[fanid]
- };
- taskList.Add(taskInfo);
-
- //mode
- var taskInfo2 = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 3,
- Data2 = open.modeList[modelId]
- };
- taskList.Add(taskInfo2);
-
- //tem
- if (open.modeList[modelId] == 4)
- {
- //heat
- var taskInfo3 = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 4,
- Data2 = open.temperatureList[tempId] * 100
- };
- taskList.Add(taskInfo3);
-
- }
- else
- {
- //heat
- var taskInfo3 = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 5,
- Data2 = open.temperatureList[tempId] * 100
- };
- taskList.Add(taskInfo3);
- }
- }
-
- sceneTarget.TaskList = taskList;
- sceneTarget.DeviceUI = device;
- selectedAction?.Invoke(sceneTarget);
- dialog.RemoveFromParent();
- };
- }
-
- #endregion
-
- }
-}
\ No newline at end of file
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs b/ZigbeeApp20200414/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs
deleted file mode 100755
index 15e3c8f..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-
-namespace Shared.Phone.Device.Category
-{
- public class CategorySceneSelectImgByLocal:FrameLayout
- {
-
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
-
- public Action<string> action;
-
- public CategorySceneSelectImgByLocal()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
- public override void RemoveFromParent()
- {
- base.RemoveFromParent();
- }
-
- public void Show()
- {
-
- AddTop();
-
- AddBodyView();
- }
-
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.SelectScenePic);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- AddChidren(bodyFrameLayout);
-
- //FunctionIconButton
- var scrollView = new VerticalScrolViewLayout()
- {
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- bodyFrameLayout.AddChidren(scrollView);
-
- int k = 0;
- for (int j = 0; j < 7; j++)
- {
- var itemView = new FrameLayout()
- {
- Height = Application.GetRealHeight(311 + 58)
- };
- scrollView.AddChidren(itemView);
- for (int i = 0; i < 2; i++)
- {
- var icon = new ImageView()
- {
- X=Application.GetRealWidth(58+i*(467+32)),
- Y=Application.GetRealHeight(58),
- Width=Application.GetRealWidth(467),
- Height=Application.GetRealHeight(311),
- ImagePath = $"SceneIcon/{k}.png",
- Radius =(uint)Application.GetRealHeight(17)
- };
- itemView.AddChidren(icon);
- icon.SetViewShadow(true);
- k++;
-
- EventHandler<MouseEventArgs> selectIcon = (sender, e) =>
- {
- action?.Invoke(icon.ImagePath);
- action = null;
- this.RemoveFromParent();
- };
- icon.MouseUpEventHandler += selectIcon;
- }
- }
- }
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectDelayTime.cs b/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectDelayTime.cs
deleted file mode 100755
index 7e3008e..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectDelayTime.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-
-namespace Shared.Phone.Device.Category
-{
- public class SelectDelayTime : FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// totalSecond
- /// </summary>
- public int totalSecond;
- /// <summary>
- /// selectedTimeAction
- /// </summary>
- public Action<SceneTargetDeviceUI> selectedTimeAction;
-
- #endregion
-
- /// <summary>
- /// SelectDelayTime
- /// </summary>
- public SelectDelayTime()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- //Tag = "categoryAddScene";
- }
- /// <summary>
- /// RemoveFromParent
- /// </summary>
- public override void RemoveFromParent()
- {
- base.RemoveFromParent();
- }
- /// <summary>
- /// sceneTargetDevice
- /// </summary>
- public SceneTargetDeviceUI sceneTargetDevice;
-
- /// <summary>
- /// Show
- /// </summary>
- public void Show()
- {
- if (sceneTargetDevice == null)
- {
- sceneTargetDevice = new SceneTargetDeviceUI { Type = 2 };
- }
- AddTop();
-
- AddBodyView();
- }
-
-
- #region Add____________________________________
- /// <summary>
- /// AddTop
- /// </summary>
- private void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.AddDelayTime);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- private void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var bg1 = new FrameLayout
- {
- Y = Application.GetRealHeight(118),
- Height = Application.GetMinRealAverage(207),
- Width = Application.GetMinRealAverage(207),
- Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetMinRealAverage(207 / 2),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- bodyFrameLayout.AddChidren(bg1);
-
- var bg2 = new FrameLayout
- {
- Height = Application.GetMinRealAverage(184),
- Width = Application.GetMinRealAverage(184),
- Gravity = Gravity.Center,
- Radius = (uint)Application.GetMinRealAverage(184 / 2),
- BackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor,
- };
- bg1.AddChidren(bg2);
-
- var timeImg = new Button
- {
- Height = Application.GetMinRealAverage(124),
- Width = Application.GetMinRealAverage(124),
- Gravity = Gravity.Center,
- Radius = (uint)Application.GetRealHeight(58),
- UnSelectedImagePath = "Item/Timer.png"
- };
- bg1.AddChidren(timeImg);
-
- var tip = new Button
- {
- Y = Application.GetRealHeight(350),
- Width = Application.GetRealWidth(700),
- Height = Application.GetRealHeight(120),
- Gravity = Gravity.CenterHorizontal,
- TextID = R.MyInternationalizationString.SelectTimeForAction,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize=15,
- IsMoreLines = true
- };
- bodyFrameLayout.AddChidren(tip);
-
- var midFL = new FrameLayout
- {
- Y = Application.GetRealHeight(611),
- Height = Application.GetRealHeight(1126),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- Radius = (uint)Application.GetRealHeight(58),
- };
- bodyFrameLayout.AddChidren(midFL);
-
- var timeFL = new FrameLayout
- {
- Y = Application.GetRealHeight(127),
- Height = Application.GetRealHeight(1126 - 127),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- midFL.AddChidren(timeFL);
-
- var pickView = new UIPickerView
- {
- Height = Application.GetRealHeight(153 * 3),
- };
- timeFL.AddChidren(pickView);
-
- //鍒�
- string strMinute = Language.StringByID(R.MyInternationalizationString.uMinute);
- //绉�
- string strSecond = Language.StringByID(R.MyInternationalizationString.uSecond);
- var listfirst = new List<string>();
- var listSecond = new List<List<string>>();
- for (int i = 0; i <= 59; i++)
- {
- listfirst.Add(i.ToString().PadLeft(2, '0') + strMinute);
- var listTemp = new List<string>();
- for (int j = 0; j <= 59; j++)
- {
- if (i == 0 && j == 0)
- {
- continue;
- }
- listTemp.Add(j.ToString().PadLeft(2, '0') + strSecond);
- }
- listSecond.Add(listTemp);
- }
- //鍔犱竴涓�60鍒嗛挓鍚�
- listfirst.Add("60" + strMinute);
- var listTemp2 = new List<string>() { "00" + strSecond };
- listSecond.Add(listTemp2);
-
- pickView.setPicker(listfirst, listSecond);
- pickView.setCurrentItems(totalSecond / 60, totalSecond % 60, 0);
- pickView.OnSelectChangeEvent += (value1, value2, value3) =>
- {
- int minute = Convert.ToInt32(listfirst[value1].Substring(0, 2));
- int second = Convert.ToInt32(listSecond[value1][value2].Substring(0, 2));
- totalSecond = minute * 60 + second;
- };
-
- var confirmBtn = new CommonForm.CompleteButton(1656, 907, 127);
- AddChidren(confirmBtn);
- confirmBtn.SetTitle(R.MyInternationalizationString.Save);
- confirmBtn.MouseUpEventHandler += (sender, e) =>
- {
- if (totalSecond == 0)
- {
- RemoveFromParent();
- }
- else
- {
- sceneTargetDevice.DelayTime = totalSecond;
- selectedTimeAction?.Invoke(sceneTargetDevice);
- RemoveFromParent();
- }
- };
- }
-
- #endregion
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectDevice.cs b/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectDevice.cs
deleted file mode 100755
index 266fff7..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectDevice.cs
+++ /dev/null
@@ -1,1245 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Category
-{
- public class SelectDevice : FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// selectedTimeAction
- /// </summary>
- public Action<SceneTargetDeviceUI> selectedAction;
- /// <summary>
- /// sceneTargetDevice
- /// </summary>
- public SceneTargetDeviceUI sceneTargetDevice;
- /// <summary>
- /// BeforesceneTargetDeviceUIs
- /// </summary>
- public List<SceneTargetDeviceUI> beforeSceneTargetDeviceUIs = new List<SceneTargetDeviceUI> { };
- /// <summary>
- /// 妤煎眰
- /// </summary>
- private Button floorBtn;
- /// <summary>
- /// 褰撳墠妤煎眰id
- /// </summary>
- private string curFloorId;
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- private Button selectFloorBtn;
- /// <summary>
- /// 鍦烘櫙鍔熻兘涓儴鑳屾櫙bodyView
- /// </summary>
- public FrameLayout functionSceneBodyView;
- /// <summary>
- /// deviceUI
- /// </summary>
- public CommonDevice deviceUI;
- /// <summary>
- /// 鍔熻兘绫诲瀷
- /// </summary>
- private HorizontalScrolViewLayout functionTypeScrowView;
- /// <summary>
- /// 鐩稿悓鐨勮澶囧垪琛�
- /// </summary>
- public VerticalScrolViewLayout deviceListScrolView;
- /// <summary>
- /// 褰撳墠鍔熻兘绫诲瀷鎸夐挳
- /// </summary>
- private FunctionButton tempFunctionTypeBtn;
- /// <summary>
- /// 璁惧绫诲瀷RowLayout
- /// </summary>
- //private FrameLayout typeRowLayout;
- /// <summary>
- /// 鍔熻兘绫诲瀷鎸夐挳
- /// </summary>
- //private FunctionButton functionTypeIMG;
- /// <summary>
- /// 娓╁害
- /// </summary>
- private int tempId;
- /// <summary>
- /// 妯″紡
- /// </summary>
- private int modelId;
- /// <summary>
- /// 椋庨��
- /// </summary>
- private int fanid;
-
- /// <summary>
- /// dList
- /// </summary>
- private List<CommonDevice> devList;
- /// <summary>
- /// 鐩稿悓绫诲瀷鐨勮澶囧垪琛�
- /// </summary>
- private Dictionary<int, List<CommonDevice>> typeDeviceDic;
- /// <summary>
- /// 璁惧绫诲瀷鐨勫浘id
- /// </summary>
- private Dictionary<int, DeviceConcreteType> typeIdDic;
- /// <summary>
- /// 褰撳墠閫変腑鎴块棿
- /// </summary>
- private Common.Room curRoom;
-
- #endregion
-
- /// <summary>
- /// RemoveFromParent
- /// </summary>
- public override void RemoveFromParent()
- {
- HomePage.Instance.ScrollEnabled = true;
- base.RemoveFromParent();
- }
-
- /// <summary>
- /// SelectDevice
- /// </summary>
- public SelectDevice()
- {
- HomePage.Instance.ScrollEnabled = false;
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
- /// <summary>
- /// Show
- /// </summary>
- public void Show()
- {
- InitData();
-
- if (sceneTargetDevice == null)
- {
- sceneTargetDevice = new SceneTargetDeviceUI { Type = 0 };
- }
- AddTop();
-
- AddBodyView();
-
- RefreshBodyView(Config.Instance.Home.CurrentFloorId);
- }
-
- /// <summary>
- /// InitData
- /// </summary>
- private void InitData()
- {
- typeDeviceDic = new Dictionary<int, List<CommonDevice>> { };
- typeIdDic = new Dictionary<int, DeviceConcreteType> { };
- }
-
- /// <summary>
- /// RefreshData
- /// </summary>
- private void RefreshData(Common.Room room)
- {
- devList = UserCenter.HdlRoomLogic.Current.GetRoomListDevice(room);
- typeDeviceDic.Clear();
- typeIdDic.Clear();
- foreach (var device in devList)
- {
- var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
- if (info.BeloneType == DeviceBeloneType.A寮�鍏� || info.BeloneType == DeviceBeloneType.A褰╃伅
- || info.BeloneType == DeviceBeloneType.A鎻掑骇 || info.BeloneType == DeviceBeloneType.A鏅鸿兘绌哄紑
- || info.BeloneType == DeviceBeloneType.A鐏厜 || info.BeloneType == DeviceBeloneType.A绌鸿皟
- || info.BeloneType == DeviceBeloneType.A绐楀笜 || info.BeloneType == DeviceBeloneType.A缁х數鍣�
- || info.BeloneType == DeviceBeloneType.A璋冨厜鍣�
- )
- {
- if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false)
- {
- var sameDevList = new List<CommonDevice> { };
- sameDevList.Add(device);
- typeDeviceDic[info.BeloneTextId] = sameDevList;
- }
- else
- {
- typeDeviceDic[info.BeloneTextId].Add(device);
- }
- typeIdDic[info.BeloneTextId] = info.ConcreteType;
- }
- }
- }
-
- #region Add____________________________________
- /// <summary>
- /// AddTop
- /// </summary>
- private void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.AddFunction);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- floorBtn = new Button()
- {
- X = Application.GetRealWidth(750),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize=14,
- IsBold=true
- };
-
- selectFloorBtn = new Button()
- {
- X = Application.GetRealWidth(950),
- Width = Application.GetMinRealAverage(69),
- Height = Application.GetMinRealAverage(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Drop_Down.png"
- };
-
- if (Config.Instance.Home.FloorDics.Count > 0)
- {
- floorBtn.Text = Config.Instance.Home.GetCurrentFloorName;
- top.topView.AddChidren(floorBtn);
- top.topView.AddChidren(selectFloorBtn);
- floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- }
- }
-
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- var floors = new SelectFloor();
- AddChidren(floors);
- floors.changeFloor = false;
- floors.CurFloorId = curFloorId;
- floors.Init(580, 184, Direction.Right);
- floors.FloorAction += (floorId) =>
- {
- curFloorId = floorId;
- floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
- RefreshBodyView(floorId);
- };
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- private void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
- }
-
- #endregion
-
- /// <summary>
- /// RefreshBodyView
- /// </summary>
- private void RefreshBodyView(string floorId)
- {
- AddRoomView(floorId);
- }
-
- /// <summary>
- /// AddRoomView
- /// </summary>
- private void AddRoomView(string floorId)
- {
- var roomFL = new HorizontalScrolViewLayout()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(204),
- Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonFormResouce.X_Left),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- bodyFrameLayout.AddChidren(roomFL);
-
- //鍔熻兘鍜屽満鏅痓odyView
- functionSceneBodyView = new FrameLayout()
- {
- Y = roomFL.Bottom,
- Height = Application.GetRealHeight(279+35+1218),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- bodyFrameLayout.AddChidren(functionSceneBodyView);
-
- RoomButton curBtn = new RoomButton(0, 0);
- var lisrRoom = UserCenter.HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(floorId);
- foreach (var room in lisrRoom)
- {
- var row = new FrameLayout()
- {
- Width = Application.GetRealWidth(255),
- Height = Application.GetRealHeight(167)
- };
- roomFL.AddChidren(row);
-
- RoomButton roomBtn = new RoomButton(0, 0);
- roomBtn.Gravity = Gravity.Center;
- roomBtn.Init();
- roomBtn.SetTitle(room.Name);
- row.AddChidren(roomBtn);
-
- if (room.IsLove)
- {
- roomBtn.IsSelected = true;
- curBtn = roomBtn;
- this.curRoom = room;
- RefreshFunction(room);
- }
- roomBtn.ButtonClickEvent += (sender, e) =>
- {
- if (sender == curBtn)
- {
- return;
- }
- sender.IsSelected = true;
- curBtn.IsSelected = false;
- curBtn = sender;
- this.curRoom = room;
- RefreshFunction(room);
- };
- }
-
- if (deviceUI != null)
- {
- ShowSelectAction(deviceUI, sceneTargetDevice);
- }
- }
-
-
- /// <summary>
- /// RefreshFunction
- /// </summary>
- /// <param name="room"></param>
- private void RefreshFunction(Common.Room room)
- {
- RefreshData(room);
- functionSceneBodyView.RemoveAll();
-
- if (typeDeviceDic.Count == 0)
- {
- ShowNoFunctionTip();
- }
- else
- {
- var functionTypeView1 = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(160),
- Width = Application.GetRealWidth(1028),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(functionTypeView1);
- functionTypeView1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft);
-
- var functionTypeView2 = new FrameLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(150),
- Height = Application.GetRealHeight(279 - 150),
- Width = Application.GetRealWidth(1028),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(functionTypeView2);
- functionTypeView2.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
-
- functionTypeScrowView = new HorizontalScrolViewLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(279),
- Width = Application.GetRealWidth(1028)
- };
- functionSceneBodyView.AddChidren(functionTypeScrowView);
-
- deviceListScrolView = new VerticalScrolViewLayout
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(35 + 275),
- Width = Application.GetRealWidth(1028),
- Height = Application.GetRealHeight(1218),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- functionSceneBodyView.AddChidren(deviceListScrolView);
- deviceListScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-
- tempFunctionTypeBtn = new FunctionButton();
- tempFunctionTypeBtn.Init("","");
-
- foreach (var deviceType in typeIdDic)
- {
- var typeRowLayout = new FrameLayout()
- {
- Width = Application.GetRealWidth(220),
- };
- functionTypeScrowView.AddChidren(typeRowLayout);
-
- var functionTypeIMG = new FunctionButton()
- {
- Tag = deviceType.Key
- };
- string imgPath = string.Empty;
- string imgSeletedPath = string.Empty;
- Common.LocalDevice.Current.GetDeviceObjectIcon(deviceType.Value, ref imgPath, ref imgSeletedPath);
- functionTypeIMG.Init(imgPath, imgSeletedPath);
- functionTypeIMG.SetTitle(deviceType.Key);
- typeRowLayout.AddChidren(functionTypeIMG);
-
- functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
-
- if (functionTypeScrowView.ChildrenCount == 1)
- {
- ShowSameTypeFunction(functionTypeIMG.ImageBtn, null);
- }
- }
- }
- }
-
- /// <summary>
- /// 鏄剧ず鐩稿悓绫诲瀷鐨勫姛鑳�
- /// </summary>
- /// <param name="typeSender">typeSender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ShowSameTypeFunction(object typeSender, MouseEventArgs mouseEventArgs)
- {
- tempFunctionTypeBtn.IsSelected = false;
- tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton;
- ((typeSender as Button).Parent as FunctionButton).IsSelected = true;
-
- deviceListScrolView.RemoveAll();
-
- var sameTypeList = new List<CommonDevice> { };
- sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
-
- foreach (var device in sameTypeList)
- {
- if (beforeSceneTargetDeviceUIs.Find((obj) => obj.DeviceUI.DeviceEpoint == device.DeviceEpoint && obj.DeviceUI.DeviceAddr == device.DeviceAddr) != null)
- {
- continue;
- }
- var deviceTypeRowLayout = new FrameLayout()
- {
- Height = Application.GetRealHeight(127 + 35),
- Tag = device
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- var deviceRow = new FunctionRow(0, 35);
- deviceRow.Init(device.IconPath, device.OnlineIconPath, true);
- deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(device));
- deviceRow.IsSelected = true;
- deviceRow.HideSwitchBtn(false);
- deviceRow.NameBtn.BackgroundColor = ZigbeeColor.Current.GXCRedColor;
- deviceTypeRowLayout.AddChidren(deviceRow);
-
-
- deviceRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
- {
- ShowSelectAction(device, sceneTargetDevice);
- };
- }
- }
-
-
- /// <summary>
- /// 鎻愮ず娌℃湁鍔熻兘
- /// </summary>
- private void ShowNoFunctionTip()
- {
- var noFunction = new Button()
- {
- Y = Application.GetRealHeight(320),
- Width = Application.GetMinRealAverage(757),
- Height = Application.GetMinRealAverage(435),
- UnSelectedImagePath = "Item/NoFunction.png",
- Gravity = Gravity.CenterHorizontal
- };
- functionSceneBodyView.AddChidren(noFunction);
-
- var noFunctionTip = new Button()
- {
- Y = noFunction.Bottom + Application.GetRealHeight(32),
- Height = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(700),
- Gravity = Gravity.CenterHorizontal,
- Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noFunctionTip);
- }
-
- /// <summary>
- /// ShowSelectAction
- /// </summary>
- /// <param name="device"></param>
- private void ShowSelectAction(CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var dialog = new FrameLayout()
- {
- BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
- };
- AddChidren(dialog);
-
- dialog.MouseUpEventHandler += (sender, e) =>
- {
- dialog.RemoveFromParent();
- };
-
- if (device.Type == ZigBee.Device.DeviceType.OnOffOutput)
- {
- SelectOnoffOutput(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.AirSwitch)
- {
- SelectOnoffOutput(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.DimmableLight)
- {
- SelectDimmableLight(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
- {
- SelectWindowCoveringDevice(dialog, device, sceneTarget);
- }
- else if (device.Type == ZigBee.Device.DeviceType.Thermostat)
- {
- SelectThermostat(dialog, device, sceneTarget);
- }
- }
-
- /// <summary>
- /// 鐏厜
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectOnoffOutput(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(1391),
- Height = Application.GetRealHeight(530),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(392),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectSceneStatuRow(0, 60);
- itemFL.AddChidren(open);
- open.Init();
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
-
-
- var shut = new SelectSceneStatuRow(0, 60 + 127 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList[0].Data1 == 1)
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- }
- else
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
- var taskList = new List<Safeguard.TaskListInfo> { };
- int taskType = 1;
- int data1 = 0;
- int data2 = 0;
-
- if (open.IsSelected)
- {
- //寮�
- data1 = 1;
- data2 = 0;
- }
- else
- {
- //鍏�
- data1 = 0;
- data2 = 0;
- }
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
-
- sceneTargetDevice.TaskList = taskList;
- sceneTargetDevice.DeviceUI = device;
- selectedAction?.Invoke(sceneTargetDevice);
- RemoveFromParent();
- };
- }
- /// <summary>
- /// 绐楀笜
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectWindowCoveringDevice(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(1169),
- Height = Application.GetRealHeight(752),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(613),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectDeviceWithSeekBarRow(0, 60);
- itemFL.AddChidren(open);
- open.Init();
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
-
- var shut = new SelectSceneStatuRow(0, 60 + 348 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- open.SeekBar.OnProgressChangedEvent += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarTitle();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList[0].Data1 == 1)
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- else
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarProgress(sceneTarget.TaskList[0].Data2);
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
- var taskList = new List<Safeguard.TaskListInfo> { };
-
- int taskType = 6;
- int data1 = 0;
- int data2 = 0;
-
- if (shut.IsSelected)
- {
- //鍏�
- data1 = 1;
- data2 = 0;
- }
- else
- {
- //鐧惧垎姣�
- data1 = 5;
- data2 = open.SeekBar.Progress;
- }
-
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
-
- sceneTargetDevice.TaskList = taskList;
- sceneTargetDevice.DeviceUI = device;
- selectedAction?.Invoke(sceneTargetDevice);
- RemoveFromParent();
- };
- }
- /// <summary>
- /// 璋冨厜鐏�
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectDimmableLight(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(1169),
- Height = Application.GetRealHeight(752),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- TextAlignment = TextAlignment.CenterLeft,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(613),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectDeviceWithSeekBarRow(0, 60);
- itemFL.AddChidren(open);
- open.Init(254);
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
-
- var shut = new SelectSceneStatuRow(0, 60 + 348 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- open.SeekBar.OnProgressChangedEvent += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarTitle();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList[0].Data1 == 0)
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- else
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- open.SetSeekBarProgress(sceneTarget.TaskList[0].Data1);
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
- var taskList = new List<Safeguard.TaskListInfo> { };
-
- int taskType = 3;
- int data1 = 0;
- int data2 = 0;
-
- if (shut.IsSelected)
- {
- //鍏�
- data1 = 0;
- data2 = 0;
- }
- else
- {
- //鐧惧垎姣�
- data1 = open.SeekBar.Progress;
- data2 = 0;
- }
-
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
-
- sceneTargetDevice.TaskList = taskList;
- sceneTargetDevice.DeviceUI = device;
- selectedAction?.Invoke(sceneTargetDevice);
- RemoveFromParent();
- };
- }
- /// <summary>
- /// 绌鸿皟
- /// </summary>
- /// <param name="dialog"></param>
- /// <param name="device"></param>
- /// <param name="sceneTarget"></param>
- private void SelectThermostat(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
- {
- var selectFL = new FrameLayout
- {
- Y = Application.GetRealHeight(815),
- Height = Application.GetRealHeight(1106),
- };
- dialog.AddChidren(selectFL);
- //selectFL.Animate = Animate.DownToUp;
-
- var titleBG = new FrameLayout
- {
- Height = Application.GetRealHeight(138 * 2),
- Radius = (uint)Application.GetRealHeight(58),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(titleBG);
-
- var titleFL = new FrameLayout
- {
- Height = Application.GetRealHeight(138),
- };
- selectFL.AddChidren(titleFL);
-
- var line = new Button
- {
- Y = titleFL.Height - 1,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- titleFL.AddChidren(line);
-
- var cancleBtn = new Button
- {
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Cancel
- };
- titleFL.AddChidren(cancleBtn);
-
- var deviceName = new Button
- {
- Width = Application.GetRealWidth(600),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 16,
- TextAlignment = TextAlignment.CenterLeft,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
- };
- titleFL.AddChidren(deviceName);
-
- var comfrimBtn = new Button
- {
- X = Application.GetRealWidth(800),
- Width = Application.GetRealWidth(200),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
- TextSize = 14,
- TextAlignment = TextAlignment.CenterRight,
- TextID = R.MyInternationalizationString.Complete
- };
- titleFL.AddChidren(comfrimBtn);
-
- var itemFL = new FrameLayout
- {
- Y = titleFL.Bottom,
- Height = Application.GetRealHeight(968),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- selectFL.AddChidren(itemFL);
-
- var open = new SelectDeviceWithPickViewRow(0, 60);
- itemFL.AddChidren(open);
- open.Init();
- open.SetTitle(R.MyInternationalizationString.Open);
- open.IsSelected = true;
- open.pickerView.OnSelectChangeEvent = (l1, l2, l3) =>
- {
- tempId = l1;
- modelId = l2;
- fanid = l3;
- };
-
- var shut = new SelectSceneStatuRow(0, 60 + 703 + 30);
- itemFL.AddChidren(shut);
- shut.Init();
- shut.hideLine(true);
- shut.SetTitle(R.MyInternationalizationString.Shut);
-
- open.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = true;
- shut.IsSelected = false;
- };
-
- shut.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- };
-
- cancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- dialog.RemoveAll();
- dialog.RemoveFromParent();
- };
-
- if (sceneTarget.TaskList.Count > 0)
- {
- if (sceneTarget.TaskList.Count == 1)
- {
- open.IsSelected = false;
- shut.IsSelected = true;
- }
- else
- {
- open.IsSelected = true;
- shut.IsSelected = false;
-
- for (int i = 0; i < sceneTarget.TaskList.Count; i++)
- {
- var tasklist = sceneTarget.TaskList[i];
- if (tasklist.Data1 == 6)
- {
- fanid = open.fanList.IndexOf(tasklist.Data2);
- }
- if (tasklist.Data1 == 3)
- {
- modelId = open.modeList.IndexOf(tasklist.Data2);
- }
- if (tasklist.Data1 == 4 || tasklist.Data1 == 5)
- {
- tempId = open.temperatureList.IndexOf(tasklist.Data2/100);
- }
- }
- open.pickerView.setCurrentItems(tempId, modelId, fanid);
- }
- }
-
- comfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
-
- var taskList = new List<Safeguard.TaskListInfo> { };
-
- int taskType = 5;
- int data1 = 0;
- int data2 = 0;
-
- if (shut.IsSelected)
- {
- //鍏�
- data1 = 3;
- data2 = 0;
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = data1,
- Data2 = data2
- };
- taskList.Add(taskInfo);
- }
- else
- {
- //fan
- var taskInfo = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 6,
- Data2 = open.fanList[fanid]
- };
- taskList.Add(taskInfo);
-
- //mode
- var taskInfo2 = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 3,
- Data2 = open.modeList[modelId]
- };
- taskList.Add(taskInfo2);
-
- //tem
- if (open.modeList[modelId] == 4)
- {
- //heat
- var taskInfo3 = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 4,
- Data2 = open.temperatureList[tempId]*100
- };
- taskList.Add(taskInfo3);
-
- }
- else
- {
- //heat
- var taskInfo3 = new Safeguard.TaskListInfo
- {
- TaskType = taskType,
- Data1 = 5,
- Data2 = open.temperatureList[tempId]*100
- };
- taskList.Add(taskInfo3);
- }
- }
-
- sceneTargetDevice.TaskList = taskList;
- sceneTargetDevice.DeviceUI = device;
- selectedAction?.Invoke(sceneTargetDevice);
- RemoveFromParent();
- };
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectScene.cs b/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectScene.cs
deleted file mode 100755
index 191ddbd..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Category/SelectScene.cs
+++ /dev/null
@@ -1,362 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-
-namespace Shared.Phone.Device.Category
-{
- public class SelectScene : FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// selectedTimeAction
- /// </summary>
- public Action<SceneTargetDeviceUI> selectedAction;
- /// <summary>
- /// sceneTargetDevice
- /// </summary>
- public SceneTargetDeviceUI sceneTargetDevice;
- /// <summary>
- /// BeforesceneTargetDeviceUIs
- /// </summary>
- public List<SceneTargetDeviceUI> beforeSceneTargetDeviceUIs = new List<SceneTargetDeviceUI> { };
- /// <summary>
- /// 妤煎眰
- /// </summary>
- private Button floorBtn;
- /// <summary>
- /// 褰撳墠妤煎眰id
- /// </summary>
- private string curFloorId;
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- private Button selectFloorBtn;
- /// <summary>
- /// 鍦烘櫙鍔熻兘涓儴鑳屾櫙bodyView
- /// </summary>
- public FrameLayout functionSceneBodyView;
- /// <summary>
- /// sceneUI
- /// </summary>
- public SceneUI sceneUI;
- /// <summary>
- /// 褰撳墠鍦烘櫙鏈韩锛屾坊鍔犲満鏅椂浣跨敤
- /// </summary>
- public SceneUI currentSceneUI;
-
- #endregion
-
- /// <summary>
- /// SelectScene
- /// </summary>
- public SelectScene()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
-
- /// <summary>
- /// Show
- /// </summary>
- public void Show()
- {
- if (sceneTargetDevice == null)
- {
- sceneTargetDevice = new SceneTargetDeviceUI { Type = 1 };
- }
- AddTop();
-
- AddBodyView();
-
- RefreshBodyView(Config.Instance.Home.CurrentFloorId);
- }
-
-
- #region Add____________________________________
- /// <summary>
- /// AddTop
- /// </summary>
- private void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.AddScence);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- floorBtn = new Button()
- {
- X = Application.GetRealWidth(750),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 14,
- IsBold = true
- };
-
- selectFloorBtn = new Button()
- {
- X = Application.GetRealWidth(950),
- Width = Application.GetMinRealAverage(69),
- Height = Application.GetMinRealAverage(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Drop_Down.png"
- };
-
- if (Config.Instance.Home.FloorDics.Count > 0)
- {
- floorBtn.Text = Config.Instance.Home.GetCurrentFloorName;
- top.topView.AddChidren(floorBtn);
- top.topView.AddChidren(selectFloorBtn);
- floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- }
- }
-
- /// <summary>
- /// 閫夋嫨妤煎眰
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- var floors = new SelectFloor();
- AddChidren(floors);
- floors.changeFloor = false;
- floors.CurFloorId = curFloorId;
- floors.Init(580, 184, Direction.Right);
- floors.FloorAction += (floorId) =>
- {
- curFloorId = floorId;
- floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
- RefreshBodyView(floorId);
- };
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- private void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var confirmBtn = new CommonForm.CompleteButton(1656, 907, 127);
- AddChidren(confirmBtn);
- confirmBtn.SetTitle(R.MyInternationalizationString.Save);
- confirmBtn.MouseUpEventHandler += (sender, e) =>
- {
- sceneTargetDevice.ElseScenesId = sceneUI.Id;
- sceneTargetDevice.SceneUI = sceneUI;
- sceneTargetDevice.SceneName = sceneUI.Name;
- selectedAction?.Invoke(sceneTargetDevice);
- RemoveFromParent();
- };
- }
-
- #endregion
-
- /// <summary>
- /// RefreshBodyView
- /// </summary>
- private void RefreshBodyView(string floorId)
- {
- AddRoomView(floorId);
- }
-
- /// <summary>
- /// AddRoomView
- /// </summary>
- private void AddRoomView(string floorId)
- {
- var roomFL = new HorizontalScrolViewLayout()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetRealHeight(204),
- Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonFormResouce.X_Left),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- bodyFrameLayout.AddChidren(roomFL);
-
- //鍔熻兘鍜屽満鏅痓odyView
- functionSceneBodyView = new FrameLayout()
- {
- Y = roomFL.Bottom,
- Height = Application.GetRealHeight(1080 + 452),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- bodyFrameLayout.AddChidren(functionSceneBodyView);
-
- RoomButton curBtn = new RoomButton(0,0);
-
- foreach (var room in UserCenter.HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(floorId))
- {
- var row = new FrameLayout()
- {
- Width = Application.GetRealWidth(255),
- Height = Application.GetRealHeight(167)
- };
- roomFL.AddChidren(row);
-
- RoomButton roomBtn = new RoomButton(0, 0);
- roomBtn.Gravity = Gravity.Center;
- roomBtn.Init();
- roomBtn.SetTitle(room.Name);
- row.AddChidren(roomBtn);
-
- if (room.IsLove)
- {
- roomBtn.IsSelected = true;
- curBtn = roomBtn;
-
- RefreshScene(room);
- }
- roomBtn.ButtonClickEvent += (sender, e) =>
- {
- if (sender == curBtn)
- {
- return;
- }
- sender.IsSelected = true;
- curBtn.IsSelected = false;
- curBtn = sender;
-
- RefreshScene(room);
- };
- }
-
- }
-
-
- /// <summary>
- /// RefreshScene
- /// </summary>
- /// <param name="room"></param>
- public void RefreshScene(Common.Room room)
- {
- functionSceneBodyView.RemoveAll();
- var sceneList = room.ListSceneId;
- if (sceneList.Count == 0)
- {
- ShowNoSceneTip();
- }
- else
- {
- var sceneScrolView = new VerticalScrolViewLayout
- {
- //Y = Application.GetRealHeight(58)
- };
-
- functionSceneBodyView.AddChidren(sceneScrolView);
- SelectSceneRow tempSceneRow = new SelectSceneRow();
- EventHandler<MouseEventArgs> selectScene = (sender, e) =>
- {
- tempSceneRow.IsSelected = false;
- tempSceneRow = ((sender as Button).Parent as SelectSceneRow);
- ((sender as Button).Parent as SelectSceneRow).IsSelected = true;
- tempSceneRow.IsSelected = true;
- sceneUI = (sender as Button).Tag as SceneUI;
- };
-
- for (int i = 0; i < sceneList.Count; i++)
- {
- var scene = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(sceneList[i]);
- if (scene == null || currentSceneUI?.Id == scene.Id)
- {
- continue;
- }
- if (beforeSceneTargetDeviceUIs.Find((obj) => obj.SceneUI.Id == scene.Id) != null)
- {
- continue;
- }
- var sceneFL = new FrameLayout()
- {
- Height = Application.GetRealHeight(127 + 23),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = scene
- };
- sceneScrolView.AddChidren(sceneFL);
- var sceneRowLayout = new SelectSceneRow(0, 23);
- sceneFL.AddChidren(sceneRowLayout);
- sceneRowLayout.Init();
- sceneRowLayout.SetTitle(scene.Name);
- sceneRowLayout.ClickButton.Tag = scene;
- if (sceneUI == null)
- {
- if (i == 0)
- {
- tempSceneRow = sceneRowLayout;
- sceneUI = scene;
- sceneRowLayout.IsSelected = true;
- }
- }
- else
- {
- if (sceneUI.Id == scene.Id)
- {
- tempSceneRow = sceneRowLayout;
- sceneUI = scene;
- sceneRowLayout.IsSelected = true;
- }
- }
-
- sceneRowLayout.ClickButton.MouseUpEventHandler += selectScene;
- }
-
- if (sceneList.Count > 8)
- {
- var frame = new FrameLayout
- {
- Height = Application.GetRealHeight(300)
- };
- sceneScrolView.AddChidren(frame);
- }
-
- }
- }
-
-
- /// <summary>
- /// 鏄剧ず娌℃湁鍦烘櫙
- /// </summary>
- private void ShowNoSceneTip()
- {
- var noFunction = new Button()
- {
- Y = Application.GetRealHeight(320),
- Width = Application.GetMinRealAverage(757),
- Height = Application.GetMinRealAverage(435),
- UnSelectedImagePath = "Item/NoFunction.png",
- Gravity = Gravity.CenterHorizontal
- };
- functionSceneBodyView.AddChidren(noFunction);
-
- var noScenceTip = new Button()
- {
- Y = noFunction.Bottom + Application.GetRealHeight(32),
- Height = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(700),
- Gravity = Gravity.CenterHorizontal,
- Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noScenceTip);
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/ACLeftIconButtonRowLayout.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/ACLeftIconButtonRowLayout.cs
deleted file mode 100755
index ee5a66d..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/ACLeftIconButtonRowLayout.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-锘縰sing System;
-namespace Shared.Phone.Device.CommonForm
-{
- /// <summary>
- /// 鍥剧墖鍦ㄥ乏杈癸紝鏂囧瓧鍦ㄥ彸杈�,甯︿笅鍒掔嚎鐨勮鎺т欢
- /// </summary>
- public class ACLeftIconButtonRowLayout : FrameLayout
- {
- #region 鈼� 鍙橀噺__________________________
- /// <summary>
- /// 鍥剧墖
- /// </summary>
- public Button IconButton;
- /// <summary>
- /// 鏍囬
- /// </summary>
- public Button TitleButton;
- /// <summary>
- /// 涓嬪垝绾�
- /// </summary>
- public FrameLayout lineFrameLayout;
-
- #endregion
-
- #region 鈼� 鏋勯�犳柟娉昣______________________
-
- public ACLeftIconButtonRowLayout()
- {
-
- }
-
- #endregion
-
- #region 鈼� 鍒濆鍖朹_________________________
-
- /// <summary>
- /// 鍒濆鍖�--閮ㄥ垎鍙傛暟鍏堝啓姝诲惂
- /// </summary>
- /// <param name="iconPath">Icon path.</param>
- /// <param name="iconSelectedPath">Icon selected path.</param>
- /// <param name="title">Title.</param>
- public void Init(string iconPath, string iconSelectedPath, string title, bool hadLine = true)
- {
- IconButton = new Button()
- {
- X = Application.GetRealWidth(80),
- Height = Application.GetMinRealAverage(80),
- Width = Application.GetMinRealAverage(80),
- UnSelectedImagePath = iconPath,
- SelectedImagePath = iconSelectedPath,
- Gravity = Gravity.CenterVertical,
- Tag = this.Tag
- };
- AddChidren(IconButton);
-
- TitleButton = new Button()
- {
- X = IconButton.Right + Application.GetRealWidth(30),
- Height = Application.GetRealHeight(80),
- Width = this.Width - Application.GetRealWidth(80 + 80 + 30),
- TextColor = Shared.Common.ZigbeeColor.Current.GXCPlaceHolderTextColor,
- SelectedTextColor = Common.ZigbeeColor.Current.GXCACSelectedTextColor_FanModel,
- Text = title,
- TextAlignment = TextAlignment.CenterLeft,
- Gravity = Gravity.CenterVertical,
- Tag = this.Tag
- };
- AddChidren(TitleButton);
-
- lineFrameLayout = new FrameLayout()
- {
- X = IconButton.X,
- Y = this.Height - 1,
- Width = this.Width - IconButton.X,
- Height = 1,
- BackgroundColor = Common.ZigbeeColor.Current.GXCPlaceHolderTextColor
- };
- if (hadLine)
- {
- AddChidren(lineFrameLayout);
- }
- }
- #endregion
-
- #region 鈼� 閫変腑鐘舵�乢_________________________
-
- /// <summary>
- /// 璁剧疆鐘舵��
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- IconButton.IsSelected = statu;
- TitleButton.IsSelected = statu;
- }
- /// <summary>
- /// 閫変腑
- /// </summary>
- public void SetSelectedStatu()
- {
- IconButton.IsSelected = true;
- TitleButton.IsSelected = true;
- }
- /// <summary>
- /// 涓嶉�変腑
- /// </summary>
- public void SetUnSelectedStatu()
- {
- IconButton.IsSelected = false;
- TitleButton.IsSelected = false;
- }
- #endregion
- }
-
-}
-
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/BackButton.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/BackButton.cs
deleted file mode 100755
index c74e102..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/BackButton.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- /// <summary>
- /// Back button.
- /// </summary>
- public class BackButton:Button
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="T:Shared.Phone.Device.CommonForm.BackButton"/> class.
- /// </summary>
- public BackButton()
- {
- X = Application.GetRealWidth(28);
- Height = Application.GetMinRealAverage(110);
- Width = Application.GetMinRealAverage(110);
- UnSelectedImagePath = "Account/Back.png";
- SelectedImagePath = "Account/BackSelected.png";
- Gravity = Gravity.CenterVertical;
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/ButtonLineForm.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
deleted file mode 100755
index 78e5035..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class ButtonLineForm : FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// line
- /// </summary>
- public Button Line;
- /// <summary>
- /// isSelected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- try
- {
- v_Selected = value;
- SetStatu(v_Selected);
- }
- catch
- {
- v_Selected = false;
- SetStatu(v_Selected);
- }
- }
- get
- {
- return v_Selected;
- }
- }
-
- /// <summary>
- /// ButtonLineForm
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public ButtonLineForm(int x, int y)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(100);
- Height = Application.GetRealHeight(85);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- NameBtn = new Button()
- {
- Width = Width,
- Height = Height - Application.GetRealHeight(6),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor4,
- SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = CommonFormResouce.TextSize,
- TextAlignment = TextAlignment.CenterLeft
- };
- AddChidren(NameBtn);
-
- Line = new Button
- {
- X = 0,
- Y = Height - Application.GetRealHeight(6),
- Width = 10,
- Height = Application.GetRealHeight(6),
- Radius = (uint)Application.GetRealHeight(6 / 2),
- BackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
- Visible = false
- };
- AddChidren(Line);
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- RefreshWidth();
- }
-
- /// <summary>
- /// RefreshWidth
- /// </summary>
- public void RefreshWidth()
- {
- NameBtn.Width = NameBtn.GetTextWidth() + Application.GetRealWidth(100);
- Width = NameBtn.Width;
- Line.X = NameBtn.GetTextWidth() / 4;
- Line.Width= NameBtn.GetTextWidth() / 2;
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- NameBtn.IsSelected = Line.Visible = statu;
- NameBtn.TextSize = statu ? CommonFormResouce.TextSize_Selected : CommonFormResouce.TextSize;
- NameBtn.IsBold = statu;
- RefreshWidth();
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs
deleted file mode 100755
index 94004ab..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs
+++ /dev/null
@@ -1,292 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class CategoryFunctionForWinRow:FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// Image
- /// </summary>
- public Button ImageBtn;
- /// <summary>
- /// ImageBG
- /// </summary>
- public Button ImageBG;
- /// <summary>
- /// ZoneBtn
- /// </summary>
- private Button StatuBtn;
- /// <summary>
- /// OpenOrUpBtn
- /// </summary>
- public Button OpenOrUpBtn;
- /// <summary>
- /// OpenOrUpBtn
- /// </summary>
- public Button CloseOrDownBtn;
- /// <summary>
- /// StopBtn
- /// </summary>
- public Button StopBtn;
-
- /// <summary>
- /// ClickBtn
- /// </summary>
- public Button ClickBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
- /// <summary>
- /// CategoryFunctionForWinRow
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public CategoryFunctionForWinRow(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1022);
- Height = Application.GetRealHeight(127-2);
- //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- /// <summary>
- /// Init
- /// </summary>
- /// <param name="device"></param>
- public void Init(CommonDevice device)
- {
- ImageBG = new Button()
- {
- X = Application.GetRealWidth(45),
- Width = Application.GetMinRealAverage(112),
- Height = Application.GetMinRealAverage(112),
- Gravity = Gravity.CenterVertical,
- Radius = (uint)Application.GetMinRealAverage(112 / 2),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- SelectedBackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor,
- };
- AddChidren(ImageBG);
-
- ImageBtn = new Button()
- {
- X = Application.GetRealWidth(63),
- Width = Application.GetMinRealAverage(78),
- Height = Application.GetMinRealAverage(78),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = device.IconPath,
- SelectedImagePath = device.OnlineIconPath,
- };
- AddChidren(ImageBtn);
-
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(181),
- Y = Application.GetRealHeight(14),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(58),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=14
- };
- AddChidren(NameBtn);
-
- StatuBtn = new Button
- {
- X = Application.GetRealWidth(181),
- Y = Application.GetRealHeight(72),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(49),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextSize=10
- };
- AddChidren(StatuBtn);
-
- OpenOrUpBtn = new Button
- {
- X = Application.GetRealWidth(625),
- Width = Application.GetMinRealAverage(69),
- Height = Application.GetMinRealAverage(69),
- SelectedImagePath = "RollerShade/OpenSelected.png",
- UnSelectedImagePath = "RollerShade/Open.png",
- Gravity = Gravity.CenterVertical
- };
- AddChidren(OpenOrUpBtn);
- OpenOrUpBtn.MouseUpEventHandler += (sender, e) =>
- {
- (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(0);
- };
-
- StopBtn = new Button
- {
- X = Application.GetRealWidth(769),
- Width = Application.GetMinRealAverage(69),
- Height = Application.GetMinRealAverage(69),
- SelectedImagePath = "RollerShade/StopSelected.png",
- UnSelectedImagePath = "RollerShade/Stop.png",
- Gravity = Gravity.CenterVertical
- };
- AddChidren(StopBtn);
- StopBtn.MouseUpEventHandler += (sender, e) =>
- {
- (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(2);
- };
-
- CloseOrDownBtn = new Button
- {
- X = Application.GetRealWidth(896),
- Width = Application.GetMinRealAverage(69),
- Height = Application.GetMinRealAverage(69),
- SelectedImagePath = "RollerShade/CloseSelected.png",
- UnSelectedImagePath = "RollerShade/Close.png",
- Gravity = Gravity.CenterVertical
- };
- AddChidren(CloseOrDownBtn);
- CloseOrDownBtn.MouseUpEventHandler += (sender, e) =>
- {
- (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(1);
- };
-
- var line = new Button()
- {
- X = Application.GetRealWidth(181),
- Y = Height - 1,
- Width = Application.GetRealWidth(821),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- Tag = Tag
- };
- AddChidren(line);
-
- ClickBtn = new Button
- {
- Width = Application.GetRealWidth(600)
- };
- AddChidren(ClickBtn);
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
-
- /// <summary>
- /// SetZoneText
- /// </summary>
- /// <param name="title"></param>
- public void SetStatuText(string title)
- {
- StatuBtn.Text = title;
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- //OpenOrUpBtn.IsSelected = CloseOrDownBtn.IsSelected = StopBtn.IsSelected = statu;
- NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = statu;
- NameBtn.IsBold = statu;
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetOnLineStatu(bool statu)
- {
- NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = statu;
- NameBtn.IsBold = statu;
- }
-
- /// <summary>
- /// HideSwitchBtn
- /// </summary>
- /// <param name="statu"></param>
- public void HideSwitchBtn(bool statu)
- {
-
- }
-
- /// <summary>
- /// WcdType=4锛氬紑鍚堝笜
- /// WcdType=0锛氬嵎甯�
- /// </summary>
- /// <param name="type"></param>
- public void SetRollerShadeIcon(int type)
- {
- if(type==0)
- {
- OpenOrUpBtn.UnSelectedImagePath = "RollerShade/Up.png";
- OpenOrUpBtn.SelectedImagePath = "RollerShade/UpSelected.png";
-
- CloseOrDownBtn.UnSelectedImagePath = "RollerShade/Down.png";
- CloseOrDownBtn.SelectedImagePath = "RollerShade/DownSelected.png";
- }
- else
- {
- OpenOrUpBtn.UnSelectedImagePath = "RollerShade/Open.png";
- OpenOrUpBtn.SelectedImagePath = "RollerShade/OpenSelected.png";
-
- CloseOrDownBtn.UnSelectedImagePath = "RollerShade/Close.png";
- CloseOrDownBtn.SelectedImagePath = "RollerShade/CloseSelected.png";
- }
- }
-
-
- /// <summary>
- /// SetDeviceIcon
- /// </summary>
- /// <param name="imagePath"></param>
- /// <param name="selectedImagePath"></param>
- public void SetDeviceIcon(string imagePath, string selectedImagePath)
- {
- ImageBtn.UnSelectedImagePath = imagePath;
- ImageBtn.SelectedImagePath = selectedImagePath;
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs
deleted file mode 100755
index 27a7468..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class CategoryFunctionRow : FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// Image
- /// </summary>
- public Button ImageBtn;
- /// <summary>
- /// ImageBG
- /// </summary>
- public Button ImageBG;
- /// <summary>
- /// SwitchBtn
- /// </summary>
- public Button SwitchBtn;
- /// <summary>
- /// ZoneBtn
- /// </summary>
- private Button StatuBtn;
- /// <summary>
- /// ClickBtn
- /// </summary>
- public Button ClickBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
-
- /// <summary>
- /// FunctionRow
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public CategoryFunctionRow(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1022);
- Height = Application.GetRealHeight(127-2);
- //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- /// <summary>
- /// Init
- /// </summary>
- /// <param name="imagePath"></param>
- /// <param name="selectedImagePath"></param>
- public void Init(string imagePath, string selectedImagePath)
- {
- ImageBG = new Button()
- {
- X = Application.GetRealWidth(45),
- Width = Application.GetMinRealAverage(112),
- Height = Application.GetMinRealAverage(112),
- Gravity = Gravity.CenterVertical,
- Radius = (uint)Application.GetMinRealAverage(112 / 2),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- SelectedBackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor,
- Tag = Tag
- };
- AddChidren(ImageBG);
-
- ImageBtn = new Button()
- {
- X = Application.GetRealWidth(63),
- Width = Application.GetMinRealAverage(78),
- Height = Application.GetMinRealAverage(78),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = imagePath,
- SelectedImagePath = selectedImagePath,
- Tag = Tag
- };
- AddChidren(ImageBtn);
-
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(181),
- Y = Application.GetRealHeight(14),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(58),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=14,
- Tag = Tag
- };
- AddChidren(NameBtn);
-
- StatuBtn = new Button
- {
- X = Application.GetRealWidth(181),
- Y = Application.GetRealHeight(72),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(49),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextSize=10
- };
- AddChidren(StatuBtn);
-
- SwitchBtn = new Button()
- {
- X = Application.GetRealWidth(896),
- Width = Application.GetMinRealAverage(78),
- Height = Application.GetMinRealAverage(78),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- Tag = Tag
- };
- AddChidren(SwitchBtn);
-
- var line = new Button()
- {
- X = Application.GetRealWidth(181),
- Y = Height - 1,
- Width = Application.GetRealWidth(821),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor,
- Tag = Tag
- };
- AddChidren(line);
-
- ClickBtn = new Button
- {
- Width=Application.GetRealWidth(890)
- };
- AddChidren(ClickBtn);
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
-
- /// <summary>
- /// SetZoneText
- /// </summary>
- /// <param name="title"></param>
- public void SetStatuText(string title)
- {
- StatuBtn.Text = title;
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- SwitchBtn.IsSelected = statu;
- NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = statu;
- NameBtn.IsBold = statu;
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetOnLineStatu(bool statu)
- {
- NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = statu;
- }
-
- /// <summary>
- /// HideSwitchBtn
- /// </summary>
- /// <param name="statu"></param>
- public void HideSwitchBtn(bool statu)
- {
- SwitchBtn.Visible = !statu;
- }
-
- /// <summary>
- /// SetDeviceIcon
- /// </summary>
- /// <param name="imagePath"></param>
- /// <param name="selectedImagePath"></param>
- public void SetDeviceIcon(string imagePath, string selectedImagePath)
- {
- ImageBtn.UnSelectedImagePath = imagePath;
- ImageBtn.SelectedImagePath = selectedImagePath;
- }
- }
-}
\ No newline at end of file
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CustomAlert.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CustomAlert.cs
deleted file mode 100755
index 23f0c78..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/CustomAlert.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class CustomAlert : FrameLayout
- {
- /// <summary>
- /// CancleBtn
- /// </summary>
- public Button CancleBtn;
- /// <summary>
- /// ComfrimBtn
- /// </summary>
- public Button ComfrimBtn;
- /// <summary>
- /// ResultEventHandler
- /// </summary>
- public Action<bool> ResultEventHandler;
-
- public CustomAlert()
- {
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(1920);
- }
-
- /// <summary>
- /// Show
- /// </summary>
- /// <param name="tip"></param>
- /// <param name="message"></param>
- /// <param name="cancle"></param>
- /// <param name="comfirm"></param>
- public void Show(string tip,string message,string cancle,string comfirm)
- {
- var tipBackGround = new FrameLayout
- {
- BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
- };
- AddChidren(tipBackGround);
-
- var tipView = new FrameLayout
- {
- Height = Application.GetRealHeight(478),
- Width = Application.GetRealWidth(792),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- Radius = (uint)Application.GetRealHeight(30),
- Gravity = Gravity.Center
- };
- tipBackGround.AddChidren(tipView);
-
- var tipBtn = new Button
- {
- Y=Application.GetRealHeight(69),
- Width=Application.GetRealWidth(500),
- Height=Application.GetRealHeight(63),
- Gravity=Gravity.CenterHorizontal,
- TextColor=ZigbeeColor.Current.GXCTextBlackColor,
- TextSize=15,
- Text=tip
- };
- tipView.AddChidren(tipBtn);
-
- var messageBtn = new Button
- {
- Y = Application.GetRealHeight(180),
- Width = Application.GetRealWidth(674),
- Height = Application.GetRealHeight(140),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 15,
- Text = message,
- IsMoreLines=true
- };
- tipView.AddChidren(messageBtn);
-
- CancleBtn = new Button
- {
- Y = Application.GetRealHeight(351),
- Width = Application.GetRealWidth(396),
- Height = Application.GetRealHeight(127),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 15,
- BackgroundColor=ZigbeeColor.Current.GXCButtonUnSelectedColor3,
- Text = cancle
- };
- tipView.AddChidren(CancleBtn);
-
- ComfrimBtn = new Button
- {
- X = Application.GetRealWidth(396),
- Y = Application.GetRealHeight(351),
- Width = Application.GetRealWidth(396),
- Height = Application.GetRealHeight(127),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 15,
- BackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor,
- Text = comfirm
- };
- tipView.AddChidren(ComfrimBtn);
-
- CancleBtn.MouseUpEventHandler = (sender, e) =>
- {
- RemoveFromParent();
- ResultEventHandler?.Invoke(false);
- };
-
- ComfrimBtn.MouseUpEventHandler = (sender, e) =>
- {
- RemoveFromParent();
- ResultEventHandler?.Invoke(true);
- };
- }
- /// <summary>
- /// Show
- /// </summary>
- /// <param name="message"></param>
- public void Show(string message)
- {
- Show(Language.StringByID(R.MyInternationalizationString.TIP), message, Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs
deleted file mode 100755
index 1b5cb52..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs
+++ /dev/null
@@ -1,430 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Globalization;
-using Shared.Common;
-using Shared.Phone.UserCenter;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class DeviceDetailInfo : FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// 鎵�灞炲尯鍩�
- /// </summary>
- private string roomName;
- /// <summary>
- /// action
- /// </summary>
- public Action<CommonDevice, Common.Room> EditAction;
- /// <summary>
- /// curRoom
- /// </summary>
- private Common.Room curRoom;
- /// <summary>
- /// curRoom
- /// </summary>
- private Common.Room befRoom;
- /// <summary>
- /// sharedRow
- /// </summary>
- private DeviceInfoRow sharedRow;
- /// <summary>
- /// functionTypeRow
- /// </summary>
- private DeviceInfoRow functionTypeRow;
-
-
- #endregion
-
- #region 鈼� 绉婚櫎____________________________
- /// <summary>
- /// RemoveFromParent
- /// </summary>
- public override void RemoveFromParent()
- {
- EditAction = null;
- base.RemoveFromParent();
- }
- #endregion
-
- #region 鈼� 鏋勯�犳柟娉昣________________________
- /// <summary>
- /// DeviceDetailInfo
- /// </summary>
- public DeviceDetailInfo()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- #endregion
-
- #region 鈼� 鏄剧ず鐣岄潰_________________________
- /// <summary>
- /// Show
- /// </summary>
- /// <param name="device"></param>
- /// <param name="room"></param>
- public void Show(CommonDevice device, Common.Room room)
- {
- Init(device);
-
- AddTop();
-
- AddBodyView(device,room);
-
- }
-
- #endregion
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.FunctionSetting);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device, Common.Room room)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var deviceBG = new Button()
- {
- Y = Application.GetRealHeight(118),
- Width = Application.GetMinRealAverage(207),
- Height = Application.GetMinRealAverage(207),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- Radius = (uint)Application.GetMinRealAverage(207/2)
- };
- bodyFrameLayout.AddChidren(deviceBG);
-
- var deviceBG2 = new Button()
- {
- Y = Application.GetRealHeight(130),
- Width = Application.GetMinRealAverage(184),
- Height = Application.GetMinRealAverage(184),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor,
- Radius = (uint)Application.GetMinRealAverage(184/2)
- };
- bodyFrameLayout.AddChidren(deviceBG2);
-
- var deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(161),
- Width = Application.GetMinRealAverage(124),
- Height = Application.GetMinRealAverage(124),
- UnSelectedImagePath = device.IconPath,
- Gravity = Gravity.CenterHorizontal
- };
- bodyFrameLayout.AddChidren(deviceIMG);
-
- var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
-
- var deviceTypeName = new Button()
- {
- Y = Application.GetRealHeight(360),
- Width = Application.GetRealWidth(900),
- Height = Application.GetRealHeight(80),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextID = info.BeloneTextId,
- Gravity = Gravity.CenterHorizontal,
- TextSize = 15
- };
- bodyFrameLayout.AddChidren(deviceTypeName);
-
-
- var infoFL = new FrameLayout
- {
- Y = Application.GetRealHeight(540),
- Height = Application.GetRealHeight(1195),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(infoFL);
- var rectCornerID = HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight;
- infoFL.SetCornerWithSameRadius(Application.GetRealHeight(58), rectCornerID);
-
- var tipBtn = new Button
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(81),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(60),
- TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = 15,
- TextID = R.MyInternationalizationString.EditInfo
- };
- infoFL.AddChidren(tipBtn);
-
- var infoScrolView = new VerticalScrolViewLayout
- {
- Y = Application.GetRealHeight(170-12),
- Height = Application.GetRealHeight(600),
- ScrollEnabled = false,
- VerticalScrollBarEnabled = false
- };
- infoFL.AddChidren(infoScrolView);
-
- var nameFL = new FrameLayout
- {
- Height = Application.GetRealHeight(127 + 12)
- };
- infoScrolView.AddChidren(nameFL);
- var nameRow = new DeviceInfoEditRow(12);
- nameRow.Init();
- nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.FunctionName)} : ");
- nameRow.SetTitle(string.IsNullOrEmpty(Common.LocalDevice.Current.GetDeviceEpointName(device)) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : Common.LocalDevice.Current.GetDeviceEpointName(device));
- nameFL.AddChidren(nameRow);
-
-
- var zoneFL = new FrameLayout
- {
- Height = Application.GetRealHeight(127 + 12)
- };
- if (room != null && room.IsLove == false)
- {
- infoScrolView.AddChidren(zoneFL);
- }
- var zoneRow = new DeviceInfoRow(12);
- zoneRow.Init();
- zoneRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongZone)} : ");
- zoneRow.SetTitle(roomName);
- zoneFL.AddChidren(zoneRow);
-
- var modelFL = new FrameLayout
- {
- Height = Application.GetRealHeight(127 + 12)
- };
- infoScrolView.AddChidren(modelFL);
- var modelRow = new DeviceInfoRow(12);
- modelRow.Init();
- modelRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongModel)} : ");
- modelRow.SetTitle(string.IsNullOrEmpty(device.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : device.DeviceName);
- modelRow.HideNext(true);
- modelFL.AddChidren(modelRow);
-
- if (device.Type == DeviceType.OnOffOutput || device.Type == DeviceType.AirSwitch)
- {
- var typeFL = new FrameLayout
- {
- Height = Application.GetRealHeight(127 + 12)
- };
- infoScrolView.AddChidren(typeFL);
- functionTypeRow = new DeviceInfoRow(12);
- functionTypeRow.Init();
- functionTypeRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.FunctionType)} : ");
- //functionTypeRow.SetTitle(device.CommonDevice.DfunctionType);
- typeFL.AddChidren(functionTypeRow);
- var dfunctionType = device.DfunctionType;
-
- //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛�
- string strT = string.Empty;
- if (dfunctionType == DeviceFunctionType.A鐏厜)
- {
- strT = Language.StringByID(R.MyInternationalizationString.uLight);
- }
- else if (dfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- strT = Language.StringByID(R.MyInternationalizationString.uSwitch);
- }
- else if (dfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- strT = Language.StringByID(R.MyInternationalizationString.uSocket1);
- }
- functionTypeRow.SetTitle(strT);
-
- functionTypeRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
- {
- var DfunctionType = device.DfunctionType;
-
- //鍔熻兘绫诲瀷鐨勭炕璇戝悕瀛�
- int nowSelectNo = 1;
- string strType = string.Empty;
- if (DfunctionType == DeviceFunctionType.A鐏厜)
- {
- strType = Language.StringByID(R.MyInternationalizationString.uLight);
- nowSelectNo = 1;
- }
- else if (DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- strType = Language.StringByID(R.MyInternationalizationString.uSwitch);
- nowSelectNo = 0;
- }
- else if (DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- strType = Language.StringByID(R.MyInternationalizationString.uSocket1);
- nowSelectNo = 2;
- }
- //鏄剧ず鍒楄〃
- var listText = new List<string>();
- listText.Add(Language.StringByID(R.MyInternationalizationString.uSwitch));//寮�鍏�
- listText.Add(Language.StringByID(R.MyInternationalizationString.uLight));//鐏厜
- listText.Add(Language.StringByID(R.MyInternationalizationString.uSocket1));//鎻掑骇
- //鏍囬:閫夋嫨鍔熻兘绫诲瀷
- var title = Language.StringByID(R.MyInternationalizationString.uSelectFunctionType);
-
- var form = new BottomItemSelectForm();
- form.AddForm(title, listText, nowSelectNo);
- form.FinishSelectEvent += (selectNo) =>
- {
- functionTypeRow.NameText.Text = listText[selectNo];
- nowSelectNo = selectNo;
- //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨�
- if (selectNo == 0)
- {
- device.DfunctionType = DeviceFunctionType.A寮�鍏�;
- }
- else if (selectNo == 1)
- {
- device.DfunctionType = DeviceFunctionType.A鐏厜;
- }
- else
- {
- device.DfunctionType = DeviceFunctionType.A鎻掑骇;
- }
- };
- };
- }
-
-
- var confirmBtn = new CommonForm.CompleteButton(962, 900, 127);
- confirmBtn.SetTitle(R.MyInternationalizationString.Save);
- infoFL.AddChidren(confirmBtn);
-
- #region event
- EventHandler<MouseEventArgs> selectZoneEvent = (sender, e) =>
- {
- var zone = new SelectZone();
- zone.Init();
- zone.ZoneAction += (selectRoom) =>
- {
- curRoom = selectRoom;
- zoneRow.SetTitle(HdlRoomLogic.Current.GetZoneName(selectRoom));
- };
- };
- zoneRow.ClickBtn.MouseUpEventHandler += selectZoneEvent;
-
- EventHandler<MouseEventArgs> selectDeviceIconEvent = (sender, e) =>
- {
- var localPic = new DeviceIconSelectedIMGByLocal();
- UserView.HomePage.Instance.AddChidren(localPic);
- UserView.HomePage.Instance.PageIndex += 1;
- localPic.Show();
- localPic.action = (unSelectedImagePath, selectedImagePath) =>
- {
- deviceIMG.UnSelectedImagePath = unSelectedImagePath;
- deviceIMG.SelectedImagePath = selectedImagePath;
- device.IsCustomizeImage = true;
- };
- };
- deviceIMG.MouseUpEventHandler += selectDeviceIconEvent;
-
- confirmBtn.MouseUpEventHandler += (sender, e) =>
- {
- try
- {
- CommonPage.Loading.Start();
- if (device == null)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain));
- return;
- }
- if (device.Type == DeviceType.OnOffOutput || device.Type == DeviceType.AirSwitch)
- {
- if (device.IsCustomizeImage == false)
- {
- if (device.DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- device.IconPath = "Device/Switch.png";
- }
- else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- device.IconPath = "Device/Socket1.png";
- }
- else if (device.DfunctionType == DeviceFunctionType.A鐏厜)
- {
- device.IconPath = "Device/Light.png";
- }
- }
- else
- {
- //鏀瑰浘鐗�
- device.IconPath = deviceIMG.UnSelectedImagePath;
- }
- }
- else
- {
- //鏀瑰浘鐗�
- device.IconPath = deviceIMG.UnSelectedImagePath;
- }
- bool result;
- new System.Threading.Thread(async () =>
- {
- result = await LocalDevice.Current.ReName(device, nameRow.NameText.Text.Trim());
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- if (result)
- {
- //鏀规埧闂�
- HdlRoomLogic.Current.ChangedRoom(device, curRoom.Id);
- device.ReSave();
- EditAction?.Invoke(device, curRoom);
- RemoveFromParent();
- }
- else
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain));
- }
- });
- })
- { IsBackground = true }.Start();
- }
- catch
- {
- CommonPage.Loading.Hide();
- }
- };
-
- #endregion
- }
-
- /// <summary>
- /// Init
- /// </summary>
- /// <param name="device"></param>
- public void Init(CommonDevice device)
- {
- roomName = HdlRoomLogic.Current.GetRoomNameByDevice(device, "锛�");
- befRoom = HdlRoomLogic.Current.GetRoomByDevice(device);
- curRoom = HdlRoomLogic.Current.GetRoomByDevice(device);
- }
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceInfoEditRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceInfoEditRow.cs
deleted file mode 100755
index 9ef77e5..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceInfoEditRow.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class DeviceInfoEditRow:FrameLayout
- {
- /// <summary>
- /// TipBtn
- /// </summary>
- public Button TipBtn;
- /// <summary>
- /// NameText
- /// </summary>
- public EditText NameText;
-
- /// <summary>
- /// DeviceInfoEditRow
- /// </summary>
- public DeviceInfoEditRow(int y)
- {
- X = Application.GetRealWidth(0);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(127);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- TipBtn = new Button
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Width = Application.GetRealWidth(223),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = CommonFormResouce.TextSize
- };
- AddChidren(TipBtn);
-
- NameText = new EditText
- {
- X = Application.GetRealWidth(300),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- PlaceholderTextColor=ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=CommonFormResouce.TextSize
- };
- AddChidren(NameText);
-
- var line = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Height - 1,
- Width = Application.GetRealWidth(965),
- Height = 1,
- BackgroundColor = UserCenter.UserCenterColor.Current.ButtomLine,
- };
- AddChidren(line);
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameText.Text = title;
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
-
- /// <summary>
- /// SetPlaceHoldText
- /// </summary>
- /// <param name="holdText"></param>
- public void SetPlaceHoldText(string holdText)
- {
- NameText.PlaceholderText = holdText;
- }
- /// <summary>
- /// SetPlaceHoldText
- /// </summary>
- /// <param name="holdText"></param>
- public void SetPlaceHoldText(int holdText)
- {
- SetPlaceHoldText(Language.StringByID(holdText));
- }
-
- /// <summary>
- /// SetName
- /// </summary>
- /// <param name="title"></param>
- public void SetTipTitle(string title)
- {
- TipBtn.Text = title;
- }
-
- /// <summary>
- /// SetTipTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTipTitle(int title)
- {
- SetTipTitle(Language.StringByID(title));
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceInfoWithZoneRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceInfoWithZoneRow.cs
deleted file mode 100755
index 7bfe15c..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/DeviceInfoWithZoneRow.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class DeviceInfoWithZoneRow : FrameLayout
- {
- /// <summary>
- /// 鍥剧墖
- /// </summary>
- public Button IconButton;
- /// <summary>
- /// NameBtn
- /// </summary>
- public Button NameButton;
- /// <summary>
- /// ZoneButton
- /// </summary>
- public Button ZoneButton;
- /// <summary>
- /// NextBtn
- /// </summary>
- public Button SelectBtn;
- /// <summary>
- /// ClickButton
- /// </summary>
- public Button ClickButton;
- /// <summary>
- /// line
- /// </summary>
- Button line;
- /// <summary>
- /// DeviceInfoWithZoneRow
- /// </summary>
- /// <param name="y"></param>
- public DeviceInfoWithZoneRow(int y)
- {
- X = Application.GetRealWidth(0);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(127);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- IconButton = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Height = Application.GetMinRealAverage(80),
- Width = Application.GetMinRealAverage(80),
- Gravity = Gravity.CenterVertical,
- };
- AddChidren(IconButton);
-
- NameButton = new Button
- {
- X = Application.GetRealWidth(176),
- Y=Application.GetRealHeight(12),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft
- };
- AddChidren(NameButton);
-
- ZoneButton = new Button
- {
- X = Application.GetRealWidth(176),
- Y = Application.GetRealHeight(72),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(50),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextAlignment = TextAlignment.CenterLeft
- };
- AddChidren(ZoneButton);
-
- SelectBtn = new Button
- {
- X = Application.GetRealWidth(910),
- Width = Application.GetMinRealAverage(100),
- Height = Application.GetMinRealAverage(100),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Scene/Selected.png",
- Visible = false
- };
- AddChidren(SelectBtn);
-
- line = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Height - 1,
- Width = Application.GetRealWidth(965),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- AddChidren(line);
- ClickButton = new Button
- {
-
- };
- AddChidren(ClickButton);
- }
-
- /// <summary>
- /// SetName
- /// </summary>
- /// <param name="title"></param>
- public void SetName(string title)
- {
- NameButton.Text = title;
- }
-
-
- /// <summary>
- /// SetZone
- /// </summary>
- /// <param name="title"></param>
- public void SetZone(string title)
- {
- ZoneButton.Text = title;
- }
-
- /// <summary>
- /// SetIcon
- /// </summary>
- /// <param name="imagePath"></param>
- public void SetIcon(string imagePath)
- {
- IconButton.UnSelectedImagePath = imagePath;
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- SelectBtn.Visible = statu;
- }
- /// <summary>
- /// HideLine
- /// </summary>
- /// <param name="statu"></param>
- public void HideLine(bool statu)
- {
- line.Visible = !statu;
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionButton.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionButton.cs
deleted file mode 100755
index fba65f2..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionButton.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class FunctionButton:FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// Image
- /// </summary>
- public Button ImageBtn;
- /// <summary>
- /// ImageBG
- /// </summary>
- public Button ImageBG;
- /// <summary>
- /// ClickBtn
- /// </summary>
- public Button ClickBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- try
- {
- v_Selected = value;
- SetStatu(v_Selected);
- }
- catch { };
- }
- get
- {
- return v_Selected;
- }
- }
-
- /// <summary>
- /// FunctionButton
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public FunctionButton(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(220);
- Height = Application.GetRealHeight(279);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- /// <param name="imagePath"></param>
- public void Init(string imagePath,string selectedImagePath)
- {
- ImageBG = new Button()
- {
- Y = Application.GetRealHeight(35),
- Width = Application.GetMinRealAverage(150),
- Height = Application.GetMinRealAverage(173),
- Gravity=Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Category_FunctionBG.png",
- SelectedImagePath = "Item/Category_FunctionBGSelected.png",
- Tag=Tag
- };
- AddChidren(ImageBG);
-
- ImageBtn = new Button()
- {
- Y = Application.GetRealHeight(63),
- Width = Application.GetMinRealAverage(84),
- Height = Application.GetMinRealAverage(84),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = imagePath,
- SelectedImagePath = selectedImagePath,
- Tag = Tag,
- IsSelected=true
- };
- AddChidren(ImageBtn);
-
- NameBtn = new Button()
- {
- Y = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(170),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
- Tag = Tag,
- TextSize=11
- };
- AddChidren(NameBtn);
-
- ClickBtn = new Button
- {
- Tag = Tag
- };
- AddChidren(ClickBtn);
- }
-
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- ImageBG.IsSelected = NameBtn.IsSelected = statu;
- NameBtn.IsBold = statu;
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionMainView.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionMainView.cs
deleted file mode 100755
index 448da2e..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionMainView.cs
+++ /dev/null
@@ -1,235 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class FunctionMainView : FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- public Button NameButton;
- /// <summary>
- /// collect
- /// </summary>
- public Button CollectButton;
- /// <summary>
- /// Image
- /// </summary>
- public Button IconButton;
- /// <summary>
- /// ImageBG
- /// </summary>
- public Button ImageBG;
-
-
- /// <summary>
- /// statu
- /// </summary>
- public Button StatuButton;
- /// <summary>
- /// switch
- /// </summary>
- public Button SwitchButton;
-
- /// <summary>
- /// CardBG
- /// </summary>
- public Button CardBG;
-
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
-
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- try
- {
- v_Selected = value;
- SetStatu(v_Selected);
- }
- catch { };
- }
- get
- {
- return v_Selected;
- }
- }
-
- public FunctionMainView(int x,int y)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetMinRealAverage(487);
- Height = Application.GetMinRealAverage(348);
- }
-
- /// <summary>
- /// init
- /// </summary>
- public void Init()
- {
- //var bg = new Button
- //{
- // Width = Application.GetMinReal(487),
- // Height = Application.GetMinReal(348),
- //UnSelectedImagePath = "Item/FunctionViewBG.png"
- //};
- //AddChidren(bg);
-
- CardBG = new Button
- {
- Width = Application.GetMinRealAverage(487),
- Height = Application.GetMinRealAverage(348),
- UnSelectedImagePath = "Item/FunctionCardView.png",
- SelectedImagePath = "Item/FunctionCardViewSelected.png",
- Gravity=Gravity.CenterHorizontal
- };
- AddChidren(CardBG);
-
- NameButton = new Button()
- {
- X=Application.GetMinRealAverage(40),
- Y = Application.GetMinRealAverage(17),
- Width = Application.GetMinRealAverage(320),
- Height = Application.GetMinRealAverage(63),
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextAlignment=TextAlignment.CenterLeft,
- TextSize=15
- };
- AddChidren(NameButton);
-
- CollectButton = new Button
- {
- X = Application.GetMinRealAverage(366),
- Y = Application.GetMinRealAverage(14),
- Width = Application.GetMinRealAverage(107),
- Height = Application.GetMinRealAverage(107),
- UnSelectedImagePath="Item/Collection1.png",
- SelectedImagePath="Item/CollectionSelected1.png"
- };
- AddChidren(CollectButton);
-
- var imgFL = new FrameLayout
- {
- X = Application.GetMinRealAverage(40),
- Y = Application.GetMinRealAverage(101),
- Width = Application.GetMinRealAverage(124),
- Height = Application.GetMinRealAverage(124)
- };
- AddChidren(imgFL);
-
- ImageBG = new Button()
- {
- //X=Application.GetMinRealAverage(40),
- //Y = Application.GetMinRealAverage(101),
- Width = Application.GetMinRealAverage(124),
- Height = Application.GetMinRealAverage(124),
- Gravity=Gravity.Center,
- BackgroundColor = ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor,
- SelectedBackgroundColor = ZigbeeColor.Current.GXCForFunctionBackgroundColor,
- Radius=(uint)Application.GetMinRealAverage(124/2)
- };
- imgFL.AddChidren(ImageBG);
-
- IconButton = new Button()
- {
- //X=Application.GetMinRealAverage(63),
- //Y = Application.GetMinRealAverage(121),
- Width = Application.GetMinRealAverage(84),
- Height = Application.GetMinRealAverage(84),
- Gravity=Gravity.Center
- };
- imgFL.AddChidren(IconButton);
-
- StatuButton = new Button()
- {
- X=Application.GetMinRealAverage(46),
- Y = Application.GetMinRealAverage(239),
- Width = Application.GetMinRealAverage(279),
- Height = Application.GetMinRealAverage(60),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
- TextAlignment=TextAlignment.CenterLeft,
- TextSize=14,
- IsBold=true
- };
- AddChidren(StatuButton);
-
- SwitchButton = new Button
- {
- X = Application.GetMinRealAverage(325),
- Y = Application.GetMinRealAverage(202),
- Width = Application.GetMinRealAverage(109),
- Height = Application.GetMinRealAverage(104),
- UnSelectedImagePath = "Item/Switch1.png",
- SelectedImagePath = "Item/SwitchSelected1.png"
- };
- AddChidren(SwitchButton);
- }
-
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- private void SetStatu(bool statu)
- {
- NameButton.IsSelected = IconButton.IsSelected = SwitchButton.IsSelected = StatuButton.IsSelected = CardBG.IsSelected = statu;
- NameButton.IsBold = statu;
- }
-
- /// <summary>
- /// SetDeviceImage
- /// </summary>
- /// <param name="img"></param>
- /// <param name="seletedImg"></param>
- public void SetDeviceImage(string img,string seletedImg)
- {
- IconButton.UnSelectedImagePath = img;
- IconButton.SelectedImagePath = seletedImg;
- }
-
- /// <summary>
- /// SetDeviceName
- /// </summary>
- /// <param name="name"></param>
- public void SetDeviceName(string name)
- {
- NameButton.Text = name;
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatuText(string statu)
- {
- StatuButton.Text = statu;
- }
-
- /// <summary>
- /// SetCollect
- /// </summary>
- /// <param name="collect"></param>
- public void SetCollect(bool collect)
- {
- CollectButton.IsSelected = collect;
- }
- /// <summary>
- /// CanControl
- /// </summary>
- /// <param name="cmd"></param>
- public void CanControl(bool cmd)
- {
- SwitchButton.Visible = cmd;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionRow.cs
deleted file mode 100755
index 651140b..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/FunctionRow.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class FunctionRow : FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// Image
- /// </summary>
- public Button ImageBtn;
- /// <summary>
- /// ImageBG
- /// </summary>
- public Button ImageBG;
- /// <summary>
- /// SwitchBtn
- /// </summary>
- public Button SwitchBtn;
- /// <summary>
- /// ClickBtn
- /// </summary>
- public Button ClickBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
-
- /// <summary>
- /// FunctionRow
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public FunctionRow(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(127);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- /// <param name="imagePath"></param>
- /// <param name="selectedImagePath"></param>
- public void Init(string imagePath, string selectedImagePath,bool click=false)
- {
- ImageBG = new Button()
- {
- X = Application.GetRealWidth(45),
- Width = Application.GetMinRealAverage(112),
- Height = Application.GetMinRealAverage(112),
- Gravity = Gravity.CenterVertical,
- Radius=(uint)Application.GetMinRealAverage(112/2),
- BackgroundColor=ZigbeeColor.Current.GXCGrayBackgroundColor,
- SelectedBackgroundColor=ZigbeeColor.Current.GXCSelectedBackgroundColor,
- Tag = Tag
- };
- AddChidren(ImageBG);
-
- ImageBtn = new Button()
- {
- X = Application.GetRealWidth(63),
- Width = Application.GetMinRealAverage(78),
- Height = Application.GetMinRealAverage(78),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = imagePath,
- SelectedImagePath = selectedImagePath,
- Tag = Tag
- };
- AddChidren(ImageBtn);
-
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(200),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
- TextAlignment = TextAlignment.CenterLeft,
- Tag = Tag,
- TextSize = 14
- };
- AddChidren(NameBtn);
-
- SwitchBtn = new Button()
- {
- X = Application.GetRealWidth(896),
- Width = Application.GetMinRealAverage(78),
- Height = Application.GetMinRealAverage(78),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- Tag = Tag
- };
- AddChidren(SwitchBtn);
-
- var line = new Button()
- {
- X = Application.GetRealWidth(200),
- Y = Height - 1,
- Width = Application.GetRealWidth(821),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- Tag = Tag
- };
- AddChidren(line);
-
- ClickBtn = new Button();
- if (click)
- {
- AddChidren(ClickBtn);
- }
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = SwitchBtn.IsSelected = statu;
- }
-
- /// <summary>
- /// HideSwitchBtn
- /// </summary>
- /// <param name="statu"></param>
- public void HideSwitchBtn(bool statu)
- {
- SwitchBtn.Visible = statu;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomButton.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomButton.cs
deleted file mode 100755
index 15f15e1..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomButton.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- /// <summary>
- /// 鎴块棿鎸夐挳鍥剧墖
- /// </summary>
- public class RoomButton : FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// 鑳屾櫙鍥�
- /// </summary>
- public Button BackGroundBtn;
- /// <summary>
- /// 鐐瑰嚮浜嬩欢
- /// </summary>
- public Action<RoomButton, MouseEventArgs> ButtonClickEvent;
- /// <summary>
- /// isSelected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- try
- {
- v_Selected = value;
- SetStatu(v_Selected);
- }
- catch
- {
- v_Selected = false;
- SetStatu(v_Selected);
- }
- }
- get
- {
- return v_Selected;
- }
- }
-
- #endregion
-
- #region 鈼� 鏋勯�犳柟娉昣________________________
-
- /// <summary>
- /// ButtonLineForm
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public RoomButton(int x, int y)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetMinRealAverage(255);
- Height = Application.GetMinRealAverage(159);
- }
-
- #endregion
-
- #region 鈼� 澶栭儴鏂规硶________________________
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- BackGroundBtn = new Button
- {
- Width = Application.GetMinRealAverage(255),
- Height = Application.GetMinRealAverage(159),
- UnSelectedImagePath = "Room/IconBackground.png",
- SelectedImagePath = "Room/IconSelectedBackground.png",
- Gravity = Gravity.Center
- };
- AddChidren(BackGroundBtn);
-
- NameBtn = new Button()
- {
- Width = Application.GetMinRealAverage(160),
- Height = Application.GetMinRealAverage(159 / 2),
- Gravity = Gravity.Center,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize = 12
- };
- AddChidren(NameBtn);
-
- BackGroundBtn.MouseUpEventHandler += Button_MouseUpEventHandler;
- NameBtn.MouseUpEventHandler += Button_MouseUpEventHandler;
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- NameBtn.IsSelected = BackGroundBtn.IsSelected = statu;
- //NameBtn.TextSize = statu ? CommonFormResouce.TextSize_Selected : CommonFormResouce.TextSize;
- NameBtn.IsBold = statu;
- }
-
- #endregion
-
- #region 鈼� 鐐瑰嚮浜嬩欢_________________________
-
- /// <summary>
- /// 鐐瑰嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_MouseUpEventHandler(object sender, MouseEventArgs e)
- {
- try
- {
- this.ButtonClickEvent?.Invoke(this, e);
- }
- catch (Exception ex)
- {
- }
- }
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomMainView.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomMainView.cs
deleted file mode 100755
index 8096d1c..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomMainView.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using Shared.Phone.UserView;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class RoomMainView : FrameLayout
- {
- /// <summary>
- /// SceneIcon
- /// </summary>
- public ImageView Icon;
- /// <summary>
- /// RoomNameButton
- /// </summary>
- public Button RoomNameButton;
- /// <summary>
- /// CardBG
- /// </summary>
- private Button CardBG;
- /// <summary>
- /// ClickBtn
- /// </summary>
- public Button ClickBtn;
- /// <summary>
- /// 鏄惁鍙互瑙﹀彂鐐瑰嚮浜嬩欢
- /// </summary>
- public bool CanClick = true;
- /// <summary>
- /// RoomMainView
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public RoomMainView(int x, int y)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetMinRealAverage(487);
- Height = Application.GetMinRealAverage(348);
- }
-
- /// <summary>
- /// init
- /// </summary>
- public void Init(FrameLayout frameLayout, Common.Room room)
- {
- CardBG = new Button
- {
- Width = Application.GetMinRealAverage(495),
- Height = Application.GetMinRealAverage(354),
- UnSelectedImagePath = "Room/RoomCardView.png",
- Gravity = Gravity.CenterHorizontal
- };
- AddChidren(CardBG);
-
- Icon = new ImageView
- {
- X = Application.GetMinRealAverage(14),
- Width = Application.GetMinRealAverage(467),
- Height = Application.GetMinRealAverage(311),
- Gravity = Gravity.CenterHorizontal,
- Radius=(uint)Application.GetMinRealAverage(29)
- };
- AddChidren(Icon);
-
- var nameBG = new Button
- {
- X=Application.GetMinRealAverage(14),
- Width = Application.GetMinRealAverage(141),
- Height = Application.GetMinRealAverage(84),
- UnSelectedImagePath = "Room/RoomCardView_Name.png",
- };
- AddChidren(nameBG);
-
- RoomNameButton = new Button()
- {
- X = Application.GetMinRealAverage(14),
- Width = Application.GetMinRealAverage(141),
- Height = Application.GetMinRealAverage(84),
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize=14,
- IsBold=true
- };
- AddChidren(RoomNameButton);
-
- ClickBtn = new Button { };
- AddChidren(ClickBtn);
-
- }
-
- /// <summary>
- /// SetRoomName
- /// </summary>
- /// <param name="name"></param>
- public void SetRoomName(string name)
- {
- RoomNameButton.Text = name;
- }
-
- /// <summary>
- /// SetRoomIcon
- /// </summary>
- /// <param name="imagePath"></param>
- public void SetRoomIcon(string imagePath)
- {
- Icon.ImagePath = imagePath;
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomNoNameMainView.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomNoNameMainView.cs
deleted file mode 100755
index 3a978ef..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomNoNameMainView.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class RoomNoNameMainView : FrameLayout
- {
- /// <summary>
- /// SceneIcon
- /// </summary>
- public Button Icon;
- /// <summary>
- /// RoomNameButton
- /// </summary>
- public Button RoomNameButton;
- /// <summary>
- /// CardBG
- /// </summary>
- private Button CardBG;
- /// <summary>
- /// iconFL
- /// </summary>
- public FrameLayout iconFL;
-
- /// <summary>
- /// RoomMainView
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public RoomNoNameMainView(int x, int y)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetMinRealAverage(487);
- Height = Application.GetMinRealAverage(348);
- }
-
- /// <summary>
- /// init
- /// </summary>
- public void Init()
- {
- CardBG = new Button
- {
- Width = Application.GetMinRealAverage(495),
- Height = Application.GetMinRealAverage(354),
- UnSelectedImagePath = "Room/RoomCardView.png",
- Gravity = Gravity.CenterHorizontal
- };
- AddChidren(CardBG);
-
- iconFL = new FrameLayout
- {
- X = Application.GetMinRealAverage(14),
- Width = Application.GetMinRealAverage(467),
- Height = Application.GetMinRealAverage(311),
- Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetMinRealAverage(29),
- BackgroundColor=ZigbeeColor.Current.GXCBlackBackgroundColor3
- };
- AddChidren(iconFL);
-
- Icon = new Button
- {
- X = Application.GetMinRealAverage(115),
- Y=Application.GetMinRealAverage(141),
- Width = Application.GetMinRealAverage(92),
- Height = Application.GetMinRealAverage(72),
- UnSelectedImagePath="Room/NoNameRoom.png"
- };
- iconFL.AddChidren(Icon);
-
- RoomNameButton = new Button()
- {
- X = Application.GetMinRealAverage(230),
- Y = Application.GetMinRealAverage(141),
- Width = Application.GetMinRealAverage(141),
- Height = Application.GetMinRealAverage(84),
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextID=R.MyInternationalizationString.Unallocated,
- TextSize=14,
- IsBold=true
-, };
- AddChidren(RoomNameButton);
- }
-
- /// <summary>
- /// SetRoomName
- /// </summary>
- /// <param name="name"></param>
- public void SetRoomName(string name)
- {
- RoomNameButton.Text = name;
- }
-
- /// <summary>
- /// SetRoomIcon
- /// </summary>
- /// <param name="imagePath"></param>
- public void SetRoomIcon(string imagePath)
- {
- Icon.UnSelectedImagePath = imagePath;
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomView.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomView.cs
index 130617e..21d6073 100755
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomView.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RoomView.cs
@@ -79,8 +79,8 @@
var frameBackGroudTemp = new FrameLayout();
frameBackGroudTemp.Width = roomBackView.Width;
frameBackGroudTemp.Height = roomBackView.Height;
- frameBackGroudTemp.Radius = roomBackView.Radius;
- frameBackGroudTemp.BackgroundColor = 0x12000000;
+ frameBackGroudTemp.Radius = (uint)Application.GetRealHeight(17);
+ frameBackGroudTemp.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor;
roomBackView.AddChidren(frameBackGroudTemp);
roomNameBackground = new FrameLayout
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RowLayoutDeleteButton.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RowLayoutDeleteButton.cs
deleted file mode 100755
index c13eb11..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RowLayoutDeleteButton.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- /// <summary>
- /// Rowlayout delete button.
- /// 鑷畾涔夊彸婊戝垹闄ゆ寜閽�
- /// 榛樿绾㈣壊鑳屾櫙 鐧借壊瀛椾綋 鏂囧瓧灞呬腑 榛樿鍦嗚--CommonPage.BigFormRadius
- /// </summary>
- public class RowLayoutDeleteButton:Button
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="T:Shared.Phone.Device.CommonForm.RowLayoutDeleteButton"/> class.
- /// </summary>
- public RowLayoutDeleteButton()
- {
- BackgroundColor = ZigbeeColor.Current.GXCRedColor;
- TextID = R.MyInternationalizationString.Delete;
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor;
- TextAlignment = TextAlignment.Center;
- TextSize = 14;
- //Radius = CommonPage.BigFormRadius;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RowLayoutEditButton.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RowLayoutEditButton.cs
deleted file mode 100755
index 1da4d87..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/RowLayoutEditButton.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- /// <summary>
- /// Rowlayout edit button.
- /// 鑷畾涔夊彸婊戠紪杈戝欢鏃舵寜閽�
- /// 榛樿鑳屾櫙 鐧借壊瀛椾綋 鏂囧瓧灞呬腑 榛樿鍦嗚--CommonPage.BigFormRadius
- /// </summary>
- public class RowLayoutEditButton:Button
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="T:Shared.Phone.Device.CommonForm.RowLayoutEditButton"/> class.
- /// </summary>
- public RowLayoutEditButton()
- {
- BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor;
- TextID = R.MyInternationalizationString.Edit;
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor;
- TextAlignment = TextAlignment.Center;
- TextSize = 14;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneMainView.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneMainView.cs
deleted file mode 100755
index 7f08de1..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneMainView.cs
+++ /dev/null
@@ -1,361 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class SceneMainView : FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- public Button TimeButton;
- /// <summary>
- /// collect
- /// </summary>
- public Button CollectButton;
- /// <summary>
- /// SceneIcon
- /// </summary>
- public ImageView SceneIcon;
- /// <summary>
- /// statu
- /// </summary>
- public Button SceneNameButton;
- /// <summary>
- /// CardBG
- /// </summary>
- private Button CardBG;
- /// <summary>
- /// sceneBG
- /// </summary>
- public Button sceneBG;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// scene
- /// </summary>
- public SceneUI scene;
- /// <summary>
- /// CollectionAction
- /// </summary>
- public Action CollectionAction;
-
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- try
- {
- v_Selected = value;
- //SetStatu(v_Selected);
- }
- catch { };
- }
- get
- {
- return v_Selected;
- }
- }
-
- /// <summary>
- /// SceneMainView
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public SceneMainView(int x, int y)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(487);
- Height = Application.GetRealHeight(358);
- }
-
- /// <summary>
- /// init
- /// </summary>
- public void Init(SceneUI sceneUI)
- {
- this.scene = sceneUI;
-
- InitFrame();
-
- InitStatu();
- }
-
- /// <summary>
- /// InitFrame
- /// </summary>
- private void InitFrame()
- {
- //CardBG = new Button
- //{
- // Width = Application.GetMinRealAverage(487),
- // Height = Application.GetMinRealAverage(348),
- // UnSelectedImagePath = "Item/FunctionCardView.png",
- // Gravity = Gravity.CenterHorizontal
- //};
- //AddChidren(CardBG);
-
- SceneIcon = new ImageView
- {
- X=Application.GetRealWidth(14),
- Width = Application.GetMinRealAverage(458),
- Height = Application.GetMinRealAverage(305),
- Gravity = Gravity.CenterHorizontal,
- Radius= (uint)Application.GetRealHeight(17)
- };
- AddChidren(SceneIcon);
- //SceneIcon.SetViewShadow(true);
- //SceneIcon.SetCornerWithSameRadius(Application.GetRealHeight(100), HDLUtils.RectCornerBottomRight);
-
- sceneBG = new Button
- {
- Width = Application.GetMinRealAverage(487),
- Height = Application.GetMinRealAverage(348),
- UnSelectedImagePath = "Scene/Background.png",
- Gravity = Gravity.CenterHorizontal
- };
- AddChidren(sceneBG);
-
- TimeButton = new Button()
- {
- X = Application.GetMinRealAverage(30),
- Y = Application.GetMinRealAverage(20),
- Width = Application.GetMinRealAverage(63),
- Height = Application.GetMinRealAverage(63),
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor3,
- TextAlignment = TextAlignment.CenterLeft,
- };
- AddChidren(TimeButton);
-
- CollectButton = new Button
- {
- X = Application.GetMinRealAverage(350),
- Y = Application.GetMinRealAverage(1),
- Width = Application.GetMinRealAverage(107),
- Height = Application.GetMinRealAverage(107),
- UnSelectedImagePath = "Item/Collection1.png",
- SelectedImagePath = "Item/CollectionSelected1.png"
- };
- AddChidren(CollectButton);
-
- SceneNameButton = new Button()
- {
- X = Application.GetMinRealAverage(46),
- Y = Application.GetMinRealAverage(239),
- Width = Application.GetMinRealAverage(279),
- Height = Application.GetMinRealAverage(60),
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = 14,
- IsBold = true
- };
- AddChidren(SceneNameButton);
- }
-
- /// <summary>
- /// InitStatu
- /// </summary>
- private void InitStatu()
- {
- SetTimeByDelayTime(scene.SceneDelayTime);
- SetSceneNameText(scene.Name);
- SetIcon(scene.IconPath);
- SetCollect(UserCenter.HdlRoomLogic.Current.IsCollectInRoom(scene));
-
- TimeButton.MouseUpEventHandler += SetTimeEvents;
- CollectButton.MouseUpEventHandler += CollectionEvent;
- SceneIcon.MouseUpEventHandler += SceneUpHandler;
- SceneNameButton.MouseUpEventHandler += SceneUpHandler;
- sceneBG.MouseUpEventHandler += SceneUpHandler;
- }
-
- /// <summary>
- /// SetTimeText
- /// </summary>
- /// <param name="name"></param>
- public void SetTimeText(string name)
- {
- TimeButton.Width = Application.GetMinRealAverage(280);
- TimeButton.Height = Application.GetMinRealAverage(63);
- TimeButton.UnSelectedImagePath = string.Empty;
- TimeButton.Text = name;
- TimeButton.TextSize = 14;
- TimeButton.IsBold = true;
- }
-
- /// <summary>
- /// SetTimeImage
- /// </summary>
- public void SetTimeImage()
- {
- TimeButton.Width = Application.GetMinRealAverage(63);
- TimeButton.Height = Application.GetMinRealAverage(63);
- TimeButton.UnSelectedImagePath = "Item/Time.png";
- TimeButton.Text = string.Empty;
- }
-
- /// <summary>
- /// SetIimeByDelayTime
- /// </summary>
- /// <param name="time"></param>
- public void SetTimeByDelayTime(int time)
- {
- if (time > 0)
- {
- SetTimeText(CommonFormResouce.GetTimeString(time));
- }
- else
- {
- SetTimeImage();
- }
- }
-
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetSceneNameText(string statu)
- {
- SceneNameButton.Text = statu;
- }
-
- /// <summary>
- /// SetIcon
- /// </summary>
- /// <param name="iconPath"></param>
- public void SetIcon(string iconPath)
- {
- if (scene.IconPathType == 0)
- {
- SceneIcon.ImagePath = iconPath;
- }
- else
- {
- SceneIcon.ImagePath = System.IO.Path.Combine(Config.Instance.FullPath, iconPath);
- }
- }
-
- /// <summary>
- /// SetCollect
- /// </summary>
- /// <param name="collect"></param>
- public void SetCollect(bool collect)
- {
- CollectButton.IsSelected = collect;
- }
-
- /// <summary>
- /// 璋冪敤鍦烘櫙
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="args"></param>
- private async void SceneUpHandler(object sender, MouseEventArgs args)
- {
- if (scene.RemainTime > 0 && scene.SceneDelayTime == 0)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying));
- return;
- }
- //1鎴愬姛 0澶辫触
- //鍚庨潰琛ヤ笂鐩稿叧鎻愮ず
- // Error鍙傛暟鍚箟
- //<para>1锛氱綉鍏虫棤娉曡В鏋愬懡浠ゆ暟鎹��</para>
- //<para>2锛氬崗璋冨櫒姝e湪鍗囩骇鎴栧浠�/鎭㈠鏁版嵁
- //<para>3锛氭搷浣滆澶�/缁�/鍦烘櫙涓嶅瓨鍦�</para>
- //<para>4锛氬叾浠栭敊璇�</para>
- //<para>5锛氭暟鎹紶杈撻敊璇紙鍦ㄦ煇娆″鎴风鍚戠綉鍏冲彂閫佹暟鎹殑杩囩▼涓紝缃戝叧鍦ㄥ悎鐞嗘椂闂磋寖鍥村唴鎺ユ敹瀹㈡埛绔暟鎹笉瀹屾暣瀵艰嚧璇ラ敊璇彂鐢熴�傚瀹㈡埛绔悜缃戝叧涓�娆″彂閫�100涓瓧鑺傜殑鏁版嵁锛屼絾缃戝叧绛夊緟鎺ユ敹浜嗕竴绉掑彧鎺ユ敹浜�80涓瓧鑺傘�傚彂鐢熻閿欒锛岀綉鍏冲皢涓诲姩鍏抽棴瀹㈡埛绔繛鎺ワ級</para>
- var sceneOpenAllData = await ZigBee.Device.Scene.ControlSceneAsync(scene.Id, scene.SceneDelayTime);
-
- if (sceneOpenAllData == null || sceneOpenAllData.sceneOpenData == null)
- {
- return;
- }
- if (sceneOpenAllData.sceneOpenData.Result == 0)
- {
- if (sceneOpenAllData.errorResponData == null)
- {
- return;
- }
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.ControlSceneFail));
- }
-
- scene.RemainTime = scene.SceneDelayTime;
- scene.SceneDelayTime = 0;
- new System.Threading.Thread(() =>
- {
- while (scene.RemainTime > 0)
- {
- System.Threading.Thread.Sleep(1000);
- Application.RunOnMainThread(() =>
- {
- SetTimeText(CommonFormResouce.GetTimeString(scene.RemainTime));
- });
- scene.RemainTime -= 1;
- }
- Application.RunOnMainThread(() =>
- {
- SetTimeImage();
- });
- })
- { IsBackground = true }.Start();
- }
-
- /// <summary>
- /// 鏀惰棌
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="mouseEventArgs"></param>
- private void CollectionEvent(object sender,MouseEventArgs mouseEventArgs)
- {
- var roomLove = UserCenter.HdlRoomLogic.Current.GetLoveRoom();
- if (UserCenter.HdlRoomLogic.Current.CurrentRoom.IsLove)
- {
- UserCenter.HdlSceneLogic.Current.DeleteSceneFromRoom(roomLove, scene);
- CollectionAction?.Invoke();
- }
- else
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- UserCenter.HdlSceneLogic.Current.AddSceneToRoom(roomLove, scene);
- }
- else
- {
- UserCenter.HdlSceneLogic.Current.DeleteSceneFromRoom(roomLove, scene);
- }
- }
- }
-
- /// <summary>
- /// setTimeEvent
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="mouseEventArgs"></param>
- private void SetTimeEvents(object sender, MouseEventArgs mouseEventArgs)
- {
- if (scene.RemainTime > 0)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneIsDelaying));
- return;
- }
- var timeSelect = new SelectTime();
- CommonPage.Instance.AddChidren(timeSelect);
- timeSelect.TempTime = scene.SceneDelayTime;
- timeSelect.Init();
- timeSelect.TimeAction = (t) =>
- {
- scene.SceneDelayTime = t;
- SetTimeByDelayTime(t);
- };
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneTargetFunctionRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneTargetFunctionRow.cs
deleted file mode 100755
index 6e36bc2..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneTargetFunctionRow.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class SceneTargetFunctionRow : FrameLayout
- {
- /// <summary>
- /// TipBtn
- /// </summary>
- public Button Icon;
- /// <summary>
- /// TitleBtn
- /// </summary>
- public Button StatuBtn;
- /// <summary>
- /// NameBtn
- /// </summary>
- private Button NameBtn;
- /// <summary>
- /// ZoneBtn
- /// </summary>
- private Button ZoneBtn;
- /// <summary>
- /// line
- /// </summary>
- private Button line;
- /// <summary>
- /// SceneTargetRow
- /// </summary>
- /// <param name="y"></param>
- public SceneTargetFunctionRow(int y)
- {
- X = Application.GetRealWidth(0);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(127 - 2);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- Icon = new Button
- {
- X = Application.GetRealWidth(104),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- Gravity = Gravity.CenterVertical
- };
- AddChidren(Icon);
-
- NameBtn = new Button
- {
- X = Application.GetRealWidth(219),
- Y = Application.GetRealHeight(14),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(58),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Delay,
- TextSize = 14
- };
- AddChidren(NameBtn);
-
- ZoneBtn = new Button
- {
- X = Application.GetRealWidth(219),
- Y = Application.GetRealHeight(72),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(49),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextSize = 12
- };
- AddChidren(ZoneBtn);
-
- StatuBtn = new Button
- {
- X = Application.GetRealWidth(650),
- Width = Application.GetRealWidth(350),
- Height = Application.GetRealHeight(100),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextSize = 14
- };
- AddChidren(StatuBtn);
-
- line = new Button()
- {
- X = Application.GetRealWidth(222),
- Y = Height - 1,
- Width = Application.GetRealWidth(800),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- AddChidren(line);
- }
-
- /// <summary>
- /// SetStatuText
- /// </summary>
- /// <param name="title"></param>
- public void SetStatuText(string title)
- {
- StatuBtn.Text = title;
- }
-
- /// <summary>
- /// SetIcon
- /// </summary>
- /// <param name="imagePath"></param>
- public void SetIcon(string imagePath)
- {
- Icon.UnSelectedImagePath = imagePath;
- }
-
- /// <summary>
- /// SetZoneText
- /// </summary>
- /// <param name="title"></param>
- public void SetZoneText(string title)
- {
- ZoneBtn.Text = title;
- }
-
- /// <summary>
- /// SetNameText
- /// </summary>
- /// <param name="title"></param>
- public void SetNameText(string title)
- {
- NameBtn.Text = title;
- }
-
- /// <summary>
- /// HideLine
- /// </summary>
- /// <param name="hiden"></param>
- public void HideLine(bool hiden)
- {
- line.Visible = !hiden;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneTargetTimeRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneTargetTimeRow.cs
deleted file mode 100755
index 3245c38..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SceneTargetTimeRow.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class SceneTargetTimeRow : FrameLayout
- {
- /// <summary>
- /// TipBtn
- /// </summary>
- public Button Icon;
- /// <summary>
- /// tipBtn
- /// </summary>
- public Button TipBtn;
- /// <summary>
- /// TitleBtn
- /// </summary>
- public Button TitleBtn;
- /// <summary>
- /// line
- /// </summary>
- private Button line;
- /// <summary>
- /// SceneTargetRow
- /// </summary>
- /// <param name="y"></param>
- public SceneTargetTimeRow(int y)
- {
- X = Application.GetRealWidth(0);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(127-2);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- Icon = new Button
- {
- X = Application.GetRealWidth(104),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Timer.png"
- };
- AddChidren(Icon);
-
- TipBtn = new Button
- {
- X = Application.GetRealWidth(219),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(100),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.Delay,
- TextSize = 14
- };
- AddChidren(TipBtn);
-
- TitleBtn = new Button
- {
- X = Application.GetRealWidth(510),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(100),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterRight,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextSize = 14
- };
- AddChidren(TitleBtn);
-
- line = new Button()
- {
- X = Application.GetRealWidth(222),
- Y = Height - 1,
- Width = Application.GetRealWidth(800),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- AddChidren(line);
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- TitleBtn.Text = title;
- }
-
- /// <summary>
- /// HideLine
- /// </summary>
- /// <param name="hiden"></param>
- public void HideLine(bool hiden)
- {
- line.Visible = !hiden;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectDeviceWithPickViewRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectDeviceWithPickViewRow.cs
deleted file mode 100755
index 8d5cf18..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectDeviceWithPickViewRow.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class SelectDeviceWithPickViewRow:FrameLayout
- {
- /// <summary>
- /// ClickButton
- /// </summary>
- public Button ClickButton;
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// SelectBtn
- /// </summary>
- public Button SelectBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// line
- /// </summary>
- private Button line;
- /// <summary>
- /// pickerView
- /// </summary>
- public UIPickerView pickerView;
- /// <summary>
- /// temperatureList
- /// </summary>
- public List<int> temperatureList;
- /// <summary>
- /// modeList
- /// </summary>
- public List<int> modeList;
- /// <summary>
- /// fanList
- /// </summary>
- public List<int> fanList;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
- /// <summary>
- /// SelectSceneRow
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public SelectDeviceWithPickViewRow(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(703);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(81),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(80),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=14
- };
- AddChidren(NameBtn);
- SelectBtn = new Button()
- {
- X = Application.GetRealWidth(919),
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(104),
- UnSelectedImagePath = "Scene/Selected.png",
- Visible = false
- };
- AddChidren(SelectBtn);
-
- var line1 = new Button()
- {
- X = Application.GetRealWidth(81),
- Y = Application.GetRealHeight(127),
- Width = Application.GetRealWidth(919),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor,
- };
- AddChidren(line1);
-
-
- ClickButton = new Button
- {
- Height = Application.GetRealHeight(127)
- };
- AddChidren(ClickButton);
-
- pickerView = new UIPickerView
- {
- Y = Application.GetRealHeight(138),
- Height = Application.GetRealHeight(564),
- };
- AddChidren(pickerView);
- /// <para>鎭掓俯鍣� Data1锛堟暟鍊硷級: 0鍔犵儹/1鍒跺喎/2鑷姩璋冭妭/3 璁剧疆宸ヤ綔妯″紡/4 璁剧疆鍔犵儹搴︽暟 5/璁剧疆鍒跺喎搴︽暟 6/璁剧疆椋庢墖妯″紡</para>
- /// <para> 鎭掓俯鍣―ata2鏁板�煎涓嬶細
- ///銆愬綋Data1=0|1|2鏃讹紝Data2涓鸿鍙樺寲鐨勫害鏁帮紝鍗曚綅锛�0.1鈩� 銆傘��
- ///銆愯嫢Data1=3锛孌ata2涓鸿璁惧畾鐨勭┖璋冩ā寮忥紙0-9锛夛紝0锛歰ff锛�1锛歛uto锛�3锛歝ool锛� 4锛歨eat 锛�5锛歟mergency heating, 6锛歱recooling锛�7锛歠an only 锛�8锛歞ry锛�9锛歴leep銆傘��
- ///銆愯嫢Data1=4|5锛孌ata2涓哄姞鐑垨鍒跺喎搴︽暟锛屽崟浣�0.01鎽勬皬搴︺�傘��
- ///銆愯嫢Data1=6锛孌ata2涓鸿璁惧畾鐨勯鎵囨ā寮忥紙0-6锛夛紝0锛歰ff锛�1锛歭ow锛�2锛歮edium锛�3锛歨igh锛�4锛歰n锛�5锛歛uto锛�6锛歴mart銆� </para>
- temperatureList = new List<int> { };
- var temperatureStrList = new List<string> { };
- modeList = new List<int> { 1,3,4,7,8 };
- var modeStrList = new List<string> {
- Language.StringByID(R.MyInternationalizationString.Mode_Auto),
- Language.StringByID(R.MyInternationalizationString.Mode_Cool),
- Language.StringByID(R.MyInternationalizationString.Mode_Heat),
- Language.StringByID(R.MyInternationalizationString.Mode_FanOnly),
- Language.StringByID(R.MyInternationalizationString.Mode_Dry)
- };
- fanList = new List<int> { 1, 2, 3 };
- var fanStrList = new List<string> {
- Language.StringByID(R.MyInternationalizationString.Fan_Low),
- Language.StringByID(R.MyInternationalizationString.Fan_Middle),
- Language.StringByID(R.MyInternationalizationString.Fan_Height)
- };
- for (int i = 16; i <= 32; i++)
- {
- temperatureList.Add(i);
- temperatureStrList.Add($"{i} 鈩�");
- }
-
- pickerView.setNPicker(temperatureStrList, modeStrList, fanStrList);
-
-
- line = new Button()
- {
- X = Application.GetRealWidth(81),
- Y = this.Height - 1,
- Width = Application.GetRealWidth(919),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor,
- };
- AddChidren(line);
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- SelectBtn.Visible = statu;
- }
- /// <summary>
- /// hideLine
- /// </summary>
- /// <param name="statu"></param>
- public void hideLine(bool statu)
- {
- line.Visible = !statu;
- }
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs
deleted file mode 100755
index c6c8597..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class SelectDeviceWithSeekBarRow : FrameLayout
- {
- /// <summary>
- /// ClickButton
- /// </summary>
- public Button ClickButton;
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// SelectBtn
- /// </summary>
- public Button SelectBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// line
- /// </summary>
- private Button line;
- /// <summary>
- /// SeekBar
- /// </summary>
- public DiyImageSeekBar SeekBar;
- /// <summary>
- /// SeekBarTitle
- /// </summary>
- public Button SeekBarTitle;
- /// <summary>
- /// MaxLevel
- /// </summary>
- public int MaxLevel;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
- /// <summary>
- /// SelectSceneRow
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public SelectDeviceWithSeekBarRow(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(348);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init(int max=100)
- {
- MaxLevel = max;
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(81),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(80),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=14
- };
- AddChidren(NameBtn);
-
- SelectBtn = new Button()
- {
- X = Application.GetRealWidth(919),
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(104),
- UnSelectedImagePath = "Scene/Selected.png",
- Visible = false
- };
- AddChidren(SelectBtn);
-
- ClickButton = new Button
- {
- Height = Application.GetRealHeight(127)
- };
- AddChidren(ClickButton);
-
- SeekBar = new DiyImageSeekBar()
- {
- X = Application.GetRealWidth(81),
- Y = Application.GetRealHeight(200),
- Width = Application.GetRealWidth(919),
- Height = Application.GetRealHeight(127),
- ProgressBarColor = ZigbeeColor.Current.GXCProgressColor,
- MaxValue = MaxLevel,
- Progress = MaxLevel,
- IsProgressTextShow = false,
- IsClickable = true,
- ThumbImageHeight=Application.GetMinRealAverage(80),
- SeekBarViewHeight=Application.GetRealHeight(6),
- ThumbImagePath="Item/SeekBarIcon.png"
- };
- AddChidren(SeekBar);
-
- SeekBarTitle = new Button()
- {
- Y = Application.GetRealHeight(127),
- Height = Application.GetRealHeight(50),
- Width = Application.GetRealWidth(200),
- Gravity = Gravity.CenterHorizontal,
- Text = $"{(int)(SeekBar.Progress * 1.0 / MaxLevel * 100)} %",
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- TextSize = 12,
- IsBold = true
- };
- AddChidren(SeekBarTitle);
-
- line = new Button()
- {
- X = Application.GetRealWidth(81),
- Y = this.Height - 1,
- Width = Application.GetRealWidth(919),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- AddChidren(line);
-
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- SelectBtn.Visible = statu;
- if(statu)
- {
- SetSeekBarProgress(SeekBar.Progress == 0 ? MaxLevel : SeekBar.Progress);
- }
- else
- {
- SetSeekBarProgress(0);
- }
- }
-
- /// <summary>
- /// hideLine
- /// </summary>
- /// <param name="statu"></param>
- public void hideLine(bool statu)
- {
- line.Visible = !statu;
- }
-
- /// <summary>
- /// SetSeekBarTitle
- /// </summary>
- public void SetSeekBarTitle()
- {
- SeekBarTitle.Text = $"{(int)(SeekBar.Progress * 1.0 / MaxLevel * 100)} %";
- }
-
- /// <summary>
- /// SetProgress
- /// </summary>
- /// <param name="progress"></param>
- public void SetSeekBarProgress(int progress)
- {
- SeekBar.Progress = progress;
- SetSeekBarTitle();
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectFunctionView.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectFunctionView.cs
deleted file mode 100755
index 786f546..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectFunctionView.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class SelectFunctionView : FrameLayout
- {
- /// <summary>
- /// name
- /// </summary>
- private Button NameBtn;
- /// <summary>
- /// Image
- /// </summary>
- private Button ImageBtn;
- /// <summary>
- /// ImageBG
- /// </summary>
- private Button ImageBG;
- /// <summary>
- /// SwitchBtn
- /// </summary>
- private Button SelectBtn;
- /// <summary>
- /// ClickBtn
- /// </summary>
- public Button ClickBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
- /// <summary>
- /// SelectFunctionView
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public SelectFunctionView(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1022);
- Height = Application.GetRealHeight(127);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- /// <param name="imagePath"></param>
- /// <param name="selectedImagePath"></param>
- public void Init(string imagePath, string selectedImagePath)
- {
- ImageBG = new Button()
- {
- X = Application.GetRealWidth(45),
- Width = Application.GetMinRealAverage(112),
- Height = Application.GetMinRealAverage(112),
- Gravity = Gravity.CenterVertical,
- Radius = (uint)Application.GetMinRealAverage(112 / 2),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- SelectedBackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor,
- Tag = Tag
- };
- AddChidren(ImageBG);
-
- ImageBtn = new Button()
- {
- X = Application.GetRealWidth(63),
- Width = Application.GetMinRealAverage(78),
- Height = Application.GetMinRealAverage(78),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = imagePath,
- SelectedImagePath = selectedImagePath,
- Tag = Tag
- };
- AddChidren(ImageBtn);
-
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(181),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
- TextAlignment = TextAlignment.CenterLeft,
- Tag = Tag
- };
- AddChidren(NameBtn);
-
- SelectBtn = new Button()
- {
- X = Application.GetRealWidth(896),
- Width = Application.GetMinRealAverage(70),
- Height = Application.GetMinRealAverage(70),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Room/ItemUnSelected_Black.png",
- SelectedImagePath = "Room/ItemSelected.png",
- Tag = Tag
- };
- AddChidren(SelectBtn);
-
- var line = new Button()
- {
- X = Application.GetRealWidth(180),
- Y = this.Height - 1,
- Width = Application.GetRealWidth(841),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor,
- Tag = Tag
- };
- AddChidren(line);
-
- ClickBtn = new Button { };
- AddChidren(ClickBtn);
- }
-
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- private void SetStatu(bool statu)
- {
- NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = SelectBtn.IsSelected = statu;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectSceneRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectSceneRow.cs
deleted file mode 100755
index 320d16e..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectSceneRow.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class SelectSceneRow:FrameLayout
- {
- /// <summary>
- /// ClickButton
- /// </summary>
- public Button ClickButton;
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// Image
- /// </summary>
- public Button ImageBtn;
- /// <summary>
- /// SelectBtn
- /// </summary>
- public Button SelectBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// line
- /// </summary>
- private Button line;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
- /// <summary>
- /// SelectSceneRow
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public SelectSceneRow(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1022);
- Height = Application.GetRealHeight(127);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
-
- ImageBtn = new Button()
- {
- X = Application.GetRealWidth(58),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Scene/SceneIcon.png"
- };
- AddChidren(ImageBtn);
-
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(173),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=15
- };
- AddChidren(NameBtn);
-
- SelectBtn = new Button()
- {
- X = Application.GetRealWidth(919),
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(104),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Scene/Selected.png",
- Visible=false
- };
- AddChidren(SelectBtn);
-
- line = new Button()
- {
- X = Application.GetRealWidth(180),
- Y = this.Height - 1,
- Width = Application.GetRealWidth(841),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- AddChidren(line);
-
- ClickButton = new Button
- {
-
- };
- AddChidren(ClickButton);
-
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- SelectBtn.Visible = statu;
- }
- /// <summary>
- /// HideIcon
- /// </summary>
- /// <param name="statu"></param>
- public void HideIcon(bool statu)
- {
- ImageBtn.Visible = !statu;
- }
- /// <summary>
- /// hideLine
- /// </summary>
- /// <param name="statu"></param>
- public void hideLine(bool statu)
- {
- line.Visible = !statu;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectSceneStatuRow.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectSceneStatuRow.cs
deleted file mode 100755
index 6f92f8b..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectSceneStatuRow.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-
-namespace Shared.Phone.Device.CommonForm
-{
- public class SelectSceneStatuRow:FrameLayout
- {
- /// <summary>
- /// ClickButton
- /// </summary>
- public Button ClickButton;
- /// <summary>
- /// name
- /// </summary>
- public Button NameBtn;
- /// <summary>
- /// SelectBtn
- /// </summary>
- public Button SelectBtn;
- /// <summary>
- /// v_Selected
- /// </summary>
- private bool v_Selected;
- /// <summary>
- /// line
- /// </summary>
- private Button line;
- /// <summary>
- /// IsSelected
- /// </summary>
- public bool IsSelected
- {
- set
- {
- v_Selected = value;
- try
- {
- SetStatu(v_Selected);
- }
- catch
- {
-
- }
- }
- get
- {
- return v_Selected;
- }
- }
- /// <summary>
- /// SelectSceneRow
- /// </summary>
- /// <param name="x"></param>
- /// <param name="y"></param>
- public SelectSceneStatuRow(int x = 0, int y = 0)
- {
- X = Application.GetRealWidth(x);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(127);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
-
- NameBtn = new Button()
- {
- X = Application.GetRealWidth(81),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(80),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize=14
- };
- AddChidren(NameBtn);
-
- SelectBtn = new Button()
- {
- X = Application.GetRealWidth(919),
- Width = Application.GetMinRealAverage(104),
- Height = Application.GetMinRealAverage(104),
- UnSelectedImagePath = "Scene/Selected.png",
- Visible = false
- };
- AddChidren(SelectBtn);
-
- ClickButton = new Button
- {
-
- };
- AddChidren(ClickButton);
-
-
- line = new Button()
- {
- X = Application.GetRealWidth(81),
- Y = this.Height - 1,
- Width = Application.GetRealWidth(919),
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- AddChidren(line);
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(string title)
- {
- NameBtn.Text = title;
- }
- /// <summary>
- /// SetTitle
- /// </summary>
- /// <param name="title"></param>
- public void SetTitle(int title)
- {
- SetTitle(Language.StringByID(title));
- }
- /// <summary>
- /// SetStatu
- /// </summary>
- /// <param name="statu"></param>
- public void SetStatu(bool statu)
- {
- SelectBtn.Visible = statu;
- }
-
- /// <summary>
- /// hideLine
- /// </summary>
- /// <param name="statu"></param>
- public void hideLine(bool statu)
- {
- line.Visible = !statu;
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectedStatuButton.cs b/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectedStatuButton.cs
deleted file mode 100755
index a7d91f8..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/CommonForm/SelectedStatuButton.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- /// <summary>
- /// 绫讳技鎸変笅鎷ユ湁鐭殏鐐逛寒鏁堟灉鐨刡utton
- /// </summary>
- public class SelectedStatuButton:Button
- {
- /// <summary>
- /// 閫変腑鐘舵�佸仠鐣欐椂闂� 鍗曚綅 姣
- /// 榛樿200姣
- /// </summary>
- private static readonly int SelectedStatuTime = 200;
- /// <summary>
- /// Initializes a new instance of the <see cref="T:Shared.SelectedStatuButton"/> class.
- /// </summary>
- public SelectedStatuButton(uint textColor = 0xFF666666, uint selectedTextColor = 0xFF000000)
- {
- MouseDownEventHandler += Button_MouseDownEvent;
- TextColor = textColor;
- SelectedTextColor = selectedTextColor;
- }
-
-
- /// <summary>
- /// 鍗曞嚮鎸変笅锛屽疄鐜扮煭鏆傜偣浜�変腑鏁堟灉
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void Button_MouseDownEvent(object sender, MouseEventArgs mouseEventArgs)
- {
- bool statu = IsSelected;
- SetSeletedStatu();
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(SelectedStatuTime);
- SetUnSelectedStatu();
- Application.RunOnMainThread(() =>
- {
- IsSelected = statu;
- });
- })
- { IsBackground = true }.Start();
-
- }
- /// <summary>
- /// 璁剧疆閫変腑鐘舵��
- /// </summary>
- public void SetSeletedStatu()
- {
- Application.RunOnMainThread(() =>
- {
- if (string.IsNullOrEmpty(UnSelectedImagePath) == false && string.IsNullOrEmpty(SelectedImagePath) == true)
- {
- IsSelected = false;
- }
- else
- {
- IsSelected = true;
- }
- });
- }
- /// <summary>
- /// 璁剧疆涓嶉�変腑鐘舵��
- /// </summary>
- public void SetUnSelectedStatu()
- {
- Application.RunOnMainThread(() =>
- {
- IsSelected = false;
- });
- }
- }
-
-
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Curtain/RollerShadeControl.cs b/ZigbeeApp20200414/Shared/Phone/Device/Curtain/RollerShadeControl.cs
deleted file mode 100755
index bc33a45..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Curtain/RollerShadeControl.cs
+++ /dev/null
@@ -1,863 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Curtain
-{
- public class RollerShadeControl:FrameLayout,ZigBee.Common.IStatus
- {
- #region 鈼� 鍙橀噺__________________________
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice, Common.Room> action;
-
- /// <summary>
- /// 鏀惰棌鎸夐挳
- /// </summary>
- private Button collectionBtn;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private CommonDevice device;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
-
- /// <summary>
- /// 鎴块棿
- /// </summary>
- private Button roomBtn;
- /// <summary>
- /// 鎴块棿鍚�
- /// </summary>
- private Button roomName;
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
-
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// StatuBtn
- /// </summary>
- private Button StatuBtn;
-
- /// <summary>
- /// OpenOrUpBtn
- /// </summary>
- public Button OpenOrUpBtn;
- /// <summary>
- /// OpenOrUpBtn
- /// </summary>
- public Button CloseOrDownBtn;
- /// <summary>
- /// StopBtn
- /// </summary>
- public Button StopBtn;
- /// <summary>
- /// 寮�鍚堝笜
- /// </summary>
- private CurtainSeekBar curtainSeekBar = new CurtainSeekBar { };
- /// <summary>
- /// 鍗峰笜
- /// </summary>
- private CurtainRollSeekBar curtainRollSeekBar = new CurtainRollSeekBar { };
-
- /// <summary>
- /// IsDrawerLockMode
- /// </summary>
- public bool IsDrawerLockMode;
-
- /// <summary>
- /// ProgressBtn
- /// </summary>
- Button ProgressBtn;
- /// <summary>
- /// ProgressBtnY
- /// </summary>
- int ProgressBtnY;
- /// <summary>
- /// ProgressBtnX
- /// </summary>
- int ProgressBtnX;
-
- #endregion
-
- #region 鈼� 鎺ュ彛___________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = this.device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- if (common.DeviceStatusReport.CluterID == 258)
- {
- if (common.DeviceStatusReport.AttriBute[0].AttributeId == 8)
- {
- //绐楀笜鐧惧垎姣�
- var rollerShade = deviceUI as Rollershade;
- rollerShade.DeviceStatusReport = common.DeviceStatusReport;
- rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData;
- StatuBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} { UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI)}";
- if(rollerShade.WcdType==0)
- {
- curtainRollSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
- }
- else if(rollerShade.WcdType==4)
- {
- curtainSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
- }
- rollerShade.LastDateTime = DateTime.Now;
- }
- else if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
- {
- ////绐楀笜绫诲瀷
- var rollerShade = device as Rollershade;
- rollerShade.DeviceStatusReport = common.DeviceStatusReport;
- rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData;
- rollerShade.LastDateTime = DateTime.Now;
- }
- }
- //***鏂版敼***璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID=3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- else if (common.DeviceStatusReport.CluterID == 3)
- {
- //var rollerShade = deviceUI.CommonDevice as Rollershade;
- //rollerShade.IsOnline = 1;
- //rollerShadeIMG.IsSelected = rollerShade.IsOnline == 1;
- //rollerShade.LastDateTime = DateTime.Now;
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- //var deviceUI = SeekBar.Tag as DeviceUI;
- ////璁惧涓虹┖
- //if (deviceUI.CommonDevice == null)
- //{
- // return;
- //}
- ////鏄惁涓哄綋鍓嶈澶�
- //if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
- //{
- // return;
- //}
- //var rollerShade = deviceUI.CommonDevice as Rollershade;
- //rollerShade.IsOnline = (common as Rollershade).IsOnline;
- //rollerShadeIMG.IsSelected = rollerShade.IsOnline == 1;
- //rollerShade.LastDateTime = DateTime.Now;
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- }
-
- #endregion
-
- #region 鈼� 鏋勯�犳柟娉昣_______________________
-
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public RollerShadeControl()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- ZigBee.Device.ZbGateway.StatusList.Add(this);
- }
-
- #endregion
-
- #region 鈼� 閲嶅啓绉婚櫎鏂规硶____________________
-
- /// <summary>
- /// Removes from parent.
- /// </summary>
- public override void RemoveFromParent()
- {
- UserView.HomePage.Instance.ScrollEnabled = true;
- ZigBee.Device.ZbGateway.StatusList.Remove(this);
- action(device,room);
- action = null;
- RemoveUpdateControlDeviceStatuAction();
- if (IsDrawerLockMode)
- {
- CommonPage.Instance.IsDrawerLockMode = false;
- }
- base.RemoveFromParent();
- }
-
- #endregion
-
- #region 鈼� 鏄剧ず鐣岄潰________________________
-
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="dev">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(CommonDevice dev, Shared.Common.Room room)
- {
- device = dev;
- zbGateway = this.device.Gateway;
- this.room = room;
-
- AddTop();
-
- AddBodyView(device);
-
-
- var rollerShade = device as ZigBee.Device.Rollershade;
- //涓嶄笂闈炶繙绋�
- if (rollerShade.Gateway == null)
- {
- return;
- }
- if (rollerShade.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(rollerShade, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇
- if ((DateTime.Now - rollerShade.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device);
- }
- }
-
- if (UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- collectionBtn.IsSelected = false;
- }
- else
- {
- collectionBtn.IsSelected = true;
- }
-
-
- BindEvent();
-
- }
-
- #endregion
-
- #region 鈼� Add______________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
-
- var moreBtn = new Button
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png"
- };
- top.topView.AddChidren(moreBtn);
-
- moreBtn.MouseUpEventHandler += More;
-
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var itemView = new FrameLayout()
- {
- Y = Application.GetRealHeight(115),
- Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1316),
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(itemView);
-
- collectionBtn = new Button()
- {
- X = Application.GetRealWidth(850),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- itemView.AddChidren(collectionBtn);
-
- var deviceNameBtn = new Button()
- {
- Y = Application.GetRealHeight(46),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15,
- IsBold=true
- };
- itemView.AddChidren(deviceNameBtn);
-
- StatuBtn = new Button
- {
- Y = Application.GetRealHeight(118),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device)}",
- TextSize = 10
- };
- itemView.AddChidren(StatuBtn);
-
-
- OpenOrUpBtn = new Button
- {
- X = Application.GetRealWidth(253),
- Y = Application.GetRealHeight(994),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81)
- };
- itemView.AddChidren(OpenOrUpBtn);
- OpenOrUpBtn.MouseUpEventHandler += (sender, e) =>
- {
- (device as Rollershade).CurtainUpDownStopControl(0);
- };
-
- StopBtn = new Button
- {
- X = Application.GetRealWidth(441),
- Y=Application.GetRealHeight(994),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- SelectedImagePath = "RollerShade/StopSelected.png",
- UnSelectedImagePath = "RollerShade/Stop.png",
- };
- itemView.AddChidren(StopBtn);
- StopBtn.MouseUpEventHandler += (sender, e) =>
- {
- (device as Rollershade).CurtainUpDownStopControl(2);
- };
-
- CloseOrDownBtn = new Button
- {
- X = Application.GetRealWidth(631),
- Y = Application.GetRealHeight(994),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81)
- };
- itemView.AddChidren(CloseOrDownBtn);
- CloseOrDownBtn.MouseUpEventHandler += (sender, e) =>
- {
- (device as Rollershade).CurtainUpDownStopControl(1);
- };
-
- if ((device as Rollershade).WcdType == -1)
- {
- CommonPage.Loading.Start();
- new System.Threading.Thread(() =>
- {
- Rollershade.ReadWcdTypeAction(device, () =>
- {
- Application.RunOnMainThread(() =>
- {
- SetRollerShadeIcon((device as Rollershade).WcdType);
- CommonPage.Loading.Hide();
- });
- });
- })
- { IsBackground = true }.Start();
- }
-
- SetCurtainType(itemView, (device as Rollershade).WcdType);
-
- var roomBG = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(138 + 50),
- BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
- };
- itemView.AddChidren(roomBG);
-
- var roomBG2 = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- itemView.AddChidren(roomBG2);
-
- roomBtn = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(1207),
- Width = Application.GetMinReal(80),
- Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png"
- };
- itemView.AddChidren(roomBtn);
-
- roomName = new Button()
- {
- X = Application.GetRealWidth(150),
- Y = Application.GetRealHeight(1224),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(50),
- Text = room.Name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize = 12
- };
- itemView.AddChidren(roomName);
- }
-
- #endregion
-
- #region 鈼� 缁戝畾浜嬩欢________________________
-
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- //upBtn.MouseUpEventHandler += Up;
- //stopBtn.MouseUpEventHandler += Stop;
- //downBtn.MouseUpEventHandler += Down;
- collectionBtn.MouseUpEventHandler += Collection;
- }
-
- #endregion
-
- #region 鈼� 鎺у埗__________________________
-
- /// <summary>
- /// 涓娿�佸紑
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Up(object sender, MouseEventArgs eventArgs)
- {
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(0);
- //鎺у埗寤舵椂鍥炶皟
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
- /// <summary>
- /// 涓嬨�佸叧
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Down(object sender, MouseEventArgs eventArgs)
- {
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(1);
- //鎺у埗寤舵椂鍥炶皟
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
- /// <summary>
- /// 鍋�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Stop(object sender, MouseEventArgs eventArgs)
- {
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(2);
- //鎺у埗寤舵椂鍥炶皟
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
- #endregion
-
- #region 鈼� 鎺у埗鍙嶉_________________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (tempDevice.DeviceEpoint != this.device.DeviceEpoint || tempDevice.DeviceAddr != this.device.DeviceAddr)
- {
- //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //鎴愬姛涓嶆彁绀�
- //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveUpdateControlDeviceStatuAction()
- {
- //绉婚櫎action
- if (zbGateway != null)
- {
- zbGateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- #endregion
-
- #region 鈼� 鏇村璁剧疆________________________
-
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void More(object sender, MouseEventArgs e)
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.EditAction += (curDev,curRoom) =>
- {
- Show(curDev, curRoom);
- };
- }
-
- /// <summary>
- /// SetCurtainType
- /// </summary>
- /// <param name="layout"></param>
- /// <param name="type"></param>
- private void SetCurtainType(FrameLayout layout, int type)
- {
- SetRollerShadeIcon(type);
- SetRollerSeekBar(layout, type);
- }
-
- /// <summary>
- /// WcdType=4锛氬紑鍚堝笜
- /// WcdType=0锛氬嵎甯�
- /// </summary>
- /// <param name="type"></param>
- private void SetRollerShadeIcon(int type)
- {
- if (type == 0)
- {
- OpenOrUpBtn.UnSelectedImagePath = "RollerShade/Up.png";
- OpenOrUpBtn.SelectedImagePath = "RollerShade/UpSelected.png";
-
- CloseOrDownBtn.UnSelectedImagePath = "RollerShade/Down.png";
- CloseOrDownBtn.SelectedImagePath = "RollerShade/DownSelected.png";
- }
- else
- {
- OpenOrUpBtn.UnSelectedImagePath = "RollerShade/Open.png";
- OpenOrUpBtn.SelectedImagePath = "RollerShade/OpenSelected.png";
-
- CloseOrDownBtn.UnSelectedImagePath = "RollerShade/Close.png";
- CloseOrDownBtn.SelectedImagePath = "RollerShade/CloseSelected.png";
- }
- }
-
- /// <summary>
- /// SetRollerSeekBar
- /// </summary>
- /// <param name="layout"></param>
- /// <param name="type"></param>
- private void SetRollerSeekBar(FrameLayout layout,int type)
- {
- if(type == 0)
- {
- curtainRollSeekBar.Y = Application.GetRealHeight(300);
- curtainRollSeekBar.Width = Application.GetRealWidth(438);
- curtainRollSeekBar.Height = Application.GetRealHeight(576);
- curtainRollSeekBar.Gravity = Gravity.CenterHorizontal;
- curtainRollSeekBar.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage;
- layout.AddChidren(curtainRollSeekBar);
- curtainRollSeekBar.IsProgressTextShow = false;
- curtainRollSeekBar.CurtainPaddingTop = Application.GetRealHeight(110);
- curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
- {
- (device as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
- };
-
- curtainRollSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
- {
- OnProgressButtonMove(curtainRollSeekBar.Progress);
- ProgressBtn.Visible = true;
- };
-
- curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
- {
- ProgressBtn.Visible = false;
- };
-
- curtainRollSeekBar.OnProgressChangedEvent += (send2, e2) =>
- {
-
- OnProgressButtonMove(e2);
-
- //鍒ゆ柇鏄惁300ms灞忚斀
- //if (curtainRollSeekBar.IsProgressChangeDelay()) return;
-
- //(device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
- };
-
- InitProgressBtn(layout);
- }
- else
- {
- curtainSeekBar.Y = Application.GetRealHeight(334);
- curtainSeekBar.Width = Application.GetRealWidth(570);
- curtainSeekBar.Height = Application.GetRealHeight(513);
- curtainSeekBar.Gravity = Gravity.CenterHorizontal;
- curtainSeekBar.IsProgressTextShow = false;
- curtainSeekBar.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage;
- layout.AddChidren(curtainSeekBar);
-
- curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
- {
- (device as Rollershade).WcdGoToTiltValue(curtainSeekBar.Progress);
- };
-
- curtainSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
- {
- OnProgressButtonMoveForCurtain(curtainSeekBar.Progress);
- ProgressBtn.Visible = true;
- };
-
- curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
- {
- ProgressBtn.Visible = false;
- };
-
- curtainSeekBar.OnProgressChangedEvent += (send2, e2) =>
- {
-
- OnProgressButtonMoveForCurtain(e2);
-
- //鍒ゆ柇鏄惁300ms灞忚斀
- //if (curtainRollSeekBar.IsProgressChangeDelay()) return;
-
- //(device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
- };
- InitProgressBtnForCurtain(layout);
- }
- }
-
- /// <summary>
- /// 娣诲姞杩涘害鎸夐挳
- /// </summary>
- private void InitProgressBtn(FrameLayout layout)
- {
- ProgressBtnY = curtainRollSeekBar.Y - Application.GetMinReal(204);
- ProgressBtn = new Button()
- {
- Y = ProgressBtnY,
- Width = Application.GetMinReal(135),
- Height = Application.GetMinReal(104),
- UnSelectedImagePath = "Item/ProgressBubbles.png",
- Visible = false,
- Gravity = Gravity.CenterHorizontal,
- TextSize=14,
- IsBold=true,
- TextColor=ZigbeeColor.Current.GXCTextWhiteColor
- };
- layout.AddChidren(ProgressBtn);
- }
-
- /// <summary>
- /// OnProgressButtonMove
- /// </summary>
- private void OnProgressButtonMove(int mProgress)
- {
- ProgressBtn.Y = ProgressBtnY + curtainRollSeekBar.NowProgressY;
- ProgressBtn.Text = mProgress + "%";
- }
-
-
- /// <summary>
- /// 娣诲姞杩涘害鎸夐挳
- /// </summary>
- private void InitProgressBtnForCurtain(FrameLayout layout)
- {
- ProgressBtnX = curtainSeekBar.X - Application.GetMinReal(20);
- ProgressBtn = new Button()
- {
- X = ProgressBtnX,
- Y = curtainSeekBar.Y + curtainSeekBar.Height / 2 - Application.GetMinReal(180),
- Width = Application.GetMinReal(135),
- Height = Application.GetMinReal(104),
- UnSelectedImagePath = "Item/ProgressBubbles.png",
- Visible = false,
- TextSize = 14,
- IsBold = true,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor
- };
- layout.AddChidren(ProgressBtn);
- }
-
- /// <summary>
- /// OnProgressButtonMove
- /// </summary>
- private void OnProgressButtonMoveForCurtain(int mProgress)
- {
- ProgressBtn.X = ProgressBtnX + curtainSeekBar.NowProgressX- Application.GetMinReal(5);
- ProgressBtn.Text = mProgress + "%";
- }
-
- #endregion
-
- #region 鈼� 鏀惰棌鍒颁富椤礯______________________
-
- /// <summary>
- /// 鏀惰棌鍒颁富椤�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void Collection(object sender, MouseEventArgs e)
- {
- if (collectionBtn.IsSelected)
- {
- UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
- collectionBtn.IsSelected = false;
- }
- else
- {
- UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
- collectionBtn.IsSelected = true;
- }
- }
-
- #endregion
-
- #region 鈼� 鍥炲埌涓婚〉________________________
-
- /// <summary>
- /// 鍥炲埌涓婚〉
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void BackToRoomHandler(object sender, MouseEventArgs mouseEventArgs)
- {
- //backToRoom
-
- }
-
- #endregion
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs b/ZigbeeApp20200414/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
old mode 100644
new mode 100755
index a18d5f2..0515eab
--- a/ZigbeeApp20200414/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
@@ -17,7 +17,7 @@
{
get
{
- if (_instance == null)
+ if(_instance == null)
{
_instance = new ReadDeviceAttributeLogic();
}
@@ -47,7 +47,6 @@
})
{ IsBackground = true }.Start();
}
-
/// <summary>
/// SendThermostatStatuComand
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Light/AirSwitchControl.cs b/ZigbeeApp20200414/Shared/Phone/Device/Light/AirSwitchControl.cs
deleted file mode 100755
index a2d4684..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Light/AirSwitchControl.cs
+++ /dev/null
@@ -1,736 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Light
-{
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- public class AirSwitchControl : FrameLayout, ZigBee.Common.IStatus
- {
- #region 鈼� 鍙橀噺__________________________
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- private Button switchBtn;
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice, Common.Room> action;
-
- /// <summary>
- /// The light image.
- /// </summary>
- private Button deviceIMG;
- /// <summary>
- /// 鏀惰棌鎸夐挳
- /// </summary>
- private Button collectionBtn;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private CommonDevice device;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
-
- /// <summary>
- /// 鎴块棿
- /// </summary>
- private Button roomBtn;
- /// <summary>
- /// 鎴块棿鍚�
- /// </summary>
- private Button roomName;
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
-
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
-
- private Button StatuBtn;
- /// <summary>
- /// OnBtn
- /// </summary>
- private Button OnBtn;
- /// <summary>
- /// OffBtn
- /// </summary>
- private Button OffBtn;
-
- /// <summary>
- /// IsDrawerLockMode
- /// </summary>
- public bool IsDrawerLockMode;
- #endregion
-
- #region 鈼� 鎺ュ彛__________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- if (deviceUI.Type == DeviceType.AirSwitch)
- {
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var light = deviceUI as AirSwitch;
- light.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (light.DeviceStatusReport.AttriBute == null || light.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device);
-
- if (device.DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- SetONOFFStatu(light.OnOffStatus == 1);
- }
- else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
- }
- else
- {
- deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
- }
-
-
- light.LastDateTime = DateTime.Now;
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- deviceUI.IsOnline = common.IsOnline;
- //OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- }
- #endregion
-
- #region 鈼� 鍒濆鍖朹____________________
- /// <summary>
- /// 閲嶅啓绉婚櫎鏂规硶
- /// </summary>
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- action(device, room);
- action = null;
- RemoveUpdateControlDeviceStatuAction();
- if (IsDrawerLockMode)
- {
- CommonPage.Instance.IsDrawerLockMode = false;
- }
- base.RemoveFromParent();
- }
-
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public AirSwitchControl()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- ZbGateway.StatusList.Add(this);
- }
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="dev">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(CommonDevice dev, Shared.Common.Room room)
- {
- device = dev;
- zbGateway = this.device.Gateway;
- this.room = room;
-
- AddTop();
-
- AddBodyView(device);
-
-
- var light = dev as AirSwitch;
- //琛ヤ笂闈炶繙绋�
- if (light.Gateway == null)
- {
- return;
- }
- if (light.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- }
- }
-
- if (UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- collectionBtn.IsSelected = false;
- }
- else
- {
- collectionBtn.IsSelected = true;
- }
-
-
- BindEvent();
-
- }
-
- #endregion
-
- #region 鈼� Add______________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var moreBtn = new Button
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png"
- };
- top.topView.AddChidren(moreBtn);
-
- moreBtn.MouseUpEventHandler += More;
-
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var itemView = new FrameLayout()
- {
- Y = Application.GetRealHeight(115),
- Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1316),
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(itemView);
-
- collectionBtn = new Button()
- {
- X = Application.GetRealWidth(850),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- itemView.AddChidren(collectionBtn);
-
- var deviceNameBtn = new Button()
- {
- Y = Application.GetRealHeight(46),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15,
- IsBold = true
- };
- itemView.AddChidren(deviceNameBtn);
-
- StatuBtn = new Button
- {
- Y = Application.GetRealHeight(118),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device),
- TextSize = 10
- };
- itemView.AddChidren(StatuBtn);
-
- var roomBG = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(138 + 50),
- BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
- };
- itemView.AddChidren(roomBG);
-
- var roomBG2 = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- itemView.AddChidren(roomBG2);
-
- roomBtn = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(1207),
- Width = Application.GetMinReal(80),
- Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png"
- };
- itemView.AddChidren(roomBtn);
-
- roomName = new Button()
- {
- X = Application.GetRealWidth(150),
- Y = Application.GetRealHeight(1224),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(50),
- Text = room.Name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize = 12
- };
- itemView.AddChidren(roomName);
-
- AddByFunctionType(itemView);
- }
-
- /// <summary>
- /// AddByFunctionType
- /// </summary>
- private void AddByFunctionType(FrameLayout itemView)
- {
- if (device.DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- AddOnOff(itemView);
- }
- else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- AddPlug(itemView);
- }
- else
- {
- AddLight(itemView);
- }
- }
-
- /// <summary>
- /// AddOnOff
- /// </summary>
- private void AddOnOff(FrameLayout itemView)
- {
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(340),
- Width = Application.GetMinRealAverage(579),
- Height = Application.GetMinRealAverage(579),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/OnOff.png",
- };
- itemView.AddChidren(deviceIMG);
-
- OffBtn = new Button
- {
- X = Application.GetRealWidth(294),
- Y = Application.GetRealHeight(588),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- UnSelectedImagePath = "Light/OFF.png",
- SelectedImagePath = "Light/OFFSelected.png",
- IsSelected = (device as AirSwitch).OnOffStatus == 0
- };
- itemView.AddChidren(OffBtn);
-
- OnBtn = new Button
- {
- X = Application.GetRealWidth(590),
- Y = Application.GetRealHeight(588),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- UnSelectedImagePath = "Light/ON.png",
- SelectedImagePath = "Light/ONSelected.png",
- IsSelected = (device as AirSwitch).OnOffStatus == 1
- };
- itemView.AddChidren(OnBtn);
-
- OnBtn.MouseUpEventHandler += ON;
- OffBtn.MouseUpEventHandler += OFF;
- }
-
- /// <summary>
- /// light
- /// </summary>
- /// <param name="itemView"></param>
- private void AddLight(FrameLayout itemView)
- {
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(389),
- Width = Application.GetMinRealAverage(377),
- Height = Application.GetMinRealAverage(435),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/DeskLamp.png",
- SelectedImagePath = "Light/DeskLampSelected.png",
- IsSelected = (device as AirSwitch).OnOffStatus == 1
- };
- itemView.AddChidren(deviceIMG);
-
- switchBtn = new Button()
- {
- Y = Application.GetRealHeight(996),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- IsSelected = (device as AirSwitch).OnOffStatus == 1
- };
- itemView.AddChidren(switchBtn);
-
- switchBtn.MouseUpEventHandler += Switch;
- deviceIMG.MouseUpEventHandler += Switch;
- }
-
- /// <summary>
- /// plug
- /// </summary>
- /// <param name="itemView"></param>
- private void AddPlug(FrameLayout itemView)
- {
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(344),
- Width = Application.GetMinRealAverage(567),
- Height = Application.GetMinRealAverage(567),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/Plug.png",
- SelectedImagePath = "Light/PlugSelected.png",
- IsSelected = (device as AirSwitch).OnOffStatus == 1
- };
- itemView.AddChidren(deviceIMG);
-
- switchBtn = new Button()
- {
- Y = Application.GetRealHeight(996),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- IsSelected = (device as AirSwitch).OnOffStatus == 1
- };
- itemView.AddChidren(switchBtn);
-
- switchBtn.MouseUpEventHandler += Switch;
- deviceIMG.MouseUpEventHandler += Switch;
- }
-
- #endregion
-
- #region 鈼� 缁戝畾鎸夐挳_______________________
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- collectionBtn.MouseUpEventHandler += Collection;
- }
-
- #endregion
-
- #region 鈼� 寮�鍏砡_________________________
-
- /// <summary>
- /// 寮�鍏宠缃�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Switch(object sender, MouseEventArgs eventArgs)
- {
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- switchBtn.IsSelected = !switchBtn.IsSelected;
- deviceIMG.IsSelected = !deviceIMG.IsSelected;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " ";
- if (deviceIMG.IsSelected == true)
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.uOpen1);
- }
- else
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.Close);
- }
-
- if (switchBtn.IsSelected == true)
- {
- (device as AirSwitch).SwitchControl(1);
- }
- else
- {
- (device as AirSwitch).SwitchControl(0);
- }
- //鎺у埗寤舵椂鍥炶皟
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
- /// <summary>
- /// ON
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="eventArgs"></param>
- private void ON(object sender, MouseEventArgs eventArgs)
- {
- SetONOFFStatu(true);
- (device as AirSwitch).SwitchControl(1);
- //鎺у埗寤舵椂鍥炶皟
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- /// <summary>
- /// OFF
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="eventArgs"></param>
- private void OFF(object sender, MouseEventArgs eventArgs)
- {
- SetONOFFStatu(false);
- (device as AirSwitch).SwitchControl(0);
- //鎺у埗寤舵椂鍥炶皟
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
- /// <summary>
- /// SetONOFFStatu
- /// </summary>
- /// <param name="statu"></param>
- private void SetONOFFStatu(bool statu)
- {
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " ";
- if (statu)
- {
- OnBtn.IsSelected = true;
- OffBtn.IsSelected = false;
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.uOpen1);
- }
- else
- {
- OnBtn.IsSelected = false;
- OffBtn.IsSelected = true;
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.Close);
- }
- }
-
-
- #endregion
-
- #region 鈼� 璁剧疆__________________________
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void More(object sender, MouseEventArgs e)
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.EditAction += (curDev, curRoom) =>
- {
- Show(curDev, curRoom);
- };
- }
-
- #endregion
-
- #region 鈼� 鏀惰棌__________________________
- /// <summary>
- /// 鏀惰棌鍒颁富椤�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void Collection(object sender, MouseEventArgs e)
- {
- //collection
- if ((sender as Button).IsSelected)
- {
- UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
- (sender as Button).IsSelected = false;
- }
- else
- {
- UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
- (sender as Button).IsSelected = true;
- }
- }
-
- #endregion
-
- #region 鈼� 璁惧鎺у埗鐘舵�乢____________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (Parent == null)
- {
- return;
- }
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (tempDevice.DeviceEpoint != this.device.DeviceEpoint || tempDevice.DeviceAddr != this.device.DeviceAddr)
- {
- //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveUpdateControlDeviceStatuAction()
- {
- //绉婚櫎action
- if (zbGateway != null)
- {
- zbGateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp20200414/Shared/Phone/Device/Light/DimmableLightControl.cs
deleted file mode 100755
index ce0324d..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Light/DimmableLightControl.cs
+++ /dev/null
@@ -1,584 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Light
-{
- public class DimmableLightControl:FrameLayout, ZigBee.Common.IStatus
- {
- #region 鈼� 鍙橀噺__________________________
-
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice, Common.Room> action;
- ///// <summary>
- ///// The top view.
- ///// </summary>
- private CommonForm.TopFrameLayout top;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private CommonDevice device;
- /// <summary>
- /// 浼犺繃鏉ョ殑ac
- /// </summary>
- private ZigBee.Device.DimmableLight dimmableLight;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// 鏀惰棌鎸夐挳
- /// </summary>
- private Button collectionBtn;
-
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- private Button switchBtn;
- /// <summary>
- /// 婊戞潯
- /// </summary>
- private WaveSeekBar levelSeekBar;
-
-
- private Button StatuBtn;
- /// <summary>
- /// 鎴块棿
- /// </summary>
- private Button roomBtn;
- /// <summary>
- /// 鎴块棿鍚�
- /// </summary>
- private Button roomName;
- /// <summary>
- /// MaxLevel
- /// </summary>
- private const int MaxLevel = 254;
-
- /// <summary>
- /// IsDrawerLockMode
- /// </summary>
- public bool IsDrawerLockMode;
- /// <summary>
- /// ProgressBtn
- /// </summary>
- Button ProgressBtn;
- /// <summary>
- /// ProgressBtnY
- /// </summary>
- int ProgressBtnY;
-
- #endregion
-
- #region 鈼� 鎺ュ彛__________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- if (deviceUI.Type == DeviceType.DimmableLight)
- {
- if (common.DeviceStatusReport.CluterID == 6)
- {
- dimmableLight = deviceUI as DimmableLight;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- switchBtn.IsSelected = dimmableLight.OnOffStatus == 1;
- StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} {UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
-
- if (switchBtn.IsSelected == true)
- {
- levelSeekBar.IsClickable = true;
- levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End);
- }
- else
- {
- levelSeekBar.IsClickable = false;
- levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
- }
- dimmableLight.LastDateTime = DateTime.Now;
- }
- //浜害
- if (common.DeviceStatusReport.CluterID == 8)
- {
- dimmableLight = deviceUI as ZigBee.Device.DimmableLight;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
- dimmableLight.Level = attriButeList[0].AttriButeData;
- dimmableLight.LastDateTime = DateTime.Now;
- levelSeekBar.Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100);
- StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
- break;
- }
- }
-
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
-
- }
- }
-
- #endregion
-
- #region 鈼� 閲嶅啓绉婚櫎_______________________
-
- /// <summary>
- /// Removes from parent.
- /// </summary>
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- UserView.HomePage.Instance.ScrollEnabled = true;
- action(device, room);
- action = null;
- if (IsDrawerLockMode)
- {
- CommonPage.Instance.IsDrawerLockMode = false;
- }
- base.RemoveFromParent();
- }
-
- #endregion
-
- #region 鈼� 鏋勯�犳柟娉昣______________________
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public DimmableLightControl()
- {
- UserView.HomePage.Instance.ScrollEnabled = false;
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- ZbGateway.StatusList.Add(this);
- }
-
- #endregion
-
- #region 鈼� 鏄剧ず鐣岄潰_______________________
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="device">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(CommonDevice device, Shared.Common.Room room)
- {
- this.device = device;
- this.room = room;
- this.dimmableLight = device as ZigBee.Device.DimmableLight;
-
- //娣诲姞topview
- AddTopView();
- //娣诲姞midview
- AddBodyView(this.device);
- //缁戝畾浜嬩欢
- BindEvent();
- //鏀惰棌
- InitCollection();
-
- if (dimmableLight.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- UserView.UserHomeView.ReadStatus(dimmableLight, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device);
- }
- }
- }
-
- #endregion
-
- #region 鈼� topview_______________________
-
- /// <summary>
- /// Adds the top view.
- /// </summary>
- private void AddTopView()
- {
- top = new CommonForm.TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var moreBtn = new Button
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png"
- };
- top.topView.AddChidren(moreBtn);
-
- moreBtn.MouseUpEventHandler += MoreEvent;
- }
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void MoreEvent(object sender, MouseEventArgs e)
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.EditAction += (curDev, curRoom) =>
- {
- Show(curDev, curRoom);
- };
- }
-
- #endregion
-
- #region 鈼� midview_______________________
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- AddItemview();
- }
-
- #endregion
-
- #region 鈼� itemview_______________________
- /// <summary>
- /// Adds the itemview.
- /// </summary>
- private void AddItemview()
- {
- var itemView = new FrameLayout()
- {
- Y = Application.GetRealHeight(115),
- Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1316),
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(itemView);
-
- collectionBtn = new Button()
- {
- X = Application.GetRealWidth(850),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- itemView.AddChidren(collectionBtn);
-
- var deviceNameBtn = new Button()
- {
- Y = Application.GetRealHeight(46),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15,
- IsBold=true
- };
- itemView.AddChidren(deviceNameBtn);
-
- StatuBtn = new Button
- {
- Y = Application.GetRealHeight(118),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = dimmableLight.Level>0?$"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device)}" :$"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}",
- TextSize=10
- };
-
- itemView.AddChidren(StatuBtn);
-
- levelSeekBar = new WaveSeekBar()
- {
- Y = Application.GetRealHeight(377),
- Width = Application.GetRealWidth(271),
- Height = Application.GetRealHeight(533),
- Gravity = Gravity.CenterHorizontal,
- WavePadding = Application.GetRealWidth(8),
- MaxValue=100,
- Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100),
-
- CornerRadius= Application.GetRealHeight(58)
- };
-
- itemView.AddChidren(levelSeekBar);
-
- if (dimmableLight.OnOffStatus == 1)
- {
- levelSeekBar.IsClickable = true;
- levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End);
- }
- else
- {
- levelSeekBar.IsClickable = false;
- levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
- }
-
- levelSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
- {
- OnProgressButtonMove(levelSeekBar.Progress);
- levelSeekBar.IsProgressTextShow = false;
- ProgressBtn.Visible = true;
- };
-
- levelSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
- {
- ProgressBtn.Visible = false;
- levelSeekBar.IsProgressTextShow = true;
- dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
- };
-
- levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
- {
-
- OnProgressButtonMove(e2);
-
- //鍒ゆ柇鏄惁300ms灞忚斀
- //if (levelSeekBar.IsProgressChangeDelay()) return;
- //dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
- };
-
- InitProgressBtn(itemView);
-
- switchBtn = new Button()
- {
- Y = Application.GetRealHeight(1005),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- IsSelected = (device as DimmableLight).OnOffStatus == 1
- };
- itemView.AddChidren(switchBtn);
-
- var roomBG = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(138 + 50),
- BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
- };
- itemView.AddChidren(roomBG);
-
- var roomBG2 = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- itemView.AddChidren(roomBG2);
-
- roomBtn = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(1207),
- Width = Application.GetMinReal(80),
- Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png"
- };
- itemView.AddChidren(roomBtn);
-
- roomName = new Button()
- {
- X = Application.GetRealWidth(150),
- Y = Application.GetRealHeight(1224),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(50),
- Text = room.Name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize = 12
- };
- itemView.AddChidren(roomName);
- }
-
- /// <summary>
- /// OnProgressButtonMove
- /// </summary>
- private void OnProgressButtonMove(int mProgress)
- {
- ProgressBtn.Y = ProgressBtnY + levelSeekBar.NowProgressY;
- ProgressBtn.Text = mProgress + "%";
- }
-
- /// <summary>
- /// 娣诲姞杩涘害鎸夐挳
- /// </summary>
- private void InitProgressBtn(FrameLayout layout)
- {
- ProgressBtnY = levelSeekBar.Y - Application.GetMinReal(154);
- ProgressBtn = new Button()
- {
- Y = ProgressBtnY,
- Width = Application.GetMinReal(135),
- Height = Application.GetMinReal(104),
- UnSelectedImagePath = "Item/ProgressBubbles.png",
- Visible = false,
- Gravity = Gravity.CenterHorizontal,
- TextSize = 14,
- IsBold = true,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor
- };
- layout.AddChidren(ProgressBtn);
- }
-
- #endregion
-
- #region 鈼� 缁戝畾鎸夐挳_______________________
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- switchBtn.MouseUpEventHandler += Switch_MouseUpEvent;
- collectionBtn.MouseUpEventHandler += Collection;
- }
-
- #endregion
-
- #region 鈼� 寮�鍏砡_________________________
-
- /// <summary>
- /// 寮�鍏宠缃�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Switch_MouseUpEvent(object sender, MouseEventArgs eventArgs)
- {
- switchBtn.IsSelected = !switchBtn.IsSelected;
- StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
- if (switchBtn.IsSelected == true)
- {
- dimmableLight.SwitchControl(1);
- levelSeekBar.IsClickable = true;
- levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End);
- }
- else
- {
- dimmableLight.SwitchControl(0);
- levelSeekBar.IsClickable = false;
- levelSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
- }
- }
-
- #endregion
-
- #region 鈼� 鏀惰棌__________________________
-
- /// <summary>
- /// Inits the collection.
- /// </summary>
- private void InitCollection()
- {
- if (UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- collectionBtn.IsSelected = false;
- }
- else
- {
- collectionBtn.IsSelected = true;
- }
- }
- /// <summary>
- /// 鏀惰棌鍒颁富椤�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void Collection(object sender, MouseEventArgs e)
- {
- //collection
- if ((sender as Button).IsSelected)
- {
- UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
- (sender as Button).IsSelected = false;
- }
- else
- {
- UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
- (sender as Button).IsSelected = true;
- }
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp20200414/Shared/Phone/Device/Light/LightControl.cs
deleted file mode 100755
index 504214d..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Light/LightControl.cs
+++ /dev/null
@@ -1,540 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Light
-{
- /// <summary>
- /// 鐏厜鎺у埗鐣岄潰
- /// </summary>
- public class LightControl:FrameLayout,ZigBee.Common.IStatus
- {
- #region 鈼� 鍙橀噺__________________________
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- private Button switchBtn;
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice, Common.Room> action;
-
- /// <summary>
- /// The light image.
- /// </summary>
- private Button deviceIMG;
- /// <summary>
- /// 鏀惰棌鎸夐挳
- /// </summary>
- private Button collectionBtn;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private CommonDevice device;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
-
- /// <summary>
- /// 鎴块棿
- /// </summary>
- private Button roomBtn;
- /// <summary>
- /// 鎴块棿鍚�
- /// </summary>
- private Button roomName;
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
-
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
-
- private Button StatuBtn;
-
- /// <summary>
- /// IsDrawerLockMode
- /// </summary>
- public bool IsDrawerLockMode;
- #endregion
-
- #region 鈼� 鎺ュ彛__________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- if (deviceUI.Type == DeviceType.OnOffOutput)
- {
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var light = deviceUI as ToggleLight;
- light.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (light.DeviceStatusReport.AttriBute == null || light.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
- deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device);
- light.LastDateTime = DateTime.Now;
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- deviceUI.IsOnline = common.IsOnline;
- deviceUI.LastDateTime = DateTime.Now;
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- }
- #endregion
-
- #region 鈼� 鍒濆鍖朹____________________
- /// <summary>
- /// 閲嶅啓绉婚櫎鏂规硶
- /// </summary>
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- action(device, room);
- action = null;
- if (IsDrawerLockMode)
- {
- CommonPage.Instance.IsDrawerLockMode = false;
- }
- RemoveUpdateControlDeviceStatuAction();
- base.RemoveFromParent();
- }
-
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public LightControl()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- ZbGateway.StatusList.Add(this);
- }
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="dev">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(CommonDevice dev,Shared.Common.Room room)
- {
- device = dev;
- zbGateway = this.device.Gateway;
- this.room = room;
-
- AddTop();
-
- AddBodyView(device);
-
-
- var light = dev as ToggleLight;
- //琛ヤ笂闈炶繙绋�
- if (light.Gateway == null)
- {
- return;
- }
- if (light.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- }
- }
-
- if(UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- collectionBtn.IsSelected = false;
- }
- else
- {
- collectionBtn.IsSelected = true;
- }
-
-
- BindEvent();
-
- }
-
- #endregion
-
- #region 鈼� Add______________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
-
- var moreBtn = new Button
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity=Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png"
- };
- top.topView.AddChidren(moreBtn);
-
- moreBtn.MouseUpEventHandler += More;
-
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var itemView = new FrameLayout()
- {
- Y = Application.GetRealHeight(115),
- Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1316),
- Radius =(uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(itemView);
-
- collectionBtn = new Button()
- {
- X = Application.GetRealWidth(850),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- itemView.AddChidren(collectionBtn);
-
- var deviceNameBtn = new Button()
- {
- Y = Application.GetRealHeight(46),
- Width=Application.GetRealWidth(500),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize=15,
- IsBold=true
- };
- itemView.AddChidren(deviceNameBtn);
-
- StatuBtn = new Button
- {
- Y = Application.GetRealHeight(118),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device),
- TextSize = 10
- };
- itemView.AddChidren(StatuBtn);
-
-
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(389),
- Width = Application.GetMinRealAverage(377),
- Height = Application.GetMinRealAverage(435),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/DeskLamp.png",
- SelectedImagePath = "Light/DeskLampSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(deviceIMG);
-
- switchBtn = new Button()
- {
- Y = Application.GetRealHeight(996),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(switchBtn);
-
- var roomBG = new Button
- {
- Y = Application.GetRealHeight(1178-50),
- Height = Application.GetRealHeight(138+50),
- BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
- };
- itemView.AddChidren(roomBG);
-
- var roomBG2 = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- itemView.AddChidren(roomBG2);
-
- roomBtn = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(1207),
- Width = Application.GetMinReal(80),
- Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png"
- };
- itemView.AddChidren(roomBtn);
-
- roomName = new Button()
- {
- X = Application.GetRealWidth(150),
- Y = Application.GetRealHeight(1224),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(50),
- Text = room.Name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize=12
- };
- itemView.AddChidren(roomName);
- }
-
- #endregion
-
- #region 鈼� 缁戝畾鎸夐挳_______________________
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- switchBtn.MouseUpEventHandler += Switch;
- deviceIMG.MouseUpEventHandler += Switch;
- collectionBtn.MouseUpEventHandler += Collection;
- }
-
- #endregion
-
- #region 鈼� 寮�鍏砡_________________________
-
- /// <summary>
- /// 寮�鍏宠缃�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Switch(object sender, MouseEventArgs eventArgs)
- {
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- switchBtn.IsSelected = !switchBtn.IsSelected;
- deviceIMG.IsSelected = !deviceIMG.IsSelected;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " ";
- if (deviceIMG.IsSelected == true)
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.uOpen1);
- }
- else
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.Close);
- }
-
- if (switchBtn.IsSelected == true)
- {
- (device as ToggleLight).SwitchControl(1);
- }
- else
- {
- (device as ToggleLight).SwitchControl(0);
- }
- //鎺у埗寤舵椂鍥炶皟
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if(Parent==null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand==false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
-
-
- #endregion
-
- #region 鈼� 璁剧疆__________________________
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void More(object sender, MouseEventArgs e)
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.EditAction += (curDev, curRoom) =>
- {
- Show(curDev, curRoom);
- };
- }
-
- #endregion
-
- #region 鈼� 鏀惰棌__________________________
- /// <summary>
- /// 鏀惰棌鍒颁富椤�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void Collection(object sender, MouseEventArgs e)
- {
- //collection
- if ((sender as Button).IsSelected)
- {
- UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
- (sender as Button).IsSelected = false;
- }
- else
- {
- UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
- (sender as Button).IsSelected = true;
- }
- }
-
- #endregion
-
- #region 鈼� 璁惧鎺у埗鐘舵�乢____________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (Parent == null)
- {
- return;
- }
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (tempDevice.DeviceEpoint != this.device.DeviceEpoint || tempDevice.DeviceAddr != this.device.DeviceAddr)
- {
- //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveUpdateControlDeviceStatuAction()
- {
- //绉婚櫎action
- if(zbGateway!=null)
- {
- zbGateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Light/OnOffControl.cs b/ZigbeeApp20200414/Shared/Phone/Device/Light/OnOffControl.cs
deleted file mode 100755
index bb3e05b..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Light/OnOffControl.cs
+++ /dev/null
@@ -1,735 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Light
-{
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- public class OnOffControl:FrameLayout, ZigBee.Common.IStatus
- {
- #region 鈼� 鍙橀噺__________________________
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- private Button switchBtn;
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice, Common.Room> action;
-
- /// <summary>
- /// The light image.
- /// </summary>
- private Button deviceIMG;
- /// <summary>
- /// 鏀惰棌鎸夐挳
- /// </summary>
- private Button collectionBtn;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private CommonDevice device;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
-
- /// <summary>
- /// 鎴块棿
- /// </summary>
- private Button roomBtn;
- /// <summary>
- /// 鎴块棿鍚�
- /// </summary>
- private Button roomName;
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
-
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
-
- private Button StatuBtn;
- /// <summary>
- /// OnBtn
- /// </summary>
- private Button OnBtn;
- /// <summary>
- /// OffBtn
- /// </summary>
- private Button OffBtn;
-
- /// <summary>
- /// IsDrawerLockMode
- /// </summary>
- public bool IsDrawerLockMode;
- #endregion
-
- #region 鈼� 鎺ュ彛__________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- if (deviceUI.Type == DeviceType.OnOffOutput)
- {
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var light = deviceUI as ToggleLight;
- light.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (light.DeviceStatusReport.AttriBute == null || light.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device);
-
- if (device.DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- SetONOFFStatu(light.OnOffStatus == 1);
- }
- else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
- }
- else
- {
- deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
- }
-
-
- light.LastDateTime = DateTime.Now;
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- deviceUI.IsOnline = common.IsOnline;
- //OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- }
- #endregion
-
- #region 鈼� 鍒濆鍖朹____________________
- /// <summary>
- /// 閲嶅啓绉婚櫎鏂规硶
- /// </summary>
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- action(device, room);
- action = null;
- RemoveUpdateControlDeviceStatuAction();
- if (IsDrawerLockMode)
- {
- CommonPage.Instance.IsDrawerLockMode = false;
- }
- base.RemoveFromParent();
- }
-
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public OnOffControl()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- ZbGateway.StatusList.Add(this);
- }
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="dev">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(CommonDevice dev, Shared.Common.Room room)
- {
- device = dev;
- zbGateway = this.device.Gateway;
- this.room = room;
-
- AddTop();
-
- AddBodyView(device);
-
-
- var light = dev as ToggleLight;
- //琛ヤ笂闈炶繙绋�
- if (light.Gateway == null)
- {
- return;
- }
- if (light.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- }
- }
-
- if(UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- collectionBtn.IsSelected = false;
- }
- else
- {
- collectionBtn.IsSelected = true;
- }
-
-
- BindEvent();
-
- }
-
- #endregion
-
- #region 鈼� Add______________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var moreBtn = new Button
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png"
- };
- top.topView.AddChidren(moreBtn);
-
- moreBtn.MouseUpEventHandler += More;
-
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var itemView = new FrameLayout()
- {
- Y = Application.GetRealHeight(115),
- Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1316),
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(itemView);
-
- collectionBtn = new Button()
- {
- X = Application.GetRealWidth(850),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- itemView.AddChidren(collectionBtn);
-
- var deviceNameBtn = new Button()
- {
- Y = Application.GetRealHeight(46),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15,
- IsBold=true
- };
- itemView.AddChidren(deviceNameBtn);
-
- StatuBtn = new Button
- {
- Y = Application.GetRealHeight(118),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device),
- TextSize = 10
- };
- itemView.AddChidren(StatuBtn);
-
- var roomBG = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(138 + 50),
- BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
- };
- itemView.AddChidren(roomBG);
-
- var roomBG2 = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- itemView.AddChidren(roomBG2);
-
- roomBtn = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(1207),
- Width = Application.GetMinReal(80),
- Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png"
- };
- itemView.AddChidren(roomBtn);
-
- roomName = new Button()
- {
- X = Application.GetRealWidth(150),
- Y = Application.GetRealHeight(1224),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(50),
- Text = room.Name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize = 12
- };
- itemView.AddChidren(roomName);
-
- AddByFunctionType(itemView);
- }
-
- /// <summary>
- /// AddByFunctionType
- /// </summary>
- private void AddByFunctionType(FrameLayout itemView)
- {
- if(device.DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- AddOnOff(itemView);
- }
- else if(device.DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- AddPlug(itemView);
- }
- else
- {
- AddLight(itemView);
- }
- }
-
- /// <summary>
- /// AddOnOff
- /// </summary>
- private void AddOnOff(FrameLayout itemView)
- {
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(340),
- Width = Application.GetMinRealAverage(579),
- Height = Application.GetMinRealAverage(579),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/OnOff.png",
- };
- itemView.AddChidren(deviceIMG);
-
- OffBtn = new Button
- {
- X = Application.GetRealWidth(294),
- Y = Application.GetRealHeight(588),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- UnSelectedImagePath = "Light/OFF.png",
- SelectedImagePath = "Light/OFFSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 0
- };
- itemView.AddChidren(OffBtn);
-
- OnBtn = new Button
- {
- X = Application.GetRealWidth(590),
- Y = Application.GetRealHeight(588),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- UnSelectedImagePath = "Light/ON.png",
- SelectedImagePath = "Light/ONSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(OnBtn);
-
- OnBtn.MouseUpEventHandler += ON;
- OffBtn.MouseUpEventHandler += OFF;
- }
-
- /// <summary>
- /// light
- /// </summary>
- /// <param name="itemView"></param>
- private void AddLight(FrameLayout itemView)
- {
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(389),
- Width = Application.GetMinRealAverage(377),
- Height = Application.GetMinRealAverage(435),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/DeskLamp.png",
- SelectedImagePath = "Light/DeskLampSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(deviceIMG);
-
- switchBtn = new Button()
- {
- Y = Application.GetRealHeight(996),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(switchBtn);
-
- switchBtn.MouseUpEventHandler += Switch;
- deviceIMG.MouseUpEventHandler += Switch;
- }
-
- /// <summary>
- /// plug
- /// </summary>
- /// <param name="itemView"></param>
- private void AddPlug(FrameLayout itemView)
- {
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(344),
- Width = Application.GetMinRealAverage(567),
- Height = Application.GetMinRealAverage(567),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/Plug.png",
- SelectedImagePath = "Light/PlugSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(deviceIMG);
-
- switchBtn = new Button()
- {
- Y = Application.GetRealHeight(996),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(switchBtn);
-
- switchBtn.MouseUpEventHandler += Switch;
- deviceIMG.MouseUpEventHandler += Switch;
- }
-
- #endregion
-
- #region 鈼� 缁戝畾鎸夐挳_______________________
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- collectionBtn.MouseUpEventHandler += Collection;
- }
-
- #endregion
-
- #region 鈼� 寮�鍏砡_________________________
-
- /// <summary>
- /// 寮�鍏宠缃�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Switch(object sender, MouseEventArgs eventArgs)
- {
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- switchBtn.IsSelected = !switchBtn.IsSelected;
- deviceIMG.IsSelected = !deviceIMG.IsSelected;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " ";
- if (deviceIMG.IsSelected == true)
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.uOpen1);
- }
- else
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.Close);
- }
- if (switchBtn.IsSelected == true)
- {
- (device as ToggleLight).SwitchControl(1);
- }
- else
- {
- (device as ToggleLight).SwitchControl(0);
- }
- //鎺у埗寤舵椂鍥炶皟
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
- /// <summary>
- /// ON
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="eventArgs"></param>
- private void ON(object sender, MouseEventArgs eventArgs)
- {
- SetONOFFStatu(true);
- (device as ToggleLight).SwitchControl(1);
- //鎺у埗寤舵椂鍥炶皟
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- /// <summary>
- /// OFF
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="eventArgs"></param>
- private void OFF(object sender, MouseEventArgs eventArgs)
- {
- SetONOFFStatu(false);
- (device as ToggleLight).SwitchControl(0);
- //鎺у埗寤舵椂鍥炶皟
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
- /// <summary>
- /// SetONOFFStatu
- /// </summary>
- /// <param name="statu"></param>
- private void SetONOFFStatu(bool statu)
- {
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " ";
- if (statu)
- {
- OnBtn.IsSelected = true;
- OffBtn.IsSelected = false;
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.uOpen1);
- }
- else
- {
- OnBtn.IsSelected = false;
- OffBtn.IsSelected = true;
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.Close);
- }
- }
-
-
- #endregion
-
- #region 鈼� 璁剧疆__________________________
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void More(object sender, MouseEventArgs e)
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.EditAction += (curDev, curRoom) =>
- {
- Show(curDev, curRoom);
- };
- }
-
- #endregion
-
- #region 鈼� 鏀惰棌__________________________
- /// <summary>
- /// 鏀惰棌鍒颁富椤�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void Collection(object sender, MouseEventArgs e)
- {
- //collection
- if ((sender as Button).IsSelected)
- {
- UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
- (sender as Button).IsSelected = false;
- }
- else
- {
- UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
- (sender as Button).IsSelected = true;
- }
- }
-
- #endregion
-
- #region 鈼� 璁惧鎺у埗鐘舵�乢____________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (Parent == null)
- {
- return;
- }
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (tempDevice.DeviceEpoint != this.device.DeviceEpoint || tempDevice.DeviceAddr != this.device.DeviceAddr)
- {
- //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveUpdateControlDeviceStatuAction()
- {
- //绉婚櫎action
- if (zbGateway != null)
- {
- zbGateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Light/PlugControl.cs b/ZigbeeApp20200414/Shared/Phone/Device/Light/PlugControl.cs
deleted file mode 100755
index 50969c8..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Light/PlugControl.cs
+++ /dev/null
@@ -1,539 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Light
-{
- /// <summary>
- /// 鎻掑骇
- /// </summary>
- public class PlugControl:FrameLayout, ZigBee.Common.IStatus
- {
-
- #region 鈼� 鍙橀噺__________________________
- /// <summary>
- /// 寮�鍏�
- /// </summary>
- private Button switchBtn;
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice, Common.Room> action;
-
- /// <summary>
- /// The light image.
- /// </summary>
- private Button deviceIMG;
- /// <summary>
- /// 鏀惰棌鎸夐挳
- /// </summary>
- private Button collectionBtn;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private CommonDevice device;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
-
- /// <summary>
- /// 鎴块棿
- /// </summary>
- private Button roomBtn;
- /// <summary>
- /// 鎴块棿鍚�
- /// </summary>
- private Button roomName;
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
-
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
-
- private Button StatuBtn;
-
- /// <summary>
- /// IsDrawerLockMode
- /// </summary>
- public bool IsDrawerLockMode;
- #endregion
-
- #region 鈼� 鎺ュ彛__________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- if (deviceUI.Type == DeviceType.OnOffOutput)
- {
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var light = deviceUI as ToggleLight;
- light.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (light.DeviceStatusReport.AttriBute == null || light.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
- deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device);
- light.LastDateTime = DateTime.Now;
- }
- }
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- else if (typeTag == "OnlineStatusChange")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- var deviceUI = device;
- //璁惧涓虹┖
- if (deviceUI == null)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
- {
- return;
- }
- deviceUI.IsOnline = common.IsOnline;
- //deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- }
- #endregion
-
- #region 鈼� 鍒濆鍖朹____________________
- /// <summary>
- /// 閲嶅啓绉婚櫎鏂规硶
- /// </summary>
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- action(device, room);
- action = null;
- RemoveUpdateControlDeviceStatuAction();
- if (IsDrawerLockMode)
- {
- CommonPage.Instance.IsDrawerLockMode = false;
- }
- base.RemoveFromParent();
- }
-
- /// <summary>
- /// 鏋勯�犳柟娉�
- /// </summary>
- public PlugControl()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- ZbGateway.StatusList.Add(this);
- }
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="dev">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(CommonDevice dev, Shared.Common.Room room)
- {
- device = dev;
- zbGateway = this.device.Gateway;
- this.room = room;
-
- AddTop();
-
- AddBodyView(device);
-
-
- var light = dev as ToggleLight;
- //琛ヤ笂闈炶繙绋�
- if (light.Gateway == null)
- {
- return;
- }
- if (light.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- }
- }
-
- if (UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- collectionBtn.IsSelected = false;
- }
- else
- {
- collectionBtn.IsSelected = true;
- }
-
-
- BindEvent();
-
- }
-
- #endregion
-
- #region 鈼� Add______________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var moreBtn = new Button
- {
- X = Application.GetRealWidth(953),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png"
- };
- top.topView.AddChidren(moreBtn);
-
- moreBtn.MouseUpEventHandler += More;
-
- }
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView(CommonDevice device)
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var itemView = new FrameLayout()
- {
- Y = Application.GetRealHeight(115),
- Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1316),
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(itemView);
-
- collectionBtn = new Button()
- {
- X = Application.GetRealWidth(850),
- Y = Application.GetRealHeight(46),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
- };
- itemView.AddChidren(collectionBtn);
-
- var deviceNameBtn = new Button()
- {
- Y = Application.GetRealHeight(46),
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15,
- IsBold=true
- };
- itemView.AddChidren(deviceNameBtn);
-
- StatuBtn = new Button
- {
- Y = Application.GetRealHeight(118),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- Gravity = Gravity.CenterHorizontal,
- TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = Language.StringByID(R.MyInternationalizationString.Current) + " " + UserCenter.HdlDeviceOtherLogic.Current.GetDeviceStatu(device),
- TextSize = 10
- };
- itemView.AddChidren(StatuBtn);
-
- deviceIMG = new Button()
- {
- Y = Application.GetRealHeight(344),
- Width = Application.GetMinRealAverage(567),
- Height = Application.GetMinRealAverage(567),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Light/Plug.png",
- SelectedImagePath = "Light/PlugSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(deviceIMG);
-
- switchBtn = new Button()
- {
- Y = Application.GetRealHeight(996),
- Width = Application.GetMinRealAverage(81),
- Height = Application.GetMinRealAverage(81),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/Switch.png",
- SelectedImagePath = "Item/SwitchSelected.png",
- IsSelected = (device as ToggleLight).OnOffStatus == 1
- };
- itemView.AddChidren(switchBtn);
-
- var roomBG = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(138 + 50),
- BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
- Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
- };
- itemView.AddChidren(roomBG);
-
- var roomBG2 = new Button
- {
- Y = Application.GetRealHeight(1178 - 50),
- Height = Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- itemView.AddChidren(roomBG2);
-
- roomBtn = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(1207),
- Width = Application.GetMinReal(80),
- Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png"
- };
- itemView.AddChidren(roomBtn);
-
- roomName = new Button()
- {
- X = Application.GetRealWidth(150),
- Y = Application.GetRealHeight(1224),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(50),
- Text = room.Name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
- TextSize=12
- };
- itemView.AddChidren(roomName);
- }
-
- #endregion
-
- #region 鈼� 缁戝畾鎸夐挳_______________________
- /// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
- /// </summary>
- private void BindEvent()
- {
- switchBtn.MouseUpEventHandler += Switch;
- deviceIMG.MouseUpEventHandler += Switch;
- collectionBtn.MouseUpEventHandler += Collection;
- }
-
- #endregion
-
- #region 鈼� 寮�鍏砡_________________________
-
- /// <summary>
- /// 寮�鍏宠缃�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="eventArgs">Event arguments.</param>
- private void Switch(object sender, MouseEventArgs eventArgs)
- {
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- switchBtn.IsSelected = !switchBtn.IsSelected;
- deviceIMG.IsSelected = !deviceIMG.IsSelected;
- StatuBtn.Text = Language.StringByID(R.MyInternationalizationString.Current) + " ";
- if (deviceIMG.IsSelected == true)
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.uOpen1);
- }
- else
- {
- StatuBtn.Text += Language.StringByID(R.MyInternationalizationString.Close);
- }
- if (switchBtn.IsSelected == true)
- {
- (device as ToggleLight).SwitchControl(1);
- }
- else
- {
- (device as ToggleLight).SwitchControl(0);
- }
- //鎺у埗寤舵椂鍥炶皟
- UserCenter.HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction();
- if (sendedControlCommand == false)
- {
- UserCenter.HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
-
-
-
- #endregion
-
- #region 鈼� 璁剧疆__________________________
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void More(object sender, MouseEventArgs e)
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.EditAction += (curDev, curRoom) =>
- {
- Show(curDev, curRoom);
- };
- }
-
- #endregion
-
- #region 鈼� 鏀惰棌__________________________
- /// <summary>
- /// 鏀惰棌鍒颁富椤�
- /// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void Collection(object sender, MouseEventArgs e)
- {
- //collection
- if ((sender as Button).IsSelected)
- {
- UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
- (sender as Button).IsSelected = false;
- }
- else
- {
- UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
- (sender as Button).IsSelected = true;
- }
- }
-
- #endregion
-
- #region 鈼� 璁惧鎺у埗鐘舵�乢____________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (Parent == null)
- {
- return;
- }
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (tempDevice.DeviceEpoint != this.device.DeviceEpoint || tempDevice.DeviceAddr != this.device.DeviceAddr)
- {
- //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveUpdateControlDeviceStatuAction()
- {
- //绉婚櫎action
- if (zbGateway != null)
- {
- zbGateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Logic/AddLogicPage.cs b/ZigbeeApp20200414/Shared/Phone/Device/Logic/AddLogicPage.cs
old mode 100755
new mode 100644
index 5e7bdea..e2168a2
--- a/ZigbeeApp20200414/Shared/Phone/Device/Logic/AddLogicPage.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -23,11 +23,11 @@
this.AddChidren(view.TopRowView());
view.toptitleNameBtn.TextID = MyInternationalizationString.selection;
view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
-
+
var middle = new FrameLayout
{
Y = view.topRowLayout.Bottom,
- Height = Application.GetRealHeight(1920 - 184),
+ Height = Application.GetRealHeight(1925 - 184),
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
this.AddChidren(middle);
@@ -36,25 +36,25 @@
timeView.iconBtn.UnSelectedImagePath = "ZigeeLogic/time.png";
timeView.funnameBtn.TextID = MyInternationalizationString.timecondition;
middle.AddChidren(timeView.FunFrameView());
-
+
///璁惧
FunView functionView = new FunView();
functionView.funFrameLayout.Y = timeView.funFrameLayout.Bottom;
functionView.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
functionView.funnameBtn.TextID = MyInternationalizationString.device;
middle.AddChidren(functionView.FunFrameView());
-
+
///瀹夐槻
FunView securityView = new FunView();
securityView.funFrameLayout.Y = functionView.funFrameLayout.Bottom;
securityView.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
securityView.funnameBtn.TextID = MyInternationalizationString.security;
middle.AddChidren(securityView.FunFrameView());
-
+
///鍦扮悊鍥存爮
FunView positionView = new FunView();
positionView.funFrameLayout.Y = securityView.funFrameLayout.Bottom;
- positionView.funFrameLayout.Height = Application.GetRealHeight(160+20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ positionView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
positionView.iconBtn.UnSelectedImagePath = "ZigeeLogic/position.png";
positionView.funnameBtn.TextID = MyInternationalizationString.location;
positionView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
@@ -335,7 +335,8 @@
#endregion
string strname = "";
//鍒拌揪鍦扮偣鐐瑰嚮浜嬩欢
- athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+ athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
strname = athomeView.titleBtn.Text;
leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
@@ -344,14 +345,15 @@
athomeView.selectedIconBtn.Visible = true;
};
//绂诲紑鍦扮偣鐐瑰嚮浜嬩欢
- leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+ leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
strname = leaveView.titleBtn.Text;
leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
leaveView.selectedIconBtn.Visible = true;
athomeView.selectedIconBtn.Visible = false;
};
-
+
double latitude = Config.Instance.Home.Latitude;//绾害
double longitude = Config.Instance.Home.Longitude;//缁忓害
int r = 500;//鍗婂緞
@@ -519,7 +521,8 @@
timeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
#endregion
//绔嬪嵆鎵ц鐐瑰嚮浜嬩欢
- timepointView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+ timepointView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
timeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
timepointView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
@@ -527,7 +530,8 @@
timepointView.selectedIconBtn.Visible = true;
};
//鏃堕棿鑼冨洿鐐瑰嚮浜嬩欢
- timeView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+ timeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
timeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
timepointView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
timeView.selectedIconBtn.Visible = true;
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Logic/CustomText.cs b/ZigbeeApp20200414/Shared/Phone/Device/Logic/CustomText.cs
index 17b995f..a1b1650 100755
--- a/ZigbeeApp20200414/Shared/Phone/Device/Logic/CustomText.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/Logic/CustomText.cs
@@ -52,6 +52,10 @@
middle.AddChidren(textBtn);
string s1 = "";
string s2 = "";
+ if (!string.IsNullOrEmpty(Common.Logic.CurrentLogic.LogicCustomPushText))
+ {
+ textBtn.Text = (50 - Common.Logic.CurrentLogic.LogicCustomPushText.Length).ToString();
+ }
textBox.TextChangeEventHandler += (sender, e) =>
{
var leng = e.Length;
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Logic/OneLogic.cs b/ZigbeeApp20200414/Shared/Phone/Device/Logic/OneLogic.cs
index 8ef4c90..7627338 100755
--- a/ZigbeeApp20200414/Shared/Phone/Device/Logic/OneLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/Logic/OneLogic.cs
@@ -130,20 +130,25 @@
var conditions = Common.Logic.CurrentLogic.Conditions[i];
switch (Type)
{
- case 5:
+ case 0:
{
-
- selecteddevice.ordinaryBtn.Visible = true;
- selecteddevice.iconBtn.UnSelectedImagePath = "ZigeeLogic/timeparagraph.png";
- string s1 = "", s2 = "";
- s1 = conditions["StartMin"].Length < 2 ? "0" + conditions["StartMin"] : conditions["StartMin"];
- s2 = conditions["StopMin"].Length < 2 ? "0" + conditions["StopMin"] : conditions["StopMin"];
- ///鏄剧ず鏃堕棿
- selecteddevice.ordinaryBtn.Text = conditions["StartHour"] + ":" + s1 + "-" + conditions["StopHour"] + ":" + s2;
- selecteddevice.selecetddevicestateBtn.Text = Language.StringByID(MyInternationalizationString.timeframe);
+
+ //"0姝e父鏃堕棿鐐�","1鏃ュ嚭鏃堕棿","2鏃ヨ惤鏃堕棿","3姝e崍鏃堕棿"
+ switch (int.Parse(conditions["DateType"]))
+ {
+ case 0:
+ {
+ selecteddevice.ordinaryBtn.Text = Language.StringByID(MyInternationalizationString.immediateexecution);
+ selecteddevice.iconBtn.UnSelectedImagePath = "ZigeeLogic/timepoint.png";
+ string s = "";
+ s = conditions["StartMin"].Length < 2 ? "0" + conditions["StartMin"] : conditions["StartMin"];
+ selecteddevice.selecetddevicestateBtn.Text= conditions["StartHour"] + ":" + s;
+ }
+ break;
+ }
+
}
break;
-
}
if (Yes)
{
@@ -154,13 +159,19 @@
///缂栬緫
selecteddevice.edit.MouseUpEventHandler += (sender, e) =>
{
- if (Type==5) {
- var timePage = new TimePage();
- UserView.HomePage.Instance.AddChidren(timePage);
+ if (Type == 0)
+ {
+ var oneTimePoint = new OneTimePoint();
+ UserView.HomePage.Instance.AddChidren(oneTimePoint);
UserView.HomePage.Instance.PageIndex += 1;
- timePage.str1 = conditions["StartHour"] + ":" + conditions["StartMin"] + "-" + conditions["StopHour"] + ":" + conditions["StopMin"];
- timePage.IsEditor = true;
- timePage.Show(true);
+ oneTimePoint.Show((timeString) =>
+ {
+ if (!string.IsNullOrEmpty(timeString))
+ {
+ //缂栬緫瀹屽洖鏉ュ厛鏇存柊鏃堕棿
+ selecteddevice.selecetddevicestateBtn.Text = timeString;
+ }
+ });
}
};
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Logic/OneTimePoint.cs b/ZigbeeApp20200414/Shared/Phone/Device/Logic/OneTimePoint.cs
new file mode 100755
index 0000000..4ceb68f
--- /dev/null
+++ b/ZigbeeApp20200414/Shared/Phone/Device/Logic/OneTimePoint.cs
@@ -0,0 +1,106 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+using Shared.Common;
+using Shared.Phone;
+using Shared.Phone.Device.Logic.LogicView;
+using Shared.R;
+using ZigBee.Device;
+
+namespace Shared.Phone.Device.Logic
+{
+ public class OneTimePoint : FrameLayout
+ {
+ public OneTimePoint()
+ {
+ Tag = "Logic";
+ }
+
+ public void Show(Action<string> action)
+ {
+ #region 涓婇潰鐨勫竷灞�浠g爜
+ TopView view = new TopView();
+ this.AddChidren(view.TopRowView());
+ view.toptitleNameBtn.TextID = MyInternationalizationString.addtime;
+ view.clickBtn.MouseDownEventHandler += (sender, e) => {
+ RemoveFromParent();
+ action("");
+ };
+ #endregion
+
+ var middle = new FrameLayout
+ {
+ Y = view.topRowLayout.Bottom,
+ Height = Application.GetRealHeight(1920 - 184 - 260),
+ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ };
+ this.AddChidren(middle);
+ #region -----绫诲瀷 鏃跺埢 鑷畾涔夋椂闂�
+ TypeView typeView = new TypeView();
+ middle.AddChidren(typeView.Show());
+ typeView.textBtn.TextID = MyInternationalizationString.type;
+ typeView.titleBtn.Width = Application.GetRealWidth(630 + 70);
+ typeView.titleBtn.TextID = MyInternationalizationString.immediateexecution;
+ typeView.backBtn.Visible = false;
+
+ TypeView skView = new TypeView();
+ skView.frameLayout.Y = typeView.frameLayout.Bottom;
+ middle.AddChidren(skView.Show());
+ skView.textBtn.TextID = MyInternationalizationString.moment;
+ skView.backBtn.UnSelectedImagePath = "ZigeeLogic/dropdown.png";
+
+ #endregion
+
+ var rowTimeView = new FrameLayout
+ {
+ Y = skView.frameLayout.Bottom,
+ Height = Application.GetRealHeight(600),
+ };
+ middle.AddChidren(rowTimeView);
+
+ TimeView timeview = new TimeView
+ {
+
+ Height = Application.GetRealHeight(550),
+ BackgroundColor = 0x40ffffff,
+ Width = Application.GetRealWidth(1080),
+ };
+ rowTimeView.AddChidren(timeview);
+
+ //淇濆瓨
+ SaveView saveView = new SaveView();
+ saveView.frameLayout.Y = middle.Bottom;
+ this.AddChidren(saveView.Show());
+ saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ string h = timeview.Hour.ToString();
+ string m = timeview.Minute.ToString();
+ Dictionary<string, string> timeIfon = new Dictionary<string, string>();
+ timeIfon.Add("Type", "0");
+ timeIfon.Add("IsValid", "1");
+ timeIfon.Add("DateType", "0");
+ timeIfon.Add("RemindTime", "0");
+ timeIfon.Add("EnDelay", "0");
+ timeIfon.Add("DelayTime", "0");
+ timeIfon.Add("DoorLockOpenDelayTime", "0");
+ timeIfon.Add("StartHour", h);
+ timeIfon.Add("StartMin", m);
+ for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++)
+ {
+ if (Common.Logic.CurrentLogic.Conditions[i]["Type"] == "0")
+ {
+ Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
+ Common.Logic.CurrentLogic.Conditions.Insert(i, timeIfon);
+ break;
+ }
+ }
+ string s = h + ":" + (m.Length < 2 ? "0" + m : m);
+ this.RemoveFromParent();
+ action(s);
+ };
+
+ }
+
+ }
+}
+
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp20200414/Shared/Phone/Device/Logic/Send.cs
index 8c89431..6d0a404 100755
--- a/ZigbeeApp20200414/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/Logic/Send.cs
@@ -1113,6 +1113,14 @@
/// <param name="logic">閫昏緫瀵硅薄</param>
public static void Zj(bool tag, Common.Logic logic)
{
+
+ if (string.IsNullOrEmpty(logic.LogicCustomPushText))
+ {
+ ///榛樿鎺ㄩ�佽嚜瀹氫箟鍐呭
+ string str = logic.LogicName + Language.StringByID(R.MyInternationalizationString.defaulttext);
+ logic.LogicCustomPushText = str;
+ }
+
new System.Threading.Thread(() =>
{
if (logic.LogicId != 0)
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp20200414/Shared/Phone/Device/Logic/SkipView.cs
old mode 100755
new mode 100644
index e20c360..6a87383
--- a/ZigbeeApp20200414/Shared/Phone/Device/Logic/SkipView.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/Logic/SkipView.cs
@@ -13,12 +13,13 @@
/// <summary>
/// 鍏跺畠鐣岄潰璺宠繘鏉ョ殑鍏ュ彛
/// </summary>
- public static void SkipAddLogic(int intvalue,DoorLock doorLock=null,UserCenter.MemberInfoRes accountObj = null)
+ public static void SkipAddLogic(int intvalue, DoorLock doorLock = null, UserCenter.MemberInfoRes accountObj = null)
{
/// 0.姝e父鑷姩鍖�;1.闂ㄩ攣鑷姩鍖�;2.闂ㄩ攣甯稿紑.鍏�;
switch (intvalue)
{
- case 0: {
+ case 0:
+ {
//new涓�涓柊閫昏緫瀵硅薄锛�
//鏂板姝e父鑷姩鍖栧叆鍙�
Common.Logic.CurrentLogic = new Common.Logic();
@@ -29,15 +30,17 @@
UserView.HomePage.Instance.AddChidren(addLogicPage);
UserView.HomePage.Instance.PageIndex += 1;
addLogicPage.Show();
- } break;
- case 1: {
+ }
+ break;
+ case 1:
+ {
//杩涘叆闂ㄩ攣鑱斿姩浜嬩欢鍏ュ彛
Send.UserMemberInfoRes = accountObj;
Send.CurrentDoorLock = doorLock;
if (accountObj == null)
{
///闃叉鎶涘紓甯�
- Send.UserMemberInfoRes = new UserCenter.MemberInfoRes();
+ Send.UserMemberInfoRes = new UserCenter.MemberInfoRes();
}
if (doorLock == null)
{
@@ -54,52 +57,49 @@
UserView.HomePage.Instance.AddChidren(doorLockLogicList);
UserView.HomePage.Instance.PageIndex += 1;
doorLockLogicList.Show();
- } break;
- case 2: {
+ }
+ break;
+ case 2:
+ {
Common.Logic.LogicDviceList.Clear();
if (Common.Logic.LogicDviceList.Count == 0)
{
Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
}
//璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
- int h =int.Parse(DateTime.Now.ToString("hh"));
- int m = int.Parse(DateTime.Now.ToString("mm"));
- //榛樿涓�涓椂闂存(寮�濮嬫椂闂翠负:绯荤粺褰撳墠锛岀粨鏉熸椂闂翠负:寮�濮嬫椂闂�+1涓椂闂�)
- Dictionary<string, string> timeDictionary = new Dictionary<string, string>();
- timeDictionary.Add("Type", "5");
- timeDictionary.Add("IsValid", "1");
- timeDictionary.Add("StartHour", h.ToString());
- timeDictionary.Add("StartMin", m.ToString());
- if (h + 1 == 24)
- {
- //缁撴潫鏃堕棿瓒呭嚭24灏忔椂澶勭悊鏂规硶;
- timeDictionary.Add("StopHour", h.ToString());
- timeDictionary.Add("StopMin", "59");
- }
- else
- {
- timeDictionary.Add("StopHour", (h + 1).ToString());
- timeDictionary.Add("StopMin", m.ToString());
- }
+ //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
+ var h = DateTime.Now.ToString("HH");
+ var m = DateTime.Now.ToString("mm");
+ Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>();
+ timeConditionsInfo.Add("Type", "0");
+ timeConditionsInfo.Add("IsValid", "1");
+ timeConditionsInfo.Add("DateType", "0");
+ timeConditionsInfo.Add("RemindTime", "0");
+ timeConditionsInfo.Add("EnDelay", "0");
+ timeConditionsInfo.Add("DelayTime", "0");
+ timeConditionsInfo.Add("DoorLockOpenDelayTime", "0");
+ timeConditionsInfo.Add("StartHour", h);
+ timeConditionsInfo.Add("StartMin", m);
Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
actionsInfo.Add("LinkType", 8);
actionsInfo.Add("DeviceAddr", doorLock.DeviceAddr);
actionsInfo.Add("Epoint", doorLock.DeviceEpoint);
- actionsInfo.Add("PassData", "055704010112");//榛樿闂ㄩ攣甯稿紑
-
+ actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧
+
//new涓�涓柊閫昏緫瀵硅薄锛�
//鏂板闂ㄩ攣甯稿紑妯″紡鑷姩鍖栧叆鍙o紱
Common.Logic.CurrentLogic = new Common.Logic();
Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
Common.Logic.CurrentLogic.LogicType = 2;//鏍囪閫昏緫绫诲瀷
Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.openmode);
- Common.Logic.CurrentLogic.Conditions.Add(timeDictionary);//娣诲姞鏉′欢
+ Common.Logic.CurrentLogic.Conditions.Add(timeConditionsInfo);//娣诲姞鏉′欢
Common.Logic.CurrentLogic.Actions.Add(actionsInfo);//娣诲姞鐩爣
var oneLogic = new OneLogic();
UserView.HomePage.Instance.AddChidren(oneLogic);
UserView.HomePage.Instance.PageIndex += 1;
oneLogic.Show(false);
- } break;
+ }
+ break;
}
}
@@ -180,8 +180,8 @@
X = Application.GetRealWidth(58),
Y = scenehorizontalScrol.Bottom,
};
- functionSceneAutoBodyView.AddChidren(logicScrolView);
-
+ functionSceneAutoBodyView.AddChidren(logicScrolView);
+
logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
bool no = false;
//鏄剧ず榛樿妯℃澘鐨勭晫闈簨浠�
@@ -286,10 +286,10 @@
Read(logicScrolView, no);
//鍏抽棴鍒锋柊View锛�
logicScrolView.EndHeaderRefreshing();
- };
-
- //鑷姩鍖�
- Read(logicScrolView, no);
+ };
+
+ //鑷姩鍖�
+ Read(logicScrolView, no);
}
/// <summary>
@@ -299,36 +299,43 @@
private static async void Read(VerticalRefreshLayout logicScrolView, bool no)
{
CommonPage.Loading.Start();
- if (Common.Logic.LogicList.Count == 0)
+ try
{
- var Idlist1 = await Send.GetLogicId(0);//
- var Idlist2 = await Send.GetLogicId(2);//闂ㄩ攣甯稿紑妯″紡
- if (Idlist1.Count != 0)
+ if (Common.Logic.LogicList.Count == 0)
{
- var listlogic1 = await Send.ReadList(Idlist1.Count, 0);
- for (int j = 0; j < listlogic1.Count; j++)
+ var Idlist1 = await Send.GetLogicId(0);//
+ var Idlist2 = await Send.GetLogicId(2);//闂ㄩ攣甯稿紑妯″紡
+ if (Idlist1.Count != 0)
{
- var logic = listlogic1[j];
- if (logic.LogicType != 0)
+ var listlogic1 = await Send.ReadList(Idlist1.Count, 0);
+ for (int j = 0; j < listlogic1.Count; j++)
{
- continue;
+ var logic = listlogic1[j];
+ if (logic.LogicType != 0)
+ {
+ continue;
+ }
+ Common.Logic.LogicList.Add(logic);
}
- Common.Logic.LogicList.Add(logic);
+ }
+ if (Idlist2.Count != 0)
+ {
+ var listlogic2 = await Send.ReadList(Idlist2.Count, 2);
+ for (int j = 0; j < listlogic2.Count; j++)
+ {
+ var logic = listlogic2[j];
+ if (logic.LogicType != 2)
+ {
+ continue;
+ }
+ Common.Logic.LogicList.Add(logic);
+ }
}
}
- if (Idlist2.Count != 0)
- {
- var listlogic2 = await Send.ReadList(Idlist2.Count, 2);
- for (int j = 0; j < listlogic2.Count; j++)
- {
- var logic = listlogic2[j];
- if (logic.LogicType != 2)
- {
- continue;
- }
- Common.Logic.LogicList.Add(logic);
- }
- }
+ }
+ catch (Exception e)
+ {
+ var dd = e.Message;
}
//鑷姩鍖�
Automationview(logicScrolView, no);
@@ -347,7 +354,7 @@
refresview.BackgroundColor = 0x00000000;
var noFrameLayout = new FrameLayout
{
- Height = Application.GetRealHeight(434 + 200 + 32 + 294-55),
+ Height = Application.GetRealHeight(434 + 200 + 32 + 294 - 55),
//BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
refresview.AddChidren(noFrameLayout);
@@ -355,7 +362,7 @@
var noIconBtn = new Button
{
- Y = Application.GetRealHeight(294-55),
+ Y = Application.GetRealHeight(294 - 55),
Width = Application.GetMinRealAverage(756),
Height = Application.GetMinRealAverage(434),
UnSelectedImagePath = "Item/NoFunction.png",
@@ -394,7 +401,7 @@
int i = 1;//灞�閮ㄥ彉閲忥紝榛樿鏄涓�鏉¢�昏緫;
foreach (var logic in Common.Logic.LogicList)
{
-
+
var fLayout = new FrameLayout
{
Height = Application.GetRealHeight(190 + 30),
@@ -402,7 +409,7 @@
BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
};
refresview.AddChidren(fLayout);
-
+
var logicRowlayout = new RowLayout
{
Height = Application.GetRealHeight(190 + 30),
@@ -419,8 +426,8 @@
fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
i = 2;
- }
-
+ }
+
var logicnameBtn = new Button
{
Height = Application.GetRealHeight(58),
@@ -461,7 +468,7 @@
logic.IsEnable = 0;
StatusColor(logic, logicRowlayout, 0);
}
- Send.LogicControlSwitch(logic);
+ Send.LogicControlSwitch(logic);
//Logic.Send.AddModifyLogic(logic);
};
if (logic.IsEnable == 1)
@@ -482,8 +489,9 @@
TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
};
logicRowlayout.AddRightView(edit);
- if (logic.LogicType==2) {
- edit.TextID=MyInternationalizationString.look;
+ if (logic.LogicType == 2)
+ {
+ edit.TextID = MyInternationalizationString.look;
}
edit.MouseUpEventHandler += (sender, e) =>
{
@@ -534,7 +542,9 @@
Width = Application.GetRealWidth(1080 - 58),
BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
- fLayout.AddChidren(line);
+ fLayout.AddChidren(line);
+
+
}
}
@@ -572,9 +582,9 @@
{
indexlist.Add(linkType);
}
- }
- //鎺掑垪鍥炬爣椤哄簭;
- if (indexlist.Contains("0")|| indexlist.Contains("8"))
+ }
+ //鎺掑垪鍥炬爣椤哄簭;
+ if (indexlist.Contains("0") || indexlist.Contains("8"))
{
iconIndexlist.Add("0");
}
@@ -702,10 +712,10 @@
/// <param name="timeVlaue">鏃堕棿鍊�</param>
/// <param name="common">璁惧</param>
/// <returns></returns>
- public static void LockAddModifyLogic(int timeVlaue, CommonDevice common)
+ public static async System.Threading.Tasks.Task<bool> LockAddModifyLogic(int timeVlaue, CommonDevice common)
{
//璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
- var h = DateTime.Now.ToString("hh");
+ var h = DateTime.Now.ToString("HH");
var m = DateTime.Now.ToString("mm");
Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>();
timeConditionsInfo.Add("Type", "0");
@@ -730,28 +740,49 @@
currentLogic.LogicName = Language.StringByID(R.MyInternationalizationString.openmode);
currentLogic.Conditions.Add(timeConditionsInfo);
currentLogic.Actions.Add(actionsInfo);
- Exist(3);//鏌ユ壘鏄惁瀛樺湪璁剧疆杩囧け鏁堟椂闂�(鏈夌殑璇濆垹闄わ紝鍐嶆坊鍔�)
- Send.AddModifyLogic(currentLogic);
+ Exist(3);//鏌ユ壘鏄惁瀛樺湪璁剧疆杩囧け鏁堟椂闂�(鏈夌殑璇濆垹闄わ紝鍐嶆坊鍔�)
+ var logicIfon = await Send.AddModifyLogic(currentLogic);
+ if (logicIfon != null && logicIfon.LogicId != 0)
+ {
+ //娣诲姞闂ㄩ攣澶辨晥鏃堕棿鐨勫巻鍙茶褰�
+ UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString());
+ return true;//琛ㄧず娣诲姞鎴愬姛;
+ }
+ return false;//琛ㄧず娣诲姞澶辫触;
}
///<summary>
- /// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶(true涓哄瓨鍦�)
- /// </summary>
- public static async System.Threading.Tasks.Task<bool> Exist(int valueInt=2)
+ /// 娉ㄦ剰锛堝弬鏁�2锛�3锛夛細valueInt=3鏄垹闄よ缃け鏁堟椂闂磋嚜鍔ㄥ寲锛泇alueInt=2鍒ゆ柇鏄惁瀛樺湪鑷姩鍖栵紱
+ /// 杩斿洖鍊硷細0涓嶅瓨鍦�;1瀛樺湪;2鍒犻櫎鎴愬姛;3鍒犻櫎澶辫触;
+ /// </summary>
+ public static async System.Threading.Tasks.Task<int> Exist(int valueInt = 2)
{
- bool exist = false;
+ int exist = 0;
var Idlist = await Send.GetLogicId(valueInt);
if (Idlist.Count != 0)
{
- if (valueInt==3) {
+ if (valueInt == 3)
+ {
for (int i = 0; i < Idlist.Count; i++)
{
//valueInt=3涓�鏉$壒娈婄殑鑷姩鍖�(鐢ㄦ潵璁剧疆澶辨晥鏃堕棿)
- Send.DelLogic(Idlist[i]);
+ var d = await Send.DelLogic(Idlist[i]);
+ if (d != 0)
+ {
+ //鍒犻櫎鎴愬姛
+ exist = 2;
+ }
+ else
+ {
+ //鍒犻櫎澶辫触
+ exist = 3;
+ }
+ return exist;
+
}
}
- exist = true;
+ exist = 1;
}
return exist;
}
@@ -762,8 +793,8 @@
public static async void LockCloseLogic(CommonDevice common)
{
//璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
- int h =int.Parse(DateTime.Now.ToString("hh"));
- int m= int.Parse(DateTime.Now.ToString("mm"));
+ int h = int.Parse(DateTime.Now.ToString("HH"));
+ int m = int.Parse(DateTime.Now.ToString("mm"));
//杞寲涓哄灏戝垎閽�;
int s = h * 60 + m;
var logicList = new List<Common.Logic>();
@@ -786,14 +817,14 @@
int stopHour = int.Parse(conditions["StopHour"]);
int s1 = startMin + startHour * 60;//寮�濮嬫椂闂村��
int s2 = stopMin + stopHour * 60;//缁撴潫鏃堕棿鍊�
- if (s >= s1&&s<=s2)
- {
- //鏌ユ壘绯荤粺鏃堕棿鍊兼槸鍚﹀睘浜庤繖涓寖鍥达紱
+ if (s >= s1 && s <= s2)
+ {
+ //鏌ユ壘绯荤粺鏃堕棿鍊兼槸鍚﹀睘浜庤繖涓寖鍥达紱
logicList.Add(logic);
}
}
- }
-
+ }
+
}
}
foreach (var logic in logicList)
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Logic/TimePage.cs b/ZigbeeApp20200414/Shared/Phone/Device/Logic/TimePage.cs
index a679593..f0f6be9 100755
--- a/ZigbeeApp20200414/Shared/Phone/Device/Logic/TimePage.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Device/Logic/TimePage.cs
@@ -19,7 +19,7 @@
public string str1;
Dictionary<string, string> timeBucketConditionsInfo = new Dictionary<string, string>();
- public void Show(bool _if=false)
+ public void Show()
{
#region 涓婇潰鐨勫竷灞�浠g爜
@@ -33,7 +33,7 @@
var middle = new FrameLayout
{
Y = view.topRowLayout.Bottom,
- Height = Application.GetRealHeight(1920 - 184-260),
+ Height = Application.GetRealHeight(1920 - 184 - 260),
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
this.AddChidren(middle);
@@ -50,7 +50,7 @@
TypeView typeView = new TypeView();
middle.AddChidren(typeView.Show());
typeView.textBtn.TextID = MyInternationalizationString.type;
- typeView.titleBtn.Width = Application.GetRealWidth(630+70);
+ typeView.titleBtn.Width = Application.GetRealWidth(630 + 70);
typeView.titleBtn.TextID = MyInternationalizationString.timeframe;
typeView.backBtn.Visible = false;
@@ -82,18 +82,18 @@
{
if (str1 != null)
{
-
+
string[] timestr = str1.Split('-');
string[] starttime = timestr[0].Split(':');
string[] endtime = timestr[1].Split(':');
string s1 = "", s2 = "";
if (starttime[1].Length < 2)
{
- s1 = "0" + starttime[1];
+ s1 = "0" + starttime[1];
}
else
{
- s1 = starttime[1];
+ s1 = starttime[1];
}
if (endtime[1].Length < 2)
{
@@ -104,7 +104,7 @@
s2 = endtime[1];
}
startView.titleBtn.Text = starttime[0] + ":" + s1;
- endView.titleBtn.Text =endtime[0] + ":" + s2;
+ endView.titleBtn.Text = endtime[0] + ":" + s2;
//btnstarttime.Text = timestr[0];
//btnendtime.Text = timestr[1];
@@ -148,7 +148,7 @@
{
Y = Application.GetRealHeight(1920 - 600),
Height = Application.GetRealHeight(600),
- BackgroundColor =ZigbeeColor.Current.LogicTimeViewColor,
+ BackgroundColor = ZigbeeColor.Current.LogicTimeViewColor,
Width = Application.GetRealWidth(1080),
};
flMain.AddChidren(timeview);
@@ -161,7 +161,7 @@
Height = Application.GetRealHeight(150),
Text = Language.StringByID(MyInternationalizationString.complete),
// TextColor = 0xFF121212,
- TextColor =ZigbeeColor.Current.LogicTimeViewSaveButton,
+ TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton,
//TextAlignment = TextAlignment.CenterRight
X = Application.GetRealWidth(1080 - 200),
};
@@ -173,9 +173,9 @@
var startval = timeview.Hour * 60 + timeview.Minute;
- if (endView.titleBtn.Tag.ToString() != "0" && startval.ToString()== endView.titleBtn.Tag.ToString())
+ if (endView.titleBtn.Tag.ToString() != "0" && startval.ToString() == endView.titleBtn.Tag.ToString())
{
-
+
var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
Language.StringByID(MyInternationalizationString.nottime),
Language.StringByID(MyInternationalizationString.confrim));
@@ -184,7 +184,7 @@
}
if (endView.titleBtn.Tag.ToString() != "0" && startval > int.Parse(endView.titleBtn.Tag.ToString()))
{
-
+
var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
Language.StringByID(MyInternationalizationString.timesetting),
Language.StringByID(MyInternationalizationString.confrim));
@@ -202,155 +202,146 @@
startView.titleBtn.Tag = timeview.Hour * 60 + timeview.Minute;
timeBucketConditionsInfo.Add("StartHour", timeview.Hour.ToString());
timeBucketConditionsInfo.Add("StartMin", timeview.Minute.ToString());
- startView.titleBtn.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2?"0"+timeview.Minute.ToString():timeview.Minute.ToString());
+ startView.titleBtn.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2 ? "0" + timeview.Minute.ToString() : timeview.Minute.ToString());
};
};
- endView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
- {
+ endView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
- var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
- AddChidren(flMain);
- flMain.MouseUpEventHandler += (sender11, e11) =>
- {
- flMain.RemoveFromParent();
- };
+ var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
+ AddChidren(flMain);
+ flMain.MouseUpEventHandler += (sender11, e11) =>
+ {
+ flMain.RemoveFromParent();
+ };
- var timeview = new TimeView
- {
- Y = Application.GetRealHeight(1920 - 600),
- Height = Application.GetRealHeight(600),
- BackgroundColor =ZigbeeColor.Current.LogicTimeViewColor,
- Width = Application.GetRealWidth(1080),
- };
- flMain.AddChidren(timeview);
+ var timeview = new TimeView
+ {
+ Y = Application.GetRealHeight(1920 - 600),
+ Height = Application.GetRealHeight(600),
+ BackgroundColor = ZigbeeColor.Current.LogicTimeViewColor,
+ Width = Application.GetRealWidth(1080),
+ };
+ flMain.AddChidren(timeview);
- var btnSave = new Button
- {
- Y = Application.GetRealHeight(1920 - 600),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(150),
- Text = Language.StringByID(MyInternationalizationString.complete),
+ var btnSave = new Button
+ {
+ Y = Application.GetRealHeight(1920 - 600),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(150),
+ Text = Language.StringByID(MyInternationalizationString.complete),
//TextColor = 0xFF121212,
- TextColor =ZigbeeColor.Current.LogicTimeViewSaveButton,
+ TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton,
//TextAlignment = TextAlignment.CenterRight
X = Application.GetRealWidth(1080 - 200),
- };
- flMain.AddChidren(btnSave);
+ };
+ flMain.AddChidren(btnSave);
- btnSave.MouseUpEventHandler += (sender2, e2) =>
- {
- flMain.RemoveFromParent();
+ btnSave.MouseUpEventHandler += (sender2, e2) =>
+ {
+ flMain.RemoveFromParent();
- var endval = timeview.Hour * 60 + timeview.Minute;
+ var endval = timeview.Hour * 60 + timeview.Minute;
- if (startView.titleBtn.Tag.ToString() != "0" && endval.ToString() == startView.titleBtn.Tag.ToString())
- {
-
- var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
- Language.StringByID(MyInternationalizationString.nottime),
- Language.StringByID(MyInternationalizationString.confrim));
- alert.Show();
- return;
- }
- if (startView.titleBtn.Tag.ToString() != "0" && endval < int.Parse(startView.titleBtn.Tag.ToString()))
- {
-
- var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
- Language.StringByID(MyInternationalizationString.timesetting),
- Language.StringByID(MyInternationalizationString.confrim));
- alert.Show();
- return;
- }
-
- if (timeBucketConditionsInfo.ContainsKey("StopHour"))
- {
- timeBucketConditionsInfo.Remove("StopHour");
- }
- if (timeBucketConditionsInfo.ContainsKey("StopMin"))
- {
- timeBucketConditionsInfo.Remove("StopMin");
- }
- endView.titleBtn.Tag = timeview.Hour * 60 + timeview.Minute;
- timeBucketConditionsInfo.Add("StopHour",timeview.Hour.ToString());
- timeBucketConditionsInfo.Add("StopMin", timeview.Minute.ToString());
- endView.titleBtn.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2?"0"+timeview.Minute.ToString():timeview.Minute.ToString());
- };
- };
-
+ if (startView.titleBtn.Tag.ToString() != "0" && endval.ToString() == startView.titleBtn.Tag.ToString())
+ {
+
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.nottime),
+ Language.StringByID(MyInternationalizationString.confrim));
+ alert.Show();
+ return;
+ }
+ if (startView.titleBtn.Tag.ToString() != "0" && endval < int.Parse(startView.titleBtn.Tag.ToString()))
+ {
+
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.timesetting),
+ Language.StringByID(MyInternationalizationString.confrim));
+ alert.Show();
+ return;
+ }
+
+ if (timeBucketConditionsInfo.ContainsKey("StopHour"))
+ {
+ timeBucketConditionsInfo.Remove("StopHour");
+ }
+ if (timeBucketConditionsInfo.ContainsKey("StopMin"))
+ {
+ timeBucketConditionsInfo.Remove("StopMin");
+ }
+ endView.titleBtn.Tag = timeview.Hour * 60 + timeview.Minute;
+ timeBucketConditionsInfo.Add("StopHour", timeview.Hour.ToString());
+ timeBucketConditionsInfo.Add("StopMin", timeview.Minute.ToString());
+ endView.titleBtn.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2 ? "0" + timeview.Minute.ToString() : timeview.Minute.ToString());
+ };
+ };
+
///瀹屾垚鐐瑰嚮浜嬩欢
- saveView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
- {
- if (timeBucketConditionsInfo.ContainsKey("Type"))
- {
- timeBucketConditionsInfo.Remove("Type");
- }
- if (timeBucketConditionsInfo.ContainsKey("IsValid"))
- {
- timeBucketConditionsInfo.Remove("IsValid");
- }
- timeBucketConditionsInfo.Add("Type", "5");
- timeBucketConditionsInfo.Add("IsValid", "1");
+ saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ if (timeBucketConditionsInfo.ContainsKey("Type"))
+ {
+ timeBucketConditionsInfo.Remove("Type");
+ }
+ if (timeBucketConditionsInfo.ContainsKey("IsValid"))
+ {
+ timeBucketConditionsInfo.Remove("IsValid");
+ }
+ timeBucketConditionsInfo.Add("Type", "5");
+ timeBucketConditionsInfo.Add("IsValid", "1");
- if (string.IsNullOrEmpty(startView.titleBtn.Text) || string.IsNullOrEmpty(endView.titleBtn.Text))
- {
- var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
- Language.StringByID(MyInternationalizationString.completeNext),
- Language.StringByID(MyInternationalizationString.confrim));
- alert.Show();
- return;
- }
- if (startView.titleBtn.Text == endView.titleBtn.Text)
- {
- var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
- Language.StringByID(MyInternationalizationString.sametime),
- Language.StringByID(MyInternationalizationString.confrim));
- alert.Show();
- return;
- }
+ if (string.IsNullOrEmpty(startView.titleBtn.Text) || string.IsNullOrEmpty(endView.titleBtn.Text))
+ {
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.completeNext),
+ Language.StringByID(MyInternationalizationString.confrim));
+ alert.Show();
+ return;
+ }
+ if (startView.titleBtn.Text == endView.titleBtn.Text)
+ {
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.sametime),
+ Language.StringByID(MyInternationalizationString.confrim));
+ alert.Show();
+ return;
+ }
- if (IsEditor)
- {
- for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++)
- {
- if (Common.Logic.CurrentLogic.Conditions[i]["Type"] == "5")
- {
+ if (IsEditor)
+ {
+ for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++)
+ {
+ if (Common.Logic.CurrentLogic.Conditions[i]["Type"] == "5")
+ {
- var timeBucketInfo = Common.Logic.CurrentLogic.Conditions[i];
- var s = timeBucketInfo["StartHour"] + ":" + timeBucketInfo["StartMin"] + "-" + timeBucketInfo["StopHour"] + ":" + timeBucketInfo["StopMin"];
- if (str1 == s)
- {
- Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
- Common.Logic.CurrentLogic.Conditions.Insert(i, timeBucketConditionsInfo);
- }
+ var timeBucketInfo = Common.Logic.CurrentLogic.Conditions[i];
+ var s = timeBucketInfo["StartHour"] + ":" + timeBucketInfo["StartMin"] + "-" + timeBucketInfo["StopHour"] + ":" + timeBucketInfo["StopMin"];
+ if (str1 == s)
+ {
+ Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
+ Common.Logic.CurrentLogic.Conditions.Insert(i, timeBucketConditionsInfo);
+ }
- }
- }
- }
- else
- {
- Common.Logic.CurrentLogic.Conditions.Add(timeBucketConditionsInfo);
- }
+ }
+ }
+ }
+ else
+ {
+ Common.Logic.CurrentLogic.Conditions.Add(timeBucketConditionsInfo);
+ }
//LogicIfon.logicIfon.Addconditions(timeBucketConditionsInfo,timeBucketConditionsInfo.Type);
- if (_if) {
- //璺冲埌S-one闂ㄩ攣
- var oneLogic = new OneLogic { };
- UserView.HomePage.Instance.AddChidren(oneLogic);
- UserView.HomePage.Instance.PageIndex += 1;
- oneLogic.Show(false);
- }
- else
- {
- var logicCommunalPage = new LogicCommunalPage { };
- UserView.HomePage.Instance.AddChidren(logicCommunalPage);
- UserView.HomePage.Instance.PageIndex += 1;
- logicCommunalPage.Show(() => { });
- }
- };
+ var logicCommunalPage = new LogicCommunalPage { };
+ UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ logicCommunalPage.Show(() => { });
+
+ };
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs b/ZigbeeApp20200414/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
deleted file mode 100755
index c79d6fc..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.Room
-{
- public class AddRoomSelectPicByLocal:FrameLayout
- {
- public Action<string> action;
- public AddRoomSelectPicByLocal()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
- public override void RemoveFromParent()
- {
- base.RemoveFromParent();
- }
- public void Show()
- {
- ShowPic();
- }
- void ShowPic()
- {
- #region topview
- var topBGView = new FrameLayout()鈥� {鈥� Height = Application.GetRealHeight(CommonPage.Navigation_Height),鈥� BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor鈥� };鈥� AddChidren(topBGView);鈥� var topView = new FrameLayout()鈥� {鈥� Y = Application.GetRealHeight(CommonPage.NavigationTitle_Y),鈥� Height = Application.GetRealHeight(CommonPage.Navigation_Height - CommonPage.NavigationTitle_Y),鈥� BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor,鈥� };鈥� AddChidren(topView);
-
- var title = new Button()
- {
- TextAlignment = TextAlignment.Center,
- //TextID = R.MyInternationalizationString.SelectPic,
- TextSize = 20,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- Width = Application.GetRealWidth(500),
- Gravity = Gravity.CenterHorizontal
- };
- topView.AddChidren(title);
-
- var back = new UserCenter.BackViewControl();鈥� topView.AddChidren(back);
- back.InitControl();
-
- back.ButtonClickEvent += (sender, e) =>
- {
- this.RemoveFromParent();
- };
- #endregion
-
- #region midFL
- var midFl = new VerticalScrolViewLayout()
- {
- Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.Navigation_Height),
- Y = topView.Bottom,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- };
- this.AddChidren(midFl);
-
- int k = 0;
- for (int j = 0; j < 11; j++)
- {
- var itemView = new FrameLayout()
- {
- Height = Application.GetRealHeight(311 + 58)
- };
- midFl.AddChidren(itemView);
- for (int i = 0; i < 2; i++)
- {
- var icon = new ImageView()
- {
- X = Application.GetRealWidth(58 + i * (467 + 32)),
- Y = Application.GetRealHeight(58),
- Width = Application.GetRealWidth(467),
- Height = Application.GetRealHeight(311),
- ImagePath = $"RoomIcon/{k}.jpg",
- Radius = (uint)Application.GetRealHeight(17)
- };
- itemView.AddChidren(icon);
- icon.SetViewShadow(true);
- k++;
-
- EventHandler<MouseEventArgs> selectIcon = (sender, e) =>
- {
- action?.Invoke(icon.ImagePath);
- action = null;
- this.RemoveFromParent();
- };
- icon.MouseUpEventHandler += selectIcon;
- }
- }
-
- #endregion
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Room/EditRoom.cs b/ZigbeeApp20200414/Shared/Phone/Device/Room/EditRoom.cs
deleted file mode 100755
index 1a22030..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Room/EditRoom.cs
+++ /dev/null
@@ -1,588 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Globalization;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserCenter;
-using Shared.Phone.UserView;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Room
-{
- public class EditRoom : FrameLayout, ZigBee.Common.IStatus
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
-
- /// <summary>
- /// The room.
- /// </summary>
- public Shared.Common.Room room;
-
- /// <summary>
- /// The action.
- /// </summary>
- public Action action;
-
- /// <summary>
- /// backGround
- /// </summary>
- private ImageView backGround;
- /// <summary>
- /// IconPathType
- /// </summary>
- public int IconPathType;
- /// <summary>
- /// OldBackgroundImagePath
- /// </summary>
- private string OldBackgroundImagePath;
-
- /// <summary>
- /// OldIconPathType
- /// </summary>
- public int OldIconPathType;
-
- public CommonDevice temperDevice;
-
- public CommonDevice humidDevice;
-
- DeviceInfoRow temperatureRow;
-
- DeviceInfoRow humidityRow;
-
- #endregion
-
- #region 鈼� 鎺ュ彛__________________________
-
- /// <summary>
- /// 璁惧鐘舵�佹洿鏂版帴鍙�
- /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:RemoveDeviceRespon</para>
- /// <para>type锛氬鏋滀负 DeviceStatusReport:璁惧涓婃姤</para>
- /// <para>type锛氬鏋滀负 IASInfoReport:IAS瀹夐槻淇℃伅涓婃姤</para>
- /// <para>type锛氬鏋滀负 OnlineStatusChange: 璁惧鍦ㄧ嚎鐘舵�佹洿鏂�</para>
- /// </summary>
- /// <param name="common">Common.</param>
- /// <param name="typeTag">Type tag.</param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- if (typeTag == "DeviceStatusReport")
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- if (common.DeviceStatusReport.AttriBute == null || common.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- //鏄惁涓哄綋鍓嶈澶�
- if ((temperDevice?.DeviceEpoint != common.DeviceEpoint || temperDevice?.DeviceAddr != common.DeviceAddr) && (humidDevice?.DeviceEpoint != common.DeviceEpoint || humidDevice?.DeviceAddr != common.DeviceAddr))
- {
- return;
- }
-
- //if (common.Type == DeviceType.TemperatureSensor)
- //{
- if (common.DeviceStatusReport.CluterID == 1026)
- {
- foreach (var data in common.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- //0鈩�
- temperatureRow.NameText.Text = "--鈩�";
- room.Temperatrue = 0;
- }
- else if (data.AttriButeData > 32767)
- {
- //璐熸暟(鐗规畩澶勭悊)
- string strValue = (data.AttriButeData - 65536).ToString();
- //灏忔暟鐐归渶瑕佷竴浣�
- strValue = strValue.Substring(0, strValue.Length - 1);
- temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
- room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
- room.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- }
- }
- }
- else if (common.DeviceStatusReport.CluterID == 1029)
- {
- foreach (var data in common.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- //0
- humidityRow.NameText.Text = "--%";
- room.Humidity = 0;
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%";
- room.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- }
- }
- }
- //}
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"Error:{ex.Message}");
- }
- });
- }
- }
- #endregion
-
-
-
- public EditRoom()
- {
- ZbGateway.StatusList.Add(this);
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- /// <summary>
- /// Show this instance.
- /// </summary>
- public void Show(Shared.Common.Room r)
- {
- room = r;
- IconPathType = r.BackgroundImageType;
- OldIconPathType = r.BackgroundImageType;
- if (IconPathType != 0)
- {
- OldBackgroundImagePath = r.BackgroundImage;
- }
- AddTop();
-
- AddBodyView();
-
- }
-
- public override void RemoveFromParent()
- {
- ZbGateway.StatusList.Remove(this);
- CommonPage.Instance.IsDrawerLockMode = false;
- base.RemoveFromParent();
- }
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.EditRoom);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- var backGround1 = new ImageView()
- {
- Y = Application.GetRealHeight(60),
- Width = Application.GetMinRealAverage(916),
- Height = Application.GetMinRealAverage(487),
- Gravity = Gravity.CenterHorizontal,
- ImagePath = "Room/Room_Rectangle.png"
- };
- bodyFrameLayout.AddChidren(backGround1);
-
- backGround = new ImageView()
- {
- Y = Application.GetRealHeight(60),
- Width = Application.GetMinRealAverage(887),
- Height = Application.GetMinRealAverage(444),
- Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius),
- ImagePath = room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage)
- };
- bodyFrameLayout.AddChidren(backGround);
-
- if (room.BackgroundImageType != 0)
- {
- backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(backGround.ImagePath);
- }
- backGround.MouseUpEventHandler += backGroundIMGHander;
-
- var infoFL = new FrameLayout
- {
- Y = Application.GetRealHeight(562),
- Height = Application.GetRealHeight(1175),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- bodyFrameLayout.AddChidren(infoFL);
- var rectCornerID = HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight;
- infoFL.SetCornerWithSameRadius(Application.GetRealHeight(50), rectCornerID);
-
- var infoEdit = new Button
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Application.GetRealHeight(80),
- Height = Application.GetRealHeight(60),
- Width = Application.GetRealWidth(700),
- TextID = R.MyInternationalizationString.EditInfo,
- TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = 15
- };
- infoFL.AddChidren(infoEdit);
-
- var nameRow = new DeviceInfoEditRow(170);
- nameRow.Init();
- nameRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.RoomName)} :");
- nameRow.SetTitle(room.Name);
- infoFL.AddChidren(nameRow);
- if (room.IsLove)
- {
- nameRow.NameText.Enable = false;
- }
-
- var floorRow = new DeviceInfoRow(308);
- floorRow.Init();
- floorRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongFloor)} :");
- if (Config.Instance.Home.FloorDics.Count > 0 && room.IsLove == false)
- {
- infoFL.AddChidren(floorRow);
- }
- floorRow.SetTitle(HdlResidenceLogic.Current.GetFloorNameById(room.FloorId));
- floorRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
- {
- if (Config.Instance.Home.FloorDics != null)
- {
- List<string> floorIds = new List<string> { };
- List<string> floorNames = new List<string> { };
- foreach (var floor in Config.Instance.Home.FloorDics)
- {
- floorIds.Add(floor.Key);
- floorNames.Add(floor.Value);
- }
-
- PickerView.Show(floorNames, (index) =>
- {
- room.FloorId = floorIds[index];
- floorRow.SetTitle(HdlResidenceLogic.Current.GetFloorNameById(room.FloorId));
- }, floorIds.IndexOf(room.FloorId), Language.StringByID(R.MyInternationalizationString.BelongFloor), Language.StringByID(R.MyInternationalizationString.Confrim), Language.StringByID(R.MyInternationalizationString.Cancel));
- }
- };
-
-
- temperatureRow = new DeviceInfoRow(446);
- temperatureRow.Init();
- temperatureRow.SetTipTitle(R.MyInternationalizationString.Temperature);
- temperatureRow.NameText.TextAlignment = TextAlignment.CenterRight;
- infoFL.AddChidren(temperatureRow);
- temperatureRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
- {
- var tem = new RoomTemperatureSetting { };
- HomePage.Instance.AddChidren(tem);
- HomePage.Instance.PageIndex += 1;
- tem.tempDevice = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
- tem.Show(room);
- tem.selectDeviceAction = (selectTemp) =>
- {
- if (selectTemp == null)
- {
- return;
- }
- room.TemperatrueDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
- temperDevice=Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
- temperatureRow.SetTitle(R.MyInternationalizationString.Getting);
- //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护
- ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(selectTemp);
- };
- };
- if (string.IsNullOrEmpty(room.TemperatrueDevice) == false)
- {
- temperatureRow.SetTitle(room.Temperatrue == 0 ? "--鈩�" : $"{room.Temperatrue}鈩�");
- //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护
- temperDevice = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
- ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(temperDevice);
- }
- else
- {
- temperatureRow.SetTitle(R.MyInternationalizationString.No);
- }
-
-
- humidityRow = new DeviceInfoRow(585);
- humidityRow.Init();
- humidityRow.SetTipTitle(R.MyInternationalizationString.Humidity);
- humidityRow.NameText.TextAlignment = TextAlignment.CenterRight;
- infoFL.AddChidren(humidityRow);
- humidityRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
- {
- var tem = new RoomHumiditySetting { };
- HomePage.Instance.AddChidren(tem);
- HomePage.Instance.PageIndex += 1;
- tem.tempDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
- tem.Show(room);
- tem.selectDeviceAction = (selectTemp) =>
- {
- if (selectTemp == null)
- {
- return;
- }
- room.HumidityDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
- humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
- humidityRow.SetTitle(R.MyInternationalizationString.Getting);
-
- //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护
- ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(selectTemp);
- };
- };
- if (string.IsNullOrEmpty(room.HumidityDevice) == false)
- {
- humidityRow.SetTitle(room.Humidity == 0 ? "--%" : $"{room.Humidity}%");
- //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护
- humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
- ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(humidDevice);
- }
- else
- {
- humidityRow.SetTitle(R.MyInternationalizationString.No);
- }
-
- if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove)
- {
- temperatureRow.Y = Application.GetRealHeight(308);
- humidityRow.Y = Application.GetRealHeight(446);
- }
-
- var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127);
- confirm.SetTitle(R.MyInternationalizationString.Save);
- AddChidren(confirm);
- confirm.MouseUpEventHandler += (sender, e) =>
- {
- var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
- var fileName = $"RoomIcon_{tradeTime}.png";
- room.Name = nameRow.NameText.Text.Trim();
- if (OldIconPathType != 0)
- {
- Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
- HdlAutoBackupLogic.DeleteFile(OldBackgroundImagePath);
- }
- if (IconPathType == 0)
- {
- room.BackgroundImage = backGround.ImagePath;
- }
- else
- {
- Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
- HdlAutoBackupLogic.AddOrEditorFile(fileName);
- room.BackgroundImage = fileName;
- }
- room.BackgroundImageType = IconPathType;
- room.Save();
- action?.Invoke();
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// 閫夋嫨鑳屾櫙鍥�
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void backGroundIMGHander(object sender, MouseEventArgs e)
- {
- if (room != null && room.IsSharedRoom)
- {
- RoomCommon.ShowTipRoomIsShared();
- return;
- }
-
- int selectRow_Height = 150;
- int selectRow_Width = 1034;
- var selectFL = new FrameLayout()
- {
- BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
- };
- AddChidren(selectFL);
-
- var itemFL = new FrameLayout()
- {
- Y = Application.GetRealHeight(1276),
- Height = Application.GetRealHeight(450),
- Width = Application.GetRealWidth(selectRow_Width),
- Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetRealHeight(35),
- BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor
- };
- selectFL.AddChidren(itemFL);
- //itemFL.Animate = Animate.DownToUp;
-
- var selectLocalPicture = new Button()
- {
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.LocalPicture,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectLocalPicture);
- var selectLocalLine = new Button()
- {
- Y = selectLocalPicture.Bottom,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
- };
- itemFL.AddChidren(selectLocalLine);
-
- var selectPhotographBtn = new Button()
- {
- Y = selectLocalLine.Bottom,
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.Photograph,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectPhotographBtn);
- var selectPhotographLine = new Button()
- {
- Y = selectPhotographBtn.Bottom,
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- itemFL.AddChidren(selectPhotographLine);
-
- var selectAblumsBtn = new Button()
- {
- Y = selectPhotographLine.Bottom,
- Height = Application.GetRealHeight(selectRow_Height) - 1,
- TextID = R.MyInternationalizationString.MyAblums,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- TextSize = 17
- };
- itemFL.AddChidren(selectAblumsBtn);
-
- var cancelBtn = new Button()
- {
- Y = Application.GetRealHeight(1742),
- Height = Application.GetRealHeight(selectRow_Height),
- Width = Application.GetRealWidth(selectRow_Width),
- Gravity = Gravity.CenterHorizontal,
- TextID = R.MyInternationalizationString.Cancel,
- TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
- BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor,
- Radius = (uint)Application.GetRealHeight(35),
- TextSize = 17
- };
- selectFL.AddChidren(cancelBtn);
-
- selectLocalPicture.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var localPic = new AddRoomSelectPicByLocal();
- Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- localPic.Show();
- localPic.action = (imgPath) =>
- {
- IconPathType = 0;
- backGround.ImageBytes = null;
- backGround.ImagePath = imgPath;
- };
- };
- selectPhotographBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
- var fileName = $"RoomIcon_{tradeTime}.png";
- //閫氳繃鐩告満鎷嶇収瑁佸壀
- CropImage.TakePicture((imagePath) =>
- {
- if (string.IsNullOrEmpty(imagePath))
- {
- return;
- }
- if (IconPathType != 0)
- {
- Global.DeleteFilebyHomeId(backGround.ImagePath);
- }
-
- IconPathType = 1;
- backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
- backGround.ImagePath = imagePath;
- System.IO.File.Delete(imagePath);
-
- }, fileName, 2, 1);
- };
-
- selectAblumsBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
- var fileName = $"RoomIcon_{tradeTime}.png";
- //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
- CropImage.SelectPicture((imagePath) =>
- {
- if (string.IsNullOrEmpty(imagePath))
- {
- return;
- }
- if (IconPathType != 0)
- {
- Global.DeleteFilebyHomeId(backGround.ImagePath);
- }
-
- IconPathType = 2;
- backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
- backGround.ImagePath = imagePath;
- System.IO.File.Delete(imagePath);
-
- }, fileName, 2, 1);
- };
-
- cancelBtn.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- };
- selectFL.MouseUpEventHandler += (send, ee) =>
- {
- selectFL.RemoveFromParent();
- };
- }
-
- #endregion
-
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomCommon.cs b/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomCommon.cs
deleted file mode 100755
index 6980b22..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomCommon.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-锘縰sing System;
-using Shared.Phone.Device.CommonForm;
-
-namespace Shared.Phone.Device.Room
-{
- public class RoomCommon
- {
- /// <summary>
- /// 鎻愮ず鐢ㄦ埛璇ユ埧闂存槸鍒嗕韩杩囨潵鐨勶紝涓嶅厑璁歌繘琛屾搷浣�
- /// </summary>
- public static void ShowTipRoomIsShared()
- {
- Application.RunOnMainThread(() =>
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheRoomIsSharedNotAllowedToOperate));
- });
- }
-
- /// <summary>
- /// 鎻愮ず鐢ㄦ埛杩樻病閫夋嫨鎴块棿
- /// </summary>
- public static void ShowTipNoRoom()
- {
- Application.RunOnMainThread(() =>
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.NotSelectZone));
- });
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomHumiditySetting.cs b/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomHumiditySetting.cs
deleted file mode 100755
index 89fc274..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomHumiditySetting.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Room
-{
- public class RoomHumiditySetting:FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// verticalScrolView
- /// </summary>
- private VerticalScrolViewLayout verticalScrolView;
- /// <summary>
- /// The room.
- /// </summary>
- public Shared.Common.Room room;
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice> selectDeviceAction;
-
- /// <summary>
- /// tempDeviceRow
- /// </summary>
- private DeviceInfoWithZoneRow tempDeviceRow = null;
- /// <summary>
- /// tempDevice
- /// </summary>
- public CommonDevice tempDevice;
-
- #endregion
-
- public RoomHumiditySetting()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- /// <summary>
- /// Show this instance.
- /// </summary>
- public void Show(Shared.Common.Room r)
- {
- room = r;
-
- AddTop();
-
- AddBodyView();
-
- }
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.Humidity);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- verticalScrolView = new VerticalScrolViewLayout
- {
- Height = Application.GetRealHeight(1737)
- };
- bodyFrameLayout.AddChidren(verticalScrolView);
-
- var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127);
- confirm.SetTitle(R.MyInternationalizationString.Save);
- AddChidren(confirm);
- confirm.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- if (tempDevice != null)
- {
- selectDeviceAction?.Invoke(tempDevice);
- }
- };
-
- var deviceList = GetHumidityDevice();
-
- for (int i = 0; i < deviceList.Count; i++)
- {
- var fl = new FrameLayout
- {
- Height = Application.GetRealHeight(127 + 20),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- verticalScrolView.AddChidren(fl);
-
- var device = deviceList[i];
- var devRow = new DeviceInfoWithZoneRow(20);
- fl.AddChidren(devRow);
- devRow.Init();
- devRow.SetIcon(device.IconPath);
- devRow.SetName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- devRow.SetZone(UserCenter.HdlRoomLogic.Current.GetRoomNameByDevice(device));
- if (i == deviceList.Count - 1)
- {
- devRow.HideLine(true);
- }
-
- if (tempDevice != null && tempDevice == device)
- {
- tempDeviceRow = devRow;
- tempDevice = device;
- devRow.SetStatu(true);
- }
- else
- {
- if (i == 0 && tempDevice == null)
- {
- tempDeviceRow = devRow;
- tempDevice = device;
- devRow.SetStatu(true);
- }
- }
-
- devRow.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- tempDeviceRow.SetStatu(false);
- devRow.SetStatu(true);
- tempDeviceRow = devRow;
- tempDevice = device;
- };
- }
-
- }
-
- /// <summary>
- /// 婀垮害浼犳劅鍣ㄥ垪琛�
- /// </summary>
- private List<ZigBee.Device.CommonDevice> GetHumidityDevice()
- {
- var listDevice = new List<ZigBee.Device.CommonDevice>();
- foreach (var device in Common.LocalDevice.Current.listAllDevice)
- {
- //鑾峰彇婀垮害浼犳劅鍣�
- if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 2)
- {
- listDevice.Add(device);
- }
- }
- return listDevice;
- }
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomShareSetting.cs b/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomShareSetting.cs
deleted file mode 100755
index 61e3606..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomShareSetting.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-namespace Shared.Phone.Device.Room
-{
- public class RoomShareSetting:FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// verticalScrolView
- /// </summary>
- private VerticalScrolViewLayout verticalScrolView;
- /// <summary>
- /// The room.
- /// </summary>
- public Shared.Common.Room room;
- /// <summary>
- /// The action.
- /// </summary>
- public Action<string> action;
-
- #endregion
-
- public RoomShareSetting()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- /// <summary>
- /// Show this instance.
- /// </summary>
- public void Show(Shared.Common.Room r)
- {
- room = r;
-
- AddTop();
-
- AddBodyView();
-
- }
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.Share);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- verticalScrolView = new VerticalScrolViewLayout
- {
- Height = Application.GetRealHeight(1737)
- };
- bodyFrameLayout.AddChidren(verticalScrolView);
-
- var confirm = new Device.CommonForm.CompleteButton(1700, 700, 127);
- confirm.SetTitle(R.MyInternationalizationString.Save);
- AddChidren(confirm);
-
- for (int i = 0; i < 15; i++)
- {
- AddItem(verticalScrolView, 20 + i * (127 + 20));
- }
- }
- /// <summary>
- /// AddItem
- /// </summary>
- /// <param name="vertical"></param>
- public void AddItem(VerticalScrolViewLayout vertical, int y)
- {
- var dev = new DeviceInfoRow(y);
- vertical.AddChidren(dev);
- dev.Init();
- dev.SetTipTitle("鐢ㄦ埛 " + y);
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomTemperatureSetting.cs b/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomTemperatureSetting.cs
deleted file mode 100755
index 60d6d8f..0000000
--- a/ZigbeeApp20200414/Shared/Phone/Device/Room/RoomTemperatureSetting.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Room
-{
- public class RoomTemperatureSetting : FrameLayout
- {
- #region 鈼� 鍙橀噺____________________________
- /// <summary>
- /// bodyFrameLayout
- /// </summary>
- private FrameLayout bodyFrameLayout;
- /// <summary>
- /// The action.
- /// </summary>
- public Action<CommonDevice> selectDeviceAction;
- /// <summary>
- /// verticalScrolView
- /// </summary>
- private VerticalScrolViewLayout verticalScrolView;
- /// <summary>
- /// The room.
- /// </summary>
- public Shared.Common.Room room;
- /// <summary>
- /// tempDeviceRow
- /// </summary>
- private DeviceInfoWithZoneRow tempDeviceRow = null;
- /// <summary>
- /// tempDevice
- /// </summary>
- public CommonDevice tempDevice;
-
- #endregion
-
- public RoomTemperatureSetting()
- {
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- }
-
- /// <summary>
- /// Show this instance.
- /// </summary>
- public void Show(Shared.Common.Room r)
- {
- room = r;
-
- AddTop();
-
- AddBodyView();
-
- }
-
- #region Add____________________________________
-
- /// <summary>
- /// AddTop
- /// </summary>
- public void AddTop()
- {
- var top = new TopFrameLayout();
- AddChidren(top);
- top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.Temperature);
- top.backButton.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
- }
-
- /// <summary>
- /// AddBodyView
- /// </summary>
- public void AddBodyView()
- {
- bodyFrameLayout = new FrameLayout()
- {
- Y = Application.GetRealHeight(184),
- Height = Application.GetRealHeight(1737),
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
- };
- AddChidren(bodyFrameLayout);
-
- verticalScrolView = new VerticalScrolViewLayout
- {
- Height = Application.GetRealHeight(1737)
- };
- bodyFrameLayout.AddChidren(verticalScrolView);
-
- var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127);
- confirm.SetTitle(R.MyInternationalizationString.Save);
- AddChidren(confirm);
- confirm.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- if(tempDevice!=null)
- {
- selectDeviceAction?.Invoke(tempDevice);
- }
- };
- var deviceList = GetTemperatrueDevices();
- for (int i = 0; i < deviceList.Count; i++)
- {
- var fl = new FrameLayout
- {
- Height = Application.GetRealHeight(127 + 20),
- BackgroundColor=ZigbeeColor.Current.GXCBackgroundColor
- };
- verticalScrolView.AddChidren(fl);
- var device = deviceList[i];
- var devRow = new DeviceInfoWithZoneRow(20);
- fl.AddChidren(devRow);
- devRow.Init();
- devRow.SetIcon(device.IconPath);
- devRow.SetName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- devRow.SetZone(UserCenter.HdlRoomLogic.Current.GetRoomNameByDevice(device));
- if (i == deviceList.Count - 1)
- {
- devRow.HideLine(true);
- }
-
- if (tempDevice!=null && tempDevice==device)
- {
- tempDeviceRow = devRow;
- tempDevice = device;
- devRow.SetStatu(true);
- }
- else
- {
- if (i == 0 && tempDevice == null)
- {
- tempDeviceRow = devRow;
- tempDevice = device;
- devRow.SetStatu(true);
- }
- }
-
- devRow.ClickButton.MouseUpEventHandler += (sender, e) =>
- {
- tempDeviceRow.SetStatu(false);
- devRow.SetStatu(true);
- tempDeviceRow = devRow;
- tempDevice = device;
- };
- }
- }
-
- /// <summary>
- /// 娓╁害浼犳劅鍣ㄥ垪琛�
- /// </summary>
- private List<ZigBee.Device.CommonDevice> GetTemperatrueDevices()
- {
- var listDevice = new List<ZigBee.Device.CommonDevice>();
- foreach (var device in Common.LocalDevice.Current.listAllDevice)
- {
- //鑾峰彇娓╁害浼犳劅鍣�
- if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1)
- {
- listDevice.Add(device);
- }
- }
- return listDevice;
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/Login/AccountLogin.cs b/ZigbeeApp20200414/Shared/Phone/Login/AccountLogin.cs
index 616eb2f..88dedda 100755
--- a/ZigbeeApp20200414/Shared/Phone/Login/AccountLogin.cs
+++ b/ZigbeeApp20200414/Shared/Phone/Login/AccountLogin.cs
@@ -2,7 +2,8 @@
using Shared.Common;
using Shared.Phone.UserView;
using Shared.Phone.Device.CommonForm;
-
+using Shared.Phone.UserCenter;
+
namespace Shared.Phone.Login
{
/// <summary>
@@ -858,10 +859,297 @@
{
loginBtn.Enable = loginBtn.IsSelected = false;
}
- }
+ }
+
+
+ #endregion
+
+
+
+
+ #region 鈻� 鍙橀噺澹版槑___________________________
+ /// <summary>
+ /// 鎵嬫満璐﹀彿鐧婚檰鐨勬帶浠跺鍣�
+ /// </summary>
+ private FrameLayout frameAccLoginPhoneback = null;
+ /// <summary>
+ /// 閭璐﹀彿鐧婚檰鐨勬帶浠跺鍣�
+ /// </summary>
+ private FrameLayout frameEmailLoginPhoneback = null;
#endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+ /// <summary>
+ /// 鐣岄潰鏄剧ず
+ /// </summary>
+ /// <param name="account">鐧婚檰璐﹀彿</param>
+ public void ShowForm(string account = "")
+ {
+ if (Config.Instance.IsLogin == true)
+ {
+ return;
+ }
+ CommonPage.Instance.IsDrawerLockMode = true;
+ this.Tag = "Login";
+
+ //鐣岄潰涓婇儴鐨勯粦鑹插浘鐗�
+ var btnTopBlackPic = new NormalViewControl(this.Width, Application.GetRealHeight(619), false);
+ btnTopBlackPic.UnSelectedImagePath = "Account/Logo_loginBG.png";
+ this.AddChidren(btnTopBlackPic);
+
+ //涓棿娴呯櫧鑹茬殑鑳屾櫙
+ var frameMidBack = new FrameLayout();
+ frameMidBack.Y = btnTopBlackPic.Bottom;
+ frameMidBack.Height = this.Height - btnTopBlackPic.Bottom;
+ frameMidBack.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
+ this.AddChidren(frameMidBack);
+
+ //HdlHome鐨勫浘鏍�
+ var btnLogoIcon = new PicViewControl(184, 184);
+ btnLogoIcon.Y = Application.GetRealHeight(230);
+ btnLogoIcon.UnSelectedImagePath = "Account/Logo_White.png";
+ btnLogoIcon.Gravity = Gravity.CenterHorizontal;
+ this.AddChidren(btnLogoIcon);
+ //Hdl Home
+ var btnLogoName = new NormalViewControl(300, 69, true);
+ btnLogoName.Y = btnLogoIcon.Bottom;
+ btnLogoName.Gravity = Gravity.CenterHorizontal;
+ btnLogoName.TextID = R.MyInternationalizationString.AppName;
+ btnLogoName.TextColor = ZigbeeColor.Current.GXCTextWhiteColor;
+ btnLogoName.TextSize = 16;
+ this.AddChidren(btnLogoName);
+
+ //鎵嬫満鍙�,閭鐨勮彍鍗曟帶浠�
+ int defultIndex = account.Contains("@") == false ? 1 : 2;
+ var sitchControl = new Controls.PhoneEmailSelectControl();
+ sitchControl.Y = Application.GetRealHeight(559);
+ this.AddChidren(sitchControl);
+ sitchControl.SelectMenuEvent += (selectIndex) =>
+ {
+ //鎵嬫満鍙�
+ if (selectIndex == 1)
+ {
+ }
+ //閭
+ else if (selectIndex == 2)
+ {
+ }
+ };
+ //鎵ц鍒濆鍖�
+ sitchControl.InitControl(ZigbeeColor.Current.GXCButtonSelectedColor, defultIndex);
+
+
+ phoneEmailForm = new PhoneEmailForm();
+ phoneEmailForm.Init(midFrameLayout);
+
+
+ //閿欒鎻愮ずBtn
+ loginErrorBtn = new Button()
+ {
+ X = Application.GetRealWidth(242),
+ Y = Application.GetRealHeight(740),
+ Width = Application.GetRealWidth(700),
+ Height = Application.GetRealHeight(58),
+ TextColor = ZigbeeColor.Current.GXCTextRed,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextSize = CommonFormResouce.TextSize,
+ IsBold = true
+ };
+ midFrameLayout.AddChidren(loginErrorBtn);
+
+ accountPwdFL = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(801),
+ Height = Application.GetRealHeight(553),
+ Width = Application.GetRealWidth(942),
+ Gravity = Gravity.CenterHorizontal,
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Radius = (uint)Application.GetRealHeight(17)
+ };
+ midFrameLayout.AddChidren(accountPwdFL);
+
+ AddPhoneOrEmailFL(accountPwdFL, "Phone");
+
+ forgotPasswordBtn = new Button()
+ {
+ X = Application.GetRealWidth(CommonPage.AppRealWidth - 115 - 250),
+ Y = Application.GetRealHeight(1198),
+ Width = Application.GetRealWidth(250),
+ Height = Application.GetRealHeight(58),
+ TextID = R.MyInternationalizationString.ForgotPWD_1,
+ TextSize = CommonFormResouce.loginTextSize,
+ TextColor = Shared.Common.ZigbeeColor.Current.GXCTextGrayColor,
+ TextAlignment = TextAlignment.CenterRight
+ };
+ midFrameLayout.AddChidren(forgotPasswordBtn);
+
+ loginBtn = new Button()
+ {
+ Y = Application.GetRealHeight(1293),
+ Width = Application.GetRealWidth(688),
+ Height = Application.GetRealHeight(127),
+ Gravity = Gravity.CenterHorizontal,
+ TextID = R.MyInternationalizationString.Login,
+ TextSize = 16,
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+ SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+ SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor,
+ BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor,
+ Radius = (uint)Application.GetRealHeight(127 / 2),
+ Enable = false,
+ IsBold = true
+ };
+ midFrameLayout.AddChidren(loginBtn);
+
+ loginByCodeBtn = new Button()
+ {
+ X = Application.GetRealWidth(98),
+ Y = Application.GetRealHeight(1466),
+ Width = Application.GetRealWidth(300),
+ Height = Application.GetRealHeight(49),
+ TextID = R.MyInternationalizationString.LoginByCode,
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextSize = CommonFormResouce.loginTextSize
+ };
+ midFrameLayout.AddChidren(loginByCodeBtn);
+
+ registerBtn = new Button()
+ {
+ X = Application.GetRealWidth(738),
+ Y = Application.GetRealHeight(1466),
+ Width = Application.GetRealWidth(244),
+ Height = Application.GetRealHeight(49),
+ TextID = R.MyInternationalizationString.Register,
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+ TextAlignment = TextAlignment.CenterRight,
+ TextSize = CommonFormResouce.loginTextSize
+ };
+ midFrameLayout.AddChidren(registerBtn);
+
+ wechatBtn = new Button
+ {
+ X = Application.GetRealWidth(395),
+ Y = Application.GetRealHeight(1737),
+ Width = Application.GetMinRealAverage(115),
+ Height = Application.GetMinRealAverage(115),
+ UnSelectedImagePath = "Account/Wechat.png",
+ Gravity = Gravity.CenterHorizontal
+ };
+ midFrameLayout.AddChidren(wechatBtn);
+
+ qqBtn = new Button
+ {
+ X = Application.GetRealWidth(567),
+ Y = Application.GetRealHeight(1737),
+ Width = Application.GetMinRealAverage(115),
+ Height = Application.GetMinRealAverage(115),
+ UnSelectedImagePath = "Account/QQ.png"
+ };
+ //midFrameLayout.AddChidren(qqBtn);
+
+ BindEvent();
+
+ if (account.Contains("@") == true)
+ {
+ SelectPhoneOrEmail_MouseUpEvent(phoneEmailForm.SelectedEmail, null);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栬处鍙风櫥闄嗙獥鍙________________
+
+ /// <summary>
+ /// 鍒濆鍖栬处鍙风櫥闄嗙獥鍙�
+ /// </summary>
+ /// <param name="frameMidBack">涓棿娴呰壊鐨勮儗鏅鍣�</param>
+ /// <param name="i_account">鐧婚檰璐﹀彿</param>
+ /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param>
+ private void InitAccoutLoginWindow(FrameLayout frameMidBack, string i_account, int i_div)
+ {
+ //瀹瑰櫒
+ var frameBack = new FrameLayout();
+ frameBack.Height = Application.GetRealHeight(620);
+ frameBack.Y = Application.GetRealHeight(181);
+ frameMidBack.AddChidren(frameBack);
+ //鐧借壊鑳屾櫙
+ var frameWhiteBack = new FrameLayout();
+ frameWhiteBack.Width = Application.GetRealWidth(942);
+ frameWhiteBack.Height = Application.GetRealHeight(553);
+ frameWhiteBack.BackgroundColor = UserCenterColor.Current.White;
+ frameWhiteBack.Radius = (uint)Application.GetRealHeight(17);
+ frameWhiteBack.Gravity = Gravity.CenterHorizontal;
+ frameBack.AddChidren(frameWhiteBack);
+
+ //璐﹀彿琛�
+ var rowAccount = new FrameLayout();
+ rowAccount.Y = Application.GetRealHeight(29);
+ rowAccount.Width = Application.GetRealWidth(884);
+ rowAccount.Height = Application.GetRealHeight(138);
+ rowAccount.Gravity = Gravity.CenterHorizontal;
+ frameWhiteBack.AddChidren(rowAccount);
+ //璐﹀彿鍥炬爣
+ var btnAccountIcon = new IconViewControl(92);
+ btnAccountIcon.X = Application.GetRealWidth(69);
+ btnAccountIcon.Gravity = Gravity.CenterVertical;
+ btnAccountIcon.UnSelectedImagePath = "Account/Account.png";
+ rowAccount.AddChidren(btnAccountIcon);
+ //璐﹀彿杈撳叆妗�
+ var txtAccount = new TextInputControl(600, 92, true);
+ txtAccount.X = btnAccountIcon.Right + Application.GetRealWidth(35);
+ txtAccount.Gravity = Gravity.CenterVertical;
+ if (i_div == 1)
+ {
+ //鎵嬫満鍙�
+ txtAccount.IsNumberKeyboardType = true;
+ txtAccount.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPhoneNum);
+ }
+ else
+ {
+ //閭
+ txtAccount.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputEmail);
+ }
+ txtAccount.PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor;
+ txtAccount.Text = i_account;
+ rowAccount.AddChidren(txtAccount);
+ //搴曠嚎
+ var btnAccountLine = new NormalViewControl(rowAccount.Width, 1, false);
+ btnAccountLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor;
+ btnAccountLine.Y = rowAccount.Height - 1;
+ rowAccount.AddChidren(btnAccountLine);
+
+ //瀵嗙爜琛�
+ var rowPassword = new FrameLayout();
+ rowPassword.Y = rowAccount.Bottom + Application.GetRealHeight(58);
+ rowPassword.Width = rowAccount.Width;
+ rowPassword.Height = rowAccount.Height;
+ rowPassword.Gravity = Gravity.CenterHorizontal;
+ frameWhiteBack.AddChidren(rowPassword);
+ //璐﹀彿鍥炬爣
+ var btnPswIcon = new IconViewControl(92);
+ btnPswIcon.X = btnAccountIcon.X;
+ btnPswIcon.Gravity = Gravity.CenterVertical;
+ btnPswIcon.UnSelectedImagePath = "Account/Password.png";
+ rowPassword.AddChidren(btnPswIcon);
+ //璐﹀彿杈撳叆妗�
+ var txtPsw = new TextInputControl(600, 92, true);
+ txtPsw.X = txtAccount.X;
+ txtPsw.Gravity = Gravity.CenterVertical;
+ txtPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPWD);
+ txtPsw.PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor;
+ txtPsw.SecureTextEntry = true;
+ rowPassword.AddChidren(txtPsw);
+ //搴曠嚎
+ var btnPswLine = new NormalViewControl(rowPassword.Width, 1, false);
+ btnPswLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor;
+ btnPswLine.Y = rowPassword.Height - 1;
+ rowPassword.AddChidren(btnPswLine);
+ }
+
+ #endregion
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/Login/Controls/PhoneEmailSelectControl.cs b/ZigbeeApp20200414/Shared/Phone/Login/Controls/PhoneEmailSelectControl.cs
new file mode 100755
index 0000000..0360031
--- /dev/null
+++ b/ZigbeeApp20200414/Shared/Phone/Login/Controls/PhoneEmailSelectControl.cs
@@ -0,0 +1,129 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.Login.Controls
+{
+ /// <summary>
+ /// 鐧婚檰鐣岄潰鐨勬墜鏈哄彿鍜岄偖绠辨潵鍥炲垏鎹㈢殑鎺т欢
+ /// </summary>
+ public class PhoneEmailSelectControl : FrameLayout
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鑿滃崟閫夋嫨浜嬩欢 1:鎵嬫満鍙� 2:閭
+ /// </summary>
+ public Action<int> SelectMenuEvent = null;
+ /// <summary>
+ /// 鎵嬫満鍙锋帶浠�
+ /// </summary>
+ private NormalViewControl btnPhone = null;
+ /// <summary>
+ /// 閭鎺т欢
+ /// </summary>
+ private NormalViewControl btnEmail = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐧婚檰鐣岄潰鐨勬墜鏈哄彿鍜岄偖绠辨潵鍥炲垏鎹㈢殑鎺т欢
+ /// </summary>
+ public PhoneEmailSelectControl()
+ {
+ this.Width = HdlControlLogic.Current.GetPictrueRealSize(905);
+ this.Height = HdlControlLogic.Current.GetPictrueRealSize(170);
+ this.Gravity = Gravity.CenterHorizontal;
+ this.BackgroundImagePath = "Account/PhoneEmail_White.png";
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�(绱㈠紩浼氳Е鍙戝洖璋冧簨浠�,SelectMenuEvent闇�瑕佸湪瀹冧箣鍓嶅疄鐜�)
+ /// </summary>
+ /// <param name="selectBackColor">閫夋嫨鏃剁殑鑳屾櫙棰滆壊</param>
+ /// <param name="selectIndex">榛樿閫夋嫨鐨勭储寮� 1:鎵嬫満鍙� 2:閭</param>
+ public void InitControl(uint selectBackColor,int selectIndex)
+ {
+ //鎵嬫満鍙�
+ this.btnPhone = new NormalViewControl(this.Width / 2 + HdlControlLogic.Current.GetPictrueRealSize(20), HdlControlLogic.Current.GetPictrueRealSize(127), false);
+ btnPhone.X = HdlControlLogic.Current.GetPictrueRealSize(10);
+ btnPhone.SelectedBackgroundColor = selectBackColor;
+ btnPhone.TextID = R.MyInternationalizationString.PhoneNum;
+ btnPhone.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnPhone.SelectedTextColor = UserCenterColor.Current.White;
+ btnPhone.Radius = (uint)HdlControlLogic.Current.GetPictrueRealSize(127) / 2;
+ this.AddChidren(btnPhone);
+ btnPhone.ButtonClickEvent += (sender, e) =>
+ {
+ if (btnPhone.IsSelected == false)
+ {
+ btnPhone.IsBold = true;
+ btnPhone.IsSelected = true;
+
+ btnEmail.IsBold = false;
+ btnEmail.IsSelected = false;
+ //璋冪敤鍥炶皟鍑芥暟
+ this.SelectMenuEvent?.Invoke(1);
+ }
+ };
+
+ //閭
+ this.btnEmail = new NormalViewControl(this.btnPhone.Width, this.btnPhone.Height, false);
+ btnEmail.X = this.btnPhone.Right - HdlControlLogic.Current.GetPictrueRealSize(40);
+ btnEmail.SelectedBackgroundColor = selectBackColor;
+ btnEmail.TextID = R.MyInternationalizationString.Email;
+ btnEmail.TextColor = UserCenterColor.Current.TextGrayColor3;
+ btnEmail.SelectedTextColor = UserCenterColor.Current.White;
+ btnEmail.Radius = (uint)HdlControlLogic.Current.GetPictrueRealSize(127) / 2;
+ this.AddChidren(btnEmail);
+ btnEmail.ButtonClickEvent += (sender, e) =>
+ {
+ if (btnEmail.IsSelected == false)
+ {
+ btnPhone.IsBold = false;
+ btnPhone.IsSelected = false;
+
+ btnEmail.IsBold = true;
+ btnEmail.IsSelected = true;
+ //璋冪敤鍥炶皟鍑芥暟
+ this.SelectMenuEvent?.Invoke(2);
+ }
+ };
+
+ //璁剧疆鍒濆鍊�
+ if (selectIndex == 1)
+ {
+ btnPhone.IsBold = true;
+ btnPhone.IsSelected = true;
+ //璋冪敤鍥炶皟鍑芥暟
+ this.SelectMenuEvent?.Invoke(1);
+ }
+ else if (selectIndex == 2)
+ {
+ btnEmail.IsBold = true;
+ btnEmail.IsSelected = true;
+ //璋冪敤鍥炶皟鍑芥暟
+ this.SelectMenuEvent?.Invoke(2);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鎺т欢鎽ф瘉___________________________
+
+ /// <summary>
+ /// 鎺т欢鎽ф瘉
+ /// </summary>
+ public override void RemoveFromParent()
+ {
+ this.SelectMenuEvent = null;
+
+ base.RemoveFromParent();
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs
index 2c67573..9631854 100755
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs
@@ -144,6 +144,7 @@
{
arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
}
+
//绌鸿皟鎺т欢閲岄潰鐨勯偅涓樉绀哄埗鐑�,鍒跺喎鐨勬帶浠�
this.btnNowModeView = new NormalViewControl(200, 55, true);
btnNowModeView.Y = Application.GetMinRealAverage(184);
@@ -193,6 +194,16 @@
btnUint.Text = "鈩�";
btnUint.TextSize = 18;
frameAcBack.AddChidren(btnUint);
+
+ //閫侀娌℃湁娓╁害鐨勬蹇�
+ if (deviceAc.currentSystemMode == 7)
+ {
+ //棰滆壊鍙樻洿
+ arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
+ arcScaleSeekBar.IsClickable = false;
+ this.btnReduce.CanClick = false;
+ this.btnAdd.CanClick = false;
+ }
//鏄惁鍚敤鎽嗛
int IconSpace = Application.GetRealWidth(156);
@@ -1004,6 +1015,13 @@
arcScaleSeekBar.IsClickable = ACControlBase.IsOpen(deviceAc);
//璁剧疆鐘舵�佹枃瀛� 褰撳墠瀹ゆ俯
this.SetStatuText(deviceAc.currentLocalTemperature + "鈩�");
+ //閫侀娌℃湁娓╁害鐨勬蹇�
+ if (deviceAc.currentSystemMode == 7)
+ {
+ //棰滆壊鍙樻洿
+ arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
+ arcScaleSeekBar.IsClickable = false;
+ }
});
//宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉
return true;
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
index 5868b0d..e40e221 100755
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
@@ -68,9 +68,9 @@
public DeviceCardCommon()
{
//鍥剧墖鐪熷疄瀹藉害+鍥剧墖鑷韩宸﹀彸绌虹櫧
- this.Width = Application.GetMinRealAverage(458 + 14 * 2);
+ this.Width = HdlControlLogic.Current.GetPictrueRealSize(458 + 14 * 2);
//鍥剧墖楂樺害+闃村奖
- this.Height = Application.GetMinRealAverage(305 + 43);
+ this.Height = HdlControlLogic.Current.GetPictrueRealSize(305 + 43);
//鍙栨秷鐐瑰嚮鐗规晥
this.UseClickStatu = false;
}
@@ -91,8 +91,8 @@
//璁惧鍚嶇О鎺т欢
this.btnDeviceName = new NormalViewControl(320, 63, true);
- btnDeviceName.X = Application.GetMinRealAverage(40);
- btnDeviceName.Y = Application.GetMinRealAverage(17);
+ btnDeviceName.X = HdlControlLogic.Current.GetPictrueRealSize(40);
+ btnDeviceName.Y = HdlControlLogic.Current.GetPictrueRealSize(17);
btnDeviceName.TextSize = 16;
btnDeviceName.TextColor = UserCenterColor.Current.TextGrayColor1;
btnDeviceName.SelectedTextColor = UserCenterColor.Current.White;
@@ -101,8 +101,8 @@
//鏀堕泦鎺т欢
this.btnCollect = new IconViewControl(107);
- btnCollect.X = Application.GetMinRealAverage(350);
- btnCollect.Y = Application.GetMinRealAverage(12);
+ btnCollect.X = HdlControlLogic.Current.GetPictrueRealSize(350);
+ btnCollect.Y = HdlControlLogic.Current.GetPictrueRealSize(12);
btnCollect.UnSelectedImagePath = "Item/Collection1.png";
btnCollect.SelectedImagePath = "Item/CollectionSelected1.png";
this.AddChidren(btnCollect, ChidrenBindMode.NotBind);
@@ -130,11 +130,11 @@
//璁惧鐨勮儗鏅渾鍦堝浘
this.fraDeviceRound = new FrameLayout();
- fraDeviceRound.Width = Application.GetMinRealAverage(124);
- fraDeviceRound.Height = Application.GetMinRealAverage(124);
- fraDeviceRound.Radius = (uint)Application.GetMinRealAverage(124) / 2;
- fraDeviceRound.X = Application.GetMinRealAverage(44);
- fraDeviceRound.Y = Application.GetMinRealAverage(101);
+ fraDeviceRound.Width = HdlControlLogic.Current.GetPictrueRealSize(124);
+ fraDeviceRound.Height = HdlControlLogic.Current.GetPictrueRealSize(124);
+ fraDeviceRound.Radius = (uint)HdlControlLogic.Current.GetPictrueRealSize(124) / 2;
+ fraDeviceRound.X = HdlControlLogic.Current.GetPictrueRealSize(44);
+ fraDeviceRound.Y = HdlControlLogic.Current.GetPictrueRealSize(101);
fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor;
this.AddChidren(fraDeviceRound, ChidrenBindMode.BindEventOnly);
@@ -145,9 +145,9 @@
this.ChangedChidrenBindMode(fraDeviceRound, ChidrenBindMode.BindEventOnly);
//鐘舵�佹枃鏈帶浠�
- this.btnStatu = new NormalViewControl(Application.GetMinRealAverage(280), Application.GetMinRealAverage(63), false);
- btnStatu.X = Application.GetMinRealAverage(46);
- btnStatu.Y = Application.GetMinRealAverage(236);
+ this.btnStatu = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(280), HdlControlLogic.Current.GetPictrueRealSize(63), false);
+ btnStatu.X = HdlControlLogic.Current.GetPictrueRealSize(46);
+ btnStatu.Y = HdlControlLogic.Current.GetPictrueRealSize(236);
btnStatu.TextColor = UserCenterColor.Current.TextColor1;
btnStatu.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
btnStatu.IsBold = true;
@@ -155,8 +155,8 @@
//寮�鍏虫帶浠�(涓嶅姞鍏ョ埗鎺т欢涓�)
this.btnSwitch = new PicViewControl(109, 104);
- btnSwitch.X = Application.GetMinRealAverage(325);
- btnSwitch.Y = Application.GetMinRealAverage(202);
+ btnSwitch.X = HdlControlLogic.Current.GetPictrueRealSize(325);
+ btnSwitch.Y = HdlControlLogic.Current.GetPictrueRealSize(202);
btnSwitch.UnSelectedImagePath = "Item/Switch1.png";
btnSwitch.SelectedImagePath = "Item/SwitchSelected1.png";
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs
index 8944a09..533c332 100755
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs
@@ -79,7 +79,7 @@
/// <returns></returns>
public override bool CheckIsOpenStatu(CommonDevice i_device)
{
- return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 10;
+ return ((Rollershade)i_device).WcdCurrentPositionLiftPercentage > 0;
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
index ae4657c..319a7f6 100755
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/ListRoomCardControl.cs
@@ -38,8 +38,8 @@
/// </summary>
public ListRoomCardControl()
{
- this.Width = Application.GetRealWidth(495);
- this.Height = Application.GetRealHeight(354);
+ this.Width = HdlControlLogic.Current.GetPictrueRealSize(495);
+ this.Height = HdlControlLogic.Current.GetPictrueRealSize(354);
}
/// <summary>
@@ -58,8 +58,8 @@
//鎴块棿鍥剧墖
this.picRoom = new ImageView();
picRoom.Gravity = Gravity.CenterHorizontal;
- picRoom.Width = Application.GetRealWidth(467);
- picRoom.Height = Application.GetRealHeight(311);
+ picRoom.Width = HdlControlLogic.Current.GetPictrueRealSize(467);
+ picRoom.Height = HdlControlLogic.Current.GetPictrueRealSize(311);
picRoom.Radius = (uint)Application.GetRealHeight(29);
this.AddChidren(picRoom, ChidrenBindMode.NotBind);
@@ -70,30 +70,15 @@
frameBack.BackgroundColor = 0x33000000;
this.AddChidren(picRoom, ChidrenBindMode.BindEventOnly);
- ////鎴块棿鍚嶅瓧鐨勮儗鏅�
- //var btnRoomNameBackGroud = new NormalViewControl(Application.GetRealWidth(141), Application.GetRealHeight(84), false);
- //btnRoomNameBackGroud.X = Application.GetRealWidth(14);
- //btnRoomNameBackGroud.UnSelectedImagePath = "Room/RoomCardView_Name.png";
- //this.AddChidren(btnRoomNameBackGroud, ChidrenBindMode.BindEventOnly);
-
- ////鎴块棿鍚嶅瓧
- //this.btnRoomName = new NormalViewControl(btnRoomNameBackGroud.Width, btnRoomNameBackGroud.Height, false);
- //btnRoomName.X = Application.GetRealWidth(14);
- //btnRoomName.TextSize = 12;
- //btnRoomName.IsBold = true;
- //btnRoomName.TextAlignment = TextAlignment.Center;
- //btnRoomName.TextColor = UserCenterColor.Current.White;
- //this.AddChidren(btnRoomName, ChidrenBindMode.BindEventOnly);
-
//鎴块棿鍚嶅瓧鐨勮儗鏅�
- this.btnRoomNameBackGroud = new NormalViewControl(Application.GetRealWidth(141), Application.GetRealHeight(84), false);
- btnRoomNameBackGroud.X = Application.GetRealWidth(14);
+ 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.btnRoomName = new NormalViewControl(50, Application.GetRealHeight(84), false);
- btnRoomName.X = Application.GetRealWidth(14);
+ btnRoomName.X = HdlControlLogic.Current.GetPictrueRealSize(14);
btnRoomName.TextSize = 12;
btnRoomName.IsBold = true;
btnRoomName.TextAlignment = TextAlignment.Center;
@@ -118,14 +103,14 @@
{
//鍒锋柊鍚嶅瓧
btnRoomName.Text = room.Name;
- int realWidth = btnRoomName.GetRealWidthByText() + Application.GetRealWidth(70);
- if (realWidth < Application.GetRealWidth(141))
+ int realWidth = btnRoomName.GetRealWidthByText() + HdlControlLogic.Current.GetPictrueRealSize(70);
+ if (realWidth < HdlControlLogic.Current.GetPictrueRealSize(141))
{
- realWidth = Application.GetRealWidth(141);
+ realWidth = HdlControlLogic.Current.GetPictrueRealSize(141);
}
- else if (realWidth > Application.GetRealWidth(420))
+ else if (realWidth > HdlControlLogic.Current.GetPictrueRealSize(420))
{
- realWidth = Application.GetRealWidth(420);
+ realWidth = HdlControlLogic.Current.GetPictrueRealSize(420);
}
btnRoomName.Width = realWidth;
btnRoomNameBackGroud.Width = realWidth;
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/SceneCardControl.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/SceneCardControl.cs
index 7290a4b..fbb0cd2 100755
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/SceneCardControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/Controls/SceneCardControl.cs
@@ -51,9 +51,9 @@
public SceneCardControl()
{
//鍥剧墖鐪熷疄瀹藉害+鍥剧墖鑷韩宸﹀彸绌虹櫧
- this.Width = Application.GetMinRealAverage(458 + 14 * 2);
+ this.Width = HdlControlLogic.Current.GetPictrueRealSize(458 + 14 * 2);
//鍥剧墖楂樺害+闃村奖
- this.Height = Application.GetMinRealAverage(305 + 43);
+ this.Height = HdlControlLogic.Current.GetPictrueRealSize(305 + 43);
//鍙栨秷鐐瑰嚮鐗规晥
this.UseClickStatu = false;
@@ -77,10 +77,10 @@
//鍦烘櫙鍥剧墖鎺т欢
this.btnScenePic = new ImageView();
- btnScenePic.X = Application.GetMinRealAverage(14);
- btnScenePic.Width = Application.GetMinRealAverage(458);
- btnScenePic.Height = Application.GetMinRealAverage(305);
- btnScenePic.Radius = (uint)Application.GetMinRealAverage(17);
+ btnScenePic.X = HdlControlLogic.Current.GetPictrueRealSize(14);
+ btnScenePic.Width = HdlControlLogic.Current.GetPictrueRealSize(458);
+ btnScenePic.Height = HdlControlLogic.Current.GetPictrueRealSize(305);
+ btnScenePic.Radius = (uint)Application.GetRealHeight(17);
this.AddChidren(btnScenePic, ChidrenBindMode.NotBind);
//鍦烘櫙鑳屾櫙鍥炬帶浠�
@@ -89,9 +89,9 @@
this.AddChidren(btnSceneBackGroud, ChidrenBindMode.BindEventOnly);
//寤舵椂鏃堕棿鏄剧ず鎺т欢
- this.btnTimeView = new NormalViewControl(Application.GetMinRealAverage(280), Application.GetMinRealAverage(63), false);
- btnTimeView.X = Application.GetMinRealAverage(37);
- btnTimeView.Y = Application.GetMinRealAverage(10);
+ this.btnTimeView = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(280), HdlControlLogic.Current.GetPictrueRealSize(63), false);
+ btnTimeView.X = HdlControlLogic.Current.GetPictrueRealSize(37);
+ btnTimeView.Y = HdlControlLogic.Current.GetPictrueRealSize(10);
btnTimeView.TextColor = 0xffffb400;
btnTimeView.IsBold = true;
if (i_scene.SceneDelayTime > 0)
@@ -102,8 +102,8 @@
//鏃堕棿鍥炬爣鎺т欢
this.btnTimeIcon = new IconViewControl(63);
- btnTimeIcon.X = Application.GetMinRealAverage(37);
- btnTimeIcon.Y = Application.GetMinRealAverage(20);
+ btnTimeIcon.X = HdlControlLogic.Current.GetPictrueRealSize(37);
+ btnTimeIcon.Y = HdlControlLogic.Current.GetPictrueRealSize(20);
btnTimeIcon.UnSelectedImagePath = "Item/Time.png";
this.AddChidren(btnTimeIcon, ChidrenBindMode.NotBind);
if (i_scene.SceneDelayTime > 0)
@@ -136,8 +136,8 @@
//鏀惰棌鎺т欢
var btnCollect = new IconViewControl(107);
- btnCollect.X = Application.GetMinRealAverage(350);
- btnCollect.Y = Application.GetMinRealAverage(12);
+ btnCollect.X = HdlControlLogic.Current.GetPictrueRealSize(350);
+ btnCollect.Y = HdlControlLogic.Current.GetPictrueRealSize(12);
btnCollect.UnSelectedImagePath = "Item/Collection1.png";
btnCollect.SelectedImagePath = "Item/CollectionSelected1.png";
this.AddChidren(btnCollect, ChidrenBindMode.NotBind);
@@ -164,9 +164,9 @@
};
//鍦烘櫙鍚嶇О鎺т欢
- this.btnSceneName = new NormalViewControl(Application.GetMinRealAverage(280), Application.GetMinRealAverage(63), false);
- btnSceneName.X = Application.GetMinRealAverage(37);
- btnSceneName.Y = Application.GetMinRealAverage(236);
+ this.btnSceneName = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(280), HdlControlLogic.Current.GetPictrueRealSize(63), false);
+ btnSceneName.X = HdlControlLogic.Current.GetPictrueRealSize(37);
+ btnSceneName.Y = HdlControlLogic.Current.GetPictrueRealSize(236);
btnSceneName.IsBold = true;
btnSceneName.TextColor = UserCenterColor.Current.White;
this.AddChidren(btnSceneName, ChidrenBindMode.BindEventOnly);
@@ -219,9 +219,11 @@
//鍒锋柊鍥剧墖
if (i_scene.IconPathType == 0)
{
- if (this.btnScenePic.ImagePath != i_scene.IconPath)
+ //涓婚〉鐨勫満鏅崱鐗囩敤鐨勬槸鍙﹀鐨勫浘
+ string newPath = i_scene.IconPath.Replace("SceneIcon", "SceneCardIcon");
+ if (this.btnScenePic.ImagePath != newPath)
{
- this.btnScenePic.ImagePath = i_scene.IconPath;
+ this.btnScenePic.ImagePath = newPath;
}
}
else
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/DeviceDetailInfoForm.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/DeviceDetailInfoForm.cs
index 71524d2..5512a41 100755
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/DeviceDetailInfoForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/DeviceDetailInfoForm.cs
@@ -29,7 +29,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
#endregion
@@ -70,15 +70,19 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 418, 1319);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1319);
//鍥剧墖
var btnPic = new DeviceInfoIconControl();
btnPic.Y = Application.GetRealHeight(46);
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
btnPic.InitControl(device.DeviceAddr, device.DeviceEpoint);
btnPic.ButtonClickEvent += (sender, e) =>
{
@@ -105,7 +109,7 @@
btnBelongType.TextID = infoType.BeloneTextId;
btnBelongType.TextSize = 15;
btnBelongType.TextAlignment = TextAlignment.Center;
- bodyFrameLayout.AddChidren(btnBelongType);
+ listBackControl.frameTable.AddChidren(btnBelongType);
//鍔熻兘鍚嶇О
string caption = Language.StringByID(R.MyInternationalizationString.FunctionName);
@@ -159,7 +163,7 @@
this.AddFunctionTypeRowByAdmin(btnBelongType);
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
@@ -194,15 +198,19 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 418, 1319);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1319);
//鍥剧墖
var btnPic = new DeviceInfoIconControl();
btnPic.Y = Application.GetRealHeight(92);
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
btnPic.InitControl(device.DeviceAddr, device.DeviceEpoint);
//璁惧鎵�灞炵被鍨�
@@ -213,7 +221,7 @@
btnBelongType.TextID = infoType.BeloneTextId;
btnBelongType.TextSize = 15;
btnBelongType.TextAlignment = TextAlignment.Center;
- bodyFrameLayout.AddChidren(btnBelongType);
+ listBackControl.frameTable.AddChidren(btnBelongType);
//鍔熻兘鍚嶇О
string caption = Language.StringByID(R.MyInternationalizationString.FunctionName);
@@ -253,7 +261,7 @@
this.AddFunctionTypeRowByMember();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
}
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/HomeMainPageForm.cs
old mode 100644
new mode 100755
index b5ead6e..97428b0
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/HomeMainPageForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/HomeMainPageForm.cs
@@ -370,13 +370,13 @@
//鎴块棿婊戝姩鎺т欢宸﹁竟鐨勮櫄鎷熷浘鐗�
var mLeftImageView = new ImageView();
- mLeftImageView.ImagePath = "RoomIcon/1.jpg";
+ mLeftImageView.ImagePath = "RoomIcon/19.jpg";
mLeftImageView.Radius = (uint)Application.GetRealHeight(17);
mLeftImageView.Width = Application.GetRealWidth(717);
mLeftImageView.Height = Application.GetRealHeight(478);
//鎴块棿婊戝姩鎺т欢鍙宠竟鐨勮櫄鎷熷浘鐗�
var mRightImageView = new ImageView();
- mRightImageView.ImagePath = "RoomIcon/2.jpg";
+ mRightImageView.ImagePath = "RoomIcon/19.jpg";
mRightImageView.Radius = (uint)Application.GetRealHeight(17);
mRightImageView.Width = mLeftImageView.Width;
mRightImageView.Height = mLeftImageView.Height;
@@ -428,7 +428,7 @@
btnRoomLeftShadow.Gravity = Gravity.CenterVertical;
btnRoomLeftShadow.BackgroundColor = 0x1c000000;
btnRoomLeftShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight);
- frameBack.AddChidren(btnRoomLeftShadow);
+ //frameBack.AddChidren(btnRoomLeftShadow);//鏆傛椂涓嶅姞閬僵
//鍦ㄦ埧闂村崱鐗囧彸杈规坊鍔犻伄缃�
var btnRoomRightShadow = new FrameLayout();
@@ -438,7 +438,7 @@
btnRoomRightShadow.Gravity = Gravity.CenterVertical;
btnRoomRightShadow.BackgroundColor = btnRoomLeftShadow.BackgroundColor;
btnRoomRightShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft);
- frameBack.AddChidren(btnRoomRightShadow);
+ //frameBack.AddChidren(btnRoomRightShadow);//鏆傛椂涓嶅姞閬僵
//鎺т欢寮�濮嬫粦鍔ㄧ殑浜嬩欢
roomPageView.StartScrollAction += () =>
@@ -480,13 +480,11 @@
};
//璁剧疆鎴块棿鐨勫垵濮嬮�夋嫨
roomPageView.PageIndex = curIndex;
-#if iOS
- //Ios濡傛灉绱㈠紩鏄涓�涓椂锛屽畠瑙﹀彂涓嶄簡浜嬩欢,闇�瑕佹墜鍔ㄨЕ鍙�
+ //濡傛灉绱㈠紩鏄涓�涓椂锛屽畠瑙﹀彂涓嶄簡浜嬩欢,闇�瑕佹墜鍔ㄨЕ鍙�
if (curIndex == 0)
{
roomPageView.EndScrollAction();
}
-#endif
}
/// <summary>
@@ -628,17 +626,7 @@
else if (device.Type == DeviceType.DoorLock)
{
cardContr = new Controls.DeviceDoorLockCardControl();
- }
- ////鏂伴
- //else if (device.Type == DeviceType.FreshAir)
- //{
- // cardContr = new Controls.DeviceAcCardControl();
- //}
- ////鏂伴婀垮害浼犳劅鍣�
- //else if (device.Type == DeviceType.FreshAirHumiditySensor)
- //{
- // cardContr = new Controls.DeviceTemperatureCardControl();
- //}
+ }
//鏃犳硶璇嗗埆
else
{
@@ -695,8 +683,11 @@
}, ShowErrorMode.NO);
}
});
-
- System.Threading.Thread.Sleep(50);
+ if (contrCount > 6)
+ {
+ //璁╁畠鍛堢幇涓�绉嶇洿鎺ヤ竴娆℃�у埛鍑烘潵鐨勬晥鏋�
+ System.Threading.Thread.Sleep(50);
+ }
}
}
@@ -844,7 +835,7 @@
HdlThreadLogic.Current.RunThread(() =>
{
- //鍒濆鍖栬澶囧崱鐗囧垪琛ㄦ帶浠�
+ //鍒濆鍖栧満鏅崱鐗囧垪琛ㄦ帶浠�
this.InitSceneListCardControl(listSceneBackContr, listScene);
});
}
@@ -858,7 +849,7 @@
//鍦烘櫙璁℃暟
int contrCount = 0;
//X杞村潗鏍�(鍥剧墖宸﹁竟鏈変綑鐧�)
- int XX = Application.GetMinRealAverage(44);
+ int XX = this.GetPictrueRealSize(44);
//Y杞村潗鏍�
int YY = 0;
foreach (var sceneUi in listScene)
@@ -885,11 +876,11 @@
//璁惧璁℃暟
contrCount++;
//姣忎袱涓悗,X杞撮噸缃�
- XX = contrCount % 2 == 0 ? Application.GetMinRealAverage(44) : cardContr.Right + Application.GetMinRealAverage(20);
+ XX = contrCount % 2 == 0 ? this.GetPictrueRealSize(44) : cardContr.Right + this.GetPictrueRealSize(20);
if (contrCount % 2 == 0)
{
//娌′袱涓箣鍚�,Y杞撮�掑
- YY = cardContr.Bottom + Application.GetMinRealAverage(15);
+ YY = cardContr.Bottom + this.GetPictrueRealSize(15);
}
//鎺т欢璁板綍鍒扮紦瀛樹腑
this.dicSceneCardControl[sceneUi.Id] = cardContr;
@@ -910,7 +901,11 @@
});
}
});
- System.Threading.Thread.Sleep(50);
+ if (contrCount > 6)
+ {
+ //璁╁畠鍛堢幇涓�绉嶄竴娆℃�ф樉绀哄嚭鏉ョ殑鏁堟灉
+ System.Threading.Thread.Sleep(50);
+ }
}
}
@@ -919,25 +914,19 @@
/// </summary>
private void ShowNoSceneTip()
{
- var noScene = new Button
- {
- Y = Application.GetRealHeight(69),
- Width = Application.GetMinRealAverage(683),
- Height = Application.GetMinRealAverage(392),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/NoFunction.png"
- };
- bodyFrameLayout.AddChidren(noScene);
- var noScenceTip = new Button()
- {
- Y = noScene.Bottom,
- Height = Application.GetRealHeight(200),
- Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- bodyFrameLayout.AddChidren(noScenceTip);
+ var picNoFunc = new PicViewControl(683, 392);
+ picNoFunc.Y = Application.GetRealHeight(69);
+ picNoFunc.Gravity = Gravity.CenterHorizontal;
+ picNoFunc.UnSelectedImagePath = "Item/NoFunction.png";
+ bodyFrameLayout.AddChidren(picNoFunc);
+
+ var btnTip = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(200), false);
+ btnTip.Y = picNoFunc.Bottom;
+ btnTip.Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n");
+ btnTip.TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor;
+ btnTip.TextAlignment = TextAlignment.Center;
+ btnTip.IsMoreLines = true;
+ bodyFrameLayout.AddChidren(btnTip);
}
/// <summary>
diff --git a/ZigbeeApp20200414/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp20200414/Shared/Phone/MainPage/ListRoomViewFrom.cs
index 009eccd..aba2d34 100755
--- a/ZigbeeApp20200414/Shared/Phone/MainPage/ListRoomViewFrom.cs
+++ b/ZigbeeApp20200414/Shared/Phone/MainPage/ListRoomViewFrom.cs
@@ -164,9 +164,9 @@
listRoom.Insert(0, HdlRoomLogic.Current.GetLoveRoom());
//X杞�
- int XX = Application.GetRealWidth(43);
+ int XX = this.GetPictrueRealSize(43);
//Y杞�
- int YY = Application.GetRealWidth(58);
+ int YY = this.GetPictrueRealSize(58);
//鎴块棿璁℃暟
int roomCount = 0;
foreach (var room in listRoom)
@@ -181,11 +181,11 @@
//鍔犵紦瀛�
this.dicCardControl[room.Id] = contr;
//姣忎袱涓噸缃甔杞�
- XX = roomCount % 2 == 0 ? Application.GetRealWidth(43) : contr.Right + Application.GetRealWidth(3);
+ XX = roomCount % 2 == 0 ? this.GetPictrueRealSize(43) : contr.Right + this.GetPictrueRealSize(3);
//姣忎袱涓疮鍔燳杞�
if (roomCount >= 2 && roomCount % 2 == 0)
{
- YY = contr.Bottom + Application.GetRealHeight(14);
+ YY = contr.Bottom + this.GetPictrueRealSize(14);
}
contr.ButtonClickEvent += (sender, e) =>
{
@@ -239,8 +239,8 @@
var frameBack = new FrameLayoutControl();
frameBack.X = XX;
frameBack.Y = YY;
- frameBack.Width = Application.GetRealWidth(495);
- frameBack.Height = Application.GetRealHeight(354);
+ frameBack.Width = this.GetPictrueRealSize(495);
+ frameBack.Height = this.GetPictrueRealSize(354);
listView.frameTable.AddChidren(frameBack);
//搴曢儴闃村奖鏁堟灉
@@ -249,23 +249,23 @@
frameBack.AddChidren(btnShadow, ChidrenBindMode.NotBind);
//鑳屾櫙鎺т欢
- var picBackGroud = new NormalViewControl(467, 311, true);
+ var picBackGroud = new NormalViewControl(this.GetPictrueRealSize(467), this.GetPictrueRealSize(311), false);
picBackGroud.Gravity = Gravity.CenterHorizontal;
- picBackGroud.Radius = (uint)Application.GetRealHeight(29);
+ picBackGroud.Radius = (uint)this.GetPictrueRealSize(29);
picBackGroud.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor3;
frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEventOnly);
//鏈垎閰嶅浘鏍�
var btnIcon = new PicViewControl(92, 72);
- btnIcon.X = Application.GetRealWidth(129);
- btnIcon.Y = Application.GetRealHeight(141);
+ btnIcon.X = this.GetPictrueRealSize(129);
+ btnIcon.Y = this.GetPictrueRealSize(141);
btnIcon.UnSelectedImagePath = "Room/NoNameRoom.png";
frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
//鏈垎閰�
var btnName = new NormalViewControl(141, 84, true);
- btnName.X = Application.GetRealWidth(244);
- btnName.Y = Application.GetRealHeight(131);
+ btnName.X = this.GetPictrueRealSize(244);
+ btnName.Y = this.GetPictrueRealSize(131);
btnName.IsBold = true;
btnName.TextColor = UserCenterColor.Current.White;
btnName.TextID = R.MyInternationalizationString.Unallocated;
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterColor.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterColor.cs
index 42d802e..8277d2c 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterColor.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterColor.cs
@@ -145,6 +145,10 @@
/// </summary>
public uint ErrorColor = 0xfff75858;
/// <summary>
+ /// 鍥剧墖閬僵鐨勯鑹�
+ /// </summary>
+ public uint PictrueZhezhaoColor = 0x12000000;
+ /// <summary>
/// 鐏拌壊(0xff6b6b6b) 鍏朵粬鍦版柟浼间箮鍦ㄧ敤,寤鸿涓嶈浣跨敤
/// </summary>
public uint Gray = 0xff6b6b6b;
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs
index 198b5b1..158bed1 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs
@@ -869,6 +869,10 @@
/// 涓婃姤鏃堕棿(hh:mm:ss)
/// </summary>
public string Time = string.Empty;
+ /// <summary>
+ /// 2020.04.13杩藉姞鏂板垎绫� 1:涓�鑸姤璀� 9000:闂ㄩ攣甯稿紑妯″紡鎶ヨ
+ /// </summary>
+ public int MsgDiv = 1;
}
#endregion
@@ -1284,6 +1288,10 @@
/// 寮哄埗璺宠浆鐪熷疄璁惧鐣岄潰 1->璁惧鍒楄〃寮哄埗璺宠浆
/// </summary>
public int GotoRealDeviceForm = 0;
+ /// <summary>
+ /// 寮哄埗璺宠浆缃戝叧浜у搧鐣岄潰 1->缃戝叧鍒楄〃寮哄埗璺宠浆
+ /// </summary>
+ public int GotoGatewayProductInfoForm = 0;
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
index b4aea46..6427e96 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
@@ -113,17 +113,35 @@
}
/// <summary>
- /// 鍒濆鍖栨帶浠跺ぇ灏�(浠ュ钩鍧囧�艰繘琛岀湡瀹炴暟鍊艰绠�)
+ /// 鍒濆鍖栧浘鏍囨帶浠跺ぇ灏�(浠ュ钩鍧囧�艰繘琛岀湡瀹炴暟鍊艰绠�)
/// </summary>
/// <param name="i_Width">瀹藉害</param>
/// <param name="i_Height">楂樺害</param>
/// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
- public void InitAvgSize(int i_Width, int i_Height, bool real = true)
+ public void InitIconSize(int i_Width, int i_Height, bool real = true)
{
if (real == true)
{
i_Width = Application.GetMinRealAverage(i_Width);
i_Height = Application.GetMinRealAverage(i_Height);
+ }
+
+ this.Height = i_Height;
+ this.Width = i_Width;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧浘鐗囨帶浠跺ぇ灏�
+ /// </summary>
+ /// <param name="i_Width">瀹藉害</param>
+ /// <param name="i_Height">楂樺害</param>
+ /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
+ public void InitPictrueSize(int i_Width, int i_Height, bool real = true)
+ {
+ if (real == true)
+ {
+ i_Width = HdlControlLogic.Current.GetPictrueRealSize(i_Width);
+ i_Height = HdlControlLogic.Current.GetPictrueRealSize(i_Height);
}
this.Height = i_Height;
@@ -281,7 +299,7 @@
return;
}
//Y杞撮噸缃�
- this.Y = UserCenterLogic.GetControlChidrenYaxis(this.Parent.Height, this.Height, alignment, Space);
+ this.Y = HdlControlLogic.Current.GetControlChidrenYaxis(this.Parent.Height, this.Height, alignment, Space);
}
/// <summary>
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs
index d48e6be..4c69fe1 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs
@@ -141,7 +141,7 @@
return;
}
//Y杞撮噸缃�
- this.Y = UserCenterLogic.GetControlChidrenYaxis(this.Parent.Height, this.Height, alignment, Space);
+ this.Y = HdlControlLogic.Current.GetControlChidrenYaxis(this.Parent.Height, this.Height, alignment, Space);
}
#endregion
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
index cbae180..62f0a2b 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
@@ -9,23 +9,42 @@
/// </summary>
public class InformationEditorControl
{
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙
+ /// </summary>
+ private FrameLayout detailBackFrame = null;
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private FrameListControl listview = null;
+ /// <summary>
+ /// 鏈�灏忛珮搴�
+ /// </summary>
+ private int minHeight = -1;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
/// <summary>
/// 鍒濆鍖栨帶浠�(杩斿洖鐨勬槸淇℃伅瀹瑰櫒鎺т欢)
/// </summary>
- /// <param name="bodyFrameLayout">bodyFrameLayout</param>
+ /// <param name="bodyFrameLayout">鐖舵帶浠�</param>
/// <param name="title">鏍囬鏂囨湰</param>
- /// <param name="Y">bodyFrameLayout閲岄潰鐨刌杞村潗鏍�</param>
/// <param name="Height">钃濇箹UI閲岄潰瀹冪殑楂樺害</param>
/// <returns>淇℃伅瀹瑰櫒鎺т欢</returns>
- public VerticalListControl InitControl(FrameLayout bodyFrameLayout, string title, int Y, int Height)
+ public FrameListControl InitControl(FrameLayout bodyFrameLayout, string title, int Height)
{
//鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙
- var detailBackFrame = new FrameLayout();
- detailBackFrame.Y = Application.GetRealHeight(Y);
- detailBackFrame.Height = Application.GetRealHeight(Height + 100);//楂樺害灏辨槸瑕佸畠瓒呰繃
+ this.detailBackFrame = new FrameLayout();
+ detailBackFrame.Height = Application.GetRealHeight(Height);
detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
detailBackFrame.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+ detailBackFrame.Gravity = Gravity.BottomCenter;
bodyFrameLayout.AddChidren(detailBackFrame);
+ this.minHeight = detailBackFrame.Height;
//淇℃伅缂栬緫
var btnTile = new NormalViewControl(800, 60, true);
@@ -36,7 +55,8 @@
btnTile.Text = title;
detailBackFrame.AddChidren(btnTile);
- var listview = new VerticalListControl(12);
+ //鍒楄〃鎺т欢
+ this.listview = new FrameListControl(12);
listview.Y = btnTile.Bottom + Application.GetRealHeight(17);
listview.Height = Application.GetRealHeight(Height) - btnTile.Bottom - Application.GetRealHeight(17);
detailBackFrame.AddChidren(listview);
@@ -45,31 +65,95 @@
}
/// <summary>
- /// 瀹屾垚鍒濆鍖�(褰撹鏁板鐨勬椂鍊�,杩欎釜鍑芥暟寰堟湁鐢ㄣ�傝鏁颁笉瓒呰繃瀹瑰櫒鏃讹紝璋冧笉璋冪敤杩欎釜鍑芥暟閮芥病浜�)
+ /// 瀹屾垚鍒濆鍖�
/// </summary>
- /// <param name="bodyFrameLayout">bodyFrameLayout</param>
- /// <param name="listview">瀹瑰櫒鎺т欢</param>
- public void FinishInitControl(FrameLayout bodyFrameLayout, VerticalListControl listview)
+ /// <param name="HadBottomButton">杩欎釜鎺т欢鎵�鍦ㄧ殑鐣岄潰,搴曢儴鏈夋病鏈変繚瀛樻寜閽�</param>
+ /// <param name="mandatoryAdjustment">寮哄埗璋冩暣楂樺害</param>
+ public void FinishInitControl(bool HadBottomButton = true, bool mandatoryAdjustment = false)
{
- var btnFinish = new BottomClickButton();
- //鍊熺敤Y杞村潗鏍�(璁╄繖涓尯鍩熶笉鑳界偣鍑昏彍鍗�)
- //var frameBack = new FrameLayout();
- //frameBack.Y = btnFinish.Yaxis;
- //frameBack.Height = bodyFrameLayout.Height - btnFinish.Yaxis;
- //bodyFrameLayout.AddChidren(frameBack);
-
- if (listview.ChildrenCount > 0)
+ if (HadBottomButton == true)
{
- var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount;
- if (bodyFrameLayout.Height - btnFinish.Yaxis + realHeight > listview.Height)
+ var btnFinish = new BottomClickButton();
+ //璁╁畠鍒敼鍙樺潗鏍�
+ int tempSpace = listview.rowSpace;
+ listview.rowSpace = 0;
+ //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩
+ var frameTemp = new FrameLayout();
+ frameTemp.Height = ControlCommonResourse.BodyFrameHeight - btnFinish.Yaxis + Application.GetRealHeight(23);
+ listview.AddChidren(frameTemp);
+
+ listview.rowSpace = tempSpace;
+ }
+
+ //璋冩暣瀹瑰櫒楂樺害澶у皬
+ int value = this.GetLocationMostLastViewBottom();
+ if (mandatoryAdjustment == false)
+ {
+ if (value + Application.GetRealHeight(23) < listview.Height)
{
- //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩
- var frameTemp = new FrameLayout();
- //frameTemp.Height = frameBack.Height + Application.GetRealHeight(115);
- frameTemp.Height = bodyFrameLayout.Height - btnFinish.Yaxis + Application.GetRealHeight(115);
- listview.AddChidren(frameTemp);
+ //涓嶉渶瑕佽皟鏁�
+ return;
}
}
+ //璋冩暣澶у皬
+ listview.Height = value + Application.GetRealHeight(23);
+
+ int backHeigth = listview.Bottom;
+ if (minHeight > backHeigth)
+ {
+ //瀹冩湁涓渶灏忛珮搴�
+ backHeigth = minHeight;
+ }
+ this.detailBackFrame.Height = backHeigth;
+
+ //鑾峰彇listview鎵�鍦ㄧ殑鍏ㄥ眬瀹瑰櫒鎺т欢
+ var contrFather = GetVerticalFrameControl(listview);
+ //璋冩暣妗屽竷澶у皬
+ contrFather?.AdjustTableHeight();
}
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鑾峰彇listview鎵�鍦ㄧ殑鍏ㄥ眬瀹瑰櫒鎺т欢
+ /// </summary>
+ /// <param name="listview"></param>
+ /// <returns></returns>
+ private VerticalFrameControl GetVerticalFrameControl(FrameListControl listview)
+ {
+ var myContr = listview.Parent;
+ while (myContr != null)
+ {
+ if (myContr is VerticalFrameControl)
+ {
+ return (VerticalFrameControl)myContr;
+ }
+ myContr = myContr.Parent;
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣
+ /// </summary>
+ /// <returns></returns>
+ private int GetLocationMostLastViewBottom()
+ {
+ int bottomHeight = -1;
+
+ for (int i = 0; i < this.listview.ChildrenCount; i++)
+ {
+ var child = this.listview.GetChildren(i);
+ if (child.Bottom > bottomHeight)
+ {
+ bottomHeight = child.Bottom;
+ }
+ }
+ return bottomHeight;
+ }
+
+ #endregion
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
index d0599a6..9d32c3d 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/RoomDeviceGroupMenuControl.cs
@@ -21,7 +21,7 @@
/// </summary>
public Action<List<CommonDevice>> SelectDeviceEvent = null;
/// <summary>
- /// 褰撳墠閫夋嫨鐨勪富閿�
+ /// 褰撳墠閫夋嫨鐨勪富閿�(鎴块棿绫诲瀷鏃讹細鎴块棿ID 璁惧绫诲瀷鏃讹細R鏂囦欢閲岄潰鐨処D)
/// </summary>
public string nowSelectKeys
{
@@ -29,20 +29,28 @@
{
if (dicDevice != null)
{
- return oldSelectKeys.ToString();
+ int index = 0;
+ foreach (var rId in dicDevice.Keys)
+ {
+ if (index == oldSelectIndex)
+ {
+ return rId.ToString();
+ }
+ }
+ return string.Empty;
}
- return dicRoom[oldSelectKeys].Id;
+ return listRoom[oldSelectIndex].Id;
}
}
/// <summary>
- /// 褰撳墠閫夋嫨鐨勪富閿�(鍐呴儴浣跨敤)
+ /// 褰撳墠閫夋嫨鐨勭储寮�(鍐呴儴浣跨敤)
/// </summary>
- private int oldSelectKeys = -1;
+ private int oldSelectIndex = -1;
/// <summary>
/// 鎴块棿瀵硅薄
/// </summary>
- private Dictionary<int, Common.Room> dicRoom = null;
+ private List<Common.Room> listRoom = null;
/// <summary>
/// 璁惧瀵硅薄
/// </summary>
@@ -66,11 +74,7 @@
/// <param name="i_listRoom">鎴块棿鍒楄〃</param>
public RoomDeviceGroupMenuControl(List<Common.Room> i_listRoom)
{
- this.dicRoom = new Dictionary<int, Common.Room>();
- for (int i = 0; i < i_listRoom.Count; i++)
- {
- this.dicRoom[i] = i_listRoom[i];
- }
+ this.listRoom = i_listRoom;
this.Height = Application.GetRealHeight(204);
}
@@ -102,20 +106,20 @@
var btnTempWidth = new ButtonBase();
btnTempWidth.TextSize = 12;
- if (this.dicRoom != null)
+ if (this.listRoom != null)
{
//鍒濆鍖栨埧闂存ā寮忕殑鎺т欢
- foreach (int keys in dicRoom.Keys)
+ for (int i = 0; i < listRoom.Count; i++)
{
- if (oldSelectKeys == -1)
+ if (oldSelectIndex == -1)
{
//鍒濆鍊�
- oldSelectKeys = keys;
+ oldSelectIndex = i;
}
//璁$畻瀛楃鐨勭湡瀹炲搴�
- btnTempWidth.Text = dicRoom[keys].Name;
- this.DoInitControl(scrolContr, keys, dicRoom[keys].Name, btnTempWidth.GetRealWidthByText());
+ btnTempWidth.Text = listRoom[i].Name;
+ this.DoInitControl(scrolContr, i, i, listRoom[i].Name, btnTempWidth.GetRealWidthByText());
}
}
else
@@ -124,19 +128,19 @@
int index = 0;
foreach (int keys in dicDevice.Keys)
{
- if (oldSelectKeys == -1)
+ if (oldSelectIndex == -1)
{
//鍒濆鍊�
- oldSelectKeys = keys;
+ oldSelectIndex = index;
}
//璁$畻瀛楃鐨勭湡瀹炲搴�
btnTempWidth.Text = Language.StringByID(keys);
- this.DoInitControl(scrolContr, keys, btnTempWidth.Text, btnTempWidth.GetRealWidthByText());
+ this.DoInitControl(scrolContr, keys, index, btnTempWidth.Text, btnTempWidth.GetRealWidthByText());
index++;
}
}
//璁╂帶浠舵粦鍔ㄥ埌鎸囧畾鐨勭储寮曚綅缃�
- scrolContr.ScrollToViewIndex(oldSelectKeys + 1);
+ scrolContr.ScrollToViewIndex(oldSelectIndex + 1);
}
/// <summary>
@@ -144,9 +148,10 @@
/// </summary>
/// <param name="scrolContr">鍒楄〃鎺т欢</param>
/// <param name="keys">瀛楀吀鐨勪富閿�</param>
+ /// <param name="index">绱㈠紩</param>
/// <param name="text">鏄剧ず鏂囨湰</param>
/// <param name="textWidth">鏂囨湰鐪熷疄瀹藉害</param>
- private void DoInitControl(HorizontalScrolViewLayout scrolContr, int keys, string text, int textWidth)
+ private void DoInitControl(HorizontalScrolViewLayout scrolContr, int keys, int index, string text, int textWidth)
{
//甯﹀簳鍥炬帶浠剁殑鏈�灏忓搴�
int minWidth = Application.GetRealWidth(255);
@@ -163,7 +168,7 @@
frameBack.Gravity = Gravity.Center;
frameBack.Height = Application.GetRealHeight(159);
frameBack.Width = realWidth;
- if (oldSelectKeys == keys)
+ if (oldSelectIndex == index)
{
frameBack.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
oldFrameBack = frameBack;
@@ -179,7 +184,7 @@
btnText.Text = text;
btnText.TextSize = 12;
btnText.TextAlignment = TextAlignment.Center;
- if (oldSelectKeys == keys)
+ if (oldSelectIndex == index)
{
btnText.TextColor = UserCenterColor.Current.White;
oldBtnText = btnText;
@@ -192,12 +197,12 @@
frameBack.ButtonClickEvent += (sender, e) =>
{
- if (oldSelectKeys == keys)
+ if (oldSelectIndex == index)
{
//鍚屼竴涓笢瑗�
return;
}
- oldSelectKeys = keys;
+ oldSelectIndex = index;
//鐘舵�佸彉鏇�
frameBack.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
@@ -212,25 +217,122 @@
{
this.SelectDeviceEvent?.Invoke(this.dicDevice[keys]);
}
- else if (this.dicRoom != null)
+ else if (this.listRoom != null)
{
- this.SelectRoomEvent?.Invoke(this.dicRoom[keys]);
+ this.SelectRoomEvent?.Invoke(this.listRoom[keys]);
}
};
//璋冪敤鍥炶皟鍑芥暟
- if (oldSelectKeys == keys)
+ if (oldSelectIndex == index)
{
if (this.dicDevice != null)
{
this.SelectDeviceEvent?.Invoke(this.dicDevice[keys]);
}
- else if (this.dicRoom != null)
+ else if (this.listRoom != null)
{
- this.SelectRoomEvent?.Invoke(this.dicRoom[keys]);
+ this.SelectRoomEvent?.Invoke(this.listRoom[keys]);
}
}
}
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="scrolContr">鍒楄〃鎺т欢</param>
+ /// <param name="keys">瀛楀吀鐨勪富閿�</param>
+ /// <param name="index">绱㈠紩</param>
+ /// <param name="text">鏄剧ず鏂囨湰</param>
+ /// <param name="textWidth">鏂囨湰鐪熷疄瀹藉害</param>
+ private void DoInitControl2(HorizontalScrolViewLayout scrolContr, int keys, int index, string text, int textWidth)
+ {
+ //甯﹀簳鍥炬帶浠剁殑鏈�灏忓搴�
+ int minWidth = Application.GetRealWidth(255);
+ //甯﹀簳鍥炬帶浠剁殑鐪熷疄瀹藉害 <鏂囧瓧鐨勫搴︾殑璁$畻 frameBack.Width - (int)(frameBack.Height * 0.47)>
+ int realWidth = textWidth + (int)(Application.GetRealHeight(159) * 0.47);
+ if (realWidth < minWidth)
+ {
+ realWidth = minWidth;
+ }
+
+ //甯﹀浘鐗囩殑
+ var frameBack = new FrameLayoutControl();
+ frameBack.UseClickStatu = false;
+ frameBack.Gravity = Gravity.Center;
+ frameBack.Height = Application.GetRealHeight(159);
+ frameBack.Width = realWidth;
+ frameBack.BorderWidth = 1;
+ frameBack.BorderColor = UserCenterColor.Current.TextColor1;
+ scrolContr.AddChidren(frameBack);
+ if (oldSelectIndex == index)
+ {
+ frameBack.SetViewShadow(true);
+ frameBack.BackgroundColor = UserCenterColor.Current.TextColor1;
+ oldFrameBack = frameBack;
+ }
+
+ //鏂囧瓧
+ var btnText = new NormalViewControl(textWidth, frameBack.Height, false);
+ btnText.Gravity = Gravity.CenterHorizontal;
+ btnText.Text = text;
+ btnText.TextSize = 12;
+ btnText.TextAlignment = TextAlignment.Center;
+ if (oldSelectIndex == index)
+ {
+ btnText.TextColor = UserCenterColor.Current.White;
+ oldBtnText = btnText;
+ }
+ else
+ {
+ btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
+ }
+ frameBack.AddChidren(btnText, ChidrenBindMode.BindEventOnly);
+
+ frameBack.ButtonClickEvent += (sender, e) =>
+ {
+ if (oldSelectIndex == index)
+ {
+ //鍚屼竴涓笢瑗�
+ return;
+ }
+ oldSelectIndex = index;
+
+ //鐘舵�佸彉鏇�
+ frameBack.SetViewShadow(true);
+ frameBack.BackgroundColor = UserCenterColor.Current.TextColor1;
+ btnText.TextColor = UserCenterColor.Current.White;
+
+ oldFrameBack.SetViewShadow(false);
+ oldFrameBack.BackgroundColor = UserCenterColor.Current.Transparent;
+ oldBtnText.TextColor = UserCenterColor.Current.TextGrayColor1;
+ oldFrameBack = frameBack;
+ oldBtnText = btnText;
+ //璋冪敤鍥炶皟鍑芥暟
+ if (this.dicDevice != null)
+ {
+ this.SelectDeviceEvent?.Invoke(this.dicDevice[keys]);
+ }
+ else if (this.listRoom != null)
+ {
+ this.SelectRoomEvent?.Invoke(this.listRoom[keys]);
+ }
+ };
+
+ //璋冪敤鍥炶皟鍑芥暟
+ if (oldSelectIndex == index)
+ {
+ if (this.dicDevice != null)
+ {
+ this.SelectDeviceEvent?.Invoke(this.dicDevice[keys]);
+ }
+ else if (this.listRoom != null)
+ {
+ this.SelectRoomEvent?.Invoke(this.listRoom[keys]);
+ }
+ }
+ }
+
#endregion
@@ -257,13 +359,13 @@
/// <param name="keys">鎴块棿ID 鎴栬�� R鏂囦欢閲岄潰鐨勬暟鍊肩紪鍙�(杞负瀛楃涓茬被鍨�)</param>
public void SetDefultIndex(string keys)
{
- if (dicRoom != null)
+ if (listRoom != null)
{
- foreach (int index in dicRoom.Keys)
+ for (int index = 0; index < listRoom.Count; index++)
{
- if (dicRoom[index].Id == keys)
+ if (listRoom[index].Id == keys)
{
- oldSelectKeys = index;
+ oldSelectIndex = index;
break;
}
}
@@ -276,7 +378,7 @@
{
if (rId == textId)
{
- oldSelectKeys = i;
+ oldSelectIndex = i;
break;
}
i++;
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
index a32a785..cc83e75 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameListControl.cs
@@ -54,5 +54,27 @@
base.AddChidren(view);
}
}
+
+ /// <summary>
+ /// 璋冩暣鐪熷疄楂樺害
+ /// </summary>
+ /// <param name="bottomSpace">搴曢儴楂樺害(闈炵湡瀹炲��)</param>
+ public void AdjustRealHeight(int bottomSpace = 0)
+ {
+ int bottomHeight = -1;
+
+ for (int i = 0; i < this.ChildrenCount; i++)
+ {
+ var child = this.GetChildren(i);
+ if (child.Bottom > bottomHeight)
+ {
+ bottomHeight = child.Bottom;
+ }
+ }
+ if (bottomHeight != -1)
+ {
+ this.Height = bottomHeight + bottomSpace;
+ }
+ }
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
index 0a70c26..8038b83 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs
@@ -5,7 +5,7 @@
namespace Shared.Phone.UserCenter
{
/// <summary>
- /// 鍋氭垚涓�涓噷闈㈠彧瑁匜rameLayout鐨勫垪琛ㄥ瀷鎺т欢(瀹冧笉浼氳皟鏁撮珮搴�)
+ /// 鍋氭垚涓�涓噷闈㈠彧瑁匜rameLayout鐨勫垪琛ㄥ瀷鎺т欢(瀹冧笉浼氳皟鏁撮珮搴�,鏈夋甯�)
/// </summary>
public class VerticalFrameControl : VerticalScrolViewLayout
{
@@ -96,13 +96,14 @@
/// <param name="buttomSpace">搴曢儴绌虹櫧闂磋窛(鐪熷疄鍊�)</param>
public void AdjustChidrenFrameHeight(FrameLayout frame, int buttomSpace)
{
- var child = frame.GetChildren(frame.ChildrenCount - 1);
- if (child != null)
+ //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣
+ int value = this.GetLocationMostLastViewBottom(frame);
+ if (value != -1)
{
//璋冩暣妗屽竷楂樺害
- if (frame.Height < child.Bottom + buttomSpace)
+ if (frame.Height < value + buttomSpace)
{
- frame.Height = child.Bottom + buttomSpace;
+ frame.Height = value + buttomSpace;
}
}
}
@@ -112,11 +113,12 @@
/// </summary>
public void AdjustTableHeight()
{
- var child = this.m_frameTable?.GetChildren(this.m_frameTable.ChildrenCount - 1);
- if (child != null)
+ //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣
+ int value = this.GetLocationMostLastViewBottom(this.m_frameTable);
+ if (value != -1)
{
//璋冩暣妗屽竷楂樺害
- this.m_frameTable.Height = child.Bottom;
+ this.m_frameTable.Height = value;
}
}
@@ -133,9 +135,12 @@
return;
}
//娣诲姞涓存椂鎺т欢,鐩磋嚦鍙互婊戝姩瓒呰繃搴曢儴鎸夐挳
+ int oldRowSpace = this.rowSpace;
+ this.rowSpace = 0;
var frameBackTemp = new FrameLayout();
frameBackTemp.Height = ControlCommonResourse.BodyFrameHeight - btnTemp.Yaxis + Application.GetRealHeight(23);
this.AddChidrenFrame(frameBackTemp);
+ this.rowSpace = oldRowSpace;
}
/// <summary>
@@ -149,6 +154,27 @@
}
}
+ /// <summary>
+ /// 鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣
+ /// </summary>
+ /// <returns></returns>
+ private int GetLocationMostLastViewBottom(FrameLayout frame)
+ {
+ int bottomHeight = -1;
+
+ if (frame == null) { return bottomHeight; }
+
+ for (int i = 0; i < frame.ChildrenCount; i++)
+ {
+ var child = frame.GetChildren(i);
+ if (child.Bottom > bottomHeight)
+ {
+ bottomHeight = child.Bottom;
+ }
+ }
+ return bottomHeight;
+ }
+
#endregion
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/DateSelectControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/DateSelectControl.cs
index f05c584..97a1833 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/DateSelectControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/DateSelectControl.cs
@@ -83,8 +83,13 @@
this.dateFomat = i_dateFomat;
this.titleText = i_titleText;
+ //鐢ㄦ潵璁$畻闀垮害鐨�
+ string dateTextTemp = DateTime.Now.ToString(i_dateFomat);
this.TextSize = 12;
- this.InitSize(210, 49, true);
+ this.Text = dateTextTemp;
+
+ this.InitSize(this.GetRealWidthByText(), Application.GetRealHeight(50), false);
+ this.Text = string.Empty;
//寮硅捣鏃ユ湡閫夋嫨
this.ButtonClickEvent += (sender, e) =>
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs
index f626800..6068952 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs
@@ -20,7 +20,7 @@
/// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
public IconViewControl(int size = 110, bool real = true)
{
- this.InitAvgSize(size, size, real);
+ this.InitIconSize(size, size, real);
this.IconSize = size;
if (real == true)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs
index 5572b5a..70dd722 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/InformationTipView.cs
@@ -16,7 +16,7 @@
/// <param name="size">瑙掓爣澶у皬</param>
public InformationTipView(ButtonBase TargetView, int size = 30)
{
- this.InitAvgSize(size, size, true);
+ this.InitIconSize(size, size, true);
this.BackgroundColor = UserCenterColor.Current.Red;
this.Radius = (uint)Application.GetMinRealAverage(size) / 2;
this.X = TargetView.X + TargetView.Width / 2 + Application.GetRealWidth(10);
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/PicViewControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/PicViewControl.cs
index 7216c7c..4e4a5e3 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/PicViewControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/PicViewControl.cs
@@ -5,19 +5,19 @@
namespace Shared.Phone.UserCenter
{
/// <summary>
- /// 鍋氭垚涓�涓樉绀哄浘鐗囩殑鏅�氭帶浠�(姣旂巼閲囧彇骞冲潎鍊�)鉁�
+ /// 鍋氭垚涓�涓樉绀哄浘鐗囩殑鏅�氭帶浠垛湬
/// </summary>
public class PicViewControl : ButtonBase
{
/// <summary>
- /// 鍋氭垚涓�涓樉绀哄浘鐗囩殑鏅�氭帶浠�(姣旂巼閲囧彇骞冲潎鍊�)
+ /// 鍋氭垚涓�涓樉绀哄浘鐗囩殑鏅�氭帶浠�
/// </summary>
/// <param name="i_Width">瀹藉害</param>
/// <param name="i_Height">楂樺害</param>
/// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
public PicViewControl(int i_Width, int i_Height, bool real = true)
{
- this.InitAvgSize(i_Width, i_Height, real);
+ this.InitPictrueSize(i_Width, i_Height, real);
}
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs
index c017895..1e42396 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/RowLayoutControl.cs
@@ -91,8 +91,9 @@
/// <summary>
/// 娣诲姞缂栬緫鎺т欢
/// </summary>
+ /// <param name="hideMenuByClick">鐐瑰嚮鏃�,鏄惁闅愯棌宸︽粦鑿滃崟</param>
/// <returns></returns>
- public NormalViewControl AddEditorControl()
+ public NormalViewControl AddEditorControl(bool hideMenuByClick = true)
{
var btnEditor = new NormalViewControl(Application.GetRealWidth(184), this.Height, false);
btnEditor.BackgroundColor = 0xff4a4a4a;
@@ -101,6 +102,14 @@
btnEditor.TextAlignment = TextAlignment.Center;
btnEditor.TextID = R.MyInternationalizationString.uEditor;
this.AddRightView(btnEditor);
+ if (hideMenuByClick == true)
+ {
+ btnEditor.ButtonClickEvent += (sender, e) =>
+ {
+ //鍏抽棴宸︽粦鑿滃崟
+ this.HideMenu();
+ };
+ }
return btnEditor;
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs
index 5246663..88b24d8 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs
@@ -579,17 +579,31 @@
}
else if (info.AlarmCode == 216)
{
- //甯稿紑妯″紡寮�鍚�
+ //甯稿紑妯″紡寮�鍚�(闂ㄩ攣瑙﹀彂)
alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg6);
+ alarmInfo.MsgDiv = 9000;
}
else if (info.AlarmCode == 217)
{
- //甯稿紑妯″紡缁撴潫
- alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg7);
+ //甯稿紑妯″紡缁撴潫(闂ㄩ攣瑙﹀彂)
+ alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg7);
+ alarmInfo.MsgDiv = 9000;
+ }
+ else if (info.AlarmCode == 218)
+ {
+ //甯稿紑妯″紡寮�鍚�(缃戝叧瑙﹀彂)
+ alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg9);
+ alarmInfo.MsgDiv = 9000;
+ }
+ else if (info.AlarmCode == 219)
+ {
+ //甯稿紑妯″紡缁撴潫(缃戝叧瑙﹀彂)
+ alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg10);
+ alarmInfo.MsgDiv = 9000;
}
else if (info.AlarmCode == 232)
{
- //闂ㄩ搩瑙﹀彂
+ //鏈変汉璁块棶
alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg8);
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlControlLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlControlLogic.cs
new file mode 100755
index 0000000..dff6a77
--- /dev/null
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlControlLogic.cs
@@ -0,0 +1,84 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 鎺т欢鐨勯�昏緫
+ /// </summary>
+ public class HdlControlLogic
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鎺т欢鐨勯�昏緫
+ /// </summary>
+ private static HdlControlLogic m_Current = null;
+ /// <summary>
+ /// 鎺т欢鐨勯�昏緫
+ /// </summary>
+ public static HdlControlLogic Current
+ {
+ get
+ {
+ if (m_Current == null)
+ {
+ m_Current = new HdlControlLogic();
+ }
+ return m_Current;
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 瀛愭帶浠剁殑Y杞村潗鏍嘷___________________
+
+ /// <summary>
+ /// 鎸囧畾浣嶇疆绫诲瀷鑾峰彇Rowlayout鐨勫瓙鎺т欢鐨刌杞村潗鏍�(璇风‘淇濆瓙鎺т欢涓嶅ぇ浜庣埗瀹瑰櫒)
+ /// </summary>
+ /// <param name="fatherCtrHeight">鐖舵帶浠剁殑鐪熷疄楂樺害</param>
+ /// <param name="ctrHeight">瀛愭帶浠剁殑鐪熷疄楂樺害</param>
+ /// <param name="alignment">浣嶇疆瀵归綈鏂瑰紡</param>
+ /// <param name="Space">涓婁笅闂寸殑绌虹櫧闂磋窛,鐪佺暐鏃讹紝鍙栬鎺т欢鍏遍�氬彉閲忕殑鍊笺�傝缃负-1鏃讹紝涓嶈绠楃┖鐧介棿璺�</param>
+ /// <returns></returns>
+ public int GetControlChidrenYaxis(int fatherCtrHeight, int ctrHeight, UViewAlignment alignment, int Space = 0)
+ {
+ if (Space < 0)
+ {
+ //涓嶈绠楅棿璺濆��
+ Space = 0;
+ }
+
+ if (alignment == UViewAlignment.Center)
+ {
+ return fatherCtrHeight / 2 - ctrHeight / 2;
+ }
+ else if (alignment == UViewAlignment.Top)
+ {
+ return (fatherCtrHeight / 2 - Space / 2) / 2 - ctrHeight / 2;
+ }
+ else
+ {
+ int top = fatherCtrHeight / 2 + Space / 2;
+ return top + (fatherCtrHeight - top) / 2 - ctrHeight / 2;
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 璁$畻鍥剧墖鐪熷疄澶у皬___________________
+
+ /// <summary>
+ /// 璁$畻鍥剧墖鐨勭湡瀹為珮瀹藉害
+ /// </summary>
+ /// <param name="i_size"></param>
+ /// <returns></returns>
+ public int GetPictrueRealSize(int i_size)
+ {
+ return Application.GetRealWidth(i_size);
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs
new file mode 100755
index 0000000..fae3017
--- /dev/null
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceDoorLockLogic.cs
@@ -0,0 +1,191 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 闂ㄩ攣鍘嗗彶璁板綍鐨勯�昏緫
+ /// </summary>
+ public class HdlDeviceDoorLockLogic
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 闂ㄩ攣鍘嗗彶璁板綍鐨勯�昏緫
+ /// </summary>
+ private static HdlDeviceDoorLockLogic m_Current = null;
+ /// <summary>
+ /// 闂ㄩ攣鍘嗗彶璁板綍鐨勯�昏緫
+ /// </summary>
+ public static HdlDeviceDoorLockLogic Current
+ {
+ get
+ {
+ if (m_Current == null)
+ {
+ m_Current = new HdlDeviceDoorLockLogic();
+ }
+ return m_Current;
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 娣诲姞鍘嗗彶璁板綍_______________________
+
+ /// <summary>
+ /// 娣诲姞鍘嗗彶璁板綍
+ /// </summary>
+ /// <param name="i_doorLock">闂ㄩ攣瀵硅薄</param>
+ /// <param name="OtherOpenLockMode">鍏朵粬寮�閿佹柟寮� 9001:甯稿紑鎵撳紑 9002:甯稿紑鍙栨秷 9003:甯稿紑鎸佺画</param>
+ /// <param name="NormallyOpenContinuedTime">甯稿紑鎸佺画鏃堕棿(1~72灏忔椂 OtherOpenLockMode=9003鐨勬椂鍊欐湁鏁�)</param>
+ public void AddDoorHistoryLog(ZigBee.Device.DoorLock i_doorLock, int OtherOpenLockMode, string NormallyOpenContinuedTime)
+ {
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+ //鑾峰彇闂ㄩ攣鐨勪富閿甀D
+ var DoorLockId = await this.GetDoorHistoryDoorLockId(i_doorLock);
+
+ var pra = new AddDoorHistoryLogPra();
+ pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ pra.DoorLockId = DoorLockId;
+ pra.OtherOpenLockMode = OtherOpenLockMode;
+ pra.NormallyOpenContinuedTime = NormallyOpenContinuedTime;
+
+ //涓嶄簩娆″彂閫�,涓嶆娴嬮敊璇爜
+ var listCheck = new List<string>() { "NotSetAgain", "NotCheck" };
+ var result = await UserCenterLogic.GetResultStatuByRequestHttps("DoorLock/AddDoorLockHistory", true, pra, listCheck);
+ if (result == false)
+ {
+ }
+ });
+ }
+
+ /// <summary>
+ /// 鑾峰彇娣诲姞闂ㄩ攣鍘嗗彶璁板綍鐨凞oorLockId
+ /// </summary>
+ /// <param name="i_doorLock">闂ㄩ攣瀵硅薄</param>
+ /// <returns></returns>
+ private async System.Threading.Tasks.Task<string> GetDoorHistoryDoorLockId(ZigBee.Device.DoorLock i_doorLock)
+ {
+ var pra = new GetDoorIdPra();
+ pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ pra.DoorLockId = i_doorLock.DeviceAddr + "_" + i_doorLock.DeviceEpoint;
+ //涓嶄簩娆″彂閫�,涓嶆娴嬮敊璇爜
+ var listCheck = new List<string>() { "NotSetAgain", "NotCheck" };
+ var result = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockPager", true, pra, listCheck);
+ if (result == null) { return null; }
+
+ //濡傛灉宸茬粡鍒涘缓浜�,鍒欎笉鍐嶅垱寤�
+ var myData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.GetDoorLockDataRes>(result);
+ if (myData.PageData.Count > 0)
+ {
+ return myData.PageData[0].Id;
+ }
+
+ //濡傛灉杩樻病鏈夊垱寤�,鍒欒櫄鎷熶竴涓壒娈婄殑涓滆タ鍑烘潵
+ var pra2 = new AddDoorPra();
+ pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ pra2.DoorLockId = i_doorLock.DeviceAddr + "_" + i_doorLock.DeviceEpoint;
+ var result2 = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/AddDoorLock", true, pra, listCheck);
+ //浜戠鏄洿鎺ヨ繑鍥炲垱寤虹殑涓婚敭瀛楃涓�
+ return result2;
+ }
+
+ /// <summary>
+ /// 娣诲姞鍘嗗彶璁板綍鐨勫弬鏁�
+ /// </summary>
+ private class AddDoorHistoryLogPra : IfacePraCommon
+ {
+ /// <summary>
+ /// RequestVersion
+ /// </summary>
+ public string RequestVersion = Common.CommonPage.RequestVersion;
+ /// <summary>
+ /// LoginAccessToken
+ /// </summary>
+ public string LoginAccessToken = string.Empty;
+ /// <summary>
+ /// ZigbeeHomeId
+ /// </summary>
+ public string HomeId = Common.Config.Instance.Home.Id;
+ /// <summary>
+ /// 闂ㄩ攣浜戠涓婚敭(鍦�(鑾峰彇鏌愪釜浣忓畢闂ㄩ攣鍒嗛〉)鎺ュ彛鍝嶅簲涓殑Id鍊�)
+ /// </summary>
+ public string DoorLockId = string.Empty;
+ /// <summary>
+ /// 鍏朵粬寮�閿佹柟寮� 9001:甯稿紑鎵撳紑 9002:甯稿紑鍙栨秷 9003:甯稿紑鎸佺画
+ /// </summary>
+ public int OtherOpenLockMode = -1;
+ /// <summary>
+ /// 甯稿紑鎸佺画鏃堕棿(1~72灏忔椂 OtherOpenLockMode=9003鐨勬椂鍊欐湁鏁�)
+ /// </summary>
+ public string NormallyOpenContinuedTime = string.Empty;
+ }
+
+ /// <summary>
+ /// 鑾峰彇娣诲姞闂ㄩ攣鍘嗗彶璁板綍鐨凞oorLockId鐨勫弬鏁�
+ /// </summary>
+ private class GetDoorIdPra : IfacePraCommon
+ {
+ /// <summary>
+ /// RequestVersion
+ /// </summary>
+ public string RequestVersion = Common.CommonPage.RequestVersion;
+ /// <summary>
+ /// LoginAccessToken
+ /// </summary>
+ public string LoginAccessToken = string.Empty;
+ /// <summary>
+ /// ZigbeeHomeId
+ /// </summary>
+ public string HomeId = Common.Config.Instance.Home.Id;
+ /// <summary>
+ /// 濉獹UID
+ /// </summary>
+ public string CloudAccountId = Common.Config.Instance.Guid;
+ /// <summary>
+ /// 杩欎釜鏄棬閿佺殑 Mac_绔偣
+ /// </summary>
+ public string DoorLockId = string.Empty;
+ /// <summary>
+ /// 寮�閿佹柟寮�:鍥哄畾9000
+ /// </summary>
+ public int OpenLockMode = 9000;
+ }
+
+ /// <summary>
+ /// 娣诲姞闂ㄩ攣鐨勫弬鏁�
+ /// </summary>
+ private class AddDoorPra : IfacePraCommon
+ {
+ /// <summary>
+ /// RequestVersion
+ /// </summary>
+ public string RequestVersion = Common.CommonPage.RequestVersion;
+ /// <summary>
+ /// LoginAccessToken
+ /// </summary>
+ public string LoginAccessToken = string.Empty;
+ /// <summary>
+ /// ZigbeeHomeId
+ /// </summary>
+ public string HomeId = Common.Config.Instance.Home.Id;
+ /// <summary>
+ /// 濉獹UID
+ /// </summary>
+ public string CloudAccountId = Common.Config.Instance.Guid;
+ /// <summary>
+ /// 杩欎釜鏄棬閿佺殑 Mac_绔偣
+ /// </summary>
+ public string DoorLockId = string.Empty;
+ /// <summary>
+ /// 鍏朵粬寮�閿佹柟寮� 鍥哄畾9000
+ /// </summary>
+ public int OpenLockMode = 9000;
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
old mode 100755
new mode 100644
index 4952414..3b7946a
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
@@ -75,8 +75,8 @@
//娓呯┖鏈湴缂撳瓨
this.dicRooms.Clear();
//妫�娴嬫垜鐨勫枩鐖辫繖涓埧闂村璞�
- this.CheckLoveRoom();
-
+ this.CheckLoveRoom();
+
foreach (var roomId in Config.Instance.Home.ListRooms)
{
//浠庢枃浠堕噷闈㈣幏鍙栨埧闂村璞�
@@ -123,7 +123,14 @@
}
}
//妫�娴嬫ゼ灞傛暟鎹殑鍚堟硶鎬�
- this.CheckFloorData(listRoomFile);
+ if (UserCenterResourse.UserInfo.AuthorityNo == 3)
+ {
+ this.CheckMemberFloorData(listRoomFile);
+ }
+ else
+ {
+ this.CheckAdminFloorData(listRoomFile);
+ }
homeTemp.Save(false);
InitAllRoom();
@@ -144,8 +151,12 @@
/// 妫�娴嬫ゼ灞傛暟鎹殑鍚堟硶鎬�
/// </summary>
/// <param name="listRoomFile"></param>
- private void CheckFloorData(List<string> listRoomFile)
+ private void CheckAdminFloorData(List<string> listRoomFile)
{
+ //娌℃湁妤煎眰,鍒欐棤闇�澶勭悊
+ if (Config.Instance.Home.FloorDics.Count == 0) { return; }
+
+ //涓讳汉鎴栬�呯鐞嗗憳鐨勮瘽,灏辨娴嬫槸鍚﹀瓨鍦ㄦ湭鍒嗛厤妤煎眰鐨勬埧闂�
for (int i = 0; i < listRoomFile.Count; i++)
{
try
@@ -163,6 +174,49 @@
}
catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
}
+ }
+
+ /// <summary>
+ /// 妫�娴嬫ゼ灞傛暟鎹殑鍚堟硶鎬�
+ /// </summary>
+ /// <param name="listRoomFile"></param>
+ private void CheckMemberFloorData(List<string> listRoomFile)
+ {
+ //娌℃湁妤煎眰,鍒欐棤闇�澶勭悊
+ if (Config.Instance.Home.FloorDics.Count == 0) { return; }
+
+ //鎴愬憳鐨勮瘽,灏辨娴嬫槸鍚﹀瓨鍦ㄦ病鏈夋埧闂寸殑妤煎眰
+ var listEsixtFloor = new List<string>();
+ for (int i = 0; i < listRoomFile.Count; i++)
+ {
+ try
+ {
+ var byteData = Global.ReadFileByHomeId(listRoomFile[i]);
+ string valueData = System.Text.Encoding.UTF8.GetString(byteData);
+ var roomTemp = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.Room>(valueData);
+ if (roomTemp.FloorId != string.Empty && listEsixtFloor.Contains(roomTemp.FloorId) == false)
+ {
+ //鏀堕泦妤煎眰
+ listEsixtFloor.Add(roomTemp.FloorId);
+ }
+ }
+ catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
+ }
+ var listDeleteId = new List<string>();
+ foreach (var flootId in Config.Instance.Home.FloorDics.Keys)
+ {
+ if (listEsixtFloor.Contains(flootId) == false)
+ {
+ //濡傛灉杩欎釜id涓嶅瓨鍦ㄤ簬浠讳綍鎴块棿鐨勮瘽,鏀堕泦瀹�
+ listDeleteId.Add(flootId);
+ }
+ }
+ foreach (var deleteId in listDeleteId)
+ {
+ //鍒犻櫎杩欎釜id
+ Config.Instance.Home.FloorDics.Remove(deleteId);
+ }
+ Config.Instance.Home.Save(false);
}
#endregion
@@ -307,10 +361,19 @@
/// </summary>
/// <returns>鎴块棿鍚�</returns>
/// <param name="device">璁惧瀵硅薄</param>
- /// <param name="append">鍦ㄦゼ灞傚拰鎴块棿鍚嶅瓧鐨勪腑闂存坊鍔犵殑瀛楃(浠呴檺鏈夋ゼ灞傜殑鏃跺�欐湁鏁�)</param>
- public string GetRoomNameByDevice(CommonDevice device, string append = " ")
+ public string GetRoomNameByDevice(CommonDevice device)
{
var room = this.GetRoomByDevice(device);
+ return this.GetFloorRoomName(room);
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎴块棿鍚嶅瓧(妤煎眰+鎴块棿鍚�)
+ /// </summary>
+ /// <returns>鎴块棿鍚�</returns>
+ /// <param name="room">鎴块棿瀵硅薄</param>
+ public string GetFloorRoomName(Room room)
+ {
if (room == null)
{
//鏈垎閰嶅尯鍩�
@@ -319,7 +382,7 @@
if (Config.Instance.Home.FloorDics.ContainsKey(room.FloorId) == true)
{
//(妤煎眰+鎴块棿鍚�)
- return Config.Instance.Home.FloorDics[room.FloorId] + append + room.Name;
+ return Config.Instance.Home.FloorDics[room.FloorId] + " " + room.Name;
}
return room.Name;
}
@@ -966,15 +1029,19 @@
}
var dic = new Dictionary<string, string>();
- for (int i = 0; i < listFloorSort.Count; i++)
- {
- if (Config.Instance.Home.FloorDics.ContainsKey(listFloorSort[i]) == true)
- {
- dic[listFloorSort[i]] = Config.Instance.Home.FloorDics[listFloorSort[i]];
- }
- }
-
- //淇濆瓨椤哄簭
+ if (listFloorSort != null)
+ {
+ for (int i = 0; i < listFloorSort.Count; i++)
+ {
+ if (Config.Instance.Home.FloorDics.ContainsKey(listFloorSort[i]) == true)
+ {
+ dic[listFloorSort[i]] = Config.Instance.Home.FloorDics[listFloorSort[i]];
+ }
+ }
+ }
+
+
+ //淇濆瓨椤哄簭
UserCenterLogic.SaveFileContent(fullName, listFloorSort);
return dic;
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
index 4a49fa5..35fc675 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
@@ -2085,7 +2085,7 @@
dicSort[modelNo] = Language.StringByID(R.MyInternationalizationString.Mode_Dry);
}
}
- else if (info.Data1 == 4 || info.Data1 == 5)
+ else if (info.Data1 == 4 || info.Data1 == 5|| info.Data1 == 7)
{
//娓╁害
dicSort[temparetureNo] = $"{ info.Data2 / 100}鈩�";
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
index 925d1eb..ce36714 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
@@ -353,7 +353,7 @@
//寤舵椂
removeData.Type = 2;
removeData.DelayTime = data.DelayTime;
- removeData.MemberNumber = i + 1;
+ removeData.MemberNumber = data.MemberNumber;
}
//鎷ユ湁鎴愬姛鐨�
deleteTargetData.Add(removeData);
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs
index 095152f..2da6efc 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs
@@ -365,6 +365,8 @@
}
}
+ //娓呯┖妤煎眰鏁版嵁
+ Common.Config.Instance.Home.FloorDics.Clear();
//鐒跺悗妫�娴嬫湰鍦扮殑鏂囦欢
var listLocalFile = Global.FileListByHomeId();
foreach (string fileName in listLocalFile)
@@ -375,8 +377,7 @@
var varData = Global.ReadFileByHomeId(fileName);
var dicFloor = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(Encoding.UTF8.GetString(varData));
Common.Config.Instance.Home.FloorDics = dicFloor;
- Common.Config.Instance.Home.Save(false);
-
+ //鏆傛椂涓嶄繚瀛�,鐣欏湪鏈�鍚庨潰鎵嶄繚瀛�
Global.DeleteFilebyHomeId(fileName);
}
@@ -425,6 +426,10 @@
dicUpdateTime.Remove(fileName);
}
}
+
+ //淇濆瓨妤煎眰鏁版嵁
+ Common.Config.Instance.Home.Save(false);
+
//缃戝叧鏂囦欢闈炲悎娉曟�ф槸鍒锋柊璁惧鍒楄〃鐨勫嚱鏁伴噷闈㈠疄鐜�
//淇濆瓨鍏ㄩ儴鍒嗕韩鏂囦欢鐨勬洿鏂版棩鏈�
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index bb2ab6f..2beb098 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -734,41 +734,6 @@
#endregion
- #region 鈻� 瀛愭帶浠剁殑Y杞村潗鏍嘷___________________
-
- /// <summary>
- /// 鎸囧畾浣嶇疆绫诲瀷鑾峰彇Rowlayout鐨勫瓙鎺т欢鐨刌杞村潗鏍�(璇风‘淇濆瓙鎺т欢涓嶅ぇ浜庣埗瀹瑰櫒)
- /// </summary>
- /// <param name="fatherCtrHeight">鐖舵帶浠剁殑鐪熷疄楂樺害</param>
- /// <param name="ctrHeight">瀛愭帶浠剁殑鐪熷疄楂樺害</param>
- /// <param name="alignment">浣嶇疆瀵归綈鏂瑰紡</param>
- /// <param name="Space">涓婁笅闂寸殑绌虹櫧闂磋窛,鐪佺暐鏃讹紝鍙栬鎺т欢鍏遍�氬彉閲忕殑鍊笺�傝缃负-1鏃讹紝涓嶈绠楃┖鐧介棿璺�</param>
- /// <returns></returns>
- public static int GetControlChidrenYaxis(int fatherCtrHeight, int ctrHeight, UViewAlignment alignment, int Space = 0)
- {
- if (Space < 0)
- {
- //涓嶈绠楅棿璺濆��
- Space = 0;
- }
-
- if (alignment == UViewAlignment.Center)
- {
- return fatherCtrHeight / 2 - ctrHeight / 2;
- }
- else if (alignment == UViewAlignment.Top)
- {
- return (fatherCtrHeight / 2 - Space / 2) / 2 - ctrHeight / 2;
- }
- else
- {
- int top = fatherCtrHeight / 2 + Space / 2;
- return top + (fatherCtrHeight - top) / 2 - ctrHeight / 2;
- }
- }
-
- #endregion
-
#region 鈻� 鎷兼帴淇℃伅___________________________
/// <summary>
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
index 5dbc59c..8c174d1 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勭綉鍏�
/// </summary>
@@ -78,15 +78,19 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1368);
//鍥剧墖
var btnPic = new DeviceInfoIconControl();
btnPic.Y = Application.GetRealHeight(92);
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
btnPic.InitControl(this.deviceAc);
//璁惧澶囨敞
@@ -190,7 +194,7 @@
};
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
old mode 100644
new mode 100755
index 6cf8f1a..cdbc6d0
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
@@ -1,7 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
using Shared.Common;
-using Shared.Phone.Device.Light;
using Shared.Phone.UserCenter.Device;
using ZigBee.Device;
using static ZigBee.Device.BindObj;
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
old mode 100644
new mode 100755
index 76ed96c..72394ac
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using Microsoft.AppCenter.Crashes;
using Shared.Common;
-using Shared.Phone.Device.Light;
using Shared.Phone.UserCenter.Device;
using ZigBee.Device;
using static ZigBee.Device.BindObj;
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
index 2c9ebe9..49fbae3 100644
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
@@ -12,7 +12,7 @@
}
#region 鈼� 鍙橀噺鐢虫槑__________________________
public FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout };
- public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1921 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout };
+ public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1925 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout };
public FrameLayout bottomRadiusFrameLayout = new FrameLayout()
{
Height = Application.GetRealHeight(100),
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
old mode 100755
new mode 100644
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
index 586f04d..b0f791b 100644
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -359,6 +359,7 @@
{
midVerticalRefreshLayout = new VerticalFrameRefreshControl(29)
{
+ Height = this.midFrameLayout.Height + 1,
};
this.midFrameLayout.AddChidren(midVerticalRefreshLayout);
midVerticalRefreshLayout.BeginHeaderRefreshingAction += () =>
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
index 46ead4f..be1e0ef 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
@@ -17,7 +17,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勮澶�
/// </summary>
@@ -80,12 +80,16 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
this.tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 562, 1175);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1175);
//鍒濆鍖栬澶囧洖璺浘鏍�
- this.InitDeviceEpointIcon();
+ this.InitDeviceEpointIcon(listBackControl);
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -211,7 +215,7 @@
//娣诲姞鑳屽厜鐏
this.AddBackLightRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
}
#endregion
@@ -431,7 +435,7 @@
/// <summary>
/// 鍒濆鍖栬澶囧洖璺浘鏍�
/// </summary>
- private void InitDeviceEpointIcon()
+ private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
{
//鑾峰彇鎸夌粍鍒嗛厤鐨勮澶�
var listIcon = this.GetAllDeviceGroup();
@@ -442,9 +446,7 @@
frameBorder.Width = Application.GetRealWidth(887);
frameBorder.Height = Application.GetRealHeight(423);
frameBorder.Radius = (uint)Application.GetRealHeight(6);
- frameBorder.BorderWidth = 1;
- frameBorder.BorderColor = 0xffd0d0d0;
- bodyFrameLayout.AddChidren(frameBorder);
+ listBackControl.frameTable.AddChidren(frameBorder);
var frameBack = new FrameLayout();
frameBack.Height = frameBorder.Height;
@@ -454,7 +456,7 @@
//闇�瑕佹粦鍔ㄦ帶浠�
var listControl = new VerticalScrolViewLayout();
listControl.Height = frameBorder.Height;
- bodyFrameLayout.AddChidren(listControl);
+ listBackControl.frameTable.AddChidren(listControl);
listControl.AddChidren(frameBack);
}
@@ -468,8 +470,8 @@
for (int i = 0; i < listIcon.Count; i++)
{
var frame = new FrameLayout();
- frame.Width = Application.GetMinRealAverage(887);
- frame.Height = Application.GetMinRealAverage(124);
+ frame.Width = this.GetPictrueRealSize(887);
+ frame.Height = this.GetPictrueRealSize(124);
frameBack.AddChidren(frame);
//鍒濆鍖栦竴琛岃澶囧浘鏍�
this.InitDeviceIconFrame(frame, listIcon[i], ref index);
@@ -480,14 +482,14 @@
}
else
{
- frame.Y = Application.GetMinRealAverage(58) + (frameBack.ChildrenCount - 1) * (frame.Height + Application.GetMinRealAverage(60));
+ frame.Y = this.GetPictrueRealSize(58) + (frameBack.ChildrenCount - 1) * (frame.Height + this.GetPictrueRealSize(60));
}
}
if (listIcon.Count > 2)
{
//璁$畻鐪熷疄楂樺害
- int realHeight = Application.GetMinRealAverage(58 + 58) + (frameBack.ChildrenCount - 1) * Application.GetMinRealAverage(124 + 60);
+ int realHeight = this.GetPictrueRealSize(58 + 58) + (frameBack.ChildrenCount - 1) * this.GetPictrueRealSize(124 + 60);
if (realHeight > frameBack.Height)
{
//鍙樻洿楂樺害
@@ -507,7 +509,7 @@
{
NormalViewControl btnTemp = null;
//闂磋窛
- int space = Application.GetMinRealAverage(84);
+ int space = this.GetPictrueRealSize(84);
int defultXX = (frame.Width - frame.Height * listDevice.Count - (listDevice.Count - 1) * space) / 2;
for (int i = 0; i < listDevice.Count; i++)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs
index 8b0ad83..3a52b0e 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勮澶�
/// </summary>
@@ -81,12 +81,16 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
this.tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1128);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1128);
//鍒濆鍖栬澶囧洖璺浘鏍�
- this.InitDeviceEpointIcon();
+ this.InitDeviceEpointIcon(listBackControl);
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -210,7 +214,7 @@
//娣诲姞鍔熻兘绫诲瀷琛�
this.AddFunctionTypeRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
}
#endregion
@@ -365,7 +369,7 @@
/// <summary>
/// 鍒濆鍖栬澶囧洖璺浘鏍�
/// </summary>
- private void InitDeviceEpointIcon()
+ private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
{
//鑾峰彇鎸夌粍鍒嗛厤鐨勮澶�
var listIcon = this.GetAllDeviceGroup();
@@ -373,10 +377,10 @@
var frameBorder = new FrameLayout();
frameBorder.Y = Application.GetRealHeight(147);
frameBorder.Gravity = Gravity.CenterHorizontal;
- frameBorder.Width = Application.GetRealWidth(887);
+ frameBorder.Width = this.GetPictrueRealSize(887);
frameBorder.Height = Application.GetRealHeight(423);
frameBorder.Radius = (uint)Application.GetRealHeight(6);
- bodyFrameLayout.AddChidren(frameBorder);
+ listBackControl.frameTable.AddChidren(frameBorder);
var frameBack = new FrameLayout();
frameBack.Height = frameBorder.Height;
@@ -401,7 +405,7 @@
{
var frame = new FrameLayout();
frame.Width = frameBorder.Width;
- frame.Height = Application.GetMinRealAverage(124);
+ frame.Height = this.GetPictrueRealSize(124);
frameBack.AddChidren(frame);
//鍒濆鍖栦竴琛岃澶囧浘鏍�
this.InitDeviceIconFrame(frame, listIcon[i], ref index);
@@ -412,16 +416,16 @@
}
else
{
- frame.Y = Application.GetMinRealAverage(58) + (frameBack.ChildrenCount - 1) * (frame.Height + Application.GetMinRealAverage(60));
+ frame.Y = this.GetPictrueRealSize(58) + (frameBack.ChildrenCount - 1) * (frame.Height + this.GetPictrueRealSize(60));
}
}
if (listIcon.Count > 2)
{
//璁$畻鐪熷疄楂樺害
- int realHeight = Application.GetMinRealAverage(58 + 58);//涓婁笅闂磋窛
- realHeight += frameBack.ChildrenCount * Application.GetMinRealAverage(124);//鍦嗗湀楂樺害
- realHeight += (frameBack.ChildrenCount-1) * Application.GetMinRealAverage(60);//鍦嗗湀闂磋窛
+ int realHeight = this.GetPictrueRealSize(58 + 58);//涓婁笅闂磋窛
+ realHeight += frameBack.ChildrenCount * this.GetPictrueRealSize(124);//鍦嗗湀楂樺害
+ realHeight += (frameBack.ChildrenCount-1) * this.GetPictrueRealSize(60);//鍦嗗湀闂磋窛
if (realHeight > frameBack.Height)
{
//鍙樻洿楂樺害
@@ -441,7 +445,7 @@
{
NormalViewControl btnTemp = null;
//闂磋窛
- int space = Application.GetMinRealAverage(84);
+ int space = this.GetPictrueRealSize(84);
int defultXX = (frame.Width - frame.Height * listDevice.Count - (listDevice.Count - 1) * space) / 2;
for (int i = 0; i < listDevice.Count; i++)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
old mode 100644
new mode 100755
index 8e30f8b..95ca2a5
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -239,13 +239,8 @@
if (listdevice.Count > 0 && Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
{
//瀹氫綅
- var btnPosition = new NormalViewControl(Application.GetRealWidth(184), rowMenu.Height, false);
+ var btnPosition = rowMenu.AddEditorControl(false);
btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
- btnPosition.TextAlignment = TextAlignment.Center;
- btnPosition.TextSize = 12;
- btnPosition.TextColor = UserCenterColor.Current.White;
- btnPosition.BackgroundColor = 0xff4a4a4a;
- rowMenu.AddRightView(btnPosition);
btnPosition.ButtonClickEvent += (sender, e) =>
{
//瀹氫綅
@@ -372,13 +367,8 @@
if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(device) == true)
{
//瀹氫綅
- var btnPosition = new NormalViewControl(Application.GetRealWidth(184), rowDevice.Height, false);
+ var btnPosition = rowDevice.AddEditorControl(false);
btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
- btnPosition.TextAlignment = TextAlignment.Center;
- btnPosition.TextSize = 12;
- btnPosition.TextColor = UserCenterColor.Current.White;
- btnPosition.BackgroundColor = 0xff4a4a4a;
- rowDevice.AddRightView(btnPosition);
btnPosition.ButtonClickEvent += (sender, e) =>
{
//瀹氫綅
@@ -452,9 +442,9 @@
}
//鏂伴闈㈡澘
else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
- {
- //鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃�
- var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm();
+ {
+ //鏂规偊鏂伴闈㈡澘鐨勬寜閿厤缃�
+ var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm();
form.AddForm(device);
}
//鏂规偊闈㈡澘
@@ -464,10 +454,10 @@
{
//骞叉帴鐐�
if (device.Type == DeviceType.OnOffSwitch)
- {
- //鏂规偊闈㈡澘鐨勬寜閿厤缃�
+ {
+ //鏂规偊闈㈡澘鐨勬寜閿厤缃�
var form = new DevicePanel.PanelFangyueButtonSettionForm();
- form.AddForm(device);
+ form.AddForm(device);
}
//缁х數鍣�
else if (device.Type == DeviceType.OnOffOutput)
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
old mode 100644
new mode 100755
index 3688d2b..4865485
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -20,7 +20,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 璁惧鐨勮澶囩被鍨�
/// </summary>
@@ -81,15 +81,19 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1368);
//鍥剧墖
var btnPic = new DeviceInfoIconControl();
btnPic.Y = Application.GetRealHeight(92);
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
btnPic.InitControl(listNewDevice[0]);
//璁惧澶囨敞
@@ -171,7 +175,7 @@
this.AddAllMenuRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
@@ -1183,8 +1187,8 @@
private void ShowTopRightMenu()
{
//妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘(鎷跨鐐规渶灏忕殑閭d釜鍥炶矾鍘诲畾浣�)
- bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]);
-
+ bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]);
+
var frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1);
string deviceMenu = string.Empty;
if (canTest == true)
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
index f478b5c..c8e359d 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
@@ -53,132 +53,132 @@
bodyFrameLayout.AddChidren(listView);
//2鎸夐敭瑙︽懜闈㈡澘
- var objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId202);
+ var objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName1);
var unSelectPic = "Device/ButtonPanelTwo.png";
var arry = objectText.Split(new string[] { "(" }, StringSplitOptions.RemoveEmptyEntries);
objectText = arry[0].Trim();
this.AddMenuRow(objectText, unSelectPic, "PanelTwoButtonDirectionForm");
//3鎸夐敭瑙︽懜闈㈡澘
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId201);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName2);
arry = objectText.Split(new string[] { "(" }, StringSplitOptions.RemoveEmptyEntries);
objectText = arry[0].Trim();
unSelectPic = "Device/ButtonPanelThree.png";
this.AddMenuRow(objectText, unSelectPic, "PanelThreeButtonDirectionForm");
//4鎸夐敭瑙︽懜闈㈡澘
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId200);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName3);
arry = objectText.Split(new string[] { "(" }, StringSplitOptions.RemoveEmptyEntries);
objectText = arry[0].Trim();
unSelectPic = "Device/ButtonPanelFour.png";
this.AddMenuRow(objectText, unSelectPic, "PanelFourButtonDirectionForm");
//鏂规偊鍗曞紑鍙屾帶闈㈡澘
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId240);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName4);
unSelectPic = "Device/ButtonPanelFangyueTwo.png";
this.AddMenuRow(objectText, unSelectPic, "PanelFangyueTwoButtonDirectionForm");
//鏂规偊鍙屽紑鍥涙帶闈㈡澘
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId241);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName5);
unSelectPic = "Device/ButtonPanelFangyueFour.png";
this.AddMenuRow(objectText, unSelectPic, "PanelFangyueFourButtonDirectionForm");
//鏂规偊鍥涘紑鍏帶闈㈡澘
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId242);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName6);
unSelectPic = "Device/ButtonPanelFangyueEight.png";
this.AddMenuRow(objectText, unSelectPic, "PanelFangyueEightButtonDirectionForm");
//鏂规偊鏂伴灏忔ā鍧�,鍥剧墖鍜�3璺户鐢靛櫒灏忔ā鍧楃浉鍚�
- objectText = Language.StringByID(R.MyInternationalizationString.DeviceModelId2310);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName7);
unSelectPic = "Device/RelayThreeLoad.png";
this.AddMenuRow(objectText, unSelectPic, "PanelFangyueFreshAirModulDirectionForm");
//鏂规偊鏂伴闈㈡澘
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId250);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName8);
unSelectPic = "Device/ButtonPanelFangyueFreshAir.png";
this.AddMenuRow(objectText, unSelectPic, "PanelFangyueFreshAirDirectionForm");
//鏂规偊鐜闈㈡澘
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId253);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName9);
unSelectPic = "Device/ButtonPanelFangyueEnvironment.png";
this.AddMenuRow(objectText, unSelectPic, "PanelFangyueEnvironmentDirectionForm");
//绐楀笜闈㈡澘
- objectText = "绐楀笜闈㈡澘";
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName10);
unSelectPic = "Device/ButtonPanelCurtain.png";
this.AddMenuRow(objectText, unSelectPic, "PanelCurtainDirectionForm");
//3璺户鐢靛櫒灏忔ā鍧�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId2300);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName11);
unSelectPic = "Device/RelayThreeLoad.png";
this.AddMenuRow(objectText, unSelectPic, "RelayThreeLoadDirectionForm");
//1璺皟鍏夊櫒灏忔ā鍧�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId2500);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName12);
unSelectPic = "Device/DimmableLightOneLoad.png";
this.AddMenuRow(objectText, unSelectPic, "DimmableLightOneLoadDirectionForm");
//Zigbee鏅鸿兘寮�鍚堝笜鐢垫満
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId100);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName13);
unSelectPic = "Device/CurtainAutoOpen.png";
this.AddMenuRow(objectText, unSelectPic, "CurtainAutoOpenDirectionForm");
//Zigbee鏅鸿兘绠$姸鐢垫満
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId101);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName14);
unSelectPic = "Device/CurtainSiphonate.png";
this.AddMenuRow(objectText, unSelectPic, "CurtainSiphonateDirectionForm");
//绌鸿皟
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId3600);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName15);
unSelectPic = "Device/AirConditionerZbGateway.png";
this.AddMenuRow(objectText, unSelectPic, "AirConditionerZbGatewayDirectionForm");
//鏅鸿兘闂ㄩ攣
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId2800);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName16);
unSelectPic = "Device/IntelligentLocksH06C.png";
this.AddMenuRow(objectText, unSelectPic, "IntelligentLocksH06cDirectionForm");
//PIR浼犳劅鍣�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId1200);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName17);
unSelectPic = "Device/SensorPir.png";
this.AddMenuRow(objectText, unSelectPic, "SensorPirDirectionForm");
//绾㈠浼犳劅鍣�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId1303);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName18);
unSelectPic = "Device/SensorInfrared.png";
this.AddMenuRow(objectText, unSelectPic, "SensorInfraredDirectionForm");
//鐕冩皵浼犳劅鍣�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId1300);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName19);
unSelectPic = "Device/SensorCarbonMonoxide.png";
this.AddMenuRow(objectText, unSelectPic, "SensorCarbonMonoxideDirectionForm");
//鐑熼浘浼犳劅鍣�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId1302);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName20);
unSelectPic = "Device/SensorFire.png";
this.AddMenuRow(objectText, unSelectPic, "SensorFireDirectionForm");
//姘存蹈浼犳劅鍣�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId1304);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName21);
unSelectPic = "Device/SensorWater.png";
this.AddMenuRow(objectText, unSelectPic, "SensorWaterDirectionForm");
//闂ㄧ獥浼犳劅鍣�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId1301);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName22);
unSelectPic = "Device/SensorDoorWindow.png";
this.AddMenuRow(objectText, unSelectPic, "SensorDoorWindowDirectionForm");
//娓╂箍搴︿紶鎰熷櫒
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId10);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName23);
unSelectPic = "Device/SensorTemperatureHumidity.png";
this.AddMenuRow(objectText, unSelectPic, "SensorTemperatureHumidityForm");
//涓户鍣�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId3900);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName24);
unSelectPic = "Device/RepeaterZigbee.png";
this.AddMenuRow(objectText, unSelectPic, "RepeaterZigbeeDirectionForm");
//绌烘皵寮�鍏�
- objectText = Language.StringByID(R.MyInternationalizationString.uDeviceModelId4100);
+ objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName25);
unSelectPic = "Device/AirSwitchCloudContr.png";
this.AddMenuRow(objectText, unSelectPic, "AirSwitchCloudContrDirectionForm");
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
index c309fd3..082f117 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
@@ -34,13 +34,17 @@
/// </summary>
private CommonDevice DeviceDoor = null;
/// <summary>
- /// 妫�绱㈠璞$殑ID(-1:鎵�鏈� 绌哄瓧绗︿覆:鍏朵粬)
+ /// 妫�绱㈠璞$殑ID(-1:鎵�鏈� -9999:鍏朵粬)
/// </summary>
private List<string> listSearchUserId = new List<string>() { "-1" };
/// <summary>
- /// 妫�绱㈠紑閿佹柟寮忕殑ID(-1:鎵�鏈� 0:瀵嗙爜 15:鎸囩汗 3:IC鍗�)
+ /// 妫�绱㈠紑閿佹柟寮忕殑ID(-1:鎵�鏈� 0:瀵嗙爜 15:鎸囩汗 3:IC鍗� 9000:甯稿紑妯″紡(鑷畾涔夌殑))
/// </summary>
private List<int> listSearchLockId = new List<int>() { -1 };
+ /// <summary>
+ /// 鑾峰彇鍒扮殑鍘嗗彶璁板綍
+ /// </summary>
+ private List<HistoryInfo> listHistoryInfo = null;
/// <summary>
/// 鍏朵粬娑堟伅鐨勪富閿�,瀹冨瓨鍦ㄥ彟澶栫殑涓�寮犳暟鎹簱琛ㄤ腑
/// </summary>
@@ -109,7 +113,7 @@
this.InitTitleSearchControl();
//鍒濆鍖栬褰曞垪琛�
- this.InitLogListInfo();
+ this.InitLogListInfo(true);
}
/// <summary>
@@ -134,37 +138,38 @@
dateFromControl.DateSelectEvent += (dateValue) =>
{
//鍒濆鍖栬褰曞垪琛�
- this.InitLogListInfo();
+ this.InitLogListInfo(true);
};
var btnTemp = new NormalViewControl(26, 58, true);
btnTemp.Y = Application.GetRealHeight(29);
- btnTemp.X = Application.GetRealWidth(357);
+ btnTemp.X = dateFromControl.Right + Application.GetRealWidth(12);
btnTemp.TextColor = UserCenterColor.Current.TextGrayColor1;
btnTemp.Text = "-";
frameTitle.AddChidren(btnTemp, ChidrenBindMode.NotBind);
dateToControl = new DateSelectControl(Language.StringByID(R.MyInternationalizationString.uEndDate));
dateToControl.Y = Application.GetRealHeight(35);
- dateToControl.X = Application.GetRealWidth(395);
+ dateToControl.X = btnTemp.Right + Application.GetRealWidth(12);
dateToControl.dateValue = DateTime.Now.ToString("yyyyMMdd");
frameTitle.AddChidren(dateToControl, ChidrenBindMode.NotBind);
dateToControl.DateSelectEvent += (dateValue) =>
{
//鍒濆鍖栬褰曞垪琛�
- this.InitLogListInfo();
+ this.InitLogListInfo(true);
};
//绫诲瀷绛涢��
var btnScreening = frameTitle.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uScreeningType), 145);
- frameTitle.ChangedChidrenBindMode(btnScreening, ChidrenBindMode.NotBind);
btnScreening.TextSize = 12;
-
+ btnScreening.Width = btnScreening.GetRealWidthByText();
+ btnScreening.X = frameTitle.Width - Application.GetRealWidth(58) - btnScreening.Width;
btnScreening.ButtonClickEvent += (sender, e) =>
{
//鏄剧ず绫诲瀷绛涢�夌晫闈�
this.ShowDoorLockScreeningTypeForm();
};
+ frameTitle.ChangedChidrenBindMode(btnScreening, ChidrenBindMode.NotBind);
//绫诲瀷绛涢�夌殑鍥炬爣
var btnScreeningIcon = new IconViewControl(69);
btnScreeningIcon.X = btnScreening.X - Application.GetRealWidth(12) - btnScreeningIcon.IconSize;
@@ -188,7 +193,7 @@
listView.BeginHeaderRefreshingAction += () =>
{
//涓嬫媺鍒锋柊
- this.InitLogListInfo();
+ this.InitLogListInfo(true);
};
}
@@ -199,7 +204,8 @@
/// <summary>
/// 鍒濆鍖栬褰曞垪琛�
/// </summary>
- private void InitLogListInfo()
+ /// <param name="reReadData">鏄惁浠庢柊浠庝簯绔鍙栨暟鎹�</param>
+ private void InitLogListInfo(bool reReadData)
{
this.listView.frameTable.RemoveAll();
listView.frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3);
@@ -211,6 +217,12 @@
this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uFromTimeIsOverToTime));
return;
}
+ if (reReadData == true)
+ {
+ //缃┖鍚�,閲嶆柊鑾峰彇
+ this.listHistoryInfo = null;
+ }
+
HdlThreadLogic.Current.RunThread(async () =>
{
//鎵撳紑杩涘害鏉�
@@ -223,8 +235,14 @@
this.CloseProgressBar(ShowReLoadMode.YES);
return;
}
+ //鎴愬憳淇℃伅
+ var dicMemberName = new Dictionary<string, string>();
+ for (int i = 0; i < listMenberInfo.Count; i++)
+ {
+ dicMemberName.Add(listMenberInfo[i].SubAccountDistributedMark, string.IsNullOrEmpty(listMenberInfo[i].UserName) == false ? listMenberInfo[i].UserName : listMenberInfo[i].Account);
+ }
//鍘嗗彶璁板綍
- var historyLog = await this.GetHistoryLogInfo();
+ var historyLog = await this.GetHistoryLogInfo(dicMemberName);
if (historyLog == null)
{
//鍏抽棴杩涘害鏉�
@@ -234,17 +252,12 @@
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
- var dic = new Dictionary<string, string>();
- for (int i = 0; i < listMenberInfo.Count; i++)
- {
- dic.Add(listMenberInfo[i].SubAccountDistributedMark, string.IsNullOrEmpty(listMenberInfo[i].UserName) == false ? listMenberInfo[i].UserName : listMenberInfo[i].Account);
- }
HdlThreadLogic.Current.RunMain(() =>
{
for (int i = 0; i < historyLog.Count; i++)
{
//娣诲姞璁板綍琛�
- this.AddLogInfoRow(historyLog[i], dic, i != historyLog.Count - 1);
+ this.AddLogInfoRow(historyLog[i], dicMemberName, i != historyLog.Count - 1);
}
//闅愯棌涓嬫媺鍒锋柊鐗规晥
listView.EndHeaderRefreshing();
@@ -322,9 +335,33 @@
this.listView.AddChidrenFrame2(frameTable);
//鍥炬爣
var btnIcon = frameTable.AddLeftIcon();
+ //淇℃伅
+ var btnMsg = frameTable.AddTopView("", 600);
+ //浜虹墿
+ string perName = dicName.ContainsKey(historyInfo.CloudAccountId) == true ? dicName[historyInfo.CloudAccountId] : Language.StringByID(R.MyInternationalizationString.uOther);
+ frameTable.AddBottomView(perName, 600);
+ //鏃堕棿
+ if (this.dateFromControl.dateValue == this.dateToControl.dateValue)
+ {
+ //濡傛灉鏃ユ湡鑼冨洿涓�鏍�,鍒欎笉鏄剧ず骞存湀鏃�
+ frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("HH:mm:ss"), 400);
+ }
+ else
+ {
+ //濡傛灉鏃ユ湡鑼冨洿涓嶄竴鏍�,鍒欐樉绀哄勾鏈堟棩
+ frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("yyyy/MM/dd HH:mm:ss"), 700);
+ }
+ //搴曠嚎
+ if (addLine == true)
+ {
+
+ frameTable.AddBottomLine();
+ }
+
+ //鍏朵粬娑堟伅
if (historyInfo.OpenLockMode == -1)
{
- //鍏朵粬娑堟伅
+ //鍥剧墖
var device = Common.LocalDevice.Current.GetDevice(historyInfo.DeviceMac, historyInfo.DeviceEpoint);
if (device == null)
{
@@ -334,25 +371,42 @@
{
Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
}
- }
- else if (historyInfo.UnlockIsSuccess == true)
- {
- btnIcon.UnSelectedImagePath = "Item/UnLockSuccess.png";
- }
- else
- {
- btnIcon.UnSelectedImagePath = "Item/UnLockFail.png";
- }
-
- //淇℃伅
- var btnMsg = frameTable.AddTopView("", 600);
- if (historyInfo.OpenLockMode == -1)
- {
- //鍏朵粬娑堟伅
+ //娑堟伅
btnMsg.Text = historyInfo.AlarmMsg;
}
+ //闂ㄩ攣甯稿紑妯″紡
+ else if (historyInfo.OpenLockMode == 9000)
+ {
+ //鍥剧墖
+ btnIcon.UnSelectedImagePath = "Item/NormallyOpen.png";
+ //娑堟伅
+ if (historyInfo.OtherOpenLockMode == 9001)
+ {
+ //甯稿紑妯″紡鎵嬪姩寮�鍚�
+ btnMsg.TextID = R.MyInternationalizationString.uNormallyOpenModeManualOpen;
+ }
+ else if (historyInfo.OtherOpenLockMode == 9002)
+ {
+ //甯稿紑妯″紡鎵嬪姩鍙栨秷
+ btnMsg.TextID = R.MyInternationalizationString.uNormallyOpenModeManualClose;
+ }
+ else if (historyInfo.OtherOpenLockMode == 9003)
+ {
+ //甯稿紑妯″紡鍚敤{0}灏忔椂
+ btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uNormallyOpenModeOpenSomeTime).Replace("{0}", historyInfo.NormallyOpenContinuedTime);
+ }
+ else
+ {
+ //涓婇潰鏄疉pp鎵嬪姩鎺ㄩ��,杩欓噷鏄綉鍏虫垨鑰呴棬閿佽嚜宸辨帹閫�
+ btnMsg.Text = historyInfo.AlarmMsg;
+ }
+ }
+ //寮�閿佹垚鍔�
else if (historyInfo.UnlockIsSuccess == true)
{
+ //鍥剧墖
+ btnIcon.UnSelectedImagePath = "Item/UnLockSuccess.png";
+ //娑堟伅
if (historyInfo.OpenLockMode == 0)
{
//瀵嗙爜寮�閿佹垚鍔�
@@ -369,8 +423,12 @@
btnMsg.TextID = R.MyInternationalizationString.uUnlockByFingerPrintSuccess;
}
}
+ //寮�閿佸け璐�
else
{
+ //鍥剧墖
+ btnIcon.UnSelectedImagePath = "Item/UnLockFail.png";
+ //娑堟伅
if (historyInfo.OpenLockMode == 0)
{
//瀵嗙爜寮�閿佸け璐�
@@ -386,28 +444,6 @@
//鎸囩汗寮�閿佸け璐�
btnMsg.TextID = R.MyInternationalizationString.uUnlockByFingerPrintFail;
}
- }
-
- //浜虹墿
- string perName = dicName.ContainsKey(historyInfo.CloudAccountId) == true ? dicName[historyInfo.CloudAccountId] : Language.StringByID(R.MyInternationalizationString.uOther);
- frameTable.AddBottomView(perName, 600);
-
- //鏃堕棿
- if (this.dateFromControl.dateValue == this.dateToControl.dateValue)
- {
- //濡傛灉鏃ユ湡鑼冨洿涓�鏍�,鍒欎笉鏄剧ず骞存湀鏃�
- frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("HH:mm:ss"), 400);
- }
- else
- {
- //濡傛灉鏃ユ湡鑼冨洿涓嶄竴鏍�,鍒欐樉绀哄勾鏈堟棩
- frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("yyyy/MM/dd HH:mm:ss"), 700);
- }
-
- if (addLine == true)
- {
- //搴曠嚎
- frameTable.AddBottomLine();
}
}
@@ -435,8 +471,112 @@
listSearchLockId.Clear();
listSearchLockId.AddRange(selectLock);
//鍒濆鍖栬褰曞垪琛�
- this.InitLogListInfo();
+ this.InitLogListInfo(false);
};
+ }
+
+ #endregion
+
+ #region 鈻� 绛涢�夎褰昣__________________________
+
+ /// <summary>
+ /// 绛涢�夊巻鍙茶褰�
+ /// </summary>
+ /// <returns></returns>
+ private List<HistoryInfo> ScreeningHistoryData(Dictionary<string, string> dicMemberName)
+ {
+ //鍘嗗彶璁板綍澶夯鐑︿簡,瀛樺湪涓嶅悓鐨勬暟鎹簱琛ㄩ噷,骞朵笖鏁版嵁杩樹笉涓�鏍�,鍙兘杩欐牱涓�涓釜鍒ゆ柇浜�
+ var listScreeningData = new List<HistoryInfo>();
+ //娓呴櫎鎺変箣鍓嶇殑璁板綍
+ this.listOtherUserId = new List<string>();
+ this.listOtherMsgId = new List<string>();
+
+ //鏄惁閫夋嫨鍏ㄩ�夌敤鎴�
+ bool selectAllUser = this.listSearchUserId.Contains("-1");
+ //鏄惁鍗曢�変簡鍏朵粬
+ bool selectOtherUser = this.listSearchUserId.Contains("-9999");
+ //鏄惁閫夋嫨鍏ㄩ�夊紑閿佹柟寮�
+ bool selectAllLockMode = this.listSearchLockId.Contains(-1);
+
+ //涓�涓釜鍘婚亶鍘�
+ foreach (var data in this.listHistoryInfo)
+ {
+ //妫�娴嬭鍘嗗彶璁板綍鑳藉惁鏄剧ず
+ bool result = this.CheckHistoryDataCanShow(data, dicMemberName, selectAllUser, selectOtherUser, selectAllLockMode);
+ if (result == true)
+ {
+ listScreeningData.Add(data);
+ }
+ }
+
+ return listScreeningData;
+ }
+
+ /// <summary>
+ /// 妫�娴嬭鍘嗗彶璁板綍鑳藉惁鏄剧ず
+ /// </summary>
+ /// <param name="info">妫�娴嬪璞�</param>
+ /// <param name="dicMemberName">鎴愬憳淇℃伅</param>
+ /// <param name="selectAllUser">鏄惁閫夋嫨鍏ㄩ�夌敤鎴�</param>
+ /// <param name="selectOtherUser">鏄惁鍗曢�変簡鍏朵粬</param>
+ /// <param name="slectAllLockMode">鏄惁閫夋嫨鍏ㄩ�夊紑閿佹柟寮�</param>
+ private bool CheckHistoryDataCanShow(HistoryInfo info, Dictionary<string, string> dicMemberName,
+ bool selectAllUser, bool selectOtherUser, bool slectAllLockMode)
+ {
+ //濡傛灉娌℃湁閫夋嫨 鍏ㄩ�夌敤鎴�
+ if (selectAllUser == false)
+ {
+ //濡傛灉杩欎釜鐢ㄦ埛ID涓嶅寘鍚湪鎸囧畾閫夋嫨鐨勬垚鍛樺垪琛ㄩ噷闈�
+ if (this.listSearchUserId.Contains(info.CloudAccountId) == false)
+ {
+ if (dicMemberName.ContainsKey(info.CloudAccountId) == true)
+ {
+ //濡傛灉鑳藉璇嗗埆杩欎釜id鐨勮瘽,鍒欒〃绀哄畠涓嶅睘浜庡叾浠栫被,骞朵笖涔熶笉鍐嶉�夋嫨鐩爣鍐�
+ return false;
+ }
+ //濡傛灉娌℃湁閫夋嫨 鍏朵粬鐨勮瘽,涓嶆樉绀�
+ if (selectOtherUser == false)
+ {
+ return false;
+ }
+ }
+ }
+ //濡傛灉鏄垚鍛樿韩浠�,骞朵笖鐢ㄦ埛ID涓嶄负绌�
+ if (UserCenterResourse.UserInfo.AuthorityNo == 3 && info.CloudAccountId != string.Empty)
+ {
+ //鎴愬憳涓嶈兘鐪嬪埌 鍏朵粬浜虹殑璁板綍(鎴愬憳鐨勬椂鍊�,杩欎釜鍙橀噺閲岄潰鍙湁浠栬嚜宸变竴涓�)
+ if (dicMemberName.ContainsKey(info.CloudAccountId) == false)
+ {
+ return false;
+ }
+ }
+ //濡傛灉娌℃湁閫夋嫨 鍏ㄩ�夊紑閿佹柟寮�
+ if (slectAllLockMode == false)
+ {
+ //濡傛灉杩欎釜寮�閿佹柟寮忎笉鍦ㄩ�夋嫨鐨勫垪琛ㄩ噷闈㈢殑璇�
+ if (this.listSearchLockId.Contains(info.OpenLockMode) == false)
+ {
+ return false;
+ }
+ }
+
+ //鍙︿竴寮犺〃鐨勬暟鎹富閿�
+ if (info.OpenLockMode == -1 || info.OpenLockMode == 9000)
+ {
+ if (info.MsgKeyId != string.Empty)
+ {
+ //鍏朵粬娑堟伅鐨勪富閿�,瀹冨瓨鍦ㄥ彟澶栫殑涓�寮犳暟鎹簱琛ㄤ腑
+ this.listOtherMsgId.Add(info.MsgKeyId);
+ }
+ }
+ if (info.CloudAccountId != string.Empty && dicMemberName.ContainsKey(info.CloudAccountId) == false
+ && this.listOtherUserId.Contains(info.CloudAccountId) == false)
+ {
+ //鏃犳硶璇嗗埆鐨勫紑閿佽褰曠殑鐢ㄦ埛ID(鍥犱负閭d釜瀵嗙爜鏈夊彲鑳芥病鏈夊垎閰嶇粰鎴愬憳)
+ this.listOtherUserId.Add(info.CloudAccountId);
+ }
+
+ return true;
}
#endregion
@@ -447,24 +587,18 @@
/// 鑾峰彇鍘嗗彶璁板綍
/// </summary>
/// <returns></returns>
- private async Task<List<HistoryInfo>> GetHistoryLogInfo()
+ private async Task<List<HistoryInfo>> GetHistoryLogInfo(Dictionary<string, string> dicMemberName)
{
- //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁�
- var pra = this.GetDbInterfacePra();
-
- //娓呯┖涓婁竴娆$殑鍏朵粬ID
- this.listOtherMsgId = new List<string>();
- this.listOtherUserId = new List<string>();
-
- //鍏ㄩ儴鎴愬憳淇℃伅
- var dicMemberName = new Dictionary<string, string>();
- for (int i = 0; i < listMenberInfo.Count; i++)
+ if (this.listHistoryInfo != null)
{
- dicMemberName.Add(listMenberInfo[i].SubAccountDistributedMark, string.IsNullOrEmpty(listMenberInfo[i].UserName) == false ? listMenberInfo[i].UserName : listMenberInfo[i].Account);
+ //涓嶄簩娆¤幏鍙�,涓昏閽堝鐨勬槸绛涢�夊姛鑳�
+ return this.ScreeningHistoryData(dicMemberName);
}
+ //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁�
+ var pra = this.GetReadHistoryPra();
//鑾峰彇闂ㄩ攣鐨勬墦寮�鍜屽叧闂褰�
- var listAllLog = await this.GetDoorOpenHistoryLog(pra, dicMemberName);
+ var listAllLog = await this.GetDoorOpenHistoryLog(pra);
//鑾峰彇闂ㄩ攣鐨勫叾浠栬褰�
var listOtherLog = await this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd);
listAllLog.AddRange(listOtherLog);
@@ -472,19 +606,9 @@
//鎺掑簭涓�涓�
var dicAllData = new Dictionary<string, List<HistoryInfo>>();
var listSortTime = new List<string>();
- //鏄惁鍖呭惈鍏朵粬
- bool getOtherFlage = this.listSearchUserId.Contains("");
+
foreach (var data in listAllLog)
{
- //濡傛灉鍗曠嫭鎸囧畾鏈夎璐﹀彿,鍙互鏄剧ず
- if (this.listSearchUserId.Contains(data.CloudAccountId) == false)
- {
- //濡傛灉杩欎釜璐﹀彿娌℃湁鎸囧畾,骞朵笖鎸囧畾鏄剧ず鍏朵粬鐨勮瘽,骞朵笖鏃犳硶璇嗗埆杩欎釜鐢ㄦ埛ID鎵嶆樉绀�
- if (getOtherFlage == true && dicMemberName.ContainsKey(data.CloudAccountId) == true)
- {
- continue;
- }
- }
//鎸夋椂闂村垎缁�
if (dicAllData.ContainsKey(data.UnlockTime) == false)
{
@@ -496,13 +620,13 @@
//鎵ц鎺掑簭,鏃堕棿澶х殑鍦ㄥ墠闈�
listSortTime.Sort();
- var listSortLog = new List<HistoryInfo>();
+ this.listHistoryInfo = new List<HistoryInfo>();
for (int i = listSortTime.Count - 1; i >= 0; i--)
{
- listSortLog.AddRange(dicAllData[listSortTime[i]]);
+ this.listHistoryInfo.AddRange(dicAllData[listSortTime[i]]);
}
-
- return listSortLog;
+ //绛涢�夊巻鍙茶褰�
+ return this.ScreeningHistoryData(dicMemberName);
}
/// <summary>
@@ -510,7 +634,7 @@
/// </summary>
/// <param name="i_pra"></param>
/// <returns></returns>
- private async Task<List<HistoryInfo>> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra, Dictionary<string, string> dicMemberName)
+ private async Task<List<HistoryInfo>> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra)
{
var listLog = new List<HistoryInfo>();
@@ -524,16 +648,7 @@
return null;
}
var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetHistoryDataResult>(result);
- foreach (var data in dataInfo.PageData)
- {
- if (dicMemberName.ContainsKey(data.CloudAccountId) == false
- && this.listOtherUserId.Contains(data.CloudAccountId) == false)
- {
- //鏀堕泦鏃犳硶璇嗗埆鐨勭敤鎴稩D
- this.listOtherUserId.Add(data.CloudAccountId);
- }
- listLog.Add(data);
- }
+ listLog.AddRange(dataInfo.PageData);
if (dataInfo.HasNextPage == false)
{
@@ -555,47 +670,47 @@
{
var listLog = new List<HistoryInfo>();
- //鏄惁鍖呭惈鍏朵粬
- bool getOtherFlage = this.listSearchUserId.Contains("") || this.listSearchUserId.Contains("-1");
- if (getOtherFlage == true)
+ //鍘昏幏鍙栧叾浠栦俊鎭�
+ var pra2 = new MessageInfoPra();
+ pra2.BeginTime = beginTime;
+ pra2.EndTime = endTime;
+ pra2.Topic = "/Alarms/SendAlarmInform";
+ pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
+ if (result == null)
{
- //鍘昏幏鍙栧叾浠栦俊鎭�
- var pra2 = new MessageInfoPra();
- pra2.BeginTime = beginTime;
- pra2.EndTime = endTime;
- pra2.Topic = "/Alarms/SendAlarmInform";
- pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
- var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
- if (result == null)
+ return null;
+ }
+ var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
+ string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
+ foreach (var myInfo in dataInfo2.PageData)
+ {
+ //璁惧瀵硅薄
+ var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson);
+ string deviceAddr = jobject.Value<string>("DeviceAddr");
+ int deviceEpoint = jobject.Value<int>("Epoint");
+ if (doorKey != deviceAddr + "_" + deviceEpoint)
{
- return null;
+ //涓嶆槸鍚屼竴涓棬閿佺殑璁板綍
+ continue;
}
- var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
- string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
- foreach (var myInfo in dataInfo2.PageData)
+
+ var data = new HistoryInfo();
+ data.DeviceMac = deviceAddr;
+ data.DeviceEpoint = deviceEpoint;
+ //娑堟伅
+ var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(jobject);
+ data.AlarmMsg = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
+ //鏃堕棿
+ data.UnlockTime = myInfo.CreatedOnUtc;
+ //涓婚敭
+ data.MsgKeyId = myInfo.Id;
+ //娑堟伅鍖哄垎
+ if (msgInfo.MsgDiv == 9000)
{
- //璁惧瀵硅薄
- var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson);
- string deviceAddr = jobject.Value<string>("DeviceAddr");
- int deviceEpoint = jobject.Value<int>("Epoint");
- if (doorKey != deviceAddr + "_" + deviceEpoint)
- {
- //涓嶆槸鍚屼竴涓棬閿佺殑璁板綍
- continue;
- }
-
- var data = new HistoryInfo();
- data.DeviceMac = deviceAddr;
- data.DeviceEpoint = deviceEpoint;
- //娑堟伅
- var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(jobject);
- data.AlarmMsg = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
- //鏃堕棿
- data.UnlockTime = myInfo.CreatedOnUtc;
-
- listLog.Add(data);
- this.listOtherMsgId.Add(myInfo.Id);
+ data.OpenLockMode = 9000;
}
+ listLog.Add(data);
}
return listLog;
@@ -611,28 +726,10 @@
private async void ClearAllHistoryLog()
{
//鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁�
- var pra = this.GetDbInterfacePra();
- if (listSearchUserId.Contains("") == true)
- {
- //濡傛灉鎸囧畾鏈夊叾浠�,鍒欑敤鎴稩D閲嶆柊璁剧疆
- pra.CloudAccountIdArr = new List<string>();
- pra.CloudAccountIdArr.AddRange(listSearchUserId);
- pra.CloudAccountIdArr.Remove("");
- if (this.listOtherUserId.Count > 0)
- {
- pra.CloudAccountIdArr.AddRange(listOtherUserId);
- }
- else
- {
- //杩欎竴姝ュ緢閲嶈,涓嶇劧鏈夊彲鑳藉崟鐙�夋嫨鍏朵粬鐨勬椂鍊�
- //鍦ㄦ病鏈夋暟鎹殑鎯呭喌涓�,浼氭竻绌烘帀鍏ㄩ儴鐨勬暟鎹�
- pra.CloudAccountIdArr.Add("other");
- }
- }
+ var pra = this.GetDeleteDataPra();
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
-
var result = await UserCenterLogic.GetResultStatuByRequestHttps("DoorLock/ClearDoorLockHistory", true, pra);
if (result == false)
{
@@ -663,6 +760,9 @@
//娓呯┖
this.listOtherMsgId = new List<string>();
+ this.listOtherUserId = new List<string>();
+ this.listHistoryInfo = null;
+
HdlThreadLogic.Current.RunMain(() =>
{
this.listView.frameTable.RemoveAll();
@@ -678,24 +778,41 @@
/// 鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁�
/// </summary>
/// <returns></returns>
- private GetHistoryDataPra GetDbInterfacePra()
+ private GetHistoryDataPra GetReadHistoryPra()
+ {
+ DateTime dateFrom = new DateTime(dateFromControl.Year, dateFromControl.Month, dateFromControl.Day, 0, 0, 0);
+ DateTime dateTo = new DateTime(dateToControl.Year, dateToControl.Month, dateToControl.Day, 23, 59, 59);
+
+ //鍏ㄩ儴璇诲彇
+ var pra = new GetHistoryDataPra();
+ pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString();
+ pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString();
+ pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
+
+ return pra;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鍒犻櫎鏁版嵁鐨勪簯绔帴鍙g殑鍚姩鍙傛暟
+ /// </summary>
+ /// <returns></returns>
+ private DeleteHistoryDataPra GetDeleteDataPra()
{
DateTime dateFrom = new DateTime(dateFromControl.Year, dateFromControl.Month, dateFromControl.Day, 0, 0, 0);
DateTime dateTo = new DateTime(dateToControl.Year, dateToControl.Month, dateToControl.Day, 23, 59, 59);
List<string> listUser = null;
- //涓�鏃︽寚瀹氫簡鍏朵粬,鍒欓渶瑕佸叏閮ㄨ鍙�,鍥犱负鏈変簺寮�閿侊紝瀹冪敤鐨勫瘑鐮佸苟娌℃湁鍒嗛厤缁欐垚鍛�
- if (listSearchUserId.Contains("-1") == true || listSearchUserId.Contains("") == true)
+ //鎸囧畾鐢ㄦ埛
+ if (listSearchUserId.Contains("-1") == false)
{
- //鍏ㄩ�夊嵆涓篘ull
- }
- else
- {
- //鎸囧畾鐢ㄦ埛
listUser = new List<string>();
listUser.AddRange(listSearchUserId);
- //绉婚櫎鍏朵粬,鍥犱负浜戠鍥哄畾浼氱粰
- listUser.Remove("");
+ //濡傛灉鎸囧畾鏈夊叾浠�
+ if (listSearchUserId.Contains("-9999") == true)
+ {
+ listUser.AddRange(this.listOtherUserId);
+ }
}
//鍏ㄩ�夊垯涓簄ull
@@ -706,13 +823,13 @@
listLock.AddRange(listSearchLockId);
}
- var pra = new GetHistoryDataPra();
+ var pra = new DeleteHistoryDataPra();
pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString();
pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
- pra.CloudAccountIdArr = listUser;
- pra.OpenLockModeArr = listLock;
+ pra.CloudAccountIds = listUser;
+ pra.OpenLockModes = listLock;
return pra;
}
@@ -784,12 +901,51 @@
}
/// <summary>
+ /// 鍒犻櫎鍘嗗彶璁板綍鏁版嵁
+ /// </summary>
+ private class DeleteHistoryDataPra : IfacePraCommon
+ {
+ /// <summary>
+ /// RequestVersion
+ /// </summary>
+ public string RequestVersion = Common.CommonPage.RequestVersion;
+ /// <summary>
+ /// Token
+ /// </summary>
+ public string LoginAccessToken = string.Empty;
+ /// <summary>
+ /// 浣忓畢ID
+ /// </summary>
+ public string HomeId = Common.Config.Instance.Home.Id;
+ /// <summary>
+ /// 闂ㄩ攣鐨凪ac鍦板潃
+ /// </summary>
+ public string DoorLockId = string.Empty;
+ /// <summary>
+ /// Config.Instance.Guid 鎴栬�� MemberInfoRes.SubAccountDistributedMark
+ /// </summary>
+ public List<string> CloudAccountIds = null;
+ /// <summary>
+ /// 寮�閿佹柟寮�(0:瀵嗙爜銆�15:鎸囩汗銆�3:IC鍗�)
+ /// </summary>
+ public List<int> OpenLockModes = null;
+ /// <summary>
+ /// 鎼滅储寮�閿佸紑濮嬫椂闂�
+ /// </summary>
+ public string UnlockTimeBegin;
+ /// <summary>
+ /// 鎼滅储寮�閿佺粨鏉熸椂闂�
+ /// </summary>
+ public string UnlockTimeEnd;
+ }
+
+ /// <summary>
/// 鍘嗗彶璁板綍鐨勭粨鏋�
/// </summary>
private class HistoryInfo
{
/// <summary>
- /// 寮�閿佹柟寮� 0:瀵嗙爜 15:鎸囩汗 3:IC鍗�
+ /// 寮�閿佹柟寮� 0:瀵嗙爜 15:鎸囩汗 3:IC鍗� 9000:甯稿紑妯″紡(鑷畾涔夌殑)
/// </summary>
public int OpenLockMode = -1;
/// <summary>
@@ -805,6 +961,14 @@
/// </summary>
public string CloudAccountId = string.Empty;
/// <summary>
+ /// 鍏朵粬寮�閿佹柟寮�(OpenLockMode=9000鏃舵湁鏁�) 9001:甯稿紑鎵撳紑 9002:甯稿紑鍙栨秷 9003:甯稿紑鎸佺画
+ /// </summary>
+ public int OtherOpenLockMode = -1;
+ /// <summary>
+ /// 甯稿紑鎸佺画鏃堕棿(1~72灏忔椂 OtherOpenLockMode=9003鐨勬椂鍊欐湁鏁�)
+ /// </summary>
+ public string NormallyOpenContinuedTime = string.Empty;
+ /// <summary>
/// 褰撳紑閿佹柟寮忎负-1鏃朵娇鐢�,瀹冨睘浜庡叾浠栫被
/// </summary>
public string AlarmMsg = string.Empty;
@@ -816,6 +980,10 @@
/// 褰撳紑閿佹柟寮忎负-1鏃朵娇鐢�,璁惧绔偣
/// </summary>
public int DeviceEpoint = 0;
+ /// <summary>
+ /// 褰撳紑閿佹柟寮忎负-1鏃朵娇鐢�,娑堟伅鐨勬暟鎹簱涓婚敭
+ /// </summary>
+ public string MsgKeyId = string.Empty;
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockScreeningTypeForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockScreeningTypeForm.cs
index 90cfa37..0bdf308 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockScreeningTypeForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/DoorLock/DoorLockScreeningTypeForm.cs
@@ -16,19 +16,19 @@
/// </summary>
public Action<List<string>, List<int>> FinishSelectEvent = null;
/// <summary>
- /// 褰撳墠閫夋嫨鐢ㄦ埛
+ /// 褰撳墠閫夋嫨鐢ㄦ埛((-1:鎵�鏈� -9999:鍏朵粬))
/// </summary>
private List<string> listSelectUser = new List<string>();
/// <summary>
- /// 褰撳墠閫夋嫨鐨勫紑閿佹柟寮�
+ /// 褰撳墠閫夋嫨鐨勫紑閿佹柟寮�(-1:鎵�鏈� 0:瀵嗙爜 15:鎸囩汗 3:IC鍗� 9000:甯稿紑妯″紡(鑷畾涔夌殑))
/// </summary>
private List<int> listSelectLock = new List<int>();
/// <summary>
- /// 鍓嶅洖鐨勯�夋嫨鐢ㄦ埛
+ /// 鍓嶅洖鐨勯�夋嫨鐢ㄦ埛(閲嶇疆閫夐」涓撶敤)
/// </summary>
private List<string> listOldSelectUser = new List<string>();
/// <summary>
- /// 鍓嶅洖鐨勯�夋嫨寮�閿佹柟寮�
+ /// 鍓嶅洖鐨勯�夋嫨寮�閿佹柟寮�(閲嶇疆閫夐」涓撶敤)
/// </summary>
private List<int> listOldSelectLock = new List<int>();
@@ -176,7 +176,7 @@
dicUser.Add(keys, i_dicUser[keys]);
}
//鍏朵粬
- dicUser.Add("", Language.StringByID(R.MyInternationalizationString.uOther));
+ dicUser.Add("-9999", Language.StringByID(R.MyInternationalizationString.uOther));
//閫夋嫨鐢ㄦ埛
var btnTitle = new NormalViewControl(600, 58, true);
@@ -289,6 +289,13 @@
btnCard.TextID = R.MyInternationalizationString.uIcCard;
btnCard.Name = "3";
frameDetail.AddChidren(btnCard);
+
+ //甯稿紑妯″紡
+ var btnNormallyOpen = this.InitLockSelectButton(listSelectLock.Contains(9000));
+ btnNormallyOpen.Y = btnAll.Bottom + Application.GetRealWidth(29);
+ btnNormallyOpen.TextID = R.MyInternationalizationString.uNormallyOpenMode;
+ btnNormallyOpen.Name = "9000";
+ frameDetail.AddChidren(btnNormallyOpen);
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
index 37de610..390b7e9 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勮澶�
/// </summary>
@@ -79,12 +79,16 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
this.tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//鍒濆鍖栬澶囧洖璺浘鏍�
- this.InitDeviceEpointIcon();
+ this.InitDeviceEpointIcon(listBackControl);
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -185,7 +189,7 @@
this.AddVibrationFeedbackRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
}
#endregion
@@ -396,7 +400,7 @@
/// <summary>
/// 鍒濆鍖栬澶囧洖璺浘鏍�
/// </summary>
- private void InitDeviceEpointIcon()
+ private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
{
bool hadDevice = false;
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
@@ -433,8 +437,8 @@
frameBorder.Y = Application.GetRealHeight(150);
frameBorder.Gravity = Gravity.CenterHorizontal;
frameBorder.Width = Application.GetMinRealAverage(426);
- frameBorder.Height = Application.GetMinRealAverage(426);
- bodyFrameLayout.AddChidren(frameBorder);
+ frameBorder.Height = Application.GetMinRealAverage(426);
+ listBackControl.frameTable.AddChidren(frameBorder);
var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
btnPic.UnSelectedImagePath = "DeviceItem/PanelTable.png";
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
index 9c1b5b4..514859d 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
@@ -16,7 +16,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勮澶�
/// </summary>
@@ -72,12 +72,16 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
this.tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//鍒濆鍖栬澶囧洖璺浘鏍�
- this.InitDeviceEpointIcon();
+ this.InitDeviceEpointIcon(listBackControl);
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -176,7 +180,7 @@
this.AddBackLightRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
}
#endregion
@@ -300,7 +304,7 @@
/// <summary>
/// 鍒濆鍖栬澶囧洖璺浘鏍�
/// </summary>
- private void InitDeviceEpointIcon()
+ private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
{
bool hadDevice = false;
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
@@ -338,7 +342,7 @@
frameBorder.Gravity = Gravity.CenterHorizontal;
frameBorder.Width = Application.GetMinRealAverage(426);
frameBorder.Height = Application.GetMinRealAverage(426);
- bodyFrameLayout.AddChidren(frameBorder);
+ listBackControl.frameTable.AddChidren(frameBorder);
var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs
index ffaf75f..40c2040 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueEnvironmentButtonSettionForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 璁惧鐨勬煇涓�鍥炶矾
/// </summary>
@@ -51,22 +51,26 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍥剧墖
var btnPic = new PicViewControl(426, 426);
btnPic.Y = Application.GetRealHeight(150);
btnPic.UnSelectedImagePath = "DeviceItem/ButtonPanelFangyueEnvironmentBigPic.png";
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//鍒濆鍖栬彍鍗曡
this.InitMenuRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
old mode 100644
new mode 100755
index 38b3a4a..35dea98
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
@@ -81,8 +81,8 @@
//娣诲姞鑳屽厜鐏寒搴︽帶浠躲�愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ��
//this.AddBackLightControl();
//銆愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ��
- //this.FinishInitControl(listview, energyModeInfo.enable);
-
+ //this.FinishInitControl(listview, energyModeInfo.enable);
+
//淇濆瓨
var btnSave = new BottomClickButton();
btnSave.TextID = R.MyInternationalizationString.uSave;
@@ -126,7 +126,7 @@
btnLevel.X = Application.GetRealWidth(855);
btnLevel.Y = Application.GetRealHeight(54);
btnLevel.TextAlignment = TextAlignment.CenterRight;
- btnLevel.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnLevel.TextColor = UserCenterColor.Current.TextGrayColor1;
frameBack.AddChidren(btnLevel);
//褰撳墠浜害
@@ -152,8 +152,8 @@
frameBack.AddChidren(seekBar1);
seekBar1.ProgressChangedEvent += (div, value) =>
{
- btnProgress1.Text = value.ToString();
- switch (value)
+ btnProgress1.Text = value.ToString();
+ switch (value)
{
case 1:
linghtLevelInfo.panelDirectionsLevel = 20;
@@ -180,8 +180,8 @@
btnLevel.Text = "0" + strRank;
break;
}
- };
-
+ };
+
if (linghtLevelInfo.panelDirectionsLevel <= 20 && linghtLevelInfo.panelDirectionsLevel > 0)
{
btnLevel.Text = "1" + strRank;
@@ -218,7 +218,7 @@
btnProgress1.Text = "0";
seekBar1.Progress = 0;
}
-
+
var btnTemp1 = new NormalViewControl(200, 50, true);
btnTemp1.X = ControlCommonResourse.XXLeft;
btnTemp1.Y = Application.GetRealHeight(322);
@@ -285,7 +285,7 @@
frameBack.AddChidren(seekBar1);
seekBar1.ProgressChangedEvent += (div, value) =>
{
- btnProgress1.Text = value + "%";
+ btnProgress1.Text = value + "%";
};
//seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
@@ -598,10 +598,10 @@
//}
//鍏抽棴鑷韩
this.CloseForm();
- }
-
+ }
+
#endregion
-
+
#region 鈻� 琛ュ厖瀹瑰櫒___________________________
/// <summary>
/// 琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout锛屼娇涔嬭兘婊戝姩
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
index 356fda1..ceb1fb2 100644
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
@@ -13,7 +13,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 璁惧鐨勬煇涓�鍥炶矾
/// </summary>
@@ -48,22 +48,26 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍥剧墖
var btnPic = new PicViewControl(426, 426);
btnPic.Y = Application.GetRealHeight(150);
btnPic.UnSelectedImagePath = "RealDevice/ButtonPanelFangyueFreshAir.png";
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//鍒濆鍖栬彍鍗曡
this.InitMenuRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
@@ -82,8 +86,28 @@
/// </summary>
private void InitMenuRow()
{
- this.listview.RemoveAll();
-
+ this.listview.RemoveAll();
+ //娣诲姞鏂伴鐩爣
+ this.AddFreshAirRow();
+ //PM2.5鏉ユ簮
+ //this.AddPMRow();
+ //娣诲姞娓╁害鏉ユ簮
+ //this.AddTemperatureSensorRow();
+ //娣诲姞婀垮害鏉ユ簮
+ //this.AddHumiditySourceRow();
+ //娣诲姞鏂伴鐩爣
+ //this.AddPMRow();
+ //浜害璋冭妭
+ this.AddLevelRow();
+ }
+ #endregion
+
+ #region 鈻� 鏂伴鐩爣_________________________
+ /// <summary>
+ /// 鏂伴鐩爣琛�
+ /// </summary>
+ private void AddFreshAirRow()
+ {
//鏂伴鐩爣
var rowNewWind = new FrameRowControl(listview.rowSpace / 2);
listview.AddChidren(rowNewWind);
@@ -93,14 +117,105 @@
//鍙崇澶�
rowNewWind.AddRightArrow();
var msg = Language.StringByID(R.MyInternationalizationString.nothing);
- // 鍥炶皟鏂伴涓暟
+ // 鍥炶皟鏂伴缁戝畾鐩爣
var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
rowNewWind.ButtonClickEvent += (sender, e) =>
- {
- var form = new PanelFangyueFreshAirTargetForm();
- form.AddForm(this.deviceObj, string.Empty, 3);
+ {
+ var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 1);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addDevicePage.Show();
};
+ }
+ #endregion
+ #region 鈻� PM2.5鏉ユ簮_________________________
+ /// <summary>
+ /// PM2.5鏉ユ簮琛�
+ /// </summary>
+ private void AddPMRow()
+ {
+ //PM2.5
+ var rowNewWind = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowNewWind);
+ rowNewWind.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.PM25Source), 600);
+ //搴曠嚎
+ rowNewWind.AddBottomLine();
+ //鍙崇澶�
+ rowNewWind.AddRightArrow();
+ var msg = Language.StringByID(R.MyInternationalizationString.nothing);
+ // 鍥炶皟PM2.5鏉ユ簮缁戝畾鐩爣
+ var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
+ rowNewWind.ButtonClickEvent += (sender, e) =>
+ {
+ var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 4);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addDevicePage.Show();
+ };
+ }
+ #endregion
+
+ #region 鈻� 娓╁害鏉ユ簮_________________________
+ /// <summary>
+ /// 娓╁害鏉ユ簮琛�
+ /// </summary>
+ private void AddTemperatureSensorRow()
+ {
+ //娓╁害鏉ユ簮
+ var rowNewWind = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowNewWind);
+ rowNewWind.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.TemperatureSource), 600);
+ //搴曠嚎
+ rowNewWind.AddBottomLine();
+ //鍙崇澶�
+ rowNewWind.AddRightArrow();
+ var msg = Language.StringByID(R.MyInternationalizationString.nothing);
+ // 鍥炶皟娓╁害鏉ユ簮缁戝畾鐩爣
+ var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
+ rowNewWind.ButtonClickEvent += (sender, e) =>
+ {
+ var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 2);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addDevicePage.Show();
+ };
+ }
+ #endregion
+
+ #region 鈻� 婀垮害鏉ユ簮_________________________
+ /// <summary>
+ /// 婀垮害鏉ユ簮琛�
+ /// </summary>
+ private void AddHumiditySourceRow()
+ {
+ //婀垮害
+ var rowNewWind = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowNewWind);
+ rowNewWind.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.HumiditySource), 600);
+ //搴曠嚎
+ rowNewWind.AddBottomLine();
+ //鍙崇澶�
+ rowNewWind.AddRightArrow();
+ var msg = Language.StringByID(R.MyInternationalizationString.nothing);
+ // 鍥炶皟婀垮害鏉ユ簮缁戝畾鐩爣
+ var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
+ rowNewWind.ButtonClickEvent += (sender, e) =>
+ {
+ var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 3);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ addDevicePage.Show();
+ };
+ }
+ #endregion
+
+ #region 鈻� 浜害璋冭妭_________________________
+ /// <summary>
+ /// 浜害璋冭妭琛�
+ /// </summary>
+ private void AddLevelRow()
+ {
//浜害璋冭妭
var rowLight = new FrameRowControl(listview.rowSpace / 2);
listview.AddChidren(rowLight);
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs
old mode 100644
new mode 100755
index ec2d672..64b9ea0
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs
@@ -84,7 +84,7 @@
if (listDataRoom.Count > 0)
{
//鍒濆鍖栨埧闂村拰璁惧鍒楄〃
- this.InitRoomAndDeviceRow(listDataRoom);
+ this.InitRoomAndDeviceRow(listDataRoom);
}
else
{
@@ -155,8 +155,8 @@
/// </summary>
/// <param name="listRoom">鍙互鏄剧ず鐨勬埧闂村璞�</param>
private void InitRoomAndDeviceRow(List<Common.Room> listRoom)
- {
- //鎴块棿鍒楄〃鎺т欢
+ {
+ //鎴块棿鍒楄〃鎺т欢
var roomContr = new RoomDeviceGroupMenuControl(listRoom);
bodyFrameLayout.AddChidren(roomContr);
@@ -200,26 +200,26 @@
listView.RecoverHeight();
DeviceSimpleSelectControl oldSelectContr = null;
- var listDevice = this.dicShowDevice[roomId];
- //鑾峰彇璁惧绫诲瀷鐨�
+ var listDevice = this.dicShowDevice[roomId];
+ //鑾峰彇璁惧绫诲瀷鐨�
var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
//妫�鏌ョ鍚堢殑璁惧
List<CommonDevice> listSupportDevice = new List<CommonDevice> { };
- foreach (var dev in listDevice)
- {
- //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欎笉鏄剧ず
- if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
- {
- continue;
- }
- if (dev.Type == DeviceType.FreshAir)
- {
- listSupportDevice.Add(dev);
- }
- }
-
- DeviceSimpleSelectControl oldDeviceSimpleSelectControl = null;
- int curIndex = 0;
+ foreach (var dev in listDevice)
+ {
+ //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欎笉鏄剧ず
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
+ {
+ continue;
+ }
+ if (dev.Type == DeviceType.FreshAir)
+ {
+ listSupportDevice.Add(dev);
+ }
+ }
+
+ DeviceSimpleSelectControl oldDeviceSimpleSelectControl = null;
+ int curIndex = 0;
for (int i = 0; i < listSupportDevice.Count; i++)
{
string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(listSupportDevice[i]);
@@ -230,34 +230,34 @@
{
//搴曠嚎
contr.AddBottomLine();
- }
-
+ }
+
contr.ButtonClickEvent += (sender, e) =>
- {
- if (contr.IsSelected)
- {
- return;
- }
- contr.IsSelected = true;
+ {
+ if (contr.IsSelected)
+ {
+ return;
+ }
+ contr.IsSelected = true;
oldSelectContr = contr;
- this.bindTargetKey = mainKey;
- //contr.IsSelected = !contr.IsSelected;
- ////閫夋嫨浜嗗埆鐨勮澶�
- //if (contr.IsSelected == true)
- //{
- // if (oldSelectContr != null)
- // {
- // oldSelectContr.IsSelected = false;
- // }
- // oldSelectContr = contr;
- // this.bindTargetKey = mainKey;
- //}
- ////鍙栨秷閫夋嫨
- //else
- //{
- // oldSelectContr = null;
- // this.bindTargetKey = string.Empty;
- //}
+ this.bindTargetKey = mainKey;
+ //contr.IsSelected = !contr.IsSelected;
+ ////閫夋嫨浜嗗埆鐨勮澶�
+ //if (contr.IsSelected == true)
+ //{
+ // if (oldSelectContr != null)
+ // {
+ // oldSelectContr.IsSelected = false;
+ // }
+ // oldSelectContr = contr;
+ // this.bindTargetKey = mainKey;
+ //}
+ ////鍙栨秷閫夋嫨
+ //else
+ //{
+ // oldSelectContr = null;
+ // this.bindTargetKey = string.Empty;
+ //}
};
if (this.bindTargetKey == mainKey)
{
@@ -295,19 +295,19 @@
{
bool canShow = false;
//鍏堟竻绌�
- this.dicShowDevice[room.Id] = new List<CommonDevice>();
-
+ this.dicShowDevice[room.Id] = new List<CommonDevice>();
+
foreach (var deviceKeys in room.ListDevice)
{
var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
if (device != null)
{
- if (device.Type == DeviceType.FreshAir)
- {
- //canShow = true;//聽聽杩欎釜鐣岄潰涓嶆樉绀烘埧闂�
- //鏀堕泦鍙互鏄剧ず鐨勮澶�
- this.dicShowDevice[room.Id].Add(device);
- }
+ if (device.Type == DeviceType.FreshAir)
+ {
+ //canShow = true;//聽聽杩欎釜鐣岄潰涓嶆樉绀烘埧闂�
+ //鏀堕泦鍙互鏄剧ず鐨勮澶�
+ this.dicShowDevice[room.Id].Add(device);
+ }
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
index 4bfeba7..dce3ae5 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勮澶�
/// </summary>
@@ -75,12 +75,16 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
this.tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//鍒濆鍖栬澶囧洖璺浘鏍�
- this.InitDeviceEpointIcon();
+ this.InitDeviceEpointIcon(listBackControl);
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -204,7 +208,7 @@
//娣诲姞鍔熻兘绫诲瀷琛�
this.AddFunctionTypeRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
}
#endregion
@@ -359,7 +363,7 @@
/// <summary>
/// 鍒濆鍖栬澶囧洖璺浘鏍�
/// </summary>
- private void InitDeviceEpointIcon()
+ private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
{
bool hadDevice = false;
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
@@ -398,7 +402,7 @@
frameBorder.Gravity = Gravity.CenterHorizontal;
frameBorder.Width = Application.GetMinRealAverage(426);
frameBorder.Height = Application.GetMinRealAverage(426);
- bodyFrameLayout.AddChidren(frameBorder);
+ listBackControl.frameTable.AddChidren(frameBorder);
var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
index afd919d..cde8171 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勮澶�
/// </summary>
@@ -75,12 +75,16 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
this.tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//鍒濆鍖栬澶囧洖璺浘鏍�
- this.InitDeviceEpointIcon();
+ this.InitDeviceEpointIcon(listBackControl);
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -204,7 +208,7 @@
//娣诲姞鍔熻兘绫诲瀷琛�
this.AddFunctionTypeRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
}
#endregion
@@ -359,7 +363,7 @@
/// <summary>
/// 鍒濆鍖栬澶囧洖璺浘鏍�
/// </summary>
- private void InitDeviceEpointIcon()
+ private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
{
bool hadDevice = false;
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
@@ -398,7 +402,7 @@
frameBorder.Gravity = Gravity.CenterHorizontal;
frameBorder.Width = Application.GetMinRealAverage(426);
frameBorder.Height = Application.GetMinRealAverage(426);
- bodyFrameLayout.AddChidren(frameBorder);
+ listBackControl.frameTable.AddChidren(frameBorder);
var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
btnPic.UnSelectedImagePath = "DeviceItem/PanelTable.png";
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs
index 29fe305..7c3b7e4 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorBindTargetSettionForm.cs
@@ -369,23 +369,26 @@
}
}
- //寤舵椂
- string strMinute = string.Empty;
- if (pirConfigure.transitionTime / 60 > 0)
+ //寤舵椂(鍗婅嚜鍔ㄦ病鏈夊欢鏃剁殑姒傚康)
+ if (this.pirConfigure.mode == 1)
{
- strMinute = pirConfigure.transitionTime / 60 + Language.StringByID(R.MyInternationalizationString.uMinute);
+ string strMinute = string.Empty;
+ if (pirConfigure.transitionTime / 60 > 0)
+ {
+ strMinute = pirConfigure.transitionTime / 60 + Language.StringByID(R.MyInternationalizationString.uMinute);
+ }
+ string strSecond = pirConfigure.transitionTime % 60 + Language.StringByID(R.MyInternationalizationString.uSecond);
+ var rowDelay = new FrameRowControl(listView.rowSpace / 2);
+ rowDelay.LeftOffset = Application.GetRealWidth(138) - ControlCommonResourse.XXLeft;
+ frameResult.AddChidren(rowDelay);
+ rowDelay.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDelayed), 300);
+ rowDelay.AddRightArrow();
+ var btnDelayView = rowDelay.AddMostRightView(strMinute + strSecond, 700);
+ rowDelay.ButtonClickEvent += (sender, e) =>
+ {
+ this.ShowDelayListTime(btnDelayView);
+ };
}
- string strSecond = pirConfigure.transitionTime % 60 + Language.StringByID(R.MyInternationalizationString.uSecond);
- var rowDelay = new FrameRowControl(listView.rowSpace / 2);
- rowDelay.LeftOffset = Application.GetRealWidth(138) - ControlCommonResourse.XXLeft;
- frameResult.AddChidren(rowDelay);
- rowDelay.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDelayed), 300);
- rowDelay.AddRightArrow();
- var btnDelayView = rowDelay.AddMostRightView(strMinute + strSecond, 700);
- rowDelay.ButtonClickEvent += (sender, e) =>
- {
- this.ShowDelayListTime(btnDelayView);
- };
//淇濆瓨
var btnSave = new BottomClickButton();
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs
index a48780e..c4fca7a 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Device/PirSensor/PirSensorWorkModeMenuForm.cs
@@ -241,8 +241,8 @@
{
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
-
- //鑾峰彇鐏厜鐨勯厤缃俊鎭�
+
+ //鑾峰彇PIR浼犳劅鍣ㄧ殑銆愰厤缃俊鎭��
this.pirConfigure = await HdlDevicePirSensorLogic.Current.GetPirSensorLightSettion(this.iASZone);
if (pirConfigure == null)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
index 1c46c2c..f80c37c 100644
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
@@ -908,9 +908,9 @@
string msg = Language.StringByID(R.MyInternationalizationString.NomallyModeIsCanceled).Replace("{0}", "\r\n");
var confirm = Language.StringByID(R.MyInternationalizationString.SureCancel);
var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.NomallyOpenMode, msg, confirm);
- var HaveLogicNormallyOpenMode = await Shared.Phone.Device.Logic.SkipView.Exist();
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist();
- if (HaveLogicNormallyOpenMode)
+ if (resTemp == 1)
{
//鏈夐�昏緫璁剧疆鐨勫脊绐�
alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.CancelNomallyOpenModeWithLogic, msg, confirm);
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/ShowDoorLockMsgControl.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
index c420160..f76ff99 100644
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -566,20 +566,6 @@
diyImageVerticalSeekBar.OnProgressChangedEvent += (sender, e) =>
{
int curVolume = -1;
- //if (e == 0)
- //{
- // curVolume = 0;
- //}
- //else if (e == 100)
- //{
- // curVolume = 14;
- //}
- //else
- //{
- // int comandValue = e;
- // int comandValueTemp = (comandValue * 100) / (Convert.ToInt32(((float)100 / 15) * 100));
- // curVolume = comandValueTemp;
- //}
curVolume = e;
currentVolume = curVolume;
progressText.Text = e.ToString() + "%";
@@ -693,7 +679,15 @@
}
NormallyOpenModeValue(tempRes);
- HaveLogicNormallyOpenMode = await Shared.Phone.Device.Logic.SkipView.Exist();
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist();
+ if (resTemp == 1)
+ {
+ HaveLogicNormallyOpenMode = true;
+ }
+ else if (resTemp == 0)
+ {
+ HaveLogicNormallyOpenMode = false;
+ }
Application.RunOnMainThread(() =>
{
UpdateNomallyOpenStatus();
@@ -1090,6 +1084,9 @@
}
else
{
+ //娣诲姞App寮�鍚父寮�妯″紡鐨勫巻鍙茶褰�
+ HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9001, string.Empty);
+
//姣忔閲嶆柊璁剧疆甯稿紑锛岄粯璁ゆ椂闂撮兘鏄�12灏忔椂
DoorLockCommonInfo.NormallyOpenModeInvalidTime = 12;
NormallyOpenModeValue(true);
@@ -1103,9 +1100,14 @@
alertNomallyModeIsTurnOn.Show();
alertNomallyModeIsTurnOn.MsgControlClickEvent += async () =>
{
- //榛樿鍒涘缓鐗规畩閫昏緫
- DoorLockCommonInfo.NormallyOpenModeInvalidTime = 12;
- Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
+ //榛樿鍒涘缓甯稿紑妯″紡鐨勭壒娈婇�昏緫
+ var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
+ if (!res)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.AddLogicNormallyModeFailed);
+ this.ShowTipMsg(msg0);
+ return;
+ }
};
//鐐瑰嚮鑷姩鍖�
@@ -1158,6 +1160,13 @@
//涓婃姤鈥滃父寮�妯″紡鈥濆凡琚彇娑堬紝app榛樿浜嗏�滃父寮�妯″紡鈥濊鍙栨秷
NormallyOpenModeValue(false);
UpdateNomallyOpenStatus();
+ //鍒犻櫎宸茬粡澶辨晥鐨勨�滃父寮�妯″紡鈥濈殑閫昏緫
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3);
+ if (resTemp == 3)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed);
+ this.ShowTipMsg(msg0);
+ }
}
else
{
@@ -1170,8 +1179,17 @@
{
if (IsFromReport)
{
- //涓婃姤鈥滃父寮�妯″紡鈥濆凡琚彇娑堬紝app閲嶆柊寮�鍚�滃父寮�妯″紡鈥�
+ //涓婃姤鈥滃父寮�妯″紡鈥濆凡琚彇娑�
Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
+ //鍏堝垹闄ゅ凡澶辨晥鐨勨�滃父寮�妯″紡鈥濈殑閫昏緫
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3);
+ if (resTemp == 3)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed);
+ this.ShowTipMsg(msg0);
+ return;
+ }
+ //app閲嶆柊寮�鍚�滃父寮�妯″紡鈥�
var result = await doorLock.SetNormallyOpenModeFuncAsync(true);
if (result == null || result.defaultControlResponseData == null)
{
@@ -1194,6 +1212,15 @@
//淇濇寔鈥滃父寮�鎴愬姛鈥�
NormallyOpenModeValue(true);
UpdateNomallyOpenStatus();
+ //鍒涘缓甯稿紑妯″紡鐨勭壒娈婇�昏緫
+ var resu = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
+ if (!resu)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.AddLogicNormallyModeFailed);
+ this.ShowTipMsg(msg0);
+ return;
+ }
+
CommonPage.Loading.Hide();
}
}
@@ -1211,6 +1238,14 @@
//涓婃姤闂ㄩ攣鈥滃父寮�妯″紡鈥濆凡缁忓彇娑堬紝鐜板湪app纭鈥滃父寮�妯″紡鈥濆彇娑�
NormallyOpenModeValue(false);
UpdateNomallyOpenStatus();
+
+ //鍒犻櫎宸茬粡澶辨晥鐨勨�滃父寮�妯″紡鈥濈殑閫昏緫
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3);
+ if (resTemp == 3)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed);
+ this.ShowTipMsg(msg0);
+ }
}
else
{
@@ -1230,13 +1265,26 @@
return;
}
else
- {
+ {
+ //娣诲姞App寮�鍚父寮�妯″紡鐨勫巻鍙茶褰�
+ HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9002, string.Empty);
+
//app纭鍙栨秷鈥滃父寮�妯″紡鈥濇垚鍔�
NormallyOpenModeValue(false);
UpdateNomallyOpenStatus();
- string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess);
- this.ShowTipMsg(msg2);
- Shared.Phone.Device.Logic.SkipView.LockCloseLogic(doorLock);
+
+ //鍒犻櫎璁剧疆甯稿紑妯″紡鍒涘缓鐨勯�昏緫
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3);
+ if (resTemp == 3)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed);
+ this.ShowTipMsg(msg0);
+ }
+ else if (resTemp == 2)
+ {
+ string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess);
+ this.ShowTipMsg(msg2);
+ }
}
}
};
@@ -1253,26 +1301,33 @@
var alertTimeInValidSetting = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim);
alertTimeInValidSetting.Show();
- alertTimeInValidSetting.InvalidTimeAction += (obj) =>
- {
- Regex rg = new Regex("^[0-9]+$");
- if (!rg.IsMatch(obj))
- {
- //蹇呴』鏄暟瀛�
- string msg0 = Language.StringByID(R.MyInternationalizationString.NormallyOpenModeInvalidTimeTip);
- this.ShowTipMsg(msg0);
+ alertTimeInValidSetting.InvalidTimeAction += async (obj) =>
+ {
+ Regex rg = new Regex("^[0-9]+$");
+ if (!rg.IsMatch(obj))
+ {
+ //蹇呴』鏄暟瀛�
+ string msg0 = Language.StringByID(R.MyInternationalizationString.NormallyOpenModeInvalidTimeTip);
+ this.ShowTipMsg(msg0);
- string msgTimeInValidSetting2 = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime);
- var timeConfrim2 = Language.StringByID(R.MyInternationalizationString.Confrim);
- var alertTimeInValidSetting2 = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting2, timeConfrim2);
- alertTimeInValidSetting2.Show();
- return;
- }
- //甯稿紑妯″紡澶辨晥鏃堕棿璁剧疆鎴愬姛
- var temp = int.Parse(obj);
- DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp;
- Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
- };
+ string msgTimeInValidSetting2 = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime);
+ var timeConfrim2 = Language.StringByID(R.MyInternationalizationString.Confrim);
+ var alertTimeInValidSetting2 = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting2, timeConfrim2);
+ alertTimeInValidSetting2.Show();
+ return;
+ }
+ //甯稿紑妯″紡澶辨晥鏃堕棿璁剧疆鎴愬姛
+ var temp = int.Parse(obj);
+ DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp;
+ //榛樿鍒涘缓甯稿紑妯″紡鐨勭壒娈婇�昏緫
+ var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
+ if (!res)
+ {
+ string msg0 = Language.StringByID(R.MyInternationalizationString.AddLogicNormallyModeFailed);
+ this.ShowTipMsg(msg0);
+ return;
+ }
+ };
}
/// <summary>
/// 甯稿紑妯″紡鐘舵�佹洿鏂�
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index 2582d09..25ec696 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -15,7 +15,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勭綉鍏�
/// </summary>
@@ -51,15 +51,19 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1368);
//鍥剧墖
var btnPic = new DeviceInfoIconControl();
btnPic.Y = Application.GetRealHeight(92);
btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
btnPic.InitControl(this.zbGateway);
//璁惧澶囨敞
@@ -156,7 +160,7 @@
};
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
index ffbdd5d..805e646 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -136,6 +136,13 @@
//鍗曞嚮浜嬩欢
gatewayRow.frameTable.ButtonClickEvent += (sender, e) =>
{
+ if (UserCenterResourse.HideOption.GotoGatewayProductInfoForm == 1)
+ {
+ //寮哄埗璺宠浆
+ var form2 = new GatewayProductInfoForm();
+ form2.AddForm(gateway);
+ return;
+ }
var form = new GatewayInfoEditorForm();
form.AddForm(gateway);
};
@@ -172,13 +179,8 @@
};
//瀹氫綅
- var btnPosition = new NormalViewControl(Application.GetRealWidth(184), gatewayRow.Height, false);
- btnPosition.BackgroundColor = 0xff4a4a4a;
- btnPosition.TextAlignment = TextAlignment.Center;
- btnPosition.TextColor = UserCenterColor.Current.White;
- btnPosition.TextSize = 12;
+ var btnPosition = gatewayRow.AddEditorControl(false);
btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
- gatewayRow.AddRightView(btnPosition);
btnPosition.ButtonClickEvent += (sender, e) =>
{
//鍙戦�佸畾浣嶅懡浠�
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
index 68597f2..e142e5b 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
@@ -44,6 +44,10 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
bool gateWayExist = HdlGatewayLogic.Current.IsGatewayExist(zbGateway);
var framePic = new FrameLayout();
@@ -51,7 +55,7 @@
framePic.Height = Application.GetRealHeight(570);
framePic.Gravity = Gravity.CenterHorizontal;
framePic.Y = Application.GetRealHeight(58);
- bodyFrameLayout.AddChidren(framePic);
+ listBackControl.frameTable.AddChidren(framePic);
//鍥剧墖
var btnImage = new PicViewControl(380, 328, true);
btnImage.Gravity = Gravity.Center;
@@ -60,7 +64,7 @@
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- var listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ var listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//璁惧澶囨敞(濡傛灉杩欎釜缃戝叧娌℃湁缁戝畾鐨勮瘽,鍙厑璁告煡鐪�,涓嶈兘鏇存敼)
string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
@@ -117,12 +121,12 @@
btnBeloneArea.AddBottomLine();
//瀹屾垚鍒濆鍖栨甯�
- tableContr.FinishInitControl(bodyFrameLayout, listview);
+ tableContr.FinishInitControl();
if (gateWayExist == true)
{
//鏇村閰嶇疆
- var btnHelp = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(49), false);
+ var btnHelp = new NormalViewControl(listBackControl.frameTable.Width, Application.GetRealHeight(49), false);
btnHelp.Y = Application.GetRealHeight(1388);
btnHelp.TextSize = 12;
btnHelp.TextAlignment = TextAlignment.Center;
@@ -133,14 +137,14 @@
var form = new GatewayManage.GatewayInfoEditorForm();
this.AddFromAndRemoveNowForm(form, zbGateway);
};
- bodyFrameLayout.AddChidren(btnHelp);
+ listBackControl.frameTable.AddChidren(btnHelp);
//搴曠嚎
int lineWidth = btnHelp.GetRealWidthByText();
var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
btnLine.Gravity = Gravity.CenterHorizontal;
btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8);
- bodyFrameLayout.AddChidren(btnLine);
+ listBackControl.frameTable.AddChidren(btnLine);
}
//瀹屾垚鎸夐挳
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
index 4868a21..a45a1c3 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
@@ -148,13 +148,8 @@
};
}
//瀹氫綅
- var btnPosition = new NormalViewControl(Application.GetRealWidth(184), frameRow.Height, false);
- btnPosition.BackgroundColor = 0xff4a4a4a;
- btnPosition.TextAlignment = TextAlignment.Center;
- btnPosition.TextColor = UserCenterColor.Current.White;
- btnPosition.TextSize = 12;
+ var btnPosition = frameRow.AddEditorControl(false);
btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
- frameRow.AddRightView(btnPosition);
btnPosition.ButtonClickEvent += (sender, e) =>
{
//鍙戦�佸畾浣嶅懡浠�
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs
index 39c627f..585bd74 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs
@@ -128,13 +128,8 @@
gatewayRow.frameTable.AddChidren(btnLink);
//瀹氫綅
- var btnPosition = new NormalViewControl(Application.GetRealWidth(184), gatewayRow.Height, false);
- btnPosition.BackgroundColor = 0xff4a4a4a;
- btnPosition.TextAlignment = TextAlignment.Center;
- btnPosition.TextColor = UserCenterColor.Current.White;
- btnPosition.TextSize = 12;
+ var btnPosition = gatewayRow.AddEditorControl(false);
btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
- gatewayRow.AddRightView(btnPosition);
btnPosition.ButtonClickEvent += (sender, e) =>
{
//鍙戦�佸畾浣嶅懡浠�
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
index f135420..6bcda5c 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
@@ -18,7 +18,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 妤煎眰涓婚敭
/// </summary>
@@ -54,24 +54,28 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍔犱竴涓櫧鑹茶儗鏅�
var frameBack1 = new FrameLayout();
frameBack1.Height = Application.GetRealHeight(450);
frameBack1.Y = Application.GetRealHeight(196);
frameBack1.BackgroundColor = UserCenterColor.Current.White;
frameBack1.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
- bodyFrameLayout.AddChidren(frameBack1);
+ listBackControl.frameTable.AddChidren(frameBack1);
//鍒濆鍖栦俊鎭甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 613, 1175);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1175);
//鎴块棿鍥剧墖搴曢儴闃村奖
var btnShadow = new PicViewControl(853, 593);
btnShadow.Y = Application.GetRealHeight(58);
btnShadow.Gravity = Gravity.CenterHorizontal;
btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
- bodyFrameLayout.AddChidren(btnShadow);
+ listBackControl.frameTable.AddChidren(btnShadow);
//鎴块棿鍥剧墖
var btnPic = new ImageView();
btnPic.Y = Application.GetRealHeight(60);
@@ -80,15 +84,16 @@
btnPic.Radius = (uint)Application.GetRealHeight(17);
btnPic.Gravity = Gravity.CenterHorizontal;
btnPic.ImagePath = "RoomIcon/0.jpg";
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
//鍥剧墖閬僵
var btnZhezhao = new FrameLayout();
btnZhezhao.Width = btnPic.Width;
btnZhezhao.Height = btnPic.Height;
btnZhezhao.Y = btnPic.Y;
btnZhezhao.Gravity = Gravity.CenterHorizontal;
- btnZhezhao.Radius = btnPic.Radius;
- bodyFrameLayout.AddChidren(btnZhezhao);
+ btnZhezhao.Radius = (uint)Application.GetRealHeight(17);
+ btnZhezhao.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor;
+ listBackControl.frameTable.AddChidren(btnZhezhao);
btnZhezhao.MouseUpEventHandler += (sender, e) =>
{
//鎴块棿鍥剧墖閫夋嫨
@@ -174,7 +179,7 @@
};
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -470,11 +475,9 @@
//榛樿鍥惧簱
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.LocalPicture), () =>
{
- var localPic = new Phone.Device.Room.AddRoomSelectPicByLocal();
- Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- localPic.Show();
- localPic.action = (imgPath) =>
+ var form = new SelectLocalRoomImageForm();
+ form.AddForm();
+ form.FinishSelectEvent = (imgPath) =>
{
if (string.IsNullOrEmpty(imgPath) == true)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
index 305b4fd..f5b7845 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -18,7 +18,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 鎴块棿瀵硅薄
/// </summary>
@@ -69,24 +69,28 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍔犱竴涓櫧鑹茶儗鏅�
var frameBack1 = new FrameLayout();
frameBack1.Height = Application.GetRealHeight(450);
frameBack1.Y = Application.GetRealHeight(196);
frameBack1.BackgroundColor = UserCenterColor.Current.White;
frameBack1.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
- bodyFrameLayout.AddChidren(frameBack1);
+ listBackControl.frameTable.AddChidren(frameBack1);
//鍒濆鍖栦俊鎭甯�
var tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 613, 1175);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1175);
//鎴块棿鍥剧墖搴曢儴闃村奖
var btnShadow = new PicViewControl(853, 593);
btnShadow.Y = Application.GetRealHeight(58);
btnShadow.Gravity = Gravity.CenterHorizontal;
btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
- bodyFrameLayout.AddChidren(btnShadow);
+ listBackControl.frameTable.AddChidren(btnShadow);
//鎴块棿鍥剧墖
var btnPic = new ImageView();
btnPic.Y = Application.GetRealHeight(60);
@@ -102,15 +106,16 @@
{
btnPic.ImageBytes = Common.Global.ReadFileByHomeId(this.editorRoom.BackgroundImage);
}
- bodyFrameLayout.AddChidren(btnPic);
+ listBackControl.frameTable.AddChidren(btnPic);
//鍥剧墖閬僵
var btnZhezhao = new FrameLayout();
btnZhezhao.Width = btnPic.Width;
btnZhezhao.Height = btnPic.Height;
btnZhezhao.Y = btnPic.Y;
btnZhezhao.Gravity = Gravity.CenterHorizontal;
- btnZhezhao.Radius = btnPic.Radius;
- bodyFrameLayout.AddChidren(btnZhezhao);
+ btnZhezhao.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor;
+ btnZhezhao.Radius = (uint)Application.GetRealHeight(17);
+ listBackControl.frameTable.AddChidren(btnZhezhao);
//鍒嗕韩鐨勬埧闂翠笉鑳界紪杈�
if (this.editorRoom.IsSharedRoom == false)
{
@@ -230,7 +235,7 @@
}
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
tableContr = null;
//鍒嗕韩鐨勬埧闂翠笉鑳戒繚瀛�
@@ -566,11 +571,9 @@
//榛樿鍥惧簱
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.LocalPicture), () =>
{
- var localPic = new Phone.Device.Room.AddRoomSelectPicByLocal();
- Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- localPic.Show();
- localPic.action = (imgPath) =>
+ var form = new SelectLocalRoomImageForm();
+ form.AddForm();
+ form.FinishSelectEvent = (imgPath) =>
{
if (string.IsNullOrEmpty(imgPath) == true)
{
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
index 7581816..393b9e2 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
@@ -254,13 +254,8 @@
return;
}
//鏇存敼
- var btnChanged = new NormalViewControl(Application.GetRealWidth(184), rowLayout.Height, false);
- btnChanged.BackgroundColor = 0xff4a4a4a;
- btnChanged.TextSize = 12;
- btnChanged.TextColor = UserCenterColor.Current.White;
- btnChanged.TextAlignment = TextAlignment.Center;
+ var btnChanged = rowLayout.AddEditorControl();
btnChanged.TextID = R.MyInternationalizationString.uChanged1;
- rowLayout.AddRightView(btnChanged);
btnChanged.ButtonClickEvent += (sender, e) =>
{
//鏄剧ず缂栬緫鍚嶇О鐣岄潰
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index 15f46ff..6ca7502 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -328,13 +328,8 @@
if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
{
//鏇存敼
- var btnChanged = new NormalViewControl(Application.GetRealWidth(184), frameRow.Height, false);
- btnChanged.BackgroundColor = 0xff4a4a4a;
- btnChanged.TextSize = 12;
- btnChanged.TextColor = UserCenterColor.Current.White;
- btnChanged.TextAlignment = TextAlignment.Center;
+ var btnChanged = frameRow.AddEditorControl();
btnChanged.TextID = R.MyInternationalizationString.uChanged1;
- frameRow.AddRightView(btnChanged);
btnChanged.ButtonClickEvent += (sender, e) =>
{
//鍒涘缓鎴栬�呯紪杈戞ゼ灞�
@@ -574,8 +569,6 @@
var btnEditor = frameRow.AddEditorControl();
btnEditor.ButtonClickEvent += (sender, e) =>
{
- //鍏抽棴宸﹀彸鑿滃崟
- frameRow.HideMenu();
var form = new EditorRoomInforForm();
form.AddForm(room);
form.FinishEditorEvent += (roomName) =>
@@ -803,7 +796,7 @@
{
//璇疯緭鍏ヤ綇瀹呭悕绉�
string msg = Language.StringByID(R.MyInternationalizationString.uPleaseInputFloorName);
- this.ShowMassage(ShowMsgType.Error, msg);
+ this.ShowMassage(ShowMsgType.Tip, msg);
return false;
}
foreach (string floorKeys in Common.Config.Instance.Home.FloorDics.Keys)
@@ -812,7 +805,7 @@
{
//妤煎眰鍚嶇О宸茬粡瀛樺湪
string msg = Language.StringByID(R.MyInternationalizationString.uFloorNameIsExist);
- this.ShowMassage(ShowMsgType.Error, msg);
+ this.ShowMassage(ShowMsgType.Tip, msg);
return false;
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs
new file mode 100755
index 0000000..b6a842a
--- /dev/null
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs
@@ -0,0 +1,118 @@
+锘縰sing System;
+using Shared.Common;
+using Shared.Phone.UserCenter;
+
+namespace Shared.Phone.UserCenter.Residence
+{
+ /// <summary>
+ /// 閫夋嫨鏈湴鎴块棿鍥剧墖鐨勭晫闈�
+ /// </summary>
+ public class SelectLocalRoomImageForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 缁撴潫閫夋嫨鐨勪簨浠�(鍥剧墖鍚嶅瓧)
+ /// </summary>
+ public Action<string> FinishSelectEvent = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ public void ShowForm()
+ {
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ //鍒楄〃鎺т欢
+ var listView = new VerticalListControl();
+ listView.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listView);
+
+ int picHeight = this.GetPictrueRealSize(311);
+ int picWidth = this.GetPictrueRealSize(467);
+ int leftRightSpace = this.GetPictrueRealSize(58);
+ int space = listView.Width - leftRightSpace * 2 - picWidth * 2;
+
+ //涓�鍏�14寮犲浘鐗�
+ FrameLayout frameRow = null;
+ for (int i = 0; i < 22; i++)
+ {
+ //鍥剧墖
+ var btnIcon = new ImageView();
+
+ if (i % 2 == 0)
+ {
+ btnIcon.X = leftRightSpace;
+
+ //琛屾帶浠�
+ frameRow = new FrameLayout();
+ frameRow.Height = picHeight + Application.GetRealHeight(58);
+ listView.AddChidren(frameRow);
+ }
+ else
+ {
+ btnIcon.X = leftRightSpace + picWidth + space;
+ }
+
+ btnIcon.Y = Application.GetRealHeight(58);
+ btnIcon.Width = picWidth;
+ btnIcon.Height = picHeight;
+ btnIcon.ImagePath = $"RoomIcon/{i}.jpg";
+ btnIcon.Radius = (uint)Application.GetRealHeight(17);
+ frameRow.AddChidren(btnIcon);
+
+ //鍥剧墖閬僵
+ var btnZhezhao = new FrameLayout();
+ btnZhezhao.Width = btnIcon.Width;
+ btnZhezhao.Height = btnIcon.Height;
+ btnZhezhao.Y = btnIcon.Y;
+ btnZhezhao.X = btnIcon.X;
+ btnZhezhao.Radius = (uint)Application.GetRealHeight(17);
+ btnZhezhao.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor;
+ frameRow.AddChidren(btnZhezhao);
+ btnZhezhao.MouseUpEventHandler += (sender, e) =>
+ {
+ //缁撴潫閫夋嫨鐨勪簨浠�
+ this.FinishSelectEvent?.Invoke(btnIcon.ImagePath);
+ this.CloseForm();
+ };
+
+ }
+
+ //搴曢儴闂磋窛
+ var frameTemp = new FrameLayout();
+ frameTemp.Height = Application.GetRealHeight(58);
+ listView.AddChidren(frameTemp);
+ }
+
+ #endregion
+
+ #region 鈻� 鐣岄潰鍏抽棴___________________________
+
+ /// <summary>
+ /// 鐣岄潰鍏抽棴
+ /// </summary>
+ public override void CloseFormBefore()
+ {
+ this.FinishSelectEvent = null;
+
+ base.CloseFormBefore();
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs
index 30a38e4..10f20ce 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectAcForm.cs
@@ -326,27 +326,33 @@
taskInfo2.TaskType = 5;
taskInfo2.Data1 = 3;
taskInfo2.Data2 = listMode[selectModelIndex];
- listData.Add(taskInfo2);
-
- //娓╁害
- if (listMode[selectModelIndex] == 4)
- {
- //鍒剁儹
- var taskInfo3 = new Safeguard.TaskListInfo();
- taskInfo3.TaskType = 5;
- taskInfo3.Data1 = 4;
- taskInfo3.Data2 = listTemperature[selectTemperatureIndex] * 100;
+ listData.Add(taskInfo2);
+
+ //娓╁害
+ var taskInfo3 = new Safeguard.TaskListInfo();
+ taskInfo3.TaskType = 5;
+ taskInfo3.Data2 = listTemperature[selectTemperatureIndex] * 100;
+ //1:鑷姩 3:鍒跺喎 4:鍒剁儹 7:閫侀 8:闄ゆ箍
+
+ //鑷姩
+ if (listMode[selectModelIndex] == 1)
+ {
+ taskInfo3.Data1 = 7;
listData.Add(taskInfo3);
}
- else
+ //鍒剁儹
+ else if (listMode[selectModelIndex] == 4)
{
- //鎴戜篃涓嶇煡閬撹繖涓槸浠�涔堝垎鏀�
- var taskInfo4 = new Safeguard.TaskListInfo();
- taskInfo4.TaskType = 5;
- taskInfo4.Data1 = 5;
- taskInfo4.Data2 = listTemperature[selectTemperatureIndex] * 100;
- listData.Add(taskInfo4);
+ taskInfo3.Data1 = 4;
+ listData.Add(taskInfo3);
}
+ //鍒跺喎锛岄櫎婀块粯璁ら兘鏄� 鍒跺喎
+ else if (listMode[selectModelIndex] == 3 || listMode[selectModelIndex] == 8)
+ {
+ taskInfo3.Data1 = 5;
+ listData.Add(taskInfo3);
+ }
+ //閫侀娌℃湁娓╁害鐨勬蹇�
}
//鑾峰彇鐘舵�佺殑鏄剧ず鏂囨湰
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
index 8fa4707..0db4b27 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
@@ -13,6 +13,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 娣诲姞鑱旂郴鏂瑰紡鐨勪簨浠�
+ /// </summary>
+ public Action AddPhoneEvent = null;
+ /// <summary>
/// 淇℃伅鎻愮ず鎺т欢
/// </summary>
private NormalViewControl btnErrorMsg = null;
@@ -61,6 +65,13 @@
//鍒濆鍖栦腑閮ㄤ俊鎭�
this.InitMiddleFrame();
+
+ //閲嶅啓搴曞眰杩斿洖鎸夐敭浜嬩欢
+ this.BackButtonClickEvent += (sender) =>
+ {
+ this.AddPhoneEvent = null;
+ this.CloseForm();
+ };
}
/// <summary>
@@ -186,6 +197,10 @@
return;
}
this.CloseForm();
+
+ //璋冪敤鍥炶皟鍑芥暟
+ this.AddPhoneEvent?.Invoke();
+ this.AddPhoneEvent = null;
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddNewForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddNewForm.cs
index f00d28f..44de1b0 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddNewForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswAddNewForm.cs
@@ -12,6 +12,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 瀵嗙爜鏀瑰彉浜嬩欢
+ /// </summary>
+ public Action<string> PasswordChangedEvent = null;
+ /// <summary>
/// 鐢ㄦ埛璐﹀彿
/// </summary>
private int pswNo = 5;
@@ -109,11 +113,18 @@
//鐣岄潰鐩存帴鍏抽棴
this.CloseForm();
- //鍏抽棴缂栬緫鐣岄潰
- this.CloseFormByFormName("CoercePswEditorForm");
- var form = new CoercePswEditorForm();
- form.AddForm(pswValue1, i_titleText);
+ if (UserCenterResourse.DicActionForm.ContainsKey("CoercePswEditorForm") == false)
+ {
+ var form = new CoercePswEditorForm();
+ form.AddForm(pswValue1, i_titleText);
+ }
+ else
+ {
+ //鍥炶皟鍑芥暟
+ this.PasswordChangedEvent?.Invoke(pswValue1);
+ this.PasswordChangedEvent = null;
+ }
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs
index caf8137..d687d30 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs
@@ -24,9 +24,17 @@
/// </summary>
private string passwordTip = string.Empty;
/// <summary>
- /// 鍒楄〃鐨勬甯冩帶浠�
+ /// 鑱旂郴浜虹殑鍒楄〃鎺т欢
/// </summary>
- private FrameLayout frameTable = null;
+ private FrameListControl listPhoneView = null;
+ /// <summary>
+ /// 淇℃伅鎺т欢
+ /// </summary>
+ private InformationEditorControl tableContr = null;
+ /// <summary>
+ /// 瀵嗙爜鎺т欢
+ /// </summary>
+ private NormalViewControl btnPassword = null;
/// <summary>
/// 褰撳墠鐨勮仈绯讳汉鍒楄〃
/// </summary>
@@ -45,6 +53,7 @@
{
this.password = i_password;
this.passwordTip = i_passwordTip;
+ this.ScrollEnabled = false;
//璁剧疆澶撮儴淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uCoercePassword));
@@ -61,9 +70,9 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
- this.frameTable = new FrameLayout();
- frameTable.Height = bodyFrameLayout.Height;
- bodyFrameLayout.AddChidren(frameTable);
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
var frameback = new FrameLayout();
frameback.Y = Application.GetRealHeight(179);
@@ -71,7 +80,7 @@
frameback.Width = Application.GetRealWidth(717);
frameback.Gravity = Gravity.CenterHorizontal;
frameback.BackgroundImagePath = "Safeguard/SafeguardPasswordGround.png";
- bodyFrameLayout.AddChidren(frameback);
+ listBackControl.frameTable.AddChidren(frameback);
//褰撳墠浣跨敤瀵嗙爜
var btnNowTip = new NormalViewControl(frameback.Width, Application.GetRealHeight(50), false);
btnNowTip.Y = Application.GetRealHeight(81);
@@ -80,7 +89,7 @@
btnNowTip.TextColor = UserCenterColor.Current.TextGrayColor3;
btnNowTip.TextID = R.MyInternationalizationString.uNowUsePassword;
frameback.AddChidren(btnNowTip);
- var btnPassword = new NormalViewControl(frameback.Width, Application.GetRealHeight(90), false);
+ this.btnPassword = new NormalViewControl(frameback.Width, Application.GetRealHeight(90), false);
btnPassword.TextAlignment = TextAlignment.Center;
btnPassword.Y = Application.GetRealHeight(150);
btnPassword.TextSize = 24;
@@ -90,29 +99,27 @@
frameback.AddChidren(btnPassword);
//鍒濆鍖栧垪琛ㄦ帶浠�
- this.InitListViewControl();
+ this.InitListViewControl(listBackControl);
}
/// <summary>
/// 鍒濆鍖栧垪琛ㄦ帶浠�
/// </summary>
- private void InitListViewControl()
+ private void InitListViewControl(VerticalFrameControl listBackControl)
{
- this.frameTable.RemoveAll();
-
//鍒濆鍖栨甯�
- var tableContr = new InformationEditorControl();
- var listview = tableContr.InitControl(this.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 711, 1025);
+ this.tableContr = new InformationEditorControl();
+ var listView = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1025);
//澶囨敞淇℃伅
string caption = Language.StringByID(R.MyInternationalizationString.uNoteInformation);
- var rowNote = new FrameCaptionInputControl(caption, passwordTip, listview.rowSpace / 2);
+ var rowNote = new FrameCaptionInputControl(caption, passwordTip, listView.rowSpace / 2);
rowNote.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPlesaeInputNoteInformation);
rowNote.txtInput.MaxByte = 90;
- listview.AddChidren(rowNote);
+ listView.AddChidren(rowNote);
rowNote.InitControl();
rowNote.AddBottomLine();
- rowNote.txtInput.FinishInputEvent += () =>
+ rowNote.txtInput.FinishInputEvent += async () =>
{
if (rowNote.Text == string.Empty)
{
@@ -122,13 +129,13 @@
if (passwordTip != rowNote.Text)
{
//淇敼瀵嗙爜澶囨敞
- this.EditorPassworTip(password, rowNote.Text);
+ await this.EditorPassworTip(password, rowNote.Text, true);
}
};
//淇敼瀵嗙爜
- var rowPsw = new FrameRowControl(listview.rowSpace / 2);
- listview.AddChidren(rowPsw);
+ var rowPsw = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowPsw);
rowPsw.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uChangedPassword), 300);
rowPsw.AddRightArrow();
rowPsw.AddBottomLine();
@@ -136,7 +143,59 @@
{
var form = new CoercePswAddNewForm();
form.AddForm(rowNote.Text);
+ form.PasswordChangedEvent += (newPassword) =>
+ {
+ this.btnPassword.Text = newPassword;
+ this.password = newPassword;
+ };
};
+
+ //鍒濆鍖栬仈绯讳汉鎺т欢
+ this.InitPhoneControl(listView);
+
+ //閲嶅啓搴曞眰鐨勮繑鍥炴寜閿簨浠�
+ this.BackButtonClickEvent += async (sender) =>
+ {
+ sender.CanClick = false;
+ if (rowNote.Text == string.Empty || passwordTip == rowNote.Text)
+ {
+ this.CloseForm();
+ }
+ else
+ {
+ //淇敼瀵嗙爜澶囨敞
+ var result = await this.EditorPassworTip(password, rowNote.Text, false);
+ sender.CanClick = true;
+ if (result == true)
+ {
+ this.CloseForm();
+ }
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栬仈绯讳汉鎺т欢___________________
+
+ /// <summary>
+ /// 鍒濆鍖栬仈绯讳汉鎺т欢
+ /// </summary>
+ private void InitPhoneControl(FrameListControl listTableView)
+ {
+ //鑱旂郴浜虹殑鍒楄〃鎺т欢
+ if (listPhoneView == null)
+ {
+ this.listPhoneView = new FrameListControl();
+ listPhoneView.rowSpace = listTableView.rowSpace;
+ listPhoneView.Height = Application.GetRealHeight(200);
+ listTableView.AddChidren(listPhoneView);
+ listPhoneView.Y -= listTableView.rowSpace;
+ }
+ else
+ {
+ this.listPhoneView.RemoveAll();
+ }
HdlThreadLogic.Current.RunThread(async () =>
{
@@ -157,9 +216,9 @@
{
this.listPhoneData = new List<ZigBee.Device.Safeguard.PushTargetInfo>();
//鑱旂郴浜�
- var rowContact = new FrameRowControl(listview.rowSpace / 2);
+ var rowContact = new FrameRowControl(this.listPhoneView.rowSpace / 2);
rowContact.UseClickStatu = false;
- listview.AddChidren(rowContact);
+ listPhoneView.AddChidren(rowContact);
rowContact.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uContactPersion), 300);
var btnAdd = rowContact.AddMostRightEmptyIcon(81, 81);
btnAdd.UnSelectedImagePath = "Item/Add.png";
@@ -167,6 +226,11 @@
{
var form = new CoercePswAddContactForm();
form.AddForm(listPhoneData);
+ form.AddPhoneEvent += () =>
+ {
+ //閲嶆柊鍒锋柊
+ this.InitPhoneControl(listTableView);
+ };
};
if (result.Actions.Count > 0)
@@ -175,7 +239,7 @@
foreach (var data in listPhoneData)
{
//娣诲姞鑱旂郴浜鸿
- this.AddPhoneNumRowLayout(listview, data);
+ this.AddPhoneNumRowLayout(data);
}
}
else
@@ -183,8 +247,20 @@
//娌℃湁鑱旂郴浜虹殑璇�,娣诲姞涓簳绾�
rowContact.AddBottomLine();
}
+ //璋冩暣妗屽竷澶у皬
+ this.AdjustPhoneContrlTable();
});
});
+ }
+
+ /// <summary>
+ /// 璋冩暣妗屽竷澶у皬
+ /// </summary>
+ private void AdjustPhoneContrlTable()
+ {
+ //璋冩暣妗屽竷
+ listPhoneView.AdjustRealHeight();
+ tableContr.FinishInitControl(false, true);
}
#endregion
@@ -194,9 +270,8 @@
/// <summary>
/// 娣诲姞鑱旂郴浜鸿
/// </summary>
- /// <param name="listview"></param>
/// <param name="data"></param>
- private void AddPhoneNumRowLayout(VerticalListControl listview, ZigBee.Device.Safeguard.PushTargetInfo data)
+ private void AddPhoneNumRowLayout(ZigBee.Device.Safeguard.PushTargetInfo data)
{
var strArry = data.PushNumber.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);
if (strArry.Length != 2)
@@ -220,7 +295,8 @@
}
var rowContact = new RowLayoutControl();
- listview.AddChidren(rowContact);
+ rowContact.MainKeys = strPhone;
+ this.listPhoneView.AddChidren(rowContact);
rowContact.frameTable.UseClickStatu = false;
//鑱旂郴鏂瑰紡
rowContact.frameTable.AddLeftCaption(strPhone + " (" + data.PushNumberNote + ")", 800);
@@ -261,6 +337,22 @@
bool result = await HdlSafeguardLogic.Current.DeleteCoercePhoneNumber(areaCode, phone);
if (result == true)
{
+ bool canMove = false;
+ for (int i = 0; i < this.listPhoneView.ChildrenCount; i++)
+ {
+ var myRow = this.listPhoneView.GetChildren(i) as RowLayoutControl;
+ if (myRow != null && myRow.MainKeys == rowContact.MainKeys)
+ {
+ //寰幆鍒颁簡褰撳墠鎺т欢
+ canMove = true;
+ continue;
+ }
+ if (canMove == true)
+ {
+ //瀹冧箣鍚庣殑鎺т欢鍏ㄩ儴寰�涓婄Щ鍔�
+ myRow.Y -= rowContact.Height;
+ }
+ }
rowContact.RemoveFromParent();
//绉婚櫎缂撳瓨
@@ -272,6 +364,8 @@
listPhoneData.RemoveAt(i);
}
}
+ //璋冩暣妗屽竷澶у皬
+ this.AdjustPhoneContrlTable();
}
}
@@ -284,31 +378,21 @@
/// </summary>
/// <param name="i_password">鐢ㄦ埛瀵嗙爜</param>
/// <param name="i_passwordTip">鐢ㄦ埛瀵嗙爜鎻愮ず</param>
- private async void EditorPassworTip(string i_password, string i_passwordTip)
+ private async System.Threading.Tasks.Task<bool> EditorPassworTip(string i_password, string i_passwordTip, bool ShowMsg)
{
var result = await HdlSafeguardLogic.Current.AddPassWordTips(this.pswNo, i_password, i_passwordTip);
if (result == true)
{
- //淇敼澶囨敞淇℃伅鎴愬姛!
- string msg = Language.StringByID(R.MyInternationalizationString.uEditorNoteInformationSuccess);
- this.ShowMassage(ShowMsgType.Tip, msg);
+ if (ShowMsg == true)
+ {
+ //淇敼澶囨敞淇℃伅鎴愬姛!
+ string msg = Language.StringByID(R.MyInternationalizationString.uEditorNoteInformationSuccess);
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ }
this.passwordTip = i_passwordTip;
}
- }
-
- #endregion
-
- #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________
-
- /// <summary>
- /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠�
- /// </summary>
- public override int FormActionAgainEvent()
- {
- //鍒濆鍖栧垪琛ㄦ帶浠�
- this.InitListViewControl();
- return 1;
+ return result;
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordAddNewForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordAddNewForm.cs
index 50a2a5a..6fb528b 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordAddNewForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordAddNewForm.cs
@@ -12,6 +12,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 瀵嗙爜鏀瑰彉浜嬩欢
+ /// </summary>
+ public Action<string> PasswordChangedEvent = null;
+ /// <summary>
/// 鐢ㄦ埛璐﹀彿
/// </summary>
private int pswNo = 0;
@@ -111,11 +115,19 @@
//鐣岄潰鐩存帴鍏抽棴
this.CloseForm();
- //鍏抽棴缂栬緫鐣岄潰
- this.CloseFormByFormName("PasswordUserEditorForm");
- var form = new PasswordUserEditorForm();
- form.AddForm(this.pswNo, pswValue1, i_titleText);
+ if (UserCenterResourse.DicActionForm.ContainsKey("PasswordUserEditorForm") == false)
+ {
+ var form = new PasswordUserEditorForm();
+ form.AddForm(this.pswNo, pswValue1, i_titleText);
+ }
+ else
+ {
+ //鍥炶皟鍑芥暟
+ this.PasswordChangedEvent?.Invoke(pswValue1);
+ this.PasswordChangedEvent = null;
+
+ }
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordUserEditorForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordUserEditorForm.cs
index a9ade58..41ce528 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordUserEditorForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/Safety/PasswordUserEditorForm.cs
@@ -30,6 +30,8 @@
{
this.pswNo = i_pswNo;
+ this.ScrollEnabled = false;
+
//璁剧疆澶撮儴淇℃伅
base.SetTitleText(i_passwordTip);
@@ -47,13 +49,17 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
var frameback = new FrameLayout();
frameback.Y = Application.GetRealHeight(179);
frameback.Height = Application.GetRealHeight(395);
frameback.Width = Application.GetRealWidth(717);
frameback.Gravity = Gravity.CenterHorizontal;
frameback.BackgroundImagePath = "Safeguard/SafeguardPasswordGround.png";
- bodyFrameLayout.AddChidren(frameback);
+ listBackControl.frameTable.AddChidren(frameback);
//褰撳墠浣跨敤瀵嗙爜
var btnNowTip = new NormalViewControl(frameback.Width, Application.GetRealHeight(50), false);
btnNowTip.Y = Application.GetRealHeight(81);
@@ -72,7 +78,7 @@
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- var listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 711, 1025);
+ var listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1025);
//澶囨敞淇℃伅
string caption = Language.StringByID(R.MyInternationalizationString.uNoteInformation);
@@ -82,7 +88,7 @@
listview.AddChidren(rowNote);
rowNote.InitControl();
rowNote.AddBottomLine();
- rowNote.txtInput.FinishInputEvent += () =>
+ rowNote.txtInput.FinishInputEvent += async () =>
{
if (rowNote.Text == string.Empty)
{
@@ -92,7 +98,11 @@
if (i_passwordTip != rowNote.Text)
{
//淇敼瀵嗙爜澶囨敞
- this.EditorPassworTip(i_password, rowNote.Text);
+ var result = await this.EditorPassworTip(i_password, rowNote.Text, true);
+ if (result == true)
+ {
+ i_passwordTip = rowNote.Text;
+ }
}
};
@@ -106,11 +116,36 @@
{
var form = new PasswordAddNewForm();
form.AddForm(this.pswNo, rowNote.Text);
+ form.PasswordChangedEvent += (newPassword) =>
+ {
+ btnPassword.Text = newPassword;
+ i_password = newPassword;
+ };
};
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, listview);
+ tableContr.FinishInitControl();
tableContr = null;
+
+ //閲嶅啓搴曞眰杩斿洖鎸夐敭鐨勪簨浠�
+ this.BackButtonClickEvent = async (sender) =>
+ {
+ sender.CanClick = false;
+ if (rowNote.Text == string.Empty || i_passwordTip == rowNote.Text)
+ {
+ this.CloseForm();
+ }
+ else
+ {
+ //淇敼瀵嗙爜澶囨敞
+ var result = await this.EditorPassworTip(i_password, rowNote.Text, false);
+ sender.CanClick = true;
+ if (result == true)
+ {
+ this.CloseForm();
+ }
+ }
+ };
}
#endregion
@@ -122,17 +157,21 @@
/// </summary>
/// <param name="i_password">鐢ㄦ埛瀵嗙爜</param>
/// <param name="i_passwordTip">鐢ㄦ埛瀵嗙爜鎻愮ず</param>
- private async void EditorPassworTip(string i_password, string i_passwordTip)
+ private async System.Threading.Tasks.Task<bool> EditorPassworTip(string i_password, string i_passwordTip, bool ShowMsg)
{
var result = await HdlSafeguardLogic.Current.AddPassWordTips(this.pswNo, i_password, i_passwordTip);
if (result == true)
{
- //淇敼澶囨敞淇℃伅鎴愬姛!
- string msg = Language.StringByID(R.MyInternationalizationString.uEditorNoteInformationSuccess);
- this.ShowMassage(ShowMsgType.Tip, msg);
+ if (ShowMsg == true)
+ {
+ //淇敼澶囨敞淇℃伅鎴愬姛!
+ string msg = Language.StringByID(R.MyInternationalizationString.uEditorNoteInformationSuccess);
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ }
//璁剧疆澶撮儴淇℃伅
base.SetTitleText(i_passwordTip);
}
+ return result;
}
#endregion
diff --git a/ZigbeeApp20200414/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs b/ZigbeeApp20200414/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
index 5c4653d..c1f5955 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
@@ -407,6 +407,11 @@
//寮哄埗璺宠浆鐪熷疄璁惧鐣岄潰
UserCenterResourse.HideOption.GotoRealDeviceForm = 1;
}
+ if (textValue == "12348")
+ {
+ //寮哄埗璺宠浆缃戝叧鐣岄潰
+ UserCenterResourse.HideOption.GotoGatewayProductInfoForm = 1;
+ }
this.ShowMassage(ShowMsgType.Tip, "Ok!");
});
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserView/LoginLoading.cs b/ZigbeeApp20200414/Shared/Phone/UserView/LoginLoading.cs
index 86aa5a4..a8247ad 100755
--- a/ZigbeeApp20200414/Shared/Phone/UserView/LoginLoading.cs
+++ b/ZigbeeApp20200414/Shared/Phone/UserView/LoginLoading.cs
@@ -20,7 +20,7 @@
var sceneBtn = new ImageView();
sceneBtn.Width = this.Width;
sceneBtn.Height = this.Height;
- sceneBtn.ImagePath = "Logo/2.jpg";
+ sceneBtn.ImagePath = "Logo/2.png";
AddChidren(sceneBtn);
}
}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserView/SafetyShortcutControl.cs b/ZigbeeApp20200414/Shared/Phone/UserView/SafetyShortcutControl.cs
deleted file mode 100755
index 5d447bb..0000000
--- a/ZigbeeApp20200414/Shared/Phone/UserView/SafetyShortcutControl.cs
+++ /dev/null
@@ -1,304 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.UserCenter;
-
-namespace Shared.Phone.UserView
-{
- public class SafetyShortcutControl : Button
- {
- /// <summary>
- /// dialog
- /// </summary>
- private Dialog dialog;
- /// <summary>
- /// SafetyShortcut
- /// </summary>
- public SafetyShortcutControl()
- {
- this.Height = Application.GetMinRealAverage(69);
- this.Width = Application.GetMinRealAverage(69);
- this.UnSelectedImagePath = "Item/SafetyShortcut.png";
- this.MouseUpEventHandler += (sender, e) =>
- {
- Show();
- };
- }
-
- /// <summary>
- /// Show
- /// </summary>
- private void Show()
- {
- Common.CommonPage.Instance.IsDrawerLockMode = true;
-
- dialog = new Dialog();
- dialog.BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor;
- dialog.Show();
- var closeBGview = new FrameLayout();
- dialog.AddChidren(closeBGview);
- closeBGview.MouseUpEventHandler += (send1, e1) =>
- {
- dialog.Close();
- };
-
- var bg = new Button
- {
- X = Application.GetRealWidth(495),
- Y = Application.GetRealHeight(161),
- Width = Application.GetRealWidth(449),
- Height = Application.GetRealHeight(495),
- UnSelectedImagePath = "Item/SafetyShortcut_background.png"
- };
- closeBGview.AddChidren(bg);
-
- var bg1 = new FrameLayout
- {
- X = Application.GetRealWidth(495),
- Y = Application.GetRealHeight(161),
- Width = Application.GetRealWidth(449),
- Height = Application.GetRealHeight(495),
- };
- closeBGview.AddChidren(bg1);
-
- new System.Threading.Thread(async () =>
- {
- //鍒锋柊
- var result = await HdlSafeguardLogic.Current.ReFreshByGateway();
- if (result == false)
- {
- return;
- }
- //鏄惁璁剧疆鏈夊唴閮ㄩ槻鍖�
- Application.RunOnMainThread(() =>
- {
- RefreshSafeZone(bg1, HdlSafeguardLogic.Current.IsHadInternalDefenseArea());
- });
- })
- { IsBackground = true }.Start();
- }
-
- /// <summary>
- /// 鏄剧ず闃插尯
- /// </summary>
- /// <param name="statu">true 3涓槻鍖� false 2涓槻鍖�</param>
- private void RefreshSafeZone(FrameLayout layout, bool statu)
- {
- if(statu)
- {
- ShowThreeSafeType(layout);
- }
- else
- {
- ShowTwoSafeType(layout);
- }
- }
-
- /// <summary>
- /// 甯冮槻鎾ら槻
- /// </summary>
- /// <param name="layout"></param>
- private void ShowTwoSafeType(FrameLayout layout)
- {
- Device.CommonForm.LeftIconButtonRow tempRow;
- var atHome = new Device.CommonForm.LeftIconButtonRow(449, 150);
- atHome.Y = Application.GetRealHeight(32);
- atHome.Init("Item/SafetyShortcut_item.png", "Item/SafetyShortcut_itemSelected.png", Language.StringByID(R.MyInternationalizationString.uGarrison));
- layout.AddChidren(atHome);
- atHome.Tag = GarrisonMode.AtHome;
- if (HdlSafeguardLogic.Current.NowGarrisonMode == GarrisonMode.AtHome)
- {
- atHome.IsSelected = true;
- tempRow = atHome;
- }
- atHome.ButtonClickEvent += (sender, e) =>
- {
- dialog.Close();
- if (sender.IsSelected)
- {
- return;
- }
- CommonPage.Loading.Start();
- new System.Threading.Thread(async () =>
- {
- var result=await HdlSafeguardLogic.Current.SetSafetyGarrisonByModel(GarrisonMode.AtHome);
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- if(result == GarrisonMode.AtHome)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonSuccess));
- }
- else
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonFail));
- }
- });
-
- })
- { IsBackground = true }.Start();
- };
-
-
- var withdrawGarriso = new Device.CommonForm.LeftIconButtonRow(449, 150);
- withdrawGarriso.Y = atHome.Bottom + Application.GetRealHeight(3);
- withdrawGarriso.Init("Item/SafetyShortcut_item.png", "Item/SafetyShortcut_itemSelected.png", Language.StringByID(R.MyInternationalizationString.uWithdrawGarrison));
- layout.AddChidren(withdrawGarriso);
- withdrawGarriso.Tag = GarrisonMode.RemoveGarrison;
- if (HdlSafeguardLogic.Current.NowGarrisonMode == GarrisonMode.None)
- {
- withdrawGarriso.IsSelected = true;
- tempRow = withdrawGarriso;
- }
- withdrawGarriso.ButtonClickEvent += (sender, e) =>
- {
- dialog.Close();
- if (sender.IsSelected)
- {
- return;
- }
- CommonPage.Loading.Start();
- new System.Threading.Thread(async () =>
- {
- var result = await HdlSafeguardLogic.Current.RemoveSafetyGarrison(GarrisonMode.RemoveGarrison, true);
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- if (result == 1)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonSuccess));
- }
- else
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonFail));
- }
- });
- })
- { IsBackground = true }.Start();
- };
- }
-
- /// <summary>
- /// 鍦ㄥ 绂诲 鎾ら槻
- /// </summary>
- /// <param name="layout"></param>
- private void ShowThreeSafeType(FrameLayout layout)
- {
- var atHome = new Device.CommonForm.LeftIconButtonRow(449, 150);
- atHome.Y = Application.GetRealHeight(32);
- atHome.Init("Item/SafetyShortcut_item.png", "Item/SafetyShortcut_itemSelected.png", Language.StringByID(R.MyInternationalizationString.uAtHomeGarrison));
- layout.AddChidren(atHome);
- if (HdlSafeguardLogic.Current.NowGarrisonMode == GarrisonMode.AtHome)
- {
- atHome.IsSelected = true;
- }
- atHome.ButtonClickEvent += (sender, e) =>
- {
- dialog.Close();
- if (sender.IsSelected)
- {
- return;
- }
- CommonPage.Loading.Start();
- new System.Threading.Thread(async () =>
- {
- var result =await HdlSafeguardLogic.Current.SetSafetyGarrisonByModel(GarrisonMode.AtHome);
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- if (result == GarrisonMode.AtHome)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetAtHomeGarrisonSuccess));
- }
- else
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonFail));
- }
- });
- })
- { IsBackground = true }.Start();
- };
-
-
- var removeHome = new Device.CommonForm.LeftIconButtonRow(449, 150);
- removeHome.Y = atHome.Bottom + Application.GetRealHeight(3);
- removeHome.Init("Item/SafetyShortcut_item.png", "Item/SafetyShortcut_itemSelected.png", Language.StringByID(R.MyInternationalizationString.uRemoveHomeGarrison));
- layout.AddChidren(removeHome);
- if (HdlSafeguardLogic.Current.NowGarrisonMode == GarrisonMode.RemoveHome)
- {
- removeHome.IsSelected = true;
- }
- removeHome.ButtonClickEvent += (sender, e) =>
- {
- dialog.Close();
- if (sender.IsSelected)
- {
- return;
- }
- CommonPage.Loading.Start();
- new System.Threading.Thread(async () =>
- {
- var result =await HdlSafeguardLogic.Current.SetSafetyGarrisonByModel(GarrisonMode.RemoveHome);
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- if (result == GarrisonMode.RemoveHome)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetRemoveHomeGarrisonSuccess));
- }
- else
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uSetGarrisonFail));
- }
- });
- })
- { IsBackground = true }.Start();
- };
-
- var withdrawGarriso = new Device.CommonForm.LeftIconButtonRow(449, 150);
- withdrawGarriso.Y = removeHome.Bottom + Application.GetRealHeight(3);
- withdrawGarriso.Init("Item/SafetyShortcut_item.png", "Item/SafetyShortcut_itemSelected.png", Language.StringByID(R.MyInternationalizationString.uWithdrawGarrison));
- layout.AddChidren(withdrawGarriso);
- withdrawGarriso.HidenLine(true);
- if (HdlSafeguardLogic.Current.NowGarrisonMode == GarrisonMode.None)
- {
- withdrawGarriso.IsSelected = true;
- }
- withdrawGarriso.ButtonClickEvent += (sender, e) =>
- {
- dialog.Close();
- if (sender.IsSelected)
- {
- return;
- }
- CommonPage.Loading.Start();
- new System.Threading.Thread(async () =>
- {
- var result =await HdlSafeguardLogic.Current.RemoveSafetyGarrison(GarrisonMode.RemoveGarrison, true);
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- if (result == 1)
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonSuccess));
- }
- else
- {
- CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonFail));
- }
- });
- })
- { IsBackground = true }.Start();
- };
- }
-
- /// <summary>
- /// RemoveFromParent
- /// </summary>
- public override void RemoveFromParent()
- {
- Common.CommonPage.Instance.IsDrawerLockMode = false;
- base.RemoveFromParent();
- }
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/UserView/UserHomeView.cs b/ZigbeeApp20200414/Shared/Phone/UserView/UserHomeView.cs
deleted file mode 100755
index cd1a3ce..0000000
--- a/ZigbeeApp20200414/Shared/Phone/UserView/UserHomeView.cs
+++ /dev/null
@@ -1,1912 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared.Common;
-using Shared.Phone.Device.CommonForm;
-using Shared.Phone.Device.DeviceLogic;
-using Shared.Phone.UserCenter;
-using Shared.Phone.UserCenter.DoorLock;
-using ZigBee.Device;
-
-namespace Shared.Phone.UserView
-{
- /// <summary>
- /// 涓婚〉(姝や笢瑗胯鑸嶅純,闄や簡瀹冮噷闈㈢殑闈欐�佹柟娉�)
- /// </summary>
- public class UserHomeView : EditorCommonForm
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 鍔熻兘ScrolViewLayout
- /// </summary>
- private VerticalScrolViewLayout deviceVerticalScrolViewLayout;
- /// <summary>
- /// 鍔熻兘鍜屽満鏅痓odyView
- /// </summary>
- private FrameLayout functionSceneBodyView;
- /// <summary>
- /// 鍔熻兘鎸夐敭
- /// </summary>
- private NormalViewControl btnFunction;
-
- /// <summary>
- /// 璇诲彇璁惧鐘舵�佺殑绾跨▼鍒楄〃
- /// </summary>
- private static List<System.Threading.Thread> threadList = new List<System.Threading.Thread> { };
-
- /// <summary>
- /// 缃戝叧
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 缃戝叧鍒楄〃
- /// </summary>
- private List<ZbGateway> zbGatewayList = new List<ZbGateway> { };
- /// <summary>
- /// 璁惧鍒楄〃
- /// </summary>
- private List<CommonDevice> commonDeviceList = new List<CommonDevice> { };
- /// <summary>
- /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
- /// </summary>
- private bool sendedControlCommand = false;
-
- private FrameLayout itemView = new FrameLayout();
- /// <summary>
- /// btnFloor
- /// </summary>
- private NormalViewControl btnFloor;
- /// <summary>
- /// sceneScrolView
- /// </summary>
- private VerticalScrolViewLayout sceneScrolView;
-
- #endregion
-
- #region 鈻� 鍒濆鍖朹____________________________
-
- /// <summary>
- /// 鐣岄潰鏄剧ず
- /// </summary>
- public void ShowForm()
- {
- this.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
- //娓呴櫎鍏ㄩ儴
- this.RemoveAll();
- //鍒濆鍖栧ご閮ㄦ帶浠�
- this.InitTopFrameLayoutControl();
- //鍒濆鍖栦腑闂存帶浠�
- this.InitMidFrameLayoutControl();
- //娣诲姞璁惧鐘舵�佷笂鎶ヤ簨浠�
- this.AddDeviceReportEvent();
- }
-
- /// <summary>
- /// 鍒濆鍖栧ご閮ㄦ帶浠�
- /// </summary>
- private void InitTopFrameLayoutControl()
- {
- //澶撮儴瀹瑰櫒
- base.topFrameLayout = new FrameLayout();
- topFrameLayout.Y = Application.GetRealHeight(60);
- topFrameLayout.Height = Application.GetRealHeight(127);
- topFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
- this.AddChidren(topFrameLayout);
-
- //鎷ユ湁妤煎眰
- if (Config.Instance.Home.FloorDics.Count > 0)
- {
- //妤煎眰鍥炬爣
- var btnFloorIcon = new IconViewControl(69);
- btnFloorIcon.X = ControlCommonResourse.XXLeft;
- btnFloorIcon.Gravity = Gravity.CenterVertical;
- btnFloorIcon.UnSelectedImagePath = "Item/Floor.png";
- topFrameLayout.AddChidren(btnFloorIcon);
- btnFloorIcon.ButtonClickEvent += (sender, e) =>
- {
- //鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
- this.ShowSelectFloorForm();
- };
- //妤煎眰鍚�
- this.btnFloor = new NormalViewControl(500, 100, true);
- btnFloor.X = btnFloorIcon.Right;
- btnFloor.Gravity = Gravity.CenterVertical;
- btnFloor.TextColor = ZigbeeColor.Current.GXCTextColor;
- btnFloor.Text = Config.Instance.Home.GetCurrentFloorName;
- btnFloor.IsBold = true;
- topFrameLayout.AddChidren(btnFloor);
- btnFloor.ButtonClickEvent += (sender, e) =>
- {
- //鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
- this.ShowSelectFloorForm();
- };
- }
- //瀹夐槻蹇嵎鏂瑰紡
- if (UserCenterResourse.ResidenceOption.SafetyShortcut)
- {
- var btnSafety = new SafetyShortcutControl();
- btnSafety.X = Application.GetRealWidth(860);
- btnSafety.Gravity = Gravity.CenterVertical;
- topFrameLayout.AddChidren(btnSafety);
- }
- //娑堟伅鍥炬爣
- var btnMessage = new MessageManagementControl();
- btnMessage.X = Application.GetRealWidth(953);
- btnMessage.Gravity = Gravity.CenterVertical;
- btnMessage.UnSelectedImagePath = "Item/Message.png";
- btnMessage.SelectedImagePath = "Item/MessageSelected.png";
- topFrameLayout.AddChidren(btnMessage);
-
- //浣忓畢鍚嶅瓧
- var btnHouseName = new NormalViewControl(700, 95, true);
- btnHouseName.X = ControlCommonResourse.XXLeft;
- btnHouseName.Y = Application.GetRealHeight(161);
- btnHouseName.TextSize = 24;
- btnHouseName.TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor;
- btnHouseName.IsBold = true;
- btnHouseName.Text = Config.Instance.Home.Name;
- this.AddChidren(btnHouseName);
-
- //鍒囨崲浣忓畢
- btnHouseName.MouseLongEventHandler += (sender, e) =>
- {
- if (Config.Instance.HomeFilePathList.Count == 0)
- {
- //褰撳墠浣忓畢涓虹┖锛岃鍏堝缓绔嬩綇瀹�
- this.ShowMassage(ShowMsgType.Remind, Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst));
- }
- else
- {
- var selectHouse = new Device.Category.SelectHouse();
- selectHouse.Init();
- selectHouse.HouseAction = (houseId) =>
- {
- ChangeResidence(House.GetHouseByHouseId(houseId));
- };
- }
- };
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑闂存帶浠�
- /// </summary>
- private void InitMidFrameLayoutControl()
- {
- //妫�娴嬫槸鍚︾粦瀹氭湁缃戝叧
- if (this.CheckHadBindGateway() == false)
- {
- //鏄剧ず娌℃湁缁戝畾杩囩綉鍏崇殑鐣岄潰
- this.ShowNoGatewayTip();
- }
- else
- {
- var roomPageView = new HorizontalPages();
- roomPageView.Y = Application.GetRealHeight(302);
- roomPageView.Width = Application.GetRealWidth(CommonPage.AppRealWidth);
- roomPageView.Height = Application.GetRealHeight(478);
- this.AddChidren(roomPageView);
- //绐佸嚭杈硅窛
- roomPageView.TCBJ = Application.GetRealWidth(124);
- //涓や釜page涔嬮棿鐨勯棿璺�
- roomPageView.JMBJ = Application.GetRealWidth(58);
-
- //褰撳墠鎴块棿
- var rList = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
- foreach (var room in rList)
- {
- var roomView = new Device.CommonForm.RoomView(0, 0);
- roomPageView.AddChidren(roomView);
- roomView.Init(room);
- roomView.HideName(true);
- }
- //璁剧疆鎴块棿鐨勫垵濮嬮�夋嫨
- var curIndex = rList.FindIndex((obj) => obj.Id == HdlRoomLogic.Current.CurrentRoom.Id);
- roomPageView.PageIndex = curIndex;
- if (roomPageView.GetChildren(roomPageView.PageIndex) != null)
- {
- (roomPageView.GetChildren(roomPageView.PageIndex) as RoomView).HideName(false);
- }
- roomPageView.PageChange += (sender, e) =>
- {
- if (roomPageView.GetChildren(roomPageView.PageIndex - 1) != null)
- {
- (roomPageView.GetChildren(roomPageView.PageIndex - 1) as RoomView).HideName(true);
- }
- if (roomPageView.GetChildren(roomPageView.PageIndex + 1) != null)
- {
- (roomPageView.GetChildren(roomPageView.PageIndex + 1) as RoomView).HideName(true);
- }
- if (roomPageView.GetChildren(roomPageView.PageIndex) != null)
- {
- (roomPageView.GetChildren(roomPageView.PageIndex) as RoomView).HideName(false);
- }
- //鍒囨崲褰撳墠鎴块棿
- HdlRoomLogic.Current.CurrentRoom = rList[roomPageView.PageIndex];
- //鍒锋柊璁惧妗屽竷鎺т欢
- this.RefreshBodyView();
- };
-
- //鍔熻兘鍜屽満鏅殑鑳屾櫙鍥�
- var functionSceneView = new FrameLayout();
- functionSceneView.Y = Application.GetRealHeight(861);
- functionSceneView.Width = Application.GetRealWidth(832);
- functionSceneView.Height = Application.GetRealHeight(167);
- functionSceneView.Gravity = Gravity.CenterHorizontal;
- functionSceneView.BackgroundImagePath = "Item/SceneFunctionBG.png";
- this.AddChidren(functionSceneView);
-
- //鍦烘櫙
- var btnScene = new NormalViewControl(350, 100, true);
- btnScene.X = Application.GetRealWidth(30);
- btnScene.Y = Application.GetRealHeight(12);
- btnScene.TextColor = ZigbeeColor.Current.GXCTextGrayColor3;
- btnScene.SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor;
- btnScene.TextID = R.MyInternationalizationString.Scence;
- btnScene.IsSelected = true;
- btnScene.TextSize = 16;
- btnScene.IsBold = true;
- btnScene.TextAlignment = TextAlignment.Center;
- functionSceneView.AddChidren(btnScene);
-
- //鍔熻兘
- btnFunction = new NormalViewControl(360, 100, true);
- btnFunction.X = Application.GetRealWidth(430);
- btnFunction.Y = Application.GetRealHeight(12);
- btnFunction.TextColor = ZigbeeColor.Current.GXCTextGrayColor3;
- btnFunction.SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor;
- btnFunction.TextID = R.MyInternationalizationString.Function;
- btnFunction.IsSelected = false;
- btnFunction.TextAlignment = TextAlignment.Center;
- functionSceneView.AddChidren(btnFunction);
-
- //鍔熻兘鍜屽満鏅痓odyView
- functionSceneBodyView = new FrameLayout()
- {
- Y = functionSceneView.Bottom,
- Height = Application.GetRealHeight(750),
- Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
- };
- this.AddChidren(functionSceneBodyView);
-
- //閫夋嫨鍔熻兘鍒嗘爮
- btnFunction.ButtonClickEvent += (sender, e) =>
- {
- btnScene.IsSelected = false;
- btnFunction.IsSelected = true;
- btnScene.TextSize = 14;
- btnScene.IsBold = false;
- btnFunction.TextSize = 16;
- btnFunction.IsBold = true;
- //鍒锋柊璁惧妗屽竷鎺т欢
- this.RefreshBodyView();
- };
- //閫夋嫨鍦烘櫙鍒嗘爮
- btnScene.ButtonClickEvent += (sender, e) =>
- {
- btnFunction.IsSelected = false;
- btnScene.IsSelected = true;
- btnScene.TextSize = 16;
- btnScene.IsBold = true;
- btnFunction.TextSize = 14;
- btnFunction.IsBold = false;
- this.RefreshBodyView();
- };
- //鍒锋柊璁惧妗屽竷鎺т欢
- this.RefreshBodyView();
- }
- }
-
- /// <summary>
- /// 鎻愮ず鐢ㄦ埛娌℃湁缃戝叧锛屽苟蹇�熻烦杞埌娣诲姞缃戝叧鐣岄潰
- /// </summary>
- private void ShowNoGatewayTip()
- {
- var bg = new PicViewControl(717, 478);
- bg.Y = Application.GetRealHeight(302);
- bg.Gravity = Gravity.CenterHorizontal;
- bg.UnSelectedImagePath = "Item/NoBindGW.png";
- this.AddChidren(bg);
-
- var tip = new NormalViewControl(Application.GetMinRealAverage(717), Application.GetMinRealAverage(58), false);
- tip.Y = Application.GetRealHeight(815);
- tip.Gravity = Gravity.CenterHorizontal;
- tip.TextID = R.MyInternationalizationString.NewAccountNeedBingGW;
- tip.TextColor = ZigbeeColor.Current.GXCTextGrayColor;
- tip.TextAlignment = TextAlignment.Center;
- this.AddChidren(tip);
-
- var addBG = new PicViewControl(971, 366);
- addBG.Y = Application.GetRealHeight(1048);
- addBG.UnSelectedImagePath = "Item/VirtualFrame.png";
- addBG.Gravity = Gravity.CenterHorizontal;
- this.AddChidren(addBG);
-
- var addGatewayBtn = new IconViewControl(89);
- addGatewayBtn.Y = Application.GetRealHeight(1143);
- addGatewayBtn.UnSelectedImagePath = "Item/Add_GW.png";
- addGatewayBtn.Gravity = Gravity.CenterHorizontal;
- this.AddChidren(addGatewayBtn);
- addGatewayBtn.ButtonClickEvent += (sender, e) =>
- {
- var form = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm();
- form.AddForm();
- };
-
- var addTip = new PicViewControl(717, 58);
- addTip.Y = Application.GetRealHeight(1256);
- addTip.Gravity = Gravity.CenterHorizontal;
- addTip.TextID = R.MyInternationalizationString.AddSmartGW;
- addTip.TextColor = ZigbeeColor.Current.GXCTextBlackColor;
- addTip.TextAlignment = TextAlignment.Center;
- AddChidren(addTip);
-
- addTip.ButtonClickEvent += (sender, e) =>
- {
- var form = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm();
- form.AddForm();
- };
- }
-
- #endregion
-
- #region 鈻� 鍔熻兘鍒嗘敮___________________________
-
- /// <summary>
- /// 鏄剧ず娌℃湁鍔熻兘
- /// </summary>
- private void ShowNoFunctionTip()
- {
- var noFunction = new Button
- {
- Y = Application.GetRealHeight(69),
- Width = Application.GetMinRealAverage(683),
- Height = Application.GetMinRealAverage(392),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/NoFunction.png"
- };
- functionSceneBodyView.AddChidren(noFunction);
-
- var noFunctionTip = new Button()
- {
- Y = noFunction.Bottom,
- Height = Application.GetRealHeight(200),
- Text = Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noFunctionTip);
- }
-
- /// <summary>
- /// 鏄剧ず鍔熻兘
- /// </summary>
- private void ShowFunction()
- {
- functionSceneBodyView.RemoveAll();
- //褰撳墠鎴块棿鐨勮澶囨暟
- if (HdlRoomLogic.Current.CurrentRoom.ListDevice.Count == 0)
- {
- ShowNoFunctionTip();
- }
- else
- {
- var dList = new List<CommonDevice>();
- foreach (var mainkeys in HdlRoomLogic.Current.CurrentRoom.ListDevice)
- {
- var device = LocalDevice.Current.GetDevice(mainkeys);
- if (device == null
- || device.Type == DeviceType.OnOffSwitch//骞叉帴鐐�
- || device.Type == DeviceType.Repeater)//涓户鍣�
- {
- continue;
- }
- dList.Add(device);
- }
-
- deviceVerticalScrolViewLayout = new VerticalScrolViewLayout { };
- functionSceneBodyView.AddChidren(deviceVerticalScrolViewLayout);
- for (int i = 0; i < dList.Count; i++)
- {
- var device = dList[i];
- Application.RunOnMainThread(() =>
- {
- try
- {
- int t = i % 2;
- int tt = i / 2;
- int xx = 43 + i % 2 * (20 + 487);
- int yy = 14;
- if (i % 2 == 0)
- {
- itemView = new FrameLayout()
- {
- Height = Application.GetRealHeight(14 + 348),
- };
- deviceVerticalScrolViewLayout.AddChidren(itemView);
- }
- //鏀惰棌
- EventHandler<MouseEventArgs> collectionEvent = (sender, e) =>
- {
- if ((sender as Button).IsSelected)
- {
- //鍒犻櫎鎴戠殑鍠滅埍
- HdlRoomLogic.Current.DeleteLoveDevice(device);
- (sender as Button).IsSelected = false;
- }
- else
- {
- //娣诲姞鎴戠殑鍠滅埍
- HdlRoomLogic.Current.AddLoveDevice(device);
- (sender as Button).IsSelected = true;
- }
- if (HdlRoomLogic.Current.CurrentRoom.IsLove)
- {
- //鍒锋柊璁惧妗屽竷鎺т欢
- this.RefreshBodyView();
- }
- };
-
- if (device.Type == DeviceType.WindowCoveringDevice)
- {
- //绐楀笜 鍗峰笜
- var rollerShade = (ZigBee.Device.Rollershade)device;
- if (rollerShade.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (rollerShade.Gateway.IsVirtual)
- {
- ReadStatus(rollerShade, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device);
- });
- }
- else
- {
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - rollerShade.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var functionView = new FunctionMainView(xx, yy);
- functionView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- itemView.AddChidren(functionView);
- functionView.Init();
- functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- functionView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- functionView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(rollerShade));
- functionView.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
- functionView.SetCollect(true);
-
- functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- (device as Rollershade).CurtainUpDownStopControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(Language.StringByID(R.MyInternationalizationString.Open));
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- (device as Rollershade).CurtainUpDownStopControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- };
-
- functionView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
- UserView.HomePage.Instance.AddChidren(rollerShadeControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- rollerShadeControl.IsDrawerLockMode = true;
- rollerShadeControl.Show(device, HdlRoomLogic.Current.CurrentRoom);
- rollerShadeControl.action += (curDev, curRoom) =>
- {
- ReFreshEditDeviceAction(device, curRoom, functionView);
- };
- };
-
- functionView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- }
- else if (device.Type == DeviceType.OnOffOutput)
- {
- //寮�鍏崇伅
- var light = device as ToggleLight;
- if (light.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (light.Gateway.IsVirtual)
- {
- ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- });
- }
- else
- {
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var functionView = new FunctionMainView(xx, yy);
- itemView.AddChidren(functionView);
- functionView.Init();
- functionView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- functionView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- functionView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- functionView.IsSelected = light.OnOffStatus == 1;
- functionView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
-
- if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- functionView.CollectButton.IsSelected = false;
- }
- else
- {
- functionView.CollectButton.IsSelected = true;
- }
-
- functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- light.SwitchControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- light.SwitchControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- };
-
- functionView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
-
- var lightControl = new Phone.Device.Light.OnOffControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- lightControl.IsDrawerLockMode = true;
- lightControl.Show(device, HdlRoomLogic.Current.CurrentRoom);
- lightControl.action += (curDev, curRoom) =>
- {
- ReFreshEditDeviceAction(device, curRoom, functionView);
- };
- };
-
- functionView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- }
- else if (device.Type == DeviceType.AirSwitch)
- {
- //绌烘皵寮�鍏�
- var airSwitch = device as AirSwitch;
- if (airSwitch.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (airSwitch.Gateway.IsVirtual)
- {
- ReadStatus(airSwitch, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- });
- }
- else
- {
- if ((DateTime.Now - airSwitch.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var functionView = new FunctionMainView(xx, yy);
- itemView.AddChidren(functionView);
- functionView.Init();
- functionView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- functionView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- functionView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(airSwitch));
- functionView.IsSelected = airSwitch.OnOffStatus == 1;
- functionView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
-
- functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- airSwitch.SwitchControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- airSwitch.SwitchControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- };
-
- functionView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var lightControl = new Phone.Device.Light.AirSwitchControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- lightControl.IsDrawerLockMode = true;
- lightControl.Show(device, HdlRoomLogic.Current.CurrentRoom);
- lightControl.action += (curDev, curRoom) =>
- {
- ReFreshEditDeviceAction(device, curRoom, functionView);
- };
-
- };
-
- functionView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- }
- else if (device.Type == DeviceType.Thermostat)
- {
- //鎭掓俯鍣�-AC-绌鸿皟
- var ac = device as AC;
- if (ac.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (ac.Gateway.IsVirtual)
- {
- ReadStatus(ac, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(device);
- });
- }
- else
- {
- if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(device);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var functionView = new FunctionMainView(xx, yy);
- itemView.AddChidren(functionView);
- functionView.Init();
- functionView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- functionView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- functionView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- functionView.IsSelected = ac.currentSystemMode != 0;
- functionView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
-
- functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- ac.Open();
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- ac.Close();
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- };
-
- functionView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var lightControl = new Phone.Device.AC.ACControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- lightControl.IsDrawerLockMode = true;
- lightControl.Show(device, HdlRoomLogic.Current.CurrentRoom);
- lightControl.action += (curDev, curRoom) =>
- {
- ReFreshEditDeviceAction(device, curRoom, functionView);
- };
- };
-
- functionView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- }
- else if (device.Type == DeviceType.DimmableLight)
- {
- //璋冨厜鐏�
- var dimmableLight = device as DimmableLight;
- if (dimmableLight.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (dimmableLight.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- ReadStatus(dimmableLight, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device);
- }
- }
- })
- { IsBackground = true }.Start();
-
- var functionView = new FunctionMainView(xx, yy);
- itemView.AddChidren(functionView);
- functionView.Init();
- functionView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- functionView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- functionView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- functionView.IsSelected = dimmableLight.OnOffStatus == 1;
- functionView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
-
- if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- functionView.CollectButton.IsSelected = false;
- }
- else
- {
- functionView.CollectButton.IsSelected = true;
- }
-
- functionView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- dimmableLight.SwitchControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device);
-
- dimmableLight.SwitchControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- HdlDeviceOtherLogic.Current.SendCommandDelayAction(device, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- };
-
- functionView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
- UserView.HomePage.Instance.AddChidren(dimmableLightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- dimmableLightControl.IsDrawerLockMode = true;
- dimmableLightControl.Show(device, HdlRoomLogic.Current.CurrentRoom);
- dimmableLightControl.action += (curDev, curRoom) =>
- {
- ReFreshEditDeviceAction(device, curRoom, functionView);
- };
- };
- functionView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- }
- else if (device.Type == DeviceType.IASZone)
- {
- //鍚勭被浼犳劅鍣�
- var ias = device as IASZone;
-
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- lightView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- lightView.IsSelected = ias.iASInfo?.Alarm1 == 1;
- lightView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
- lightView.CanControl(false);
- if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- else if (device.Type == DeviceType.TemperatureSensor)
- {
- var tempera = device as TemperatureSensor;
-
- if (tempera.Gateway != null)
- {
- new System.Threading.Thread(() =>
- {
- System.Threading.Thread.Sleep(100 * i);
- if (tempera.Gateway.IsVirtual)
- {
- ReadStatus(tempera, () =>
- {
- if (tempera.SensorDiv == 1)
- {
- ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(device);
- }
- else if (tempera.SensorDiv == 2)
- {
- ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(device);
- }
- });
- }
- else
- {
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - tempera.LastDateTime).TotalSeconds)
- {
- if (tempera.SensorDiv == 1)
- {
- ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(device);
- }
- else if (tempera.SensorDiv == 2)
- {
- ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(device);
- }
- }
- }
- })
- { IsBackground = true }.Start();
-
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- lightView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- lightView.IsSelected = false;
- lightView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
- lightView.CanControl(false);
- if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- }
- else if (device.Type == DeviceType.DoorLock)
- {
- //闂ㄩ攣
- var dimmableLight = device as DoorLock;
-
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- lightView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- lightView.IsSelected = false;
- lightView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
- lightView.CanControl(false);
- if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
-
- lightView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var userDoorLockPage = new UserDoorLockPage(HdlRoomLogic.Current.CurrentRoom, device);
- HomePage.Instance.AddChidren(userDoorLockPage);
- HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
- };
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- else
- {
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.Tag = LocalDevice.Current.GetDeviceMainKeys(device);
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(device));
- lightView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- lightView.CanControl(false);
- lightView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
-
- if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- }
- catch (Exception ex)
- {
-
- }
- });
- //})
- //{ IsBackground = true }.Start();
- }
- }
- }
-
- /// <summary>
- /// ReFreshEditDeviceAction
- /// </summary>
- /// <param name="device"></param>
- /// <param name="curRoom"></param>
- /// <param name="functionView"></param>
- private void ReFreshEditDeviceAction(CommonDevice device, Common.Room curRoom, FunctionMainView functionView)
- {
- if (HdlRoomLogic.Current.CurrentRoom.IsLove)
- {
- functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- functionView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
- {
- ShowFunction();
- }
- }
- else
- {
- if (curRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id)
- {
- ShowFunction();
- }
- else
- {
- functionView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- functionView.SetDeviceName(Common.LocalDevice.Current.GetDeviceEpointName(device));
- functionView.SetCollect(HdlRoomLogic.Current.IsCollectInRoom(device));
- }
- }
- }
-
- #endregion
-
- #region 鈻� 鍦烘櫙鍒嗘敮___________________________
-
- /// <summary>
- /// 鏄剧ず娌″満鏅�
- /// </summary>
- private void ShowNoSceneTip()
- {
- var noScene = new Button
- {
- Y = Application.GetRealHeight(69),
- Width = Application.GetMinRealAverage(683),
- Height = Application.GetMinRealAverage(392),
- Gravity = Gravity.CenterHorizontal,
- UnSelectedImagePath = "Item/NoFunction.png"
- };
- functionSceneBodyView.AddChidren(noScene);
- var noScenceTip = new Button()
- {
- Y = noScene.Bottom,
- Height = Application.GetRealHeight(200),
- Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"),
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
- TextAlignment = TextAlignment.Center,
- IsMoreLines = true
- };
- functionSceneBodyView.AddChidren(noScenceTip);
- }
-
- /// <summary>
- /// 鏄剧ず鍦烘櫙
- /// </summary>
- private void ShowScene()
- {
- functionSceneBodyView.RemoveAll();
- //閫夋嫨鍦烘櫙
- var sceneList = HdlSceneLogic.Current.GetRoomSceneList(HdlRoomLogic.Current.CurrentRoom);
- if (sceneList == null)
- {
- return;
- }
- if (sceneList.Count == 0)
- {
- ShowNoSceneTip();
- }
- else
- {
- sceneScrolView = new VerticalScrolViewLayout { };
- functionSceneBodyView.AddChidren(sceneScrolView);
- for (int i = 0; i < sceneList.Count; i++)
- {
- var scene = sceneList[i];
- int xx = 33 + i % 2 * (40 + 487);
- int yy = 14;
- if (scene == null)
- {
- continue;
- }
-
- if (i % 2 == 0)
- {
- itemView = new FrameLayout()
- {
- Height = Application.GetRealHeight(14 + 348),
- Tag = scene.Id
- };
- sceneScrolView.AddChidren(itemView);
- }
-
- var sceneView = new SceneMainView(xx, yy);
- sceneView.Init(scene);
- itemView.AddChidren(sceneView);
- sceneView.CollectionAction += ShowScene;
- }
- GetDelayScene(sceneScrolView);
- }
- }
-
- /// <summary>
- /// GetDelayScene
- /// </summary>
- /// <param name="scrolViewLayout"></param>
- private async void GetDelayScene(VerticalScrolViewLayout scrolViewLayout)
- {
-
- var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync();
- if (catDelaySceneResponseAllData == null)
- {
- return;
- }
- var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData;
- if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0)
- {
- return;
- }
- var delayList = catDelaySceneResponseData.DelayScenesList;
-
- for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
- {
- var iView = scrolViewLayout.GetChildren(i) as FrameLayout;
- for (int j = 0; iView != null && j < iView.ChildrenCount; j++)
- {
- var sceneView = iView.GetChildren(j) as SceneMainView;
- foreach (var delayScenesListResponseInfo in delayList)
- {
- if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
- {
- var remainTime = delayScenesListResponseInfo.RemainTime;
- sceneView.scene.RemainTime = remainTime;
-
- if (remainTime > 0)
- {
- new System.Threading.Thread(() =>
- {
- while (remainTime-- > 0)
- {
- System.Threading.Thread.Sleep(1000);
- Application.RunOnMainThread(() =>
- {
- sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime));
- });
- }
- Application.RunOnMainThread(() =>
- {
- sceneView.scene.RemainTime = 0;
- sceneView.SetTimeImage();
- });
- })
- { IsBackground = true }.Start();
- }
- break;
- }
- }
- }
- }
- }
-
- #endregion
-
- #region 鈻� 鍒锋柊_______________________________
-
- /// <summary>
- /// 鍒锋柊璁惧妗屽竷鎺т欢
- /// </summary>
- public void RefreshBodyView()
- {
- functionSceneBodyView.RemoveAll();
- if (btnFunction.IsSelected)
- {
- ShowFunction();
- }
- else
- {
- ShowScene();
- }
- }
-
- #endregion
-
- #region 鈻� 鍒囨崲浣忓畢___________________________
- /// <summary>
- /// 鍒囨崲浣忓畢
- /// </summary>
- /// <param name="home">Home.</param>
- private void ChangeResidence(House home)
- {
- try
- {
- CommonPage.Loading.Start();
- new System.Threading.Thread(async () =>
- {
- Config.Instance.HomeId = home.Id;
- Config.Instance.Home = House.GetHouseByFilePath(home.FileName);
- Global.CreateHomeDirectory(home.Id);
- Config.Instance.Save();
- //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
- await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- //鍒濆鍖栧叏閮ㄦ埧闂�
- HdlRoomLogic.Current.InitAllRoom();
-
- Application.RunOnMainThread(() =>
- {
- ShowForm();
- CommonPage.Loading.Hide();
- });
- })
- { IsBackground = true }.Start();
- }
- catch (Exception ex)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- //new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.CheckInternet), Language.StringByID(R.MyInternationalizationString.Close)).Show();
- Console.WriteLine(ex.Message);
- });
- }
- }
-
- #endregion
-
- #region 鈻� 杩涜璁惧鐘舵�佽鍙朹__________________
-
- /// <summary>
- /// 鍒ゆ柇鏄惁鍙互杩涜璁惧鐘舵�佽鍙栥�傚湪鍥炶皟涓鍙�
- /// </summary>
- /// <param name="commonDevice">Common device.</param>
- /// <param name="action">鍥炶皟澶勭悊--鍙戦�佽鍙栧懡浠�</param>
- /// <param name="span">Span. 榛樿30绉�</param>
- public static void ReadStatus(CommonDevice commonDevice, Action action, int span = 30)
- {
- var threadName = commonDevice.GetHashCode().ToString();
- if (null == threadList.Find((obj) => obj.Name == threadName))
- {
- var thread = new System.Threading.Thread(() =>
- {
- var dateTime = DateTime.Now;
- while ((DateTime.Now - dateTime).TotalSeconds < 10)
- {
- System.Threading.Thread.Sleep(100);
- if (commonDevice.Gateway == null)
- {
- return;
- }
- if (!commonDevice.Gateway.IsVirtual)
- {
- break;
- }
- }
- lock (threadList)
- {
- threadList.RemoveAll((obj) => obj.Name == threadName);
- }
- //闃叉鐭椂闂村唴璇诲彇棰戠箒
- if (span < (DateTime.Now - commonDevice.LastDateTime).TotalSeconds)
- {
- action?.Invoke();
- };
- })
- { IsBackground = true, Name = threadName };
- lock (threadList)
- {
- threadList.Add(thread);
- }
- thread.Start();
- }
- }
-
- #endregion
-
- #region 鈻� 鎺у埗鐘舵�乢__________________________
-
- /// <summary>
- /// 鏄剧ず璁惧鎺у埗鐘舵��
- /// </summary>
- /// <param name="command">Command.</param>
- /// <param name="objValue">Object value.</param>
- private void UpdateDeviceControllStatu(string command, object objValue)
- {
- if (command != "DeviceDefaultAck" || objValue == null)
- {
- return;
- }
- var tempDevice = (CommonDevice)objValue;
- if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == tempDevice.DeviceEpoint && obj.DeviceAddr == tempDevice.DeviceAddr))
- {
- return;
- }
- //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
- sendedControlCommand = true;
- //HdlDeviceOtherLogic.Current.ShowStatuTip(R.MyInternationalizationString.Success);
- }
-
- /// <summary>
- /// 绉婚櫎鍏ㄩ儴鏇存柊鎺у埗璁惧鐨刟ction
- /// </summary>
- private void RemoveAllUpdateControlDeviceStatuAction()
- {
- foreach (var gateway in zbGatewayList)
- {
- //绉婚櫎action
- if (gateway != null)
- {
- gateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
- }
-
- /// <summary>
- /// 绉婚櫎鍗曚釜鎺у埗璁惧鐨勬洿鏂扮姸鎬乤ction
- /// </summary>
- /// <param name="gateway">Gateway.</param>
- private void RemoveUpdateControlDeviceStatuAction(ZbGateway gateway)
- {
- //绉婚櫎action
- if (gateway != null)
- {
- gateway.ReportAction -= UpdateDeviceControllStatu;
- }
- }
-
- /// <summary>
- /// 娣诲姞闇�瑕佺洃鎺у洖璋冪姸鎬佺殑缃戝叧鍜岃澶�
- /// </summary>
- /// <param name="gatewayList">Gateway list.</param>
- /// <param name="gateway">Gateway.</param>
- /// <param name="deviceList">Device list.</param>
- /// <param name="common">Common.</param>
- private void AddZbGateway(List<ZbGateway> gatewayList, ZbGateway gateway, List<CommonDevice> deviceList, CommonDevice common)
- {
- if (null == gatewayList.Find((obj) => obj.getGatewayBaseInfo.gwID == gateway.getGatewayBaseInfo.gwID))
- {
- gatewayList.Add(gateway);
- }
- if (null == commonDeviceList.Find((obj) => obj.DeviceEpoint == common.DeviceEpoint && obj.DeviceAddr == common.DeviceAddr))
- {
- commonDeviceList.Add(common);
- }
- }
-
- #endregion
-
- #region 鈻� 璁惧鐘舵�佷笂鎶______________________
-
- /// <summary>
- /// 娣诲姞璁惧鐘舵�佷笂鎶ヤ簨浠�
- /// </summary>
- private void AddDeviceReportEvent()
- {
- //璁惧灞炴�т笂鎶�
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceStatus", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
- {
- HdlThreadLogic.Current.RunMain(() =>
- {
- if (report.DeviceStatusReport.AttriBute == null || report.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- for (int i = 0; deviceVerticalScrolViewLayout != null && i < deviceVerticalScrolViewLayout.ChildrenCount; i++)
- {
- var rowFL = deviceVerticalScrolViewLayout.GetChildren(i) as FrameLayout;
- if (rowFL.ChildrenCount == 0)
- {
- //璁惧涓虹┖鎴栬�呮帶浠朵负绌�
- continue;
- }
-
- for (int j = 0; j < rowFL.ChildrenCount; j++)
- {
- var deviceUI = LocalDevice.Current.GetDevice((rowFL.GetChildren(j) as FunctionMainView).Tag.ToString());
- if (deviceUI == null)
- {
- //璁惧涓虹┖鎴栬�呮帶浠朵负绌�
- continue;
- }
- if (report.DeviceAddr != deviceUI.DeviceAddr || report.DeviceEpoint != deviceUI.DeviceEpoint)
- {
- //鍒ゆ柇鏄惁涓哄綋鍓嶈澶�
- continue;
- }
-
- switch (deviceUI.Type)
- {
- case DeviceType.OnOffOutput:
- //寮�鍏冲姛鑳�
- if (report.DeviceStatusReport.CluterID == 6)
- {
- var onOffOutputLight = deviceUI as ZigBee.Device.ToggleLight;
- onOffOutputLight.DeviceStatusReport = report.DeviceStatusReport;
- onOffOutputLight.OnOffStatus = onOffOutputLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = onOffOutputLight.OnOffStatus == 1;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- onOffOutputLight.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.AirSwitch:
- //寮�鍏冲姛鑳�
- if (report.DeviceStatusReport.CluterID == 6)
- {
- var airSwitch = deviceUI as ZigBee.Device.AirSwitch;
- airSwitch.DeviceStatusReport = report.DeviceStatusReport;
- airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData;
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = airSwitch.OnOffStatus == 1;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- airSwitch.LastDateTime = DateTime.Now;
- }
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (report.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.IsOnline = 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.WindowCoveringDevice:
- if (report.DeviceStatusReport.CluterID == 258)
- {
- if (report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
- {
- //绐楀笜绫诲瀷
- var rollerShade = deviceUI as Rollershade;
- rollerShade.DeviceStatusReport = report.DeviceStatusReport;
- rollerShade.WcdType = report.DeviceStatusReport.AttriBute[0].AttriButeData;
- rollerShade.LastDateTime = DateTime.Now;
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- }
- if (report.DeviceStatusReport.AttriBute[0].AttributeId == 8)
- {
- //绐楀笜鐧惧垎姣�
- var rollerShade = deviceUI as Rollershade;
- rollerShade.DeviceStatusReport = report.DeviceStatusReport;
- rollerShade.WcdCurrentPositionLiftPercentage = report.DeviceStatusReport.AttriBute[0].AttriButeData;
- rollerShade.LastDateTime = DateTime.Now;
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- }
- }
- if (report.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.IsOnline = 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.Thermostat:
- //AC鍔熻兘
- if (report.DeviceStatusReport.CluterID == 513)
- {
- var ac = deviceUI as ZigBee.Device.AC;
- ac.DeviceStatusReport = report.DeviceStatusReport;
- var attriButeList = ac.DeviceStatusReport.AttriBute;
- foreach (var attList in attriButeList)
- {
- var curTemp = attList.AttriButeData / 100;
- switch (attList.AttributeId)
- {
- case 0:
- //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
- ac.currentLocalTemperature = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 17:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鍐锋俯搴︼紝瀹為檯娓╁害涓衡�淐oolingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentCoolingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 18:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentHeatingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentAutoSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 28:
- //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
- ac.currentSystemMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- }
- }
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = ac.currentSystemMode != 0;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- }
- if (report.DeviceStatusReport.CluterID == 514)
- {
- var ac = deviceUI as ZigBee.Device.AC;
- var attriButeList = report.DeviceStatusReport.AttriBute;
- ac.DeviceStatusReport = report.DeviceStatusReport;
- foreach (var attList in attriButeList)
- {
- switch (attList.AttributeId)
- {
- case 0:
- ac.currentFanMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentFanSwingMode = attList.AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- }
- }
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = ac.currentSystemMode != 0;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- }
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (report.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.IsOnline = 1;
- deviceUI.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.DimmableLight:
- //璋冨厜鐏姛鑳�
- if (report.DeviceStatusReport.CluterID == 6)
- {
- var dimmableLight = deviceUI as DimmableLight;
- dimmableLight.DeviceStatusReport = report.DeviceStatusReport;
- dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = dimmableLight.OnOffStatus == 1;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- dimmableLight.LastDateTime = DateTime.Now;
- }
-
- //浜害
- if (report.DeviceStatusReport.CluterID == 8)
- {
- var dimmableLight = deviceUI as DimmableLight;
- dimmableLight.DeviceStatusReport = report.DeviceStatusReport;
- var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
- dimmableLight.Level = attriButeList[0].AttriButeData;
- dimmableLight.LastDateTime = DateTime.Now;
- //(rowFL.GetChildren(j) as FunctionMainView).IsSelected = true;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- break;
- }
- }
- break;
- case DeviceType.TemperatureSensor:
- //娓╁害
- if (report.DeviceStatusReport.CluterID == 1026)
- {
- var tempera = deviceUI as TemperatureSensor;
- foreach (var data in report.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- tempera.Temperatrue = 0;
- }
- else if (data.AttriButeData > 32767)
- {
- //璐熸暟(鐗规畩澶勭悊)
- string strValue = (data.AttriButeData - 65536).ToString();
- //灏忔暟鐐归渶瑕佷竴浣�
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
-
- tempera.LastDateTime = DateTime.Now;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- }
- }
- }
- //婀垮害
- if (report.DeviceStatusReport.CluterID == 1029)
- {
- var tempera = deviceUI as TemperatureSensor;
- foreach (var data in report.DeviceStatusReport.AttriBute)
- {
- if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
- {
- if (data.AttriButeData == 0)
- {
- tempera.Humidity = 0;
- }
- else
- {
- //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟)
- string strValue = data.AttriButeData.ToString();
- strValue = strValue.Substring(0, strValue.Length - 1);
- tempera.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
- }
- tempera.LastDateTime = DateTime.Now;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- }
- }
- }
- break;
- }
- }
- }
-
- }, ShowErrorMode.NO);
- });
-
- //浼犳劅鍣ㄤ笂鎶�
- HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewSensor", ReceiveComandDiv.A浼犳劅鍣ㄤ笂鎶�, (report) =>
- {
- HdlThreadLogic.Current.RunMain(() =>
- {
- for (int i = 0; deviceVerticalScrolViewLayout != null && i < deviceVerticalScrolViewLayout.ChildrenCount; i++)
- {
- var rowFL = deviceVerticalScrolViewLayout.GetChildren(i) as FrameLayout;
- if (rowFL.ChildrenCount == 0)
- {
- //璁惧涓虹┖鎴栬�呮帶浠朵负绌�
- continue;
- }
-
- for (int j = 0; j < rowFL.ChildrenCount; j++)
- {
- var deviceUI = LocalDevice.Current.GetDevice((rowFL.GetChildren(j) as FunctionMainView).Tag.ToString());
- if (deviceUI == null)
- {
- //璁惧涓虹┖鎴栬�呮帶浠朵负绌�
- continue;
- }
- if (report.DeviceAddr != deviceUI.DeviceAddr || report.DeviceEpoint != deviceUI.DeviceEpoint)
- {
- //鍒ゆ柇鏄惁涓哄綋鍓嶈澶�
- continue;
- }
-
- switch (deviceUI.Type)
- {
- case DeviceType.IASZone:
- //ias
- var ias = report as IASZone;
- var iAS = deviceUI as ZigBee.Device.IASZone;
- iAS.iASInfo = ias.iASInfo;
- (rowFL.GetChildren(j) as FunctionMainView).IsSelected = iAS.iASInfo?.Alarm1 == 1;
- (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(deviceUI);
- iAS.LastDateTime = DateTime.Now;
- break;
- }
- }
- }
- }, ShowErrorMode.NO);
- });
- }
-
- #endregion
-
- #region 鈻� 鍒囨崲妤煎眰___________________________
-
- /// <summary>
- /// 鏄剧ず閫夋嫨妤煎眰鐨勭晫闈�
- /// </summary>
- private void ShowSelectFloorForm()
- {
- var floorFL = new Device.Category.SelectFloor();
- this.AddChidren(floorFL);
- floorFL.Init(35, 153);
- floorFL.changeFloor = true;
- floorFL.FloorAction = (floorId) =>
- {
- this.btnFloor.Text = Config.Instance.Home.GetFloorNameById(floorId);
- HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
- this.ShowForm();
- };
- }
-
- #endregion
-
- #region 鈻� 鐣岄潰鍏抽棴___________________________
-
- /// <summary>
- /// 鐣岄潰鍏抽棴
- /// </summary>
- public override void CloseFormBefore()
- {
- HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewDeviceStatus");
- HdlGatewayReceiveLogic.Current.RemoveEvent("UserHomeViewSensor");
-
- base.CloseFormBefore();
- }
-
- #endregion
-
- #region 鈻� 涓�鑸柟娉昣__________________________
-
- /// <summary>
- /// 妫�娴嬫槸鍚︾粦瀹氭湁缃戝叧
- /// </summary>
- private bool CheckHadBindGateway()
- {
- //鑾峰彇鏈湴宸茬粡缁戝畾鐨勭綉鍏�
- var gatewayList = HdlGatewayLogic.Current.GetAllLocalGateway();
- if (gatewayList.Count == 0)
- {
- return false;
- }
- //涓讳汉鎴栬�呯鐞嗗憳鎵嶈
- if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
- {
- return true;
- }
- return false;
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/CommonDevice.cs
old mode 100644
new mode 100755
index 493a26f..f73ef01
--- a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -1293,217 +1293,8 @@
if (topic == gatewayID + "/" + "MacRename_Respon")
{
- var deviceID = jobject.Value<int>("Device_ID");
- switch ((DeviceType)(deviceID))
- {
- case DeviceType.OnOffOutput:
- var toggleLight = new ToggleLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- toggleLight.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (toggleLight.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = toggleLight.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var infoToggleLight = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr && obj.DeviceEpoint == toggleLight.DeviceEpoint);
- if (infoToggleLight != null)
- {
- infoToggleLight.DeviceName = toggleLight.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.AirSwitch:
- var airSwitch = new AirSwitch() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- airSwitch.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (airSwitch.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = airSwitch.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- var infoAirSwitch = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == airSwitch.DeviceID && obj.DeviceAddr == airSwitch.DeviceAddr && obj.DeviceEpoint == airSwitch.DeviceEpoint);
- if (infoAirSwitch != null)
- {
- infoAirSwitch.DeviceName = airSwitch.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.OnOffSwitch:
- var panelObj = new Panel() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- panelObj.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.RenameDeviceMacNameData>(jobject["Data"].ToString());
- if (panelObj.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = panelObj.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}");
- var infoPanel = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == panelObj.DeviceID && obj.DeviceAddr == panelObj.DeviceAddr && obj.DeviceEpoint == panelObj.DeviceEpoint);
- if (infoPanel != null)
- {
- infoPanel.DeviceName = panelObj.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.WindowCoveringDevice:
- var windowCovering = new Rollershade() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- windowCovering.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.RenameDeviceMacNameData>(jobject["Data"].ToString());
- if (windowCovering.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = windowCovering.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}_鏀跺埌閫氱煡鍚庣殑鏁版嵁_{ d.renameDeviceMacNameData.ToString()}");
- var wc = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == windowCovering.DeviceID && obj.DeviceAddr == windowCovering.DeviceAddr && obj.DeviceEpoint == windowCovering.DeviceEpoint);
- if (wc != null)
- {
- wc.DeviceName = windowCovering.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.IASZone:
- var ias = new IASZone() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- ias.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (ias.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = ias.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}_鏀跺埌閫氱煡鍚庣殑鏁版嵁_{ d.renameDeviceMacNameData.ToString()}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr && obj.DeviceEpoint == ias.DeviceEpoint);
- if (info != null)
- {
- info.DeviceName = ias.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.DimmableLight:
- var dimmableLight = new DimmableLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- dimmableLight.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (dimmableLight.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = dimmableLight.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}_鏀跺埌閫氱煡鍚庣殑鏁版嵁_{ d.renameDeviceMacNameData.ToString()}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr && obj.DeviceEpoint == dimmableLight.DeviceEpoint);
- if (info != null)
- {
- info.DeviceName = dimmableLight.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.Repeater:
- var repeater = new DimmableLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- repeater.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<Repeater.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (repeater.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = repeater.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}_鏀跺埌閫氱煡鍚庣殑鏁版嵁_{ d.renameDeviceMacNameData.ToString()}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == repeater.DeviceID && obj.DeviceAddr == repeater.DeviceAddr && obj.DeviceEpoint == repeater.DeviceEpoint);
- if (info != null)
- {
- info.DeviceName = repeater.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.Thermostat:
- var ac = new AC() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- ac.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<AC.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (ac.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = ac.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}_鏀跺埌閫氱煡鍚庣殑鏁版嵁_{ d.renameDeviceMacNameData.ToString()}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == ac.DeviceID && obj.DeviceAddr == ac.DeviceAddr && obj.DeviceEpoint == ac.DeviceEpoint);
- if (info != null)
- {
- info.DeviceName = ac.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.Transverter:
- var transverter = new Transverter() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- transverter.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (transverter.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = transverter.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}_鏀跺埌閫氱煡鍚庣殑鏁版嵁_{ d.renameDeviceMacNameData.ToString()}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == transverter.DeviceID && obj.DeviceAddr == transverter.DeviceAddr && obj.DeviceEpoint == transverter.DeviceEpoint);
- if (info != null)
- {
- info.DeviceName = transverter.renameDeviceMacNameData.MacName;
- }
- }
- break;
- case DeviceType.DoorLock:
- var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- doorLock.renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock.RenameDeviceMacNameData>(jobject["Data"].ToString());
-
- if (doorLock.renameDeviceMacNameData == null)
- {
- d = new RenameDeviceMacNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
- }
- else
- {
- d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = doorLock.renameDeviceMacNameData };
- System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}_鏀跺埌閫氱煡鍚庣殑鏁版嵁_{ d.renameDeviceMacNameData.ToString()}");
- var info = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == doorLock.DeviceID && obj.DeviceAddr == doorLock.DeviceAddr && obj.DeviceEpoint == doorLock.DeviceEpoint);
- if (info != null)
- {
- info.DeviceName = doorLock.renameDeviceMacNameData.MacName;
- }
- }
- break;
- //case DeviceType.TemperatureSensor:
- // var temperatureSensor = new TemperatureSensor() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- // temperatureSensor.renameDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor.DeviceRenameResponseData>(jobject["Data"].ToString());
- // if (temperatureSensor.renameDeviceData == null)
- // {
- // d.errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�";
- // }
- // else
- // {
- // d.deviceRenameData = temperatureSensor.renameDeviceData;
- // }
- // var ts = Gateway.DeviceList.Find((CommonDevice obj) => obj.DeviceID == temperatureSensor.DeviceID && obj.DeviceEpoint == temperatureSensor.DeviceEpoint && obj.DeviceEpoint == temperatureSensor.DeviceEpoint);
- // if (ts == null)
- // {
- // ts.DeviceName = temperatureSensor.renameDeviceData.DeviceName;
- // IO.LocalFileUtils.SaveDeviceInfo(ts, ts.DeviceEpoint.ToString());
-
- // }
- // break;
- }
+ var deviceID = jobject.Value<int>("Device_ID");
+ d = new RenameDeviceMacNameAllData { renameDeviceMacNameData = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.RenameDeviceMacNameData>(jobject["Data"].ToString()) };
}
};
Gateway.Actions += action;
@@ -1861,16 +1652,6 @@
{
d = new RemoveGatewayDeviceListAllData { removeGatewayDeviceListData = gatewayTemp.removeGatewayDeviceListData };
System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
-
- //for (int listCount = 0; listCount < Gateway.AllGatewayDeviceList.Count; listCount++)
- //{
- // var dev = Gateway.AllGatewayDeviceList[listCount];
- // if (gatewayTemp.removeGatewayDeviceListData.GwId == dev.Gateway.CurrentGateWayId)
- // {
- // ZigBee.Device.ZbGateway.LogicList.RemoveAt(listCount);
- // listCount--;
- // }
- //}
}
}
};
@@ -1984,500 +1765,6 @@
System.Console.WriteLine("Identify_Actions 閫�鍑�" + System.DateTime.Now.ToString());
}
- #endregion
-
- #region 璁惧涓婃姤杩斿洖鏁版嵁锛岀綉鍏冲洖澶嶄俊鎭�
- ///// <summary>
- ///// 璁惧涓婃姤杩斿洖鏁版嵁锛岀綉鍏冲洖澶嶄俊鎭�
- ///// </summary>
- //public DeviceReportResponAllData deviceReportResponAllData;
- ///// <summary>
- ///// 缃戝叧鎭㈠鍑哄巶璁剧疆杩斿洖鏁版嵁
- ///// </summary>
- //[System.Serializable]
- //public class DeviceReportResponAllData
- //{
- // /// <summary>
- // /// 閿欒淇℃伅
- // /// </summary>
- // public string errorMessageBase;
- // /// <summary>
- // /// 缃戝叧淇℃伅閿欒鍙嶉
- // /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
- // /// </summary>
- // public ErrorResponData errorResponData;
- // ///<summary >
- // ///璁惧鏁版嵁
- // /// </summary>
- // public DeviceStatusReportData deviceStatusReportData;
- //}
-
- ///// <summary>
- ///// 璇诲彇鎶ュ憡灞炴�ч厤缃�,寮傛鑾峰彇鏁版嵁
- ///// </summary>
- ///// <param name="clusterID">Cluster identifier.</param>
- ///// <param name="attriButeId">Attri bute identifier.</param>
- //public async System.Threading.Tasks.Task<DeviceReportResponAllData> ReadAttriAsync(Cluster_ID clusterID, AttriButeId attriButeId)
- //{
- //if (Gateway == null)
- //{
- // return null;
- //}
- ////string result = null;
-
- //return await System.Threading.Tasks.Task.Run(async () =>
- //{
- //var d = new DeviceReportResponAllData();
- //Action<string, string> action = (topic, message) =>
- //{
- //var gatewayID = topic.Split('/')[0];
- //var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
- //if (topic == gatewayID + "/" + "Error_Respon")
- //{
- // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID };
- // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString());
-
- // if (temp == null)
- // {
- // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖";
- // }
- // else
- // {
- // d.errorResponData = temp;
- // d.errorMessageBase = ErrorMess(temp.Error);
- // }
- //}
-
- //if (topic == gatewayID + "/" + "DeviceStatusReport" + "/" + DeviceAddr + "/" + DeviceEpoint + "/" + (int)clusterID + "/" + (int)attriButeId)
- //{
- //var deviceID = jobject.Value<int>("Device_ID");
- //var deviceAddr = jobject.Value<string>("DeviceAddr");
- //var ep = jobject.Value<int>("Epoint");
-
- //var device = Gateway.DeviceList.Find((obj) => obj.DeviceID == deviceID && obj.DeviceAddr == deviceAddr && obj.DeviceEpoint == ep);
- //if (device == null)
- //{
- // return;
- //}
-
- //switch ((DeviceType)(deviceID))
- //{
- // case DeviceType.ColorDimmableLight:
- // device.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorDimmableLight.DeviceStatusReportData>(jobject["Data"].ToString());
- // if (device.DeviceStatusReport == null)
- // {
- // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖";
- // }
- // else
- // {
- // d.deviceStatusReportData = device.DeviceStatusReport;
- // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- // var light = device as ColorDimmableLight;
- // if (device.DeviceStatusReport.CluterID == 8)
- // {
- // var attriButeList = device.DeviceStatusReport.AttriBute;
- // foreach (var attriBute1 in attriButeList)
- // {
- // light.Level = attriBute1.AttriButeData;
- // }
- // light.ReSave();
- // ZigBee.Device.ZbGateway.UpdateDeviceStatus(light);
- // }
- // else if (device.DeviceStatusReport.CluterID == 6)
- // {
- // var attriButeList = device.DeviceStatusReport.AttriBute;
- // foreach (var attriBute1 in attriButeList)
- // {
- // light.OnOffStatus = attriBute1.AttriButeData;
-
- // var key = light.DeviceAddr + "_" + light.DeviceEpoint;
- // Gateway.sceneTaskInfoList.Remove(key);
- // var st = new Scene.TaskListInfo()
- // {
- // TaskType = 1,
- // Data1 = attriBute1.AttriButeData,
- // Data2 = 0,
- // };
- // Gateway.sceneTaskInfoList.Add(key, st);
- // }
- // light.ReSave();
- // ZigBee.Device.ZbGateway.UpdateDeviceStatus(light);
- // }
- // else if (device.DeviceStatusReport.CluterID == 768)
- // {
- // var attriButeList = device.DeviceStatusReport.AttriBute;
- // //foreach (var attriBute1 in attriButeList)
- // //{
- // // if (attriBute1.AttriButeId == 0)
- // // {
- // // light.Hue = attriBute1.AttriButeData.ToString();
- // // }
- // // else if ((attriBute1.AttriButeId == 1))
- // // {
- // // light.Saturation = attriBute1.AttriButeData.ToString();
-
- // // }
- // // else if ((attriBute1.AttriButeId == 16394))
- // // {
- // // light.ColorCapabilities = attriBute1.AttriButeData.ToString();
- // // }
- // // else if ((attriBute1.AttriButeId == 16384))
- // // {
- // // light.EnhancedCurrentHue = attriBute1.AttriButeData.ToString();
- // // }
- // //}
- // light.ReSave();
- // ZigBee.Device.ZbGateway.UpdateDeviceStatus(light);
- // }
- // }
- // break;
- // case DeviceType.OnOffSwitch:
- // device.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.DeviceStatusReportData>(jobject["Data"].ToString());
- // if (device.DeviceStatusReport == null)
- // {
- // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖";
- // }
- // else
- // {
- // d.deviceStatusReportData = device.DeviceStatusReport;
- // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
-
- // var panelObj = device as Panel;
- // foreach (var common in Gateway.DeviceList)
- // {
- // if (common.DeviceAddr != panelObj.DeviceAddr || common.DeviceEpoint != panelObj.DeviceEpoint)
- // {
- // continue;
- // }
- // if (common.Type == DeviceType.OnOffSwitch)
- // {
- // if (device.DeviceStatusReport.CluterID == 6)
- // {
- // var attriButeList = device.DeviceStatusReport.AttriBute;
- // foreach (var attriBute1 in attriButeList)
- // {
- // panelObj.panelMode = attriBute1.AttriButeData;
- // }
-
- // }
- // }
- // panelObj.ReSave();
- // ZigBee.Device.ZbGateway.UpdateDeviceStatus(panelObj);
- // }
- // }
- // break;
- //case DeviceType.OnOffOutput:
- // device.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.DeviceStatusReportData>(jobject["Data"].ToString());
- // //if (device.DeviceStatusReport != null)
- // //{
- // // result = "鎴愬姛";
- // //}
- // if (device.DeviceStatusReport == null)
- // {
- // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖";
- // }
- // else
- // {
- // d.deviceStatusReportData = device.DeviceStatusReport;
- // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
-
- // var lighttoggle = device as ToggleLight;
- // foreach (var common in Gateway.DeviceList)
- // {
- // if (common.DeviceAddr != lighttoggle.DeviceAddr || common.DeviceEpoint != lighttoggle.DeviceEpoint)
- // {
- // continue;
- // }
- // if (common.Type == DeviceType.OnOffOutput)
- // {
- // if (device.DeviceStatusReport.CluterID == 6)
- // {
- // var attriButeList = device.DeviceStatusReport.AttriBute;
- // foreach (var attriBute1 in attriButeList)
- // {
- // lighttoggle.OnOffStatus = attriBute1.AttriButeData;
- // System.Console.WriteLine("褰撳墠寮�鍏崇姸鎬�" + "_" + attriBute1.AttriButeData.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // }
- // }
- // }
- // lighttoggle.ReSave();
- // ZigBee.Device.ZbGateway.UpdateDeviceStatus(lighttoggle);
- // }
- // }
- // break;
-
- //case DeviceType.WindowCoveringDevice:
- // device.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.DeviceStatusReportData>(jobject["Data"].ToString());
- // if (device.DeviceStatusReport == null)
- // {
- // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖";
- // }
- // else
- // {
- // d.deviceStatusReportData = device.DeviceStatusReport;
- // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
- // var curtain = device as Rollershade;
- // foreach (var common in Gateway.DeviceList)
- // {
- // if (common.DeviceAddr != curtain.DeviceAddr || common.DeviceEpoint != curtain.DeviceEpoint)
- // {
- // continue;
- // }
- // if (common.Type == DeviceType.WindowCoveringDevice)
- // {
- // if (device.DeviceStatusReport.CluterID == 258)
- // {
- // foreach (var attriBute1 in curtain.DeviceStatusReport.AttriBute)
- // {
- // switch (attriBute1.AttributeId)
- // {
- // case 0:
- // curtain.WcdType = attriBute1.AttriButeData;
- // System.Console.WriteLine("褰撳墠绐楀笜鐨勭被鍨�" + "_" + curtain.WcdType.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // case 3:
- // curtain.WcdCurrentPositionLift = attriBute1.AttriButeData;
- // System.Console.WriteLine("绐楀笜褰撳墠楂樺害" + "_" + curtain.WcdCurrentPositionLift.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // case 8:
- // curtain.WcdCurrentPositionLiftPercentage = attriBute1.AttriButeData;
- // System.Console.WriteLine("褰撳墠绐楀笜鎵�鍦ㄧ殑杩涘害锛堢櫨鍒嗭級浣嶇疆" + "_" + curtain.WcdCurrentPositionLiftPercentage.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // case 16:
- // curtain.WcdInstalledOpenLimitLift = attriBute1.AttriButeData;
- // System.Console.WriteLine("绐楀笜鍏ㄥ紑鎵�鍦ㄧ殑浣嶇疆" + "_" + curtain.WcdInstalledOpenLimitLift.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // case 17:
- // curtain.WcdInstalledClosedLimitLift = attriBute1.AttriButeData;
- // System.Console.WriteLine("绐楀笜鍏ㄥ叧鎵�鍦ㄧ殑浣嶇疆" + "_" + curtain.WcdCurrentPositionLift.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // case 18:
- // curtain.WcdInstalledOpenLimitTilt = attriBute1.AttriButeData;
- // System.Console.WriteLine("绐楀笜鍏ㄥ紑鎵�鍦ㄧ殑瑙掑害" + "_" + curtain.WcdCurrentPositionLift.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // case 19:
- // curtain.WcdInstalledClosedLimitTilt = attriBute1.AttriButeData;
- // System.Console.WriteLine("绐楀笜鍏ㄥ叧鎵�鍦ㄧ殑瑙掑害" + "_" + curtain.WcdCurrentPositionLift.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // case 23:
- // curtain.WcdCurrentMode = attriBute1.AttriButeData;
- // System.Console.WriteLine("绐楀笜褰撳墠妯″紡" + "_" + curtain.WcdCurrentMode.ToString() + "_" + Gateway.getGatewayBaseInfo.gwID + "_" + System.DateTime.Now.ToString());
- // break;
- // default:
- // break;
- // }
- // }
- // curtain.ReSave();
- // ZigBee.Device.ZbGateway.UpdateDeviceStatus(curtain);
- // }
- // }
- // }
- // }
- // break;
- //case DeviceType.IASZone:
- //device.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.DeviceStatusReportData>(jobject["Data"].ToString());
- //var ias = device as IASZone;
- //foreach (var common in Gateway.DeviceList)
- //{
- // if (common.DeviceAddr != ias.DeviceAddr || common.DeviceEpoint != ias.DeviceEpoint)
- // {
- // continue;
- // }
- // if (common.Type == DeviceType.IASZone)
- // {
- // ias.ReSave();
- // ZigBee.Device.ZbGateway.UpdateDeviceStatus(ias);
- // }
- //}
- //ias.ReSave();
- //break;
- //case DeviceType.Thermostat:
- //device.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<ThermostatObj.DeviceStatusReportData>(jobject["Data"].ToString());
- //var ther = device as ThermostatObj;
- //if (ther.DeviceStatusReport.CluterID == 514)
- //{
- // foreach (var attriBute1 in ther.DeviceStatusReport.AttriBute)
- // {
- // if (attriBute1.AttributeId == 0)
- // {
- // ther.CurentFanControlMode = attriBute1.AttriButeData;
- // }
- // }
- //}
-
- //if (ther.DeviceStatusReport.CluterID == 513)
- //{
- // foreach (var attriBute1 in ther.DeviceStatusReport.AttriBute)
- // {
- // if (attriBute1.AttributeId == 0)
- // {
- // ther.LocalThermostat = attriBute1.AttriButeData / 100;
- // }
- // else if (attriBute1.AttributeId == 17)
- // {
- // ther.CurentCoolingSetpoint = attriBute1.AttriButeData / 100;
- // }
- // else if (attriBute1.AttributeId == 18)
- // {
- // ther.CurentHeatingSetpoint = attriBute1.AttriButeData / 100;
- // }
- // else if (attriBute1.AttributeId == 28)
- // {
- // ther.CurentSystemMode = attriBute1.AttriButeData;
- // }
- // }
- //}
-
- //ZigBee.Device.ZbGateway.UpdateDeviceStatus(ther);
- //break;
- //case DeviceType.TemperatureSensor:
- //var sensor = new TemperatureSensor() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.CurrentGateWayId };
- //sensor.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor.DeviceStatusReportData>(jobject["Data"].ToString());
- //ZigBee.Device.ZbGateway.UpdateDeviceStatus(sensor);
-
- //if (sensor.DeviceStatusReport.CluterID == 1026)
- //{
- // foreach (var attriBute1 in sensor.DeviceStatusReport.AttriBute)
- // {
- // if (attriBute1.AttributeId == 0)
- // {
- // sensor.CurentTemperature = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 1)
- // {
- // sensor.MaxTemperature = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 2)
- // {
- // sensor.MinTemperature = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 3)
- // {
- // sensor.TorleranceTemperature = attriBute1.AttriButeData;
- // }
- // IO.LocalFileUtils.SaveDeviceInfo(sensor, sensor.DeviceEpoint.ToString());
- // }
- //}
- //else if (sensor.DeviceStatusReport.CluterID == 1029)
- //{
- // foreach (var attriBute1 in sensor.DeviceStatusReport.AttriBute)
- // {
- // if (attriBute1.AttributeId == 0)
- // {
- // sensor.CurentHumidity = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 1)
- // {
- // sensor.MaxHumidity = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 2)
- // {
- // sensor.MinHumidity = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 3)
- // {
- // sensor.ToleranceHumidity = attriBute1.AttriButeData;
- // }
- // IO.LocalFileUtils.SaveDeviceInfo(sensor, sensor.DeviceEpoint.ToString());
- // }
- //}
-
- //var sen = Gateway.SensorInfoList.Find(obj => obj.DeviceAddr == sensor.DeviceAddr && obj.DeviceEpoint == sensor.DeviceEpoint);
- //if (sen == null)
- //{
- // Gateway.SensorInfoList.Add(sensor);
- //}
- //else
- //{
- // if (sensor.DeviceStatusReport.CluterID == 1026)
- // {
- // foreach (var attriBute1 in sensor.DeviceStatusReport.AttriBute)
- // {
- // if (attriBute1.AttributeId == 0)
- // {
- // sen.CurentTemperature = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 1)
- // {
- // sen.MaxTemperature = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 2)
- // {
- // sen.MinTemperature = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 3)
- // {
- // sen.TorleranceTemperature = attriBute1.AttriButeData;
- // }
- // IO.LocalFileUtils.SaveDeviceInfo(sensor, sensor.DeviceEpoint.ToString());
- // }
- // }
- // else if (sensor.DeviceStatusReport.CluterID == 1029)
- // {
- // foreach (var attriBute1 in sensor.DeviceStatusReport.AttriBute)
- // {
- // if (attriBute1.AttributeId == 0)
- // {
- // sen.CurentHumidity = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 1)
- // {
- // sen.MaxHumidity = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 2)
- // {
- // sen.MinHumidity = attriBute1.AttriButeData;
- // }
- // else if (attriBute1.AttributeId == 3)
- // {
- // sen.ToleranceHumidity = attriBute1.AttriButeData;
- // }
- // IO.LocalFileUtils.SaveDeviceInfo(sensor, sensor.DeviceEpoint.ToString());
- // }
- // }
- //}
- //break;
- // }
- // }
- // };
-
- // Gateway.Actions += action;
-
- // var JObject = new JObject {
- // { "DeviceAddr",DeviceAddr },
- // { "Epoint", DeviceEpoint },
- // { "Cluster_ID", (int)clusterID },
- // { "Command", 108 }
- // };
- // var attriBute = new JArray{
- // new JObject {
- // { "AttriButeId", (int)attriButeId}
- // }
- // };
- // var data = new JObject { { "AttriBute", attriBute } };
- // JObject.Add("Data", data);
- // Gateway?.Send(("GetDeviceStatus"), Common.SecuritySet.Encryption((JObject.ToString())));
-
- // var dateTime = DateTime.Now;
- // while ((DateTime.Now - dateTime).TotalMilliseconds < 5000)
- // {
- // await System.Threading.Tasks.Task.Delay(10);
- // if (d.deviceStatusReportData != null)
- // {
- // break;
- // }
- // }
- // if ((DateTime.Now - dateTime).TotalMilliseconds > 10000)
- // {
- // d.errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔";
- // }
- // Gateway.Actions -= action;
- // return d;
-
- // });
-
- //}
#endregion
#region 璁惧灞炴�х姸鎬佷笂鎶�
@@ -3382,37 +2669,6 @@
public List<OTADeviceList> DeviceList = new List<OTADeviceList>();
}
- #endregion
-
- #region 鍚敤鎴栧叧闂妭鐐硅澶囬�忎紶鏁版嵁涓婁紶鎺ュ彛
- /// <summary>
- /// 鑺傜偣璁惧閫忎紶鏁版嵁鍒板鎴风
- /// <para>缃戝叧绋嬪簭榛樿鏄叧闂�忎紶鏁版嵁涓婁紶鐨勶紝鍙互閫氳繃浠ヤ笅鎸囦护寮�鍚�忎紶鏁版嵁涓婁紶銆傞�忎紶鏁版嵁涓婁紶寮�鍚悗锛岄噸鍚綉鍏崇▼搴忛�忎紶鏁版嵁涓婁紶灏嗚繕鍘熸垚鍏抽棴鐘舵��</para>
- /// <para>isOn 0锛氬叧闂�忎紶鏁版嵁涓婁紶</para>
- /// <para>isOn 1锛氬紑鍚�忎紶鏁版嵁涓婁紶</para>
- /// </summary>
- //public void OpenPassthroughControl(ZigBee.Device.ZbGateway gateway, int isOn = 1)
- //{
- // if (Gateway == null)
- // {
- // return;
- // }
- // Action<string, string> action = (topic, message) => { };
- // Gateway.Actions += action;
- // System.Console.WriteLine("OnZbDataPassthrough_Actions 鍚姩" + "_" + System.DateTime.Now.ToString());
-
- // try
- // {
- // var jObject = new JObject { { "Cluster_ID", 64513 }, { "Command", 1 } };
- // var data = new JObject { { "IsOn", isOn } };
- // jObject.Add("Data", data);
- // gateway.Send(("OnZbDataPassthrough"), jObject.ToString());
- // }
- // catch { }
-
- // Gateway.Actions -= action;
- // System.Console.WriteLine("OnZbDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
- //}
#endregion
#region 瀹㈡埛绔悜鑺傜偣璁惧閫忎紶鏁版嵁.
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DeviceType.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DeviceType.cs
old mode 100644
new mode 100755
index 98813c1..7e3f7f7
--- a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DeviceType.cs
+++ b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DeviceType.cs
@@ -77,10 +77,10 @@
/// <para>瀹氫箟瀵硅薄锛欶reshAirAC</para>
/// </summary>
FreshAir = 0xD100,
- /// <summary>
- /// <para>鏂伴婀垮害浼犳劅鍣�</para>
- /// <para>璁惧ID涓�0xD200</para>
- /// <para>瀹氫箟瀵硅薄锛歍emperatureSensor</para>
+ /// <summary>
+ /// <para>鏂伴婀垮害浼犳劅鍣�</para>
+ /// <para>璁惧ID涓�0xD200</para>
+ /// <para>瀹氫箟瀵硅薄锛歍emperatureSensor</para>
/// </summary>
FreshAirHumiditySensor = 0xD200,
/// 杞崲鍣�
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/DoorLock.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/FreshAir.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/FreshAir.cs
index 077f2b7..4a9954a 100644
--- a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/FreshAir.cs
+++ b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/FreshAir.cs
@@ -4,8 +4,11 @@
namespace ZigBee.Device
{
[System.Serializable]
- public class FreshAir : CommonDevice
+ public class FreshAir : Panel
{
+ /// <summary>
+ /// 璇ョ被锛堟柊椋庡璞★級鍖呭惈鏂伴璁惧鍜屾柊椋庨潰鏉�
+ /// </summary>
public FreshAir()
{
this.Type = DeviceType.FreshAir;
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/HumiditySensor.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/HumiditySensor.cs
old mode 100644
new mode 100755
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/Panel.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/Panel.cs
old mode 100755
new mode 100644
index 3fb3691..4de23e1
--- a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/Panel.cs
+++ b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/Panel.cs
@@ -61,7 +61,7 @@
public string RoomId = "";
/// <summary>
- /// 褰撳墠鎴块棿ID
+ /// 褰撳墠閫変腑鐨勫満鏅疘D
/// </summary>
public string curSelectSceneID = "";
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs
index ca05683..70c8b3d 100755
--- a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs
+++ b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -3130,14 +3130,14 @@
{
if (localMqttClient.Options == null)
{
- var options = new MQTTnet.Client.Options.MqttClientOptionsBuilder().WithClientId(currentGuid.ToString())
- .WithTcpServer(brokerName, 1883)
- .WithKeepAlivePeriod(TimeSpan.FromSeconds(20))
- .WithCleanSession()
- //.WithCommunicationTimeout(TimeSpan.FromSeconds(10))
- .WithCredentials("", "")
- .Build();
- await localMqttClient.ConnectAsync(options, CancellationToken.None);
+ var options = new MQTTnet.Client.Options.MqttClientOptionsBuilder()//MQTT杩炴帴鍙傛暟濉厖
+ .WithClientId(currentGuid.ToString())//瀹㈡埛绔疘D
+ .WithTcpServer(brokerName, 1883)//TCP鏈嶅姟绔� 1883 锛屽嵆MQTT鏈嶅姟绔�
+ .WithCredentials("", "")//"", "")//鍑瘉 甯愬彿 瀵嗙爜
+ .WithCommunicationTimeout(new TimeSpan(0, 0, 60)) //閲嶈繛瓒呮椂鏃堕棿锛岄粯璁�5s
+ .WithKeepAlivePeriod(new TimeSpan(0, 0, 15)) //淇濇寔杩炴帴鏃堕棿锛岄粯璁�5s锛屽績璺冲寘
+ .Build();//
+ await localMqttClient.ConnectAsync(options);
}
else
{
diff --git a/ZigbeeApp20200414/Shared/R.cs b/ZigbeeApp20200414/Shared/R.cs
index ba2c881..c27b71b 100644
--- a/ZigbeeApp20200414/Shared/R.cs
+++ b/ZigbeeApp20200414/Shared/R.cs
@@ -332,9 +332,9 @@
/// <summary>
/// 闀滃儚ID涓�2310鐨勮澶囩殑榛樿鍚嶅瓧锛氭柟鎮︽柊椋庡皬妯″潡
/// </summary>
- public const int DeviceModelId2310 = 234;
+ public const int uDeviceModelId2310 = 234;
/// <summary>
- /// 闀滃儚ID涓�2310鐨勮澶囩殑榛樿鍚嶅瓧锛氭柟鎮︽柊椋庡皬妯″潡
+ /// 鎸変綇闈㈡澘妯″紡
/// </summary>
public const int AddFreshAirPanelMsg = 235;
/// <summary>
@@ -518,9 +518,9 @@
/// 澶辨晥鏃堕棿涓嶈兘灏忎簬1灏忔椂
/// </summary>
public const int InvalidTimeLessThan1 = 299;
- /// <summary>
- /// 鏂伴
- /// </summary>
+ /// <summary>
+ /// 鏂伴
+ /// </summary>
public const int FreshAir = 300;
/// <summary>
/// 闈炵鐞嗗憳涓嶈兘鍦ㄥ父寮�妯″紡涓嬫搷浣�
@@ -542,7 +542,14 @@
/// PM2.5鏉ユ簮
/// </summary>
public const int PM25Source = 305;
-
+ /// <summary>
+ /// 涓嶈兘鍒涘缓鑷姩鍖栧父寮�妯″紡
+ /// </summary>
+ public const int AddLogicNormallyModeFailed = 307;
+ /// <summary>
+ /// 涓嶈兘鍙栨秷鑷姩鍖栧父寮�妯″紡
+ /// </summary>
+ public const int CancelLogicNormallyModeFailed = 308;
public readonly static int cancel = 5097;
public readonly static int confrim = 5098;
@@ -4052,15 +4059,15 @@
/// </summary>
public const int uDoorLockAlarmMsg5 = 15699;
/// <summary>
- /// 闂ㄩ攣鎶ヨ淇℃伅6锛氬父寮�妯″紡寮�鍚�
+ /// 闂ㄩ攣鎶ヨ淇℃伅6锛氬父寮�妯″紡寮�鍚�(闂ㄩ攣瑙﹀彂)
/// </summary>
public const int uDoorLockAlarmMsg6 = 15700;
/// <summary>
- /// 闂ㄩ攣鎶ヨ淇℃伅7锛氬父寮�妯″紡缁撴潫
+ /// 闂ㄩ攣鎶ヨ淇℃伅7锛氬父寮�妯″紡缁撴潫(闂ㄩ攣瑙﹀彂)
/// </summary>
public const int uDoorLockAlarmMsg7 = 15701;
/// <summary>
- /// 闂ㄩ攣鎶ヨ淇℃伅8锛氶棬閾冭Е鍙�
+ /// 闂ㄩ攣鎶ヨ淇℃伅8锛氭湁浜鸿闂�
/// </summary>
public const int uDoorLockAlarmMsg8 = 15702;
/// <summary>
@@ -5595,6 +5602,31 @@
/// 淇敼鍦烘櫙鍚嶇О澶辫触
/// </summary>
public const int uEditorSceneNameFail = 16087;
+ /// <summary>
+ /// 闂ㄩ攣鎶ヨ淇℃伅8锛氬父寮�妯″紡寮�鍚�(缃戝叧瑙﹀彂)
+ /// </summary>
+ public const int uDoorLockAlarmMsg9 = 16088;
+ /// <summary>
+ /// 闂ㄩ攣鎶ヨ淇℃伅8锛氬父寮�妯″紡缁撴潫(缃戝叧瑙﹀彂)
+ /// </summary>
+ public const int uDoorLockAlarmMsg10 = 16089;
+ /// <summary>
+ /// 甯稿紑妯″紡
+ /// </summary>
+ public const int uNormallyOpenMode = 16090;
+ /// <summary>
+ /// 甯稿紑妯″紡鎵嬪姩寮�鍚�
+ /// </summary>
+ public const int uNormallyOpenModeManualOpen = 16091;
+ /// <summary>
+ /// 甯稿紑妯″紡鎵嬪姩鍙栨秷
+ /// </summary>
+ public const int uNormallyOpenModeManualClose = 16092;
+ /// <summary>
+ /// 甯稿紑妯″紡鍚敤{0}灏忔椂
+ /// </summary>
+ public const int uNormallyOpenModeOpenSomeTime = 16093;
+
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
/// <summary>
@@ -5981,8 +6013,6 @@
/// </summary>
public const int uDeviceModelId2802 = 30037;
- //锛燂紵锛燂紵鏂规偊鏂伴闈㈡澘
-
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
/// <summary>
@@ -6058,12 +6088,109 @@
/// </summary>
public const int uDeviceBelongId16 = 40017;
- /// <summary>
- /// 鑷畾涔夎澶囨墍灞濱D涓�18鐨勭炕璇戝悕瀛楋細鏂伴
- /// </summary>
- public const int uDeviceBelongId18 = 40018;
-
//鈽呪槄鈽呪槄妯″潡ID鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�,杩欓噷涓嶉渶瑕佸畾涔�,鍙啓鍦↙anguage.ini鏂囦欢閲岄潰鈽呪槄鈽呪槄
//鈽呪槄鈽呪槄妯″潡ID鐨勮澶囩被鍨嬪悕瀛�,浠�60000寮�濮�,杩欓噷涓嶉渶瑕佸畾涔�,鍙啓鍦↙anguage.ini鏂囦欢閲岄潰鈽呪槄鈽呪槄
+
+ //鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄坊鍔犳柊璁惧鐣岄潰閭i噷鏄剧ず鐨勫悕瀛�,浠�70000寮�濮嬧槄鈽呪槄鈽�
+ /// <summary>
+ /// 2鎸夐敭闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName1 = 70000;
+ /// <summary>
+ /// 3鎸夐敭闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName2 = 70001;
+ /// <summary>
+ /// 4鎸夐敭闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName3 = 70002;
+ /// <summary>
+ /// 鏂规偊鍗曞紑鍙屾帶闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName4 = 70003;
+ /// <summary>
+ /// 鏂规偊鍙屽紑鍥涙帶闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName5 = 70004;
+ /// <summary>
+ /// 鏂规偊鍥涘紑鍏帶闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName6 = 70005;
+ /// <summary>
+ /// 鏂规偊鏂伴灏忔ā鍧�
+ /// </summary>
+ public const int uDeviceDirectionName7 = 70006;
+ /// <summary>
+ /// 鏂规偊鏂伴闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName8 = 70007;
+ /// <summary>
+ /// 鏂规偊鐜闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName9 = 70008;
+ /// <summary>
+ /// 绐楀笜闈㈡澘
+ /// </summary>
+ public const int uDeviceDirectionName10 = 70009;
+ /// <summary>
+ /// 3璺户鐢靛櫒
+ /// </summary>
+ public const int uDeviceDirectionName11 = 70010;
+ /// <summary>
+ /// 1璺皟鍏夊櫒
+ /// </summary>
+ public const int uDeviceDirectionName12 = 70011;
+ /// <summary>
+ /// 绐楀笜鐢垫満
+ /// </summary>
+ public const int uDeviceDirectionName13 = 70012;
+ /// <summary>
+ /// 鍗峰笜鐢垫満
+ /// </summary>
+ public const int uDeviceDirectionName14 = 70013;
+ /// <summary>
+ /// 绌鸿皟缃戝叧
+ /// </summary>
+ public const int uDeviceDirectionName15 = 70014;
+ /// <summary>
+ /// 闂ㄩ攣
+ /// </summary>
+ public const int uDeviceDirectionName16 = 70015;
+ /// <summary>
+ /// PIR浼犳劅鍣�
+ /// </summary>
+ public const int uDeviceDirectionName17 = 70016;
+ /// <summary>
+ /// 绾㈠浼犳劅鍣�
+ /// </summary>
+ public const int uDeviceDirectionName18 = 70017;
+ /// <summary>
+ /// 鐕冩皵浼犳劅鍣�
+ /// </summary>
+ public const int uDeviceDirectionName19 = 70018;
+ /// <summary>
+ /// 鐑熼浘浼犳劅鍣�
+ /// </summary>
+ public const int uDeviceDirectionName20 = 70019;
+ /// <summary>
+ /// 姘存蹈浼犳劅鍣�
+ /// </summary>
+ public const int uDeviceDirectionName21 = 70020;
+ /// <summary>
+ /// 闂ㄧ獥浼犳劅鍣�
+ /// </summary>
+ public const int uDeviceDirectionName22 = 70021;
+ /// <summary>
+ /// 娓╂箍搴︿紶鎰熷櫒
+ /// </summary>
+ public const int uDeviceDirectionName23 = 70022;
+ /// <summary>
+ /// 涓户鍣�
+ /// </summary>
+ public const int uDeviceDirectionName24 = 70023;
+ /// <summary>
+ /// 鏅鸿兘绌哄紑
+ /// </summary>
+ public const int uDeviceDirectionName25 = 70024;
}
}
diff --git a/ZigbeeApp20200414/Shared/Shared.projitems b/ZigbeeApp20200414/Shared/Shared.projitems
index 3c8a28b..39fddd1 100644
--- a/ZigbeeApp20200414/Shared/Shared.projitems
+++ b/ZigbeeApp20200414/Shared/Shared.projitems
@@ -33,6 +33,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceRelayRowControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceSensorRowControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceTemperatureRowControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\SelectLocalSceneImageForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\CurrentDeviceState.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\AddDeviceView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\Addview.cs" />
@@ -46,6 +47,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TypeView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\Method.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\OneLogic.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\OneTimePoint.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\RoomAndDeviceView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SkipView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountForgetPWD.cs" />
@@ -53,60 +55,25 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountRegister.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountRegisterSuccess.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountResetPWDSuccess.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\Controls\PhoneEmailSelectControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\PhoneEmailForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\PhoneZone.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\AC\ACControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\AC\ACControlBase.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\CategorySceneSelectImgByLocal.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectDelayTime.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectDevice.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectFloor.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectHouse.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\SelectScene.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\ACLeftIconButtonRowLayout.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\BackButton.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\ButtonLineForm.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CategoryFunctionForWinRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CategoryFunctionRow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CommonEnum.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CommonFormResouce.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CompleteButton.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\CustomAlert.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\DeviceDetailInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\DeviceIconSelectedIMGByLocal.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\DeviceInfoEditRow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\DeviceInfoRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\DeviceInfoWithZoneRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\FunctionButton.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\FunctionIconButton.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\FunctionMainView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\FunctionRow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\LeftIconButtonRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RoomButton.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RoomMainView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RoomNoNameMainView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RoomView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RowLayoutDeleteButton.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RowLayoutEditButton.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SceneCategoryView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SceneMainView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SceneTargetFunctionRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SceneTargetTimeRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectDeviceWithPickViewRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectDeviceWithSeekBarRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectedStatuButton.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectFunctionView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectSceneRow.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectSceneStatuRow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectTime.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SelectZone.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\TopFrameLayout.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\DeviceLogic\ReadDeviceAttributeLogic.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Light\AirSwitchControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Light\DimmableLightControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Light\LightControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Light\OnOffControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Light\PlugControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\AddLogicPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\AddScenePage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\CustomText.cs" />
@@ -128,11 +95,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TimePage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TimePoint.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\WeekPage.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\EditRoom.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomCommon.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomHumiditySetting.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomShareSetting.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\RoomTemperatureSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\Base\DeviceDetailCardCommonForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceAcDetailCardForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceColorLightDetailCardForm.cs" />
@@ -183,8 +145,10 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Form\PswSecondarySecurityForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlACZbGatewayUpdateLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlCheckLogic.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlControlLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceAirConditionerLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceCurtainLogic.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceDoorLockLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceOtherLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlGatewayBackupLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlGatewayUpdateLogic.cs" />
@@ -427,10 +391,11 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Suggestion\FeedbackForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\UserMain\SecondAuthenticationForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserView\LoginLoading.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserView\SafetyShortcutControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\AC.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" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\HumiditySensor.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Repeater.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\ThirdPartyModuleUpgrade.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Transverter.cs" />
@@ -452,7 +417,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountLogin.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountLoginByCode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\CommonPage.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Common\ResultStatus.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\BackupInfoRes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\FolderRes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\GatewayRes.cs" />
@@ -462,10 +426,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\UserLoginRes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\ResponseEntity\UserRegisterReqDto.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\SendDataToServer.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserView\UserHomeView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\Room.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ListRoomViewFrom.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Room\AddRoomSelectPicByLocal.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Residence\SelectLocalRoomImageForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\ProgressBar.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\SearchEditText.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\RowLayoutControls\RowLayoutControl.cs" />
@@ -475,9 +438,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceAddSuccessForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Safety\SafetyManagementMainForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\FrameLayoutControls\FrameRowControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\Category.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Curtain\rollerShadeControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\CategoryAddScene.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\SceneUI.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\SceneTargetDeviceUI.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\SceneRoomUI.cs" />
@@ -518,14 +478,11 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\IO\LocalFileUtils.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlSafeguardLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlAlarmsLogic.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\FreshAir.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\HumiditySensor.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirTargetsForm.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Pad\" />
<Folder Include="$(MSBuildThisFileDirectory)Pad\Home\" />
- <Folder Include="$(MSBuildThisFileDirectory)Phone\Device\Curtain\" />
<Folder Include="$(MSBuildThisFileDirectory)Phone\CommonForm\" />
<Folder Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\Base\" />
</ItemGroup>
--
Gitblit v1.8.0