From 8b4d79ca03495e522a1953e04ca17527f33c853a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 28 十月 2019 13:22:17 +0800
Subject: [PATCH] 合并完成代码
---
ZigbeeApp/GateWay.Droid/Assets/Language.ini | 108
ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs | 1
ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs | 5
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs | 10
ZigbeeApp/Shared/Common/DeviceUI.cs | 23
ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 250
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 35
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs | 7
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs | 211 +
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithPickViewRow.cs | 191 +
ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColor.png | 0
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneRow.cs | 163 +
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs | 159
ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 2
ZigbeeApp/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs | 7
ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs | 342 ++
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs | 2
ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 54
ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 4
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs | 440 --
ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Heat2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs | 333 ++
ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloor.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs | 23
ZigbeeApp/Shared/Common/ZigbeeColor.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 634 ++-
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneStatuRow.cs | 140
ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloor.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs | 48
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs | 2
ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs | 128
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs | 7
ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/Selected.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs | 8
ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Dry2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs | 76
ZigbeeApp/Shared/Phone/Device/Category/SelectDelayTime.cs | 58
ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetTimeRow.cs | 102
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 21
ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColor.png | 0
ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs | 13
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs | 144
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs | 4
ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/SceneIcon.png | 0
ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColorOn.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockIfon.cs | 19
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpoint.png | 0
ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat2.png | 0
ZigbeeApp/Shared/Shared.projitems | 18
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 165
ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs | 3
ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs | 1160 +++++++
ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs | 25
ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png | 0
ZigbeeApp/GateWay.Ios/Resources/Phone/Item/WarningIcon1.png | 0
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs | 244 +
ZigbeeApp/GateWay.Ios/Resources/Language.ini | 108
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs | 194 +
ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 44
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/EditorCommonForm.cs | 32
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessGatewaySearchForm.cs | 2
ZigbeeApp/Shared/Common/CommonPage.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs | 22
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 34
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs | 14
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs | 25
ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs | 12
ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan2.png | 0
ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs | 139
ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs | 4
ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloorSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs | 5
ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionRow.cs | 34
ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs | 8
ZigbeeApp/Shared/Common/SceneUI.cs | 142
ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/Selected.png | 0
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs | 389 --
ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIconSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected.png | 0
ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetFunctionRow.cs | 143
ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColorOn.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs | 5
ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloorSelected.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs | 110
ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionButton.cs | 12
ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool2.png | 0
ZigbeeApp/Shared/Common/SceneRoomUI.cs | 123
ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs | 40
ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs | 18
ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIcon.png | 0
ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs | 6
ZigbeeApp/Shared/Phone/Device/Room/AddRoomScene.cs | 4
ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 8
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs | 11
ZigbeeApp/Shared/R.cs | 313 +
ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry2.png | 0
ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Fan2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs | 10
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs | 402 +-
ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs | 660 ++-
ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs | 2
ZigbeeApp/Shared/Common/Device.cs | 13
ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpoint.png | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs | 143
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs | 7
ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/SceneIcon.png | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 18
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs | 2
ZigbeeApp/GateWay.Droid/Assets/Phone/Item/WarningIcon1.png | 0
/dev/null | 84
ZigbeeApp/GateWay.Ios/Resources/Phone/Item/IndoorUnitGround.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 36
ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpointSelected.png | 0
ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Cool2.png | 0
ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs | 54
ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs | 4
ZigbeeApp/Shared/Common/Room.cs | 212
ZigbeeApp/GateWay.Droid/Assets/Phone/Item/IndoorUnitGround.png | 0
126 files changed, 6,587 insertions(+), 2,470 deletions(-)
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
index 340d6c4..25ab4d2 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini
+++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -76,15 +76,15 @@
71=鏃�
72=鎴愬憳绠$悊
73=鎸囩汗褰曞叆鎴愬姛
-74=IC鍗″綍鍏ユ垚鍔�
+74=IC鍗″綍鍏ユ垚鍔�
75=鎸囩汗澶囨敞锛�
76=鍒囨崲妯″紡浼氭竻闄ゆ寜閿腑鎵�鏈夌殑鐩爣锛岀‘瀹氳鍒囨崲鍚�
77=鍐荤粨鐢ㄦ埛
78=鍘嗗彶璁板綍
-79=鎵�鏈夋垚鍛�
-80=寮�閿佹柟寮�
-81=寮�閿佹垚鍔�
-82=鏈変汉璁块棶
+79=鎵�鏈夋垚鍛�
+80=寮�閿佹柟寮�
+81=寮�閿佹垚鍔�
+82=鏈変汉璁块棶
83=鎸囩汗寮�閿�
84=瀵嗙爜寮�閿�
85=涓存椂瀵嗙爜寮�閿�
@@ -161,7 +161,7 @@
156=鏆傛棤鍙帶鐩爣
157=娣诲姞鍦烘櫙
-158=娣诲姞寮�鍏�
+158=娣诲姞寮�鍏�
159=娣诲姞鐏厜
160=娣诲姞閬槼
161=閫夋嫨鎸夐敭妯″紡
@@ -174,17 +174,17 @@
168=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞鏂板満鏅悧锛�
169=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞寮�鍏冲悧锛�
170=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞璋冨厜鍚楋紵
-171=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞閬槼鍚楋紵
+171=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞閬槼鍚楋紵
172=IC鍗�
173=瀵嗙爜
-174=鎸囩汗
+174=鎸囩汗
175=淇敼澶辫触
176=璇ョ敤鎴峰彧鑳藉湪璁惧绔垹闄�
177=鏈垎閰�
178=楠岃瘉棰戠箒锛岃30绉掑悗鍐嶈瘯
-179=鎿嶄綔澶辫触
+179=鎿嶄綔澶辫触
180=杩滅▼寮�閿佺粦瀹氭垚鍔�
-181=璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮�
+181=璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮�
182=鍏抽棴
183=姝e湪寮�閿�
184=鎵撳紑
@@ -203,8 +203,9 @@
197=璁剧疆澶辫触,璇烽噸鏂板皾璇�
198=娓呴櫎澶辫触,璇烽噸鏂板皾璇�
199=娓呴櫎澶辫触
-200=淇敼涓存椂瀵嗙爜淇℃伅鍓�
+200= 淇敼涓存椂瀵嗙爜淇℃伅鍓�
201=璇风偣鍑诲彸涓婅鈥滄竻闄ゅ瘑鐮佲��
+202=涓�妤�
548=鎻愰啋璁剧疆
550=鏂板鐢ㄦ埛
@@ -214,14 +215,14 @@
554=鏈紪杈戝瘑鐮�
555=鏈紪杈戞劅搴斿崱
556=鍦烘櫙缂栬緫
-557=鏈紪杈戝満鏅�
-558=鏂板悕瀛�
-559=鍘熷悕瀛�
+557=鏈紪杈戝満鏅�
+558=鏂板悕瀛�
+559=鍘熷悕瀛�
560=绯荤粺璁剧疆
561=瀵嗙爜鍒楄〃
562=淇敼澶囨敞
563=涓存椂瀵嗙爜
-564=鎰熷簲鍗�
+564=鎰熷簲鍗�
565=澶囨敞涓虹┖
566=楠岃瘉鎴愬姛
567=楠岃瘉棰戠箒锛岃5绉掑悗閲嶆柊鎿嶄綔
@@ -237,7 +238,7 @@
577=鐭鏃堕棿
578=鑷姩鐭鏃堕棿
579=鎵嬪姩鐭鏃堕棿
-580=鍒�
+580=鍒�
581=璁剧疆鎴愬姛
582=璁剧疆澶辫触
583=鍔ㄦ�佸瘑鐮�
@@ -279,7 +280,7 @@
620=璁剧疆瀵嗙爜闇�瑕佹寜璁惧鎸夐敭
621=璇疯緭鍏�6浣嶅瘑鐮�
622=瀵嗙爜鍙戦�佸け璐�
-623=鏇存敼瀵嗙爜鏃跺厛鍦ㄨ緭鍏ュ師瀵嗙爜
+623=鏇存敼瀵嗙爜鏃跺厛鍦ㄨ緭鍏ュ師瀵嗙爜
624=璁剧疆瀵嗙爜闇�瑕佹寜璁惧閿�5s
625=鏇存敼瀵嗙爜鏃跺厛杈撳叆鍘熷瘑鐮佺劧鍚庨暱鎸夎澶囨寜閿�5s鎵嶈兘鏇存敼瀵嗙爜
626=鏃堕棿璁剧疆
@@ -289,14 +290,14 @@
630=鐢ㄦ埛鍚�
631=鎵�鏈夐棬閿�
632=瀵嗙爜涓嶅瓨鍦ㄣ�傚缓璁缃柊瀵嗙爜
-633=纭畾瑕佹洿鏀瑰瘑鐮佸悧
-634=鎵�鏈夊巻鍙茶褰�
+633=纭畾瑕佹洿鏀瑰瘑鐮佸悧
+634=鎵�鏈夊巻鍙茶褰�
635=璁剧疆瀵嗙爜
636=鎵惧洖瀵嗙爜
637=璐︽埛瀵嗙爜
-638=璐︽埛瀵嗙爜閿欒
+638=璐︽埛瀵嗙爜閿欒
639=鎵�鏈夎褰�
-640=杩滅▼寮�閿佸瘑鐮佽缃�/鏇存敼
+640=杩滅▼寮�閿佸瘑鐮佽缃�/鏇存敼
641=杩樻病璁剧疆瀵嗙爜
642= 杩滅▼寮�閿佸瘑鐮佸凡缁忚缃�
643= 娆㈣繋浣跨敤杩滅▼寮�閿�
@@ -309,13 +310,13 @@
650=璐︽埛瀵嗙爜涓虹┖
651=鍦烘櫙鎶ヨ璁剧疆
652=璁剧疆鐩爣澶辫触锛岃鍦ㄥ満鏅腑娣诲姞閫昏緫妯″潡
-653=鎺у埗澶辫触
-654=鏈煡鎸囩汗
+653=鎺у埗澶辫触
+654=鏈煡鎸囩汗
655=璇锋鏌ョ綉缁�
656=鏈煡IC鍗�
657=纭畾鎵撳紑鎶ヨ鎻愰啋?
658=纭畾鍏抽棴鎶ヨ鎻愰啋锛�
-659=鎸囩汗璁板綍
+659=鎸囩汗璁板綍
660=瀵嗙爜璁板綍
661=IC鍗¤褰�
662=杩滅▼璁板綍
@@ -323,7 +324,7 @@
664=鐢ㄦ埛
665=璇疯緭鍏ユ帹閫佸唴瀹�
666=褰撳墠宸茬粡閰嶇疆浜嗗満鏅紝纭畾瑕佹浛鎹㈠悧锛�
-667=鏀瑰満鏅凡缁忛�変腑
+667=鏀瑰満鏅凡缁忛�変腑
668=娌℃湁鍙戠幇缃戝叧
669=鍚屾閫氱煡鎴愬姛
670=鍚屾閫氱煡澶辫触
@@ -575,6 +576,12 @@
5359=浜烘潵鐏寒
5360=浜鸿蛋鐏伃
5361=鎸夐敭
+5362=鏂板鑱斿姩浜嬩欢
+5363=缂栬緫鑱斿姩浜嬩欢
+5364=閫夋嫨寮�閿佹柟寮�
+5365=娣诲姞鍔ㄤ綔
+5366=鑱斿姩浜嬩欢
+
@@ -637,6 +644,17 @@
11032=閫夋嫨鍖哄煙
11033=閫夋嫨鍦烘櫙鍥剧墖
+12100=鏈煡璁惧
+12101=鎺у埗闈㈡澘
+12102=缁х數鍣�
+12103=璋冨厜鐏�
+12104=绐楀笜
+12105=绌鸿皟
+12106=浼犳劅鍣�
+12107=绌烘皵寮�鍏�
+12108=褰╃伅
+12109=涓户鍣�
+
13100=鎴块棿鍒楄〃
13101=閫夋嫨妤煎眰
@@ -650,7 +668,7 @@
13109=婀垮害
13110=褰撳墠
13111=寮�
-13112=鍏�
+13112=鍏抽棴
13113=涓嶅紑鍚�
13114=绉�
13115=鍒嗛挓
@@ -661,6 +679,27 @@
13120=璇ユ埧闂存槸鍒嗕韩杩囨潵鐨勶紝涓嶅厑璁歌繘琛岃鎿嶄綔
13121=杩樻病閫夋嫨鎴块棿锛岃鍏堥�夋嫨
13122=涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅�
+13123=鍚�
+13124=鍒犻櫎
+13125=鍏�
+13126=閫夋嫨椋庨��
+13127=浣庨
+13128=涓
+13129=楂橀
+13130=閫夋嫨妯″紡
+13131=鑷姩
+13132=鍒跺喎
+13133=鍒剁儹
+13134=闄ゆ箍
+13135=閫侀
+13136=瀹ゆ俯
+13137=绌鸿皟宸茬粡鍏抽棴锛岃鍏堟墦寮�
+13138=娣诲姞鍦烘櫙澶辫触
+13139=璇ュ満鏅凡瀛樺湪
+13140=缂栬緫
+13141=缂栬緫鍦烘櫙
+
+
@@ -1442,6 +1481,20 @@
15839=1.璇风‘淇濇墜鏈轰笌璁惧涔嬮棿鐨勮窛绂昏冻澶熻繎锛屽苟涓斿懆鍥寸綉缁滅幆澧冩病鏈夊己骞叉壈銆�
15840=2.鍚屾椂闇�纭搴旂敤鐨勫畾浣嶆潈闄愭湭琚叧闂�傝嫢鎵嬪姩鍏抽棴浜嗗簲鐢ㄥ畾浣嶆潈闄愬彲鑳藉鑷存棤娉曡嚜鎷斿彂鐜拌澶囥��
15841=3.濡傛灉浠嶅缁堟棤娉曞彂鐜拌澶囷紝鍙兘鍥犱负璁惧宸茬粡琚粬浜虹粦瀹氫簡銆傚鏋滀綘骞朵笉娓呮鏄皝杩炴帴浜嗚澶囷紝鍙互杩涜閲嶇疆锛岄噸缃柟寮忚鏌ラ槄璇存槑涔︼紝鏍规嵁鎸囧紩鎿嶄綔銆�
+15842=鎴块棿鍒楄〃
+15843=杩樻病鏈夋坊鍔犲満鏅摝
+15844=杩樻病鏈夋坊鍔犺澶囧摝
+15845=鎴块棿鍚嶇О宸茬粡瀛樺湪
+15846=瀹ゅ唴鏈鸿缃�
+15847=绌鸿皟妯″紡
+15848=鎽嗛
+15849=鍒跺喎
+15850=鍒剁儹
+15851=鑷姩
+15852=閫侀
+15853=闄ゆ箍
+15854=鎵撳紑绌鸿皟澶辫触
+15855=鍏抽棴绌鸿皟澶辫触
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1475,7 +1528,8 @@
18047=鍏变韩鏁版嵁涓嶅瓨鍦�
18048=鍒嗕韩鐨勭洰鏍囪处鍙蜂笉瀛樺湪
18049=鍒嗕韩鏁版嵁鎿嶄綔澶辫触
-18050=涓嶈兘娣诲姞鑷繁涓哄瓙璐﹀彿
+18050=涓嶈兘鎶婅嚜宸辨坊鍔犱负鎴愬憳
+18051=涓嶈兘鎶婁富璐﹀彿娣诲姞涓烘垚鍛�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囩殑鍏ョ綉姝ラ,浠�21000寮�濮嬧槄鈽呪槄鈽�
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Cool2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Cool2.png
new file mode 100755
index 0000000..f434105
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Cool2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Dry2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Dry2.png
new file mode 100755
index 0000000..7a888b3
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Dry2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Fan2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Fan2.png
new file mode 100755
index 0000000..2bc8a79
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Fan2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Heat2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Heat2.png
new file mode 100755
index 0000000..e5c6cec
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/AC/Mode_Heat2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColor.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColor.png
new file mode 100755
index 0000000..cbc6eda
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColor.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColorOn.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColorOn.png
new file mode 100755
index 0000000..28f3760
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/BindPic/BindRoomColorOn.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpoint.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpoint.png
index f360c34..2f09584 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpoint.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpoint.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected.png
new file mode 100755
index 0000000..2d86133
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirConditionerEpointSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png
index 2228105..34011fb 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/FunctionIcon/2IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloor.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloor.png
new file mode 100755
index 0000000..9d20b1e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloor.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloorSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloorSelected.png
new file mode 100755
index 0000000..716141b
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/CreatFloorSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/IndoorUnitGround.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/IndoorUnitGround.png
new file mode 100755
index 0000000..a086c67
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/IndoorUnitGround.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/PirSensorLightScale.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/PirSensorLightScale.png
deleted file mode 100755
index 1400c3a..0000000
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/PirSensorLightScale.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/PirSensorLightScaleButton.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/PirSensorLightScaleButton.png
deleted file mode 100755
index cd04260..0000000
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/PirSensorLightScaleButton.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIcon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIcon.png
index c107a1e..cca18cd 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIcon.png
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIcon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIconSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIconSelected.png
new file mode 100755
index 0000000..c107a1e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/RoomIconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/WarningIcon1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/WarningIcon1.png
new file mode 100755
index 0000000..d137261
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/WarningIcon1.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/SceneIcon.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/SceneIcon.png
new file mode 100755
index 0000000..afa320a
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/SceneIcon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/Selected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/Selected.png
new file mode 100755
index 0000000..53616fe
--- /dev/null
+++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Scene/Selected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
index e972c74..f15e4cb 100755
--- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
+++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj
@@ -483,8 +483,6 @@
<AndroidAsset Include="Assets\Phone\Item\OpenIcon.png" />
<AndroidAsset Include="Assets\Phone\Item\PersentIcon.png" />
<AndroidAsset Include="Assets\Phone\Item\PickerColorWheel.png" />
- <AndroidAsset Include="Assets\Phone\Item\PirSensorLightScale.png" />
- <AndroidAsset Include="Assets\Phone\Item\PirSensorLightScaleButton.png" />
<AndroidAsset Include="Assets\Phone\Item\Point.png" />
<AndroidAsset Include="Assets\Phone\Item\ProgressMsg.png" />
<AndroidAsset Include="Assets\Phone\Item\PswSettion.png" />
@@ -940,6 +938,48 @@
<ItemGroup>
<AndroidAsset Include="Assets\Phone\ZigeeLogic\selectedtemperature.png" />
</ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Item\CreatFloor.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Item\CreatFloorSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Item\RoomIconSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Device\AirConditionerEpointSelected.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Item\WarningIcon1.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\AC\Mode_Cool2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\AC\Mode_Dry2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\AC\Mode_Fan2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\AC\Mode_Heat2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Item\IndoorUnitGround.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\BindPic\BindRoomColor.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\BindPic\BindRoomColorOn.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Scene\SceneIcon.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <AndroidAsset Include="Assets\Phone\Scene\Selected.png" />
+ </ItemGroup>
<Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" />
diff --git a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
index ed011c2..2e3097c 100755
--- a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
+++ b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2019101801" android:installLocation="auto" android:versionName="1.0.19101801">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2019102801" android:installLocation="auto" android:versionName="1.0.19102801">
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" />
<permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Language.ini b/ZigbeeApp/GateWay.Ios/Resources/Language.ini
index 340d6c4..25ab4d2 100755
--- a/ZigbeeApp/GateWay.Ios/Resources/Language.ini
+++ b/ZigbeeApp/GateWay.Ios/Resources/Language.ini
@@ -76,15 +76,15 @@
71=鏃�
72=鎴愬憳绠$悊
73=鎸囩汗褰曞叆鎴愬姛
-74=IC鍗″綍鍏ユ垚鍔�
+74=IC鍗″綍鍏ユ垚鍔�
75=鎸囩汗澶囨敞锛�
76=鍒囨崲妯″紡浼氭竻闄ゆ寜閿腑鎵�鏈夌殑鐩爣锛岀‘瀹氳鍒囨崲鍚�
77=鍐荤粨鐢ㄦ埛
78=鍘嗗彶璁板綍
-79=鎵�鏈夋垚鍛�
-80=寮�閿佹柟寮�
-81=寮�閿佹垚鍔�
-82=鏈変汉璁块棶
+79=鎵�鏈夋垚鍛�
+80=寮�閿佹柟寮�
+81=寮�閿佹垚鍔�
+82=鏈変汉璁块棶
83=鎸囩汗寮�閿�
84=瀵嗙爜寮�閿�
85=涓存椂瀵嗙爜寮�閿�
@@ -161,7 +161,7 @@
156=鏆傛棤鍙帶鐩爣
157=娣诲姞鍦烘櫙
-158=娣诲姞寮�鍏�
+158=娣诲姞寮�鍏�
159=娣诲姞鐏厜
160=娣诲姞閬槼
161=閫夋嫨鎸夐敭妯″紡
@@ -174,17 +174,17 @@
168=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞鏂板満鏅悧锛�
169=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞寮�鍏冲悧锛�
170=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞璋冨厜鍚楋紵
-171=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞閬槼鍚楋紵
+171=褰撳墠鎸夐敭瀛樺湪鍦烘櫙锛岀‘瀹氳绉婚櫎褰撳墠鍦烘櫙閲嶆柊娣诲姞閬槼鍚楋紵
172=IC鍗�
173=瀵嗙爜
-174=鎸囩汗
+174=鎸囩汗
175=淇敼澶辫触
176=璇ョ敤鎴峰彧鑳藉湪璁惧绔垹闄�
177=鏈垎閰�
178=楠岃瘉棰戠箒锛岃30绉掑悗鍐嶈瘯
-179=鎿嶄綔澶辫触
+179=鎿嶄綔澶辫触
180=杩滅▼寮�閿佺粦瀹氭垚鍔�
-181=璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮�
+181=璇疯缃簩娆″畨鍏ㄩ獙璇佹柟寮�
182=鍏抽棴
183=姝e湪寮�閿�
184=鎵撳紑
@@ -203,8 +203,9 @@
197=璁剧疆澶辫触,璇烽噸鏂板皾璇�
198=娓呴櫎澶辫触,璇烽噸鏂板皾璇�
199=娓呴櫎澶辫触
-200=淇敼涓存椂瀵嗙爜淇℃伅鍓�
+200= 淇敼涓存椂瀵嗙爜淇℃伅鍓�
201=璇风偣鍑诲彸涓婅鈥滄竻闄ゅ瘑鐮佲��
+202=涓�妤�
548=鎻愰啋璁剧疆
550=鏂板鐢ㄦ埛
@@ -214,14 +215,14 @@
554=鏈紪杈戝瘑鐮�
555=鏈紪杈戞劅搴斿崱
556=鍦烘櫙缂栬緫
-557=鏈紪杈戝満鏅�
-558=鏂板悕瀛�
-559=鍘熷悕瀛�
+557=鏈紪杈戝満鏅�
+558=鏂板悕瀛�
+559=鍘熷悕瀛�
560=绯荤粺璁剧疆
561=瀵嗙爜鍒楄〃
562=淇敼澶囨敞
563=涓存椂瀵嗙爜
-564=鎰熷簲鍗�
+564=鎰熷簲鍗�
565=澶囨敞涓虹┖
566=楠岃瘉鎴愬姛
567=楠岃瘉棰戠箒锛岃5绉掑悗閲嶆柊鎿嶄綔
@@ -237,7 +238,7 @@
577=鐭鏃堕棿
578=鑷姩鐭鏃堕棿
579=鎵嬪姩鐭鏃堕棿
-580=鍒�
+580=鍒�
581=璁剧疆鎴愬姛
582=璁剧疆澶辫触
583=鍔ㄦ�佸瘑鐮�
@@ -279,7 +280,7 @@
620=璁剧疆瀵嗙爜闇�瑕佹寜璁惧鎸夐敭
621=璇疯緭鍏�6浣嶅瘑鐮�
622=瀵嗙爜鍙戦�佸け璐�
-623=鏇存敼瀵嗙爜鏃跺厛鍦ㄨ緭鍏ュ師瀵嗙爜
+623=鏇存敼瀵嗙爜鏃跺厛鍦ㄨ緭鍏ュ師瀵嗙爜
624=璁剧疆瀵嗙爜闇�瑕佹寜璁惧閿�5s
625=鏇存敼瀵嗙爜鏃跺厛杈撳叆鍘熷瘑鐮佺劧鍚庨暱鎸夎澶囨寜閿�5s鎵嶈兘鏇存敼瀵嗙爜
626=鏃堕棿璁剧疆
@@ -289,14 +290,14 @@
630=鐢ㄦ埛鍚�
631=鎵�鏈夐棬閿�
632=瀵嗙爜涓嶅瓨鍦ㄣ�傚缓璁缃柊瀵嗙爜
-633=纭畾瑕佹洿鏀瑰瘑鐮佸悧
-634=鎵�鏈夊巻鍙茶褰�
+633=纭畾瑕佹洿鏀瑰瘑鐮佸悧
+634=鎵�鏈夊巻鍙茶褰�
635=璁剧疆瀵嗙爜
636=鎵惧洖瀵嗙爜
637=璐︽埛瀵嗙爜
-638=璐︽埛瀵嗙爜閿欒
+638=璐︽埛瀵嗙爜閿欒
639=鎵�鏈夎褰�
-640=杩滅▼寮�閿佸瘑鐮佽缃�/鏇存敼
+640=杩滅▼寮�閿佸瘑鐮佽缃�/鏇存敼
641=杩樻病璁剧疆瀵嗙爜
642= 杩滅▼寮�閿佸瘑鐮佸凡缁忚缃�
643= 娆㈣繋浣跨敤杩滅▼寮�閿�
@@ -309,13 +310,13 @@
650=璐︽埛瀵嗙爜涓虹┖
651=鍦烘櫙鎶ヨ璁剧疆
652=璁剧疆鐩爣澶辫触锛岃鍦ㄥ満鏅腑娣诲姞閫昏緫妯″潡
-653=鎺у埗澶辫触
-654=鏈煡鎸囩汗
+653=鎺у埗澶辫触
+654=鏈煡鎸囩汗
655=璇锋鏌ョ綉缁�
656=鏈煡IC鍗�
657=纭畾鎵撳紑鎶ヨ鎻愰啋?
658=纭畾鍏抽棴鎶ヨ鎻愰啋锛�
-659=鎸囩汗璁板綍
+659=鎸囩汗璁板綍
660=瀵嗙爜璁板綍
661=IC鍗¤褰�
662=杩滅▼璁板綍
@@ -323,7 +324,7 @@
664=鐢ㄦ埛
665=璇疯緭鍏ユ帹閫佸唴瀹�
666=褰撳墠宸茬粡閰嶇疆浜嗗満鏅紝纭畾瑕佹浛鎹㈠悧锛�
-667=鏀瑰満鏅凡缁忛�変腑
+667=鏀瑰満鏅凡缁忛�変腑
668=娌℃湁鍙戠幇缃戝叧
669=鍚屾閫氱煡鎴愬姛
670=鍚屾閫氱煡澶辫触
@@ -575,6 +576,12 @@
5359=浜烘潵鐏寒
5360=浜鸿蛋鐏伃
5361=鎸夐敭
+5362=鏂板鑱斿姩浜嬩欢
+5363=缂栬緫鑱斿姩浜嬩欢
+5364=閫夋嫨寮�閿佹柟寮�
+5365=娣诲姞鍔ㄤ綔
+5366=鑱斿姩浜嬩欢
+
@@ -637,6 +644,17 @@
11032=閫夋嫨鍖哄煙
11033=閫夋嫨鍦烘櫙鍥剧墖
+12100=鏈煡璁惧
+12101=鎺у埗闈㈡澘
+12102=缁х數鍣�
+12103=璋冨厜鐏�
+12104=绐楀笜
+12105=绌鸿皟
+12106=浼犳劅鍣�
+12107=绌烘皵寮�鍏�
+12108=褰╃伅
+12109=涓户鍣�
+
13100=鎴块棿鍒楄〃
13101=閫夋嫨妤煎眰
@@ -650,7 +668,7 @@
13109=婀垮害
13110=褰撳墠
13111=寮�
-13112=鍏�
+13112=鍏抽棴
13113=涓嶅紑鍚�
13114=绉�
13115=鍒嗛挓
@@ -661,6 +679,27 @@
13120=璇ユ埧闂存槸鍒嗕韩杩囨潵鐨勶紝涓嶅厑璁歌繘琛岃鎿嶄綔
13121=杩樻病閫夋嫨鎴块棿锛岃鍏堥�夋嫨
13122=涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅�
+13123=鍚�
+13124=鍒犻櫎
+13125=鍏�
+13126=閫夋嫨椋庨��
+13127=浣庨
+13128=涓
+13129=楂橀
+13130=閫夋嫨妯″紡
+13131=鑷姩
+13132=鍒跺喎
+13133=鍒剁儹
+13134=闄ゆ箍
+13135=閫侀
+13136=瀹ゆ俯
+13137=绌鸿皟宸茬粡鍏抽棴锛岃鍏堟墦寮�
+13138=娣诲姞鍦烘櫙澶辫触
+13139=璇ュ満鏅凡瀛樺湪
+13140=缂栬緫
+13141=缂栬緫鍦烘櫙
+
+
@@ -1442,6 +1481,20 @@
15839=1.璇风‘淇濇墜鏈轰笌璁惧涔嬮棿鐨勮窛绂昏冻澶熻繎锛屽苟涓斿懆鍥寸綉缁滅幆澧冩病鏈夊己骞叉壈銆�
15840=2.鍚屾椂闇�纭搴旂敤鐨勫畾浣嶆潈闄愭湭琚叧闂�傝嫢鎵嬪姩鍏抽棴浜嗗簲鐢ㄥ畾浣嶆潈闄愬彲鑳藉鑷存棤娉曡嚜鎷斿彂鐜拌澶囥��
15841=3.濡傛灉浠嶅缁堟棤娉曞彂鐜拌澶囷紝鍙兘鍥犱负璁惧宸茬粡琚粬浜虹粦瀹氫簡銆傚鏋滀綘骞朵笉娓呮鏄皝杩炴帴浜嗚澶囷紝鍙互杩涜閲嶇疆锛岄噸缃柟寮忚鏌ラ槄璇存槑涔︼紝鏍规嵁鎸囧紩鎿嶄綔銆�
+15842=鎴块棿鍒楄〃
+15843=杩樻病鏈夋坊鍔犲満鏅摝
+15844=杩樻病鏈夋坊鍔犺澶囧摝
+15845=鎴块棿鍚嶇О宸茬粡瀛樺湪
+15846=瀹ゅ唴鏈鸿缃�
+15847=绌鸿皟妯″紡
+15848=鎽嗛
+15849=鍒跺喎
+15850=鍒剁儹
+15851=鑷姩
+15852=閫侀
+15853=闄ゆ箍
+15854=鎵撳紑绌鸿皟澶辫触
+15855=鍏抽棴绌鸿皟澶辫触
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1475,7 +1528,8 @@
18047=鍏变韩鏁版嵁涓嶅瓨鍦�
18048=鍒嗕韩鐨勭洰鏍囪处鍙蜂笉瀛樺湪
18049=鍒嗕韩鏁版嵁鎿嶄綔澶辫触
-18050=涓嶈兘娣诲姞鑷繁涓哄瓙璐﹀彿
+18050=涓嶈兘鎶婅嚜宸辨坊鍔犱负鎴愬憳
+18051=涓嶈兘鎶婁富璐﹀彿娣诲姞涓烘垚鍛�
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囩殑鍏ョ綉姝ラ,浠�21000寮�濮嬧槄鈽呪槄鈽�
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool2.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool2.png
new file mode 100755
index 0000000..f434105
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Cool2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry2.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry2.png
new file mode 100755
index 0000000..7a888b3
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Dry2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan2.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan2.png
new file mode 100755
index 0000000..2bc8a79
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Fan2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat2.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat2.png
new file mode 100755
index 0000000..e5c6cec
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/AC/Mode_Heat2.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColor.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColor.png
new file mode 100755
index 0000000..cbc6eda
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColor.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColorOn.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColorOn.png
new file mode 100755
index 0000000..28f3760
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/BindPic/BindRoomColorOn.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpoint.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpoint.png
index f360c34..2f09584 100755
--- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpoint.png
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpoint.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpointSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpointSelected.png
new file mode 100755
index 0000000..2d86133
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Device/AirConditionerEpointSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png
index 2228105..34011fb 100755
--- a/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/FunctionIcon/2IconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloor.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloor.png
new file mode 100755
index 0000000..9d20b1e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloor.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloorSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloorSelected.png
new file mode 100755
index 0000000..716141b
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/CreatFloorSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/IndoorUnitGround.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/IndoorUnitGround.png
new file mode 100755
index 0000000..a086c67
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/IndoorUnitGround.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/PirSensorLightScale.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/PirSensorLightScale.png
deleted file mode 100755
index 1400c3a..0000000
--- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/PirSensorLightScale.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/PirSensorLightScaleButton.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/PirSensorLightScaleButton.png
deleted file mode 100755
index cd04260..0000000
--- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/PirSensorLightScaleButton.png
+++ /dev/null
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png
index c107a1e..cca18cd 100755
--- a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIcon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIconSelected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIconSelected.png
new file mode 100755
index 0000000..c107a1e
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/RoomIconSelected.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/WarningIcon1.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/WarningIcon1.png
new file mode 100755
index 0000000..d137261
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Item/WarningIcon1.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/SceneIcon.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/SceneIcon.png
new file mode 100755
index 0000000..afa320a
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/SceneIcon.png
Binary files differ
diff --git a/ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/Selected.png b/ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/Selected.png
new file mode 100755
index 0000000..53616fe
--- /dev/null
+++ b/ZigbeeApp/GateWay.Ios/Resources/Phone/Scene/Selected.png
Binary files differ
diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs
index 2554b6b..8857fa6 100755
--- a/ZigbeeApp/Shared/Common/CommonPage.cs
+++ b/ZigbeeApp/Shared/Common/CommonPage.cs
@@ -57,7 +57,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string CodeIDString = "1.0.19101801";
+ public static string CodeIDString = "1.0.19102801";
/// <summary>
/// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee)
/// </summary>
diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs
index 85ac646..15b7c71 100755
--- a/ZigbeeApp/Shared/Common/Device.cs
+++ b/ZigbeeApp/Shared/Common/Device.cs
@@ -223,11 +223,11 @@
/// <param name="zbGateway">缃戝叧瀵硅薄</param>
/// <param name="deviceComingAction">鎺ユ敹鍒拌澶囨椂鐨勪簨浠�,璁惧瀵硅薄涓簄ull鏃�,浠h〃鎺ユ敹瀹屾垚</param>
/// <returns>涓�鐩磋繑鍥瀟rue</returns>
- public async Task<bool> SetDeviceToMemmoryByGateway(ZbGateway zbGateway, Action<CommonDevice> deviceComingAction = null)
+ public bool SetDeviceToMemmoryByGateway(ZbGateway zbGateway, Action<CommonDevice> deviceComingAction = null)
{
//浠庣綉鍏宠幏鍙栧叏閮ㄧ殑璁惧
List<CommonDevice> listDevice = new List<CommonDevice>();
- List<CommonDevice> list = await this.GetDeviceListFromGateway(zbGateway, true, deviceComingAction);
+ List<CommonDevice> list = this.GetDeviceListFromGateway(zbGateway, true, deviceComingAction);
if (list == null)
{
@@ -1007,6 +1007,7 @@
this.GetDeviceIcon(device, ref unSelectFilePath, ref selectFilePath);
btnIcon.UnSelectedImagePath = unSelectFilePath;
+ btnIcon.SelectedImagePath = selectFilePath;
}
/// <summary>
@@ -1706,7 +1707,7 @@
/// <param name="deviceComingAction">鎺ユ敹鍒拌澶囨椂鐨勪簨浠�</param>
/// <param name="mode">鏄惁鏄剧ず閿欒</param>
/// <returns></returns>
- public async Task<List<CommonDevice>> GetDeviceListFromGateway(ZbGateway zbGateway, bool ignoreTime, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES)
+ public List<CommonDevice> GetDeviceListFromGateway(ZbGateway zbGateway, bool ignoreTime, Action<CommonDevice> deviceComingAction = null, ShowErrorMode mode = ShowErrorMode.YES)
{
if (ignoreTime == false)
{
@@ -1813,13 +1814,13 @@
try
{
var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 93 } };
- await realWay.Send("GetDeviceInfo", jObject.ToString());
+ realWay.Send("GetDeviceInfo", jObject.ToString());
}
catch { canBreak = true; }
while (canBreak == false && TimeOut < 60)
{
- await Task.Delay(100);
+ System.Threading.Thread.Sleep(100);
TimeOut++;
}
@@ -2074,7 +2075,7 @@
this.dicDeviceModelIdEnum["H06C"] = "2800-2800";//鏅鸿兘闂ㄩ攣(H06C)
//=========鈽呪槄绌鸿皟绫�(3600-3899)鈽呪槄=========
- this.dicDeviceModelIdEnum["MAC/GW-ZB.431"] = "3600-3600";//zigbee绌鸿皟缃戝叧妯″潡
+ this.dicDeviceModelIdEnum["MAC/GW-ZB.10"] = "3600-3600";//zigbee绌鸿皟缃戝叧妯″潡
//=========鈽呪槄涓户鍣ㄧ被(3900-3999)鈽呪槄=========
this.dicDeviceModelIdEnum["MSR-ZB.10"] = "3900-3900"; //zigbee涓户鍣�
diff --git a/ZigbeeApp/Shared/Common/DeviceUI.cs b/ZigbeeApp/Shared/Common/DeviceUI.cs
index c91f9ec..043cc69 100755
--- a/ZigbeeApp/Shared/Common/DeviceUI.cs
+++ b/ZigbeeApp/Shared/Common/DeviceUI.cs
@@ -312,5 +312,28 @@
}
#endregion
+
+ #region 鈼� 閫氳繃id鑾峰彇鍦烘櫙鍖哄煙_____________
+
+ /// <summary>
+ /// GetZone
+ /// </summary>
+ /// <returns></returns>
+ public string GetZone()
+ {
+ var room = Room.CurrentRoom.GetRoomByDevice(CommonDevice);
+ if (room == null)
+ {
+ return null;
+ }
+ var floorName = Shared.Common.Config.Instance.Home.GetFloorNameById(room.FloorId);
+ if (floorName == null)
+ {
+ return room.Name;
+ }
+ return $"{floorName},{room.Name}";
+ }
+
+ #endregion
}
}
diff --git a/ZigbeeApp/Shared/Common/Room.cs b/ZigbeeApp/Shared/Common/Room.cs
index 363128b..50956db 100755
--- a/ZigbeeApp/Shared/Common/Room.cs
+++ b/ZigbeeApp/Shared/Common/Room.cs
@@ -140,11 +140,28 @@
/// <summary>
/// 鎵�鏈夋埧闂寸殑鎵�鏈夎澶囩被鍨�
- /// 鍏堣皟鐢� GetAllRoomDeviceTypeList()
/// </summary>
/// <value>All room device type list.</value>
[Newtonsoft.Json.JsonIgnore]
- public static List<DeviceType> AllRoomDeviceTypeList = new List<DeviceType> { };
+ public static List<DeviceType> AllRoomDeviceTypeList
+ {
+ get
+ {
+ var typeList = new List<DeviceType> { };
+ foreach (var deviceUI in AllRoomDeviceUIList)
+ {
+ if (deviceUI == null || deviceUI.CommonDevice == null)
+ {
+ continue;
+ }
+ if (!typeList.Contains(deviceUI.CommonDevice.Type))
+ {
+ typeList.Add(deviceUI.CommonDevice.Type);
+ }
+ }
+ return typeList;
+ }
+ }
/// <summary>
/// 鑾峰彇鎵�鏈夋埧闂寸殑鎵�鏈夊満鏅�
@@ -191,11 +208,39 @@
/// <summary>
/// 鑾峰彇鎵�鏈夋埧闂寸殑鎵�鏈夎澶�
- /// 璇峰厛璋冪敤 GetAllRoomDeviceUIList()鏂规硶
/// </summary>
/// <value>All room device UIL ist.</value>
[Newtonsoft.Json.JsonIgnore]
- public static List<DeviceUI> AllRoomDeviceUIList = new List<DeviceUI> { };
+ public static List<DeviceUI> AllRoomDeviceUIList
+ {
+ get
+ {
+ List<DeviceUI> deviceList = new List<DeviceUI>();
+ foreach (var room in Lists)
+ {
+ if (room.IsSharedRoom)
+ {
+ continue;
+ }
+ if (room.DeviceUIList.Count == 0)
+ {
+ continue;
+ }
+ foreach (var device in room.DeviceUIList)
+ {
+ if (device == null || device.CommonDevice == null)
+ {
+ continue;
+ }
+ if (deviceList.Find((obj) => obj.FileName == device.FileName) == null)
+ {
+ deviceList.Add(device);
+ }
+ }
+ }
+ return deviceList;
+ }
+ }
#endregion
@@ -491,7 +536,7 @@
deviceUI.DeviceAddr = device.DeviceAddr;
deviceUI.DeviceEpoint = device.DeviceEpoint;
- return Lists.Find((obj) => obj.DeviceUIFilePathList.Contains(deviceUI.FileName));
+ return Lists.Find((obj) => obj.IsLove == false && obj.DeviceUIFilePathList.Contains(deviceUI.FileName));
}
/// <summary>
@@ -802,39 +847,6 @@
#region 鈼� 鑾峰彇璁惧_________________________
/// <summary>
- /// 鑾峰彇鎵�鏈夋埧闂寸殑鎵�鏈夎澶�
- /// </summary>
- public static void GetAllRoomDeviceUIList()
- {
- List<string> devicePathList = new List<string>();
- //鎵�鏈夋埧闂寸殑鎵�鏈夎澶�
- AllRoomDeviceUIList.Clear();
- foreach (var room in Shared.Common.Room.Lists)
- {
- if(room.IsSharedRoom)
- {
- continue;
- }
- if (room.DeviceUIList.Count == 0)
- {
- continue;
- }
- foreach (var device in room.DeviceUIList)
- {
- if (device == null || device.CommonDevice == null)
- {
- continue;
- }
- if (!devicePathList.Contains(device.FileName))
- {
- AllRoomDeviceUIList.Add(device);
- devicePathList.Add(device.FileName);
- }
- }
- }
- }
-
- /// <summary>
/// 鏍规嵁璁惧鑾峰彇瀹冪殑UI瀵硅薄锛屽鏋滀笉瀛樺湪鍒欐柊寤�
/// </summary>
/// <returns>The device user interface.</returns>
@@ -842,25 +854,6 @@
public DeviceUI GetDeviceUI(CommonDevice device)
{
return Common.LocalDevice.Current.GetDeviceUI(device);
- }
-
- /// <summary>
- /// 閲嶆柊鑾峰彇-鎵�鏈夋埧闂寸殑鎵�鏈夎澶囩被鍨�
- /// </summary>
- public static void GetAllRoomDeviceTypeList()
- {
- AllRoomDeviceTypeList.Clear();
- foreach (var deviceUI in AllRoomDeviceUIList)
- {
- if (deviceUI == null || deviceUI.CommonDevice == null)
- {
- continue;
- }
- if (!AllRoomDeviceTypeList.Contains(deviceUI.CommonDevice.Type))
- {
- AllRoomDeviceTypeList.Add(deviceUI.CommonDevice.Type);
- }
- }
}
/// <summary>
@@ -934,6 +927,36 @@
return typeList;
}
+ /// <summary>
+ /// 鑾峰彇璇ユゼ灞傜殑鍦烘櫙
+ /// </summary>
+ /// <param name="floorId"></param>
+ /// <returns></returns>
+ public List<SceneUI> GetSceneUIsByFloorId(string floorId)
+ {
+ var rooms = GetRoomsByFloorId(floorId);
+ if (rooms == null)
+ {
+ return null;
+ }
+ var sceneList = new List<SceneUI> { };
+ foreach (var r in rooms)
+ {
+ if (r.SceneUIList.Count == 0)
+ {
+ continue;
+ }
+ foreach (var sceneUI in r.SceneUIList)
+ {
+ if (sceneUI == null)
+ {
+ continue;
+ }
+ sceneList.Add(sceneUI);
+ }
+ }
+ return sceneList;
+ }
#endregion
@@ -949,25 +972,21 @@
/// <param name="iconPathType">I鍦烘櫙鑳屾櫙鍥剧墖鏉ユ簮绫诲瀷 鍥剧墖鏉ユ簮 0--鏈湴鍥惧簱 1--鎷嶇収 2--绯荤粺鍥惧簱 榛樿0</param>
public async System.Threading.Tasks.Task<int> AddScene(string sceneName, string sceneIconPath, List<ZigBee.Device.Scene.AddSceneMemberData> commons, int iconPathType = 0)
{
- if (AllRoomSceneUIList.Find(s => s.Name == sceneName) != null)
+ var scenes = GetSceneUIsByFloorId(FloorId);
+ if(scenes!=null && scenes.Count>0)
{
- return -1;
+ if (scenes.Find(s => s.Name == sceneName) != null)
+ {
+ return -1;
+ }
}
+
var getSceneIdAllData = await ZigBee.Device.Scene.GetSceneNewIdAsync(sceneName);
if (getSceneIdAllData == null || getSceneIdAllData.getSceneIdData == null)
{
return 0;
}
var getSceneIdData = getSceneIdAllData.getSceneIdData;
- //寰幆鐩稿悓鎶ラ敊
- foreach (var tempSceneUI in AllRoomSceneUIList)
- {
- if (tempSceneUI.Id == getSceneIdAllData.getSceneIdData.NewScenesId)
- {
- //鍦烘櫙宸插瓨鍦�
- return -1;
- }
- }
bool result = true;
foreach (var common in commons)
@@ -975,12 +994,13 @@
//娣诲姞鏂版垚鍛�
var addSceneMemberData = new ZigBee.Device.Scene.AddSceneMemberData
{
- DeviceAddr = common.DeviceAddr,
Type = common.Type,
+ DeviceAddr = common.DeviceAddr,
Epoint = common.Epoint,
ScenesId = getSceneIdData.NewScenesId,
TaskList = common.TaskList,
DelayTime = common.DelayTime,
+ MemberNumber=common.MemberNumber,
ElseScenesId = common.ElseScenesId
};
//common.ScenesId = getSceneIdData.NewScenesId;
@@ -1030,17 +1050,30 @@
/// <param name="scene">Scene.</param>
public void AddScene(SceneUI scene)
{
- var sceneUI = new SceneUI
- {
- Name = scene.Name,
- Id = scene.Id,
- IconPath = scene.IconPath,
- IconPathType = scene.IconPathType,
- AddSceneMemberDataList = scene.AddSceneMemberDataList
- };
- SceneUIList.Add(sceneUI);
- SceneUIFilePathList.Add(sceneUI.FileName);
- sceneUI.Save();
+ //var sceneUI = new SceneUI
+ //{
+ // Name = scene.Name,
+ // Id = scene.Id,
+ // IconPath = scene.IconPath,
+ // IconPathType = scene.IconPathType,
+ // AddSceneMemberDataList = scene.AddSceneMemberDataList
+ //};
+ SceneUIList.Add(scene);
+ SceneUIFilePathList.Add(scene.FileName);
+ scene.Save();
+ Save();
+ }
+
+ /// <summary>
+ /// 鍒犻櫎鍦烘櫙
+ /// </summary>
+ /// <param name="scene"></param>
+ public void DeleteScene(SceneUI scene)
+ {
+ //scene.IsCollected = false;
+ scene.Save();
+ SceneUIList.Remove(scene);
+ SceneUIFilePathList.Remove(scene.FileName);
Save();
}
@@ -1112,7 +1145,8 @@
ScenesId = sceneUI.Id,
TaskList = addCommon.TaskList,
DelayTime = addCommon.DelayTime,
- ElseScenesId = addCommon.ElseScenesId
+ ElseScenesId = addCommon.ElseScenesId,
+ MemberNumber=addCommon.MemberNumber
};
//娣诲姞鏂版垚鍛� 杩斿洖缁撴灉
var addSceneMemberResponseAllData = await ZigBee.Device.Scene.AddSceneMemberAsync(addSceneMemberData);
@@ -1183,7 +1217,21 @@
}
return null;
}
-
+ /// <summary>
+ /// 鑾峰彇璇ユゼ灞傛墍鏈夊満鏅�
+ /// </summary>
+ /// <param name="floorId"></param>
+ /// <returns></returns>
+ public List<SceneUI> GetSameFloorScenes(string floorId)
+ {
+ List<SceneUI> sceneUIs = new List<SceneUI> { };
+ var rooms= CurrentRoom.GetRoomsByFloorId(floorId);
+ foreach(var r in rooms)
+ {
+ sceneUIs.AddRange(r.SceneUIList);
+ }
+ return sceneUIs;
+ }
#endregion
#region 鈼� 鍒锋柊鍦烘櫙_________________________
diff --git a/ZigbeeApp/Shared/Common/SceneRoomUI.cs b/ZigbeeApp/Shared/Common/SceneRoomUI.cs
index 3692d3f..f60ab23 100755
--- a/ZigbeeApp/Shared/Common/SceneRoomUI.cs
+++ b/ZigbeeApp/Shared/Common/SceneRoomUI.cs
@@ -55,127 +55,6 @@
[Newtonsoft.Json.JsonIgnore]
public static List<SceneRoomUI> AllSceneRoomUIList = new List<SceneRoomUI> { };
- /// <summary>
- /// 缂栬緫鍦烘櫙
- /// </summary>
- /// <param name="sceneUI">sceneUI</param>
- /// <param name="room">Room.</param>
- public static void EditScene(SceneUI sceneUI,Room room)
- {
- Application.RunOnMainThread(async () =>
- {
- try
- {
- CommonPage.Loading.Start();
- //浠庣綉鍏充腑鍙嶅簭鍒楀寲鍑哄搴旂殑鎴块棿璁惧
- var sceneDeviceList = await ZigBee.Device.Scene.GetSceneDeviceListAsync(sceneUI.Id);
- if (sceneDeviceList == null)
- {
- CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheMainGatewayIsNotOnLine);
- //CommonPage.Instance.FailureToServer();
- return;
- }
-
- if (Shared.Common.Room.AllRoomDeviceUIList.Count == 0)
- {
- Shared.Common.Room.GetAllRoomDeviceUIList();
- if (Shared.Common.Room.AllRoomDeviceUIList.Count == 0)
- {
- CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ThisSceneHaveNoDevice);
- }
- //return;
- }
- if (sceneDeviceList.getSceneDeviceListInfo != null)
- {
- var deviceList = sceneDeviceList.getSceneDeviceListInfo.DeviceList;
- //CategoryAddScene.sceneTargetDevicesList?.Clear();
- //绱姞寤舵椂
- int AddedDelayTime = 0;
- if (deviceList != null && Shared.Common.Room.AllRoomDeviceUIList.Count != 0)
- {
- foreach (var sceneDev in deviceList)
- {
- if (sceneDev.Type == 0)
- {
- foreach (var dev in Shared.Common.Room.AllRoomDeviceUIList)
- {
- if (dev == null || dev.CommonDevice == null)
- {
- continue;
- }
- if (dev.CommonDevice.DeviceAddr == sceneDev.DeviceAddr && dev.CommonDevice.DeviceEpoint == sceneDev.Epoint)
- {
- if (sceneDev.DelayTime - AddedDelayTime > 0)
- {
- var sceneTargetDeviceTime = new SceneTargetDeviceUI { Type = 1, DelayTime = sceneDev.DelayTime - AddedDelayTime };
- //CategoryAddScene.sceneTargetDevicesList.Add(sceneTargetDeviceTime);
- //CategoryAddScene.beforeSceneTargetDevicesList.Add(sceneTargetDeviceTime);
-
- var sceneTargetDevice = new SceneTargetDeviceUI { Type = 0, DeviceUI = dev, TaskList = sceneDev.TaskList };
- //CategoryAddScene.sceneTargetDevicesList.Add(sceneTargetDevice);
- //CategoryAddScene.beforeSceneTargetDevicesList.Add(sceneTargetDevice);
- AddedDelayTime = sceneDev.DelayTime;
- }
- else
- {
- var sceneTargetDevice = new SceneTargetDeviceUI { Type = 0, DeviceUI = dev, TaskList = sceneDev.TaskList };
- //CategoryAddScene.sceneTargetDevicesList.Add(sceneTargetDevice);
- //CategoryAddScene.beforeSceneTargetDevicesList.Add(sceneTargetDevice);
- }
- }
- }
- }
- else if (sceneDev.Type == 1)
- {
- string localSceneName = string.Empty;
- var localScene = SceneRoomUI.AllSceneRoomUIList.Find((obj) => obj.sceneUI.Id == sceneDev.ElseScenesId);
- if (localScene != null)
- {
- localSceneName = localScene.sceneUI.Name;
- }
- if (sceneDev.DelayTime - AddedDelayTime > 0)
- {
- var sceneTargetDeviceTime = new SceneTargetDeviceUI { Type = 1, DelayTime = sceneDev.DelayTime - AddedDelayTime };
- //CategoryAddScene.sceneTargetDevicesList.Add(sceneTargetDeviceTime);
- //CategoryAddScene.beforeSceneTargetDevicesList.Add(sceneTargetDeviceTime);
- var sceneTargetDeviceScene = new SceneTargetDeviceUI { Type = 2, ElseScenesId = sceneDev.ElseScenesId, SceneName = localSceneName };
- //CategoryAddScene.sceneTargetDevicesList.Add(sceneTargetDeviceScene);
- //CategoryAddScene.beforeSceneTargetDevicesList.Add(sceneTargetDeviceScene);
- AddedDelayTime = sceneDev.DelayTime;
- }
- else
- {
- var sceneTargetDeviceScene = new SceneTargetDeviceUI { Type = 2, ElseScenesId = sceneDev.ElseScenesId, SceneName = localSceneName };
- //CategoryAddScene.sceneTargetDevicesList.Add(sceneTargetDeviceScene);
- //CategoryAddScene.beforeSceneTargetDevicesList.Add(sceneTargetDeviceScene);
- }
- }
- }
- }
- }
- else
- {
- CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
- }
- var scene = new CategoryAddScene();
- Phone.UserView.HomePage.Instance.AddChidren(scene);
- Phone.UserView.HomePage.Instance.PageIndex += 1;
- //CategoryAddScene.SceneText = sceneUI.Name;
- //scene.curRoom = room;
- //CategoryAddScene.ModifySceneUI = sceneUI;
- //CategoryAddScene.Modify = true;
- //CategoryAddScene.ImagePath = sceneUI.IconPath;
- scene.Show();
- }
- catch (Exception ex)
- {
- System.Console.WriteLine($"缂栬緫鍦烘櫙鍑洪敊---{ex.Message}");
- }
- finally
- {
- CommonPage.Loading.Hide();
- }
- });
- }
+
}
}
diff --git a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs b/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs
index 0f3e214..15739d4 100755
--- a/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs
+++ b/ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs
@@ -12,7 +12,7 @@
public class SceneTargetDeviceUI
{
/// <summary>
- /// 鍦烘櫙娣诲姞瀵硅薄鐨勭被鍨� 榛樿0璁惧 1鏃堕棿娈� 2鍦烘櫙
+ /// 鍦烘櫙娣诲姞瀵硅薄鐨勭被鍨� 榛樿0璁惧 2鏃堕棿娈� 1鍏朵粬鍦烘櫙
/// </summary>
public int Type = 0;
/// <summary>
@@ -25,24 +25,31 @@
/// Type=0 瀛樺湪
/// </summary>
public DeviceUI DeviceUI = new DeviceUI();
+
/// <summary>
+ /// Type=0銆�1銆�2 瀛樺湪
/// 寤舵椂鏃堕棿
- /// Type=1 瀛樺湪
/// </summary>
public int DelayTime = 0;
/// <summary>
+ /// 褰揟ype=2鏃跺瓨鍦�
+ /// 寤舵椂鎵ц搴忓彿锛岃〃绀虹鍑犱釜寤舵椂鍔ㄤ綔
+ /// </summary>
+ public int DelayTimeSerialNumber = 0;
+
+ /// <summary>
/// 閫夋嫨鐨勫満鏅�
- /// Type=2 瀛樺湪
+ /// Type=1 瀛樺湪
/// </summary>
public SceneUI SceneUI = new SceneUI();
/// <summary>
/// 浣滀负鎴愬憳鐨勫叾浠栧満鏅痠d銆�
- /// Type=2 瀛樺湪
+ /// Type=1 瀛樺湪
/// </summary>
public int ElseScenesId = 0;
/// <summary>
/// 鍦烘櫙鍚嶇О
- /// Type=2 瀛樺湪
+ /// Type=1 瀛樺湪
/// </summary>
public string SceneName = string.Empty;
/// <summary>
@@ -56,5 +63,127 @@
return GetHashCode().ToString();
}
}
+
+ /// <summary>
+ /// GetDeviceStatu
+ /// </summary>
+ /// <returns></returns>
+ public string GetDeviceStatu()
+ {
+ if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
+ {
+ if (TaskList.Count == 0)
+ {
+ return null;
+ }
+ if (TaskList[0].Data1 == 1)
+ {
+ return Language.StringByID(R.MyInternationalizationString.Open);
+ }
+ return Language.StringByID(R.MyInternationalizationString.Shut);
+ }
+ else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
+ {
+ if (TaskList.Count == 0)
+ {
+ return null;
+ }
+ if (TaskList[0].Data1 == 1)
+ {
+ return Language.StringByID(R.MyInternationalizationString.Open);
+ }
+ return Language.StringByID(R.MyInternationalizationString.Shut);
+ }
+ else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
+ {
+ if (TaskList.Count == 0)
+ {
+ return null;
+ }
+ if (TaskList[0].Data1 == 0)
+ {
+ return Language.StringByID(R.MyInternationalizationString.Shut);
+ }
+ return $"{(int)(TaskList[0].Data1 * 1.0 / 254 * 100)}%";
+ }
+ else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
+ {
+ if (TaskList.Count == 0)
+ {
+ return null;
+ }
+ if (TaskList[0].Data1 == 0)
+ {
+ return Language.StringByID(R.MyInternationalizationString.Shut);
+ }
+ return $"{TaskList[0].Data1}%";
+ }
+ else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
+ {
+ //娓╁害锛屾ā寮忥紝椋庨��
+ string tempareture = string.Empty;
+ string model = string.Empty;
+ string wind = string.Empty;
+ if (TaskList.Count == 0)
+ {
+ return null;
+ }
+ foreach(var taskListInfo in TaskList)
+ {
+ if(taskListInfo.Data1==3)
+ {
+ if(taskListInfo.Data2==0)
+ {
+ return Language.StringByID(R.MyInternationalizationString.Shut);
+ }
+ else if(taskListInfo.Data2==1)
+ {
+ model = Language.StringByID(R.MyInternationalizationString.Mode_Auto);
+ }
+ else if(taskListInfo.Data2==3)
+ {
+ model = Language.StringByID(R.MyInternationalizationString.Mode_Cool);
+ }
+ else if (taskListInfo.Data2 == 4)
+ {
+ model = Language.StringByID(R.MyInternationalizationString.Mode_Heat);
+ }
+ else if (taskListInfo.Data2 == 7)
+ {
+ model = Language.StringByID(R.MyInternationalizationString.Mode_FanOnly);
+ }
+ else if (taskListInfo.Data2 == 8)
+ {
+ model = Language.StringByID(R.MyInternationalizationString.Mode_Dry);
+ }
+ }
+ else if(taskListInfo.Data1==4 || taskListInfo.Data1==5)
+ {
+ tempareture = $"{ taskListInfo.Data2} 鈩�";
+ }
+ else if (taskListInfo.Data1 == 6)
+ {
+ if (taskListInfo.Data2 == 1)
+ {
+ wind = Language.StringByID(R.MyInternationalizationString.Fan_Low);
+ }
+ else if(taskListInfo.Data2 ==2)
+ {
+ wind = Language.StringByID(R.MyInternationalizationString.Fan_Middle);
+ }
+ else if (taskListInfo.Data2 == 3)
+ {
+ wind = Language.StringByID(R.MyInternationalizationString.Fan_Height);
+ }
+ }
+ }
+ return $"{tempareture},{model},{wind}";
+ }
+
+ else
+ {
+ return null;
+ }
+ }
}
}
diff --git a/ZigbeeApp/Shared/Common/SceneUI.cs b/ZigbeeApp/Shared/Common/SceneUI.cs
index 3c02d15..364b4bb 100755
--- a/ZigbeeApp/Shared/Common/SceneUI.cs
+++ b/ZigbeeApp/Shared/Common/SceneUI.cs
@@ -1,5 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
+using Shared.Phone.Device.Category;
using Shared.Phone.UserCenter;
namespace Shared.Common
@@ -61,10 +62,10 @@
/// 鏍囪瘑褰撳墠鍦烘櫙鏄惁鏄垎浜殑鍦烘櫙
/// </summary>
public bool IsSharedScene = false;
- /// <summary>
- /// 鏄惁鏀惰棌
- /// </summary>
- public bool IsCollected = false;
+ ///// <summary>
+ ///// 鏄惁鏀惰棌
+ ///// </summary>
+ //public bool IsCollected = false;
/// <summary>
/// 寤舵椂鎵ц鏃堕棿--鏁翠釜鍦烘櫙寤舵椂(涓嶆槸寤舵椂鍦烘櫙閲岄潰鐨勬墽琛岀洰鏍�)
@@ -77,6 +78,10 @@
/// 鍦烘櫙鎵ц鐩爣
/// </summary>
public List<ZigBee.Device.Scene.AddSceneMemberData> AddSceneMemberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData> { };
+ ///// <summary>
+ ///// RoomId
+ ///// </summary>
+ //public string RoomId = string.Empty;
#endregion
@@ -93,21 +98,136 @@
#endregion
- #region 鈼� 鏀惰棌____________________________
+ #region 鈼� 閫氳繃id鑾峰彇鍦烘櫙鍖哄煙_________________
/// <summary>
- /// collect
+ /// GetZone
/// </summary>
- /// <param name="collected"></param>
- /// <param name="autoBackup"></param>
- public void Collect(bool collected, bool autoBackup = true)
+ /// <returns></returns>
+ public string GetZone()
{
- IsCollected = collected;
- Save(autoBackup);
+ var room = Room.CurrentRoom.GetRoomBySceneId(Id);
+ if(room==null)
+ {
+ return null;
+ }
+ var floorName = Shared.Common.Config.Instance.Home.GetFloorNameById(room.FloorId);
+ if (floorName == null)
+ {
+ return room.Name;
+ }
+ return $"{floorName},{room.Name}";
}
#endregion
+ #region 鈼� 缂栬緫鍦烘櫙_________________________
+ /// <summary>
+ /// 缂栬緫鍦烘櫙
+ /// </summary>
+ /// <param name="sceneUI">sceneUI</param>
+ /// <param name="room">Room.</param>
+ public static void EditScene(SceneUI sceneUI, Room room)
+ {
+ Application.RunOnMainThread(async () =>
+ {
+ try
+ {
+ var targetList = new List<SceneTargetDeviceUI> { };
+ CommonPage.Loading.Start();
+ //浠庣綉鍏充腑鍙嶅簭鍒楀寲鍑哄搴旂殑鎴块棿璁惧
+ var sceneDeviceList = await ZigBee.Device.Scene.GetSceneDeviceListAsync(sceneUI.Id);
+ if (sceneDeviceList == null)
+ {
+ CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheMainGatewayIsNotOnLine);
+ return;
+ }
+
+ if (Shared.Common.Room.AllRoomDeviceUIList.Count == 0)
+ {
+
+ if (Shared.Common.Room.AllRoomDeviceUIList.Count == 0)
+ {
+ CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ThisSceneHaveNoDevice);
+ }
+ //return;
+ }
+ if (sceneDeviceList.getSceneDeviceListInfo != null)
+ {
+ var deviceList = sceneDeviceList.getSceneDeviceListInfo.DeviceList;
+
+ if (deviceList != null && Room.AllRoomDeviceUIList.Count != 0)
+ {
+ foreach (var sceneDev in deviceList)
+ {
+ if (sceneDev.Type == 0)
+ {
+ var dev = Room.AllRoomDeviceUIList.Find((obj) => obj.DeviceEpoint == sceneDev.Epoint && obj.DeviceAddr == sceneDev.DeviceAddr);
+ if(dev!=null)
+ {
+ var sceneTargetDevice = new SceneTargetDeviceUI {
+ Type = 0,
+ DeviceUI = dev,
+ TaskList = sceneDev.TaskList,
+ DelayTimeSerialNumber= deviceList.IndexOf(sceneDev) + 1
+ };
+
+ targetList.Add(sceneTargetDevice);
+ }
+ }
+ else if (sceneDev.Type == 1)
+ {
+ var localScene = Room.AllRoomSceneUIList.Find((obj) => obj.Id == sceneDev.ElseScenesId);
+ if (localScene != null)
+ {
+ var sceneTargetDeviceScene = new SceneTargetDeviceUI {
+ Type = 1,
+ ElseScenesId = sceneDev.ElseScenesId,
+ SceneName = localScene.Name,
+ SceneUI = localScene,
+ DelayTimeSerialNumber = deviceList.IndexOf(sceneDev) + 1
+ };
+ targetList.Add(sceneTargetDeviceScene);
+ }
+ }
+ else
+ {
+ var sceneTargetDeviceScene = new SceneTargetDeviceUI
+ {
+ Type = 2,
+ DelayTime = sceneDev.DelayTime,
+ DelayTimeSerialNumber = deviceList.IndexOf(sceneDev)+1
+ };
+ targetList.Add(sceneTargetDeviceScene);
+ }
+ }
+ }
+ }
+ else
+ {
+ CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
+ }
+ var scene = new CategoryAddScene();
+ Phone.UserView.HomePage.Instance.AddChidren(scene);
+ Phone.UserView.HomePage.Instance.PageIndex += 1;
+ scene.isModify = true;
+ scene.modifyRoom = room;
+ scene.modifySceneUI = sceneUI;
+ scene.modifySceneTargetDevicesList = targetList;
+ scene.Show();
+ }
+ catch (Exception ex)
+ {
+ System.Console.WriteLine($"缂栬緫鍦烘櫙鍑洪敊---{ex.Message}");
+ }
+ finally
+ {
+ CommonPage.Loading.Hide();
+ }
+ });
+ }
+ #endregion
+
#region 鈼� 淇濆瓨____________________________
/// <summary>
diff --git a/ZigbeeApp/Shared/Common/ZigbeeColor.cs b/ZigbeeApp/Shared/Common/ZigbeeColor.cs
index b05ebc5..3bc8bd6 100755
--- a/ZigbeeApp/Shared/Common/ZigbeeColor.cs
+++ b/ZigbeeApp/Shared/Common/ZigbeeColor.cs
@@ -237,6 +237,14 @@
/// GXCWaveSeekBarColor 0xFFFE4F35
/// </summary>
public uint GXCWaveSeekBarColor = 0xFFFE4F35;
+ /// <summary>
+ /// 0xFFFDB500
+ /// </summary>
+ public uint GXCProgressColor = 0xFFFDB500;
+ /// <summary>
+ /// 0xFFF5F5F5
+ /// </summary>
+ public uint GXCSeekBarBackground = 0xFFF5F5F5;
diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
index 5d34e1f..586446e 100755
--- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -141,14 +141,14 @@
if (deviceUI.CommonDevice.Type == DeviceType.Thermostat)
{
//Thermostat鍔熻兘
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513)
+ if (common.DeviceStatusReport.CluterID == 513)
{
- var attriButeList = (common as ZigBee.Device.AC).DeviceStatusReport.AttriBute;
+ var attriButeList = common.DeviceStatusReport.AttriBute;
if (attriButeList == null || attriButeList.Count == 0)
{
return;
}
- ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
+ ac.DeviceStatusReport = common.DeviceStatusReport;
switch (attriButeList[0].AttributeId)
{
case 0:
@@ -206,14 +206,14 @@
}
}
//Fan Control鍔熻兘
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 514)
+ if (common.DeviceStatusReport.CluterID == 514)
{
- var attriButeList = (common as ZigBee.Device.AC).DeviceStatusReport.AttriBute;
+ var attriButeList = common.DeviceStatusReport.AttriBute;
if (attriButeList == null || attriButeList.Count == 0)
{
return;
}
- ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
+ ac.DeviceStatusReport = common.DeviceStatusReport;
switch (attriButeList[0].AttributeId)
{
case 0:
diff --git a/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs b/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs
index 2e777a0..ecb3c7e 100755
--- a/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AirSwitch/AirSwitchControl.cs
@@ -126,10 +126,10 @@
}
if (deviceUI.CommonDevice.Type == DeviceType.AirSwitch)
{
- if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
- airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
+ airSwitch.DeviceStatusReport = common.DeviceStatusReport;
//璁板綍銆佹洿鏂扮姸鎬�
if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0)
{
@@ -140,7 +140,7 @@
airSwitch.LastDateTime = DateTime.Now;
}
//***鏂版敼***璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID=3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- else if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3)
+ else if (common.DeviceStatusReport.CluterID == 3)
{
var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
airSwitch.IsOnline = 1;
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index 01dd736..9ed8a71 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -90,7 +90,7 @@
/// <summary>
/// 璁惧绫诲瀷RowLayout
/// </summary>
- private RowLayout typeRowLayout;
+ private FrameLayout typeRowLayout;
/// <summary>
/// 妤煎眰
/// </summary>
@@ -162,10 +162,10 @@
{
case DeviceType.OnOffOutput:
//寮�鍏冲姛鑳�
- if ((common as ToggleLight).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var light = deviceUI.CommonDevice as ToggleLight;
- light.DeviceStatusReport = (common as ToggleLight).DeviceStatusReport;
+ light.DeviceStatusReport = common.DeviceStatusReport;
for (int j = 0; j < rowLayout.ChildrenCount; j++)
{
var tempView = rowLayout.GetChildren(j);
@@ -187,7 +187,7 @@
}
}
}
- if ((common as ToggleLight).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var light = deviceUI.CommonDevice as ToggleLight;
light.IsOnline = 1;
@@ -210,10 +210,10 @@
case DeviceType.AirSwitch:
//寮�鍏冲姛鑳�
- if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
- airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
+ airSwitch.DeviceStatusReport = common.DeviceStatusReport;
for (int j = 0; j < rowLayout.ChildrenCount; j++)
{
var tempView = rowLayout.GetChildren(j);
@@ -235,7 +235,7 @@
}
}
}
- if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
airSwitch.IsOnline = 1;
@@ -256,7 +256,7 @@
}
break;
case DeviceType.WindowCoveringDevice:
- if ((common as Rollershade).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var rollerShape = deviceUI.CommonDevice as Rollershade;
//璁板綍鍥炲鏃堕棿
@@ -279,15 +279,15 @@
case DeviceType.Thermostat:
//AC鍔熻兘
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513)
+ if (common.DeviceStatusReport.CluterID == 513)
{
- var attriButeList = (common as ZigBee.Device.AC).DeviceStatusReport.AttriBute;
+ var attriButeList = common.DeviceStatusReport.AttriBute;
if (attriButeList == null || attriButeList.Count == 0)
{
return;
}
var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
- ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
+ ac.DeviceStatusReport = common.DeviceStatusReport;
switch (attriButeList[0].AttributeId)
{
case 0:
@@ -336,7 +336,7 @@
}
}
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
ac.IsOnline = 1;
@@ -358,10 +358,10 @@
break;
case DeviceType.DimmableLight:
//璋冨厜鐏姛鑳�
- if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
- dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
for (int j = 0; j < rowLayout.ChildrenCount; j++)
{
var tempView = rowLayout.GetChildren(j);
@@ -383,7 +383,7 @@
}
}
}
- if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
dimmableLight.IsOnline = 1;
@@ -705,7 +705,7 @@
{
var floors = new SelectFloor ();
AddChidren(floors);
- floors.Init(599,357,Direction.Right);
+ floors.Init(580,330,Direction.Right);
floors.FloorAction += (floorName) =>
{
floorBtn.Text = floorName;
@@ -1006,8 +1006,8 @@
sendedControlCommand = false;
zbGateway.ReportAction += UpdateDeviceControllStatu;
AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
- (send2 as CommonForm.SelectedStatuButton).IsSelected = !(send2 as CommonForm.SelectedStatuButton).IsSelected;
- if ((send2 as CommonForm.SelectedStatuButton).IsSelected)
+ (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+ if ((send2 as Button).IsSelected)
{
light.SwitchControl(1);
}
@@ -1418,10 +1418,9 @@
foreach (var deviceType in Common.Room.GetdeviceTypes(room))
{
- typeRowLayout = new RowLayout()
+ typeRowLayout = new FrameLayout()
{
Width = Application.GetRealWidth(CommonPage.AppRealWidth / 5),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
Tag = deviceType
};
functionTypeScrowView.AddChidren(typeRowLayout);
@@ -1434,19 +1433,14 @@
functionTypeIMG.SetTitle(DeviceUI.GetDeviceTypeName(deviceType));
typeRowLayout.AddChidren(functionTypeIMG);
-
- functionTypeIMG.ImageBtn.MouseUpEventHandler += ShowSameTypeFunction;
- functionTypeIMG.NameBtn.MouseUpEventHandler += ShowSameTypeFunction;
- functionTypeIMG.ImageBG.MouseUpEventHandler += ShowSameTypeFunction;
+ functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
+
if (deviceType == room.DeviceUIList[0].CommonDevice.Type)
{
ShowSameTypeFunction(functionTypeIMG.ImageBtn, null);
}
-
}
-
-
}
}
@@ -1476,11 +1470,10 @@
Button curBtn = new Button();
foreach (var room in Common.Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom())
{
- var row = new RowLayout()
+ var row = new FrameLayout()
{
Width = Application.GetRealWidth(187 + 50),
- Height = Application.GetRealHeight(167),
- LineColor = ZigbeeColor.Current.GXCGrayBackgroundColor
+ Height = Application.GetRealHeight(167)
};
roomFL.AddChidren(row);
@@ -1553,6 +1546,7 @@
/// <param name="room"></param>
public void RefreshScene(Common.Room room)
{
+ functionSceneBodyView.RemoveAll();
var sceneList = room.SceneUIList;
if (sceneList.Count == 0)
{
@@ -1612,20 +1606,48 @@
Width = Application.GetMinRealAverage(65),
Height = Application.GetMinRealAverage(65),
UnSelectedImagePath = "Item/Collection.png",
- SelectedImagePath = "Item/CollectionSelected.png"
+ SelectedImagePath = "Item/CollectionSelected.png",
+ IsSelected = Common.Room.CurrentRoom.GetLoveRoom().SceneUIFilePathList.Contains(scene.FileName),
+ Tag = scene
};
leftFL.AddChidren(collectionBtn);
-
+
var sceneNameBtn = new Button()
{
Width = Application.GetRealWidth(176),
- Height = Application.GetRealHeight(200),
+ Height = Application.GetRealHeight(150),
TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
Text = scene.Name,
Gravity = Gravity.Center,
IsMoreLines = true
};
leftFL.AddChidren(sceneNameBtn);
+
+ var collection = new Button
+ {
+ Tag=scene
+ };
+ leftFL.AddChidren(collection);
+ collection.MouseUpEventHandler += (sender, e) =>
+ {
+ if (room.IsLove)
+ {
+ Common.Room.CurrentRoom.GetLoveRoom().DeleteScene(scene);
+ sceneScrolView.RemoveViewByTag(collectionBtn.Tag);
+ }
+ else
+ {
+ collectionBtn.IsSelected = !collectionBtn.IsSelected;
+ if (collectionBtn.IsSelected)
+ {
+ Common.Room.CurrentRoom.GetLoveRoom().AddScene(scene);
+ }
+ else
+ {
+ Common.Room.CurrentRoom.GetLoveRoom().DeleteScene(scene);
+ }
+ }
+ };
//瀹氭椂
var delayBtn = new RowLayoutDeleteButton
@@ -1638,7 +1660,7 @@
//缂栬緫
var settingBtn = new Device.CommonForm.RowLayoutEditButton()
{
- TextID = R.MyInternationalizationString.Setting,
+ TextID = R.MyInternationalizationString.Editor,
Tag = scene.SceneDelayTime
};
//鍒犻櫎
@@ -1688,83 +1710,75 @@
//鍒犻櫎鍦烘櫙
EventHandler<MouseEventArgs> delEvent = (sender, e) =>
{
- var tip = new CustomAlert { };
- AddChidren(tip);
- tip.Show(Language.StringByID(R.MyInternationalizationString.ConfirmDelete));
-
- //var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.ConfirmDelete), Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
- //alert.Show();
- tip.ResultEventHandler += async (e1) =>
+ if(room.IsLove)
{
- if (e1)
+ Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteScene(scene);
+ sceneScrolView.RemoveViewByTag((sender as Button).Tag);
+ }
+ else
+ {
+ var tip = new CustomAlert { };
+ AddChidren(tip);
+ tip.Show(Language.StringByID(R.MyInternationalizationString.ConfirmDelete));
+
+ //var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.ConfirmDelete), Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
+ //alert.Show();
+ tip.ResultEventHandler += async (e1) =>
{
- //0 绉婚櫎澶辫触 1 绉婚櫎鎴愬姛 2 娌℃湁璇ュ満鏅�
- var removeSceneAllData = await ZigBee.Device.Scene.DeleteSceneAsync(scene.Id);
- if (removeSceneAllData == null || removeSceneAllData.removeSceneData == null)
+ if (e1)
{
- //CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheMainGatewayIsNotOnLine);
- CommonPage.Instance.FailureToServer();
- return;
+ //0 绉婚櫎澶辫触 1 绉婚櫎鎴愬姛 2 娌℃湁璇ュ満鏅�
+ var removeSceneAllData = await ZigBee.Device.Scene.DeleteSceneAsync(scene.Id);
+ if (removeSceneAllData == null || removeSceneAllData.removeSceneData == null)
+ {
+ //CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheMainGatewayIsNotOnLine);
+ CommonPage.Instance.FailureToServer();
+ return;
+ }
+ //1鎴愬姛
+ if (removeSceneAllData.removeSceneData.Result == 1)
+ {
+ room.RemoveScene(scene);
+ //RefreshBodyView();
+ sceneScrolView.RemoveViewByTag((sender as Button).Tag);
+ }
+ //0 绉婚櫎澶辫触
+ else if (removeSceneAllData.removeSceneData.Result == 0)
+ {
+ CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
+ return;
+ }
+ //2 娌℃湁璇ュ満鏅�
+ else if (removeSceneAllData.removeSceneData.Result == 2)
+ {
+ room.RemoveScene(scene);
+ //RefreshBodyView();
+ sceneScrolView.RemoveViewByTag((sender as Button).Tag);
+ CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneIsNull);
+ return;
+ }
}
- //1鎴愬姛
- if (removeSceneAllData.removeSceneData.Result == 1)
- {
- room.RemoveScene(scene);
- //RefreshBodyView();
- sceneScrolView.RemoveViewByTag((sender as Button).Tag);
- }
- //0 绉婚櫎澶辫触
- else if (removeSceneAllData.removeSceneData.Result == 0)
- {
- CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
- return;
- }
- //2 娌℃湁璇ュ満鏅�
- else if (removeSceneAllData.removeSceneData.Result == 2)
- {
- room.RemoveScene(scene);
- //RefreshBodyView();
- sceneScrolView.RemoveViewByTag((sender as Button).Tag);
- CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneIsNull);
- return;
- }
- }
- };
+ };
+ }
+
};
deleteBtn.MouseUpEventHandler += delEvent;
//缂栬緫鍦烘櫙
settingBtn.MouseUpEventHandler += (sender, e) =>
{
- SceneRoomUI.EditScene(scene,room);
+ SceneUI.EditScene(scene, room);
};
//缂栬緫寤舵椂
delayBtn.MouseUpEventHandler += (sender, e) =>
{
- var tList = new List<string>() { };
-
- for (int i = 0; i < 60; i++)
+ var timeSelect = new SelectTime();
+ CommonPage.Instance.AddChidren(timeSelect);
+ timeSelect.TempTime = scene.SceneDelayTime;
+ timeSelect.Init();
+ timeSelect.TimeAction = (t) =>
{
- tList.Add($"{i} {Language.StringByID(R.MyInternationalizationString.Second)}");
- }
- //int beforeIndex = (int)(sender as CommonForm.RowLayoutEditButton).Tag;
- //PickerView.Show(tList, (obj) =>
- //{
- // var tempRoom = Shared.Common.Room.GetRoomByFilePath(sceneRoomUI.room.FileName);
- // if (tempRoom == null)
- // {
- // return;
- // }
- // foreach (var ss in tempRoom.SceneUIList)
- // {
- // if (ss.Id == sceneRoomUI.sceneUI.Id)
- // {
- // //ss.SceneDelayTime = int.Parse(obj.Split(' ')[0]);
- // sceneRoomUI.room.Save();
- // RefreshBodyView();
- // return;
- // }
- // }
- //}, Language.StringByID(R.MyInternationalizationString.Confrim), tList[(int)(sender as CommonForm.RowLayoutEditButton).Tag]);
+ scene.SceneDelayTime = t;
+ };
};
}
}
@@ -1807,7 +1821,7 @@
/// <summary>
/// 鑷姩鍖�
/// </summary>
- public async void ShowAutotion()
+ private async void ShowAutotion()
{
functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
@@ -1975,34 +1989,19 @@
CommonPage.Loading.Start();
if (Common.Logic.LogicList.Count == 0)
{
- //var Idlist = await Logic.Send.GetLogicId();
- //if (Idlist.Count != 0)
- //{
- // foreach (var LogicId in Idlist)
- // {
- // var logic = await Logic.Send.GetLogic(LogicId);
- // if (logic != null)
- // {
- // Common.Logic.LogicList.Add(logic);
- // }
- // }
- //}
- var Idlist = await Logic.Send.GetLogicId();
+ var Idlist = await Logic.Send.GetLogicId(0);
if (Idlist.Count != 0)
{
- var listlogic = await Logic.Send.ReadList(Idlist.Count);
- for (int i = 0; i < Idlist.Count; i++)
+ var listlogic = await Logic.Send.ReadList(Idlist.Count,0);
+ //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆�
+ for (int j = 0; j < listlogic.Count; j++)
{
- var LogicId = Idlist[i];
- //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆�
- for (int j = 0; j < listlogic.Count; j++)
+ var logic = listlogic[j];
+ if (logic.LogicType != 0)
{
- var logic = listlogic[j];
- if (logic.LogicId == LogicId)
- {
- Common.Logic.LogicList.Add(logic);
- }
+ continue;
}
+ Common.Logic.LogicList.Add(logic);
}
}
}
@@ -2015,7 +2014,7 @@
/// 鑷姩鍖栧垪琛ㄧ晫闈�
/// </summary>
/// <param name="refresview">Refresview.</param>
- public async void Automationview(VerticalScrolViewLayout refresview)
+ private async void Automationview(VerticalScrolViewLayout refresview)
{
refresview.RemoveAll();
foreach (var logic in Common.Logic.LogicList)
@@ -2100,7 +2099,7 @@
Text = Language.StringByID(MyInternationalizationString.edit),
TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
};
- bjRow.AddRightView(edit);
+ logicRowlayout.AddRightView(edit);
edit.MouseUpEventHandler += (sender, e) =>
{
Common.Logic.LogicDviceList.Clear();
@@ -2124,7 +2123,7 @@
Text = Language.StringByID(MyInternationalizationString.del),
TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
};
- bjRow.AddRightView(del);
+ logicRowlayout.AddRightView(del);
del.MouseUpEventHandler += (sender, e) =>
{
var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
@@ -2146,8 +2145,6 @@
}
-
- #endregion
#region 鈼� 鎺у埗鐘舵�乢________________________
@@ -2614,5 +2611,6 @@
}
}
}
+ #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
index 48f3418..8d287f2 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
@@ -36,6 +36,10 @@
/// </summary>
private string ImagePath="SceneIcon/1.png";
/// <summary>
+ /// 鍥剧墖鏉ユ簮 0--鏈湴鍥惧簱 1--鎷嶇収 2--绯荤粺鍥惧簱
+ /// </summary>
+ public int IconPathType = 0;
+ /// <summary>
/// curRoom
/// </summary>
private Common.Room curRoom;
@@ -43,23 +47,32 @@
/// sceneTargetDevicesList
/// </summary>
private List<SceneTargetDeviceUI> sceneTargetDevicesList = new List<SceneTargetDeviceUI> { };
-
/// <summary>
/// 娣诲姞鐩爣鍚庣殑灞曠ず鍒楄〃
/// </summary>
public VerticalScrolViewLayout TargetListScrolView;
/// <summary>
- /// 娣诲姞鐨勬墽琛岀洰鏍囩殑琛岄珮
- /// </summary>
- private readonly int TargetListScrolView_RowHeight = 170;
- /// <summary>
/// The confirm button.
/// </summary>
private CommonForm.CompleteButton confirmBtn;
+
/// <summary>
- /// 纭畾鎸夐挳鏈�寮�濮嬬殑鍧愭爣
+ /// 鏄惁淇敼
/// </summary>
- private readonly int ConfirmButton_Y = CommonPage.AppRealHeight - 300;
+ public bool isModify;
+ /// <summary>
+ /// 淇敼鐨勫満鏅�
+ /// </summary>
+ public SceneUI modifySceneUI;
+ /// <summary>
+ /// 璁板綍缂栬緫鍓嶇殑璁惧鍒楄〃
+ /// </summary>
+ public List<SceneTargetDeviceUI> modifySceneTargetDevicesList;
+ /// <summary>
+ /// modifyRoom
+ /// </summary>
+ public Common.Room modifyRoom;
+
#endregion
@@ -69,7 +82,6 @@
public CategoryAddScene()
{
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- Tag = "categoryAddScene";
}
/// <summary>
/// RemoveFromParent
@@ -90,6 +102,13 @@
{
foreach (var targetDevice in sceneTargetDevicesList)
{
+ var targetRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(160),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
+ };
+ TargetListScrolView.AddChidren(targetRowLayout);
string devImgPath = string.Empty;
string devNameText = string.Empty;
if (targetDevice.Type == 0)
@@ -97,70 +116,63 @@
if (targetDevice.DeviceUI == null || targetDevice.DeviceUI.CommonDevice == null) continue;
devImgPath = targetDevice.DeviceUI.IconPath;
devNameText = targetDevice.DeviceUI.CommonDevice.DeviceEpointName;
- }
- else if (targetDevice.Type == 1)
- {
- devImgPath = "Item/Timer.png";
- devNameText = $"{targetDevice.DelayTime} {Language.StringByID(R.MyInternationalizationString.Second)}";
+
+ var targetRow = new SceneTargetFunctionRow(23);
+ targetRowLayout.AddChidren(targetRow);
+ targetRow.Init();
+ targetRow.SetIcon(devImgPath);
+ targetRow.SetNameText(devNameText);
+ targetRow.SetZoneText(targetDevice.DeviceUI.GetZone());
+ targetRow.SetStatuText(targetDevice.GetDeviceStatu());
}
else if (targetDevice.Type == 2)
{
- devImgPath = "Item/Scene.png";
- devNameText = targetDevice.SceneName;
+ if(targetDevice.DelayTime<60)
+ {
+ devNameText = $"{targetDevice.DelayTime} {Language.StringByID(R.MyInternationalizationString.Second)}";
+ }
+ else
+ {
+ devNameText = $"{targetDevice.DelayTime / 60} {Language.StringByID(R.MyInternationalizationString.Minute)} {targetDevice.DelayTime % 60} {Language.StringByID(R.MyInternationalizationString.Second)}";
+ }
+ devNameText += Language.StringByID(R.MyInternationalizationString.Later);
+ var targetRow = new SceneTargetTimeRow(23);
+ targetRowLayout.AddChidren(targetRow);
+ targetRow.Init();
+ targetRow.SetTitle(devNameText);
}
- var targetRowLayout = new RowLayout()
+ else if (targetDevice.Type == 1)
{
- Height = Application.GetRealHeight(160),
- LineColor = ZigbeeColor.Current.GXCLineColor,
- BackgroundColor=ZigbeeColor.Current.GXCBackgroundColor
- };
- TargetListScrolView.AddChidren(targetRowLayout);
+ devImgPath = "Scene/SceneIcon.png";
+ devNameText = targetDevice.SceneName;
- var targetFL = new FrameLayout()
+ var targetRow = new SceneTargetFunctionRow(23);
+ targetRowLayout.AddChidren(targetRow);
+ targetRow.Init();
+ targetRow.SetIcon(devImgPath);
+ targetRow.SetNameText(devNameText);
+ targetRow.SetZoneText(targetDevice.SceneUI.GetZone());
+ }
+
+
+ var editBtn = new Button()
{
-
+ BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor,
+ TextID = R.MyInternationalizationString.Edit,
+ TextColor = ZigbeeColor.Current.GXCTextWhiteColor
};
- targetRowLayout.AddChidren(targetFL);
-
- var devIMG = new Button()
- {
- X = Application.GetRealWidth(CommonPage.XLeft),
- Width = Application.GetMinRealAverage(110),
- Height = Application.GetMinRealAverage(110),
- UnSelectedImagePath = devImgPath,
- Gravity = Gravity.CenterVertical
- };
- targetRowLayout.AddChidren(devIMG);
- var devName = new Button()
- {
- X = devIMG.Right,
- Width = Application.GetRealWidth(500),
- Height = Application.GetRealHeight(100),
- Gravity = Gravity.CenterVertical,
- Text = devNameText,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft
- };
- targetRowLayout.AddChidren(devName);
- var devTimer = new Button()
- {
- X = targetRowLayout.Width - Application.GetRealWidth(150),
- Width = Application.GetMinRealAverage(110),
- Height = Application.GetMinRealAverage(110),
- UnSelectedImagePath = "Item/Timer.png",
- Gravity = Gravity.CenterVertical
- };
- /////******鏆傛椂鍏堜笉鍔犲欢鏃讹紝瀹夊崜鎺т欢鏈夐棶棰�*******////
- //targetRowLayout.AddChidren(devTimer);
- var devRight = new Button()
+ targetRowLayout.AddRightView(editBtn);
+ //缂栬緫璁惧
+ editBtn.MouseUpEventHandler += detailMouseUpEventHandler;
+ var delBtn = new Button()
{
BackgroundColor = ZigbeeColor.Current.GXCRedColor,
TextID = R.MyInternationalizationString.Delete,
TextColor = ZigbeeColor.Current.GXCTextWhiteColor
};
- targetRowLayout.AddRightView(devRight);
+ targetRowLayout.AddRightView(delBtn);
//鍒犻櫎璁惧
- devRight.MouseUpEventHandler += (sender, e) =>
+ delBtn.MouseUpEventHandler += (sender, e) =>
{
sceneTargetDevicesList.Remove(targetDevice);
RefreshTargetListView();
@@ -176,79 +188,33 @@
{
return;
}
- if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
- {
- //寮�鍏崇伅
- var taskList = targetDevice.TaskList;
- if (taskList.Count == 0)
- {
- return;
- }
- var detail = new CategorySceneSelectLightSetting();
- UserView.HomePage.Instance.AddChidren(detail);
- UserView.HomePage.Instance.PageIndex += 1;
- detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1);
- }
- else if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
- {
- //绌烘皵寮�鍏�
- var taskList = targetDevice.TaskList;
- if (taskList.Count == 0)
- {
- return;
- }
- var detail = new CategorySceneSelectAirSwitchSetting();
- UserView.HomePage.Instance.AddChidren(detail);
- UserView.HomePage.Instance.PageIndex += 1;
- detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1);
- }
- else if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
- {
- //鍗峰笜
- var taskList = targetDevice.TaskList;
- if (taskList.Count == 0)
- {
- return;
- }
- var detail = new CategorySceneSelectCurtainSetting();
- UserView.HomePage.Instance.AddChidren(detail);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1, taskList[0].Data2);
- }
- else if (targetDevice.DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
- {
- //璋冨厜鐏�
- var taskList = targetDevice.TaskList;
- if (taskList.Count == 0)
- {
- return;
- }
- var detail = new CategorySceneSelectedDimmableLightSetting();
- UserView.HomePage.Instance.AddChidren(detail);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- if (taskList[0].TaskType == 1)
- {
- detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].Data1, taskList[0].Data2);
- }
- else if (taskList[0].TaskType == 3)
- {
- detail.Show(targetDevice.DeviceUI, targetDevice.SceneTargetDeviceUIID, taskList[0].TaskType, taskList[0].Data1);
+ var deviceView = new SelectDevice();
+ UserView.HomePage.Instance.AddChidren(deviceView);
+ UserView.HomePage.Instance.PageIndex += 1;
+ deviceView.sceneTargetDevice = targetDevice;
+ deviceView.deviceUI = targetDevice.DeviceUI;
+ deviceView.Show();
+ deviceView.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 == 1)
+ 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) =>
{
@@ -261,18 +227,29 @@
};
}
//鍦烘櫙
- else if (targetDevice.Type == 2)
+ else if (targetDevice.Type == 1)
{
- var sceneView = new CategorySceneSelectedScene();
+ var sceneView = new SelectScene();
UserView.HomePage.Instance.AddChidren(sceneView);
UserView.HomePage.Instance.PageIndex += 1;
- sceneView.Show(sceneTargetDevicesList, 1, targetDevice.SceneTargetDeviceUIID);
+ sceneView.sceneTargetDevice = targetDevice;
+ sceneView.sceneUI = targetDevice.SceneUI;
+ 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();
+ };
}
}
- devIMG.MouseUpEventHandler += detailMouseUpEventHandler;
- devName.MouseUpEventHandler += detailMouseUpEventHandler;
- targetRowLayout.MouseUpEventHandler += detailMouseUpEventHandler;
- targetFL.MouseUpEventHandler += detailMouseUpEventHandler;
+
+
}
}
}
@@ -316,7 +293,14 @@
var top = new TopFrameLayout();
AddChidren(top);
top.InitTopview();
- top.SetTopTitle(R.MyInternationalizationString.AddScence);
+ if(isModify)
+ {
+ top.SetTopTitle(R.MyInternationalizationString.EditorScene);
+ }
+ else
+ {
+ top.SetTopTitle(R.MyInternationalizationString.AddScence);
+ }
top.backButton.MouseUpEventHandler += (sender, e) =>
{
RemoveFromParent();
@@ -442,14 +426,24 @@
//娣诲姞鐩爣鍚庣殑灞曠ず鍒楄〃
TargetListScrolView = new VerticalScrolViewLayout()
{
- Y = targetLine.Bottom,
- Height = Application.GetRealHeight(730-127),
+ Y = Application.GetRealHeight(49+127),
+ Height = Application.GetRealHeight(730-127-49),
//BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
};
targetFL.AddChidren(TargetListScrolView);
confirmBtn = new CommonForm.CompleteButton(1656, 907, 127);
AddChidren(confirmBtn);
+
+ if(isModify)
+ {
+ backGround.UnSelectedImagePath = modifySceneUI.IconPath;
+ nameRow.SetTitle(modifySceneUI.Name);
+ zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(modifyRoom.FloorId)},{modifyRoom.Name}");
+ IconPathType = modifySceneUI.IconPathType;
+ curRoom = modifyRoom;
+ sceneTargetDevicesList.AddRange(modifySceneTargetDevicesList);
+ }
RefreshTargetListView();
@@ -473,14 +467,14 @@
Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
localPic.Show();
- localPic.action = () =>
+ localPic.action = (imgPath) =>
{
- backGround.UnSelectedImagePath = ImagePath;
+ IconPathType = 0;
+ backGround.UnSelectedImagePath = imgPath;
};
};
backGround.MouseUpEventHandler += backGroundIMGHander;
-
//鍖哄煙
EventHandler<MouseEventArgs> zoneHander = (sender, e) =>
@@ -588,26 +582,32 @@
selectedFunctionBtn.MouseUpEventHandler += (send, ee) =>
{
selectFL.RemoveFromParent();
- var deviceTypeList = new CategorySceneSelectDevice();
- UserView.HomePage.Instance.AddChidren(deviceTypeList);
+ var deviceView = new SelectDevice();
+ UserView.HomePage.Instance.AddChidren(deviceView);
UserView.HomePage.Instance.PageIndex += 1;
- deviceTypeList.Show(sceneTargetDevicesList);
+ deviceView.beforeSceneTargetDeviceUIs = sceneTargetDevicesList;
+ deviceView.Show();
+ deviceView.selectedAction = (selectedDevice) =>
+ {
+ sceneTargetDevicesList.Add(selectedDevice);
+ RefreshTargetListView();
+ };
};
//娣诲姞鍦烘櫙
selectedSceneBtn.MouseUpEventHandler += (send, ee) =>
{
selectFL.RemoveFromParent();
- var sceneView = new CategorySceneSelectedScene();
+ var sceneView = new SelectScene();
UserView.HomePage.Instance.AddChidren(sceneView);
UserView.HomePage.Instance.PageIndex += 1;
- //if (Modify)
- //{
- // sceneView.Show(sceneTargetDevicesList, -1, "", false, ModifySceneUI.Id);
- //}
- //else
- //{
- // sceneView.Show(sceneTargetDevicesList);
- //}
+ sceneView.beforeSceneTargetDeviceUIs = sceneTargetDevicesList;
+ sceneView.Show();
+ sceneView.selectedAction = (selectedScene) =>
+ {
+ sceneTargetDevicesList.Add(selectedScene);
+ RefreshTargetListView();
+ };
+
};
//娣诲姞鏃堕棿闂撮殧
selectedTimerBtn.MouseUpEventHandler += (send, ee) =>
@@ -651,123 +651,281 @@
return;
}
- //鏂板
- if (string.IsNullOrEmpty(nameRow.NameText.Text))
+ if(isModify)
{
- var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close));
- alert.Show();
- alert.ResultEventHandler += (sendAlert, eAlert) =>
+ if (string.IsNullOrEmpty(nameRow.NameText.Text))
{
- return;
- };
+ var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close));
+ alert.Show();
+ alert.ResultEventHandler += (sendAlert, eAlert) =>
+ {
+ return;
+ };
+ }
+ else
+ {
+ try
+ {
+ //鏀瑰悕
+ if (modifySceneUI.Name != nameRow.NameText.Text.Trim())
+ {
+ if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
+ {
+ Common.CommonPage.Instance.ShowErrorInfoAlert(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(IconPathType==1 || IconPathType ==2)
+ {
+
+ }
+
+ 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 || sceneTarget.DeviceUI.CommonDevice == null)
+ {
+ continue;
+ }
+ var memberData = new AddSceneMemberData
+ {
+ Type = 0,
+ ScenesId = 0,
+ DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr,
+ Epoint = sceneTarget.DeviceUI.CommonDevice.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 || sceneTarget.DeviceUI.CommonDevice == null)
+ {
+ continue;
+ }
+ var removeDevice = new RemoveSceneDeviceListInfo
+ {
+ Type = 0,
+ DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr,
+ Epoint = sceneTarget.DeviceUI.CommonDevice.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 curRoom.ModifyScene(modifySceneUI, sceneRemoveMemberData, memberDataList);
+ if (result == 1)
+ {
+ if (modifyRoom != curRoom)
+ {
+ modifyRoom.SceneUIList.Remove(modifySceneUI);
+ modifyRoom.SceneUIFilePathList.Remove(modifySceneUI.FileName);
+ curRoom.SceneUIList.Add(modifySceneUI);
+ curRoom.SceneUIFilePathList.Add(modifySceneUI.FileName);
+ modifyRoom.Save();
+ curRoom.Save();
+ }
+ RemoveFromParent();
+ }
+ else if (result == 0)
+ {
+ //澶辫触
+ Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
+ }
+ else if (result == -1)
+ {
+ //宸插瓨鍦�
+ Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist);
+ }
+ }
+ catch (Exception ex)
+ {
+ System.Console.WriteLine($"鍒嗙被娣诲姞鍦烘櫙鍑洪敊{ex.Message}");
+ }
+ finally
+ {
+ CommonPage.Loading.Hide();
+ }
+ }
}
else
{
- try
+ //鏂板
+ if (string.IsNullOrEmpty(nameRow.NameText.Text))
{
- if (Shared.Common.Room.AllRoomSceneUIList.Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
+ var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.SceneNameCannotBeNull), Language.StringByID(R.MyInternationalizationString.Close));
+ alert.Show();
+ alert.ResultEventHandler += (sendAlert, eAlert) =>
{
- Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist);
return;
- }
- CommonPage.Loading.Start();
- var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>();
- //绱姞寤舵椂
- int AddedDelayTime = 0;
- for (int i = 0; i < sceneTargetDevicesList.Count; i++)
- {
- var sceneTarget = sceneTargetDevicesList[i];
- SceneTargetDeviceUI beforeSceneTarget = null;
- if (i - 1 >= 0)
- {
- beforeSceneTarget = sceneTargetDevicesList[i - 1];
- }
- if (sceneTarget.Type == 0)
- {
- if (sceneTarget.DeviceUI == null || sceneTarget.DeviceUI.CommonDevice == null)
- {
- continue;
- }
-
- if (beforeSceneTarget != null && beforeSceneTarget.Type == 1)
- {
- if (i - 1 >= 0)
- {
- for (int k = i - 1; k >= 0; k--)
- {
- if (sceneTargetDevicesList[k] == null || sceneTargetDevicesList[k].Type != 1)
- {
- break;
- }
- AddedDelayTime += sceneTargetDevicesList[k].DelayTime;
- }
- }
- }
-
- var memberData = new ZigBee.Device.Scene.AddSceneMemberData
- {
- DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr,
- Type = 0,
- ScenesId = 0,
- Epoint = sceneTarget.DeviceUI.CommonDevice.DeviceEpoint,
- TaskList = sceneTarget.TaskList,
- DelayTime = AddedDelayTime
- };
- memberDataList.Add(memberData);
- }
- else if (sceneTarget.Type == 2)
- {
- if (beforeSceneTarget != null && beforeSceneTarget.Type == 1)
- {
- if (i - 1 >= 0)
- {
- for (int k = i - 1; k >= 0; k--)
- {
- if (sceneTargetDevicesList[k] == null || sceneTargetDevicesList[k].Type != 1)
- {
- break;
- }
- AddedDelayTime += sceneTargetDevicesList[k].DelayTime;
- }
- }
- }
- var memberData = new ZigBee.Device.Scene.AddSceneMemberData
- {
- Type = 1,
- ScenesId = 0,
- ElseScenesId = sceneTarget.ElseScenesId,
- DelayTime = AddedDelayTime
- };
- memberDataList.Add(memberData);
- }
- }
-
- var result = await curRoom.AddScene(nameRow.NameText.Text, backGround.UnSelectedImagePath, memberDataList);
- if (result == 1)
- {
- RemoveFromParent();
- }
- else if (result == 0)
- {
- //澶辫触
- CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.AddSceneFail);
- }
- else if (result == -1)
- {
- //宸插瓨鍦�
- CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist);
- }
+ };
}
- catch (Exception ex)
+ else
{
- System.Console.WriteLine($"鍒嗙被娣诲姞鍦烘櫙鍑洪敊{ex.Message}");
- }
- finally
- {
- CommonPage.Loading.Hide();
- }
+ try
+ {
+ if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
+ {
+ Common.CommonPage.Instance.ShowErrorInfoAlert(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 || sceneTarget.DeviceUI.CommonDevice == null)
+ {
+ continue;
+ }
+ var memberData = new AddSceneMemberData
+ {
+ Type = 0,
+ ScenesId = 0,
+ DeviceAddr = sceneTarget.DeviceUI.CommonDevice.DeviceAddr,
+ Epoint = sceneTarget.DeviceUI.CommonDevice.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 curRoom.AddScene(nameRow.NameText.Text, backGround.UnSelectedImagePath, memberDataList);
+ if (result == 1)
+ {
+ RemoveFromParent();
+ }
+ else if (result == 0)
+ {
+ //澶辫触
+ CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.AddSceneFail);
+ }
+ else if (result == -1)
+ {
+ //宸插瓨鍦�
+ CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist);
+ }
+ }
+ catch (Exception ex)
+ {
+ System.Console.WriteLine($"鍒嗙被娣诲姞鍦烘櫙鍑洪敊{ex.Message}");
+ }
+ finally
+ {
+ CommonPage.Loading.Hide();
+ }
+
+ }
}
+
+
};
#endregion
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs
index a718558..d166540 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/CategorySceneSelectImgByLocal.cs
@@ -12,8 +12,7 @@
/// </summary>
private FrameLayout bodyFrameLayout;
-
- public Action action;
+ public Action<string> action;
public CategorySceneSelectImgByLocal()
{
@@ -95,8 +94,8 @@
EventHandler<MouseEventArgs> selectIcon = (sender, e) =>
{
//CategoryAddScene.ImagePath = icon.UnSelectedImagePath;
- Room.AddRoomScene.ImagePath = icon.UnSelectedImagePath;
- action?.Invoke();
+ //Room.AddRoomScene.ImagePath = icon.UnSelectedImagePath;
+ action?.Invoke(icon.UnSelectedImagePath);
action = null;
this.RemoveFromParent();
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectDelayTime.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectDelayTime.cs
index 8a34d39..dac1b70 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectDelayTime.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectDelayTime.cs
@@ -15,7 +15,7 @@
/// <summary>
/// totalSecond
/// </summary>
- private int totalSecond;
+ public int totalSecond;
/// <summary>
/// selectedTimeAction
/// </summary>
@@ -23,52 +23,38 @@
#endregion
+ /// <summary>
+ /// SelectDelayTime
+ /// </summary>
public SelectDelayTime()
{
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
- Tag = "categoryAddScene";
+ //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 = 1 };
+ sceneTargetDevice = new SceneTargetDeviceUI { Type = 2 };
}
AddTop();
AddBodyView();
-
-
-
- void selectTimeMouseUpEvent(object sender, MouseEventArgs e)
- {
- //if (!string.IsNullOrEmpty(targetDeviceID))
- //{
- //var targetDeviceUI = CategoryAddScene.sceneTargetDevicesList.Find((obj) => obj.SceneTargetDeviceUIID == targetDeviceID);
- // if (targetDeviceUI != null)
- // {
- // targetDeviceUI.DelayTime= SceneTargetDevice.DelayTime;
- // targetDeviceUI.Type = SceneTargetDevice.Type;
- // }
- //}
- //UserView.HomePage.Instance.RemoveViewByTag("categoryAddScene");
- //var categoryAddScene = new CategoryAddScene();
- //UserView.HomePage.Instance.AddChidren(categoryAddScene);
- //UserView.HomePage.Instance.PageIndex += 1;
- //categoryAddScene.Show();
- }
-
-
-
-
}
@@ -104,20 +90,20 @@
var bg1 = new FrameLayout
{
Y = Application.GetRealHeight(118),
- Height = Application.GetRealHeight(207),
- Width = Application.GetRealWidth(207),
+ Height = Application.GetMinRealAverage(207),
+ Width = Application.GetMinRealAverage(207),
Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetRealHeight(207 / 2),
+ Radius = (uint)Application.GetMinRealAverage(207 / 2),
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
};
bodyFrameLayout.AddChidren(bg1);
var bg2 = new FrameLayout
{
- Height = Application.GetRealHeight(184),
- Width = Application.GetRealWidth(184),
+ Height = Application.GetMinRealAverage(184),
+ Width = Application.GetMinRealAverage(184),
Gravity = Gravity.Center,
- Radius = (uint)Application.GetRealHeight(184 / 2),
+ Radius = (uint)Application.GetMinRealAverage(184 / 2),
BackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor,
};
bg1.AddChidren(bg2);
@@ -181,6 +167,8 @@
pickView.setNPicker(minuStrList, secStrList, null);
+ pickView.setCurrentItems(totalSecond / 60, totalSecond % 60, 0);
+
pickView.OnSelectChangeEvent += (l1, l2, l3) =>
{
totalSecond = minuList[l1] * 60 + secList[l2];
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
new file mode 100755
index 0000000..bb2ee90
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
@@ -0,0 +1,1160 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.Phone.Device.CommonForm;
+using Shared.Phone.UserView;
+
+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>
+ /// 閫夋嫨妤煎眰
+ /// </summary>
+ private Button selectFloorBtn;
+ /// <summary>
+ /// 鍦烘櫙鍔熻兘涓儴鑳屾櫙bodyView
+ /// </summary>
+ public FrameLayout functionSceneBodyView;
+ /// <summary>
+ /// deviceUI
+ /// </summary>
+ public DeviceUI 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;
+
+
+ #endregion
+
+ 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()
+ {
+ if (sceneTargetDevice == null)
+ {
+ sceneTargetDevice = new SceneTargetDeviceUI { Type = 0 };
+ }
+ AddTop();
+
+ AddBodyView();
+
+ RefreshBodyView();
+ }
+
+
+ #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,
+ };
+
+ 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.Init(580, 184, Direction.Right);
+ floors.FloorAction += (floorName) =>
+ {
+ floorBtn.Text = floorName;
+ RefreshBodyView();
+ };
+ }
+ /// <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()
+ {
+ AddRoomView();
+ }
+
+ /// <summary>
+ /// AddRoomView
+ /// </summary>
+ private void AddRoomView()
+ {
+ 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(910 + 622),
+ BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
+ };
+ bodyFrameLayout.AddChidren(functionSceneBodyView);
+
+ Button curBtn = new Button();
+ foreach (var room in Common.Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom())
+ {
+ var row = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(187 + 50),
+ Height = Application.GetRealHeight(204),
+ };
+ roomFL.AddChidren(row);
+
+ var roomBtn = new Button()
+ {
+ Width = Application.GetRealWidth(187),
+ Height = Application.GetRealHeight(78),
+ Radius = (uint)Application.GetRealHeight(78 / 2),
+ Gravity = Gravity.Center,
+ Text = room.Name,
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+ SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+ BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor3,
+ SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
+ BorderColor = ZigbeeColor.Current.GXCBorderUnSelectedColor,
+ BorderWidth = 1
+ };
+ row.AddChidren(roomBtn);
+
+ if (room.IsLove)
+ {
+ roomBtn.IsSelected = true;
+ curBtn = roomBtn;
+
+ RefreshFunction(room);
+ }
+ roomBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ if ((sender as Button) == curBtn)
+ {
+ return;
+ }
+ (sender as Button).IsSelected = true;
+ curBtn.IsSelected = false;
+ curBtn = sender as Button;
+
+ RefreshFunction(room);
+ };
+ }
+
+ if (deviceUI != null)
+ {
+ ShowSelectAction(deviceUI, sceneTargetDevice);
+ }
+ }
+
+
+ /// <summary>
+ /// RefreshFunction
+ /// </summary>
+ /// <param name="room"></param>
+ private void RefreshFunction(Common.Room room)
+ {
+ functionSceneBodyView.RemoveAll();
+
+ if (room.DeviceUIList.Count == 0)
+ {
+ ShowNoFunctionTip();
+ }
+ else
+ {
+ functionTypeScrowView = new HorizontalScrolViewLayout
+ {
+ X = Application.GetRealWidth(CommonFormResouce.X_Left),
+ Height = Application.GetRealHeight(279),
+ Width = Application.GetRealWidth(1028),
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
+ };
+ functionSceneBodyView.AddChidren(functionTypeScrowView);
+
+ deviceListScrolView = new VerticalScrolViewLayout
+ {
+ X = Application.GetRealWidth(CommonFormResouce.X_Left),
+ Y = functionTypeScrowView.Bottom + Application.GetRealHeight(50),
+ Width = Application.GetRealWidth(1028),
+ Height = functionSceneBodyView.Height - Application.GetRealHeight(279 + 50) - 1,
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
+ };
+ functionSceneBodyView.AddChidren(deviceListScrolView);
+ tempFunctionTypeBtn = new FunctionButton();
+
+ EventHandler<MouseEventArgs> 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<DeviceUI> { };
+ foreach (var devieceUI in room.DeviceUIList)
+ {
+ if (devieceUI == null || devieceUI.CommonDevice == null)
+ {
+ continue;
+ }
+ if (devieceUI.CommonDevice.Type.ToString() == (typeSender as Button).Tag.ToString())
+ {
+ if (!sameTypeList.Contains(devieceUI))
+ {
+ sameTypeList.Add(devieceUI);
+ }
+ }
+ }
+ 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);
+ deviceTypeRowLayout.AddChidren(deviceRow);
+ deviceRow.Init(device.IconPath, device.OnlineIconPath,true);
+ deviceRow.SetTitle(device.CommonDevice.DeviceEpointName);
+ deviceRow.SetStatu(device.CommonDevice.IsOnline == 1);
+ deviceRow.HideSwitchBtn(false);
+
+ deviceRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ ShowSelectAction(device, sceneTargetDevice);
+ };
+ }
+ };
+
+ foreach (var deviceType in Common.Room.GetdeviceTypes(room))
+ {
+ typeRowLayout = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(CommonPage.AppRealWidth / 5),
+ Tag = deviceType
+ };
+ functionTypeScrowView.AddChidren(typeRowLayout);
+
+ functionTypeIMG = new FunctionButton()
+ {
+ Tag = deviceType
+ };
+ functionTypeIMG.Init(DeviceUI.GetDeviceTypeUnSelectedImagePath(deviceType), DeviceUI.GetDeviceTypeUnSelectedImagePath(deviceType));
+ functionTypeIMG.SetTitle(DeviceUI.GetDeviceTypeName(deviceType));
+ typeRowLayout.AddChidren(functionTypeIMG);
+
+ functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
+
+
+ if (deviceType == room.DeviceUIList[0].CommonDevice.Type)
+ {
+ ShowSameTypeFunction(functionTypeIMG.ClickBtn, null);
+ }
+ }
+ }
+ }
+
+ /// <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(DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ {
+ var dialog = new FrameLayout()
+ {
+ BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
+ };
+ AddChidren(dialog);
+
+ dialog.MouseUpEventHandler += (sender, e) =>
+ {
+ dialog.RemoveFromParent();
+ };
+
+ if (device.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
+ {
+ SelectOnoffOutput(dialog, device, sceneTarget);
+ }
+ else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
+ {
+ SelectOnoffOutput(dialog, device, sceneTarget);
+ }
+ else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
+ {
+ SelectDimmableLight(dialog, device, sceneTarget);
+ }
+ else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
+ {
+ SelectWindowCoveringDevice(dialog, device, sceneTarget);
+ }
+ else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
+ {
+ SelectWindowCoveringDevice(dialog, device, sceneTarget);
+ }
+ }
+
+ /// <summary>
+ /// 鐏厜
+ /// </summary>
+ /// <param name="dialog"></param>
+ /// <param name="device"></param>
+ /// <param name="sceneTarget"></param>
+ private void SelectOnoffOutput(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ {
+ var selectFL = new FrameLayout
+ {
+ Y = Application.GetRealHeight(1391),
+ Height = Application.GetRealHeight(530),
+ };
+ dialog.AddChidren(selectFL);
+
+ var titleBG = new FrameLayout
+ {
+ Height = Application.GetRealHeight(138 * 2),
+ Radius = (uint)Application.GetRealHeight(20),
+ 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 = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.Cancel
+ };
+ titleFL.AddChidren(cancleBtn);
+
+ var deviceName = new Button
+ {
+ Width = Application.GetRealWidth(400),
+ Gravity = Gravity.CenterHorizontal,
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextSize = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = device.CommonDevice.DeviceEpointName
+ };
+ titleFL.AddChidren(deviceName);
+
+ var comfrimBtn = new Button
+ {
+ X = Application.GetRealWidth(800),
+ Width = Application.GetRealWidth(200),
+ TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
+ TextSize = 15,
+ 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<ZigBee.Device.Scene.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 ZigBee.Device.Scene.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, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ {
+ var selectFL = new FrameLayout
+ {
+ Y = Application.GetRealHeight(1169),
+ Height = Application.GetRealHeight(752),
+ };
+ dialog.AddChidren(selectFL);
+
+ var titleBG = new FrameLayout
+ {
+ Height = Application.GetRealHeight(138 * 2),
+ Radius = (uint)Application.GetRealHeight(20),
+ 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 = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.Cancel
+ };
+ titleFL.AddChidren(cancleBtn);
+
+ var deviceName = new Button
+ {
+ Width = Application.GetRealWidth(400),
+ Gravity = Gravity.CenterHorizontal,
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextSize = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = device.CommonDevice.DeviceEpointName
+ };
+ titleFL.AddChidren(deviceName);
+
+ var comfrimBtn = new Button
+ {
+ X = Application.GetRealWidth(800),
+ Width = Application.GetRealWidth(200),
+ TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
+ TextSize = 15,
+ 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.ProgressChanged += (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.SetProgress(sceneTarget.TaskList[0].Data1);
+ }
+ }
+
+ comfrimBtn.MouseUpEventHandler = (sender, e) =>
+ {
+ var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+
+ int taskType = 6;
+ int data1 = 0;
+ int data2 = 0;
+
+ if (shut.IsSelected)
+ {
+ //鍏�
+ data1 = 0;
+ data2 = 0;
+ }
+ else
+ {
+ //鐧惧垎姣�
+ data1 = open.SeekBar.Progress;
+ data2 = 0;
+ }
+
+ var taskInfo = new ZigBee.Device.Scene.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, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ {
+ var selectFL = new FrameLayout
+ {
+ Y = Application.GetRealHeight(1169),
+ Height = Application.GetRealHeight(752),
+ };
+ dialog.AddChidren(selectFL);
+
+ var titleBG = new FrameLayout
+ {
+ Height = Application.GetRealHeight(138 * 2),
+ Radius = (uint)Application.GetRealHeight(20),
+ 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 = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.Cancel
+ };
+ titleFL.AddChidren(cancleBtn);
+
+ var deviceName = new Button
+ {
+ Width = Application.GetRealWidth(400),
+ Gravity = Gravity.CenterHorizontal,
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextSize = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = device.CommonDevice.DeviceEpointName
+ };
+ titleFL.AddChidren(deviceName);
+
+ var comfrimBtn = new Button
+ {
+ X = Application.GetRealWidth(800),
+ Width = Application.GetRealWidth(200),
+ TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
+ TextSize = 15,
+ 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.ProgressChanged += (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.SetProgress(sceneTarget.TaskList[0].Data1);
+ }
+ }
+
+ comfrimBtn.MouseUpEventHandler = (sender, e) =>
+ {
+ var taskList = new List<ZigBee.Device.Scene.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 ZigBee.Device.Scene.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, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ {
+ var selectFL = new FrameLayout
+ {
+ Y = Application.GetRealHeight(815),
+ Height = Application.GetRealHeight(1106),
+ };
+ dialog.AddChidren(selectFL);
+
+ var titleBG = new FrameLayout
+ {
+ Height = Application.GetRealHeight(138 * 2),
+ Radius = (uint)Application.GetRealHeight(20),
+ 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 = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.Cancel
+ };
+ titleFL.AddChidren(cancleBtn);
+
+ var deviceName = new Button
+ {
+ Width = Application.GetRealWidth(400),
+ Gravity = Gravity.CenterHorizontal,
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextSize = 15,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = device.CommonDevice.DeviceEpointName
+ };
+ titleFL.AddChidren(deviceName);
+
+ var comfrimBtn = new Button
+ {
+ X = Application.GetRealWidth(800),
+ Width = Application.GetRealWidth(200),
+ TextColor = ZigbeeColor.Current.GXCTextSelectedColor2,
+ TextSize = 15,
+ 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);
+ }
+ }
+
+ open.pickerView.setCurrentItems(tempId, modelId, fanid);
+ }
+ }
+
+ comfrimBtn.MouseUpEventHandler = (sender, e) =>
+ {
+
+ var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+
+ int taskType = 5;
+ int data1 = 0;
+ int data2 = 0;
+
+ if (shut.IsSelected)
+ {
+ //鍏�
+ data1 = 3;
+ data2 = 0;
+ var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+ {
+ TaskType = taskType,
+ Data1 = data1,
+ Data2 = data2
+ };
+ taskList.Add(taskInfo);
+ }
+ else
+ {
+ //fan
+ var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+ {
+ TaskType = taskType,
+ Data1 = 6,
+ Data2 = open.fanList[fanid]
+ };
+ taskList.Add(taskInfo);
+
+ //mode
+ var taskInfo2 = new ZigBee.Device.Scene.TaskListInfo
+ {
+ TaskType = taskType,
+ Data1 = 3,
+ Data2 = open.modeList[fanid]
+ };
+ taskList.Add(taskInfo2);
+
+ //tem
+ if (open.modeList[modelId] == 4)
+ {
+ //heat
+ var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo
+ {
+ TaskType = taskType,
+ Data1 = 4,
+ Data2 = open.temperatureList[tempId]
+ };
+ taskList.Add(taskInfo3);
+
+ }
+ else
+ {
+ //heat
+ var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo
+ {
+ TaskType = taskType,
+ Data1 = 5,
+ Data2 = open.temperatureList[tempId]
+ };
+ taskList.Add(taskInfo3);
+ }
+ }
+
+ sceneTargetDevice.TaskList = taskList;
+ sceneTargetDevice.DeviceUI = device;
+ selectedAction?.Invoke(sceneTargetDevice);
+ RemoveFromParent();
+ };
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs
index 668754b..93f30a9 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs
@@ -60,10 +60,6 @@
TextID = R.MyInternationalizationString.SelectFloor
};
backgroundFL.AddChidren(tip);
- tip.MouseUpEventHandler += (sender, e) =>
- {
- BackgroundColor = ZigbeeColor.Current.GXCRedColor;
- };
var floorLayout = new VerticalScrolViewLayout
{
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
new file mode 100755
index 0000000..65094ac
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
@@ -0,0 +1,342 @@
+锘縰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>
+ /// 閫夋嫨妤煎眰
+ /// </summary>
+ private Button selectFloorBtn;
+ /// <summary>
+ /// 鍦烘櫙鍔熻兘涓儴鑳屾櫙bodyView
+ /// </summary>
+ public FrameLayout functionSceneBodyView;
+ /// <summary>
+ /// sceneUI
+ /// </summary>
+ public SceneUI sceneUI;
+
+
+ #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();
+ }
+
+
+ #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,
+ };
+
+ 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.Init(580, 184, Direction.Right);
+ floors.FloorAction += (floorName) =>
+ {
+ floorBtn.Text = floorName;
+ RefreshBodyView();
+ };
+ }
+ /// <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()
+ {
+ AddRoomView();
+ }
+
+ /// <summary>
+ /// AddRoomView
+ /// </summary>
+ private void AddRoomView()
+ {
+ 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(910+622),
+ BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
+ };
+ bodyFrameLayout.AddChidren(functionSceneBodyView);
+
+ Button curBtn = new Button();
+ foreach (var room in Common.Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom())
+ {
+ var row = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(187 + 50),
+ Height = Application.GetRealHeight(204),
+ };
+ roomFL.AddChidren(row);
+
+ var roomBtn = new Button()
+ {
+ Width = Application.GetRealWidth(187),
+ Height = Application.GetRealHeight(78),
+ Radius = (uint)Application.GetRealHeight(78 / 2),
+ Gravity = Gravity.Center,
+ Text = room.Name,
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+ SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+ BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor3,
+ SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
+ BorderColor = ZigbeeColor.Current.GXCBorderUnSelectedColor,
+ BorderWidth = 1
+ };
+ row.AddChidren(roomBtn);
+
+ if (room.IsLove)
+ {
+ roomBtn.IsSelected = true;
+ curBtn = roomBtn;
+
+ RefreshScene(room);
+ }
+ roomBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ if ((sender as Button) == curBtn)
+ {
+ return;
+ }
+ (sender as Button).IsSelected = true;
+ curBtn.IsSelected = false;
+ curBtn = sender as Button;
+
+ RefreshScene(room);
+ };
+ }
+
+ }
+
+
+ /// <summary>
+ /// RefreshScene
+ /// </summary>
+ /// <param name="room"></param>
+ public void RefreshScene(Common.Room room)
+ {
+ functionSceneBodyView.RemoveAll();
+ var sceneList = room.SceneUIList;
+ 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 = sceneList[i];
+ 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;
+ }
+ }
+ }
+
+ /// <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);
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionButton.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionButton.cs
index ca424b1..176cd8e 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionButton.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionButton.cs
@@ -17,6 +17,10 @@
/// </summary>
public Button ImageBG;
/// <summary>
+ /// ClickBtn
+ /// </summary>
+ public Button ClickBtn;
+ /// <summary>
/// v_Selected
/// </summary>
private bool v_Selected;
@@ -94,6 +98,12 @@
Tag = Tag
};
AddChidren(NameBtn);
+
+ ClickBtn = new Button
+ {
+ Tag = Tag
+ };
+ AddChidren(ClickBtn);
}
@@ -122,5 +132,7 @@
{
ImageBG.IsSelected = NameBtn.IsSelected = statu;
}
+
+
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionRow.cs
index 9865c24..8fe24e8 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionRow.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/FunctionRow.cs
@@ -19,7 +19,11 @@
/// <summary>
/// SwitchBtn
/// </summary>
- public CommonForm.SelectedStatuButton SwitchBtn;
+ public Button SwitchBtn;
+ /// <summary>
+ /// ClickBtn
+ /// </summary>
+ public Button ClickBtn;
/// <summary>
/// v_Selected
/// </summary>
@@ -56,8 +60,9 @@
{
X = Application.GetRealWidth(x);
Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1022);
+ Width = Application.GetRealWidth(1080);
Height = Application.GetRealHeight(127);
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
}
/// <summary>
@@ -65,7 +70,7 @@
/// </summary>
/// <param name="imagePath"></param>
/// <param name="selectedImagePath"></param>
- public void Init(string imagePath, string selectedImagePath)
+ public void Init(string imagePath, string selectedImagePath,bool click=false)
{
ImageBG = new Button()
{
@@ -94,7 +99,7 @@
NameBtn = new Button()
{
- X = Application.GetRealWidth(181),
+ X = Application.GetRealWidth(200),
Width = Application.GetRealWidth(500),
Height = Application.GetRealHeight(80),
Gravity = Gravity.CenterVertical,
@@ -105,7 +110,7 @@
};
AddChidren(NameBtn);
- SwitchBtn = new SelectedStatuButton()
+ SwitchBtn = new Button()
{
X = Application.GetRealWidth(896),
Width = Application.GetMinRealAverage(78),
@@ -119,14 +124,20 @@
var line = new Button()
{
- X = Application.GetRealWidth(180),
+ X = Application.GetRealWidth(200),
Y = Height - 2,
- Width = Application.GetRealWidth(841),
+ Width = Application.GetRealWidth(821),
Height = 2,
BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor,
Tag = Tag
};
AddChidren(line);
+
+ ClickBtn = new Button();
+ if (click)
+ {
+ AddChidren(ClickBtn);
+ }
}
/// <summary>
@@ -153,5 +164,14 @@
{
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/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetFunctionRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetFunctionRow.cs
new file mode 100755
index 0000000..34e6352
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetFunctionRow.cs
@@ -0,0 +1,143 @@
+锘縰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);
+ }
+
+ /// <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(300),
+ Height = Application.GetRealHeight(58),
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.Delay
+ };
+ AddChidren(NameBtn);
+
+ ZoneBtn = new Button
+ {
+ X = Application.GetRealWidth(219),
+ Y = Application.GetRealHeight(72),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(49),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2
+ };
+ AddChidren(ZoneBtn);
+
+ StatuBtn = new Button
+ {
+ X = Application.GetRealWidth(510),
+ Width = Application.GetRealWidth(500),
+ Height = Application.GetRealHeight(100),
+ Gravity = Gravity.CenterVertical,
+ TextAlignment = TextAlignment.CenterRight,
+ TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2
+ };
+ AddChidren(StatuBtn);
+
+ line = new Button()
+ {
+ X = Application.GetRealWidth(222),
+ Y = Height - 2,
+ Width = Application.GetRealWidth(800),
+ Height = 2,
+ 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/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetRow.cs
deleted file mode 100755
index 370fb76..0000000
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetRow.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-锘縰sing System;
-using Shared.Common;
-namespace Shared.Phone.Device.CommonForm
-{
- public class SceneTargetRow:FrameLayout
- {
- /// <summary>
- /// TipBtn
- /// </summary>
- public Button Icon;
- /// <summary>
- /// NameText
- /// </summary>
- public Button NameText;
- /// <summary>
- /// NextBtn
- /// </summary>
- public Button NextBtn;
- /// <summary>
- /// line
- /// </summary>
- private Button line;
- /// <summary>
- /// SceneTargetRow
- /// </summary>
- /// <param name="y"></param>
- public SceneTargetRow(int y)
- {
- X = Application.GetRealWidth(0);
- Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(1080);
- Height = Application.GetRealHeight(127);
- }
-
- /// <summary>
- /// Init
- /// </summary>
- public void Init()
- {
- Icon = new Button
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Width = Application.GetMinRealAverage(80),
- Height = Application.GetMinRealAverage(80),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath="Item/Timer.png"
- };
- AddChidren(Icon);
-
- NameText = new Button
- {
- X = Application.GetRealWidth(300),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(80),
- Gravity = Gravity.CenterVertical,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
- TextAlignment = TextAlignment.CenterLeft
- };
- AddChidren(NameText);
-
- NextBtn = new Button
- {
- X = Application.GetRealWidth(910),
- Width = Application.GetMinRealAverage(100),
- Height = Application.GetMinRealAverage(100),
- Gravity = Gravity.CenterVertical,
- SelectedImagePath = "Item/Next.png",
- UnSelectedImagePath = "Item/NextSelected.png"
- };
- AddChidren(NextBtn);
-
- line = new Button()
- {
- X = Application.GetRealWidth(CommonFormResouce.X_Left),
- Y = Height - 2,
- Width = Application.GetRealWidth(965),
- Height = 2,
- BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
- };
- 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>
- /// SetIcon
- /// </summary>
- /// <param name="imagePath"></param>
- public void SetIcon(string imagePath)
- {
- Icon.UnSelectedImagePath = imagePath;
- }
-
- /// <summary>
- /// HideLine
- /// </summary>
- /// <param name="hiden"></param>
- public void HideLine(bool hiden)
- {
- line.Visible = hiden;
- }
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetTimeRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetTimeRow.cs
new file mode 100755
index 0000000..2c04202
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SceneTargetTimeRow.cs
@@ -0,0 +1,102 @@
+锘縰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);
+ }
+
+ /// <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
+ };
+ 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
+ };
+ AddChidren(TitleBtn);
+
+ line = new Button()
+ {
+ X = Application.GetRealWidth(222),
+ Y = Height - 2,
+ Width = Application.GetRealWidth(800),
+ Height = 2,
+ 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/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithPickViewRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithPickViewRow.cs
new file mode 100755
index 0000000..609b606
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithPickViewRow.cs
@@ -0,0 +1,191 @@
+锘縰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,
+ };
+ 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);
+
+ 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 - 2,
+ Width = Application.GetRealWidth(919),
+ Height = 2,
+ 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/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs
new file mode 100755
index 0000000..4f9dd8f
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectDeviceWithSeekBarRow.cs
@@ -0,0 +1,194 @@
+锘縰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 HorizontalSeekBar 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,
+ };
+ 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 HorizontalSeekBar()
+ {
+ X = Application.GetRealWidth(81),
+ Y = Application.GetRealHeight(200),
+ Width = Application.GetRealWidth(919),
+ Height = Application.GetRealHeight(127),
+ BackgroundColor = ZigbeeColor.Current.GXCSeekBarBackground,
+ ProgressColor = ZigbeeColor.Current.GXCProgressColor,
+ ThumbColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Max = MaxLevel,
+ Progress = max
+ };
+ AddChidren(SeekBar);
+
+ SeekBarTitle = new Button()
+ {
+ Y = Application.GetRealHeight(127),
+ Height = Application.GetRealHeight(50),
+ Width = Application.GetRealWidth(200),
+ Gravity = Gravity.CenterHorizontal,
+ Text = $"{SeekBar.Progress} %",
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor
+ };
+ AddChidren(SeekBarTitle);
+
+ line = new Button()
+ {
+ X = Application.GetRealWidth(81),
+ Y = this.Height - 2,
+ Width = Application.GetRealWidth(919),
+ Height = 2,
+ 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;
+ }
+
+ /// <summary>
+ /// SetSeekBarTitle
+ /// </summary>
+ public void SetSeekBarTitle()
+ {
+ SeekBarTitle.Text = $"{(int)(SeekBar.Progress * 1.0 / MaxLevel * 100)} %";
+ }
+
+ /// <summary>
+ /// SetProgress
+ /// </summary>
+ /// <param name="progress"></param>
+ public void SetProgress(int progress)
+ {
+ SeekBar.Progress = progress;
+ SetSeekBarTitle();
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneRow.cs
new file mode 100755
index 0000000..262a2f8
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneRow.cs
@@ -0,0 +1,163 @@
+锘縰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(500),
+ Height = Application.GetRealHeight(80),
+ Gravity = Gravity.CenterVertical,
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextAlignment = TextAlignment.CenterLeft,
+ };
+ 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 - 2,
+ Width = Application.GetRealWidth(841),
+ Height = 2,
+ BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor,
+ };
+ 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/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneStatuRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneStatuRow.cs
new file mode 100755
index 0000000..5598511
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectSceneStatuRow.cs
@@ -0,0 +1,140 @@
+锘縰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,
+ };
+ 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 - 2,
+ Width = Application.GetRealWidth(919),
+ Height = 2,
+ 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/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
index 28f9330..ded3c3d 100755
--- a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
@@ -107,29 +107,29 @@
{
return;
}
- if ((common as Rollershade).DeviceStatusReport.CluterID == 258)
+ if (common.DeviceStatusReport.CluterID == 258)
{
- if ((common as Rollershade).DeviceStatusReport.AttriBute[0].AttributeId == 8)
+ if (common.DeviceStatusReport.AttriBute[0].AttributeId == 8)
{
//绐楀笜鐧惧垎姣�
var rollerShade = deviceUI.CommonDevice as Rollershade;
- rollerShade.DeviceStatusReport = (common as Rollershade).DeviceStatusReport;
- rollerShade.WcdCurrentPositionLiftPercentage = (common as Rollershade).DeviceStatusReport.AttriBute[0].AttriButeData;
+ rollerShade.DeviceStatusReport = common.DeviceStatusReport;
+ rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData;
SeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage;
seekBarTitle.Text = $"{SeekBar.Progress} %";
rollerShade.LastDateTime = DateTime.Now;
}
- else if ((common as Rollershade).DeviceStatusReport.AttriBute[0].AttributeId == 0)
+ else if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
{
//绐楀笜绫诲瀷
var rollerShade = deviceUI.CommonDevice as Rollershade;
- rollerShade.DeviceStatusReport = (common as Rollershade).DeviceStatusReport;
- rollerShade.WcdType = (common as Rollershade).DeviceStatusReport.AttriBute[0].AttriButeData;
+ rollerShade.DeviceStatusReport = common.DeviceStatusReport;
+ rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData;
rollerShade.LastDateTime = DateTime.Now;
}
}
//***鏂版敼***璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID=3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- else if ((common as Rollershade).DeviceStatusReport.CluterID == 3)
+ else if (common.DeviceStatusReport.CluterID == 3)
{
var rollerShade = deviceUI.CommonDevice as Rollershade;
rollerShade.IsOnline = 1;
@@ -161,7 +161,7 @@
return;
}
var rollerShade = deviceUI.CommonDevice as Rollershade;
- rollerShade.IsOnline = (common as Rollershade).IsOnline;
+ rollerShade.IsOnline = common.IsOnline;
rollerShadeIMG.IsSelected = rollerShade.IsOnline == 1;
rollerShade.LastDateTime = DateTime.Now;
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
index 02e5698..5dd0ba7 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
@@ -120,10 +120,10 @@
}
if (deviceUI.CommonDevice.Type == DeviceType.DimmableLight)
{
- if ((common as DimmableLight).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
dimmableLight = deviceUI.CommonDevice as DimmableLight;
- dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
//璁板綍銆佹洿鏂扮姸鎬�
if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
{
@@ -146,10 +146,10 @@
dimmableLight.LastDateTime = DateTime.Now;
}
//浜害
- if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8)
+ if (common.DeviceStatusReport.CluterID == 8)
{
dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
- dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
if (attriButeList == null || attriButeList.Count == 0)
{
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
index 54e4f18..946630a 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
@@ -121,10 +121,10 @@
}
if (deviceUI.CommonDevice.Type == DeviceType.OnOffOutput)
{
- if ((common as ToggleLight).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var light = deviceUI.CommonDevice as ToggleLight;
- light.DeviceStatusReport = (common as ToggleLight).DeviceStatusReport;
+ light.DeviceStatusReport = common.DeviceStatusReport;
//璁板綍銆佹洿鏂扮姸鎬�
if (light.DeviceStatusReport.AttriBute == null || light.DeviceStatusReport.AttriBute.Count == 0)
{
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
index 54dd41d..df2d07c 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -80,7 +80,7 @@
BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
};
middle.AddChidren(timeframelayout);
-
+
var timeiconBtn = new Button
{
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
index 1634157..26cc142 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
@@ -4,9 +4,6 @@
using Shared.Common;
using Shared.Phone;
using Shared.R;
-//if (Application.DeviceType == Device.Android) {
-//}
-//using UIKit;//ios骞冲彴鎵嶆湁锛宎ndroid娌℃湁锛�
using ZigBee.Device;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
index c600459..139489c 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
@@ -10,7 +10,7 @@
public AddAction()
{
- Tag = "Logic";
+ Tag = "LockLogic";
}
public void Show()
{
@@ -125,11 +125,6 @@
EventHandler<MouseEventArgs> devicestateclick = (sender, e) =>
{
- Common.Logic.LogicDviceList.Clear();
- if (Common.Logic.LogicDviceList.Count == 0)
- {
- Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
- }
var lockAddDevice = new LockAddDevice();
UserView.HomePage.Instance.AddChidren(lockAddDevice);
UserView.HomePage.Instance.PageIndex += 1;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
index 150a32a..577d841 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
@@ -3,12 +3,17 @@
using Shared;
using Shared.Common;
using Shared.R;
-
-namespace Shared.Phone.Logic.DoorLockLogic
+namespace Shared.Phone.Device.Logic.DoorLockLogic
{
public class AddCondition : FrameLayout
{
+ public AddCondition()
+ {
+ Tag = "LockLogic";
+ }
Button selectedIcon = new Button();
+
+ public int conditionsIndex = -1;
public void Show()
{
#region 鏈�涓婇潰鐨勫竷灞�浠g爜
@@ -74,10 +79,10 @@
var userlist = new List<ZigBee.Device.DoorLock.LocaDoorLockObj>();
userlist.Clear();
-
+ ///鍒ゆ柇APP鐧诲綍杩涙潵鐢ㄦ埛韬唤(涓讳汉锛岀鐞嗗憳锛屾垚鍛�)
if (UserCenter.UserCenterResourse.UserInfo.AuthorityNo == 3)
{
- var list = DoorLockIfon.GetUserIfon(DoorLockIfon.UserMemberInfoRes.SubAccountDistributedMark);
+ var list = LockIfon.GetUserIfon(LockIfon.UserMemberInfoRes.SubAccountDistributedMark);
foreach (var o in list)
{
if (userlist.Count != 0)
@@ -89,9 +94,8 @@
}
else
{
- userlist = DoorLockIfon.GetUserList();
+ userlist = LockIfon.GetUserList();
}
-
for (int i = 0; i < userlist.Count; i++)
{
var user = userlist[i];
@@ -119,6 +123,7 @@
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
Width = Application.GetRealWidth(600),
Height = Application.GetRealHeight(130),
+ Tag = userlist[i].ConnectedAccount
};
userRow.AddChidren(usernameBtn);
@@ -135,169 +140,8 @@
EventHandler<MouseEventArgs> userclick = (sender, e) =>
{
- var uesrifonlist = DoorLockIfon.GetUserIfon(user.ConnectedAccount);
- var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
- this.AddChidren(flMain);
- flMain.MouseUpEventHandler += (sender1, e1) =>
- {
- flMain.RemoveFromParent();
- };
-
- var lockcolorfra = new FrameLayout
- {
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(100),
- Y = Application.GetRealHeight(1920 - 100),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- };
- flMain.AddChidren(lockcolorfra);
-
- var lockcolorfra1 = new FrameLayout
- {
-
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(530),
- Y = Application.GetRealHeight(1920 - 530),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- Radius = (uint)Application.GetRealHeight(60),
- };
- flMain.AddChidren(lockcolorfra1);
-
- #region -------鍙栨秷 瀹屾垚
- var lockRow = new RowLayout
- {
- Height = Application.GetRealHeight(140),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- lockcolorfra1.AddChidren(lockRow);
- var Btncancel = new Button
- {
- TextID = MyInternationalizationString.cancel,
- TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
- X = Application.GetRealWidth(80),
- TextAlignment = TextAlignment.CenterLeft,
- };
- lockRow.AddChidren(Btncancel);
- Btncancel.MouseUpEventHandler += (sender16, e16) =>
- {
- flMain.RemoveFromParent();
- UserView.HomePage.Instance.ScrollEnabled = true;
- };
-
- var Btntitle = new Button
- {
- TextID = MyInternationalizationString.security,
- TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(320),
- TextAlignment = TextAlignment.Center,
- X = Btncancel.Right + Application.GetRealWidth(100),
- TextSize = 16,
- Text = user.UserName,
- };
- lockRow.AddChidren(Btntitle);
- var Btncomplete = new Button
- {
- TextID = MyInternationalizationString.complete,
- TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
- TextAlignment = TextAlignment.CenterRight,
- X = Btntitle.Right + Application.GetRealWidth(100),
-
- };
- lockRow.AddChidren(Btncomplete);
- #endregion
-
- string SelectedDeviceStatuscondition = "";
- lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * uesrifonlist.Count) - 20 - 50);
- lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * uesrifonlist.Count) + 20 + 50);
- for (int j = 0; j < uesrifonlist.Count; j++)
- {
- var userid = uesrifonlist[i];
- var doorlockfra = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = lockRow.Bottom + Application.GetRealHeight(20 + 160 * j),
- };
- lockcolorfra1.AddChidren(doorlockfra);
-
- var doorlockRow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(920),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(80),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- doorlockfra.AddChidren(doorlockRow);
-
- var doorlockBtn = new Button
- {
- Width = Application.GetRealWidth(600),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
- };
- doorlockRow.AddChidren(doorlockBtn);
- //(0鎸夐敭/3鍗�/15鎸囩汗)
- switch (userid.UnlockType)
- {
- case 0:
- {
- doorlockBtn.Text = Language.StringByID(MyInternationalizationString.lockpassword);
- }
- break;
- case 3:
- {
- doorlockBtn.Text = Language.StringByID(MyInternationalizationString.ic);
- }
- break;
- case 15:
- {
- doorlockBtn.Text = Language.StringByID(MyInternationalizationString.fingerprint);
- }
- break;
- }
- var doorlockSelected = new Button
- {
- X = Application.GetRealWidth(860),
- Width = Application.GetMinRealAverage(60),
- Height = Application.GetMinRealAverage(60),
- UnSelectedImagePath = "ZigeeLogic/selected.png",
- Visible = false,
- Gravity = Gravity.CenterVertical,
-
- };
- doorlockRow.AddChidren(doorlockSelected);
- if ((uesrifonlist.Count - 1) == i)
- {
- doorlockRow.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
- }
- EventHandler<MouseEventArgs> doorlockclick = (sender2, e2) =>
- {
- SelectedDeviceStatuscondition = "DoorLock";
- selectedIcon.Visible = false;
- selectedIcon = doorlockSelected;
- doorlockSelected.Visible = true;
- //doorlockBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-
- };
- doorlockRow.MouseUpEventHandler += doorlockclick;
- doorlockBtn.MouseUpEventHandler += doorlockclick;
- doorlockSelected.MouseUpEventHandler += doorlockclick;
- doorlockfra.MouseUpEventHandler += doorlockclick;
-
- }
-
-
- Btncomplete.MouseUpEventHandler += (sender3, e3) =>
- {
-
-
- };
-
+ var uesrifonlist = LockIfon.GetUserIfon(usernameBtn.Tag.ToString());
+ SelectedUserID(uesrifonlist, usernameBtn.Text);
};
usernameBtn.MouseUpEventHandler += userclick;
btntimeback.MouseUpEventHandler += userclick;
@@ -306,8 +150,228 @@
}
+ }
+
+ /// <summary>
+ /// 閫夋嫨鏌愪釜鐢ㄦ埛
+ /// </summary>
+ /// <param name="uesrifonlist">瑙﹀彂婧愬垪琛�</param>
+ /// <param name="userName">鐢ㄦ埛鍚嶅瓧</param>
+ void SelectedUserID(List<ZigBee.Device.DoorLock.LocaDoorLockObj> uesrifonlist,string userName) {
+
+ var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+ this.AddChidren(flMain);
+
+ flMain.MouseUpEventHandler += (sender1, e1) =>
+ {
+ flMain.RemoveFromParent();
+ };
+
+ var lockcolorfra = new FrameLayout
+ {
+ Width = Application.GetRealWidth(1080),
+ Height = Application.GetRealHeight(100),
+ Y = Application.GetRealHeight(1920 - 100),
+ BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+ };
+ flMain.AddChidren(lockcolorfra);
+
+ var lockcolorfra1 = new FrameLayout
+ {
+
+ Width = Application.GetRealWidth(1080),
+ Height = Application.GetRealHeight(530),
+ Y = Application.GetRealHeight(1920 - 530),
+ BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+ Radius = (uint)Application.GetRealHeight(60),
+ };
+ flMain.AddChidren(lockcolorfra1);
+
+ #region -------鍙栨秷 瀹屾垚
+ var lockRow = new RowLayout
+ {
+ Height = Application.GetRealHeight(140),
+ LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ };
+ lockcolorfra1.AddChidren(lockRow);
+ var Btncancel = new Button
+ {
+ TextID = MyInternationalizationString.cancel,
+ TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+ Height = Application.GetRealHeight(140),
+ Width = Application.GetRealWidth(200),
+ X = Application.GetRealWidth(80),
+ TextAlignment = TextAlignment.CenterLeft,
+ };
+ lockRow.AddChidren(Btncancel);
+ Btncancel.MouseUpEventHandler += (sender16, e16) =>
+ {
+ flMain.RemoveFromParent();
+ UserView.HomePage.Instance.ScrollEnabled = true;
+ };
+
+ var Btntitle = new Button
+ {
+ TextID = MyInternationalizationString.security,
+ TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
+ Height = Application.GetRealHeight(140),
+ Width = Application.GetRealWidth(320),
+ TextAlignment = TextAlignment.Center,
+ X = Btncancel.Right + Application.GetRealWidth(100),
+ TextSize = 16,
+ Text =userName,
+ };
+ lockRow.AddChidren(Btntitle);
+ var Btncomplete = new Button
+ {
+ TextID = MyInternationalizationString.complete,
+ TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
+ Height = Application.GetRealHeight(140),
+ Width = Application.GetRealWidth(200),
+ TextAlignment = TextAlignment.CenterRight,
+ X = Btntitle.Right + Application.GetRealWidth(100),
+
+ };
+ lockRow.AddChidren(Btncomplete);
+ #endregion
+
+ string SelectedLockStatus = "";
+ lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * uesrifonlist.Count) - 20 - 50);
+ lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * uesrifonlist.Count) + 20 + 50);
+ ///瀹氫箟涓や釜鍙橀噺璁板綍閫変腑鐘舵�侊紱
+ int attriButeId = 0, attriButeData2 = 0;
+ for (int j = 0; j < uesrifonlist.Count; j++)
+ {
+ var userid = uesrifonlist[j];
+ var doorlockfra = new FrameLayout
+ {
+ Height = Application.GetRealHeight(160),
+ Y = lockRow.Bottom + Application.GetRealHeight(20 + 160 * j),
+ };
+ lockcolorfra1.AddChidren(doorlockfra);
+
+ var doorlockRow = new RowLayout
+ {
+ Y = Application.GetRealHeight(30),
+ Width = Application.GetRealWidth(920),
+ Height = Application.GetRealHeight(130),
+ X = Application.GetRealWidth(80),
+ LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ };
+ doorlockfra.AddChidren(doorlockRow);
+
+ var doorlockBtn = new Button
+ {
+ Width = Application.GetRealWidth(600),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
+ };
+ doorlockRow.AddChidren(doorlockBtn);
+ //(0鎸夐敭/3鍗�/15鎸囩汗)
+ switch (userid.UnlockType)
+ {
+ case 0:
+ {
+ doorlockBtn.Text = Language.StringByID(MyInternationalizationString.lockpassword);
+ }
+ break;
+ case 3:
+ {
+ doorlockBtn.Text = Language.StringByID(MyInternationalizationString.ic);
+ }
+ break;
+ case 15:
+ {
+ doorlockBtn.Text = Language.StringByID(MyInternationalizationString.fingerprint);
+ }
+ break;
+
+ }
+ var doorlockSelected = new Button
+ {
+ X = Application.GetRealWidth(860),
+ Width = Application.GetMinRealAverage(60),
+ Height = Application.GetMinRealAverage(60),
+ UnSelectedImagePath = "ZigeeLogic/selected.png",
+ Visible = false,
+ Gravity = Gravity.CenterVertical,
+
+ };
+ doorlockRow.AddChidren(doorlockSelected);
+ if ((uesrifonlist.Count - 1) == j)
+ {
+ doorlockRow.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
+ }
+ EventHandler<MouseEventArgs> doorlockclick = (sender2, e2) =>
+ {
+ SelectedLockStatus = "DoorLock";
+ selectedIcon.Visible = false;
+ selectedIcon = doorlockSelected;
+ doorlockSelected.Visible = true;
+ //doorlockBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+ attriButeId = userid.UnlockType;
+ attriButeData2 = userid.UserID;
+ };
+ doorlockRow.MouseUpEventHandler += doorlockclick;
+ doorlockBtn.MouseUpEventHandler += doorlockclick;
+ doorlockSelected.MouseUpEventHandler += doorlockclick;
+ doorlockfra.MouseUpEventHandler += doorlockclick;
+ ///鏄剧ず涔嬪墠鐨勭姸鎬�
+ if (conditionsIndex != -1)
+ {
+ var s = Common.Logic.CurrentLogic.Conditions[conditionsIndex];
+ if (s["AttriButeId"] == userid.UnlockType.ToString() && s["AttriButeData2"] == userid.UserID.ToString())
+ {
+ selectedIcon.Visible = false;
+ selectedIcon = doorlockSelected;
+ doorlockSelected.Visible = true;
+ }
+ }
+ }
+
+ Btncomplete.MouseUpEventHandler += (sender, e) =>
+ {
+ var lockConditionsInfo = new Dictionary<string, string>();
+ lockConditionsInfo.Add("Type", "1");
+ lockConditionsInfo.Add("IsValid", "1");
+ lockConditionsInfo.Add("MacAddr", LockIfon.DoorLock.DeviceAddr);
+ lockConditionsInfo.Add("Epoint", LockIfon.DoorLock.DeviceEpoint.ToString());
+ lockConditionsInfo.Add("Cluster_ID", "64529");
+ lockConditionsInfo.Add("AttriButeId", attriButeId.ToString());
+ lockConditionsInfo.Add("AttriButeData2", attriButeData2.ToString());
+ lockConditionsInfo.Add("AttriButeData1", "2");
+ lockConditionsInfo.Add("Range", "0");
+ if (SelectedLockStatus != "")
+ {
+ if (conditionsIndex == -1)
+ {
+ Common.Logic.CurrentLogic.Conditions.Add(lockConditionsInfo);
+ }
+ else
+ {
+ Common.Logic.CurrentLogic.Conditions.RemoveAt(conditionsIndex);
+ Common.Logic.CurrentLogic.Conditions.Insert(conditionsIndex, lockConditionsInfo);
+ }
+
+ }
+ else
+ {
+ if (conditionsIndex == -1)
+ {
+ var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
+ Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
+ Language.StringByID(MyInternationalizationString.complete));
+ alert.Show();
+ return;
+ }
+ }
+ var lockLogicCommunalPage = new LockLogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ lockLogicCommunalPage.Show(() => { });
+ };
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/DoorLockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/DoorLockLogicList.cs
deleted file mode 100755
index 92f5a85..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/DoorLockLogicList.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-锘縰sing System;
-using Shared;
-using Shared.Common;
-using Shared.R;
-
-namespace Shared.Phone.Logic.DoorLockLogic
-{
- public class DoorLockLogicList : FrameLayout
- {
-
- public async void Show()
- {
-
- #region 鏈�涓婇潰鐨勫竷灞�浠g爜
- var topRowLayout = new RowLayout
- {
- BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
- Height = Application.GetRealHeight(184),
- LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
- };
- this.AddChidren(topRowLayout);
-
- var titleName = new Button
- {
- TextSize = 16,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- X = Application.GetRealWidth(176),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(69),
- Y = Application.GetRealHeight(92),
- TextID = MyInternationalizationString.selection,
- };
- topRowLayout.AddChidren(titleName);
-
- var clickBtn = new Button
- {
- Width = Application.GetRealWidth(81 + 51),
- Height = Application.GetRealHeight(58 + 40),
- Y = Application.GetRealHeight(98 - 40),
- };
- topRowLayout.AddChidren(clickBtn);
- clickBtn.MouseDownEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var back = new Button
- {
- Width = Application.GetRealWidth(30),
- Height = Application.GetRealHeight(51),
- X = Application.GetRealWidth(81),
- Y = Application.GetRealHeight(98),
- //Gravity = Gravity.CenterVertical;
- UnSelectedImagePath = "ZigeeLogic/back.png",
- };
- topRowLayout.AddChidren(back);
- back.MouseDownEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var addiocn = new Button
- {
- Width = Application.GetRealWidth(72),
- Height = Application.GetRealHeight(72),
- X = Application.GetRealWidth(1080-108-58),
- UnSelectedImagePath = "ZigeeLogic/lockadd.png",
- Y = Application.GetRealHeight(184-72-20),
- };
- topRowLayout.AddChidren(addiocn);
- addiocn.MouseUpEventHandler += (sender, e) =>
- {
- //new涓�涓柊閫昏緫瀵硅薄锛�
- Common.Logic.CurrentLogic = new Common.Logic();
- Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
- Common.Logic.CurrentLogic.LogicType = 1;
- //Config.Instance.Guid鐢ㄦ潵璇嗗埆璐﹀彿韬唤锛�
- var accounts = new System.Collections.Generic.Dictionary<string, string>();
- accounts.Add("Account",Config.Instance.Guid);
- Common.Logic.CurrentLogic.Accounts.Add(accounts);
- Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
- var lockLogicCommunalPage = new LockLogicCommunalPage();
- UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
- UserView.HomePage.Instance.PageIndex += 1;
- lockLogicCommunalPage.Show(() => { });
- };
- #endregion
-
- var middle = new VerticalScrolViewLayout
- {
- Y = topRowLayout.Bottom,
- Height = Application.GetRealHeight(1920 - 184),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- this.AddChidren(middle);
-
- CommonPage.Loading.Start();
- if (Common.Logic.LockLogicList.Count == 0)
- {
- var Idlist = await Device.Logic.Send.GetLogicId();
- if (Idlist.Count != 0)
- {
- var listlogic = await Device.Logic.Send.ReadList(Idlist.Count);
- for (int i = 0; i < Idlist.Count; i++)
- {
- var LogicId = Idlist[i];
- //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆�
- for (int j = 0; j < listlogic.Count; j++)
- {
- var logic = listlogic[j];
- if (logic.LogicId == LogicId)
- {
- Common.Logic.LockLogicList.Add(logic);
- }
- }
- }
- }
- }
- //鑷姩鍖�
- for (int i = 0; i < Common.Logic.LockLogicList.Count; i++)
- {
- var logic = Common.Logic.LockLogicList[i];
- var logicRowlayout = new RowLayout
- {
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(190),
- LineColor = ZigbeeColor.Current.LogicBackgroundColor,
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-
- };
- middle.AddChidren(logicRowlayout);
-
- var logicnameBtn = new Button
- {
- Height = Application.GetRealHeight(190),
- Width = Application.GetRealWidth(600),
- Text = logic.LogicName,
- X = Application.GetRealWidth(58),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- Gravity = Gravity.CenterVertical,
- };
- 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),
- Gravity = Gravity.CenterVertical,
- };
- logicRowlayout.AddChidren(logicswitchBtn);
-
- }
- CommonPage.Loading.Hide();
- }
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
index 32d4550..7998d32 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
@@ -13,7 +13,7 @@
{
public LockAddDevice()
{
- Tag = "Logic";
+ Tag = "LockLogic";
}
Button roombjButton = new Button();
Button roomTextButton = new Button();
@@ -621,8 +621,6 @@
UserView.HomePage.Instance.ScrollEnabled = false;
Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
List<Dictionary<string, string>> taskListInfo = new List<Dictionary<string, string>>();
- //var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
- //this.AddChidren(flMain);
flMain.MouseUpEventHandler += (sender, e) =>
{
flMain.RemoveFromParent();
@@ -2017,10 +2015,10 @@
}
flMain.RemoveFromParent();
- var logicCommunalPage = new LogicCommunalPage();
- UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+ var lockLogicCommunalPage = new LockLogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
UserView.HomePage.Instance.PageIndex += 1;
- logicCommunalPage.Show(() => { });
+ lockLogicCommunalPage.Show(() => { });
};
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs
index 6619248..fb4ffce 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs
@@ -12,7 +12,7 @@
{
public LockAddScene()
{
- Tag = "Logic";
+ Tag = "LockLogic";
}
Button roombjButton = new Button();
Button roomTextButton = new Button();
@@ -160,10 +160,10 @@
}
actionsInfo.Add("LinkType", 2);
LogicIfon.AddSceneactions(tempScene, actionsInfo);
- var logicCommunalPage = new LogicCommunalPage();
- UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+ var lockLogicCommunalPage = new LockLogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
UserView.HomePage.Instance.PageIndex += 1;
- logicCommunalPage.Show(() => { });
+ lockLogicCommunalPage.Show(() => { });
};
@@ -403,5 +403,8 @@
}
}
+
+
+
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/DoorLockIfon.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockIfon.cs
similarity index 72%
rename from ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/DoorLockIfon.cs
rename to ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockIfon.cs
index 4ffe84f..1d13ab0 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/DoorLockIfon.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockIfon.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using Shared;
-namespace Shared.Phone.Logic.DoorLockLogic
+namespace Shared.Phone.Device.Logic.DoorLockLogic
{
- public class DoorLockIfon
+ public class LockIfon
{
/// <summary>
/// 褰撳墠闂ㄩ攣
@@ -22,9 +22,12 @@
{
var locaDoorLockObjlist = new List<ZigBee.Device.DoorLock.LocaDoorLockObj>();
locaDoorLockObjlist.Clear();
- var userlist = new ZigBee.Device.DoorLock();
- foreach (var dictionary in userlist.localDoorLockUserList)
+ foreach (var dictionary in DoorLock.localDoorLockUserList)
{
+ if (string.IsNullOrEmpty(dictionary.Value.ConnectedAccount)) {
+ //涓嶇煡閬撲紶杩囨潵ConnectedAccount涓轰粈涔堜负绌猴紝闃叉鎶涘紓甯革紱
+ continue;
+ }
var @null = locaDoorLockObjlist.Find((o) => { return o.ConnectedAccount == dictionary.Value.ConnectedAccount; });
if (@null == null)
{
@@ -42,9 +45,13 @@
{
var locaDoorLockObjlist = new List<ZigBee.Device.DoorLock.LocaDoorLockObj>();
locaDoorLockObjlist.Clear();
- var userlist = new ZigBee.Device.DoorLock();
- foreach (var dictionary in userlist.localDoorLockUserList)
+ foreach (var dictionary in DoorLock.localDoorLockUserList)
{
+ if (string.IsNullOrEmpty(dictionary.Value.ConnectedAccount))
+ {
+ //涓嶇煡閬撲紶杩囨潵ConnectedAccount涓轰粈涔堜负绌猴紝闃叉鎶涘紓甯革紱
+ continue;
+ }
if (dictionary.Value.ConnectedAccount ==SubAccountDistributedMark)
{
locaDoorLockObjlist.Add(dictionary.Value);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogic.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogic.cs
deleted file mode 100755
index a7b9501..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogic.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-
-namespace Shared.Phone.Logic.DoorLockLogic
-{
-
-
- public class LockLogic
- {
- public static List<LockLogic> LogicList = new List<LockLogic>();
- public static List<ZigBee.Device.CommonDevice> LogicDviceList = new List<ZigBee.Device.CommonDevice>();
- public static LockLogic CurrentLockLogic;
- /// <summary>
- ///0锛氳幏鍙栨垚鍔�
- ///<para>1锛氳閫昏緫涓嶅瓨鍦ㄣ��</para>
- ///<para>浠ヤ笅鎵�鏈夊瓧娈靛彧鏈夊湪Result 涓�1鏃跺瓨鍦�</para>
- /// </summary>
- public int Result;
- /// <summary>
- /// 0姝e父鑷姩鍖�;1闂ㄩ攣鑱斿姩浜嬩欢;
- /// </summary>
- public int LogicType = 1;
- /// <summary>
- /// 閫昏緫ID
- /// </summary>
- public int LogicId;
- /// <summary>
- ///璇ラ�昏緫鏄惁琚娇鑳姐��
- ///<para>0锛氱鐢ㄨ閫昏緫</para>
- ///<para>1锛氫娇鑳借閫昏緫</para>
- ///<para>2: 鍙Е鍙戜竴娆°�傝Е鍙戝悗璇ュ瓧娈靛皢鑷姩缃负0锛屽嵆绂佺敤鐘舵�併��</para>
- /// </summary>
- public int IsEnable;
-
- /// <summary>
- ///閫昏緫鍚嶇О
- /// </summary>
- public string LogicName;
-
- /// <summary>
- ///閫昏緫鍏崇郴銆�
- ///<para>0锛氭弧瓒虫墍鏈夋潯浠惰Е鍙戝姩浣�</para>
- ///<para>1锛氭弧瓒冲叾涓竴涓潯浠惰Е鍙戝姩浣�</para>
- /// </summary>
- public int Relationship;
- /// <summary>
- /// 鎺ㄩ�佸唴瀹�
- /// </summary>
- public string LogicCustomPushText;
-
- //public Dictionary<string, string> TimeAttribute = new Dictionary<string, string>();
- public TimeAttributeObj TimeAttribute = new TimeAttributeObj();
- /// <summary>
- /// 閫昏緫鏉′欢鍒楄〃
- /// </summary>
- public List<Dictionary<string, string>> Conditions = new List<Dictionary<string, string>>();
-
- /// <summary>
- /// 鏉′欢婊¤冻鍚庢墽琛岀殑鍔ㄤ綔鍒楄〃
- /// </summary>
- public List<Dictionary<string, object>> Actions = new List<Dictionary<string, object>>();
-
- /// <summary>
- /// 鍏宠仈app璐﹀彿鍒楄〃
- /// </summary>
- public List<Dictionary<string, string>> Accounts = new List<Dictionary<string, string>>();
-
- }
-
- /// <summary>
- /// 鎻忚堪閫昏緫鏃堕棿灞炴��
- /// </summary>
- [System.Serializable]
- public class TimeAttributeObj
- {
- public int Calendar;
- public int Repeat = 2;
- public int WeekDay;
- public int SetYear;
- public int MonthDate;
- public int SelectMonth;
- public List<int> SelectMonDate = new List<int>();
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
index df7d67c..37ff757 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -7,15 +7,15 @@
using Shared.R;
using ZigBee.Device;
-namespace Shared.Phone.Logic.DoorLockLogic
+namespace Shared.Phone.Device.Logic.DoorLockLogic
{
public class LockLogicCommunalPage : FrameLayout
{
public LockLogicCommunalPage()
{
- UserView.HomePage.Instance.RemoveViewByTag("Logic");
- Tag = "Logic";
+ UserView.HomePage.Instance.RemoveViewByTag("LockLogic");
+ Tag = "LockLogic";
}
EditText logicTextBox;
public void Show(Action action)
@@ -44,11 +44,11 @@
topRowLayout.AddChidren(titleName);
if (Common.Logic.CurrentLogic.LogicId != 0)
{
- titleName.Text = Language.StringByID(MyInternationalizationString.editautomation);
+ titleName.Text = Language.StringByID(MyInternationalizationString.editlinkageevent);
}
else
{
- titleName.Text = Language.StringByID(MyInternationalizationString.newautomation);
+ titleName.Text = Language.StringByID(MyInternationalizationString.addlinkageevent);
}
var clickBtn = new Button
@@ -78,9 +78,9 @@
action();
RemoveFromParent();
};
-
+
#endregion
-
+
var middle = new VerticalScrolViewLayout
{
@@ -192,17 +192,11 @@
///娣诲姞鏉′欢鐨勭偣鍑讳簨浠�
EventHandler<MouseEventArgs> conditionaddclick = (sender, e) =>
{
- if (Common.Logic.CurrentLogic.Conditions.Count == 1)
- {
- ConditionView(false);
- }
- else
- {
- var addCondition = new AddCondition();
- UserView.HomePage.Instance.AddChidren(addCondition);
- UserView.HomePage.Instance.PageIndex += 1;
- addCondition.Show();
- }
+ var addCondition = new AddCondition();
+ addCondition.conditionsIndex = -1;
+ UserView.HomePage.Instance.AddChidren(addCondition);
+ UserView.HomePage.Instance.PageIndex += 1;
+ addCondition.Show();
};
conditionadd.MouseUpEventHandler += conditionaddclick;
conditionadd1.MouseUpEventHandler += conditionaddclick;
@@ -210,40 +204,6 @@
ListConditions.Clear();
ListConditions.AddRange(Common.Logic.CurrentLogic.Conditions);
ListConditions.Add(new Dictionary<string, string>());
- if (Common.Logic.CurrentLogic.Conditions.Count > 1)
- {
- var row = new FrameLayout
- {
- Height = Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(row);
- var relationship = new Button
- {
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(60),
- TextAlignment = TextAlignment.CenterLeft,
- X = Application.GetRealWidth(58),
- TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
- };
- row.AddChidren(relationship);
- if (Common.Logic.CurrentLogic.Relationship == 0)
- {
- relationship.Text = Language.StringByID(MyInternationalizationString.followingconditions) + Language.StringByID(MyInternationalizationString.Allconditions);
- }
- else
- {
- relationship.Text = Language.StringByID(MyInternationalizationString.followingconditions) + Language.StringByID(MyInternationalizationString.anycondition);
- }
- EventHandler<MouseEventArgs> editclick = (sender, e) =>
- {
-
- ConditionView(true);
- };
- row.MouseUpEventHandler += editclick;
- relationship.MouseUpEventHandler += editclick;
-
- }
for (int i = 0; i < ListConditions.Count; i++)
{
if (i == (ListConditions.Count - 1))
@@ -272,24 +232,19 @@
Width = Application.GetRealWidth(300),
Y = Application.GetRealHeight(45 + 30),
TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- TextID = MyInternationalizationString.addconditions,
+ TextID = MyInternationalizationString.selectunlockingmode,
X = Application.GetRealWidth(390),
};
addfl.AddChidren(addtextbtn);
EventHandler<MouseEventArgs> addconditionsclick = (sender, e) =>
{
- if (Common.Logic.CurrentLogic.Conditions.Count == 1)
- {
- ConditionView(false);
- }
- else
- {
- var addCondition = new AddCondition();
- UserView.HomePage.Instance.AddChidren(addCondition);
- UserView.HomePage.Instance.PageIndex += 1;
- addCondition.Show();
- }
+ var addCondition = new AddCondition();
+ ///璁板綍绱㈠紩
+ addCondition.conditionsIndex = -1;
+ UserView.HomePage.Instance.AddChidren(addCondition);
+ UserView.HomePage.Instance.PageIndex += 1;
+ addCondition.Show();
};
addbtn.MouseUpEventHandler += addconditionsclick;
addtextbtn.MouseUpEventHandler += addconditionsclick;
@@ -368,26 +323,17 @@
BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
Text = Language.StringByID(MyInternationalizationString.edit),
TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+ Tag=i,
};
conditionsRowLayout.AddRightView(deviceedit);
deviceedit.MouseUpEventHandler += (sender, e) =>
{
-
- if (deviceinof.Type != DeviceType.DoorLock)
- {
- var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
- this.AddChidren(flMain);
- // DeviceStateCondition.CurrentDeviceView(flMain, deviceinof, true);
- }
- else
- {
- //var memberList = new MemberList();
- //UserView.HomePage.Instance.AddChidren(memberList);
- //UserView.HomePage.Instance.PageIndex += 1;
- //MemberList.edit = true;
- //memberList.Show(deviceinof);
- }
-
+ var addCondition = new AddCondition();
+ ///璁板綍绱㈠紩
+ addCondition.conditionsIndex = int.Parse(deviceedit.Tag.ToString());
+ UserView.HomePage.Instance.AddChidren(addCondition);
+ UserView.HomePage.Instance.PageIndex += 1;
+ addCondition.Show();
};
///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
@@ -404,31 +350,48 @@
switch (deviceinof.Type)
{
-
case DeviceType.DoorLock:
{
- for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
- {
- if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
- {
- if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
- {
- devicestatus.Text = conditions["Account"];
- break;
+ conditionIcon.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
+ //for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
+ //{
+ // if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
+ // {
+ // if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
+ // {
+ // devicestatus.Text = conditions["Account"];
+ // break;
+ // }
+ // }
+ //}
+ //(0鎸夐敭/3鍗�/15鎸囩汗)
+ switch (conditions["AttriButeId"])
+ {
+ case "0":
+ {
+ devicestatus.Text = Language.StringByID(MyInternationalizationString.lockpassword);
}
- }
+ break;
+ case "3":
+ {
+ devicestatus.Text = Language.StringByID(MyInternationalizationString.ic);
+ }
+ break;
+ case "15":
+ {
+ devicestatus.Text = Language.StringByID(MyInternationalizationString.fingerprint);
+ }
+ break;
}
+
}
break;
-
}
}
break;
-
-
}
///鍒犻櫎鎺т欢
var del = new Button
@@ -450,7 +413,7 @@
var lockLogicCommunalPage = new LockLogicCommunalPage();
UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
UserView.HomePage.Instance.PageIndex += 1;
- lockLogicCommunalPage.Show(()=> { });
+ lockLogicCommunalPage.Show(() => { });
}
};
alert.Show();
@@ -519,7 +482,7 @@
EventHandler<MouseEventArgs> btntargetaddclick = (sender, e) =>
{
Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
- var addAction = new Device.Logic.DoorLockLogic.AddAction();
+ var addAction = new AddAction();
UserView.HomePage.Instance.AddChidren(addAction);
UserView.HomePage.Instance.PageIndex += 1;
addAction.Show();
@@ -560,14 +523,14 @@
Width = Application.GetRealWidth(300),
Y = Application.GetRealHeight(45 + 30),
TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- TextID = MyInternationalizationString.addfunction,
+ TextID = MyInternationalizationString.lockaddaction,
X = Application.GetRealWidth(390),
};
addfl.AddChidren(addtextbtn);
EventHandler<MouseEventArgs> addfunctionclick = (sender, e) =>
{
Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
- var addAction = new Device.Logic.DoorLockLogic.AddAction();
+ var addAction = new AddAction();
UserView.HomePage.Instance.AddChidren(addAction);
UserView.HomePage.Instance.PageIndex += 1;
addAction.Show();
@@ -672,16 +635,10 @@
///缂栬緫鐐瑰嚮浜嬩欢
deviceedit.MouseUpEventHandler += (sender, e) =>
{
- //var deviceStatePage = new DeviceStatePage();
- //UserView.HomePage.Instance.AddChidren(deviceStatePage);
- //UserView.HomePage.Instance.PageIndex += 1;
- //deviceStatePage.IsDeviceEditor = true;
- //deviceStatePage.Show(deviceinof);
-
- //ActionModifyDeviceStateView(deviceinof);
+
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
this.AddChidren(flMain);
- //LogicDevicePage.CurrentDeviceStateView(flMain, deviceinof, true);
+ LockAddDevice.CurrentDeviceStateView(flMain, deviceinof, true);
};
@@ -976,7 +933,7 @@
}
break;
-
+
}
///鍒犻櫎鎺т欢
var del = new Button
@@ -995,11 +952,7 @@
if (e1)
{
Common.Logic.CurrentLogic.Actions.Remove(actions);
- //var logicCommunalPage = new LogicCommunalPage();
- //UserView.HomePage.Instance.AddChidren(logicCommunalPage);
- //UserView.HomePage.Instance.PageIndex += 1;
- //logicCommunalPage.Show(() => { });
- }
+ }
};
alert.Show();
@@ -1110,7 +1063,7 @@
custompushRowLayout.AddChidren(custompushback);
EventHandler<MouseEventArgs> customclick = (sender, e) =>
{
- var CustomText = new Device.Logic.CustomText();
+ var CustomText = new CustomText();
UserView.HomePage.Instance.AddChidren(CustomText);
UserView.HomePage.Instance.PageIndex += 1;
CustomText.Show();
@@ -1145,16 +1098,12 @@
btnsave.MouseUpEventHandler += async (sender, e) =>
{
var name = logicTextBox.Text.Trim();
- //if (Common.Logic.CurrentLogic.Conditions.Count != 0 && Common.Logic.CurrentLogic.Actions.Count != 0)
- //{
- // AddChidren(btnsave);
- //}
if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
{
new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
return;
}
- var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
+ var logicname = Common.Logic.LockLogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
if (logicname != null)
{
new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show();
@@ -1168,265 +1117,26 @@
if (Common.Logic.CurrentLogic.LogicId == 0)
{
//鍙戦�佹坊鍔犻�昏緫鍛戒护
- var logicifon = await Device.Logic.Send.AddModifyLogic(Common.Logic.CurrentLogic);
+ var logicifon = await Send.AddModifyLogic(Common.Logic.CurrentLogic);
if (logicifon != null && logicifon.LogicId != 0)
{
Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
- Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
+ Common.Logic.LockLogicList.Add(Common.Logic.CurrentLogic);
}
}
else
{
//鍙戦�佷慨鏀归�昏緫鍛戒护
- Device.Logic.Send.AddModifyLogic(Common.Logic.CurrentLogic);
+ Send.AddModifyLogic(Common.Logic.CurrentLogic);
}
CommonPage.Loading.Hide();
- //UserView.HomePage.Instance.RemoveViewByTag("Logic");
- //Category.Category.instance?.RefreshBodyView();
- //UserView.HomePage.Instance.RemoveAt("Logic1");
- //Category.Category category = new Category.Category();
- //UserView.HomePage.Instance.AddChidren(category);
- //UserView.HomePage.Instance.PageIndex += 1;
- //category.Show(2);
- };
-
-
- }
-
-
- void ConditionView(bool edit)
- {
- Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
-
- #region 缁勫悎鏉′欢View
- FrameLayout flMain = new FrameLayout { BackgroundColor = 0x50000000 };
- this.AddChidren(flMain);
- flMain.MouseUpEventHandler += (sender2, e2) =>
- {
- flMain.RemoveFromParent();
- };
-
- var timetypeframelayout1 = new FrameLayout
- {
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(100),
- Y = Application.GetRealHeight(1920 - 100),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- };
- flMain.AddChidren(timetypeframelayout1);
- var framelayout = new FrameLayout
- {
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(530),
- Y = Application.GetRealHeight(1920 - 530),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- Radius = (uint)Application.GetRealHeight(60),
- };
- flMain.AddChidren(framelayout);
-
- #region -------鍙栨秷 瀹屾垚
- var timetype = new RowLayout
- {
- Height = Application.GetRealHeight(140),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- framelayout.AddChidren(timetype);
- var Btncancel = new Button
- {
- TextID = MyInternationalizationString.cancel,
- TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
- X = Application.GetRealWidth(80),
- TextAlignment = TextAlignment.CenterLeft,
- };
- timetype.AddChidren(Btncancel);
- Btncancel.MouseUpEventHandler += (sender16, e16) =>
- {
- flMain.RemoveFromParent();
- UserView.HomePage.Instance.ScrollEnabled = true;
- };
-
- var Btntitle = new Button
- {
- TextID = MyInternationalizationString.condition,
- TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(320),
- TextAlignment = TextAlignment.Center,
- X = Btncancel.Right + Application.GetRealWidth(100),
- TextSize = 16,
- };
- timetype.AddChidren(Btntitle);
- var Btncomplete = new Button
- {
- TextID = MyInternationalizationString.complete,
- TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
- TextAlignment = TextAlignment.CenterRight,
- X = Btntitle.Right + Application.GetRealWidth(100),
-
- };
- timetype.AddChidren(Btncomplete);
- #endregion
-
- #region -------婊¤冻鎵�鏈夋潯浠� 婊¤冻鍏朵腑涓�涓潯浠�
-
-
- #region -------婊¤冻鎵�鏈夋潯浠�
-
-
- var andFrameLayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = timetype.Bottom + Application.GetRealHeight(20),
- };
- framelayout.AddChidren(andFrameLayout);
-
-
- var androw = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(920),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(80),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- andFrameLayout.AddChidren(androw);
- var andbtn = new Button
- {
-
- Width = Application.GetRealWidth(600),
- TextID = MyInternationalizationString.Allconditions,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-
- };
- androw.AddChidren(andbtn);
-
- var andSelected = new Device.Logic.SelectedButton();
- androw.AddChidren(andSelected);
- #endregion
- #region -------婊¤冻鍏朵腑涓�涓潯浠�
-
- var orFrameLayout = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = andFrameLayout.Bottom,
-
- };
- framelayout.AddChidren(orFrameLayout);
-
-
-
- var orrow = new RowLayout
- {
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(920),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(80),
- LineColor = ZigbeeColor.Current.LogicBackgroundColor,
- };
- orFrameLayout.AddChidren(orrow);
- var orbtn = new Button
- {
-
- Width = Application.GetRealWidth(600),
- TextID = MyInternationalizationString.anycondition,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
- };
- orrow.AddChidren(orbtn);
-
- var orSelected = new Device.Logic.SelectedButton();
- orrow.AddChidren(orSelected);
- #endregion
- ///婊¤冻鎵�鏈夋潯浠剁偣鍑讳簨浠�
- EventHandler<MouseEventArgs> andclick = (sedner14, e14) =>
- {
- andSelected.Visible = true;
- orSelected.Visible = false;
- andbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- orbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- };
- androw.MouseUpEventHandler += andclick;
- andbtn.MouseUpEventHandler += andclick;
- andSelected.MouseUpEventHandler += andclick;
- andFrameLayout.MouseUpEventHandler += andclick;
-
-
- ///婊¤冻鍏朵腑涓�涓潯浠剁偣鍑讳簨浠�
- EventHandler<MouseEventArgs> orclick = (sedner15, e15) =>
- {
- andSelected.Visible = false;
- orSelected.Visible = true;
- andbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- orbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- };
- orrow.MouseUpEventHandler += orclick;
- orbtn.MouseUpEventHandler += orclick;
- orSelected.MouseUpEventHandler += orclick;
- orFrameLayout.MouseUpEventHandler += orclick;
-
- #endregion
- #endregion
-
- if (edit)
- {
- if (Common.Logic.CurrentLogic.Relationship == 0)
- {
- andSelected.Visible = true;
- orSelected.Visible = false;
- andbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- orbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- }
- else
- {
- andSelected.Visible = false;
- orSelected.Visible = true;
- andbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- orbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- }
- }
- Btncomplete.MouseUpEventHandler += (sender, e) =>
- {
- if (!andSelected.Visible && !orSelected.Visible)
- {
- ///鍙互鎻愮ず鏈�変腑鐘舵�侊紱
- return;
- }
- flMain.RemoveFromParent();
-
- if (andSelected.Visible)
- {
- Common.Logic.CurrentLogic.Relationship = 0;
-
- }
- if (orSelected.Visible)
- {
- Common.Logic.CurrentLogic.Relationship = 1;
-
- }
- if (edit)
- {
- if (Common.Logic.CurrentLogic.LogicId != 0)
- {
- Device.Logic.Send.LogicControlSwitch(Common.Logic.CurrentLogic);
- }
- var addCondition = new AddCondition();
- UserView.HomePage.Instance.AddChidren(addCondition);
- UserView.HomePage.Instance.PageIndex += 1;
- addCondition.Show();
- }
- else
- {
- var addCondition = new AddCondition();
- UserView.HomePage.Instance.AddChidren(addCondition);
- UserView.HomePage.Instance.PageIndex += 1;
- addCondition.Show();
- }
+ UserView.HomePage.Instance.RemoveViewByTag("LockLogic");
+ UserView.HomePage.Instance.RemoveViewByTag("LockLogicList");
+ var doorLockLogicList = new LockLogicList();
+ UserView.HomePage.Instance.AddChidren(doorLockLogicList);
+ UserView.HomePage.Instance.PageIndex += 1;
+ doorLockLogicList.Show();
};
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
new file mode 100755
index 0000000..8870208
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -0,0 +1,244 @@
+锘縰sing System;
+using Shared;
+using Shared.Common;
+using Shared.R;
+
+namespace Shared.Phone.Device.Logic.DoorLockLogic
+{
+ public class LockLogicList : FrameLayout
+ {
+
+ public LockLogicList()
+ {
+ Tag = "LockLogicList";
+ }
+ VerticalScrolViewLayout middle;
+ public async void Show()
+ {
+
+ #region 鏈�涓婇潰鐨勫竷灞�浠g爜
+ var topRowLayout = new RowLayout
+ {
+ BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
+ Height = Application.GetRealHeight(184),
+ LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
+ };
+ this.AddChidren(topRowLayout);
+
+ var titleName = new Button
+ {
+ TextSize = 16,
+ TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ TextAlignment = TextAlignment.CenterLeft,
+ X = Application.GetRealWidth(176),
+ Width = Application.GetRealWidth(400),
+ Height = Application.GetRealHeight(69),
+ Y = Application.GetRealHeight(92),
+ TextID = MyInternationalizationString.linkageevent,
+ };
+ topRowLayout.AddChidren(titleName);
+
+ var clickBtn = new Button
+ {
+ Width = Application.GetRealWidth(81 + 51),
+ Height = Application.GetRealHeight(58 + 40),
+ Y = Application.GetRealHeight(98 - 40),
+ };
+ topRowLayout.AddChidren(clickBtn);
+ clickBtn.MouseDownEventHandler += (sender, e) =>
+ {
+ RemoveFromParent();
+ };
+
+ var back = new Button
+ {
+ Width = Application.GetRealWidth(30),
+ Height = Application.GetRealHeight(51),
+ X = Application.GetRealWidth(81),
+ Y = Application.GetRealHeight(98),
+ //Gravity = Gravity.CenterVertical;
+ UnSelectedImagePath = "ZigeeLogic/back.png",
+ };
+ topRowLayout.AddChidren(back);
+ back.MouseDownEventHandler += (sender, e) =>
+ {
+ RemoveFromParent();
+ };
+
+ var addiocn = new Button
+ {
+ Width = Application.GetRealWidth(72),
+ Height = Application.GetRealHeight(72),
+ X = Application.GetRealWidth(1080 - 108 - 58),
+ UnSelectedImagePath = "ZigeeLogic/lockadd.png",
+ Y = Application.GetRealHeight(184 - 72 - 20),
+ };
+ topRowLayout.AddChidren(addiocn);
+ addiocn.MouseUpEventHandler += (sender, e) =>
+ {
+ //new涓�涓柊閫昏緫瀵硅薄锛�
+ Common.Logic.CurrentLogic = new Common.Logic();
+ Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
+ Common.Logic.CurrentLogic.LogicType = 1;
+ Common.Logic.CurrentLogic.Relationship = 1;
+ //Config.Instance.Guid鐢ㄦ潵璇嗗埆璐﹀彿韬唤锛�
+ var accounts = new System.Collections.Generic.Dictionary<string, string>();
+ accounts.Add("Account", Config.Instance.Guid);
+ Common.Logic.CurrentLogic.Accounts.Add(accounts);
+ Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
+ var lockLogicCommunalPage = new LockLogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ lockLogicCommunalPage.Show(() => { });
+ };
+ #endregion
+
+ middle = new VerticalScrolViewLayout
+ {
+ Y = topRowLayout.Bottom,
+ Height = Application.GetRealHeight(1920 - 184),
+ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ };
+ this.AddChidren(middle);
+
+ CommonPage.Loading.Start();
+ if (Common.Logic.LockLogicList.Count == 0)
+ {
+ var Idlist = await Send.GetLogicId(1);
+ if (Idlist.Count != 0)
+ {
+ var listlogic = await Send.ReadList(Idlist.Count, 1);
+ //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆�
+ for (int j = 0; j < listlogic.Count; j++)
+ {
+ var logic = listlogic[j];
+ if (logic.LogicType == 0)
+ {
+ continue;
+ }
+ bool yes = false;
+ for (int a = 0; a < logic.Accounts.Count; a++)
+ {
+ if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid)
+ {
+ //鏌ユ壘鑷繁璐﹀彿涓嬬殑鍒涘缓鑱斿姩浜嬩欢锛�
+ yes = true;
+ break;
+ }
+ }
+ if (yes)
+ {
+ Common.Logic.LockLogicList.Add(listlogic[j]);
+ }
+ }
+ }
+ }
+ //鑷姩鍖�
+ Automationview();
+ CommonPage.Loading.Hide();
+ }
+
+ void Automationview()
+ {
+ middle.RemoveAll();
+ for (int i = 0; i < Common.Logic.LockLogicList.Count; i++)
+ {
+ var logic = Common.Logic.LockLogicList[i];
+ var logicRowlayout = new RowLayout
+ {
+ Width = Application.GetRealWidth(1080),
+ Height = Application.GetRealHeight(190),
+ LineColor = ZigbeeColor.Current.LogicBackgroundColor,
+ BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+
+ };
+ middle.AddChidren(logicRowlayout);
+
+ var logicnameBtn = new Button
+ {
+ Height = Application.GetRealHeight(190),
+ Width = Application.GetRealWidth(600),
+ Text = logic.LogicName,
+ X = Application.GetRealWidth(58),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ Gravity = Gravity.CenterVertical,
+ };
+ 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),
+ Gravity = Gravity.CenterVertical,
+ };
+ logicRowlayout.AddChidren(logicswitchBtn);
+
+ logicswitchBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ logicswitchBtn.IsSelected = !logicswitchBtn.IsSelected;
+ if (logicswitchBtn.IsSelected)
+ {
+ //閫昏緫寮�
+ logic.IsEnable = 1;
+ }
+ else
+ {
+ //閫昏緫鍏�
+ logic.IsEnable = 0;
+ }
+ Send.LogicControlSwitch(logic);
+
+ };
+ ///缂栬緫
+ 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 lockLogicCommunalPage = new LockLogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ lockLogicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(); });
+
+ };
+
+
+ ///鍒犻櫎
+ var del = new Button
+ {
+ BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
+ Text = Language.StringByID(MyInternationalizationString.del),
+ TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+ };
+ logicRowlayout.AddRightView(del);
+ del.MouseUpEventHandler += (sender, e) =>
+ {
+ var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+ Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
+ alert.ResultEventHandler += (sender1, e1) =>
+ {
+ if (e1)
+ {
+ Common.Logic.LogicList.Remove(logic);
+ Automationview();
+ Send.DelLogic(logic.LogicId);
+ }
+ };
+ alert.Show();
+
+ };
+ }
+
+ }
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
index d6f3727..4f954b9 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -718,6 +718,7 @@
break;
case DeviceType.DoorLock:
{
+ conditionIcon.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
{
if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
@@ -1184,13 +1185,6 @@
///缂栬緫鐐瑰嚮浜嬩欢
deviceedit.MouseUpEventHandler += (sender, e) =>
{
- //var deviceStatePage = new DeviceStatePage();
- //UserView.HomePage.Instance.AddChidren(deviceStatePage);
- //UserView.HomePage.Instance.PageIndex += 1;
- //deviceStatePage.IsDeviceEditor = true;
- //deviceStatePage.Show(deviceinof);
-
- //ActionModifyDeviceStateView(deviceinof);
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
this.AddChidren(flMain);
LogicDevicePage.CurrentDeviceStateView(flMain, deviceinof, true);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
index 5174ff6..78c77e8 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
@@ -119,7 +119,6 @@
Common.Logic.CurrentLogic.Conditions.Add(objecttype);
}
#endregion
-
#region ----閫昏緫杈撳嚭鐩爣----
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
index 348124f..a4e865e 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -14,7 +14,7 @@
/// 鑾峰彇LogicId鐨勬柟娉�
/// </summary>
/// <returns>The logic identifier.</returns>
- public static async System.Threading.Tasks.Task<List<int>> GetLogicId()
+ public static async System.Threading.Tasks.Task<List<int>> GetLogicId(int LogicType)
{
return await System.Threading.Tasks.Task.Run(async () =>
{
@@ -53,6 +53,8 @@
mainGateWay.GwResDataAction += action;
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2004 } };
+ var jObjectdata1 = new JObject { { "LogicType", LogicType } };
+ jObject.Add("Data", jObjectdata1);
mainGateWay?.Send("Logic/GetLogicList", jObject.ToString());
//await System.Threading.Tasks.Task.Run(async () =>
//{
@@ -74,7 +76,7 @@
/// 鑾峰彇Logic鐨勬柟娉�
/// </summary>
/// <returns>The logic identifier.</returns>
- public static async System.Threading.Tasks.Task<Common.Logic> GetLogic(int LogicId)
+ public static async System.Threading.Tasks.Task<Common.Logic> GetLogic(int LogicId,int LogicType)
{
return await System.Threading.Tasks.Task.Run(async () =>
{
@@ -149,7 +151,8 @@
{
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2002 } };
var data = new JObject {
- { "LogicId",LogicId}
+ { "LogicId",LogicId},
+ { "LogicType",LogicType}
};
jObject.Add("Data", data);
ZbGateway.MainGateWay?.Send("Logic/GetLogicInfo", jObject.ToString());
@@ -566,13 +569,13 @@
/// 鑾峰彇Logic鍒楄〃鐨勬柟娉�
/// </summary>
/// <returns>The logic identifier.</returns>
- public static async System.Threading.Tasks.Task<List<Common.Logic>> ReadList(int sum)
+ public static async System.Threading.Tasks.Task<List<Common.Logic>> ReadList(int sum,int LogicType)
{
return await System.Threading.Tasks.Task.Run(async () =>
{
var listLogic = new List<Common.Logic>();
- bool @bool = false;
+ // bool @bool = false;
Action<string, string> action = (topic, data) =>
{
var gatewayID = topic.Split('/')[0];
@@ -590,6 +593,7 @@
logic.LogicId = int.Parse(Logicifon["LogicId"].ToString());
logic.IsEnable = int.Parse(Logicifon["IsEnable"].ToString());
logic.LogicName = Logicifon["LogicName"].ToString();
+ logic.LogicType = int.Parse(Logicifon["LogicType"].ToString());
logic.Relationship = int.Parse(Logicifon["Relationship"].ToString());
logic.TimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.TimeAttributeObj>(Logicifon["TimeAttribute"].ToString());
logic.Conditions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Conditions"].ToString());
@@ -639,10 +643,10 @@
}
}
- if (topic == $"{gatewayID}/Logic/AllLogicNum_Respon")
- {
- @bool = true;
- }
+ //if (topic == $"{gatewayID}/Logic/AllLogicNum_Respon")
+ //{
+ // @bool = true;
+ //}
};
var mainGateWay = ZbGateway.MainGateWay;
if (mainGateWay == null)
@@ -654,6 +658,8 @@
try
{
var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 2015 } };
+ var jObjectdata = new JObject { { "LogicType", LogicType } };
+ jObject.Add("Data", jObjectdata);
ZbGateway.MainGateWay?.Send("Logic/GetAllLogicListInfo", jObject.ToString());
}
catch { }
@@ -661,14 +667,14 @@
while ((DateTime.Now - dateTime).TotalMilliseconds < 8 * 1000)
{
await System.Threading.Tasks.Task.Delay(100);
- //if (sum == listLogic.Count)
- //{
- // break;
- //}
- if (@bool)
+ if (sum == listLogic.Count)
{
break;
}
+ //if (@bool)
+ //{
+ // break;
+ //}
}
ZbGateway.MainGateWay.GwResDataAction -= action;
return listLogic;
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomScene.cs b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomScene.cs
index 73f1753..26b318e 100755
--- a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomScene.cs
@@ -468,9 +468,9 @@
Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
localPic.Show();
- localPic.action = () =>
+ localPic.action = (imgPath) =>
{
- backGround.UnSelectedImagePath = ImagePath;
+ backGround.UnSelectedImagePath = imgPath;
IconType = 0;
};
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs b/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs
index 278128d..2b19869 100755
--- a/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs
@@ -93,7 +93,7 @@
{
var floors = new SelectFloor();
AddChidren(floors);
- floors.Init(599, 161);
+ floors.Init(599, 161,Direction.Right);
floors.FloorAction += (floorName) =>
{
floorBtn.Text = floorName;
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs
index 709f0be..55a51f1 100755
--- a/ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/UnallocatedRoom.cs
@@ -245,8 +245,6 @@
{
SelectAll = selectAll;
//閫夋嫨鍔熻兘--鐩存帴浠庢埧闂寸殑devicelist涓幏鍙�
- Shared.Common.Room.GetAllRoomDeviceUIList();
- Shared.Common.Room.GetAllRoomDeviceTypeList();
if (Common.Room.AllRoomDeviceUIList == null)
{
return;
@@ -300,9 +298,8 @@
typeRowLayout.AddChidren(functionTypeIMG);
- functionTypeIMG.ImageBtn.MouseUpEventHandler += ShowSameTypeFunction;
- functionTypeIMG.NameBtn.MouseUpEventHandler += ShowSameTypeFunction;
- functionTypeIMG.ImageBG.MouseUpEventHandler += ShowSameTypeFunction;
+ functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
+
if (deviceType == Shared.Common.Room.AllRoomDeviceUIList[0].CommonDevice.Type)
{
@@ -320,7 +317,6 @@
private void ShowSameTypeFunction(object typeSender, MouseEventArgs mouseEventArgs)
{
//閫夋嫨鍔熻兘--鐩存帴浠庢埧闂寸殑devicelist涓幏鍙�
- Shared.Common.Room.GetAllRoomDeviceUIList();
tempFunctionTypeBtn.IsSelected = false;
tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton;
((typeSender as Button).Parent as FunctionButton).IsSelected = true;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs
index 4608454..0dcddac 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs
@@ -75,8 +75,10 @@
dic["BeRestrict"] = R.MyInternationalizationString.uBeRestrict;
//琚粦瀹氱殑瀛愯处鍙蜂笉瀛樺湪锛岃娉ㄥ唽鍚庡啀璇�
dic["AccountNoExists"] = R.MyInternationalizationString.BindSubAccount_AccountNoExists;
- //涓嶈兘娣诲姞鑷繁涓哄瓙璐﹀彿
+ //涓嶈兘鎶婅嚜宸辨坊鍔犱负鎴愬憳
dic["SameAccount"] = R.MyInternationalizationString.BindSubAccount_SameAccount;
+ //涓嶈兘鎶婁富璐﹀彿娣诲姞涓烘垚鍛�
+ dic["NoAddMainAccount"] = R.MyInternationalizationString.BindSubAccount_NoAddMainAccount;
//鍗囩骇鎴栭檷绾у瓙璐﹀彿
keys = "ZigbeeUsers/UpSubAccount";
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
index 5d191f4..9d754ef 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
@@ -240,7 +240,7 @@
{
var btnShadow = new PicViewControl(this.Width, Application.GetMinRealAverage(45), false);
btnShadow.X = this.X;
- btnShadow.Y = this.Bottom - 1;
+ btnShadow.Y = this.Bottom;
btnShadow.UnSelectedImagePath = "Item/BottomShadow.png";
this.Parent.AddChidren(btnShadow);
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs
index 9b4ae07..1e1babd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/BelongAreaControl.cs
@@ -131,9 +131,15 @@
txtView.Y += chidrenYaxis;
}
- if (IsSharedRoom == true || this.listFloorKeys.Count == 0)
+ if (IsSharedRoom == true)
{
- //濡傛灉杩欎釜璁惧浣嶄簬鍒嗕韩鐨勬埧闂�,鎴栬�呮牴鏈氨娌℃湁鍒涘缓鎴块棿锛屽垯涓嶅厑璁告洿鏀�
+ //濡傛灉杩欎釜璁惧浣嶄簬鍒嗕韩鐨勬埧闂�
+ this.UseClickStatu = false;
+ return;
+ }
+ if (this.listFloorKeys.Count == 0 && listRoomKeys.Count == 0)
+ {
+ //鎴栬�呮牴鏈氨娌℃湁鍒涘缓鎴块棿锛屽垯涓嶅厑璁告洿鏀�
this.UseClickStatu = false;
return;
}
@@ -153,14 +159,11 @@
private void InitData()
{
var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
- foreach (string fKeys in dicFloor.Keys)
+ if (dicFloor.Count == 0)
{
- var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(fKeys, false);
+ var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(string.Empty, false);
if (listRoom.Count > 0)
{
- //妤煎眰鍚嶅瓧鍜屼富閿敹闆�
- this.listFloorKeys.Add(fKeys);
- this.listFloorName.Add(dicFloor[fKeys]);
//鎴块棿鍚嶅瓧鍜屼富閿敹闆�
var listName = new List<string>();
var listKeys = new List<string>();
@@ -171,6 +174,29 @@
}
listRoomName.Add(listName);
listRoomKeys.Add(listKeys);
+ }
+ }
+ else
+ {
+ foreach (string fKeys in dicFloor.Keys)
+ {
+ var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(fKeys, false);
+ if (listRoom.Count > 0)
+ {
+ //妤煎眰鍚嶅瓧鍜屼富閿敹闆�
+ this.listFloorKeys.Add(fKeys);
+ this.listFloorName.Add(dicFloor[fKeys]);
+ //鎴块棿鍚嶅瓧鍜屼富閿敹闆�
+ var listName = new List<string>();
+ var listKeys = new List<string>();
+ foreach (var myRoom in listRoom)
+ {
+ listName.Add(myRoom.Name);
+ listKeys.Add(myRoom.Id);
+ }
+ listRoomName.Add(listName);
+ listRoomKeys.Add(listKeys);
+ }
}
}
}
@@ -191,17 +217,35 @@
int index2 = this.listRoomKeys[index1].IndexOf(RoomKey);
if (index2 == -1) { index2 = 0; }
- PickerView.ShowSecondary(this.listFloorName, this.listRoomName, (value1, value2) =>
+ if (this.listFloorKeys.Count == 0)
{
- //妤煎眰+鎴块棿
- txtView.Text = this.listFloorName[value1] + " " + this.listRoomName[value1][value2];
- FloorKey = this.listFloorKeys[value1];
- RoomKey = this.listRoomKeys[value1][value2];
- this.SelectRoomEvent?.Invoke(RoomKey);
+ //鏃犳ゼ灞傛ā寮�
+ PickerView.Show(this.listRoomName[0], (value) =>
+ {
+ //妤煎眰+鎴块棿
+ txtView.Text = this.listRoomName[0][value];
+ RoomKey = this.listRoomKeys[0][value];
+ this.SelectRoomEvent?.Invoke(RoomKey);
- }, index1, index2, i_caption,
- Language.StringByID(R.MyInternationalizationString.uFinish),
- Language.StringByID(R.MyInternationalizationString.uCancel));
+ }, index2, i_caption,
+ Language.StringByID(R.MyInternationalizationString.uFinish),
+ Language.StringByID(R.MyInternationalizationString.uCancel));
+ }
+ else
+ {
+ //鏈夋ゼ灞傛ā寮�
+ PickerView.ShowSecondary(this.listFloorName, this.listRoomName, (value1, value2) =>
+ {
+ //妤煎眰+鎴块棿
+ txtView.Text = this.listFloorName[value1] + " " + this.listRoomName[value1][value2];
+ FloorKey = this.listFloorKeys[value1];
+ RoomKey = this.listRoomKeys[value1][value2];
+ this.SelectRoomEvent?.Invoke(RoomKey);
+
+ }, index1, index2, i_caption,
+ Language.StringByID(R.MyInternationalizationString.uFinish),
+ Language.StringByID(R.MyInternationalizationString.uCancel));
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs
index 3d529e1..4eb84cc 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs
@@ -19,6 +19,10 @@
/// 鏈�澶ч珮搴�
/// </summary>
private int maxHeight = -1;
+ /// <summary>
+ /// 涓�涓病浠�涔堢敤鐨勪笢瑗�
+ /// </summary>
+ private FrameLayout frameBackTemp = null;
#endregion
@@ -78,24 +82,32 @@
/// <param name="addSpace">褰撶湡瀹為珮搴﹁秴杩囧師鏈夐珮搴︽椂,鏄惁娣诲姞绌虹櫧</param>
public void AdjustRealHeight(int bottomSpace, bool addSpace = true)
{
- if (this.ChildrenCount == 0)
+ int count = frameBackTemp == null ? this.ChildrenCount : this.ChildrenCount - 1;
+ if (count <= 0)
{
+ frameBackTemp?.RemoveFromParent();
+ frameBackTemp = null;
//杩樺師涓烘渶澶ч珮搴�
this.Height = maxHeight;
return;
}
+
//璋冩暣鍒楄〃鎺т欢鐨勯珮搴�
- var realHeight = this.ChildrenCount * this.GetChildren(0).Height + bottomSpace;
+ var realHeight = count * this.GetChildren(0).Height + bottomSpace;
if (realHeight < this.Height)
{
+ frameBackTemp?.RemoveFromParent();
+ frameBackTemp = null;
//缂╁皬鎺т欢楂樺害
this.Height = realHeight;
}
else if (addSpace == true && bottomSpace > 0 && realHeight > this.maxHeight)
{
- var frameBack = new FrameLayout();
- frameBack.Height = bottomSpace;
- this.AddChidren(frameBack);
+ frameBackTemp?.RemoveFromParent();
+
+ frameBackTemp = new FrameLayout();
+ frameBackTemp.Height = bottomSpace;
+ this.AddChidren(frameBackTemp);
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/EditorCommonForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/EditorCommonForm.cs
index 3be4e71..2bde57d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/EditorCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/EditorCommonForm.cs
@@ -235,8 +235,38 @@
#endregion
- #region 鈻� 娓呯┖BodyFrame______________________
+ #region 鈻� 鏄剧ず娌℃湁鏁版嵁鐨勫浘鍍忔樉绀虹壒鏁坃________
+ /// <summary>
+ /// 鏄剧ず娌℃湁鏁版嵁鐨勫浘鍍忔樉绀虹壒鏁�
+ /// </summary>
+ /// <param name="frameTable">瀹瑰櫒</param>
+ /// <param name="i_Text">鏄剧ず鏂囧瓧</param>
+ /// <param name="Imagepath">鍥惧儚鍦板潃</param>
+ /// <param name="imageWith">鍥惧儚瀹藉害(闈炵湡瀹炲��)</param>
+ /// <param name="imageHeight">鍥惧儚楂樺害(闈炵湡瀹炲��)</param>
+ public void ShowNotDataImage(FrameLayout frameTable, string i_Text, string Imagepath = "Item/NoFunction.png", int imageWith = 683, int imageHeight = 392)
+ {
+ //杩樻病鏈夌粦瀹氱綉鍏冲摝
+ var btnPic = new PicViewControl(imageWith, imageHeight);
+ btnPic.UnSelectedImagePath = Imagepath;
+ btnPic.Y = (int)(frameTable.Height * 0.382) - Application.GetRealHeight(imageHeight / 2);
+ btnPic.Gravity = Gravity.CenterHorizontal;
+ frameTable.AddChidren(btnPic);
+
+ var btnView = new NormalViewControl(frameTable.Width, Application.GetRealHeight(50), false);
+ btnView.Y = btnPic.Bottom + Application.GetRealHeight(32);
+ btnView.Text = i_Text;
+ btnView.TextAlignment = TextAlignment.Center;
+ btnView.TextSize = 12;
+ btnView.TextColor = UserCenterColor.Current.TextGrayColor1;
+ frameTable.AddChidren(btnView);
+ return;
+ }
+ #endregion
+
+ #region 鈻� 娓呯┖BodyFrame______________________
+
/// <summary>
/// 娓呯┖BodyFrame
/// </summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs
new file mode 100755
index 0000000..c0de009
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs
@@ -0,0 +1,143 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 绌鸿皟鐨勯�昏緫
+ /// </summary>
+ public class HdlDeviceAirConditionerLogic
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 绌鸿皟鐨勯�昏緫
+ /// </summary>
+ private static HdlDeviceAirConditionerLogic m_Current = null;
+ /// <summary>
+ /// 绌鸿皟鐨勯�昏緫
+ /// </summary>
+ public static HdlDeviceAirConditionerLogic Current
+ {
+ get
+ {
+ if (m_Current == null)
+ {
+ m_Current = new HdlDeviceAirConditionerLogic();
+ }
+ return m_Current;
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鎵撳紑绌鸿皟___________________________
+
+ /// <summary>
+ /// 鎵撳紑绌鸿皟
+ /// </summary>
+ /// <param name="device">绌鸿皟瀵硅薄</param>
+ /// <returns></returns>
+ public async Task<bool> OpenAirConditioner(AC device)
+ {
+ var result = await device.Open();
+ //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
+ string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+ if (error != null)
+ {
+ this.ShowTipMsg(error);
+ return false;
+ }
+ if (result == null || result.setWritableValueResponData == null || result.setWritableValueResponData.Status != 0)
+ {
+ //鎵撳紑绌鸿皟澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.uOpenAirConditionerFail);
+ //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
+ msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+ this.ShowTipMsg(msg);
+ return false;
+ }
+ if (result.setWritableValueResponData.Status != 0)
+ {
+ //鎵撳紑绌鸿皟澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.uOpenAirConditionerFail);
+ this.ShowTipMsg(msg);
+ return false;
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region 鈻� 鎵撳紑绌鸿皟___________________________
+
+ /// <summary>
+ /// 鎵撳紑绌鸿皟
+ /// </summary>
+ /// <param name="device">绌鸿皟瀵硅薄</param>
+ /// <returns></returns>
+ public async Task<bool> CloseAirConditioner(AC device)
+ {
+ var result = await device.Close();
+ //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
+ string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
+ if (error != null)
+ {
+ this.ShowTipMsg(error);
+ return false;
+ }
+ if (result == null || result.setWritableValueResponData == null || result.setWritableValueResponData.Status != 0)
+ {
+ //鍏抽棴绌鸿皟澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.uCloseAirConditionerFail);
+ //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
+ msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+ this.ShowTipMsg(msg);
+ return false;
+ }
+ if (result.setWritableValueResponData.Status != 0)
+ {
+ //鍏抽棴绌鸿皟澶辫触
+ string msg = Language.StringByID(R.MyInternationalizationString.uCloseAirConditionerFail);
+ this.ShowTipMsg(msg);
+ return false;
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鏄剧ず閿欒淇℃伅绐楀彛
+ /// </summary>
+ /// <param name="msg"></param>
+ private void ShowErrorMsg(string msg)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var contr = new ShowMsgControl(ShowMsgType.Error, msg);
+ contr.Show();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ずTip淇℃伅绐楀彛
+ /// </summary>
+ /// <param name="msg"></param>
+ private void ShowTipMsg(string msg)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
+ contr.Show();
+ });
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
index fd35796..97e642b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -625,7 +625,7 @@
}
//鑾峰彇鍏ㄩ儴璁惧
- bool result = await LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay);
+ bool result = LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay);
//鍏抽棴杩涘害鏉�
ProgressBar.Close();
if (result == false)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
index eba7f4b..df93dac 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
@@ -60,11 +60,11 @@
{
lock (objLock)
{
- if (div != -1)
- {
- //鏆傛椂鍙褰曞紓甯镐俊鎭�
- return;
- }
+ //if (div != -1)
+ //{
+ // //鏆傛椂鍙褰曞紓甯镐俊鎭�
+ // return;
+ //}
//Log鏂囦欢
string fileName = this.GetLogFile(div);
string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory, fileName);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs
new file mode 100755
index 0000000..d413616
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/AirConditionerModeForm.cs
@@ -0,0 +1,110 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.DeviceAirConditioner
+{
+ /// <summary>
+ /// 绌鸿皟妯″紡鐨勭晫闈�
+ /// </summary>
+ public class AirConditionerModeForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 褰撳墠閫夋嫨鐨勭綉鍏�
+ /// </summary>
+ private AC deviceAc = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_deviceAc">閫夋嫨鐨勭┖璋冨洖璺�</param>
+ public void ShowForm(AC i_deviceAc)
+ {
+ this.deviceAc = i_deviceAc;
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAirConditionerMode));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ var listView = new VerticalListControl(29);
+ listView.Y = Application.GetRealHeight(-6);
+ listView.BackgroundColor = UserCenterColor.Current.White;
+ listView.Height = bodyFrameLayout.Height + Application.GetRealHeight(6);
+ bodyFrameLayout.AddChidren(listView);
+
+ //鍒跺喎
+ this.AddAirConditionerModeRow(listView, "AC/Mode_Cool2.png", Language.StringByID(R.MyInternationalizationString.uMode_Cool), 1);
+ //鍒剁儹
+ this.AddAirConditionerModeRow(listView, "AC/Mode_Heat2.png", Language.StringByID(R.MyInternationalizationString.uMode_Heat), 2);
+ //鑷姩
+ this.AddAirConditionerModeRow(listView, "AC/Mode_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.uMode_Auto), 3);
+ //閫侀
+ this.AddAirConditionerModeRow(listView, "AC/Mode_Fan2.png", Language.StringByID(R.MyInternationalizationString.uMode_FanOnly), 4);
+ //闄ゆ箍
+ this.AddAirConditionerModeRow(listView, "AC/Mode_Dry2.png", Language.StringByID(R.MyInternationalizationString.uMode_Dry), 5);
+
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
+
+ //淇濆瓨
+ var btnOk = new BottomClickButton();
+ btnOk.TextID = R.MyInternationalizationString.uSave;
+ bodyFrameLayout.AddChidren(btnOk);
+ btnOk.ButtonClickEvent += (sender, e) =>
+ {
+ this.CloseForm();
+ };
+ }
+
+ /// <summary>
+ /// 娣诲姞绌鸿皟妯″紡琛�
+ /// </summary>
+ /// <param name="listView">鍒楄〃鎺т欢</param>
+ /// <param name="imagePath">鍥剧墖鍦板潃</param>
+ /// <param name="textValue">鏄剧ず鏂囨湰</param>
+ /// <param name="div">鍖哄垎</param>
+ private void AddAirConditionerModeRow(VerticalListControl listView, string imagePath, string textValue, int div)
+ {
+ var rowFrame = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowFrame);
+ //鍥炬爣
+ var btnIcon = rowFrame.AddLeftIcon(81);
+ btnIcon.UnSelectedImagePath = imagePath;
+ //鏄剧ず鏂囨湰
+ var btnText = rowFrame.AddLeftCaption(textValue, 400);
+ btnText.TextSize = 15;
+ if (div != 5)
+ {
+ //搴曠嚎
+ rowFrame.AddBottomLine();
+ }
+ //閫夋嫨
+ var btnSelect = rowFrame.AddMostRightEmptyIcon(58, 58);
+ btnSelect.Visible = false;
+ btnSelect.UnSelectedImagePath = "Item/ItemSelected.png";
+ rowFrame.ButtonClickEvent += (sender, e) =>
+ {
+ btnSelect.Visible = !btnSelect.Visible;
+ };
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
new file mode 100755
index 0000000..2c63cd3
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
@@ -0,0 +1,333 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.DeviceAirConditioner
+{
+ /// <summary>
+ /// 绌鸿皟鐨勫鍐呮満鍒楄〃鐣岄潰
+ /// </summary>
+ public class IndoorUnitListForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 璁惧鍒楄〃
+ /// </summary>
+ private List<CommonDevice> listDevice = null;
+ /// <summary>
+ /// 鎺т欢淇℃伅
+ /// </summary>
+ private Dictionary<string, RowControlInfo> dicControl = new Dictionary<string, RowControlInfo>();
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_diviceMac">璁惧Mac鍦板潃</param>
+ public void ShowForm(string i_diviceMac)
+ {
+ this.listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_diviceMac);
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uIndoorUnitSettion));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ var listView = new VerticalFrameControl(14);
+ listView.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listView);
+
+ var frameTemp = new FrameLayout();
+ frameTemp.Height = Application.GetRealHeight(69);
+ listView.AddChidrenFrame(frameTemp);
+
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ for (int i = 0; i < listDevice.Count; i++)
+ {
+ //娣诲姞绌鸿皟琛�
+ this.AddAcControlRow(listView, (AC)listDevice[i]);
+ }
+ var frameTemp2 = new FrameLayout();
+ frameTemp2.Height = Application.GetRealHeight(29);
+ listView.AddChidrenFrame(frameTemp2);
+
+ //鏁版嵁鎺ユ敹
+ this.StartReceiveDataEvent();
+ //鍙戦�佽鍙栧睘鎬х殑鍛戒护
+ this.SetReadAttributeComand();
+ });
+ }
+
+ /// <summary>
+ /// 娣诲姞绌鸿皟琛�
+ /// </summary>
+ /// <param name="listView"></param>
+ /// <param name="device"></param>
+ private void AddAcControlRow(VerticalFrameControl listView, AC device)
+ {
+ var rowInfo = new RowControlInfo();
+
+ var frameTable = new FrameLayoutControl();
+ frameTable.UseClickStatu = false;
+ frameTable.Width = Application.GetRealWidth(994);
+ frameTable.Height = Application.GetRealHeight(337);
+ frameTable.BackgroundImagePath = "Item/IndoorUnitGround.png";
+ frameTable.Gravity = Gravity.CenterHorizontal;
+ listView.AddChidrenFrame(frameTable);
+
+ //璁惧鍥炬爣
+ var btnIconBack = new FrameLayout();
+ btnIconBack.X = Application.GetRealWidth(46);
+ btnIconBack.Y = Application.GetRealHeight(43);
+ btnIconBack.Height = Application.GetMinRealAverage(112);
+ btnIconBack.Width = Application.GetMinRealAverage(112);
+ btnIconBack.Radius = (uint)Application.GetMinRealAverage(112) / 2;
+ btnIconBack.BackgroundColor = 0xfff5f6fa;
+ frameTable.AddChidren(btnIconBack, ChidrenBindMode.NotBind);
+ rowInfo.btnIconBack = btnIconBack;
+
+ var btnIcon = new IconViewControl(78);
+ btnIcon.Gravity = Gravity.Center;
+ Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
+ btnIconBack.AddChidren(btnIcon);
+ frameTable.ChangedChidrenBindMode(btnIconBack, ChidrenBindMode.BindEventOnly);
+ rowInfo.btnIcon = btnIcon;
+
+ //璁惧鍚嶇О
+ var btnDeviceName = new NormalViewControl(400, 60, true);
+ btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
+ btnDeviceName.X = Application.GetRealWidth(193);
+ btnDeviceName.Y = Application.GetRealHeight(45);
+ frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+ //鎴块棿
+ var btnRoom = new NormalViewControl(400, 50, true);
+ btnRoom.X = btnDeviceName.X;
+ btnRoom.Y = btnDeviceName.Bottom + Application.GetRealHeight(12);
+ btnRoom.TextSize = 12;
+ btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
+ frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
+ //鎽勬皬搴�
+ var btnValue = new NormalViewControl(150, 60, true);
+ btnValue.Y = Application.GetRealHeight(58);
+ btnValue.X = frameTable.Width - Application.GetRealWidth(150 + 58);
+ btnValue.TextAlignment = TextAlignment.CenterRight;
+ frameTable.AddChidren(btnValue, ChidrenBindMode.BindEventOnly);
+ rowInfo.btnValue = btnValue;
+ //璀﹀憡鍥炬爣
+ var btnWarningIcon = new IconViewControl(69);
+ btnWarningIcon.X = btnIconBack.X;
+ btnWarningIcon.Y = btnRoom.Bottom + Application.GetRealHeight(43);
+ btnWarningIcon.UnSelectedImagePath = "Item/WarningIcon1.png";
+ frameTable.AddChidren(btnWarningIcon, ChidrenBindMode.NotBind);
+ btnWarningIcon.Visible = false;
+ rowInfo.btnWarningIcon = btnWarningIcon;
+ //璀﹀憡淇℃伅
+ var btnWarningMsg = new NormalViewControl(500, 50, true);
+ btnWarningMsg.X = btnWarningIcon.Right + Application.GetRealWidth(12);
+ btnWarningMsg.Y = btnRoom.Bottom + Application.GetRealHeight(55);
+ btnWarningMsg.TextSize = 12;
+ btnWarningMsg.TextColor = UserCenterColor.Current.TextGrayColor1;
+ frameTable.AddChidren(btnWarningMsg, ChidrenBindMode.NotBind);
+ rowInfo.btnWarningMsg = btnWarningMsg;
+ //寮�鍏�
+ var btnSwitch = new IconViewControl(69);
+ btnSwitch.X = frameTable.Width - Application.GetRealWidth(69 + 46);
+ btnSwitch.Y = btnRoom.Bottom + Application.GetRealHeight(43);
+ btnSwitch.UnSelectedImagePath = "Item/Switch.png";
+ btnSwitch.SelectedImagePath = "Item/SwitchSelected.png";
+ frameTable.AddChidren(btnSwitch, ChidrenBindMode.NotBind);
+ rowInfo.btnSwitch = btnSwitch;
+ btnSwitch.ButtonClickEvent += async (sender, e) =>
+ {
+ if (btnSwitch.IsSelected == false)
+ {
+ //鎵撳紑绌鸿皟
+ var result = await HdlDeviceAirConditionerLogic.Current.OpenAirConditioner(device);
+ if (result == false)
+ {
+ return;
+ }
+ btnIcon.IsSelected = true;
+ btnIconBack.BackgroundColor = 0xfffef1ed;
+ }
+ else
+ {
+ //鍏抽棴绌鸿皟
+ var result = await HdlDeviceAirConditionerLogic.Current.CloseAirConditioner(device);
+ if (result == false)
+ {
+ return;
+ }
+ btnIcon.IsSelected = false;
+ btnIconBack.BackgroundColor = 0xfff5f6fa;
+ }
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ };
+
+ frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new IndoorUnitSettionForm();
+ form.AddForm(device);
+ };
+
+ dicControl[Common.LocalDevice.Current.GetDeviceMainKeys(device)] = rowInfo;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佸懡浠__________________________
+
+ /// <summary>
+ /// 鍙戦�佽鍙栧睘鎬х殑鍛戒护
+ /// </summary>
+ private void SetReadAttributeComand()
+ {
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ for (int i = 0; i < listDevice.Count; i++)
+ {
+ if (i != 0 && i % 5 == 0)
+ {
+ //璇诲彇5涓悗锛岄棿闅斾竴娈垫椂闂�
+ System.Threading.Thread.Sleep(500);
+ if (this.Parent == null)
+ {
+ return;
+ }
+ }
+ //鑾峰彇褰撳墠瀹ゆ俯
+ ((AC)listDevice[i]).ReadLocalTemperature();
+ //鑾峰彇寮�鍏崇姸鎬�(澶勪簬鏌愮宸ヤ綔鐘舵��,鍗充负鎵撳紑鐘舵��)
+ ((AC)listDevice[i]).ReadSystemMode();
+ }
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鏁版嵁鎺ユ敹___________________________
+
+ /// <summary>
+ /// 鏁版嵁鎺ユ敹
+ /// </summary>
+ private void StartReceiveDataEvent()
+ {
+ HdlDeviceAttributeLogic.Current.AddAttributeEvent("IndoorUnitListFormEvent", "DeviceStatusReport", (device) =>
+ {
+ string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+ if (dicControl.ContainsKey(mainkeys) == false || device.DeviceStatusReport.CluterID != 513)
+ {
+ return;
+ }
+
+ var rowInfo = dicControl[mainkeys];
+ for (int i = 0; i < device.DeviceStatusReport.AttriBute.Count; i++)
+ {
+ var data = device.DeviceStatusReport.AttriBute[i];
+ if (data.AttributeId == 0)
+ {
+ //瀹ゅ唴娓╁害
+ if (data.AttriButeData == 0)
+ {
+ //0鈩�
+ rowInfo.btnValue.Text = "0.0鈩�";
+ }
+ else if (data.AttriButeData > 32767)
+ {
+ //璐熸暟(鐗规畩澶勭悊)
+ string strValue = (data.AttriButeData - 65536).ToString();
+ //灏忔暟鐐归渶瑕佷竴浣�
+ strValue = strValue.Substring(0, strValue.Length - 1);
+ rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
+ }
+ else
+ {
+ //灏忔暟鐐归渶瑕佷竴浣�
+ string strValue = data.AttriButeData.ToString();
+ strValue = strValue.Substring(0, strValue.Length - 1);
+ rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
+ }
+ }
+ else if (data.AttributeId == 28)
+ {
+ //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
+ //Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8
+ if (data.AttriButeData != 0)
+ {
+ rowInfo.btnSwitch.IsSelected = true;
+ rowInfo.btnIcon.IsSelected = true;
+ rowInfo.btnIconBack.BackgroundColor = 0xfffef1ed;
+ }
+ }
+ }
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鐣岄潰鍏抽棴___________________________
+
+ /// <summary>
+ /// 鐣岄潰鍏抽棴
+ /// </summary>
+ public override void CloseForm()
+ {
+ HdlDeviceAttributeLogic.Current.RemoveEvent("IndoorUnitListFormEvent");
+
+ base.CloseForm();
+ }
+
+ #endregion
+
+ #region 鈻� 缁撴瀯浣揰____________________________
+
+ /// <summary>
+ /// 琛屾暟鎹�
+ /// </summary>
+ private class RowControlInfo
+ {
+ /// <summary>
+ /// 璁惧鍥炬爣鑳屾櫙
+ /// </summary>
+ public FrameLayout btnIconBack = null;
+ /// <summary>
+ /// 璁惧鍥炬爣
+ /// </summary>
+ public IconViewControl btnIcon = null;
+ /// <summary>
+ /// 鎽勬皬搴�
+ /// </summary>
+ public NormalViewControl btnValue = null;
+ /// <summary>
+ /// 璀﹀憡鍥炬爣
+ /// </summary>
+ public IconViewControl btnWarningIcon = null;
+ /// <summary>
+ /// 璀﹀憡淇℃伅
+ /// </summary>
+ public NormalViewControl btnWarningMsg = null;
+ /// <summary>
+ /// 寮�鍏�
+ /// </summary>
+ public IconViewControl btnSwitch = null;
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
new file mode 100755
index 0000000..202f732
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitSettionForm.cs
@@ -0,0 +1,211 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.DeviceAirConditioner
+{
+ /// <summary>
+ /// 绌鸿皟瀹ゅ唴鏈鸿缃晫闈�
+ /// </summary>
+ public class IndoorUnitSettionForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalListControl listview = null;
+ /// <summary>
+ /// 褰撳墠閫夋嫨鐨勭綉鍏�
+ /// </summary>
+ private AC deviceAc = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_deviceAc">閫夋嫨鐨勭┖璋冨洖璺�</param>
+ public void ShowForm(AC i_deviceAc)
+ {
+ this.deviceAc = i_deviceAc;
+
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uIndoorUnitSettion));
+
+ //鍒濆鍖栧彸涓婅鑿滃崟
+ this.InitTopRightMenu();
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄦ帶浠�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ //鍒濆鍖栨甯�
+ var tableContr = new InformationEditorControl();
+ this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
+
+ //鍥剧墖
+ var btnPic = new DeviceInfoIconControl();
+ btnPic.Y = Application.GetRealHeight(92);
+ btnPic.Gravity = Gravity.CenterHorizontal;
+ bodyFrameLayout.AddChidren(btnPic);
+ btnPic.InitControl(this.deviceAc);
+
+ //璁惧澶囨敞
+ string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
+ string nameValue = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
+ var btnNote = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
+ listview.AddChidren(btnNote);
+ btnNote.InitControl();
+ //鍒掔嚎
+ btnNote.AddBottomLine();
+ btnNote.txtInput.FinishInputEvent += async () =>
+ {
+ string oldName = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
+ if (btnNote.Text.Trim() == string.Empty)
+ {
+ //灏嗗悕瀛楄繕鍘�
+ btnNote.Text = oldName;
+ }
+ if (oldName != btnNote.Text)
+ {
+ //璁惧鍚嶇О淇敼
+ var result = await Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
+ if (result == false)
+ {
+ return;
+ }
+ //璁惧澶囨敞淇敼鎴愬姛!
+ string msg = Language.StringByID(R.MyInternationalizationString.uDeviceReNoteSuccess);
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ }
+ };
+
+ //璁惧绫诲瀷
+ caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
+ nameValue = Common.LocalDevice.Current.GetDeviceObjectText(new List<CommonDevice>() { deviceAc });
+ var btnType = new FrameCaptionViewControl(caption, nameValue, listview.rowSpace / 2);
+ btnType.UseClickStatu = false;
+ listview.AddChidren(btnType);
+ btnType.InitControl();
+ //鍒掔嚎
+ btnType.AddBottomLine();
+
+ //鎵�灞炲尯鍩�
+ var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
+ listview.AddChidren(rowBeloneArea);
+ rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), deviceAc);
+ //搴曠嚎
+ rowBeloneArea.AddBottomLine();
+ rowBeloneArea.SelectRoomEvent += (roomKeys) =>
+ {
+ //淇濆瓨杩欎釜璁惧灞炰簬鍝釜鍖哄煙
+ deviceAc.DeviceRoomId = roomKeys;
+ deviceAc.ReSave();
+
+ Common.Room.CurrentRoom.ChangedRoom(deviceAc, roomKeys);
+ };
+
+ //绌鸿皟妯″紡
+ var rowMode = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(rowMode);
+ rowMode.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uAirConditionerMode), 600);
+ rowMode.AddRightArrow();
+ rowMode.AddBottomLine();
+ rowMode.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new AirConditionerModeForm();
+ form.AddForm(deviceAc);
+ };
+
+ //鎽嗛
+ var rowSwing = new FrameRowControl(listview.rowSpace / 2);
+ rowSwing.UseClickStatu = false;
+ listview.AddChidren(rowSwing);
+ rowSwing.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uAirConditionerSwing), 600);
+ rowSwing.AddBottomLine();
+ var btnSwicth = rowSwing.AddMostRightSwitchIcon();
+ btnSwicth.ButtonClickEvent += (sender, e) =>
+ {
+ btnSwicth.IsSelected = !btnSwicth.IsSelected;
+ };
+
+ //鍒濆鍖栨甯冨畬鎴�
+ tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr = null;
+
+ //淇濆瓨
+ var btnFinish = new BottomClickButton();
+ btnFinish.TextID = R.MyInternationalizationString.uSave;
+ bodyFrameLayout.AddChidren(btnFinish);
+ btnFinish.ButtonClickEvent += async (sender, e) =>
+ {
+ string oldName = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
+ if (oldName != btnNote.Text)
+ {
+ //璁惧鍚嶇О淇敼
+ var result = await Common.LocalDevice.Current.ReName(deviceAc, btnNote.Text);
+ if (result == false)
+ {
+ return;
+ }
+ }
+ this.CloseForm();
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鍙充笂瑙掕彍鍗昣________________________
+
+ /// <summary>
+ /// 鍒濆鍖栧彸涓婅鑿滃崟
+ /// </summary>
+ private void InitTopRightMenu()
+ {
+ //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘(鎷跨鐐规渶灏忕殑閭d釜鍥炶矾鍘诲畾浣�)
+ bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(deviceAc);
+ if (canTest == false)
+ {
+ return;
+ }
+ var btnIcon = new MostRightIconControl(69, 69);
+ btnIcon.UnSelectedImagePath = "Item/More.png";
+ topFrameLayout.AddChidren(btnIcon);
+ btnIcon.InitControl();
+ btnIcon.ButtonClickEvent += ((sender, e) =>
+ {
+ //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ this.ShowTopRightMenu();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ /// </summary>
+ private void ShowTopRightMenu()
+ {
+ var frame = new TopRightMenuControl(1);
+ //瀹氫綅
+ var deviceMenu = Language.StringByID(R.MyInternationalizationString.uFixedPosition);
+ frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
+ {
+ //鍙戦�佸畾浣嶅姛鑳�
+ Common.LocalDevice.Current.SetFixedPositionCommand(deviceAc);
+ });
+ }
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
index be6c3a1..4e81bfb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -17,11 +17,6 @@
/// <param name="common">Common.</param>
public void Changed(CommonDevice common)
{
- //if (common.Type != ZigBee.Device.DeviceType.OnOffSwitch)
- //{
- // return;
- //}
-
Shared.Application.RunOnMainThread(() =>
{
//var dev = common as Panel;
@@ -57,37 +52,44 @@
{
RemoveFromParent();
};
+ this.btnTitle.Width = Application.GetRealWidth(1080 - 161 - 200 - 58);
this.btnBack.MouseUpEventHandler += eHandlerBack;
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
this.MidFrameLayout(this);
var btnAddFrameLayout = new FrameLayout
{
- X = Application.GetRealWidth(953),
- Height = Application.GetRealHeight(72),
- Width = Application.GetRealWidth(72),
+ X = Application.GetRealWidth(830),
+ Width = Application.GetRealWidth(0),//200
+ BackgroundColor = 0xff00ff00,
};
this.titleFrameLayout.AddChidren(btnAddFrameLayout);
var btnFloorText = new Button
{
- Height = Application.GetRealHeight(84),
- Width = Application.GetRealWidth(58),
- X = Application.GetRealWidth(881),
- Text = "涓�妤�",
+ Width = Application.GetRealWidth(110),
+ X = Application.GetRealWidth(15),
+ Text = Language.StringByID(R.MyInternationalizationString.FirstFloor),
TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ TextSize = 15,
+ TextAlignment = TextAlignment.CenterRight,
+ BackgroundColor = 0xffff0000,
};
btnAddFrameLayout.AddChidren(btnFloorText);
var btnBindDown = new Button
{
- Height = Application.GetRealHeight(72),
- Width = Application.GetRealWidth(72),
- //UnSelectedImagePath = "BindPic/BindDown.png",
+ Height = Application.GetRealHeight(69),
+ Width = Application.GetRealWidth(69),
+ X = Application.GetRealWidth(200 - 69),
+ UnSelectedImagePath = "BindPic/BindDown.png",
+ Gravity = Gravity.CenterVertical,
+ BackgroundColor = 0xff0000ff,
};
btnAddFrameLayout.AddChidren(btnBindDown);
btnBindDown.MouseDownEventHandler += (sender, e) =>
{
+ SideslipFramelayout();
};
MidFrameLayoutContent();
}
@@ -105,14 +107,6 @@
{
};
btnMidTopLayout.AddChidren(btnHorizontalScrolViewLayout);
-
- //var btnLine = new Button
- //{
- // Y = btnMidTopLayout.Bottom,
- // Height = 1,
- // BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine,
- //};
- //this.midFrameLayout.AddChidren(btnLine);
midVerticalScrolViewLayout = new VerticalScrolViewLayout()
{
@@ -320,11 +314,7 @@
#endregion
}
- /// <summary>
- /// 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
- /// </summary>
- /// <param name="gateway">Gateway.</param>
- /// <param name="key">Key.</param>
+ // 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
void RefreshRoomList(Shared.Common.Room curRoom, Button btnFinish, ref int index2)
{
Button curentOldRoom = null;
@@ -333,6 +323,11 @@
for (int i = 0; i < roomList.Count; i++)
{
var room = roomList[i];
+ if (room.IsLove == true)
+ {
+ //;
+ }
+
var btnRoomFrameLayout = new FrameLayout
{
Height = Application.GetRealHeight(78),
@@ -355,6 +350,8 @@
TextSize = 12,
TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
Gravity = Gravity.Center,
+ //SelectedImagePath = "BindPic/BindRoomColorOn.png",
+ //UnSelectedImagePath = "BindPic/BindRoomColor.png",
};
btnRoomFrameLayout.AddChidren(btnRoom);
@@ -373,6 +370,7 @@
else
{
btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
+ btnRoom.IsSelected = false;
btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout;
btnRoomFrameLayout.BorderWidth = 1;
}
@@ -462,11 +460,7 @@
}
}
- /// <summary>
- /// 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
- /// </summary>
- /// <param name="gateway">Gateway.</param>
- /// <param name="key">Key.</param>
+ //鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
void RefreshSceneList(Shared.Common.Room curRoom)
{
midVerticalScrolViewLayout.RemoveAll();
@@ -591,6 +585,111 @@
}
}
+ // 渚ц竟瀵艰埅鏍�
+ void SideslipFramelayout()
+ {
+ var dialog = new Dialog
+ {
+ };
+ dialog.Show();
+
+ var flMain = new FrameLayout { BackgroundColor = 0x00000000 };
+ dialog.AddChidren(flMain);
+ flMain.MouseUpEventHandler += (sender11, e11) =>
+ {
+ dialog.Close();
+ };
+
+ var sidelipFrameLayout = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(783),
+ Width = Application.GetRealWidth(449),
+ Y = Application.GetRealHeight(161),
+ X = Application.GetRealWidth(596),
+ BackgroundImagePath = "DoorLock/SideslipPic.png",
+ };
+ flMain.AddChidren(sidelipFrameLayout);
+
+ var btnSelectFloor = new Button()
+ {
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(58),
+ X = Application.GetRealWidth(81),
+ Y = Application.GetRealHeight(58),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+ TextSize = 14,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.SelectFloor,
+ };
+ sidelipFrameLayout.AddChidren(btnSelectFloor);
+
+ var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout()
+ {
+ Height = Application.GetRealHeight(600),
+ Y = Application.GetRealHeight(173),
+ };
+ sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout);
+
+ //鑾峰彇妤煎眰
+ var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
+
+ Button oldbutton = null;
+ Button oldbuttonText = null;
+ foreach (var floorId in dicFloor.Keys)
+ {
+ var rowFrameLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(150),
+ };
+ sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout);
+
+ var btnAllMethod = new Button()
+ {
+ Width = Application.GetRealWidth(81),
+ Height = Application.GetRealHeight(81),
+ X = Application.GetRealWidth(81),
+ Y = Application.GetRealHeight(55),
+ };
+ rowFrameLayout.AddChidren(btnAllMethod);
+
+ var btnMethodText = new Button()
+ {
+ Width = Application.GetRealWidth(311),
+ Height = Application.GetRealHeight(58),
+ X = Application.GetRealWidth(173),
+ Y = Application.GetRealHeight(69),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+ TextSize = 14,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = dicFloor[floorId],
+ };
+ rowFrameLayout.AddChidren(btnMethodText);
+
+ EventHandler<MouseEventArgs> hander = (sender, e) =>
+ {
+ if (!btnMethodText.IsSelected)
+ {
+ if (oldbutton != null)
+ {
+ oldbutton.IsSelected = false;
+ }
+ if (oldbuttonText != null)
+ {
+ oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
+ }
+ oldbutton = btnMethodText;
+ oldbuttonText = btnMethodText;
+ btnMethodText.IsSelected = true;
+ oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ }
+ dialog.Close();
+ };
+ btnAllMethod.MouseUpEventHandler += hander;
+ rowFrameLayout.MouseUpEventHandler += hander;
+ btnMethodText.MouseUpEventHandler += hander;
+ }
+ }
+
public void DeviceInfoChange(CommonDevice common, string typeTag)
{
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
index b9d0c89..3779405 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
@@ -25,7 +25,15 @@
Y = Application.GetRealHeight(92),
Height = Application.GetRealHeight(69),
};
-
+ public Button btnTitle = new Button
+ {
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText,
+ X = Application.GetRealWidth(161),
+ Width = Application.GetRealWidth(1080 - 161),
+ Height = Application.GetRealWidth(69),
+ TextSize = 17,
+ };
public FrameLayout btnBackFrameLayout = new FrameLayout
{
X = Application.GetRealWidth(58),
@@ -57,17 +65,8 @@
this.AddChidren(topFrameLayout);
topFrameLayout.AddChidren(titleFrameLayout);
topFrameLayout.AddChidren(btnTitleLine);
- var title = new Button()
- {
- TextAlignment = TextAlignment.CenterLeft,
- Text = titleText,
- TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText,
- X = Application.GetRealWidth(161),
- Width = Application.GetRealWidth(1080 - 161),
- Height = Application.GetRealWidth(69),
- TextSize = 17,
- };
- titleFrameLayout.AddChidren(title);
+ titleFrameLayout.AddChidren(btnTitle);
+ btnTitle.Text = titleText;
titleFrameLayout.AddChidren(btnBackFrameLayout);
btnBackFrameLayout.AddChidren(btnBack);
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
index 1991435..4977f95 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
@@ -227,395 +227,6 @@
return dicCheck;
}
- #region 绉佹湁鏁版嵁澶囦唤姝ラ(鏈夌敤浠g爜锛岃繖閲屽厛娉ㄩ噴鎺夛級
- // title.MouseLongEventHandler += async(sender, e) =>
- // {
- // string fileName = "Panel_";
- // fileName += currentKey.FilePath;
- // var file = await System.Threading.Tasks.Task.Factory.StartNew(() => Newtonsoft.Json.JsonConvert.SerializeObject(currentKey));
- // var data = System.Text.Encoding.UTF8.GetBytes(file);
- // //缃戝叧涓垱寤哄瓨鍌ㄦ暟鎹殑鏂囦欢
- // var saveFile = await currentKey.Gateway.CreateFileAsync(fileName);
- // //涓婁紶鏁版嵁鍒扮綉鍏�
- // var saveData = await currentKey.Gateway.SendFileAsync(data);
- // };
-
- // //瀛樺偍涓嬭浇鐨勬枃浠舵暟鎹�
- // var byteSource = new System.Collections.Generic.List<byte>();
- // if (byteSource != null)
- // {
- // //鎭㈠鏁版嵁瀵硅薄
- // var realDa = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel>(System.Text.Encoding.UTF8.GetString(byteSource.ToArray()));
- //}
-
- ////涓嬭浇鎭㈠绉佹湁鏁版嵁
- //title.MouseUpEventHandler +=async(sender, e) =>
- // {
- // var key11 = currentKey;
- //string fileName = "Panel_";
- //fileName += currentKey.FilePath;
- // //鑾峰彇褰撳墠鏂囦欢鐨勫叿浣撲俊鎭�
- // var getFileSize = await currentKey.Gateway.GetCurrentFileInfoAsync(fileName);
- ////涓嬭浇鏂囦欢
- //var saveFileName = await currentKey.Gateway.SetDownloadFileAsync(fileName);
- ////鎺ユ敹鏁版嵁
- //Action<string, byte[]> action = (topic, dataContent) =>
- //{
- // if (topic.Split('/')[0] + "/" + topic.Split('/')[1] + "/" + topic.Split('/')[2] == topic.Split('/')[0] + "/" + "FileTransfer/DownloadFile")
- // {
- // byte[] fileBytes = dataContent;
- // if (fileBytes[5] != 1)
- // {
- // if (fileBytes.Length == 2056)
- // {
- // var tempBytes = new byte[2048];
- // System.Array.Copy(fileBytes, 8, tempBytes, 0, 2048);
- // byteSource.AddRange(tempBytes);
- // }
- // else
- // {
- // var tempBytes = new byte[fileBytes.Length - 8];
- // System.Array.Copy(fileBytes, 8, tempBytes, 0, tempBytes.Length);
- // byteSource.AddRange(tempBytes);
- // }
- // }
- // else
- // {
- // var tempBytes = new byte[fileBytes.Length - 8];
- // System.Array.Copy(fileBytes, 8, tempBytes, 0, tempBytes.Length);
- // byteSource.AddRange(tempBytes);
- // }
-
- // }
- //};
- //currentKey.Gateway.FileContentAction += action;
- //};
- #endregion
-
- ///// <summary>
- ///// 鍒楄〃鎺т欢
- ///// </summary>
- //private VerticalScrolViewLayout listView = null;
- ///// <summary>
- ///// 宸茬粡瀛樺湪鐨勭粦瀹氳澶�
- ///// </summary>
- //private Dictionary<string, CommonDevice> dicEsixtDevice = new Dictionary<string, CommonDevice>();
-
- ///// <summary>
- ///// 鑾峰彇璁惧鐨勫敮涓�涓婚敭
- ///// </summary>
- ///// <param name="device"></param>
- ///// <returns></returns>
- //public string GetDeviceMainKeys(CommonDevice device)
- //{
- // return device.DeviceAddr + device.DeviceEpoint;
- //}
-
- ///// <summary>
- ///// 鏄剧ず閿欒淇℃伅绐楀彛
- ///// </summary>
- ///// <param name="msg"></param>
- //private void ShowErrorMsg(string msg)
- //{
- // Application.RunOnMainThread(() =>
- // {
- // var contr = new Phone.UserCenter.ErrorMsgControl(msg);
- // contr.Show();
- // });
- //}
-
- ///// <summary>
- ///// 鏄剧ずTip淇℃伅绐楀彛
- ///// </summary>
- ///// <param name="msg"></param>
- //private void ShowTipMsg(string msg)
- //{
- // Application.RunOnMainThread(() =>
- // {
- // var contr = new Phone.UserCenter.TipViewControl(msg);
- // contr.ShowView();
- // });
- //}
-
- ///// <summary>
- ///// 鏄剧ず涓�涓渶瑕佺‘璁ょ殑淇℃伅妗�
- ///// </summary>
- ///// <param name="msg">淇℃伅</param>
- ///// <param name="methodName">鏂规硶鍚�(璇风‘璁よ繖鏄竴涓叡鏈夋柟娉�)</param>
- ///// <param name="obj">鍥炶皟鍑芥暟鐨勫惎鍔ㄥ弬鏁�</param>
- //public void ShowConfirmMsg(string msg, string methodName = null, params object[] obj)
- //{
- // Application.RunOnMainThread(() =>
- // {
- // var alert = new ConfirmMsgControl(msg);
- // alert.Show();
-
- // if (methodName != null)
- // {
- // alert.ResultEventHandler += (sender, result) =>
- // {
- // if (result == true)
- // {
- // this.LoadFormMethodByName(this, methodName, obj);
- // }
- // };
- // }
- // });
- //}
-
- ///// <summary>
- ///// 鎵ц鎸囧畾鐢婚潰鐨勬柟娉�
- ///// </summary>
- ///// <param name="form">鎸囧畾鐢婚潰鐨勮嫳鏂囧悕</param>
- ///// <param name="method">鎸囧畾瑕佸姞杞界殑鏂规硶鍚�</param>
- ///// <param name="parameter">鍚姩鍙傛暟</param>
- //public object LoadFormMethodByName(BindInfo form, string method, params object[] parameter)
- //{
- // return form.GetType().InvokeMember(method, System.Reflection.BindingFlags.InvokeMethod, null, form, parameter);
- //}
-
- ///// <summary>
- ///// 娣诲姞鐢婚潰,鍚姩鍙傛暟鐢辨寚瀹氱敾闈㈢殑ShowForm鍑芥暟鎵�鎸囧畾
- ///// </summary>
- ///// <param name="newform">瀵硅薄鐢婚潰</param>
- ///// <param name="parameter">鍚姩鍙傛暟锛氬弬鏁扮敱鎸囧畾鐢婚潰鐨凷howForm鍑芥暟鎵�鎸囧畾</param>
- //public void AddForm(UserCenterCommonForm newform, params object[] parameter)
- //{
- // //妫�娴嬭兘鍚﹁拷鍔犵敾闈�(闃叉鐢婚潰浜岄噸娣诲姞)锛屽綋鐐瑰嚮杩囧揩鏃讹紝浼氭湁鍑犵巼浜岄噸娣诲姞
- // if (UserCenterLogic.CheckCanAddForm(newform) == false)
- // {
- // return;
- // }
- // newform.FormID = UserCenterLogic.GetFormName(newform);
-
- // UserView.HomePage.Instance.AddChidren(newform);
- // UserView.HomePage.Instance.PageIndex += 1;
- // //鍒濆鍖栫晫闈㈡鏋�
- // newform.InitForm(parameter);
- // //鎵цShowForm()鏂规硶
- // newform.LoadShowFormMethod(parameter);
- //}
-
- ///// <summary>
- ///// 鑳界粦瀹氬埌鎸夐敭鐨勮澶�
- ///// </summary>
- ///// <param name="device"></param>
- ///// <returns></returns>
- //public bool SupportDevice(CommonDevice device,int currentClusterID)
- //{
- // foreach (var data in device.InClusterList)
- // {
- // //鎷ユ湁on/off鍔熻兘鐨勶紝鎵嶆敮鎸佹祴璇�
- // if (data.InCluster == currentClusterID)
- // {
- // return true;
- // }
- // }
- // return false;
- //}
-
- ///// <summary>
- ///// 缁戝畾PIR浼犳劅鍣ㄧ殑鐩爣(杩斿洖鎴愬姛璁剧疆鐨勮澶�,閿欒鏃讹紝杩斿洖null)
- ///// </summary>
- ///// <param name="i_iasZone">浼犳劅鍣�</param>
- ///// <param name="listDevice">瑕佺粦瀹氱殑鐩爣璁惧</param>
- ///// <returns></returns>
- //public async Task<List<CommonDevice>> BindKeyDeviceTargets(Panel key, List<CommonDevice> listDevice,int currentClusterID)
- //{
- // if (listDevice.Count == 0)
- // {
- // return new List<CommonDevice>();
- // }
-
- // var dicDevice = new Dictionary<string, CommonDevice>();
-
- // //缁勮鏁版嵁
- // var addData = new Panel.AddBindData();
- // addData.DeviceAddr = key.DeviceAddr;
- // addData.Epoint = key.DeviceEpoint;
- // foreach (var device in listDevice)
- // {
- // var info = new Panel.AddBindListObj();
- // info.BindCluster = currentClusterID;
- // info.BindMacAddr = device.DeviceAddr;
- // info.BindEpoint = device.DeviceEpoint;
- // info.BindType = 0;
-
- // addData.BindList.Add(info);
-
- // //杩斿洖鎴愬姛璁惧鐨勬椂鍊欎娇鐢�
- // string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
- // dicDevice[mainkeys] = device;
- // }
-
- // var result = await key.AddDeviceBindAsync(addData);
- // if (result.addedDeviceBindResponseData == null)
- // {
- // //濡傛灉缃戝叧宸茬粡鎺夌嚎
- // bool flage = Common.LocalGateway.Current.CheckGatewayOnLineOnTimeout(key.CurrentGateWayId, result.errorMessageBase);
- // if (flage == false)
- // {
- // return null;
- // }
- // //缁戝畾鐩爣璁剧疆澶辫触
- // string msg = Language.StringByID(R.MyInternationalizationString.uSetBindTargetsFail);
- // //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
- // msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg);
-
- // this.ShowErrorMsg(msg);
- // return null;
- // }
-
- // var listSuccess = new List<CommonDevice>();
- // foreach (var data in result.addedDeviceBindResponseData.BindList)
- // {
- // string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(data.BindMacAddr, data.BindEpoint);
- // //0:娣诲姞鎴愬姛 3:宸茬粡瀛樺湪锛屼篃鍙互浠h〃鎴愬姛
- // if (data.Result == 0 || data.Result == 3)
- // {
- // if (dicDevice.ContainsKey(mainkeys) == true)
- // {
- // listSuccess.Add(dicDevice[mainkeys]);
- // }
- // }
- // //1锛氬け璐ワ紝鑺傜偣璁惧鎴栧満鏅笉瀛樺湪
- // else if (data.Result == 1)
- // {
- // if (dicDevice.ContainsKey(mainkeys) == true)
- // {
- // //璁惧鍚嶇О 缁戝畾澶辫触
- // string msg = Shared.Common.LocalDevice .Current.GetDeviceEpointName(dicDevice[mainkeys]) + " ";
- // msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
- // this.ShowTipMsg(msg);
- // }
- // }
- // //2锛氭湭鐭ワ紝鐢辫妭鐐硅澶囧弽棣堝彂閫佲�淏ind/BindResult鈥濅富棰樻秷鎭‘瀹氭槸鍚︽垚鍔�
- // else if (data.Result == 2)
- // {
- // if (result.addBindResultResponseData == null)
- // {
- // //璁惧鍚嶇О 缁戝畾澶辫触
- // string msg = Shared.Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + " ";
- // msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
- // this.ShowTipMsg(msg);
- // }
- // else
- // {
- // //娣诲姞鎴愬姛
- // if (result.addBindResultResponseData.Result == 0)
- // {
- // if (dicDevice.ContainsKey(mainkeys) == true)
- // {
- // listSuccess.Add(dicDevice[mainkeys]);
- // }
- // }
- // //璁惧鍚嶇О 缁戝畾鍒楄〃宸叉弧
- // else if (result.addBindResultResponseData.Result == 140)
- // {
- // string msg = Shared.Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + " ";
- // msg += Language.StringByID(R.MyInternationalizationString.uBindListIsFull);
- // this.ShowTipMsg(msg);
- // }
- // else
- // {
- // //璁惧鍚嶇О 缁戝畾澶辫触
- // string msg = Shared.Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + " ";
- // msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
- // this.ShowTipMsg(msg);
- // }
- // }
- // }
- // }
-
- // return listSuccess;
- //}
-
- ///// <summary>
- ///// 鏄剧ず璁惧閫夋嫨鐨勭晫闈�
- ///// </summary>
- //public void ShowDeviceSelectForm(Panel key, int currentClusterID)
- //{
- // var listShowDevice = new List<CommonDevice>();
- // foreach (var device in PanelBindPage.list)
- // {
- // if (SupportDevice(device, currentClusterID) == false)
- // {
- // continue;
- // }
-
- // string mainKeys = this.GetDeviceMainKeys(device);
- // if (this.dicEsixtDevice.ContainsKey(mainKeys) == true)
- // {
- // //濡傛灉宸茬粡娣诲姞浜嗭紝鍒欎笉鍐嶆樉绀�
- // continue;
- // }
-
- // listShowDevice.Add(device);
- // }
-
- // var listSelect = new List<string>();
- // foreach (string mainkeys in this.dicEsixtDevice.Keys)
- // {
- // listSelect.Add(mainkeys);
- // }
-
- // var form = new SelectDeviceForm();
- // this.AddForm(form, listShowDevice, listSelect, false);
- // //娣诲姞缁戝畾鐩爣
- // form.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddBindTargets));
-
- // //璁惧閫夋嫨纭畾
- // form.ActionSelectDevice += (async (listDevice) =>
- // {
- // if (listDevice.Count == 0)
- // {
- // return;
- // }
-
- // var listNewDevice = await this.BindKeyDeviceTargets(key, listDevice,currentClusterID);
-
- // if (listNewDevice == null || listNewDevice.Count == 0)
- // {
- // return;
- // }
-
- // foreach (CommonDevice device in listNewDevice)
- // {
- // string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
- // this.dicEsixtDevice[mainKeys] = device;
-
- // Application.RunOnMainThread(() =>
- // {
- // this.AddRowlayout(device);
- // });
- // }
- // });
- //}
-
- ///// <summary>
- ///// 娣诲姞琛�
- ///// </summary>
- ///// <param name="device"></param>
- //private void AddRowlayout(CommonDevice device)
- //{
- // string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
- // this.dicEsixtDevice[mainKeys] = device;
-
- // var row = new DeviceRoomViewRow(this.listView, device);
- // row.ChangedChidrenBindMode(row.btnIcon, ChidrenBindMode.BindEventOnly);
- // row.ChangedChidrenBindMode(row.btnRoom, ChidrenBindMode.BindEventOnly);
- // row.ChangedChidrenBindMode(row.btnDevie, ChidrenBindMode.BindEventOnly);
-
- // //鍒犻櫎
- // var btnDelete = new RowDeleteButton();
- // row.AddRightView(btnDelete);
- // btnDelete.MouseUpEventHandler += (sender, e) =>
- // {
- // //纭瑕佸垹闄ゅ悧锛�
- // string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg);
- // this . ShowConfirmMsg(msg, "DeleteTargetDevice", device, row);
- // };
- //}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
index 7c32d18..65f1e0a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
@@ -38,6 +38,14 @@
/// 鍒楄〃鎺т欢
/// </summary>
private VerticalListControl listView = null;
+ /// <summary>
+ /// 寮�闄愪綅鐨勮繘搴︽潯
+ /// </summary>
+ private HorizontalSeekBar openSeekBar = null;
+ /// <summary>
+ /// 鍚堥檺浣嶇殑杩涘害鏉�
+ /// </summary>
+ private HorizontalSeekBar closeSeekBar = null;
#endregion
@@ -216,17 +224,17 @@
btnProgress1.Text = progressValue + "%";
frameBack.AddChidren(btnProgress1);
//杩涘害鏉�
- var seekBar = new HorizontalSeekBar();
- seekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
- seekBar.Gravity = Gravity.CenterHorizontal;
- seekBar.Width = Application.GetRealWidth(962);
- seekBar.Height = Application.GetRealHeight(84);
- seekBar.Max = 100;
- seekBar.BackgroundColor = 0xfff5f5f5;
- seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
- seekBar.ProgressColor = 0xff288bfd;
- seekBar.Progress = progressValue;
- frameBack.AddChidren(seekBar);
+ this.openSeekBar = new HorizontalSeekBar();
+ openSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
+ openSeekBar.Gravity = Gravity.CenterHorizontal;
+ openSeekBar.Width = Application.GetRealWidth(962);
+ openSeekBar.Height = Application.GetRealHeight(84);
+ openSeekBar.Max = 100;
+ openSeekBar.BackgroundColor = 0xfff5f5f5;
+ openSeekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
+ openSeekBar.ProgressColor = 0xff288bfd;
+ openSeekBar.Progress = progressValue;
+ frameBack.AddChidren(openSeekBar);
var btnTemp1 = new NormalViewControl(200, 50, true);
btnTemp1.X = ControlCommonResourse.XXLeft;
@@ -254,10 +262,16 @@
int waitTime = 4;//500姣涓哄崟浣�
bool startWait = false;
bool checking = false;
- seekBar.ProgressChanged += (sender, value) =>
+ openSeekBar.ProgressChanged += (sender, value) =>
{
//鍊肩户缁敼鍙�,鍒欑瓑寰呮椂闂磋繕鍘�
waitTime = 4;
+ //寮�闄愪綅涓嶈兘澶т簬鍚堥檺浣�
+ if (value > closeSeekBar.Progress)
+ {
+ openSeekBar.Progress = closeSeekBar.Progress;
+ return;
+ }
if (checking == false)
{
startWait = true;
@@ -269,7 +283,7 @@
};
HdlThreadLogic.Current.RunThread(async () =>
{
- while (seekBar.Parent != null)
+ while (openSeekBar.Parent != null)
{
if (startWait == false)
{
@@ -285,7 +299,7 @@
startWait = false;
checking = true;
- var value = seekBar.Progress;
+ var value = openSeekBar.Progress;
if (oldValue == value)
{
//鐩稿悓鏁板��
@@ -311,39 +325,6 @@
}
}
});
-
- //var oldTime = DateTime.Now;
- //var oldValue = 0;
- //seekBar.MouseUpEventHandler += async (sender, e) =>
- //{
- // if ((DateTime.Now - oldTime).TotalSeconds <= 1)
- // {
- // //鏈�灏戦渶瑕�2绉掗棿闅�
- // return;
- // }
- // var value = seekBar.Progress;
- // if (oldValue == value)
- // {
- // //鐩稿悓鏁板��
- // return;
- // }
- // oldValue = value;
- // oldTime = DateTime.Now;
-
- // if (curtainData.DeleteOpenLimit == true)
- // {
- // //閲嶇疆寮�闄愪綅鐐�
- // var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.UpLimit);
- // if (result == false)
- // {
- // return;
- // }
- // curtainData.DeleteOpenLimit = false;
- // }
- // receiveUplimit = "1";
- // //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
- // curtainDevice.WcdGoToTiltValue(value);
- //};
}
/// <summary>
@@ -370,17 +351,17 @@
btnProgress1.Text = progressValue + "%";
frameBack.AddChidren(btnProgress1);
//杩涘害鏉�
- var seekBar = new HorizontalSeekBar();
- seekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
- seekBar.Gravity = Gravity.CenterHorizontal;
- seekBar.Width = Application.GetRealWidth(962);
- seekBar.Height = Application.GetRealHeight(84);
- seekBar.Max = 100;
- seekBar.BackgroundColor = 0xfff5f5f5;
- seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
- seekBar.ProgressColor = 0xff288bfd;
- seekBar.Progress = progressValue;
- frameBack.AddChidren(seekBar);
+ this.closeSeekBar = new HorizontalSeekBar();
+ closeSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
+ closeSeekBar.Gravity = Gravity.CenterHorizontal;
+ closeSeekBar.Width = Application.GetRealWidth(962);
+ closeSeekBar.Height = Application.GetRealHeight(84);
+ closeSeekBar.Max = 100;
+ closeSeekBar.BackgroundColor = 0xfff5f5f5;
+ closeSeekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
+ closeSeekBar.ProgressColor = 0xff288bfd;
+ closeSeekBar.Progress = progressValue;
+ frameBack.AddChidren(closeSeekBar);
var btnTemp1 = new NormalViewControl(200, 50, true);
btnTemp1.X = ControlCommonResourse.XXLeft;
@@ -408,10 +389,16 @@
int waitTime = 4;//500姣涓哄崟浣�
bool startWait = false;
bool checking = false;
- seekBar.ProgressChanged += (sender, value) =>
+ closeSeekBar.ProgressChanged += (sender, value) =>
{
//鍊肩户缁敼鍙�,鍒欑瓑寰呮椂闂磋繕鍘�
waitTime = 4;
+ //鍚堥檺浣嶄笉鑳藉皬浜庡悎闄愪綅
+ if (value < openSeekBar.Progress)
+ {
+ closeSeekBar.Progress = openSeekBar.Progress;
+ return;
+ }
if (checking == false)
{
startWait = true;
@@ -423,7 +410,7 @@
};
HdlThreadLogic.Current.RunThread(async () =>
{
- while (seekBar.Parent != null)
+ while (closeSeekBar.Parent != null)
{
if (startWait == false)
{
@@ -439,7 +426,7 @@
startWait = false;
checking = true;
- var value = seekBar.Progress;
+ var value = closeSeekBar.Progress;
if (oldValue == value)
{
//鐩稿悓鏁板��
@@ -465,39 +452,6 @@
}
}
});
-
- //var oldTime = DateTime.Now;
- //var oldValue = 0;
- //seekBar.MouseUpEventHandler += async (sender, e) =>
- //{
- // if ((DateTime.Now - oldTime).TotalSeconds <= 1)
- // {
- // //鏈�灏戦渶瑕�2绉掗棿闅�
- // return;
- // }
- // var value = seekBar.Progress;
- // if (oldValue == value)
- // {
- // //鐩稿悓鏁板��
- // return;
- // }
- // oldValue = value;
- // oldTime = DateTime.Now;
-
- // if (curtainData.DeleteCloseLimit == true)
- // {
- // //閲嶇疆鍚堥檺浣嶇偣
- // var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.DownLimit);
- // if (result == false)
- // {
- // return;
- // }
- // curtainData.DeleteCloseLimit = false;
- // }
- // receiveDownLimit = "1";
- // //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
- // curtainDevice.WcdGoToTiltValue(value);
- //};
}
#endregion
@@ -678,6 +632,7 @@
if (receiveUplimit == "1")
{
receiveUplimit = "0";
+ openSeekBar.Progress = curtainData.OpenLimitPersent;
//纭褰撳墠浣嶇疆{0}涓哄紑闄愪綅?
string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainOpenLimitMsg);
msg = msg.Replace("{0}", curtainData.OpenLimitPersent + "%");
@@ -692,6 +647,7 @@
else if (receiveDownLimit == "1")
{
receiveDownLimit = "0";
+ closeSeekBar.Progress = curtainData.CloseLimitPersent;
//纭褰撳墠浣嶇疆{0}涓哄悎闄愪綅?
string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainCloseLimitMsg);
msg = msg.Replace("{0}", curtainData.CloseLimitPersent + "%");
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
index bd8b836..e406864 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
@@ -375,6 +375,11 @@
btnBind.AddRightArrow();
btnBind.ButtonClickEvent += (sender, e) =>
{
+ var panel = nowSelectDevice as ZigBee.Device.Panel;
+ var bindTargetsPage = new Shared.Phone.UserCenter.DeviceBind.BindTargetsPage(panel);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(bindTargetsPage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ bindTargetsPage.Show();
};
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index f3149a5..ad78427 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -370,6 +370,23 @@
var form = new DeviceMacInfoEditorForm();
form.AddForm(device.DeviceAddr);
}
+ else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A绐楀笜)
+ {
+ var form = new DeviceMacInfoEditorForm();
+ form.AddForm(device.DeviceAddr);
+ }
+ //pir浼犳劅鍣�
+ else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.Sensor_Pir)
+ {
+ var form = new DevicePirSensor.PirSensorBindTargetSettionForm();
+ form.AddForm((IASZone)device);
+ }
+ //涓ぎ绌鸿皟
+ else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.AirConditioner_ZbGateway)
+ {
+ var form = new DeviceAirConditioner.IndoorUnitSettionForm();
+ form.AddForm((AC)device);
+ }
//闈㈡澘璁惧
else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A鎸夐敭闈㈡澘)
{
@@ -599,11 +616,11 @@
return;
}
string gwId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway);
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//杩欓噷涓昏鍙槸鑾峰彇鍦ㄧ嚎鐘舵��
var zbway = HdlGatewayLogic.Current.GetLocalGateway(gwId);
- var result = await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
+ var result = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
});
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
index 553133f..d2b5697 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -210,6 +210,11 @@
this.AddDoorLocksTimeRow();
}
}
+ else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.AirConditioner_ZbGateway)
+ {
+ //娣诲姞銆愬鍐呮満璁剧疆銆戣(绌鸿皟涓撶敤)
+ this.AddIndoorUnitSettionRow();
+ }
else
{
//娣诲姞銆愮粦瀹氱洰鏍囥�戣(pir浼犳劅鍣ㄤ笓鐢�)
@@ -539,6 +544,7 @@
//鎵嬫媺鎺у埗
string caption = Language.StringByID(R.MyInternationalizationString.uHandPullControl);
var btnFunction = new FrameRowControl(listview.rowSpace / 2);
+ btnFunction.UseClickStatu = false;
listview.AddChidren(btnFunction);
btnFunction.AddLeftCaption(caption, 600);
//寮�鍏冲浘鏍�
@@ -582,6 +588,35 @@
#endregion;
+ #region 鈻� 瀹ゅ唴鏈鸿缃�(绌鸿皟)___________________
+
+ /// <summary>
+ /// 娣诲姞銆愬鍐呮満璁剧疆銆戣(绌鸿皟涓撶敤)
+ /// </summary>
+ private void AddIndoorUnitSettionRow()
+ {
+ if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway)
+ {
+ return;
+ }
+ //瀹ゅ唴鏈鸿缃�
+ string caption = Language.StringByID(R.MyInternationalizationString.uIndoorUnitSettion);
+ var btnFunction = new FrameRowControl(listview.rowSpace / 2);
+ listview.AddChidren(btnFunction);
+ btnFunction.AddLeftCaption(caption, 600);
+ //鍚戝彸鍥炬爣
+ btnFunction.AddRightArrow();
+ //搴曠嚎
+ btnFunction.AddBottomLine();
+ btnFunction.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new DeviceAirConditioner.IndoorUnitListForm();
+ form.AddForm(listNewDevice[0].DeviceAddr);
+ };
+ }
+
+ #endregion
+
#region 鈻� 閫氱敤淇℃伅___________________________
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
index 95b5669..ca94064 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
@@ -53,12 +53,18 @@
// 璇诲彇浜戠闂ㄩ攣璁惧涓殑淇℃伅
var localDoorLockObj = new ZigBee.Device.DoorLock.GetDoorLockData() { };
+
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ localDoorLockObj.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ localDoorLockObj.IsOtherAccountCtrl = true;
+ }
+
localDoorLockObj.CloudAccountId = curAccountObj.SubAccountDistributedMark;
- if (doorLock.DeviceAddr != null)
+
{
localDoorLockObj.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
}
-
var getDoorLockInfoList = await ZigBee.Device.DoorLock.GetDoorLockInfoFromServer("DoorLock/GetDoorLockPager", localDoorLockObj);
if (getDoorLockInfoList != null)
@@ -73,12 +79,18 @@
doorLockObj.PrimaryId = curDoorLockUser.Id;
doorLockObj.EntryTime = curDoorLockUser.EntryTime;
doorLockObj.UserName = curDoorLockUser.UserIdRemarks;
- doorLockObj.ConnectedAccount = curDoorLockUser.CloudAccountId; doorLock.localDoorLockUserList[int.Parse(curDoorLockUser.DoorLockLocalUserId)] = doorLockObj;
+ doorLockObj.ConnectedAccount = curDoorLockUser.CloudAccountId;
+ doorLock.localDoorLockUserList[int.Parse(curDoorLockUser.DoorLockLocalUserId)] = doorLockObj;
}
else
{
//闂ㄩ攣涓笉瀛樺湪鐢ㄦ埛ID锛屼簯绔瓨鍦紝闇�瑕佸湪杩欓噷鍒犻櫎浜戠瀛樺湪鐨勬暟鎹�
var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ deleteDoorLockData.IsOtherAccountCtrl = true;
+ }
if (doorLock.DeviceAddr != null)
{
deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
index f6c38e6..0204744 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
@@ -208,6 +208,12 @@
{
completeBtn.Enable = false;
var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ addLockInfo.IsOtherAccountCtrl = true;
+ }
+
addLockInfo.CloudAccountId = curAccountObj.SubAccountDistributedMark;
if (doorLock.DeviceAddr != null)
{
@@ -215,7 +221,6 @@
}
addLockInfo.OpenLockMode = doorLock.doorLockProgrammingEventNotificationCommand.ProgramEventSoure;
addLockInfo.DoorLockLocalUserId = doorLock.doorLockProgrammingEventNotificationCommand.UserID.ToString();
- //var entryTime = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocalTime(doorLock.doorLockProgrammingEventNotificationCommand.ZigbeeLocalTime);
addLockInfo.EntryTime = System.DateTime.Now;
if (btnPasswordRemarkContent.Text != "")
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs
index 563f2d9..1b9661e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MasterManagementPage.cs
@@ -56,7 +56,9 @@
this.btnBack.MouseUpEventHandler += eHandlerBack;
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
this.MidFrameLayout(this);
+
ReadDoorLockUserInfo();
+
}
public void MidFrameLayoutContent()
@@ -128,7 +130,10 @@
}
else
{
-
+ var userDoorLockPage = new UserDoorLockPage(doorLock, accountObj);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ userDoorLockPage.Show();
}
};
btnRight.MouseUpEventHandler += eHandler;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
index b820eb9..b6001cf 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
@@ -31,8 +31,8 @@
DateTime cunIVDateTime;
#endregion
- /// <summary>
- /// UI鏄剧ず
+ /// <summary>
+ /// UI鏄剧ず
/// </summary>
public void Show()
{
@@ -112,9 +112,31 @@
delBackgroundFrameLayout.AddChidren(btnDelText);
EventHandler<MouseEventArgs> eHandler2 = (sender2, e2) =>
- {
- ClearEventHandler(btnDelText, dialog);
- };
+ {
+ var dialog1 = new Dialog { };
+ var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog1, Language.StringByID(R.MyInternationalizationString.Tip));
+ doorDialog.Show();
+ doorDialog.dialogMidFraFrameLayout.Width = Application.GetRealWidth(415);
+ doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58);
+ doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(190);
+ doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202);
+ doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
+ doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.SureToDeleteTempPassword);
+ doorDialog.dialogMidText.TextSize = 14;
+ doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
+ doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.Confrim);
+ doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) =>
+ {
+ dialog.Close();
+ dialog1.Close();
+ };
+ doorDialog.dialogBtnConfirm.MouseUpEventHandler += (sender1, e1) =>
+ {
+ dialog.Close();
+ dialog1.Close();
+ ClearEventHandler(btnDelText, dialog1);
+ };
+ };
delBackgroundFrameLayout.MouseDownEventHandler += eHandler2;
btnDelIcon2.MouseDownEventHandler += eHandler2;
btnDelText.MouseDownEventHandler += eHandler2;
@@ -161,6 +183,8 @@
Text = Language.StringByID(R.MyInternationalizationString.ClickGenerate),
TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText,
TextSize = 12,
+ Visible = true,
+ Enable = true,
};
topMidTopFrameLayout.AddChidren(topPic);
@@ -243,11 +267,15 @@
{
btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
btnFinifh.Enable = true;
+ topPic.Visible = true;
+ topPic.Enable = true;
}
else
{
btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
btnFinifh.Enable = false;
+ topPic.Visible = false;
+ topPic.Enable = false;
}
if (string.IsNullOrEmpty(doorLock.LocalTempPassword))
{
@@ -256,12 +284,15 @@
randomPassword.X = Application.GetRealWidth(215);
randomPassword.TextColor = Shared.Common.ZigbeeColor.Current.XMGray4;
Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify = true;
+ topPic.Visible = true;
+ topPic.Enable = true;
}
else
{
randomPassword.Text = doorLock.LocalTempPassword;
temPasswordVisiable.Visible = true;
-
+ // topPic.Visible = false;
+ // topPic.Enable = false;
if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InTempPasswordVisiable)
{
randomPassword.SecureTextEntry = false;
@@ -431,6 +462,29 @@
btnNext.MouseDownEventHandler += hander;
}
+ var modifyTempPasswordTip1 = new Button()
+ {
+ Height = Application.GetRealHeight(49),
+ Y = Application.GetRealHeight(628),
+ TextID = R.MyInternationalizationString.ModifyTempPasswordTip1,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+ TextSize = 12,
+ TextAlignment = TextAlignment.Center,
+ };
+ bottomFrameLayout.AddChidren(modifyTempPasswordTip1);
+
+ var modifyTempPasswordTip2 = new Button()
+ {
+ Height = Application.GetRealHeight(49),
+ Y = modifyTempPasswordTip1.Bottom,
+ Radius = (uint)Application.GetRealHeight(120) / 2,
+ TextID = R.MyInternationalizationString.ModifyTempPasswordTip2,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+ TextSize = 12,
+ TextAlignment = TextAlignment.Center,
+ };
+ bottomFrameLayout.AddChidren(modifyTempPasswordTip2);
+
btnFinifh = new Button()
{
Width = Application.GetRealWidth(907),
@@ -469,40 +523,40 @@
});
return;
}
- if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour == 100)
- {
- //璇疯缃敓鏁堟椂闂达紱
- Application.RunOnMainThread(() =>
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip2), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- return;
- }
- if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth == 0)
- {
- //璇疯缃敓鏁堟棩鏈燂紱
- Application.RunOnMainThread(() =>
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip3), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- return;
- }
- if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour == 100)
- {
- Application.RunOnMainThread(() =>
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip4), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- return;
- }
- if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth == 0)
- {
- Application.RunOnMainThread(() =>
- {
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip5), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- return;
- }
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour == 100)
+ //{
+ // //璇疯缃敓鏁堟椂闂达紱
+ // Application.RunOnMainThread(() =>
+ // {
+ // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip2), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ // });
+ // return;
+ //}
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth == 0)
+ //{
+ // //璇疯缃敓鏁堟棩鏈燂紱
+ // Application.RunOnMainThread(() =>
+ // {
+ // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip3), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ // });
+ // return;
+ //}
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour == 100)
+ //{
+ // Application.RunOnMainThread(() =>
+ // {
+ // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip4), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ // });
+ // return;
+ //}
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth == 0)
+ //{
+ // Application.RunOnMainThread(() =>
+ // {
+ // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip5), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ // });
+ // return;
+ //}
var dNow = DateTime.Now;
var validDateTime = new DateTime(dNow.Year, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute, dNow.Second);
@@ -554,6 +608,11 @@
if (doorLock.tempPasswordObject != null)
{
var addDoorLockTempPasswordData = new ZigBee.Device.DoorLock.AddDoorLockTempPasswordData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ addDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ addDoorLockTempPasswordData.IsOtherAccountCtrl = true;
+ }
addDoorLockTempPasswordData.TempPwd = doorLock.tempPasswordObject.TempPassword;
if (doorLock.DeviceAddr != null)
{
@@ -572,8 +631,8 @@
});
return;
}
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;//XMUnSelect XMBlack
- btnFinifh.Enable = false;
+ //btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;//XMUnSelect XMBlack
+ //btnFinifh.Enable = false;
Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify = false;
doorLock.LocalTempPassword = doorLock.tempPasswordObject.TempPassword;
TimeDateData(doorLock.tempPasswordObject.ValidTime, doorLock.tempPasswordObject.InValidTime);
@@ -596,7 +655,10 @@
return;
}
}
- catch { }
+ catch (Exception ex)
+ {
+ var mess = ex.Message;
+ }
finally
{
Application.RunOnMainThread(() =>
@@ -625,6 +687,11 @@
if (resultData != null && resultData.defaultControlResponseData != null && resultData.defaultControlResponseData.status == 0)
{
var delDoorLockTempPasswordData = new ZigBee.Device.DoorLock.DelDoorLockTempPasswordData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ delDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ delDoorLockTempPasswordData.IsOtherAccountCtrl = true;
+ }
if (doorLock.DeviceAddr != null)
{
delDoorLockTempPasswordData.LocalDoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
@@ -636,6 +703,7 @@
doorLock.LocalTempPassword = "";
TimeDateData(DateTime.Now, DateTime.Now, true);
Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InTempPasswordVisiable = false;
+ Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify = true;
}
else
{
@@ -673,6 +741,11 @@
try
{
var getDoorLockTempPasswordData = new ZigBee.Device.DoorLock.GetDoorLockTempPasswordData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ getDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ getDoorLockTempPasswordData.IsOtherAccountCtrl = true;
+ }
if (doorLock.DeviceAddr != null)
{
getDoorLockTempPasswordData.LocalDoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
index f6bbed0..53eec42 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -314,6 +314,11 @@
Action<Shared.View> action = async (obj) =>
{
var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ refreshDoorLockData.IsOtherAccountCtrl = true;
+ }
refreshDoorLockData.CloudAccountId = curAccountObj.SubAccountDistributedMark;
if (doorLock.DeviceAddr != null)
{
@@ -362,6 +367,11 @@
if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
{
var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ deleteDoorLockData.IsOtherAccountCtrl = true;
+ }
if (doorLock.DeviceAddr != null)
{
deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
@@ -393,6 +403,11 @@
if (isSecondDel)
{
var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ deleteDoorLockData.IsOtherAccountCtrl = true;
+ }
if (doorLock.DeviceAddr != null)
{
deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
@@ -757,6 +772,11 @@
Action<Shared.View> action = async (obj) =>
{
var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ refreshDoorLockData.IsOtherAccountCtrl = true;
+ }
refreshDoorLockData.CloudAccountId = curAccountObj.SubAccountDistributedMark;
if (doorLock.DeviceAddr != null)
{
@@ -805,6 +825,11 @@
if (resultData.defaultControlResponseData.status == 0)
{
var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ deleteDoorLockData.IsOtherAccountCtrl = true;
+ }
if (doorLock.DeviceAddr != null)
{
deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
index b43c2b8..a2400e0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
@@ -54,6 +54,11 @@
foreach (var curAccountObj in doorLock.localAllAccountList)
{
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ localDoorLockObj.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ localDoorLockObj.IsOtherAccountCtrl = true;
+ }
localDoorLockObj.CloudAccountId = curAccountObj.SubAccountDistributedMark;
if (doorLock.DeviceAddr != null)
{
@@ -80,6 +85,10 @@
}
}
}
+ }
+ else
+ {
+
}
}
catch { }
@@ -463,6 +472,11 @@
else
{
var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ addLockInfo.IsOtherAccountCtrl = true;
+ }
addLockInfo.CloudAccountId = curAccountId;
if (doorLock.DeviceAddr != null)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
index 67b568b..9b7e97c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
@@ -97,7 +97,11 @@
async void MidFrameLayoutContent()
{
- var SubAccounList = await ZigBee.Device.DoorLock.GetSubAccountByDistributedMark();
+ List<Shared.Phone.UserCenter.MemberInfoRes> SubAccounList = null;
+ if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
+ {
+ SubAccounList = await ZigBee.Device.DoorLock.GetSubAccountByDistributedMark();
+ }
var masterAccount = new Shared.Phone.UserCenter.MemberInfoRes();
masterAccount.Account = Shared.Common.Config.Instance.Account;
@@ -184,13 +188,6 @@
Shared.Phone.UserView.HomePage.Instance.AddChidren(masterManagementPage);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
masterManagementPage.Show();
- }
- else if (currentIndex == 3)
- {
- var userDoorLockPage = new UserDoorLockPage(doorLock, currentAccount);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
index c8e953e..29ece02 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
@@ -390,7 +390,7 @@
if (mode != GatewayBindMode.BindAgain)
{
//鎴戣寰楄繖閲岄渶瑕佽幏鍙栦竴涓嬫柊缃戝叧鐨勮澶囧垪琛�
- await Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way);
+ Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way);
}
}
return true;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessGatewaySearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessGatewaySearchForm.cs
index ed9d6cd..943dab1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessGatewaySearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessGatewaySearchForm.cs
@@ -250,7 +250,7 @@
//缃戝叧缁戝畾鍦ㄥ綋鍓嶈处鍙蜂笅鐨勫叾浠栦綇瀹呴噷\r\n璇疯В闄ょ粦瀹氬悗鍐嶈瘯(IP鍦板潃)
if (result == 0) { continue; }
//鎴戣寰楄繖閲岄渶瑕佽幏鍙栦竴涓嬫柊缃戝叧鐨勮澶囧垪琛�
- await Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay);
+ Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay);
Application.RunOnMainThread(() =>
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
index 8a6a8e7..05a06bb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -88,19 +88,7 @@
if (listway.Count == 0)
{
//杩樻病鏈夌粦瀹氱綉鍏冲摝
- var btnPic = new PicViewControl(683, 392);
- btnPic.UnSelectedImagePath = "Item/NoFunction.png";
- btnPic.Y = (int)(bodyFrameLayout.Height * 0.382) - Application.GetRealHeight(392 / 2);
- btnPic.Gravity = Gravity.CenterHorizontal;
- bodyFrameLayout.AddChidren(btnPic);
-
- var btnView = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
- btnView.Y = btnPic.Bottom + Application.GetRealHeight(32);
- btnView.TextID = R.MyInternationalizationString.uHadNotBindGatewayMsg;
- btnView.TextAlignment = TextAlignment.Center;
- btnView.TextSize = 12;
- btnView.TextColor = UserCenterColor.Current.TextGrayColor1;
- bodyFrameLayout.AddChidren(btnView);
+ this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uHadNotBindGatewayMsg));
return;
}
@@ -177,8 +165,11 @@
}
this.ShowMassage(ShowMsgType.Confirm, msg, () =>
{
- //鎵ц鍒囨崲缃戝叧鎿嶄綔
- this.DoSwitchGateway(strWayId);
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鎵ц鍒囨崲缃戝叧鎿嶄綔
+ this.DoSwitchGateway(strWayId);
+ });
});
};
@@ -278,19 +269,22 @@
//濡傛灉閫夋嫨浜嗗埛鏂扮殑缃戝叧锛屽垯涓嶅叧闂鐞嗙晫闈�
this.closeDeviceManagForm = false;
- if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
+ HdlThreadLogic.Current.RunMain(() =>
{
- //鍒锋柊涓荤敾闈�
- var form = new Device.DeviceListMainForm();
- this.AddFromAndRemoveNowForm(form);
- }
- else
- {
- //鍏抽棴鐣岄潰
- this.CloseForm();
- //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
- this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
- }
+ if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
+ {
+ //鍒锋柊涓荤敾闈�
+ var form = new Device.DeviceListMainForm();
+ this.AddFromAndRemoveNowForm(form);
+ }
+ else
+ {
+ //鍏抽棴鐣岄潰
+ this.CloseForm();
+ //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
+ this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
+ }
+ });
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs
index a8ad87f..9c535f6 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotAccountPasswordForm.cs
@@ -187,8 +187,8 @@
btnCode.BackgroundColor = 0xfffebca9;
//?s鍚庨噸鍙�
string repeat = Language.StringByID(R.MyInternationalizationString.RepeatSend1);
- //鏈夋晥鏃堕棿300绉�
- int waitime = 300;
+ //鏈夋晥鏃堕棿60绉�
+ int waitime = 60;
btnCode.Text = waitime + "s" + repeat;
HdlThreadLogic.Current.RunThread(() =>
@@ -199,7 +199,6 @@
System.Threading.Thread.Sleep(1000);
if (waitime == 0)
{
- this.canCheckCode = false;
Application.RunOnMainThread(() =>
{
if (btnCode != null)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
index 7d95668..0a8979a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
@@ -12,6 +12,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 瀹屾垚娣诲姞鎴块棿鐨勪簨浠�
+ /// </summary>
+ public Action FinishEditorEvent = null;
+ /// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
private VerticalListControl listview = null;
@@ -85,19 +89,23 @@
//搴曠嚎
txtRoomName.AddBottomLine();
- //銆愭墍灞炴ゼ灞傘��
- var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.floorKeys], this.listview.rowSpace / 2);
- listview.AddChidren(btnBelone);
- btnBelone.InitControl();
- //鍙崇澶�
- btnBelone.AddRightArrow();
- //搴曠嚎
- btnBelone.AddBottomLine();
- btnBelone.ButtonClickEvent += (sender, e) =>
+ //璇PP涓烘湁妤煎眰鐨勬ā寮忔墠寮�鍚繖涓彍鍗�
+ if (floorKeys != string.Empty)
{
- //妤煎眰閫夋嫨
- this.ShowSelectFloor(btnBelone);
- };
+ //銆愭墍灞炴ゼ灞傘��
+ var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.floorKeys], this.listview.rowSpace / 2);
+ listview.AddChidren(btnBelone);
+ btnBelone.InitControl();
+ //鍙崇澶�
+ btnBelone.AddRightArrow();
+ //搴曠嚎
+ btnBelone.AddBottomLine();
+ btnBelone.ButtonClickEvent += (sender, e) =>
+ {
+ //妤煎眰閫夋嫨
+ this.ShowSelectFloor(btnBelone);
+ };
+ }
//銆愭俯搴︺��
var rowTemperature = new FrameRowControl(this.listview.rowSpace / 2);
@@ -152,6 +160,8 @@
}
else
{
+ this.FinishEditorEvent?.Invoke();
+
this.CloseForm();
}
};
@@ -379,6 +389,8 @@
/// </summary>
public override void CloseForm()
{
+ this.FinishEditorEvent = null;
+
HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice");
HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice");
@@ -405,7 +417,7 @@
{
if (Shared.Common.Room.Lists.Find((obj) => obj.Name == this.newRoom.Name && obj.Id != this.newRoom.Id) != null)
{
- this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.HadSameRoom));
+ this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uRoomNameIsExist));
return false;
}
}
@@ -414,7 +426,7 @@
var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(this.floorKeys);
if (listRoom.Find((obj) => obj.Name == this.newRoom.Name && obj.Id != this.newRoom.Id) != null)
{
- this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.HadSameRoom));
+ this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uRoomNameIsExist));
return false;
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
index 1b22eb0..a737171 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -12,6 +12,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 缁撴潫缂栬緫鍚嶇О鐨勪簨浠�
+ /// </summary>
+ public Action<string> FinishEditorEvent = null;
+ /// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
private VerticalListControl listview = null;
@@ -82,19 +86,23 @@
//搴曠嚎
txtRoomName.AddBottomLine();
- //銆愭墍灞炴ゼ灞傘��
- var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.cloneRoom.FloorId], this.listview.rowSpace / 2);
- listview.AddChidren(btnBelone);
- btnBelone.InitControl();
- //鍙崇澶�
- btnBelone.AddRightArrow();
- //搴曠嚎
- btnBelone.AddBottomLine();
- btnBelone.ButtonClickEvent += (sender, e) =>
+ //璇PP涓烘湁妤煎眰鐨勬ā寮忔墠寮�鍚繖涓彍鍗�
+ if (string.IsNullOrEmpty(this.cloneRoom.FloorId) == false)
{
- //妤煎眰閫夋嫨
- this.ShowSelectFloor(btnBelone);
- };
+ //銆愭墍灞炴ゼ灞傘��
+ var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.cloneRoom.FloorId], this.listview.rowSpace / 2);
+ listview.AddChidren(btnBelone);
+ btnBelone.InitControl();
+ //鍙崇澶�
+ btnBelone.AddRightArrow();
+ //搴曠嚎
+ btnBelone.AddBottomLine();
+ btnBelone.ButtonClickEvent += (sender, e) =>
+ {
+ //妤煎眰閫夋嫨
+ this.ShowSelectFloor(btnBelone);
+ };
+ }
//銆愭俯搴︺��
var rowTemperature = new FrameRowControl(this.listview.rowSpace / 2);
@@ -152,6 +160,8 @@
return;
}
editorRoom.Save();
+
+ FinishEditorEvent?.Invoke(this.cloneRoom.Name);
this.CloseForm();
};
}
@@ -378,6 +388,8 @@
/// </summary>
public override void CloseForm()
{
+ this.FinishEditorEvent = null;
+
HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice");
HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice");
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs
index 4c66ad9..51dfaf3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs
@@ -110,7 +110,7 @@
listView.AddChidren(frameRow);
//鍥炬爣
var btnIcon = frameRow.frameTable.AddLeftIcon(81);
- btnIcon.UnSelectedImagePath = "Item/RoomIcon.png";
+ btnIcon.UnSelectedImagePath = "Item/RoomIconSelected.png";
//鍚嶇О
var btnName = frameRow.frameTable.AddLeftCaption(room.Name, 600);
btnName.TextSize = 15;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
index 184c54c..1d9b16b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
@@ -170,17 +170,18 @@
{
//娓呯┖妗屽竷
this.frameTable.RemoveAll();
-
- var listView = new VerticalFrameControl(29);
- listView.Height = frameTable.Height;
- frameTable.AddChidren(listView);
-
HdlThreadLogic.Current.RunMainInThread(() =>
{
- if (this.frameTable == null)
+ if (lookRoom.SceneUIList.Count == 0)
{
+ //杩樻病鏈夋坊鍔犲満鏅摝
+ this.ShowNotDataImage(frameTable, Language.StringByID(R.MyInternationalizationString.uDoNotHadAddScenceMsg));
return;
}
+ var listView = new VerticalFrameControl(29);
+ listView.Height = frameTable.Height;
+ frameTable.AddChidren(listView);
+
foreach (var data in lookRoom.SceneUIList)
{
var frameContr = new FrameLayout();
@@ -207,27 +208,30 @@
//娓呯┖妗屽竷
this.frameTable.RemoveAll();
- var frameBack = new FrameLayout();
- frameBack.X = ControlCommonResourse.XXLeft;
- frameBack.BackgroundColor = UserCenterColor.Current.White;
- frameBack.Width = bodyFrameLayout.Width;
- frameBack.Height = Application.GetRealHeight(1650);
- frameBack.Radius = (uint)Application.GetMinRealAverage(20);
- frameTable.AddChidren(frameBack);
-
- var listView = new VerticalListControl(23);
- listView.Y = Application.GetRealHeight(23);
- listView.Height = Application.GetRealHeight(1549 - 23);
- frameBack.AddChidren(listView);
-
HdlThreadLogic.Current.RunMainInThread(() =>
{
- if (listView == null)
- {
- return;
- }
//鑾峰彇鍒嗙粍鍚庣殑璁惧鍒楄〃
var dicGroupDevice = this.GetAllGroupDevice();
+ if (dicGroupDevice.Count == 0)
+ {
+ //杩樻病鏈夋坊鍔犺澶囧摝
+ this.ShowNotDataImage(frameTable, Language.StringByID(R.MyInternationalizationString.uDoNotHadAddDeviceMsg));
+ return;
+ }
+
+ var frameBack = new FrameLayout();
+ frameBack.X = ControlCommonResourse.XXLeft;
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Width = bodyFrameLayout.Width;
+ frameBack.Height = Application.GetRealHeight(1650);
+ frameBack.Radius = (uint)Application.GetMinRealAverage(20);
+ frameTable.AddChidren(frameBack);
+
+ var listView = new VerticalListControl(23);
+ listView.Y = Application.GetRealHeight(23);
+ listView.Height = Application.GetRealHeight(1549 - 23);
+ frameBack.AddChidren(listView);
+
var dicData = new Dictionary<string, DeviceRowInfo>();
var listGwId = new List<string>();
foreach (var textId in dicGroupDevice.Keys)
@@ -370,7 +374,7 @@
/// <param name="dicData">浠ュ洖璺綔涓虹储寮曞幓鎸囧畾瀵硅薄</param>
private void StartCheckDeviceOnline(VerticalListControl listView, List<string> listGwId, Dictionary<string, DeviceRowInfo> dicData)
{
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
for (int i = 0; i < listGwId.Count; i++)
{
@@ -380,7 +384,7 @@
}
//杩欓噷涓昏鍙槸鑾峰彇鍦ㄧ嚎鐘舵��
var zbway = HdlGatewayLogic.Current.GetLocalGateway(listGwId[i]);
- var result = await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, (device) =>
+ var result = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, (device) =>
{
string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
if (listView.Parent == null)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index dee51b6..f7e7f35 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -12,17 +12,25 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 妗屽竷鎺т欢
+ /// </summary>
+ private FrameLayout frameTable = null;
+ /// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
private VerticalListControl listView = null;
/// <summary>
- /// 鍒楄〃鎺т欢鏈�澶ч珮搴�
- /// </summary>
- private int MaxListViewHeight = 0;
- /// <summary>
/// 妤煎眰椤哄簭
/// </summary>
private List<string> listFloorSort = new List<string>();
+ /// <summary>
+ /// 鎴块棿椤哄簭
+ /// </summary>
+ private List<string> listRoomSort = new List<string>();
+ /// <summary>
+ /// 褰撳墠APP鐨勪綇瀹呮ā寮� 0:杩樻病鏈夎缃湁妯″紡 1:妤煎眰妯″紡 2:娌℃湁妤煎眰妯″紡
+ /// </summary>
+ private int AppResidenceMode = 0;
#endregion
@@ -37,52 +45,174 @@
//璁剧疆澶撮儴淇℃伅
base.SetTitleText(Common.Config.Instance.Home.Name);
- //鍒ゆ柇鑳藉惁鍒犻櫎浣忓畢
- if (i_CanDeleteResidence == true)
+ //涓讳汉鎴栬�呯鐞嗗憳鎵嶄細鍑虹幇杩欎釜鑿滃崟
+ if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
{
//鍒濆鍖栧彸涓婅鑿滃崟
this.InitTopRightMenu();
}
//鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame();
+ this.InitMiddleFrame(i_CanDeleteResidence);
}
/// <summary>
/// 鍒濆鍖栦腑閮ㄤ俊鎭�
/// </summary>
- private void InitMiddleFrame()
+ /// <param name="i_CanDeleteResidence">鑳藉惁鍒犻櫎褰撳墠浣忓畢</param>
+ private void InitMiddleFrame(bool i_CanDeleteResidence)
{
//娓呯┖bodyFrame
this.ClearBodyFrame();
- var frameHome = new FrameRowControl();
- frameHome.Height = Application.GetRealHeight(173);
- frameHome.BackgroundColor = UserCenterColor.Current.White;
- bodyFrameLayout.AddChidren(frameHome);
+ var rowHome = new RowLayoutControl();
+ rowHome.Height = Application.GetRealHeight(173);
+ rowHome.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(rowHome);
- var btnAdreeIcon = frameHome.AddLeftIcon(81);
+ var btnAdreeIcon = rowHome.frameTable.AddLeftIcon(81);
btnAdreeIcon.UnSelectedImagePath = "Item/FixedPositionSelected.png";
//浣忓畢鍚嶇О
- var btnHomeName = frameHome.AddLeftCaption(Common.Config.Instance.Home.Name, 700, 60);
+ var btnHomeName = rowHome.frameTable.AddLeftCaption(Common.Config.Instance.Home.Name, 700, 60);
btnHomeName.TextSize = 15;
btnHomeName.Y = Application.GetRealHeight(35);
- frameHome.AddChidren(btnHomeName, ChidrenBindMode.BindEventOnly);
+ rowHome.frameTable.AddChidren(btnHomeName, ChidrenBindMode.BindEventOnly);
//褰撳墠浣忓畢
- var btnNowView = frameHome.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowResidence), 700, 49);
+ var btnNowView = rowHome.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowResidence), 700, 49);
btnNowView.TextSize = 12;
btnNowView.Y = Application.GetRealHeight(95);
btnNowView.TextColor = UserCenterColor.Current.TextGrayColor1;
- frameHome.AddChidren(btnNowView, ChidrenBindMode.BindEventOnly);
+ rowHome.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEventOnly);
//鍙崇澶�
- frameHome.AddRightArrow();
+ rowHome.frameTable.AddRightArrow();
+ if (i_CanDeleteResidence == true)
+ {
+ //鍒犻櫎
+ var btnDelete = new NormalViewControl(Application.GetRealWidth(184), rowHome.Height, false);
+ btnDelete.BackgroundColor = 0xfff75858;
+ btnDelete.TextAlignment = TextAlignment.Center;
+ btnDelete.TextColor = UserCenterColor.Current.White;
+ btnDelete.TextSize = 12;
+ btnDelete.TextID = R.MyInternationalizationString.uDelete;
+ rowHome.AddRightView(btnDelete);
+ btnDelete.ButtonClickEvent += (sender, e) =>
+ {
+ //纭鍒犻櫎浣忓畢鍙婃墍鏈夋ゼ灞傘�佹埧闂�?
+ string msg = Language.StringByID(R.MyInternationalizationString.uDeleteResidenceMsg);
+ this.ShowMassage(ShowMsgType.Confirm, msg, () =>
+ {
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ this.DeleteResidence();
+ });
+ });
+ };
+ }
+ //鍒濆鍖栨甯�
+ this.frameTable = new FrameLayout();
+ frameTable.Y = rowHome.Bottom + Application.GetRealHeight(23);
+ frameTable.Height = bodyFrameLayout.Height - rowHome.Bottom - Application.GetRealHeight(23);
+ bodyFrameLayout.AddChidren(frameTable);
+
+ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
+ this.InitFrameTableByMode();
+ }
+
+ /// <summary>
+ /// 鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
+ /// </summary>
+ private void InitFrameTableByMode()
+ {
+ this.frameTable.RemoveAll();
+
+ //0:杩樻病鏈夎缃湁妯″紡 1:妤煎眰妯″紡 2:娌℃湁妤煎眰妯″紡
+ AppResidenceMode = this.CheckAppResidenceMode();
+ if (AppResidenceMode == 1)
+ {
+ //鍒濆鍖栨ゼ灞傛ā寮�
+ this.InitControlByFloorMode();
+ }
+ else if (AppResidenceMode == 2)
+ {
+ //鍒濆鍖栨棤妤煎眰妯″紡
+ this.InitControlByNotFloorMode();
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍙充笂瑙掕彍鍗昣________________________
+
+ /// <summary>
+ /// 鍒濆鍖栧彸涓婅鑿滃崟
+ /// </summary>
+ private void InitTopRightMenu()
+ {
+ var btnIcon = new MostRightIconControl(69, 69);
+ btnIcon.UnSelectedImagePath = "Item/Add.png";
+ topFrameLayout.AddChidren(btnIcon);
+ btnIcon.InitControl();
+ btnIcon.ButtonClickEvent += ((sender, e) =>
+ {
+ //0:杩樻病鏈夎缃湁妯″紡 1:妤煎眰妯″紡 2:娌℃湁妤煎眰妯″紡
+ AppResidenceMode = this.CheckAppResidenceMode();
+ //娌℃湁璁剧疆杩囨ā寮�
+ if (AppResidenceMode == 0)
+ {
+ var frame = new TopRightMenuControl(2);
+ //鍒涘缓妤煎眰
+ frame.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uCreatFloor), "Item/CreatFloor.png", "Item/CreatFloorSelected.png", () =>
+ {
+ //鍒涘缓妤煎眰
+ this.CreatOrEditorFloor(null, string.Empty, string.Empty);
+ });
+ //鍒涘缓鎴块棿
+ frame.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uCreatRoom), "Item/RoomIcon.png", "Item/RoomIconSelected.png", () =>
+ {
+ var form = new AddNewRoomForm();
+ form.AddForm(string.Empty);
+ form.FinishEditorEvent += () =>
+ {
+ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
+ this.InitFrameTableByMode();
+ };
+ });
+ }
+ //妤煎眰妯″紡
+ else if (AppResidenceMode == 1)
+ {
+ //鍒涘缓妤煎眰
+ this.CreatOrEditorFloor(null, string.Empty, string.Empty);
+ }
+ //鏃犳ゼ灞傛ā寮�
+ else if (AppResidenceMode == 2)
+ {
+ var form = new AddNewRoomForm();
+ form.AddForm(string.Empty);
+ form.FinishEditorEvent += () =>
+ {
+ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
+ this.InitFrameTableByMode();
+ };
+ }
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栨ゼ灞傛ā寮廮____________________
+
+ /// <summary>
+ /// 鍒濆鍖栨ゼ灞傛ā寮�
+ /// </summary>
+ private void InitControlByFloorMode()
+ {
var frameFloor = new FrameRowControl();
frameFloor.UseClickStatu = false;
- frameFloor.Y = frameHome.Bottom + Application.GetRealHeight(23);
frameFloor.Height = Application.GetRealHeight(115);
frameFloor.BackgroundColor = UserCenterColor.Current.White;
- bodyFrameLayout.AddChidren(frameFloor);
+ frameTable.AddChidren(frameFloor);
//妤煎眰
var btnFloor = frameFloor.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFloor), 200, 60);
@@ -90,26 +220,12 @@
btnFloor.TextColor = UserCenterColor.Current.TextColor2;
btnFloor.TextSize = 15;
frameFloor.AddChidren(btnFloor, ChidrenBindMode.NotBind);
- if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
- {
- //娣诲姞妤煎眰
- var btnAddFloor = frameFloor.AddMostRightEmptyIcon(69, 69);
- frameFloor.ChangedChidrenBindMode(btnAddFloor, ChidrenBindMode.NotBind);
- btnAddFloor.btnIcon.Y = Application.GetRealHeight(46);
- btnAddFloor.UnSelectedImagePath = "Item/Add.png";
- btnAddFloor.ButtonClickEvent += (sender, e) =>
- {
- //鍒涘缓妤煎眰
- this.CreatOrEditorFloor(string.Empty, string.Empty);
- };
- }
- this.MaxListViewHeight = bodyFrameLayout.Height - frameFloor.Bottom;
listView = new VerticalListControl(29);
listView.BackgroundColor = UserCenterColor.Current.White;
listView.Y = frameFloor.Bottom;
- listView.Height = MaxListViewHeight;
- bodyFrameLayout.AddChidren(listView);
+ listView.Height = frameTable.Height - frameFloor.Bottom;
+ frameTable.AddChidren(listView);
//鍒濆鍖栨ゼ灞傝
this.InitFloorRow();
@@ -128,8 +244,6 @@
listFloorSort.Add(keys);
}
- listView.Height = MaxListViewHeight;
- listView.RemoveAll();
if (Common.Config.Instance.Home.FloorDics.Count == 0)
{
return;
@@ -191,8 +305,8 @@
frameRow.AddRightView(btnChanged);
btnChanged.ButtonClickEvent += (sender, e) =>
{
- //鍒涘缓鎴栬�呯紪杈戞ゼ灞�
- this.CreatOrEditorFloor(keys, floorName);
+ //鍒涘缓鎴栬�呯紪杈戞ゼ灞�
+ this.CreatOrEditorFloor(btnFloor, keys, floorName);
};
//鍒犻櫎
@@ -205,22 +319,60 @@
frameRow.AddRightView(btnDelete);
btnDelete.ButtonClickEvent += (sender, e) =>
{
- //鍒犻櫎妤煎眰
- this.DeleteFloor(keys);
+ //纭鍒犻櫎妤煎眰鍙婂叾鎵�鏈夋埧闂�?
+ this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteFloorMsg), () =>
+ {
+ //绉婚櫎妤煎眰
+ Common.Config.Instance.Home.FloorDics.Remove(keys);
+ if (Common.Room.CurrentRoom == null)
+ {
+ Common.Room.CurrentRoom = Common.Room.Lists[0];
+ }
+ var listDeleteFile = new List<string>();
+ for (int i = 0; i < Common.Room.Lists.Count; i++)
+ {
+ if (Common.Room.Lists[i].FloorId == keys)
+ {
+ listDeleteFile.Add(Common.Room.Lists[i].FileName);
+ }
+ }
+ //鍒犻櫎鎴块棿
+ foreach (string fileName in listDeleteFile)
+ {
+ Common.Room.CurrentRoom.Remove(fileName);
+ }
+ //濡傛灉褰撳墠閫夋嫨鐨勬埧闂存槸鍒犻櫎瀵硅薄鐨勮瘽
+ if (Common.Room.CurrentRoom.FloorId == keys)
+ {
+ Common.Room.CurrentRoom = Common.Room.Lists[0];
+ }
+ Common.Config.Instance.Home.Save();
+ //淇濆瓨椤哄簭
+ listFloorSort.Remove(keys);
+ Common.Room.CurrentRoom.SaveFloorSort(listFloorSort);
+
+ if (Common.Config.Instance.Home.FloorDics.Count == 0)
+ {
+ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
+ this.InitFrameTableByMode();
+ }
+ else
+ {
+ frameRow.RemoveFromParent();
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
+ }
+ });
};
}
}
- #endregion
-
- #region 鈻� 鍒涘缓鎴栫紪杈戞ゼ灞俖____________________
-
/// <summary>
/// 鍒涘缓鎴栬�呯紪杈戞ゼ灞�
/// </summary>
+ /// <param name="btnFloor"></param>
/// <param name="keys"></param>
/// <param name="floorName"></param>
- private void CreatOrEditorFloor(string keys, string floorName)
+ private void CreatOrEditorFloor(NormalViewControl btnFloor, string keys, string floorName)
{
//鐢熸垚涓�涓脊绐楃敾闈�
var dialogForm = new DialogInputFrameControl(this, DialogFrameMode.OnlyInput);
@@ -254,11 +406,257 @@
}
Common.Config.Instance.Home.FloorDics[keys] = textValue;
Common.Config.Instance.Home.Save();
- //閲嶆柊鍒濆鍖栨ゼ灞傝
- this.InitFloorRow();
+ if (btnFloor != null)
+ {
+ btnFloor.Text = textValue;
+ }
+ else
+ {
+ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
+ this.InitFrameTableByMode();
+ }
}
});
}
+
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖栨棤妤煎眰妯″紡___________________
+
+ /// <summary>
+ /// 鍒濆鍖栨棤妤煎眰妯″紡
+ /// </summary>
+ private void InitControlByNotFloorMode()
+ {
+ var frameRoom = new FrameRowControl();
+ frameRoom.UseClickStatu = false;
+ frameRoom.Height = Application.GetRealHeight(115);
+ frameRoom.BackgroundColor = UserCenterColor.Current.White;
+ frameTable.AddChidren(frameRoom);
+
+ //鎴块棿鍒楄〃
+ var btnRoomList = frameRoom.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uRoomList), 200, 60);
+ btnRoomList.Y = Application.GetRealHeight(50);
+ btnRoomList.TextColor = UserCenterColor.Current.TextColor2;
+ btnRoomList.TextSize = 15;
+ frameRoom.AddChidren(btnRoomList, ChidrenBindMode.NotBind);
+
+ listView = new VerticalListControl(29);
+ listView.BackgroundColor = UserCenterColor.Current.White;
+ listView.Y = frameRoom.Bottom;
+ listView.Height = frameTable.Height - frameRoom.Bottom;
+ frameTable.AddChidren(listView);
+
+ //鍒濆鍖栨埧闂村垪琛�
+ this.InitRoomListRow();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨埧闂村垪琛�
+ /// </summary>
+ private void InitRoomListRow()
+ {
+ //鑾峰彇妤煎眰鐨勬埧闂�
+ var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(string.Empty);
+ this.listRoomSort.Clear();
+ for (int i = 0; i < listRoom.Count; i++)
+ {
+ this.listRoomSort.Add(listRoom[i].Id);
+ }
+
+ for (int i = 0; i < listRoom.Count; i++)
+ {
+ //娣诲姞鎴块棿琛�
+ this.AddRoomRow(listRoom[i], i != listRoom.Count - 1);
+ }
+ //璋冩暣鎺т欢鐪熷疄楂樺害
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
+ }
+
+ #endregion
+
+ #region 鈻� 娣诲姞鎴块棿琛宊________________________
+
+ /// <summary>
+ /// 娣诲姞鎴块棿琛�
+ /// </summary>
+ /// <param name="room"></param>
+ /// <param name="addLine"></param>
+ private void AddRoomRow(Common.Room room, bool addLine)
+ {
+ var frameRow = new RowLayoutControl(listView.rowSpace / 2);
+ listView.AddChidren(frameRow);
+ //鍥炬爣
+ var btnIcon = frameRow.frameTable.AddLeftIcon(81);
+ btnIcon.UnSelectedImagePath = "Item/RoomIconSelected.png";
+ //鍚嶇О
+ var btnName = frameRow.frameTable.AddLeftCaption(room.Name, 600);
+ btnName.TextSize = 15;
+ //鍙崇澶�
+ frameRow.frameTable.AddRightArrow();
+ if (addLine == true)
+ {
+ //搴曠嚎
+ frameRow.frameTable.AddBottomLine();
+ }
+ frameRow.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new LookRoomSettionForm();
+ form.AddForm(room);
+ };
+
+ if (room.IsSharedRoom == true)
+ {
+ //濡傛灉鏄垎浜殑鎴块棿锛屼笉鑳界紪杈戝拰淇敼
+ return;
+ }
+
+ //缂栬緫
+ var btnEditor = new NormalViewControl(Application.GetRealWidth(184), frameRow.Height, false);
+ btnEditor.BackgroundColor = 0xff4a4a4a;
+ btnEditor.TextSize = 12;
+ btnEditor.TextColor = UserCenterColor.Current.White;
+ btnEditor.TextAlignment = TextAlignment.Center;
+ btnEditor.TextID = R.MyInternationalizationString.uEditor;
+ frameRow.AddRightView(btnEditor);
+ btnEditor.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new EditorRoomInforForm();
+ form.AddForm(room);
+ form.FinishEditorEvent += (roomName) =>
+ {
+ btnName.Text = roomName;
+ };
+ };
+
+ //鍒犻櫎
+ var btnDelete = new NormalViewControl(Application.GetRealWidth(184), frameRow.Height, false);
+ btnDelete.BackgroundColor = 0xfff75858;
+ btnDelete.TextSize = 12;
+ btnDelete.TextColor = UserCenterColor.Current.White;
+ btnDelete.TextAlignment = TextAlignment.Center;
+ btnDelete.TextID = R.MyInternationalizationString.uDelete;
+ frameRow.AddRightView(btnDelete);
+ btnDelete.ButtonClickEvent += (sender, e) =>
+ {
+ //纭鍒犻櫎鎴块棿?
+ this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteRoomMsg), () =>
+ {
+ if (Common.Room.CurrentRoom.Id == room.Id)
+ {
+ //濡傛灉鍒犻櫎鐨勬槸褰撳墠鎴块棿鐨勮瘽
+ Common.Room.CurrentRoom = Common.Room.Lists[0];
+ }
+ Common.Room.CurrentRoom.Remove(room.FileName);
+ //淇濆瓨椤哄簭
+ this.listRoomSort.Remove(room.Id);
+ Common.Room.CurrentRoom.SaveRoomSort(string.Empty, this.listRoomSort);
+
+ if (Common.Room.Lists.Count <= 1)
+ {
+ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
+ this.InitFrameTableByMode();
+ }
+ else
+ {
+ frameRow.RemoveFromParent();
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
+ }
+ });
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 鍒犻櫎浣忓畢___________________________
+
+ /// <summary>
+ /// 鍒犻櫎浣忓畢
+ /// </summary>
+ public async void DeleteResidence()
+ {
+ //寮�鍚繘搴︽潯
+ this.ShowProgressBar();
+
+ var Pra = new DeleteResidencePra();
+ Pra.HomeId = Common.Config.Instance.Home.Id;
+ Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+
+ bool result = await UserCenterLogic.GetResultStatuByRequestHttps("App/DelHome", true, Pra);
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
+ if (result == false)
+ {
+ return;
+ }
+
+ //鍥犱负鍒犻櫎鐨勬槸褰撳墠鐨勪綇瀹�,鎵�浠ラ渶瑕佸厛鍒囨崲鍒板埆鐨勪綇瀹�
+ string deleteId = Common.Config.Instance.Home.Id;
+ string deleteFile = Common.Config.Instance.Home.FileName;
+ int index = 0;
+ for (; index < Common.Config.Instance.HomeFilePathList.Count; index++)
+ {
+ if (Common.Config.Instance.HomeFilePathList[index] == deleteFile)
+ {
+ //褰撳墠浣忓畢鎵�澶勭殑浣嶇疆(浣忓畢鏁拌偗瀹氬ぇ浜�1,涓嶇劧涓嶄細鍑虹幇鍒犻櫎鎸夐挳)
+ if (index == 0)
+ {
+ //鍙栦笅涓�浣�
+ index++;
+ }
+ else
+ {
+ //鍙栧墠涓�浣�
+ index--;
+ }
+ break;
+ }
+ }
+
+ var myHouse = Common.House.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]);
+ //鍒囨崲浣忓畢
+ Common.Config.Instance.HomeId = myHouse.Id;
+ Common.Global.CreateHomeDirectory(myHouse.Id);
+ Common.Config.Instance.Save();
+ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
+ await UserCenterLogic.InitUserCenterMenmoryAndThread();
+ Common.Room.InitAllRoom();
+
+ //鍒犻櫎浣忓畢
+ Common.House.DeleteHouseByHouseId(deleteId);
+
+ Application.RunOnMainThread(() =>
+ {
+ //鍏抽棴鐣岄潰
+ this.CloseForm();
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 妫�娴婣pp鐨勪綇瀹呮ā寮� 0:杩樻病鏈夎缃湁妯″紡 1:妤煎眰妯″紡 2:娌℃湁妤煎眰妯″紡
+ /// </summary>
+ /// <returns></returns>
+ private int CheckAppResidenceMode()
+ {
+ if (Common.Config.Instance.Home.FloorDics.Count > 0)
+ {
+ //鎷ユ湁妤煎眰
+ return 1;
+ }
+ if (Common.Room.Lists.Count > 1)
+ {
+ //鏃犳ゼ灞傛ā寮�
+ return 2;
+ }
+
+ return 0;
+ }
+
/// <summary>
/// 妫�娴嬫ゼ灞傚悕绉�
@@ -286,144 +684,6 @@
}
}
return true;
- }
-
- #endregion
-
- #region 鈻� 鍒犻櫎妤煎眰___________________________
-
- /// <summary>
- /// 鍒犻櫎妤煎眰
- /// </summary>
- /// <param name="keys"></param>
- private void DeleteFloor(string keys)
- {
- //纭鍒犻櫎妤煎眰鍙婂叾鎵�鏈夋埧闂�?
- this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteFloorMsg), () =>
- {
- //绉婚櫎妤煎眰
- Common.Config.Instance.Home.FloorDics.Remove(keys);
- if (Common.Room.CurrentRoom == null)
- {
- Common.Room.CurrentRoom = Common.Room.Lists[0];
- }
- var listDeleteFile = new List<string>();
- for (int i = 0; i < Common.Room.Lists.Count; i++)
- {
- if (Common.Room.Lists[i].FloorId == keys)
- {
- listDeleteFile.Add(Common.Room.Lists[i].FileName);
- }
- }
- //鍒犻櫎鎴块棿
- foreach (string fileName in listDeleteFile)
- {
- Common.Room.CurrentRoom.Remove(fileName);
- }
- //濡傛灉褰撳墠閫夋嫨鐨勬埧闂存槸鍒犻櫎瀵硅薄鐨勮瘽
- if (Common.Room.CurrentRoom.FloorId == keys)
- {
- Common.Room.CurrentRoom = Common.Room.Lists[0];
- }
- Common.Config.Instance.Home.Save();
- //閲嶆柊鍒濆鍖栨ゼ灞傝
- listFloorSort.Remove(keys);
- this.InitFloorRow();
- });
- }
-
- #endregion
-
- #region 鈻� 鍙充笂瑙掕彍鍗昣________________________
-
- /// <summary>
- /// 鍒濆鍖栧彸涓婅鑿滃崟
- /// </summary>
- private void InitTopRightMenu()
- {
- var btnIcon = new MostRightIconControl(69, 69);
- btnIcon.UnSelectedImagePath = "Item/More.png";
- topFrameLayout.AddChidren(btnIcon);
- btnIcon.InitControl();
- btnIcon.ButtonClickEvent += ((sender, e) =>
- {
- var frame = new TopRightMenuControl(1);
- //鍒犻櫎浣忓畢
- frame.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uDeleteResidence), "Item/DeleteIcon2.png", "Item/DeleteIcon2Selected.png", () =>
- {
- //纭鍒犻櫎浣忓畢鍙婃墍鏈夋ゼ灞傘�佹埧闂�?
- string msg = Language.StringByID(R.MyInternationalizationString.uDeleteResidenceMsg);
- this.ShowMassage(ShowMsgType.Confirm, msg, () =>
- {
- this.DeleteResidence();
- });
- });
- });
- }
-
- /// <summary>
- /// 鍒犻櫎浣忓畢
- /// </summary>
- public async void DeleteResidence()
- {
- //寮�鍚繘搴︽潯
- this.ShowProgressBar();
-
- var Pra = new DeleteResidencePra();
- Pra.HomeId = Common.Config.Instance.Home.Id;
- Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
-
- bool result = await UserCenterLogic.GetResultStatuByRequestHttps("App/DelHome", true, Pra);
- //鍏抽棴杩涘害鏉�
- this.CloseProgressBar();
- if (result == false)
- {
- return;
- }
-
- HdlThreadLogic.Current.RunThread(async () =>
- {
- //鍥犱负鍒犻櫎鐨勬槸褰撳墠鐨勪綇瀹�,鎵�浠ラ渶瑕佸厛鍒囨崲鍒板埆鐨勪綇瀹�
- string deleteId = Common.Config.Instance.Home.Id;
- string deleteFile = Common.Config.Instance.Home.FileName;
- int index = 0;
- for (; index < Common.Config.Instance.HomeFilePathList.Count; index++)
- {
- if (Common.Config.Instance.HomeFilePathList[index] == deleteFile)
- {
- //褰撳墠浣忓畢鎵�澶勭殑浣嶇疆(浣忓畢鏁拌偗瀹氬ぇ浜�1,涓嶇劧涓嶄細鍑虹幇鍒犻櫎鎸夐挳)
- if (index == 0)
- {
- //鍙栦笅涓�浣�
- index++;
- }
- else
- {
- //鍙栧墠涓�浣�
- index--;
- }
- break;
- }
- }
-
- var myHouse = Common.House.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]);
- //鍒囨崲浣忓畢
- Common.Config.Instance.HomeId = myHouse.Id;
- Common.Global.CreateHomeDirectory(myHouse.Id);
- Common.Config.Instance.Save();
- //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
- await UserCenterLogic.InitUserCenterMenmoryAndThread();
- Common.Room.InitAllRoom();
-
- //鍒犻櫎浣忓畢
- Common.House.DeleteHouseByHouseId(deleteId);
-
- Application.RunOnMainThread(() =>
- {
- //鍏抽棴鐣岄潰
- this.CloseForm();
- });
- });
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 47ea583..17beacf 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -456,7 +456,7 @@
oldGetOnlineTime = DateTime.Now;
//浠庤澶囧垪琛ㄤ腑鑾峰彇鍦ㄧ嚎鐘舵��
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//棣栧厛鑾峰彇杩欎簺浼犳劅鍣ㄦ墍鍦ㄧ殑缃戝叧
var listWay = new List<ZbGateway>();
@@ -477,7 +477,7 @@
//鐣岄潰鍏抽棴
return;
}
- await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
+ Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
}
});
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs
index de98c4b..1a76109 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs
@@ -235,7 +235,7 @@
listView.AddChidren(row);
//鍥炬爣
var btnIcon = row.AddLeftIcon(81);
- btnIcon.UnSelectedImagePath = "Item/RoomIcon.png";
+ btnIcon.UnSelectedImagePath = "Item/RoomIconSelected.png";
//鎴块棿鍚�
var btnName = row.AddLeftCaption(room.Name, 650);
btnName.TextSize = 15;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs
index ef235e2..d34fc96 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/LookSharedListRoomForm.cs
@@ -210,7 +210,7 @@
frameBack.AddChidren(frameRow);
//鍥炬爣
var btnIcon = frameRow.frameTable.AddLeftIcon(81);
- btnIcon.UnSelectedImagePath = "Item/RoomIcon.png";
+ btnIcon.UnSelectedImagePath = "Item/RoomIconSelected.png";
//鍚嶇О
var btnName = frameRow.frameTable.AddLeftCaption(room.Name, 600);
btnName.TextSize = 15;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
index cc179ac..fc53b31 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
@@ -412,7 +412,10 @@
public override int FormActionAgainEvent()
{
//鐢ㄦ埛澶村儚
- btnUserIcon.UnSelectedImagePath = UserCenterResourse.UserInfo.UserIconFile;
+ if (btnUserIcon.UnSelectedImagePath != UserCenterResourse.UserInfo.UserIconFile)
+ {
+ btnUserIcon.UnSelectedImagePath = UserCenterResourse.UserInfo.UserIconFile;
+ }
//鐢ㄦ埛鍚嶅瓧
btnUserName.Text = UserCenterResourse.UserInfo.UserName;
if (UserCenterResourse.UserInfo != null)
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
index e29eb94..1d35185 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
@@ -853,7 +853,7 @@
{
ShowNoGatewayTip();
}
-
+
}
#endregion
@@ -2379,7 +2379,7 @@
sceneView.Init();
sceneView.SetSceneNameText(scene.Name);
sceneView.SetIcon($"SceneIcon/{i}.png");
- sceneView.SetCollect(scene.IsCollected);
+ sceneView.SetCollect(Common.Room.CurrentRoom.GetLoveRoom().SceneUIFilePathList.Contains(scene.FileName));
if (scene.SceneDelayTime == 0)
{
@@ -2439,17 +2439,30 @@
//鏀惰棌
EventHandler<MouseEventArgs> collectionEvent = (sender, e) =>
{
+ (sender as Button).IsSelected = !(sender as Button).IsSelected;
if ((sender as Button).IsSelected)
{
- scene.Collect(false);
- (sender as Button).IsSelected = false;
+ //scene.IsCollected = true;
+ Room.CurrentRoom.GetLoveRoom().AddScene(scene);
}
else
{
- scene.Collect(true);
- (sender as Button).IsSelected = true;
+ //scene.IsCollected = false;
+ Room.CurrentRoom.GetLoveRoom().RemoveScene(scene);
}
scene.Save();
+
+ //if ((sender as Button).IsSelected)
+ //{
+ // scene.Collect(false);
+ // (sender as Button).IsSelected = false;
+ //}
+ //else
+ //{
+ // scene.Collect(true);
+ // (sender as Button).IsSelected = true;
+ //}
+ //scene.Save();
//if (Room.CurrentRoom.IsLove)
//{
// RefreshBodyView();
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
index 2dacd74..bcfbb8e 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
@@ -523,8 +523,6 @@
EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) =>
{
- Room.GetAllRoomDeviceUIList();
-
Instance.homePageName.IsSelected = false;
Instance.homePageIMG.IsSelected = false;
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
index 40777bc..599c3a1 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
@@ -30,9 +30,7 @@
public static string RemoteUnlockPassword = string.Empty;//杩滅▼寮�閿佸瘑鐮�
public static DateTime maxValue = DateTime.MaxValue;
public static DateTime minValue = DateTime.MinValue;
-
public string LocalTempPassword = string.Empty;//鏈湴鐢熸垚鐨勪复鏃跺瘑鐮�
-
#region 涓存椂瀵嗙爜淇℃伅
/// <summary>
@@ -97,6 +95,11 @@
/// 闂ㄩ攣鏈湴鐢ㄦ埛Id -->閿悕 : DoorLockLocalUserId
/// </summary>
public string DoorLockLocalUserId = "";
+
+ /// <summary>
+ /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+ /// </summary>
+ public bool IsOtherAccountCtrl = false;
}
#endregion
@@ -249,6 +252,10 @@
/// 0:00:00] ValidEndTime 鏈夋晥缁撴潫鏃堕棿 -->閿悕 : ValidEndTime
/// </summary>
public DateTime ValidEndTime;
+ /// <summary>
+ /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+ /// </summary>
+ public bool IsOtherAccountCtrl = false;
}
/// <summary>
@@ -281,6 +288,10 @@
/// LocalDoorLockId 鎼滅储鏈湴闂ㄩ攣Id -->閿悕 : LocalDoorLockId 榛樿鍊�: null
/// </summary>
public string LocalDoorLockId = "";
+ /// <summary>
+ /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+ /// </summary>
+ public bool IsOtherAccountCtrl = false;
}
/// <summary>
@@ -333,6 +344,10 @@
/// 0:00:00] ValidEndTime 鏈夋晥缁撴潫鏃堕棿 -->閿悕 : ValidEndTime
/// </summary>
public DateTime ValidEndTime;
+ /// <summary>
+ /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+ /// </summary>
+ public bool IsOtherAccountCtrl = false;
}
/// <summary>
@@ -381,11 +396,15 @@
/// 0:00:00] ValidEndTime 鏈夋晥缁撴潫鏃堕棿 -->閿悕 : ValidEndTime
/// </summary>
public DateTime? ValidEndTime;
+ /// <summary>
+ /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+ /// </summary>
+ public bool IsOtherAccountCtrl = false;
}
/// <summary>
/// 鑾峰彇闂ㄩ攣涓存椂瀵嗙爜缁撴灉
- /// </summary>
+ /// </summary>
[Serializable]
public class GetDoorLockTempPasswordDataRes
{
@@ -533,7 +552,7 @@
}
/// <summary>
- /// 鑾峰彇闂ㄩ攣缁欎簯鏈嶅姟鍣�
+ /// 鑾峰彇闂ㄩ攣浜戞湇鍔″櫒
/// </summary>
public static async System.Threading.Tasks.Task<GetDoorLockDataRes> GetDoorLockInfoFromServer(string RequestName, GetDoorLockData getDoorLockData)
{
@@ -566,10 +585,27 @@
{
//搴忓垪鍖栧璞�
var requestJson = JsonConvert.SerializeObject(obj);
+ var byteData = System.Text.Encoding.UTF8.GetBytes(requestJson);
+ byte[] result1 = null;
//璁块棶鎺ュ彛
- var result = await CommonPage.Instance.RequestHttpsZigbeeAsync(RequestName, System.Text.Encoding.UTF8.GetBytes(requestJson));
-
- return result;
+ if (UserCenterResourse.UserInfo.AuthorityNo == 1)
+ {
+ result1 = await CommonPage.Instance.RequestHttpsZigbeeBytesResultAsync(RequestName, byteData);
+ }
+ else
+ {
+ result1 = await CommonPage.Instance.RequestZigbeeHttpsByAdmin(RequestName, byteData);
+ }
+ if (result1 != null)
+ {
+ var result2 = Encoding.UTF8.GetString(result1);
+ if (result2 != null)
+ {
+ var result = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.ResponsePack>(result2);
+ return result;
+ }
+ }
+ return null;
}
catch (Exception ex)
{
@@ -1099,7 +1135,7 @@
tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
- DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0402_{ topic}");
+ DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0450_{ topic}");
}
}
}
@@ -1128,7 +1164,7 @@
break;
}
}
- if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
+ if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
{
result = new DefaultControlResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
}
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs
index 8ae134b..1f9530c 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs
@@ -442,15 +442,32 @@
public class DeviceListData
{
/// <summary>
- ///寤舵椂鎵ц鏃堕棿锛屽崟浣嶇銆�
- /// </summary>
- public int DelayTime;
- /// <summary>
/// 鎴愬憳绫诲瀷
///<para>0锛氳澶囨垚鍛�</para>
///<para>1锛氬満鏅垚鍛�</para>
+ ///<para>2锛氬欢鏃舵垚鍛�</para>
/// </summary>
public int Type;
+
+ /// <summary>
+ /// 璁惧mac鍦板潃 锛�
+ ///<para>褰揟ype=0鏃跺瓨鍦ㄣ��</para>
+ /// </summary>
+ public string DeviceAddr;
+ /// <summary>
+ /// 璁惧绔彛鍙�
+ ///<para>褰揟ype=0鏃跺瓨鍦ㄣ��</para>
+ /// </summary>
+ public int Epoint;
+ /// <summary>
+ /// 璁惧鍚嶇О
+ /// </summary>
+ public string DeviceName;
+ /// <summary>
+ /// 璁惧鍒楄〃
+ /// 褰揟ype=0鏃跺瓨鍦�
+ /// </summary>
+ public List<TaskListInfo> TaskList = new List<TaskListInfo>();
/// <summary>
/// 鍦烘櫙鎴愬憳鐨勫満鏅痠d
@@ -459,26 +476,17 @@
public int ElseScenesId;
/// <summary>
- /// 璁惧mac鍦板潃 锛�
- ///<para>褰揟ype=0鏃跺瓨鍦ㄣ��</para>
+ ///寤舵椂鎵ц鏃堕棿锛屽崟浣嶇銆�
/// </summary>
- public string DeviceAddr;
-
+ public int DelayTime;
/// <summary>
- /// 璁惧绔彛鍙�
- ///<para>褰揟ype=0鏃跺瓨鍦ㄣ��</para>
+ /// 鍦烘櫙鍔ㄤ綔搴忓彿锛岃〃绀虹鍑犱釜鍔ㄤ綔
/// </summary>
- public int Epoint;
+ public int MemberNumber;
- /// <summary>
- /// 璁惧鍚嶇О
- /// </summary>
- public string DeviceName;
- /// <summary>
- /// 璁惧鍒楄〃
- /// </summary>
- public List<TaskListInfo> TaskList = new List<TaskListInfo>();
+
+
}
/// <summary>
@@ -975,7 +983,7 @@
try{
if (sceneMemberData != null)
{
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 810 } };
+ var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 820 } };
var data = new JObject { };
if (sceneMemberData.Type == 0)
{
@@ -992,20 +1000,31 @@
data = new JObject {
{ "ScenesId",sceneMemberData.ScenesId},
- { "DelayTime", sceneMemberData.DelayTime} ,
{ "Type", sceneMemberData.Type} ,
{ "DeviceAddr",sceneMemberData.DeviceAddr} ,
{ "Epoint", sceneMemberData.Epoint} ,
- { "TaskList", taskList }
+ { "TaskList", taskList },
+ { "DelayTime", sceneMemberData.DelayTime} ,
+ { "MemberNumber",sceneMemberData.MemberNumber},
};
}
else if (sceneMemberData.Type == 1)
{
data = new JObject {
{ "ScenesId",sceneMemberData.ScenesId},
- { "DelayTime", sceneMemberData.DelayTime} ,
{ "Type", sceneMemberData.Type} ,
- { "ElseScenesId", sceneMemberData.ElseScenesId }
+ { "ElseScenesId", sceneMemberData.ElseScenesId },
+ { "DelayTime", sceneMemberData.DelayTime} ,
+ { "MemberNumber",sceneMemberData.MemberNumber},
+ };
+ }
+ else if (sceneMemberData.Type == 2)
+ {
+ data = new JObject {
+ { "Type", sceneMemberData.Type} ,
+ { "ScenesId",sceneMemberData.ScenesId},
+ { "DelayTime", sceneMemberData.DelayTime} ,
+ { "MemberNumber",sceneMemberData.MemberNumber},
};
}
@@ -1135,16 +1154,23 @@
public int ScenesId;
/// <summary>
- /// 寤舵椂鎵ц鏃堕棿锛屽崟浣嶇
- /// </summary>
- public int DelayTime;
-
- /// <summary>
/// 娣诲姞鎴愬憳绫诲瀷
///<para>0锛氳妭鐐硅澶�</para>
///<para>1锛氬叾浠栧満鏅�</para>
+ ///<para>2锛氬欢鏃剁被鍨�</para>
/// </summary>
public int Type;
+
+ /// <summary>
+ /// 寤舵椂鎵ц鏃堕棿锛屽崟浣嶇
+ /// 褰揟ype=2鏃跺瓨鍦�
+ /// </summary>
+ public int DelayTime;
+ /// <summary>
+ /// 寤舵椂鎵ц搴忓彿锛岃〃绀哄欢鏃剁储寮�
+ ///褰揟ype=2鏃跺瓨鍦�
+ /// </summary>
+ public int MemberNumber;
/// <summary>
/// 浣滀负鎴愬憳鐨勫叾浠栧満鏅痠d銆�
@@ -1157,13 +1183,11 @@
/// <para>Type=0鏃跺瓨鍦�</para>
/// </summary>
public string DeviceAddr;
-
/// <summary>
/// 璁惧绔彛鍙�
/// <para>Type=0鏃跺瓨鍦�</para>
/// </summary>
public int Epoint;
-
/// <summary>
/// 璁惧鍒楄〃
/// <para>Type=0鏃跺瓨鍦�</para>
@@ -1241,19 +1265,33 @@
var dInfo = new JObject{
{ "Type", deviceInfo.Type},
{ "DeviceAddr",deviceInfo.DeviceAddr},
- { "Epoint",deviceInfo.Epoint}
+ { "Epoint",deviceInfo.Epoint},
+ { "DelayTime", deviceInfo.DelayTime} ,
+ { "MemberNumber",deviceInfo.MemberNumber},
};
deviceList.Add(dInfo);
}
- else
+ else if (deviceInfo.Type == 1)
{
var dInfo = new JObject{
{ "Type", deviceInfo.Type},
- { "ElseScenesId",deviceInfo.ElseScenesId}
+ { "ElseScenesId",deviceInfo.ElseScenesId},
+ { "DelayTime", deviceInfo.DelayTime} ,
+ { "MemberNumber",deviceInfo.MemberNumber},
};
deviceList.Add(dInfo);
}
- }
+ else if (deviceInfo.Type == 2)
+ {
+ var dInfo = new JObject{
+ { "Type", deviceInfo.Type},
+ { "DelayTime", deviceInfo.DelayTime} ,
+ { "MemberNumber",deviceInfo.MemberNumber},
+ };
+ deviceList.Add(dInfo);
+ }
+
+ }
var data = new JObject {
{"ScenesId",sceneRemoveMemberData.ScenesId},
@@ -1316,6 +1354,7 @@
/// 绉婚櫎鎴愬憳绫诲瀷
///<para >0锛氳澶囨垚鍛�</para>
///<para >1锛氬満鏅垚鍛�</para>
+ ///<para >2锛氬欢鏃剁被鍨�</para>
/// </summary>
public int Type;
@@ -1326,14 +1365,27 @@
public string DeviceAddr;
/// <summary>
- /// 璁惧绔彛鍙� 褰揟ype=0鏃跺瓨鍦�
+ /// 璁惧绔彛鍙�
+ /// 褰揟ype=0鏃跺瓨鍦�
/// </summary>
public int Epoint;
/// <summary>
- /// 鍦烘櫙鎴愬憳id锛屽綋Type=1鏃跺瓨鍦�
+ /// 鍦烘櫙鎴愬憳id
+ /// 褰揟ype=1鏃跺瓨鍦�
/// </summary>
public int ElseScenesId;
+
+ /// <summary>
+ /// 寤舵椂鎵ц鏃堕棿锛屽崟浣嶇
+ /// 褰揟ype=2鏃跺瓨鍦�
+ /// </summary>
+ public int DelayTime;
+ /// <summary>
+ /// 寤舵椂鎵ц搴忓彿锛岃〃绀哄欢鏃剁储寮�
+ ///褰揟ype=2鏃跺瓨鍦�
+ /// </summary>
+ public int MemberNumber;
}
/// <summary>
@@ -1759,7 +1811,7 @@
mainGateway.Actions += action;
System.Console.WriteLine("Scene/Open_Actions 鍚姩" + "_" + mainGateway.getGatewayBaseInfo.gwID + System.DateTime.Now.ToString());
try{
- var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 808 } };
+ var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 821 } };
var data = new JObject { { "ScenesId", ScenesId }, { "DelayTime", delayTime } };
jObject.Add("Data", data);
mainGateway.Send(("Scene/Open"),System.Text.Encoding.UTF8.GetBytes(jObject.ToString()));
diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs
index 7c7e1f0..990a82a 100755
--- a/ZigbeeApp/Shared/R.cs
+++ b/ZigbeeApp/Shared/R.cs
@@ -286,6 +286,7 @@
public readonly static int ClearFailedXm = 199;
public readonly static int ModifyTempPasswordTip1 = 200;
public readonly static int ModifyTempPasswordTip2 = 201;
+ public readonly static int FirstFloor = 202;
public readonly static int RemindSetting = 548;
public readonly static int AddNewUser = 650;
@@ -545,6 +546,11 @@
public readonly static int onlight = 5359;
public readonly static int offlight = 5360;
public readonly static int OnOffSwitch=5361;
+ public readonly static int addlinkageevent = 5362;
+ public readonly static int editlinkageevent = 5363;
+ public readonly static int selectunlockingmode=5364;
+ public readonly static int lockaddaction = 5365;
+ public readonly static int linkageevent = 5366;
@@ -593,7 +599,7 @@
/// </summary>
public const int Search = 10108;
/// <summary>
- /// 纭畾
+ /// 瀹屾垚
/// </summary>
public const int Complete = 10109;
/// <summary>
@@ -781,15 +787,55 @@
/// </summary>
public const int SelectScenePic = 11033;
+ #region 璁惧绫诲瀷
+ /// <summary>
+ /// 鏈煡璁惧
+ /// </summary>
+ public const int UnknowDevice = 12100;
+ /// <summary>
+ /// 缁х數鍣�
+ /// </summary>
+ public const int OnOffOutput = 12102;
+ /// <summary>
+ /// 璋冨厜鐏�
+ /// </summary>
+ public const int DimmableLight = 12103;
+ /// <summary>
+ /// 绐楀笜
+ /// </summary>
+ public const int WindowCoveringDevice = 12104;
+ /// <summary>
+ /// 绌鸿皟
+ /// </summary>
+ public const int Thermostat = 12105;
+ /// <summary>
+ /// 浼犳劅鍣�
+ /// </summary>
+ public const int IASZone = 12106;
+ /// <summary>
+ /// 绌烘皵寮�鍏�
+ /// </summary>
+ public const int AirSwitch = 12107;
+ /// <summary>
+ /// 褰╃伅
+ /// </summary>
+ public const int ColorDimmableLight = 12108;
+ /// <summary>
+ /// 涓户鍣�
+ /// </summary>
+ public const int Repeater = 12109;
- #endregion
+ #endregion
- #region 涓婚〉
- /// <summary>
- /// 鎴块棿鍒楄〃
- /// </summary>
- public const int RoomList = 13100;
+ #endregion
+
+ #region 涓婚〉
+
+ /// <summary>
+ /// 鎴块棿鍒楄〃
+ /// </summary>
+ public const int RoomList = 13100;
/// <summary>
/// 閫夋嫨妤煎眰
@@ -836,7 +882,7 @@
/// </summary>
public const int Open = 13111;
/// <summary>
- /// 鍏�
+ /// 鍏抽棴
/// </summary>
public const int Close = 13112;
/// <summary>
@@ -879,10 +925,87 @@
/// 涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅�
/// </summary>
public const int SelectTimeForAction = 13122;
-
-
+ /// <summary>
+ /// 鍚�
+ /// </summary>
+ public const int Later = 13123;
+ /// <summary>
+ /// 鍒犻櫎
+ /// </summary>
+ public const int Delete = 13124;
+ /// <summary>
+ /// 鍏�
+ /// </summary>
+ public const int Shut = 13125;
+ /// <summary>
+ /// 閫夋嫨椋庨��
+ /// </summary>
+ public const int SelectFanMode = 13126;
+ /// <summary>
+ /// 浣庨
+ /// </summary>
+ public const int Fan_Low = 13127;
+ /// <summary>
+ /// 涓
+ /// </summary>
+ public const int Fan_Middle = 13128;
+ /// <summary>
+ /// 楂橀
+ /// </summary>
+ public const int Fan_Height = 13129;
+ /// <summary>
+ /// 閫夋嫨妯″紡
+ /// </summary>
+ public const int SelectMode = 13130;
+ /// <summary>
+ /// 鑷姩
+ /// </summary>
+ public const int Mode_Auto = 13131;
+ /// <summary>
+ /// 鍒跺喎
+ /// </summary>
+ public const int Mode_Cool = 13132;
+ /// <summary>
+ /// 鍒剁儹
+ /// </summary>
+ public const int Mode_Heat = 13133;
+ /// <summary>
+ /// 闄ゆ箍
+ /// </summary>
+ public const int Mode_Dry = 13134;
+ /// <summary>
+ /// 閫侀
+ /// </summary>
+ public const int Mode_FanOnly = 13135;
+ /// <summary>
+ /// 瀹ゆ俯
+ /// </summary>
+ public const int IndoorTemperature = 13136;
+ /// <summary>
+ /// 绌鸿皟宸茬粡鍏抽棴锛岃鍏堟墦寮�
+ /// </summary>
+ public const int TheACIsClose = 13137;
+ /// <summary>
+ /// 娣诲姞鍦烘櫙澶辫触
+ /// </summary>
+ public const int AddSceneFail = 13138;
+ /// <summary>
+ /// 璇ュ満鏅凡瀛樺湪
+ /// </summary>
+ public const int TheSceneHadExist = 13139;
+ /// <summary>
+ /// 缂栬緫
+ /// </summary>
+ public const int Editor = 13140;
+ /// <summary>
+ /// 缂栬緫鍦烘櫙
+ /// </summary>
+ public const int EditorScene = 13141;
#endregion
+
+
+
/// <summary>
/// 鍠滅埍
@@ -966,7 +1089,7 @@
//*****public static readonly int Function = 11038;
- public static readonly int Delete = 11041;
+
public static readonly int AddFunction = 11042;
public static readonly int Light = 11044;
@@ -1048,13 +1171,14 @@
/// 鏃堕棿闂撮殧
/// </summary>
public static readonly int TimeSpan = 11093;
- public static readonly int TheSceneHadExist = 11094;
- public static readonly int AddSceneFail = 11095;
+
- /// <summary>
- /// 鑷畾涔�
- /// </summary>
- public static readonly int Custom = 11098;
+
+
+ /// <summary>
+ /// 鑷畾涔�
+ /// </summary>
+ public static readonly int Custom = 11098;
/// <summary>
/// 鍙栨秷鏀惰棌
@@ -1183,99 +1307,10 @@
///褰撳墠娌℃湁鍙互娣诲姞鍒拌鎴块棿鐨勮澶�
/// </summary>
public static readonly int NoDeviceCanAddToRoom = 12034;
- /// <summary>
- /// 閫夋嫨椋庨��
- /// </summary>
- public static readonly int SelectFanMode = 12035;
- /// <summary>
- /// 浣庨
- /// </summary>
- public static readonly int Fan_Low = 12036;
- /// <summary>
- /// 涓
- /// </summary>
- public static readonly int Fan_Middle = 12037;
- /// <summary>
- /// 楂橀
- /// </summary>
- public static readonly int Fan_Height = 12038;
- /// <summary>
- /// 閫夋嫨妯″紡
- /// </summary>
- public static readonly int SelectMode = 12039;
- /// <summary>
- /// 鑷姩
- /// </summary>
- public static readonly int Mode_Auto = 12040;
- /// <summary>
- /// 鍒跺喎
- /// </summary>
- public static readonly int Mode_Cool = 12041;
- /// <summary>
- /// 鍒剁儹
- /// </summary>
- public static readonly int Mode_Heat = 12042;
- /// <summary>
- /// 闄ゆ箍
- /// </summary>
- public static readonly int Mode_Dry = 12043;
- /// <summary>
- /// 閫侀
- /// </summary>
- public static readonly int Mode_FanOnly = 12044;
- /// <summary>
- /// 瀹ゆ俯
- /// </summary>
- public static readonly int IndoorTemperature = 12045;
- /// <summary>
- /// 绌鸿皟宸茬粡鍏抽棴锛岃鍏堟墦寮�
- /// </summary>
- public static readonly int TheACIsClose = 12046;
+
- #region 璁惧绫诲瀷
- /// <summary>
- /// 鏈煡璁惧
- /// </summary>
- public static readonly int UnknowDevice = 12100;
- /// <summary>
- /// 鎺у埗闈㈡澘
- /// </summary>
- //public static readonly int OnOffSwitch = 12101;
- /// <summary>
- /// 缁х數鍣�
- /// </summary>
- public static readonly int OnOffOutput = 12102;
- /// <summary>
- /// 璋冨厜鐏�
- /// </summary>
- public static readonly int DimmableLight = 12103;
- /// <summary>
- /// 绐楀笜
- /// </summary>
- public static readonly int WindowCoveringDevice = 12104;
- /// <summary>
- /// 绌鸿皟
- /// </summary>
- public static readonly int Thermostat = 12105;
- /// <summary>
- /// 浼犳劅鍣�
- /// </summary>
- public static readonly int IASZone = 12106;
- /// <summary>
- /// 绌烘皵寮�鍏�
- /// </summary>
- public static readonly int AirSwitch = 12107;
- /// <summary>
- /// 褰╃伅
- /// </summary>
- public static readonly int ColorDimmableLight = 12108;
- /// <summary>
- /// 涓户鍣�
- /// </summary>
- public static readonly int Repeater = 12109;
-
- #endregion
+
/// <summary>
/// 褰撳墠鎴块棿娌℃湁璁惧鍙互娣诲姞鍒板満鏅�
@@ -4352,6 +4387,62 @@
/// 3.濡傛灉浠嶅缁堟棤娉曞彂鐜拌澶囷紝鍙兘鍥犱负璁惧宸茬粡琚粬浜虹粦瀹氫簡銆傚鏋滀綘骞朵笉娓呮鏄皝杩炴帴浜嗚澶囷紝鍙互杩涜閲嶇疆锛岄噸缃柟寮忚鏌ラ槄璇存槑涔︼紝鏍规嵁鎸囧紩鎿嶄綔銆�
/// </summary>
public const int uAddDeviceHelp5 = 15841;
+ /// <summary>
+ /// 鎴块棿鍒楄〃
+ /// </summary>
+ public const int uRoomList = 15842;
+ /// <summary>
+ /// 杩樻病鏈夋坊鍔犲満鏅摝
+ /// </summary>
+ public const int uDoNotHadAddScenceMsg = 15843;
+ /// <summary>
+ /// 杩樻病鏈夋坊鍔犺澶囧摝
+ /// </summary>
+ public const int uDoNotHadAddDeviceMsg = 15844;
+ /// <summary>
+ /// 鎴块棿鍚嶇О宸茬粡瀛樺湪
+ /// </summary>
+ public const int uRoomNameIsExist = 15845;
+ /// <summary>
+ /// 瀹ゅ唴鏈鸿缃�
+ /// </summary>
+ public const int uIndoorUnitSettion = 15846;
+ /// <summary>
+ /// 绌鸿皟妯″紡
+ /// </summary>
+ public const int uAirConditionerMode = 15847;
+ /// <summary>
+ /// 鎽嗛
+ /// </summary>
+ public const int uAirConditionerSwing = 15848;
+ /// <summary>
+ /// 鍒跺喎
+ /// </summary>
+ public const int uMode_Cool = 15849;
+ /// <summary>
+ /// 鍒剁儹
+ /// </summary>
+ public const int uMode_Heat = 15850;
+ /// <summary>
+ /// 鑷姩
+ /// </summary>
+ public const int uMode_Auto = 15851;
+ /// <summary>
+ /// 閫侀
+ /// </summary>
+ public const int uMode_FanOnly = 15852;
+ /// <summary>
+ /// 闄ゆ箍
+ /// </summary>
+ public const int uMode_Dry = 15853;
+ /// <summary>
+ /// 鎵撳紑绌鸿皟澶辫触
+ /// </summary>
+ public const int uOpenAirConditionerFail = 15854;
+ /// <summary>
+ /// 鍏抽棴绌鸿皟澶辫触
+ /// </summary>
+ public const int uCloseAirConditionerFail = 15855;
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
/// <summary>
@@ -4479,9 +4570,13 @@
/// </summary>
public const int uShareData_Fail = 18049;
/// <summary>
- /// 涓嶈兘娣诲姞鑷繁涓哄瓙璐﹀彿
+ /// 涓嶈兘鎶婅嚜宸辨坊鍔犱负鎴愬憳
/// </summary>
public const int BindSubAccount_SameAccount = 18050;
+ /// <summary>
+ /// 涓嶈兘鎶婁富璐﹀彿娣诲姞涓烘垚鍛�
+ /// </summary>
+ public const int BindSubAccount_NoAddMainAccount = 18051;
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囩殑鍏ョ綉姝ラ,浠�21000寮�濮嬧槄鈽呪槄鈽�
diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems
index 74b52de..4ae94cf 100755
--- a/ZigbeeApp/Shared/Shared.projitems
+++ b/ZigbeeApp/Shared/Shared.projitems
@@ -38,7 +38,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\CategorySceneSelectLightSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Category\CategorySceneSelectRoomList.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\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" />
@@ -62,9 +64,14 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RowLayoutDeleteButton.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\RowLayoutEditButton.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SceneMainView.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\CommonForm\SceneTargetRow.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" />
@@ -79,12 +86,11 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DeviceTarget.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\AddAction.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\AddCondition.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\DoorLockIfon.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\DoorLockLogicList.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockAddDevice.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockAddScene.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockLogic.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockIfon.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockLogicCommunalPage.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockLogicList.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\EverymonthPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\EveryyearPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\IgnoreTime.cs" />
@@ -121,9 +127,13 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Form\GesturePswSecirityForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Form\SecondaryPswSecurityForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlCheckLogic.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\HdlLogLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlThreadLogic.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\AirConditioner\AirConditionerModeForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\AirConditioner\IndoorUnitListForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\AirConditioner\IndoorUnitSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Bind\AddDevicePage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Bind\AddScenePage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Bind\BindCommonLayout.cs" />
--
Gitblit v1.8.0