From 5986f63b75bd81c6cef262c670e9251c038cbf5d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 17 十二月 2019 17:21:07 +0800
Subject: [PATCH] 合并一个版本
---
ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs | 1713 +++++++--------
ZigbeeApp/GateWay.Droid/Assets/Language.ini | 16
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs | 93
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 1
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 31
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs | 7
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs | 8
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll | 0
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs | 9
ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs | 2
ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 1443 ++++++------
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 62
ZigbeeApp/Shared/Common/CommonPage.cs | 2
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 40
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 4
ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs | 4
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs | 7
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll | 0
ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs | 222 +-
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs | 16
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs | 404 ++-
ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 135
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs | 18
ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 17
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs | 6
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2
ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 4
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll | 0
ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs | 22
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs | 1
ZigbeeApp/Shared/Common/ZigbeeColor.cs | 51
ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 7
ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs | 9
ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs | 2
ZigbeeApp/Home.Ios/Resources/Language.ini | 16
ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs | 2
ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 16
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs | 100
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs | 100
ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs | 22
ZigbeeApp/Shared/R.cs | 46
ZigbeeApp/Shared/Phone/UserCenter/Abount/SLAForm.cs | 5
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll | 0
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs | 14
ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs | 56
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs | 4
ZigbeeApp/Shared/Common/Device.cs | 24
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 5
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs | 462 +++-
ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs | 63
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs | 424 ++-
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs | 14
ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll | 0
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs | 5
ZigbeeApp/Shared/Shared.projitems | 8
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs | 2
/dev/null | 359 ---
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 4
ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs | 156
ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs | 83
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs | 27
65 files changed, 3,481 insertions(+), 2,904 deletions(-)
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
index 7977c50..4fa0bd3 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini
+++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -698,7 +698,7 @@
11019=鍒嗕韩鐨�
11020=閫夋嫨鍥炬爣
11021=淇濆瓨
-11022=鎻愮ず
+11022=鎻愰啋
11023=鍙栨秷
11024=娌℃湁鍦烘櫙 {\r\n} 璇风偣鍑诲彸涓婅娣诲姞
11025=璁剧疆
@@ -710,6 +710,7 @@
11031=娣诲姞鎵ц鐩爣
11032=閫夋嫨鍖哄煙
11033=閫夋嫨鍦烘櫙鍥剧墖
+11034=纭畾瑕佺Щ闄よ鍔熻兘锛�
12100=鏈煡璁惧
@@ -1540,8 +1541,8 @@
15810=鑾峰彇绐楀笜鏂瑰悜涓庨檺浣嶈缃け璐�
15811=閲嶇疆绐楀笜闄愪綅鐐瑰け璐�
15812=璁剧疆绐楀笜闄愪綅鐐瑰け璐�
-15813=纭褰撳墠浣嶇疆{0}涓哄紑闄愪綅?
-15814=纭褰撳墠浣嶇疆{0}涓哄悎闄愪綅?
+15813=纭褰撳墠浣嶇疆涓哄紑闄愪綅?
+15814=纭褰撳墠浣嶇疆涓哄悎闄愪綅?
15815=閲嶇疆绐楀笜澶辫触
15816=涓婇檺浣�
15817=涓嬮檺浣�
@@ -1726,6 +1727,12 @@
15998=璇峰墠寰�浣忓畢绠$悊{0}璁剧疆浣忓畢鐨勫湴鐞嗕綅缃�
15999=鏈煡妤煎眰
16000=濡傛灉涓嶈缃綇瀹呯殑鍦扮悊浣嶇疆,鍒欎細褰卞搷鑷姩鍖栧湴鐞嗗洿鏍忓姛鑳界殑璁剧疆
+16001=绌鸿皟妯″潡鐗堟湰
+16002=閫氫俊鑺墖
+16003=绌鸿皟妯″潡
+16004=鑾峰彇澶辫触
+16005=鏃犳硶璇嗗埆
+16006=姝e湪閲嶇疆鐢垫満
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1825,6 +1832,9 @@
30023=zigbee杞�485鍗忚杞崲鍣�
30024=zigbee绌鸿皟缃戝叧妯″潡
30025=H06C
+30026=绠�绾�4鎸夐敭闈㈡澘
+30027=绠�绾�3鎸夐敭闈㈡澘
+30028=绠�绾�2鎸夐敭闈㈡澘
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
40000=绐楀笜
diff --git a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
index 1c9548e..9b115d9 100644
--- a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
+++ b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2019121201" android:installLocation="auto" android:versionName="1.0.19121201">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2019121601" android:installLocation="auto" android:versionName="1.0.19121601">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" />
<permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
diff --git a/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs b/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs
index bcf64c2..4d98be1 100644
--- a/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs
+++ b/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs
@@ -1698,44 +1698,44 @@
public partial class Color
{
- // aapt resource value: 0x7f0d0051
- public const int abc_background_cache_hint_selector_material_dark = 2131558481;
-
// aapt resource value: 0x7f0d0052
- public const int abc_background_cache_hint_selector_material_light = 2131558482;
+ public const int abc_background_cache_hint_selector_material_dark = 2131558482;
// aapt resource value: 0x7f0d0053
- public const int abc_btn_colored_borderless_text_material = 2131558483;
+ public const int abc_background_cache_hint_selector_material_light = 2131558483;
// aapt resource value: 0x7f0d0054
- public const int abc_btn_colored_text_material = 2131558484;
+ public const int abc_btn_colored_borderless_text_material = 2131558484;
// aapt resource value: 0x7f0d0055
- public const int abc_color_highlight_material = 2131558485;
+ public const int abc_btn_colored_text_material = 2131558485;
// aapt resource value: 0x7f0d0056
- public const int abc_hint_foreground_material_dark = 2131558486;
+ public const int abc_color_highlight_material = 2131558486;
// aapt resource value: 0x7f0d0057
- public const int abc_hint_foreground_material_light = 2131558487;
+ public const int abc_hint_foreground_material_dark = 2131558487;
+
+ // aapt resource value: 0x7f0d0058
+ public const int abc_hint_foreground_material_light = 2131558488;
// aapt resource value: 0x7f0d0000
public const int abc_input_method_navigation_guard = 2131558400;
- // aapt resource value: 0x7f0d0058
- public const int abc_primary_text_disable_only_material_dark = 2131558488;
-
// aapt resource value: 0x7f0d0059
- public const int abc_primary_text_disable_only_material_light = 2131558489;
+ public const int abc_primary_text_disable_only_material_dark = 2131558489;
// aapt resource value: 0x7f0d005a
- public const int abc_primary_text_material_dark = 2131558490;
+ public const int abc_primary_text_disable_only_material_light = 2131558490;
// aapt resource value: 0x7f0d005b
- public const int abc_primary_text_material_light = 2131558491;
+ public const int abc_primary_text_material_dark = 2131558491;
// aapt resource value: 0x7f0d005c
- public const int abc_search_url_text = 2131558492;
+ public const int abc_primary_text_material_light = 2131558492;
+
+ // aapt resource value: 0x7f0d005d
+ public const int abc_search_url_text = 2131558493;
// aapt resource value: 0x7f0d0001
public const int abc_search_url_text_normal = 2131558401;
@@ -1746,29 +1746,29 @@
// aapt resource value: 0x7f0d0003
public const int abc_search_url_text_selected = 2131558403;
- // aapt resource value: 0x7f0d005d
- public const int abc_secondary_text_material_dark = 2131558493;
-
// aapt resource value: 0x7f0d005e
- public const int abc_secondary_text_material_light = 2131558494;
+ public const int abc_secondary_text_material_dark = 2131558494;
// aapt resource value: 0x7f0d005f
- public const int abc_tint_btn_checkable = 2131558495;
+ public const int abc_secondary_text_material_light = 2131558495;
// aapt resource value: 0x7f0d0060
- public const int abc_tint_default = 2131558496;
+ public const int abc_tint_btn_checkable = 2131558496;
// aapt resource value: 0x7f0d0061
- public const int abc_tint_edittext = 2131558497;
+ public const int abc_tint_default = 2131558497;
// aapt resource value: 0x7f0d0062
- public const int abc_tint_seek_thumb = 2131558498;
+ public const int abc_tint_edittext = 2131558498;
// aapt resource value: 0x7f0d0063
- public const int abc_tint_spinner = 2131558499;
+ public const int abc_tint_seek_thumb = 2131558499;
// aapt resource value: 0x7f0d0064
- public const int abc_tint_switch_track = 2131558500;
+ public const int abc_tint_spinner = 2131558500;
+
+ // aapt resource value: 0x7f0d0065
+ public const int abc_tint_switch_track = 2131558501;
// aapt resource value: 0x7f0d0004
public const int accent_material_dark = 2131558404;
@@ -1815,8 +1815,8 @@
// aapt resource value: 0x7f0d003c
public const int design_bottom_navigation_shadow_color = 2131558460;
- // aapt resource value: 0x7f0d0065
- public const int design_error = 2131558501;
+ // aapt resource value: 0x7f0d0066
+ public const int design_error = 2131558502;
// aapt resource value: 0x7f0d003d
public const int design_fab_shadow_end_color = 2131558461;
@@ -1842,8 +1842,8 @@
// aapt resource value: 0x7f0d0044
public const int design_snackbar_background_color = 2131558468;
- // aapt resource value: 0x7f0d0066
- public const int design_tint_password_toggle = 2131558502;
+ // aapt resource value: 0x7f0d0067
+ public const int design_tint_password_toggle = 2131558503;
// aapt resource value: 0x7f0d0012
public const int dim_foreground_disabled_material_dark = 2131558418;
@@ -1865,6 +1865,9 @@
// aapt resource value: 0x7f0d0018
public const int foreground_material_light = 2131558424;
+
+ // aapt resource value: 0x7f0d0048
+ public const int gd_top_view = 2131558472;
// aapt resource value: 0x7f0d0019
public const int highlighted_text_material_dark = 2131558425;
@@ -1920,32 +1923,32 @@
// aapt resource value: 0x7f0d003b
public const int notification_material_background_media_default_color = 2131558459;
- // aapt resource value: 0x7f0d0048
- public const int pickerview_bgColor_default = 2131558472;
-
// aapt resource value: 0x7f0d0049
- public const int pickerview_bgColor_overlay = 2131558473;
+ public const int pickerview_bgColor_default = 2131558473;
// aapt resource value: 0x7f0d004a
- public const int pickerview_bg_topbar = 2131558474;
+ public const int pickerview_bgColor_overlay = 2131558474;
// aapt resource value: 0x7f0d004b
- public const int pickerview_timebtn_nor = 2131558475;
+ public const int pickerview_bg_topbar = 2131558475;
// aapt resource value: 0x7f0d004c
- public const int pickerview_timebtn_pre = 2131558476;
+ public const int pickerview_timebtn_nor = 2131558476;
// aapt resource value: 0x7f0d004d
- public const int pickerview_topbar_title = 2131558477;
+ public const int pickerview_timebtn_pre = 2131558477;
// aapt resource value: 0x7f0d004e
- public const int pickerview_wheelview_textcolor_center = 2131558478;
+ public const int pickerview_topbar_title = 2131558478;
// aapt resource value: 0x7f0d004f
- public const int pickerview_wheelview_textcolor_divider = 2131558479;
+ public const int pickerview_wheelview_textcolor_center = 2131558479;
// aapt resource value: 0x7f0d0050
- public const int pickerview_wheelview_textcolor_out = 2131558480;
+ public const int pickerview_wheelview_textcolor_divider = 2131558480;
+
+ // aapt resource value: 0x7f0d0051
+ public const int pickerview_wheelview_textcolor_out = 2131558481;
// aapt resource value: 0x7f0d0027
public const int primary_dark_material_dark = 2131558439;
@@ -1995,11 +1998,11 @@
// aapt resource value: 0x7f0d0036
public const int switch_thumb_disabled_material_light = 2131558454;
- // aapt resource value: 0x7f0d0067
- public const int switch_thumb_material_dark = 2131558503;
-
// aapt resource value: 0x7f0d0068
- public const int switch_thumb_material_light = 2131558504;
+ public const int switch_thumb_material_dark = 2131558504;
+
+ // aapt resource value: 0x7f0d0069
+ public const int switch_thumb_material_light = 2131558505;
// aapt resource value: 0x7f0d0037
public const int switch_thumb_normal_material_dark = 2131558455;
diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini
index 7977c50..4fa0bd3 100755
--- a/ZigbeeApp/Home.Ios/Resources/Language.ini
+++ b/ZigbeeApp/Home.Ios/Resources/Language.ini
@@ -698,7 +698,7 @@
11019=鍒嗕韩鐨�
11020=閫夋嫨鍥炬爣
11021=淇濆瓨
-11022=鎻愮ず
+11022=鎻愰啋
11023=鍙栨秷
11024=娌℃湁鍦烘櫙 {\r\n} 璇风偣鍑诲彸涓婅娣诲姞
11025=璁剧疆
@@ -710,6 +710,7 @@
11031=娣诲姞鎵ц鐩爣
11032=閫夋嫨鍖哄煙
11033=閫夋嫨鍦烘櫙鍥剧墖
+11034=纭畾瑕佺Щ闄よ鍔熻兘锛�
12100=鏈煡璁惧
@@ -1540,8 +1541,8 @@
15810=鑾峰彇绐楀笜鏂瑰悜涓庨檺浣嶈缃け璐�
15811=閲嶇疆绐楀笜闄愪綅鐐瑰け璐�
15812=璁剧疆绐楀笜闄愪綅鐐瑰け璐�
-15813=纭褰撳墠浣嶇疆{0}涓哄紑闄愪綅?
-15814=纭褰撳墠浣嶇疆{0}涓哄悎闄愪綅?
+15813=纭褰撳墠浣嶇疆涓哄紑闄愪綅?
+15814=纭褰撳墠浣嶇疆涓哄悎闄愪綅?
15815=閲嶇疆绐楀笜澶辫触
15816=涓婇檺浣�
15817=涓嬮檺浣�
@@ -1726,6 +1727,12 @@
15998=璇峰墠寰�浣忓畢绠$悊{0}璁剧疆浣忓畢鐨勫湴鐞嗕綅缃�
15999=鏈煡妤煎眰
16000=濡傛灉涓嶈缃綇瀹呯殑鍦扮悊浣嶇疆,鍒欎細褰卞搷鑷姩鍖栧湴鐞嗗洿鏍忓姛鑳界殑璁剧疆
+16001=绌鸿皟妯″潡鐗堟湰
+16002=閫氫俊鑺墖
+16003=绌鸿皟妯″潡
+16004=鑾峰彇澶辫触
+16005=鏃犳硶璇嗗埆
+16006=姝e湪閲嶇疆鐢垫満
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
18004=鎸囧畾缃戝叧宸茬粡琚粦瀹�
@@ -1825,6 +1832,9 @@
30023=zigbee杞�485鍗忚杞崲鍣�
30024=zigbee绌鸿皟缃戝叧妯″潡
30025=H06C
+30026=绠�绾�4鎸夐敭闈㈡澘
+30027=绠�绾�3鎸夐敭闈㈡澘
+30028=绠�绾�2鎸夐敭闈㈡澘
;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
40000=绐楀笜
diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs
index e9bbe31..9941514 100755
--- a/ZigbeeApp/Shared/Common/CommonPage.cs
+++ b/ZigbeeApp/Shared/Common/CommonPage.cs
@@ -62,7 +62,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string CodeIDString = "1.0.19121201";
+ public static string CodeIDString = "1.0.19121601";
/// <summary>
/// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee)
/// </summary>
diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs
index c8ace0a..acbcb17 100755
--- a/ZigbeeApp/Shared/Common/Device.cs
+++ b/ZigbeeApp/Shared/Common/Device.cs
@@ -543,6 +543,12 @@
/// <param name="deleteRoom">鏄惁浠庢埧闂村垹闄�</param>
public void DeleteMemmoryDevice(CommonDevice device, bool deleteRoom = true)
{
+ if (deleteRoom == true && Room.CurrentRoom != null)
+ {
+ //浠庢埧闂翠腑鍒犻櫎
+ Room.CurrentRoom.DeleteDevice(device);
+ }
+
//鍒犻櫎缂撳瓨
string mainKeys = this.GetDeviceMainKeys(device);
lock (dicAllDevice)
@@ -592,12 +598,6 @@
}
}
this.dicOTADevice.Remove(otaKeys);
- }
-
- if (deleteRoom == true && Room.CurrentRoom != null)
- {
- //浠庢埧闂翠腑鍒犻櫎
- Room.CurrentRoom.DeleteDevice(device);
}
}
@@ -2058,6 +2058,14 @@
//瀹氫箟瑙勫垯锛氭ā鍧桰D(宸茬炕璇�)=璁惧鍏蜂綋绫诲瀷鍊�-璁惧鎵�灞炵被鍨嬪��(鑷畾涔夌殑鍊�,鍢�,鍙涓嶉噸澶嶅氨鍙互)
//绗竴涓�兼槸:DeviceConcreteType 绗簩涓�兼槸:DeviceBeloneType
+ //*********************************************************************
+ //鏂拌澶囨坊鍔犳柟娉曪細
+ //1銆佸湪杩欓噷濉啓涓婃ā鍧桰D锛岀劧鍚庢槸 DeviceConcreteType 锛岀劧鍚庢槸 DeviceBeloneType
+ //2銆佺劧鍚庡湪鏈�涓嬮潰娣诲姞銆愯澶囩殑鍏蜂綋绫诲瀷銆戯紝銆愯澶囩殑鎵�灞炵被鍨嬨��
+ //3銆佸凡璁惧鐨勫叿浣撶被鍨嬩负鍚嶅瓧(鍘绘帀銆�-銆�)娣诲姞璁惧鐨勩�愭墍灞炲浘鐗囥�戯紝銆愮湡瀹炵墿鐞嗗浘鐗囥�戙�傚洖璺浘鐗囬渶瑕佺壒娈婂鐞�
+ //4銆佹坊鍔燫鏂囦欢,娣诲姞Language鏂囦欢
+ //*********************************************************************
+
//=========鈽呪槄寮�鍚堝笜绫�(100-199)鈽呪槄=========
this.dicDeviceModelIdEnum["MWM65B-ZB.20"] = "100-100";//鏅鸿兘寮�鍚堝笜鐢垫満
this.dicDeviceModelIdEnum["MVSM35B-ZB.20"] = "101-100";//鏅鸿兘绠$姸鐢垫満
@@ -2105,7 +2113,7 @@
this.dicDeviceModelIdEnum["MBUS/GW-ZB.10"] = "4200-4200";//zigbee杞琤uspro鍗忚杞崲鍣�
this.dicDeviceModelIdEnum["M485/GW-ZB.10"] = "4201-4200";//zigbee杞�485鍗忚杞崲鍣�
- //闇�瑕佷氦鎹㈢殑妯″潡ID
+ //鉁┾湬鉁┾湬鉁╅渶瑕佷氦鎹㈢殑妯″潡ID鉁┾湬鉁┾湬鉁�
this.dicDeviceModelIdChanged = new Dictionary<string, string>();
//=========鈽呪槄瀹夐槻绫讳紶鎰熷櫒绫烩槄鈽�=========
this.dicDeviceModelIdChanged["MULTI-GASE--EA07"] = "MSG01/M-ZB.10";//鐕冩皵浼犳劅鍣�
@@ -2115,7 +2123,7 @@
this.dicDeviceModelIdChanged["MULTI-WATE--EA02"] = "MSW01/M-ZB.10";//姘存蹈浼犳劅鍣�
this.dicDeviceModelIdChanged["MULTI-BURO--EA06"] = "MBU01/M-ZB.10";//绱ф�ユ寜閿�
- //闇�瑕佸叡鏈夌殑鍥剧墖瀵硅薄
+ //鉁┾湬鉁┾湬鉁╅渶瑕佸叡鏈夌殑鍥剧墖瀵硅薄鉁┾湬鉁┾湬鉁�
this.dicPictrueShard = new Dictionary<string, string>();
this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//绠�绾�4鎸夐敭闈㈡澘 娌跨敤 4鎸夐敭鐨勫浘鏍�
this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//绠�绾�3鎸夐敭闈㈡澘 娌跨敤 3鎸夐敭鐨勫浘鏍�
diff --git a/ZigbeeApp/Shared/Common/ZigbeeColor.cs b/ZigbeeApp/Shared/Common/ZigbeeColor.cs
index 90baaca..9cf8886 100755
--- a/ZigbeeApp/Shared/Common/ZigbeeColor.cs
+++ b/ZigbeeApp/Shared/Common/ZigbeeColor.cs
@@ -254,48 +254,23 @@
/// 0xFFF5F5F5
/// </summary>
public uint GXCSeekBarBackground = 0xFFF5F5F5;
-
-
-
-
- public uint GXCTextBlueColor = 0xFF00AAF0;
-
-
-
- public uint GXCBorderRedColor = 0xFFF44D4D;
-
-
- public uint GXCButtonBlueColor = 0xFF00AAF0;
- public uint GXCButtonUnselectedColor = 0xFFAAAAAA;
- public uint GXCTextUnselectedColor = 0xFFD5D6D7;
-
-
- public uint GXCSelectedColor = 0xFFFE5E00;//閫変腑棰滆壊
- public uint GXCButtonhardWhiteColor = 0xFFE0E0E0;//鎴块棿btn鍗婇�忔槑鑳屾櫙鑹�
-
- /// <summary>
- /// 30%閫忔槑搴﹂粦鑹�
- /// </summary>
- public uint GXCBlack70Color = 0x4C000000;
- /// <summary>
- /// 20%閫忔槑搴﹂粦鑹�
- /// </summary>
- public uint GXCBlack80Color = 0x33000000;
- public uint GXCButtonTipColor = 0xFF999999;//娴呰壊瀛楁彁绀�
- public uint GXCTransparent = 0x00FFFFFF;
- /// <summary>
- /// 婊戞潯鏈�夋嫨涓鑹�--7C7C7C ->0xffadadad
- /// </summary>
- public uint GXCSliderUnSelectedColor = 0xffadadad;
- public uint GXCEditorBGColor = 0xFF32B4C8;
- /// <summary>
- /// 鍙栨秷鏀惰棌棰滆壊--999999
- /// </summary>
- public uint GXCCancelCollectionBGColor = 0xFF999999;
/// <summary>
/// 鐢ㄤ簬绌鸿皟鐨勯�変腑鏂囧瓧棰滆壊
/// </summary>
public uint GXCACSelectedTextColor = 0xFF99D619;
+ /// <summary>
+ /// 寮�濮嬮鑹�
+ /// </summary>
+ public uint GXCArcScaleSeekBarStartColor = 0xFF495AF4;
+ /// <summary>
+ /// 缁撴潫棰滆壊
+ /// </summary>
+ public uint GXCArcScaleSeekBarEndColor = 0xFFAE50A8;
+
+
+
+ public uint GXCButtonBlueColor = 0xFF00AAF0;
+
#endregion
#region --Logic瀹氫箟鐨勯鑹�--
diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll
index ef4abd0..866897a 100755
--- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll
+++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll
Binary files differ
diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll
index 7d7a66c..5638501 100755
--- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll
+++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll
Binary files differ
diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll
index 0f6badc..ac2ea32 100755
--- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll
+++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll
Binary files differ
diff --git a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll
index a5ed496..05d277f 100755
--- a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll
+++ b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll
Binary files differ
diff --git a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll
index 6fa3f33..9d2ff26 100755
--- a/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll
+++ b/ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll
Binary files differ
diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
index 230ce9c..0ba99c3 100755
--- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -170,120 +170,110 @@
return;
}
deviceUI.CommonDevice.DeviceStatusReport = common.DeviceStatusReport;
- var curTemp = (attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default;
- switch (attriButeList[0].AttributeId)
+ foreach(var attList in attriButeList)
{
- case 0:
- ac.currentLocalTemperature = curTemp;
- ac.LastDateTime = DateTime.Now;
- indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} 鈩�";
- //currentTemperatureBtn.Text = $"{ac.currentLocalTemperature} 鈩�";
- break;
-
- case 17:
- ac.currentCoolingSetpoint = curTemp;
- if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
- {
- mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
- }
-
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 18:
- ac.currentHeatingSetpoint = curTemp;
- if (ac.currentSystemMode == 4)
- {
- mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
- }
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 4096:
- ac.currentAutoSetpoint = curTemp;
- if (ac.currentSystemMode == 1)
- {
- mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
- }
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 28:
- //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
- //Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8
- ac.currentSystemMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- if (ac.currentSystemMode == 0)
- {
- switchBtn.IsSelected = false;
- modeBtn.IsSelected = false;
+ var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
+ switch (attList.AttributeId)
+ {
+ case 0:
+ ac.currentLocalTemperature = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} 鈩�";
+ //currentTemperatureBtn.Text = $"{ac.currentLocalTemperature} 鈩�";
+ break;
+ case 17:
+ ac.currentCoolingSetpoint = curTemp;
+ if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
+ {
+ mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
+ }
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 18:
+ ac.currentHeatingSetpoint = curTemp;
+ if (ac.currentSystemMode == 4)
+ {
+ mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
+ }
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4096:
+ ac.currentAutoSetpoint = curTemp;
+ if (ac.currentSystemMode == 1)
+ {
+ mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
+ }
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 28:
+ //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
+ //Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8
+ ac.currentSystemMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ if (ac.currentSystemMode == 0)
+ {
+ switchBtn.IsSelected = false;
+ modeBtn.IsSelected = false;
+ fanModeBtn.IsSelected = false;
+ FanSwingModeBtn.IsSelected = false;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
+ }
+ else if (ac.currentSystemMode == 1 || ac.currentSystemMode == 3 || ac.currentSystemMode == 4 || ac.currentSystemMode == 7 || ac.currentSystemMode == 8)
+ {
+ switchBtn.IsSelected = true;
+ modeBtn.IsSelected = true;
+ fanModeBtn.IsSelected = true;
+ FanSwingModeBtn.IsSelected = true;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
+ }
modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode);
modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode);
currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode);
-
mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
-
- fanModeBtn.IsSelected = false;
- FanSwingModeBtn.IsSelected = false;
- }
- else if (ac.currentSystemMode == 1 || ac.currentSystemMode == 3 || ac.currentSystemMode == 4 || ac.currentSystemMode == 7 || ac.currentSystemMode == 8)
- {
- switchBtn.IsSelected = true;
- modeBtn.IsSelected = true;
- modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode);
- modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode);
- currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode);
-
- mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
- fanModeBtn.IsSelected = true;
- FanSwingModeBtn.IsSelected = true;
- }
- break;
-
- case 4097:
- //杩囪檻缃戞竻娲楁爣蹇�:42
- ac.CleanStatu = attriButeList[0].AttriButeData == 42;
- cleanStatu.Visible = ac.CleanStatu;
- break;
-
- case 4099:
- var value = Convert.ToString(attriButeList[0].AttriButeData, 2).PadLeft(16, '0');
- var modeStr = value.Substring(value.Length - 5, 5);
- for (int j = 0; j < modeStr.Length; j++)
- {
- ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
- }
- break;
-
+ mArcScaleSeekBar.IsClickable = ACControlBase.IsOpen(ac);
+ break;
+ case 4097:
+ //杩囪檻缃戞竻娲楁爣蹇�:42
+ ac.CleanStatu = attList.AttriButeData == 42;
+ cleanStatu.Visible = ac.CleanStatu;
+ break;
+ case 4099:
+ var value = Convert.ToString(attList.AttriButeData, 2).PadLeft(16, '0');
+ var modeStr = value.Substring(value.Length - 5, 5);
+ for (int j = 0; j < modeStr.Length; j++)
+ {
+ ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
+ }
+ break;
+ }
}
}
if (common.DeviceStatusReport.CluterID == 514)
{
var attriButeList = common.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
ac.DeviceStatusReport = common.DeviceStatusReport;
- switch (attriButeList[0].AttributeId)
+ foreach(var attList in attriButeList)
{
- case 0:
- //椋庢墖褰撳墠鐨勫伐浣滄ā寮� 1=Low 2=Medium 3=High
- ac.currentFanMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- fanModeBtn.IsSelected = true;
- fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode);
- fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode);
- break;
- case 4096:
- //椋庢墖褰撳墠鐨勬壂椋庢ā寮�
- ac.currentFanSwingMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- FanSwingModeBtn.IsSelected = true;
- FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
- FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
- break;
+ switch (attList.AttributeId)
+ {
+ case 0:
+ //椋庢墖褰撳墠鐨勫伐浣滄ā寮� 1=Low 2=Medium 3=High
+ ac.currentFanMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ fanModeBtn.IsSelected = true;
+ fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode);
+ fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode);
+ break;
+ case 4096:
+ //椋庢墖褰撳墠鐨勬壂椋庢ā寮�
+ ac.currentFanSwingMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ FanSwingModeBtn.IsSelected = true;
+ FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
+ FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
+ break;
+ }
}
}
//***鏂版敼 * **璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID = 3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
@@ -508,7 +498,7 @@
var deviceNameBtn = new Button()
{
Y = Application.GetRealHeight(184),
- Width = Application.GetRealWidth(500),
+ Width = Application.GetRealWidth(600),
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
Text = device.CommonDevice.DeviceEpointName,
@@ -534,11 +524,20 @@
Width = Application.GetRealWidth(671),
Height = Application.GetRealHeight(671),
Gravity = Gravity.CenterHorizontal,
- MinValue=ACControlBase.Temperature_Low,
- MaxValue=ACControlBase.Temperature_High,
- Progress=ACControlBase.GetCurrentModeTemperature(ac)
+ MinValue = ACControlBase.Temperature_Low,
+ MaxValue = ACControlBase.Temperature_High,
+ Progress = ACControlBase.GetCurrentModeTemperature(ac),
+ IsClickable = ACControlBase.IsOpen(ac)
};
itemView.AddChidren(mArcScaleSeekBar);
+ if(ACControlBase.IsOpen(ac))
+ {
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
+ }
+ else
+ {
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
+ }
mArcScaleSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
{
if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
@@ -560,7 +559,7 @@
currentModeBtn = new Button()
{
- Y = Application.GetRealHeight(599),
+ Y = Application.GetRealHeight(565),
Height = Application.GetRealHeight(80),
Width = Application.GetRealWidth(200),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
@@ -572,7 +571,7 @@
reduceTemperatureBtn = new Button()
{
X = Application.GetRealWidth(268),
- Y = Application.GetRealHeight(680),
+ Y = Application.GetRealHeight(650),
Width = Application.GetMinRealAverage(80),
Height = Application.GetMinRealAverage(80),
UnSelectedImagePath = "AC/Reduce.png"
@@ -581,8 +580,8 @@
addTemperatureBtn = new Button()
{
- X = Application.GetRealWidth(628),
- Y = Application.GetRealHeight(680),
+ X = Application.GetRealWidth(610),
+ Y = Application.GetRealHeight(650),
Width = Application.GetMinRealAverage(80),
Height = Application.GetMinRealAverage(80),
UnSelectedImagePath = "AC/Add.png"
@@ -707,12 +706,14 @@
private void Switch_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
{
switchBtn.IsSelected = !switchBtn.IsSelected;
+ mArcScaleSeekBar.IsClickable = switchBtn.IsSelected;
if (switchBtn.IsSelected == true)
{
ac.Open();
modeBtn.IsSelected = true;
fanModeBtn.IsSelected = true;
FanSwingModeBtn.IsSelected = true;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
}
else
{
@@ -720,6 +721,7 @@
modeBtn.IsSelected = false;
fanModeBtn.IsSelected = false;
FanSwingModeBtn.IsSelected = false;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
}
}
@@ -1412,8 +1414,6 @@
}
#endregion
-
-
#region 鈼� 鎺у埗鍙嶉_________________________
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index 078d1c6..36ef4af 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -149,6 +149,10 @@
{
try
{
+ if (common.DeviceStatusReport.AttriBute == null || common.DeviceStatusReport.AttriBute.Count == 0)
+ {
+ return;
+ }
for (int i = 0; deviceListScrolView != null && i < deviceListScrolView.ChildrenCount; i++)
{
var rowLayout = deviceListScrolView.GetChildren(i) as RowLayout;
@@ -169,10 +173,6 @@
{
var light = deviceUI.CommonDevice as ToggleLight;
light.DeviceStatusReport = common.DeviceStatusReport;
- if (light.DeviceStatusReport.AttriBute == null || light.DeviceStatusReport.AttriBute.Count == 0)
- {
- continue;
- }
light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
row.SetStatu(light.OnOffStatus == 1);
@@ -194,10 +194,6 @@
{
var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
airSwitch.DeviceStatusReport = common.DeviceStatusReport;
- if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData;
var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
row.SetStatu(airSwitch.OnOffStatus == 1);
@@ -249,57 +245,47 @@
if (common.DeviceStatusReport.CluterID == 513)
{
var attriButeList = common.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
ac.DeviceStatusReport = common.DeviceStatusReport;
-
- var curTemp = (attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default;
- switch (attriButeList[0].AttributeId)
+ foreach(var attList in attriButeList)
{
- case 0:
- ac.currentLocalTemperature = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 17:
- ac.currentCoolingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 18:
- ac.currentHeatingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 4096:
- ac.currentAutoSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 28:
- //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
- ac.currentSystemMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 4099:
- var value = Convert.ToString(attriButeList[0].AttriButeData, 2).PadLeft(16, '0');
- var modeStr = value.Substring(value.Length - 5, 5);
- for (int j = 0; j < modeStr.Length; j++)
- {
- ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
- }
- break;
-
- case 4097:
- //杩囪檻缃戞竻娲楁爣蹇�:42
- ac.CleanStatu = attriButeList[0].AttriButeData == 42;
- break;
+ var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
+ switch (attList.AttributeId)
+ {
+ case 0:
+ ac.currentLocalTemperature = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 17:
+ ac.currentCoolingSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 18:
+ ac.currentHeatingSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4096:
+ ac.currentAutoSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 28:
+ ac.currentSystemMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4099:
+ var value = Convert.ToString(attList.AttriButeData, 2).PadLeft(16, '0');
+ var modeStr = value.Substring(value.Length - 5, 5);
+ for (int j = 0; j < modeStr.Length; j++)
+ {
+ ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
+ }
+ break;
+ case 4097:
+ //杩囪檻缃戞竻娲楁爣蹇�:42
+ ac.CleanStatu = attList.AttriButeData == 42;
+ break;
+ }
}
-
var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
row.SetStatu(ac.currentSystemMode != 0);
row.SetStatuText(deviceUI.GetDeviceStatu());
@@ -309,21 +295,20 @@
{
var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
var attriButeList = common.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
ac.DeviceStatusReport = common.DeviceStatusReport;
- switch (attriButeList[0].AttributeId)
+ foreach(var attList in attriButeList)
{
- case 0:
- ac.currentFanMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentFanSwingMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
+ switch (attList.AttributeId)
+ {
+ case 0:
+ ac.currentFanMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4096:
+ ac.currentFanSwingMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ }
}
var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
row.SetStatu(ac.currentSystemMode != 0);
@@ -345,12 +330,17 @@
{
var dimmableLight = deviceUI.CommonDevice as DimmableLight;
dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
- {
- continue;
- }
dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
+ var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
+ row.SetStatu(dimmableLight.OnOffStatus == 1);
+ row.SetStatuText(deviceUI.GetDeviceStatu());
+ dimmableLight.LastDateTime = DateTime.Now;
+ }
+ if (common.DeviceStatusReport.CluterID == 8)
+ {
+ var dimmableLight = deviceUI.CommonDevice as DimmableLight;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
+ dimmableLight.Level = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
var row = rowLayout.GetChildren(0) as CategoryFunctionRow;
row.SetStatu(dimmableLight.OnOffStatus == 1);
row.SetStatuText(deviceUI.GetDeviceStatu());
@@ -530,7 +520,7 @@
functionBtn.Init();
functionBtn.SetTitle(R.MyInternationalizationString.Function);
//鑷姩鍖�
- automationBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 * 2 + 20, 34, 150, 68);
+ automationBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 * 2 + 20+50, 34, 150, 68);
automationBtn.Init();
automationBtn.SetTitle(R.MyInternationalizationString.Automation);
//闅愯棌鑷姩鍖�
@@ -869,623 +859,651 @@
}
}
}
- foreach (var deviceUI in sameTypeList)
+ for (int i=0;i<sameTypeList.Count;i++)
{
- //鍒犻櫎璁惧
- EventHandler<MouseEventArgs> delEvent = (delSender, delE) =>
+ var deviceUI = sameTypeList[i];
+ new System.Threading.Thread(() =>
{
- var alert = new CustomAlert();
- AddChidren(alert);
- alert.Show(Language.StringByID(R.MyInternationalizationString.ConfirmDelete));
- alert.ResultEventHandler += (e2) =>
+ Application.RunOnMainThread(() =>
{
- if (e2)
+ try
{
- Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice);
- deviceListScrolView.RemoveViewByTag((delSender as Button).Tag);
- sameTypeList.Remove(deviceUI);
- if (sameTypeList.Count == 0)
+ //鍒犻櫎璁惧
+ EventHandler<MouseEventArgs> delEvent = (delSender, delE) =>
{
- RefreshBodyView();
- }
- }
- };
- };
- EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
- {
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
- detailInfo.action = RefreshBodyView;
- };
-
- if (deviceUI.CommonDevice.Type == DeviceType.OnOffOutput)
- {
- //鐏�
- var light = deviceUI.CommonDevice as ToggleLight;
- //琛ヤ笂闈炶繙绋�
- if (light.Gateway == null)
- {
- continue;
- }
- if (light.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
- }
- }
-
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(129 + 35),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
- deviceRow.SetOnLineStatu(light.IsOnline == 1);
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- deviceRow.SetStatu(light.OnOffStatus == 1);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- deviceRow.IsSelected = (send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- light.SwitchControl(1);
- }
- else
- {
- light.SwitchControl(0);
- }
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
-
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- var lightControl = new Phone.Device.Light.OnOffControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(deviceUI, room);
- }
- else if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- var lightControl = new Phone.Device.Light.PlugControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(deviceUI, room);
- }
- else
- {
- var lightControl = new Phone.Device.Light.LightControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(deviceUI, room);
- }
- };
-
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- if (room.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
- }
- else if (deviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
- {
- //绌烘皵寮�鍏�
- var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
- //琛ヤ笂闈炶繙绋�
- if (airSwitch.Gateway == null)
- {
- continue;
- }
- if (airSwitch.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(airSwitch, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
- });
- }
- else
- {
- if ((DateTime.Now - airSwitch.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
- }
- }
-
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(129 + 35),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
- deviceRow.SetOnLineStatu(airSwitch.IsOnline == 1);
- deviceRow.SetStatu(airSwitch.OnOffStatus == 1);
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
-
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- airSwitch.SwitchControl(1);
- }
- else
- {
- airSwitch.SwitchControl(0);
- }
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
-
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
-
- var lightControl = new Phone.Device.Light.AirSwitchControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(deviceUI, room);
- };
-
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- if (room.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
-
- }
- else if (deviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
- {
- //璋冨厜鐏�
- var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
- //琛ヤ笂闈炶繙绋�
- if (dimmableLight.Gateway == null)
- {
- continue;
- }
- if (dimmableLight.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(dimmableLight, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(deviceUI.CommonDevice);
- });
- }
- else
- {
- if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(deviceUI.CommonDevice);
- }
- }
-
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(129 + 35),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
- deviceRow.SetOnLineStatu(dimmableLight.IsOnline == 1);
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- deviceRow.SetStatu(dimmableLight.OnOffStatus == 1);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
-
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- dimmableLight.SwitchControl(1);
- }
- else
- {
- dimmableLight.SwitchControl(0);
- }
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
-
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
- UserView.HomePage.Instance.AddChidren(dimmableLightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- //dimmableLightControl.action = RefreshBodyView;
- dimmableLightControl.Show(deviceUI, room);
- };
-
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- if (room.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
- }
- else if (deviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
- {
- //绌鸿皟
- var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
- //琛ヤ笂闈炶繙绋�
- if (ac.Gateway == null)
- {
- continue;
- }
- if (ac.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- UserView.UserHomeView.ReadStatus(ac, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(deviceUI.CommonDevice);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(deviceUI.CommonDevice);
- }
- }
-
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(129 + 35),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
- deviceRow.SetOnLineStatu(ac.IsOnline == 1);
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- deviceRow.SetStatu(ac.currentSystemMode != 1);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
- {
- zbGateway = deviceUI.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
-
- (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
- if ((send2 as Button).IsSelected)
- {
- ac.Open();
- }
- else
- {
- ac.Close();
- }
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- };
-
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- if (room.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
-
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var acControl = new Phone.Device.AC.ACControl();
- UserView.HomePage.Instance.AddChidren(acControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- //rollerShadeControl.action = RefreshBodyView;
- acControl.Show(deviceUI, room);
- };
- }
- else if (deviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
- {
- //鍗峰笜
- var rollerShade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
- //涓嶄笂闈炶繙绋�
- if (rollerShade.Gateway == null)
- {
- continue;
- }
- if (rollerShade.Gateway.IsVirtual)
- {
- UserHomeView.ReadStatus(rollerShade, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(deviceUI.CommonDevice);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇
- if ((DateTime.Now - rollerShade.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(deviceUI.CommonDevice);
- }
- }
-
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(129 + 35),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
-
- var deviceRow = new CategoryFunctionForWinRow(0, 35);
- deviceRow.Init(deviceUI);
- deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
- deviceRow.SetOnLineStatu(rollerShade.IsOnline == 1);
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- deviceRow.SetStatu(rollerShade.WcdCurrentPositionLiftPercentage != 0);
- deviceRow.SetRollerShadeIcon(rollerShade.WcdType);
- deviceTypeRowLayout.AddChidren(deviceRow);
-
- if (rollerShade.WcdType == -1)
- {
- CommonPage.Loading.Start();
- new System.Threading.Thread(() =>
- {
- Rollershade.ReadWcdTypeAction(rollerShade, () =>
- {
- Application.RunOnMainThread(() =>
+ var alert = new CustomAlert();
+ AddChidren(alert);
+ alert.Show(Language.StringByID(R.MyInternationalizationString.DeleteFunction));
+ alert.ResultEventHandler += (e2) =>
{
+ if (e2)
+ {
+ Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice);
+ deviceListScrolView.RemoveViewByTag((delSender as Button).Tag);
+ sameTypeList.Remove(deviceUI);
+ if (sameTypeList.Count == 0)
+ {
+ RefreshBodyView();
+ }
+ }
+ };
+ };
+ EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
+ {
+ var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
+ UserView.HomePage.Instance.AddChidren(detailInfo);
+ UserView.HomePage.Instance.PageIndex += 1;
+ detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
+ detailInfo.action = RefreshBodyView;
+ };
+
+ if (deviceUI.CommonDevice.Type == DeviceType.OnOffOutput)
+ {
+ //鐏�
+ var light = deviceUI.CommonDevice as ToggleLight;
+ if (light.Gateway != null)
+ {
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (light.Gateway.IsVirtual)
+ {
+ UserHomeView.ReadStatus(light, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
+ });
+ }
+ else
+ {
+ //闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
+ if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var deviceTypeRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(129 + 35),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Tag = deviceUI
+ };
+ deviceListScrolView.AddChidren(deviceTypeRowLayout);
+
+ var deviceRow = new CategoryFunctionRow(0, 35);
+ deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
+ deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+ deviceRow.SetOnLineStatu(light.IsOnline == 1);
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ deviceRow.SetStatu(light.OnOffStatus == 1);
+ deviceTypeRowLayout.AddChidren(deviceRow);
+
+ deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ zbGateway = deviceUI.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
+ (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+ deviceRow.IsSelected = (send2 as Button).IsSelected;
+ if ((send2 as Button).IsSelected)
+ {
+ light.SwitchControl(1);
+ }
+ else
+ {
+ light.SwitchControl(0);
+ }
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ };
+
+ deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A寮�鍏�)
+ {
+ var lightControl = new Phone.Device.Light.OnOffControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(deviceUI, room);
+ }
+ else if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A鎻掑骇)
+ {
+ var lightControl = new Phone.Device.Light.PlugControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(deviceUI, room);
+ }
+ else
+ {
+ var lightControl = new Phone.Device.Light.LightControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(deviceUI, room);
+ }
+ };
+
+ var editBtn = new CommonForm.RowLayoutEditButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ var delBtn = new CommonForm.RowLayoutDeleteButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ if (room.IsSharedRoom == false)
+ {
+ deviceTypeRowLayout.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += deviceDetailHandler;
+ deviceTypeRowLayout.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += delEvent;
+ }
+ }
+ }
+ else if (deviceUI.CommonDevice.Type == DeviceType.AirSwitch)
+ {
+ //绌烘皵寮�鍏�
+ var airSwitch = deviceUI.CommonDevice as AirSwitch;
+ if (airSwitch.Gateway != null)
+ {
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (airSwitch.Gateway.IsVirtual)
+ {
+ UserHomeView.ReadStatus(airSwitch, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
+ });
+ }
+ else
+ {
+ if ((DateTime.Now - airSwitch.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(deviceUI.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var deviceTypeRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(129 + 35),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Tag = deviceUI
+ };
+ deviceListScrolView.AddChidren(deviceTypeRowLayout);
+
+ var deviceRow = new CategoryFunctionRow(0, 35);
+ deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
+ deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+ deviceRow.SetOnLineStatu(airSwitch.IsOnline == 1);
+ deviceRow.SetStatu(airSwitch.OnOffStatus == 1);
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ deviceTypeRowLayout.AddChidren(deviceRow);
+
+ deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ zbGateway = deviceUI.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
+
+ (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+ if ((send2 as Button).IsSelected)
+ {
+ airSwitch.SwitchControl(1);
+ }
+ else
+ {
+ airSwitch.SwitchControl(0);
+ }
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ };
+
+ deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+
+ var lightControl = new Phone.Device.Light.AirSwitchControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(deviceUI, room);
+ };
+
+ var editBtn = new CommonForm.RowLayoutEditButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ var delBtn = new CommonForm.RowLayoutDeleteButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ if (room.IsSharedRoom == false)
+ {
+ deviceTypeRowLayout.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += deviceDetailHandler;
+ deviceTypeRowLayout.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += delEvent;
+ }
+ }
+ }
+ else if (deviceUI.CommonDevice.Type == DeviceType.DimmableLight)
+ {
+ //璋冨厜鐏�
+ var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
+ if (dimmableLight.Gateway != null)
+ {
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (dimmableLight.Gateway.IsVirtual)
+ {
+ UserHomeView.ReadStatus(dimmableLight, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(deviceUI.CommonDevice);
+ });
+ }
+ else
+ {
+ if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
+ {
+ ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(deviceUI.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var deviceTypeRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(129 + 35),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Tag = deviceUI
+ };
+ deviceListScrolView.AddChidren(deviceTypeRowLayout);
+
+ var deviceRow = new CategoryFunctionRow(0, 35);
+ deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
+ deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+ deviceRow.SetOnLineStatu(dimmableLight.IsOnline == 1);
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ deviceRow.SetStatu(dimmableLight.OnOffStatus == 1);
+ deviceTypeRowLayout.AddChidren(deviceRow);
+
+ deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ zbGateway = deviceUI.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
+
+ (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+ if ((send2 as Button).IsSelected)
+ {
+ dimmableLight.SwitchControl(1);
+ }
+ else
+ {
+ dimmableLight.SwitchControl(0);
+ }
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ };
+
+ deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
+ UserView.HomePage.Instance.AddChidren(dimmableLightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ //dimmableLightControl.action = RefreshBodyView;
+ dimmableLightControl.Show(deviceUI, room);
+ };
+
+ var editBtn = new CommonForm.RowLayoutEditButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ if (room.IsSharedRoom == false)
+ {
+ deviceTypeRowLayout.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += deviceDetailHandler;
+ deviceTypeRowLayout.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += delEvent;
+ }
+ }
+ }
+ else if (deviceUI.CommonDevice.Type == DeviceType.Thermostat)
+ {
+ //绌鸿皟
+ var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
+ if (ac.Gateway != null)
+ {
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (ac.Gateway.IsVirtual)
+ {
+ //鍙戦�佽鍙栫姸鎬佸懡浠�
+ UserView.UserHomeView.ReadStatus(ac, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendACStatuComand(deviceUI.CommonDevice);
+ });
+ }
+ else
+ {
+ //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
+ if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
+ {
+ ReadDeviceAttributeLogic.Instance.SendACStatuComand(deviceUI.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var deviceTypeRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(129 + 35),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Tag = deviceUI
+ };
+ deviceListScrolView.AddChidren(deviceTypeRowLayout);
+
+ var deviceRow = new CategoryFunctionRow(0, 35);
+ deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
+ deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+ deviceRow.SetOnLineStatu(ac.IsOnline == 1);
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ deviceRow.SetStatu(ac.currentSystemMode != 1);
+ deviceTypeRowLayout.AddChidren(deviceRow);
+
+ deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ zbGateway = deviceUI.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
+
+ (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+ if ((send2 as Button).IsSelected)
+ {
+ ac.Open();
+ }
+ else
+ {
+ ac.Close();
+ }
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(deviceUI.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ };
+
+ var editBtn = new CommonForm.RowLayoutEditButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ var delBtn = new CommonForm.RowLayoutDeleteButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ if (room.IsSharedRoom == false)
+ {
+ deviceTypeRowLayout.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += deviceDetailHandler;
+ deviceTypeRowLayout.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += delEvent;
+ }
+
+ deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ var acControl = new Phone.Device.AC.ACControl();
+ UserView.HomePage.Instance.AddChidren(acControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ //rollerShadeControl.action = RefreshBodyView;
+ acControl.Show(deviceUI, room);
+ };
+ }
+ }
+ else if (deviceUI.CommonDevice.Type == DeviceType.WindowCoveringDevice)
+ {
+ //鍗峰笜
+ var rollerShade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
+ if (rollerShade.Gateway != null)
+ {
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (rollerShade.Gateway.IsVirtual)
+ {
+ UserHomeView.ReadStatus(rollerShade, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(deviceUI.CommonDevice);
+ });
+ }
+ else
+ {
+ //闃叉鐭椂闂村唴澶氭璇诲彇
+ if ((DateTime.Now - rollerShade.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
+ {
+ ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(deviceUI.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var deviceTypeRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(129 + 35),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Tag = deviceUI
+ };
+ deviceListScrolView.AddChidren(deviceTypeRowLayout);
+
+ var deviceRow = new CategoryFunctionForWinRow(0, 35);
+ deviceRow.Init(deviceUI);
+ deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+ deviceRow.SetOnLineStatu(rollerShade.IsOnline == 1);
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ deviceRow.SetStatu(rollerShade.WcdCurrentPositionLiftPercentage != 0);
deviceRow.SetRollerShadeIcon(rollerShade.WcdType);
- CommonPage.Loading.Hide();
- });
- });
- })
- { IsBackground = true }.Start();
- }
+ deviceTypeRowLayout.AddChidren(deviceRow);
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
- {
- Tag = deviceUI,
- Radius = 0
- };
- if (room.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
+ if (rollerShade.WcdType == -1)
+ {
+ CommonPage.Loading.Start();
+ new System.Threading.Thread(() =>
+ {
+ Rollershade.ReadWcdTypeAction(rollerShade, () =>
+ {
+ Application.RunOnMainThread(() =>
+ {
+ deviceRow.SetRollerShadeIcon(rollerShade.WcdType);
+ CommonPage.Loading.Hide();
+ });
+ });
+ })
+ { IsBackground = true }.Start();
+ }
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
- UserView.HomePage.Instance.AddChidren(rollerShadeControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- //rollerShadeControl.action = RefreshBodyView;
- rollerShadeControl.Show(deviceUI, room);
- };
- }
- else if(deviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.DoorLock)
- {
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(129 + 35),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
+ var editBtn = new CommonForm.RowLayoutEditButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
+ {
+ Tag = deviceUI,
+ Radius = 0
+ };
+ if (room.IsSharedRoom == false)
+ {
+ deviceTypeRowLayout.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += deviceDetailHandler;
+ deviceTypeRowLayout.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += delEvent;
+ }
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
- deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1);
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- deviceRow.HideSwitchBtn(true);
- deviceTypeRowLayout.AddChidren(deviceRow);
+ deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
+ UserView.HomePage.Instance.AddChidren(rollerShadeControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ //rollerShadeControl.action = RefreshBodyView;
+ rollerShadeControl.Show(deviceUI, room);
+ };
+ }
+ }
+ else if (deviceUI.CommonDevice.Type == DeviceType.DoorLock)
+ {
+ var deviceTypeRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(129 + 35),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Tag = deviceUI
+ };
+ deviceListScrolView.AddChidren(deviceTypeRowLayout);
+ var deviceRow = new CategoryFunctionRow(0, 35);
+ deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
+ deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+ deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1);
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ deviceRow.HideSwitchBtn(true);
+ deviceTypeRowLayout.AddChidren(deviceRow);
- deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
- {
- var userDoorLockPage = new UserDoorLockPage(room, deviceUI);
- HomePage.Instance.AddChidren(userDoorLockPage);
- HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
- };
+ deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+ {
+ var userDoorLockPage = new UserDoorLockPage(room, deviceUI);
+ HomePage.Instance.AddChidren(userDoorLockPage);
+ HomePage.Instance.PageIndex += 1;
+ userDoorLockPage.Show();
+ };
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = deviceUI
- };
- var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
- {
- Tag = deviceUI
- };
- if (room.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
- }
- else
- {
- var deviceTypeRowLayout = new RowLayout()
- {
- Height = Application.GetRealHeight(129 + 35),
- LineColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = deviceUI
- };
- deviceListScrolView.AddChidren(deviceTypeRowLayout);
+ var editBtn = new CommonForm.RowLayoutEditButton()
+ {
+ Tag = deviceUI
+ };
+ var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
+ {
+ Tag = deviceUI
+ };
+ if (room.IsSharedRoom == false)
+ {
+ deviceTypeRowLayout.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += deviceDetailHandler;
+ deviceTypeRowLayout.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += delEvent;
+ }
+ }
+ else
+ {
+ var deviceTypeRowLayout = new RowLayout()
+ {
+ Height = Application.GetRealHeight(129 + 35),
+ LineColor = ZigbeeColor.Current.GXCBackgroundColor,
+ Tag = deviceUI
+ };
+ deviceListScrolView.AddChidren(deviceTypeRowLayout);
- var deviceRow = new CategoryFunctionRow(0, 35);
- deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
- deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
- deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1);
- deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
- deviceRow.HideSwitchBtn(true);
- deviceTypeRowLayout.AddChidren(deviceRow);
+ var deviceRow = new CategoryFunctionRow(0, 35);
+ deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
+ deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+ deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1);
+ deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
+ deviceRow.HideSwitchBtn(true);
+ deviceTypeRowLayout.AddChidren(deviceRow);
- var editBtn = new CommonForm.RowLayoutEditButton()
- {
- Tag = deviceUI
- };
- var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
- {
- Tag = deviceUI
- };
- if (room.IsSharedRoom == false)
- {
- deviceTypeRowLayout.AddRightView(editBtn);
- editBtn.MouseUpEventHandler += deviceDetailHandler;
- deviceTypeRowLayout.AddRightView(delBtn);
- delBtn.MouseUpEventHandler += delEvent;
- }
- }
+ var editBtn = new CommonForm.RowLayoutEditButton()
+ {
+ Tag = deviceUI
+ };
+ var delBtn = new Device.CommonForm.RowLayoutDeleteButton()
+ {
+ Tag = deviceUI
+ };
+ if (room.IsSharedRoom == false)
+ {
+ deviceTypeRowLayout.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += deviceDetailHandler;
+ deviceTypeRowLayout.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += delEvent;
+ }
+ }
+ }
+ catch
+ {
+
+ }
+ });
+ })
+ { IsBackground=true}.Start();
}
};
@@ -1507,7 +1525,6 @@
typeRowLayout.AddChidren(functionTypeIMG);
functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
-
if (deviceType == room.DeviceUIList[0].CommonDevice.Type)
{
@@ -1675,57 +1692,53 @@
/// GetDelayScene
/// </summary>
/// <param name="scrolViewLayout"></param>
- private void GetDelayScene(VerticalScrolViewLayout scrolViewLayout)
+ private async void GetDelayScene(VerticalScrolViewLayout scrolViewLayout)
{
- new System.Threading.Thread(async () =>
+ var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync();
+ if (catDelaySceneResponseAllData == null)
{
- var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync();
- if (catDelaySceneResponseAllData == null)
- {
- return;
- }
- var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData;
- if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0)
- {
- return;
- }
- var delayList = catDelaySceneResponseData.DelayScenesList;
+ return;
+ }
+ var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData;
+ if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0)
+ {
+ return;
+ }
+ var delayList = catDelaySceneResponseData.DelayScenesList;
- Application.RunOnMainThread(() =>
+ for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
+ {
+ var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView;
+ foreach (var delayScenesListResponseInfo in delayList)
{
- for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
+ if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
{
- var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView;
- foreach (var delayScenesListResponseInfo in delayList)
+ sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime;
+ var remainTime= delayScenesListResponseInfo.RemainTime;
+ if (remainTime > 0)
{
- if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
+ new System.Threading.Thread(() =>
{
- sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime;
- new System.Threading.Thread(() =>
+ while (remainTime-- > 0)
{
- while (sceneView.scene.RemainTime > 0)
- {
- System.Threading.Thread.Sleep(1000);
- Application.RunOnMainThread(() =>
- {
- sceneView.SetTimeText(CommonFormResouce.GetTimeString(sceneView.scene.RemainTime));
- });
- sceneView.scene.RemainTime -= 1;
- }
+ System.Threading.Thread.Sleep(1000);
Application.RunOnMainThread(() =>
{
- sceneView.SetTimeImage();
+ sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime));
});
- })
- { IsBackground = true }.Start();
-
- break;
- }
+ }
+ Application.RunOnMainThread(() =>
+ {
+ sceneView.scene.RemainTime = 0;
+ sceneView.SetTimeImage();
+ });
+ })
+ { IsBackground = true }.Start();
}
+ break;
}
- });
- })
- { IsBackground = true }.Start();
+ }
+ }
}
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs
index 6a94c98..d31b0e0 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs
@@ -111,7 +111,7 @@
{
X = Application.GetRealWidth(181),
Y = Application.GetRealHeight(14),
- Width = Application.GetRealWidth(400),
+ Width = Application.GetRealWidth(600),
Height = Application.GetRealHeight(58),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs
index c86f41d..b73178f 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs
@@ -105,7 +105,7 @@
{
X = Application.GetRealWidth(181),
Y = Application.GetRealHeight(14),
- Width = Application.GetRealWidth(400),
+ Width = Application.GetRealWidth(600),
Height = Application.GetRealHeight(58),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
diff --git a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
index 97bfe44..e283fca 100755
--- a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
+++ b/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs
@@ -35,8 +35,13 @@
/// <param name="device">璁惧</param>
public void SendACStatuComand(CommonDevice device)
{
- SendThermostatStatuComand(device);
- SendFanStatuComand(device);
+ new System.Threading.Thread(() =>
+ {
+ SendFanStatuComand(device);
+ System.Threading.Thread.Sleep(300);
+ SendThermostatStatuComand(device);
+ })
+ { IsBackground = true }.Start();
}
/// <summary>
@@ -82,7 +87,6 @@
{
{ "AttriButeId", (int)AttriButeId.CleanStatu}
}
-
};
var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
jObject.Add("Data", data);
@@ -115,7 +119,7 @@
};
var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
jObject.Add("Data", data);
- device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString());
+ device.Gateway?.Send("GetDeviceStatus", jObject.ToString());
}
#endregion
@@ -165,8 +169,13 @@
/// <param name="device"></param>
public void SendDimmableLightStatuComand(CommonDevice device)
{
- SendSwitchStatuComand(device);
- SendLevelStatuComand(device);
+ new System.Threading.Thread(() =>
+ {
+ SendSwitchStatuComand(device);
+ System.Threading.Thread.Sleep(300);
+ SendLevelStatuComand(device);
+ })
+ { IsBackground = true }.Start();
}
/// <summary>
@@ -218,7 +227,6 @@
jObject.Add("Data", data);
device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString());
}
-
#endregion
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
index 87d0d18..1c0e296 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs
@@ -318,7 +318,7 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
+ Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ZigBee.Device.AirSwitch).OnOffStatus == 1)
};
itemView.AddChidren(StatuBtn);
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
index 6d52a0a..94c1dc7 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
@@ -126,10 +126,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)
{
@@ -142,20 +142,22 @@
{
levelSeekBar.IsClickable = true;
levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor;
+ //levelSeekBar.Progress = 100;
}
else
{
levelSeekBar.IsClickable = false;
levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor;
+ //levelSeekBar.Progress = 0;
}
//change color
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)
{
@@ -375,7 +377,7 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
+ Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as DimmableLight).OnOffStatus == 1)
};
itemView.AddChidren(StatuBtn);
@@ -392,7 +394,7 @@
};
itemView.AddChidren(levelSeekBar);
- if (dimmableLight.OnOffStatus==1)
+ if (dimmableLight.OnOffStatus == 1)
{
levelSeekBar.IsClickable = true;
levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor;
@@ -405,7 +407,7 @@
levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
{
- dimmableLight.SetLevel((int)(levelSeekBar.Progress*MaxLevel/100.0));
+ dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
};
switchBtn = new Button()
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
index 076661e..ed3cd89 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
@@ -166,7 +166,7 @@
return;
}
deviceUI.CommonDevice.IsOnline = common.IsOnline;
- deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1;
+ //deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1;
deviceUI.CommonDevice.LastDateTime = DateTime.Now;
}
catch (Exception ex)
@@ -341,7 +341,7 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text=CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline==1)
+ Text=CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1)
};
itemView.AddChidren(StatuBtn);
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
index 8ce7c2b..047aa8b 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
@@ -174,7 +174,7 @@
return;
}
deviceUI.CommonDevice.IsOnline = common.IsOnline;
- OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
+ //OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
deviceUI.CommonDevice.LastDateTime = DateTime.Now;
}
catch (Exception ex)
@@ -348,7 +348,7 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
+ Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1)
};
itemView.AddChidren(StatuBtn);
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs
index d8ca61a..0e6a0af 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs
@@ -167,7 +167,7 @@
return;
}
deviceUI.CommonDevice.IsOnline = common.IsOnline;
- deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1;
+ //deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1;
deviceUI.CommonDevice.LastDateTime = DateTime.Now;
}
catch (Exception ex)
@@ -341,7 +341,7 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
+ Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1)
};
itemView.AddChidren(StatuBtn);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
index e2355c2..e297d7b 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
@@ -1440,94 +1440,116 @@
case DeviceType.TemperatureSensor:
{
string current = Language.StringByID(MyInternationalizationString.current);
- devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 * 2 - 20 - 50);
- devicefra.Height = Application.GetRealHeight(140 + 160 * 2 + 20 + 50);
+ devicefra.Y = Application.GetRealHeight(1920 - 140 - 600);
+ devicefra.Height = Application.GetRealHeight(140 + 600);
var temperatureSensor = common as TemperatureSensor;
- var Btntemperaturevalue = new Button
+ SelectedDeviceStatuscondition = "TemperatureSensor";
+ #region 甯冨眬View
+ var PickerViewfra = new FrameLayout
{
- TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
- Height = Application.GetRealHeight(60),
- Width = Application.GetRealWidth(400),
- TextAlignment = TextAlignment.CenterLeft,
- X = Application.GetRealWidth(80),
- Y = timetype.Bottom + Application.GetRealHeight(70),
- TextSize = 14,
+ Y = Application.GetRealHeight(140),
+ Height = Application.GetRealHeight(600),
};
- devicefra.AddChidren(Btntemperaturevalue);
+ devicefra.AddChidren(PickerViewfra);
- var horizontalSeekBarVol = new DiyImageSeekBar
+
+ var mUIPickerView = new UIPickerView
{
- Y = timetype.Bottom + Application.GetRealHeight(70 + 60 + 70),
- X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(920),
- Height = Application.GetRealHeight(160),
- IsProgressTextShow = false,//鏄剧ず鐧惧垎姣�
- IsClickable = true,//杩涘害鏉℃槸鍚︽粦鍔�
- ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
- ThumbImagePath = "ZigeeLogic/progressbtn_2.png",//杩涘害鏉℃寜閽浘鏍�
- ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
- ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊
- //ProgressTextSize = 13,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏�
- SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
+ Height = Application.GetRealHeight(600 - 5),
};
- devicefra.AddChidren(horizontalSeekBarVol);
+ PickerViewfra.AddChidren(mUIPickerView);
- EventHandler<int> progressclick = (sender, e) =>
+ var mList1 = new List<string> { ">", "<", "=", "鈮�", "鈮�" };
+ var mList2 = new List<string>();
+ var mList3 = new List<string>();
+ for (int i = 1; i <=100; i++)
{
-
- SelectedDeviceStatuscondition = "TemperatureSensor";
- if (temperatureSensor.SensorDiv == 1)
- {
- dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());
-
- Btntemperaturevalue.Text = current + ">" + horizontalSeekBarVol.Progress.ToString() + "鈩�";
-
- }
- else
- {
- Btntemperaturevalue.Text = current + "<" + horizontalSeekBarVol.Progress.ToString() + "%";
- dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());//娓╁害鍊�
- }
-
- };
- horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
- horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
-
-
- if (temperatureSensor.SensorDiv == 1)
- {
+ mList2.Add(i.ToString());
+ }
+ if (temperatureSensor.SensorDiv == 1) {
+ mList3.Add("鈩�");
dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
dictionary(deviceConditionsInfo, "AttriButeId", "0");
- dictionary(deviceConditionsInfo, "Range", "0");//0澶т簬AttriButeData1鏃惰Е鍙戝姩浣�
- dictionary(deviceConditionsInfo, "AttriButeData1", "0");
+ dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
+ dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿娓╁害鍊�50鈩�
dictionary(deviceConditionsInfo, "AttriButeData2", "0");
- Btntemperaturevalue.Text = current + ">0鈩�";
-
- }
- else
- {
- Btntemperaturevalue.Text = current + "<0%";
+ } else {
+ mList3.Add("%");
dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
dictionary(deviceConditionsInfo, "AttriButeId", "0");
- dictionary(deviceConditionsInfo, "Range", "2");//2灏忎簬AttriButeData1鏃惰Е鍙戝姩浣�
- dictionary(deviceConditionsInfo, "AttriButeData1", "0");//娓╁害鍊�
+ dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
+ dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿婀垮害鍊�50%
dictionary(deviceConditionsInfo, "AttriButeData2", "0");
}
+ mUIPickerView.setNPicker(mList1, mList2, mList3);
+ #endregion
+
+ mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
+ {
+ SelectedDeviceStatuscondition = "TemperatureSensor";
+ dictionary(deviceConditionsInfo, "AttriButeData1", mList2[s2]);
+ switch (mList1[s1])
+ {
+ case ">": {
+ dictionary(deviceConditionsInfo, "Range", "0");
+ } break;
+ case "<": {
+ dictionary(deviceConditionsInfo, "Range", "2");
+ } break;
+ case "=": {
+ dictionary(deviceConditionsInfo, "Range", "1");
+ } break;
+ case "鈮�": {
+ dictionary(deviceConditionsInfo, "Range", "6");
+ } break;
+ case "鈮�": {
+ dictionary(deviceConditionsInfo, "Range", "7");
+ } break;
+ }
+ };
+
+ //榛樿=,50
+ int index1 = 2, index2 = 49;
if (edit && devices != null)
{
- horizontalSeekBarVol.Progress = int.Parse(devices["AttriButeData1"]);
- if (temperatureSensor.SensorDiv == 1)
+ SelectedDeviceStatuscondition = "";
+ string s = "";
+ switch (devices["Range"])
{
-
- Btntemperaturevalue.Text = current + ">" + devices["AttriButeData1"] + "鈩�";
-
+ case "0":
+ {
+ s = ">";
+ }
+ break;
+ case "1":
+ {
+ s = "=";
+ }
+ break;
+ case "2":
+ {
+ s = "<";
+ }
+ break;
+ case "6":
+ {
+ s = "鈮�";
+ }
+ break;
+ case "7":
+ {
+ s = "鈮�";
+ }
+ break;
}
- else
- {
- Btntemperaturevalue.Text = current + "<" + devices["AttriButeData1"] + "%";
- }
+ //鏌ユ壘绱㈠紩
+ index1 = mList1.IndexOf(s);
+ index2 = mList2.IndexOf(devices["AttriButeData1"]);
+
}
+ ///鏇存柊鏈�鏂扮姸鎬侊紱
+ mUIPickerView.setCurrentItems(index1, index2, 0);
}
break;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
index d4470ad..74ba416 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
@@ -94,7 +94,17 @@
//鍏抽棴鍒锋柊View锛�
middle.EndHeaderRefreshing();
};
- Read();
+ //Read();
+ CommonPage.Loading.Start();
+ new System.Threading.Thread(() =>
+ {
+ Application.RunOnMainThread(() =>
+ {
+ Read();
+ CommonPage.Loading.Hide();
+ });
+ })
+ { IsBackground = true }.Start();
}
/// <summary>
@@ -116,7 +126,7 @@
CommonPage.Loading.Start();
if (!d)
{
- var allMemberslist = await Send.AllMembers(Send.CurrentDoorLock.DeviceAddr);
+ var allMemberslist = await Send.AllMembers(macport);
Send.LockList.AddRange(allMemberslist);
}
UserAllView(macport);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
index 568e567..96f0799 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
@@ -1058,15 +1058,15 @@
var horizontalSeekBarVol = new DiyImageSeekBar
{
Y = openrowlayout.Bottom,
+ X = Application.GetRealWidth(80),
Width = Application.GetRealWidth(920),
Height = Application.GetRealHeight(160),
- X = Application.GetRealWidth(80),
IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
- ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+ ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊
ProgressTextSize = 13,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏�
SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
};
@@ -1360,15 +1360,15 @@
var horizontalSeekBarVol = new DiyImageSeekBar
{
Y = openrowlayout.Bottom,
+ X = Application.GetRealWidth(80),
Width = Application.GetRealWidth(920),
Height = Application.GetRealHeight(160),
- X = Application.GetRealWidth(80),
IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
- ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+ ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊
ProgressTextSize = 13,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏�
SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
};
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
index cdf1612..be44d89 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -758,22 +758,54 @@
}
break;
case DeviceType.TemperatureSensor:
- // conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png";
+ // conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png";
var dev = deviceinof as TemperatureSensor;
- if (conditions["Cluster_ID"]=="1026") {
+ if (conditions["Cluster_ID"] == "1026")
+ {
dev.SensorDiv = 1;
- } else {
+ }
+ else
+ {
dev.SensorDiv = 2;
+ }
+ string s = "";
+ switch (conditions["Range"])
+ {
+ case "0":
+ {
+ s = ">";
+ }
+ break;
+ case "1":
+ {
+ s = "=";
+ }
+ break;
+ case "2":
+ {
+ s = "<";
+ }
+ break;
+ case "6":
+ {
+ s = "鈮�";
+ }
+ break;
+ case "7":
+ {
+ s = "鈮�";
+ }
+ break;
}
if (conditions["Cluster_ID"] == "1026")
{
conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png";
- devicestatus.Text = ">" + conditions["AttriButeData1"] + "鈩�";
+ devicestatus.Text = s + conditions["AttriButeData1"] + "鈩�";
}
else
{
conditionIcon.UnSelectedImagePath = "ZigeeLogic/humidity.png";
- devicestatus.Text = "<" + conditions["AttriButeData1"] + "%";
+ devicestatus.Text = s + conditions["AttriButeData1"] + "%";
}
break;
@@ -1960,7 +1992,7 @@
}
Common.Logic.CurrentLogic.LogicName = name;
-
+ bool succeed = false;
//鍒ゆ柇鏄柊娣诲姞閫昏緫(榛樿0)杩樻槸淇敼閫昏緫
CommonPage.Loading.Start();
if (Common.Logic.CurrentLogic.LogicId == 0)
@@ -1969,6 +2001,7 @@
var logicifon = await Send.AddModifyLogic(Common.Logic.CurrentLogic);
if (logicifon != null && logicifon.LogicId != 0)
{
+ succeed = true;
Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
}
@@ -1976,10 +2009,20 @@
else
{
//鍙戦�佷慨鏀归�昏緫鍛戒护
- Send.AddModifyLogic(Common.Logic.CurrentLogic);
+ var modlogic=Send.AddModifyLogic(Common.Logic.CurrentLogic);
+ //缂栬緫榛樿鎴愬姛锛堜笉鑰冭檻缃戠粶鎯呭喌锛夛紱
+ succeed = true;
}
-
CommonPage.Loading.Hide();
+
+ if (!succeed)//succeed鏍囪鏄坊鍔犳垚鍔熻繕鏄け璐�
+ {
+ //缃戝叧鍥炲澶辫触锛屼笉鍏抽棴鐣岄潰锛岃瀹冨仠鐣欏綋鍓嶇晫闈紱
+ //锛堝師鍥狅細鑰冭檻鍒板け璐ラ噸鏂扮紪杈戝師鏉ユ暟鎹粰鐢ㄦ埛甯︽潵浜嗛夯鐑︼級
+ ///鎻愮ず锛氭坊鍔犺嚜鍔ㄥ寲澶辫触锛�
+ //TipView("娣诲姞鑷姩鍖栧け璐�");
+ //return;
+ }
UserView.HomePage.Instance.RemoveViewByTag("Logic");
Category.Category.instance?.RefreshBodyView();
@@ -2479,5 +2522,46 @@
};
}
+ /// <summary>
+ /// 闂幇鎻愮ず妗嗙殑鏂规硶
+ /// </summary>
+ /// <param name="tipText">鎻愮ず鍐呭</param>
+ /// <param name="second">鍋滅暀鏃堕棿鍗曚綅涓簊</param>
+ public void TipView(string tipText, int second = 1)
+ {
+
+ var frameLayout = new FrameLayout { BackgroundColor = 0x50000000 };
+ this.AddChidren(frameLayout);
+
+ var btn = new Button
+ {
+ Gravity = Gravity.Center,
+ Text = tipText,
+ BackgroundColor = 0xff1f1f1f,
+ Width = Application.GetRealWidth(500),
+ Height = Application.GetRealHeight(100),
+ Radius = (uint)Application.GetRealHeight(50),
+ };
+ frameLayout.AddChidren(btn);
+
+ var dateTime1 = DateTime.Now;
+ new System.Threading.Thread(() =>
+ {
+ Application.RunOnMainThread(() =>
+ {
+ while (true)
+ {
+ if ((DateTime.Now - dateTime1).TotalMilliseconds > second * 1000)
+ {
+ //榛樿涓�绉掑叧闂�
+ frameLayout.RemoveFromParent();
+ break;
+ }
+ }
+ });
+ })
+ { IsBackground = true }.Start();
+
+ }
}
}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
index 1db0408..27130ce 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
@@ -1040,7 +1040,7 @@
};
openrowlayout.AddChidren(btnopen);
- var openBtnSelected = new SelectedButton();
+ var openBtnSelected = new SelectedButton();
openrowlayout.AddChidren(openBtnSelected);
var horizontalSeekBarRow = new RowLayout
@@ -1049,7 +1049,7 @@
Width = Application.GetRealWidth(920),
Height = Application.GetRealHeight(160),
X = Application.GetRealWidth(80),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
openframelayout.AddChidren(horizontalSeekBarRow);
var horizontalSeekBarVol = new DiyImageSeekBar
@@ -1142,7 +1142,6 @@
int Progressvalue = 100;
EventHandler<int> progressclick = (sender, e) =>
{
- Console.WriteLine("12345");
SelectedDeviceStatusaction = "yes";
Progressvalue = horizontalSeekBarVol.Progress;
if (switchdictionary.ContainsKey("TaskType"))
@@ -1357,8 +1356,8 @@
openframelayout.AddChidren(horizontalSeekBarRow);
var horizontalSeekBarVol = new DiyImageSeekBar
{
- X = Application.GetRealWidth(80),
Y = openrowlayout.Bottom,
+ X = Application.GetRealWidth(80),
Width = Application.GetRealWidth(920),
Height = Application.GetRealHeight(160),
IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
@@ -1366,9 +1365,9 @@
ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
- ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+ ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊
ProgressTextSize = 14,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏�
- SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
+ SeekBarViewHeight = Application.GetRealHeight(10),
};
openframelayout.AddChidren(horizontalSeekBarVol);
@@ -1747,7 +1746,7 @@
}
}
break;
-
+ ///绌鸿皟
case DeviceType.Thermostat:
{
@@ -1882,8 +1881,7 @@
var closeBtnSelected = new SelectedButton();
closerowlayout.AddChidren(closeBtnSelected);
#endregion
-
-
+
mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
{
@@ -1902,12 +1900,13 @@
}
};
-
- #endregion
+
+ #endregion
//榛樿26,鑷姩,涓
int indextemperature = 10, indexmode = 2, indexspeed = 1;
if (edit && TaskList != null)
{
+
foreach (var value in TaskList)
{
if (TaskList.Count == 1)
@@ -2049,6 +2048,7 @@
///鍙栨秷浜嬩欢
EventHandler<MouseEventArgs> closeclick = (sender, e) =>
{
+
//娓呴櫎涔嬪墠鏁版嵁锛�
taskListInfo.Clear();
dictionary(modedictionary, "TaskType", "5");
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
index c3b8852..312084c 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -99,7 +99,18 @@
//鍏抽棴鍒锋柊View锛�
middle.EndHeaderRefreshing();
};
- Read();
+ //Read();
+
+ CommonPage.Loading.Start();
+ new System.Threading.Thread(() =>
+ {
+ Application.RunOnMainThread(() =>
+ {
+ Read();
+ CommonPage.Loading.Hide();
+ });
+ })
+ { IsBackground = true }.Start();
}
/// <summary>
/// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱
@@ -119,14 +130,12 @@
}
}
- CommonPage.Loading.Start();
if (!d)
{
- var allMemberslist = await Send.AllMembers(common.DeviceAddr);
+ var allMemberslist = await Send.AllMembers(macport);
Send.LockList.AddRange(allMemberslist);
}
UserList(macport);
- CommonPage.Loading.Hide();
}
/// <summary>
/// 鎴愬憳鍒楄〃鐨勬柟娉�
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
index 21c171d..146fa54 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -743,7 +743,7 @@
/// <summary>
/// 鑾峰彇鑷繁+鍏朵粬鎴愬憳淇℃伅
/// </summary>
- /// <param name="doorlockMac">闂ㄩ攣Mac</param>
+ /// <param name="doorlockMac">闂ㄩ攣Mac+绔彛</param>
/// <returns></returns>
public static async System.Threading.Tasks.Task<List<MembershipIfon>> AllMembers(string doorlockMac)
{
@@ -881,7 +881,7 @@
{
string s = null;
var str = await WebClientAsync(0, CommonPage.RequestHttpsHost + "/App/GetHomePager");//涓嶅悓鍖哄煙鍩熷悕鍓嶇紑涓嶄竴鏍�
- // var str = await WebClientAsync(0, "https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager");
+ // var str = await WebClientAsync(0, "https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager");
var jObject = JObject.Parse(str);
if (jObject == null || jObject["StateCode"].ToString() != "Success")
{
@@ -976,7 +976,7 @@
postValues.Add("RequestVersion", CommonPage.RequestVersion);
postValues.Add("LoginAccessToken", residential.Token);
postValues.Add("HomeId", residential.Id);
- postValues.Add("DoorLockId", residential.doorlockmac);//闂ㄩ攣Mac
+ postValues.Add("DoorLockId", residential.doorlockmac);//闂ㄩ攣Mac+绔彛
postValues.Add("IsOtherAccountCtrl", residential.IsOtherAccountCtrl.ToString());
postValues.Add("PageSetting.PageSize", Int32.MaxValue.ToString());
}
@@ -1095,5 +1095,39 @@
public static UserCenter.MemberInfoRes UserMemberInfoRes = null;
#endregion
+ #region 瀛樺彇鏈湴鏂囦欢鐨勬柟娉� ---鏆傛椂涓嶇敤鍚堝苟璇ユ柟娉�---
+ /// <summary>
+ /// 鏂囦欢淇濆瓨
+ /// </summary>
+ /// <param name="FileName">鏂囦欢璺緞</param>
+ /// <param name="obj">闇�瑕佸簭鍒楀寲鏁版嵁</param>
+ public static void SaveLocalFile(string FileName, object obj)
+ {
+ //鍏堝簭鍒楀寲鏁版嵁锛�
+ var data = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
+ //鏁版嵁杞崲涓哄瓧鑺傛祦锛�
+ var byteData = System.Text.Encoding.UTF8.GetBytes(data);
+ //鍐欏叆鏁版嵁锛�
+ Shared.IO.FileUtils.WriteFileByBytes(FileName, byteData);
+ }
+
+ /// <summary>
+ /// 鏂囦欢璇诲彇
+ /// </summary>
+ /// <param name="FileName">鏂囦欢璺緞</param>
+ /// <returns></returns>
+ public static string ReadLocalFile(string FileName)
+ {
+ if (System.IO.File.Exists(FileName) == false)
+ {
+ ///鍒ゆ柇鏄惁鏈夋枃浠�;
+ return null;
+ }
+ //璇诲嚭淇濆瓨璇ヨ矾寰勭殑鏂囦欢锛�
+ var varByte = Shared.IO.FileUtils.ReadFile(FileName);
+ //瀛楄妭娴佽浆鎹负瀛楃涓诧紱
+ return System.Text.Encoding.UTF8.GetString(varByte);
+ }
+ #endregion
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
old mode 100644
new mode 100755
index e2faa2d..e1f7466
--- a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
@@ -246,31 +246,31 @@
{
#if iOS
try
- {
- CommonPage.Loading.Start();
- var versionResult = await RequestHttpsiOSAppVersionAsync();
- if (versionResult == null || versionResult.Results == null)
- {
- return false;
- }
- var results = Newtonsoft.Json.Linq.JArray.Parse(versionResult.Results.ToString());
- if (results[0] == null)
- {
- return false;
- }
- var newVersion = results[0]["version"]?.ToString();
- var updateContent = results[0]["releaseNotes"]?.ToString();
- if (newVersion != CommonPage.CodeIDString)
- {
- return true;
- }
- return false;
- }
- catch
- {
- return false;
-
- }
+ {
+ CommonPage.Loading.Start();
+ var versionResult = await RequestHttpsiOSAppVersionAsync();
+ if (versionResult == null || versionResult.Results == null)
+ {
+ return false;
+ }
+ var results = Newtonsoft.Json.Linq.JArray.Parse(versionResult.Results.ToString());
+ if (results[0] == null)
+ {
+ return false;
+ }
+ var newVersion = results[0]["version"]?.ToString();
+ var updateContent = results[0]["releaseNotes"]?.ToString();
+ if (newVersion != CommonPage.CodeIDString)
+ {
+ return true;
+ }
+ retuun false;
+ }
+ catch
+ {
+ return false;
+
+ }
#elif Android
try
@@ -300,7 +300,7 @@
private async void UpdateVersion()
{
#if iOS
- OpenUrl();
+ CommonPage.Instance.OpenUrl();
#elif Android
try
{
@@ -351,7 +351,7 @@
/// 鑾峰彇iOS-APP鐗堟湰淇℃伅
/// </summary>
/// <returns>The https app version async.</returns>
- public async System.Threading.Tasks.Task<Common.ResponseEntity.ResultPack> RequestHttpsiOSAppVersionAsync()
+ public async System.Threading.Tasks.Task<ResponseEntity.ResultPack> RequestHttpsiOSAppVersionAsync()
{
try
{
@@ -361,7 +361,7 @@
{
return null;
}
- return Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResultPack>(Encoding.UTF8.GetString(result));
+ return Newtonsoft.Json.JsonConvert.DeserializeObject<ResponseEntity.ResultPack>(Encoding.UTF8.GetString(result));
}
catch
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Abount/SLAForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Abount/SLAForm.cs
index 43d8046..b8f594a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Abount/SLAForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Abount/SLAForm.cs
@@ -44,10 +44,11 @@
Width = Application.GetRealWidth(942),
Height = Application.GetRealHeight(800),
Text = Language.StringByID(R.MyInternationalizationString.SLA_Detail).Replace("{\\r\\n}","\r\n\r\n"),
- TextAlignment = TextAlignment.CenterLeft,
+ TextAlignment = TextAlignment.TopLeft,
TextColor = ZigbeeColor.Current.GXCTextColor,
IsMoreLines=true,
- TextSize = 12
+ TextSize = 12,
+
};
bodyFrameLayout.AddChidren(detail);
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs
index 65e77ea..2f3a945 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs
@@ -601,15 +601,21 @@
}
string statuCode = revertObj.StateCode;
- string errorMsg = "鎺ュ彛璁块棶澶辫触锛�" + requestName + " " + statuCode + " " + revertObj.ErrorInfo == null ? string.Empty : revertObj.ErrorInfo + "\r\n";
+ string errorInfo = revertObj.ErrorInfo == null ? string.Empty : revertObj.ErrorInfo;
+ string errorMsg = "鎺ュ彛璁块棶澶辫触锛�" + requestName + " " + statuCode + " " + errorInfo + "\r\n";
+
errorMsg += "褰撳墠婵�娲荤殑鐣岄潰锛�" + UserCenterResourse.NowActionFormID + "\r\n";
if (pra != null)
{
//搴忓垪鍖栧璞�
- var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(pra);
- errorMsg += "鍙傛暟锛歕r\n" + requestJson;
+ try
+ {
+ var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(pra);
+ errorMsg += "鍙傛暟锛歕r\n" + requestJson;
+ }
+ catch { errorMsg += "鍙傛暟锛氬簭鍒楀寲寮傚父锛�"; }
}
- HdlLogLogic.Current.WriteLog(-1, errorMsg);
+ HdlLogLogic.Current.WriteLog(-1, errorMsg + "\r\n");
//鍏遍�氱爜
if (statuCode == "ParameterOrEmpty")
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
index 22d6a8f..652c262 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
@@ -29,7 +29,14 @@
return m_Current;
}
}
-
+ /// <summary>
+ /// 娑堟伅鎺т欢鍗曞嚮鐨勪簨浠�
+ /// </summary>
+ public Action MsgClickEvent = null;
+ /// <summary>
+ /// 鐣岄潰鍏抽棴鐨勪簨浠�
+ /// </summary>
+ public Action CloseEvent = null;
/// <summary>
/// 瀹瑰櫒鎺т欢
/// </summary>
@@ -76,6 +83,7 @@
this.oldScrollEnabled = UserView.HomePage.Instance.ScrollEnabled;
UserView.HomePage.Instance.ScrollEnabled = false;
Shared.Common.CommonPage.BackKeyCanClick = false;
+
this.oldPrigressVisible = Common.CommonPage.Loading.Visible;
if (oldPrigressVisible == true)
{
@@ -103,6 +111,10 @@
btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
btnText.TextAlignment = TextAlignment.Center;
frameBack.AddChidren(btnText);
+ btnText.ButtonClickEvent += (sender, e) =>
+ {
+ this.MsgClickEvent?.Invoke();
+ };
//杩涘害鏉�
var btnProRow = new FrameLayout();
@@ -248,6 +260,10 @@
btnProgressView = null;
frameProgress = null;
btnProgressBar = null;
+ this.MsgClickEvent = null;
+ //鍏抽棴浜嬩欢
+ this.CloseEvent?.Invoke();
+ this.CloseEvent = null;
});
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
index 3af1925..a293155 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
@@ -49,6 +49,14 @@
/// 杩涘害鍊兼敼鍙�,濡傛灉瑕佽缃垵濮嬭繘搴﹀��,姝ゅ彉閲忚鍦ㄨ缃垵濮嬭繘搴﹀�间箣鍓嶈繘琛岃缃�(绗竴涓弬鏁�0:婊戝姩鐨勬椂鍊�,1:鎵嬫寚寮硅捣鐨勬椂鍊�)
/// </summary>
public Action<int, int> ProgressChangedEvent = null;
+ /// <summary>
+ /// 杩涘害鏉′簨浠剁殑瑙﹀彂鏃堕棿闂撮殧(榛樿娌℃湁闂撮殧)
+ /// </summary>
+ public int EventWaitTime = -1;
+ /// <summary>
+ /// 鍓嶅洖鏃堕棿
+ /// </summary>
+ private DateTime oldTime = DateTime.Now;
#endregion
@@ -92,6 +100,13 @@
this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
return;
}
+ //鏃堕棿闂撮殧
+ if (EventWaitTime != -1)
+ {
+ if ((DateTime.Now - oldTime).TotalMilliseconds < EventWaitTime) { return; }
+ oldTime = DateTime.Now;
+ }
+
this.ProgressChangedEvent(0, value);
}
@@ -107,6 +122,7 @@
this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
return;
}
+ //寮硅捣浜嬩欢涓嶉渶瑕佸垽鏂椂闂�
this.ProgressChangedEvent(1, value);
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs
index 425f9a8..f626800 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/IconViewControl.cs
@@ -5,7 +5,7 @@
namespace Shared.Phone.UserCenter
{
/// <summary>
- /// 鍋氭垚涓�涓樉绀哄浘鏍囩殑鎺т欢鉁�
+ /// 鍋氭垚涓�涓樉绀哄浘鏍囩殑鎺т欢(闇�瑕佹墜鍔ㄥ紑鍚偣鍑荤姸鎬�)
/// </summary>
public class IconViewControl : IconControlCommon
{
@@ -14,7 +14,7 @@
/// </summary>
public int IconSize = 0;
/// <summary>
- /// 鍋氭垚涓�涓樉绀哄浘鏍囩殑鎺т欢
+ /// 鍋氭垚涓�涓樉绀哄浘鏍囩殑鎺т欢(闇�瑕佹墜鍔ㄥ紑鍚偣鍑荤姸鎬�)
/// </summary>
/// <param name="size">澶у皬</param>
/// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs
index 22758c3..202c3c0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAlarmsLogic.cs
@@ -549,17 +549,17 @@
//鏆村姏寮�闂�
alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg5);
}
- else if (info.AlarmCode == 16)
+ else if (info.AlarmCode == 116)
{
//甯稿紑妯″紡寮�鍚�
alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg6);
}
- else if (info.AlarmCode == 17)
+ else if (info.AlarmCode == 117)
{
//甯稿紑妯″紡缁撴潫
alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg7);
}
- else if (info.AlarmCode == 32)
+ else if (info.AlarmCode == 132)
{
//闂ㄩ搩瑙﹀彂
alarmInfo.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg8);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs
index 0788c92..d986516 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs
@@ -420,12 +420,9 @@
nvc.Add("ManualBackupType", ManualBackupType.ToString());
nvc.Add("IsOtherAccountCtrl", Common.Config.Instance.isAdministrator.ToString());
- for (int i = 0; i < listPicFile.Count; i++)
- {
- string base64 = GetBase64Text(fullName);
- nvc.Add("UploadSubFileLists[" + i + "].BackupFileName", fileName);
- nvc.Add("UploadSubFileLists[" + i + "].BackupFileContent", base64);
- }
+ string base64 = GetBase64Text(fullName);
+ nvc.Add("UploadSubFileLists[0].BackupFileName", fileName);
+ nvc.Add("UploadSubFileLists[0].BackupFileContent", base64);
bool result = UpLoadBigBackupFileToDB("App/UploadHomeAppGatewaySubFiles", fullName, nvc);
if (result == false)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
index 51ed3a9..04af707 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -165,6 +165,11 @@
/// <param name="receiveData"></param>
private void DeviceAttributeReportPush(JObject receiveData)
{
+ if (this.dicDeviceEvent.Count == 0)
+ {
+ //娌℃湁娣诲姞鐩戝惉
+ return;
+ }
var deviceAddr = receiveData.Value<string>("DeviceAddr");
var deviceEpoint = receiveData.Value<int>("Epoint");
@@ -227,6 +232,11 @@
/// <param name="receiveData"></param>
private void DeviceOnlineChangePush (JObject receiveData)
{
+ if (this.dicDeviceEvent.Count == 0)
+ {
+ //娌℃湁娣诲姞鐩戝惉
+ return;
+ }
var tempDevice = new CommonDevice() { DeviceAddr = receiveData.Value<string>("DeviceAddr"), DeviceEpoint = receiveData.Value<int>("Epoint") };
tempDevice.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(receiveData["Data"]["IsOnline"].ToString());
@@ -470,14 +480,13 @@
/// <param name="comand"></param>
private void DeviceReportPush(CommonDevice common, ReceiveComandDiv comand)
{
+ if (this.dicDeviceEvent.Count == 0)
+ {
+ //娌℃湁娣诲姞鐩戝惉
+ return;
+ }
lock (this.dicDeviceEvent)
{
- if (this.dicDeviceEvent.Count == 0)
- {
- //娌℃湁娣诲姞鐩戝惉
- return;
- }
-
var list = new List<Action<CommonDevice>>();
foreach (string keys in this.dicDeviceEvent.Keys)
{
@@ -490,9 +499,9 @@
list.Add(this.dicDeviceEvent[keys]);
}
//鏈夊彲鑳藉湪鍥炶皟鍑芥暟涓Щ闄や簡浜嬩欢锛屽鑷存姤閿欙紝鎵�浠ュ厛鏀堕泦锛屽啀璋冪敤
- Application.RunOnMainThread(() =>
+ foreach (var action in list)
{
- foreach (var action in list)
+ Application.RunOnMainThread(() =>
{
try
{
@@ -501,11 +510,11 @@
catch (Exception ex)
{
//Log鍑哄姏
- string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + UserCenterResourse.NowActionFormID + "]";
+ string msg = "鎺ㄩ�侀敊璇�! 褰撳墠婵�娲荤殑鐣岄潰[" + UserCenterResourse.NowActionFormID + "]";
HdlLogLogic.Current.WriteLog(ex, msg);
}
- }
- });
+ });
+ }
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs
index f8d5139..4c1952b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlShardLogic.cs
@@ -835,9 +835,8 @@
if (roomTemp.BackgroundImageType != 0)
{
//鑷畾涔夌殑鍥剧墖,瀹冨瓨鍦ㄤ簬鏈湴,浣嗘槸瀹冩槸鍏ㄨ矾寰�
- string[] Arry = roomTemp.BackgroundImage.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
- listFile.Add(Arry[Arry.Length - 1]);
- this.AddShardFile(Arry[Arry.Length - 1]);
+ listFile.Add(roomTemp.BackgroundImage);
+ this.AddShardFile(roomTemp.BackgroundImage);
}
}
else
@@ -849,15 +848,13 @@
if (roomTemp.BackgroundImageType != 0)
{
//鍒犻櫎鑷畾涔夊浘鐗�
- string[] Arry = roomTemp.BackgroundImage.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
- listDelPic.Add(Arry[Arry.Length - 1]);
+ listDelPic.Add(roomTemp.BackgroundImage);
}
if (nowRoom.BackgroundImageType != 0)
{
//鑷畾涔夌殑鍥剧墖,瀹冨瓨鍦ㄤ簬鏈湴,浣嗘槸瀹冩槸鍏ㄨ矾寰�
- string[] Arry = nowRoom.BackgroundImage.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
- listFile.Add(Arry[Arry.Length - 1]);
- this.AddShardFile(Arry[Arry.Length - 1]);
+ listFile.Add(nowRoom.BackgroundImage);
+ this.AddShardFile(nowRoom.BackgroundImage);
}
//鍙樻洿鍥剧墖璁剧疆
roomTemp.BackgroundImageType = nowRoom.BackgroundImageType;
@@ -897,10 +894,9 @@
{
if (secene.IconPathType != 0)
{
- //鑷畾涔夌殑鍥剧墖,瀹冨瓨鍦ㄤ簬鏈湴,浣嗘槸瀹冩槸鍏ㄨ矾寰�
- string[] Arry = secene.IconPath.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
- listFile.Add(Arry[Arry.Length - 1]);
- this.AddShardFile(Arry[Arry.Length - 1]);
+ //鑷畾涔夌殑鍥剧墖,瀹冨瓨鍦ㄤ簬鏈湴
+ listFile.Add(secene.IconPath);
+ this.AddShardFile(secene.IconPath);
}
listFile.Add(secene.FileName);
@@ -1029,7 +1025,7 @@
if (memberShardInfo.dicAllShardKeys.ContainsKey(fileName) == false)
{
var result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeDataShare/AddShareData", false, info);
- if (string.IsNullOrEmpty(result) == true)
+ if (result == null)
{
return false;
}
@@ -1077,24 +1073,19 @@
nvc.Add("HouseDistributedMark", Common.Config.Instance.Home.Id);
nvc.Add("SubAccountDistributedMark", memberShardInfo.SubAccountDistributedMark);
nvc.Add("ShareDataBytes", Convert.ToBase64String(this.GetShardFileContent(fileName)));
- nvc.Add("IsOtherAccountCtrl", Common.Config.Instance.isAdministrator.ToString());
//杩藉姞鍏变韩
if (memberShardInfo.dicAllShardKeys.ContainsKey(fileName) == false)
{
- var result = this.UpLoadBigBackupFileToDB("ZigbeeDataShare/AddShareData", fullName, nvc);
- if (string.IsNullOrEmpty(result) == true)
- {
- return null;
- }
//杩欓噷鏈夌偣鐗规畩锛屾帴鍙f槸鐩存帴杩斿洖涓婚敭鍥炴潵鐨勶紝鑰屼笉鏄疛soin
+ var result = this.DoUpLoadBigBackupFileToDB("ZigbeeDataShare/AddShareData", fullName, nvc);
return result;
}
else
{
nvc.Add("DistributedMark", memberShardInfo.dicAllShardKeys[fileName]);
- var result = this.UpLoadBigBackupFileToDB("ZigbeeDataShare/EditShareData", fullName, nvc);
- if (result != "1")
+ var result = this.DoUpLoadBigBackupFileToDB("ZigbeeDataShare/EditShareData", fullName, nvc);
+ if (result == null)
{
return null;
}
@@ -1103,26 +1094,17 @@
}
/// <summary>
- /// 涓婁紶澶ф枃浠�
+ /// 鎵ц涓婁紶澶ф枃浠�
/// </summary>
/// <param name="RequestName">璇锋眰鎺ュ彛</param>
/// <param name="fullFileName">鏂囦欢鍚嶅瓧(鍚矾寰�)</param>
/// <param name="nvc"></param>
/// <returns></returns>
- private string UpLoadBigBackupFileToDB(string RequestName, string fullFileName, NameValueCollection nvc)
+ private string DoUpLoadBigBackupFileToDB(string RequestName, string fullFileName, NameValueCollection nvc)
{
string paramName = "file";
string contentType = "application/octet-stream";
string requestUrl = $"{CommonPage.RequestHttpsHost}/{RequestName}";
- //鍚敤绠$悊鍛樻潈闄�
- //if (Config.Instance.isAdministrator == true)
- //{
- // requestUrl = $"{Config.Instance.AdminRequestBaseUrl}/{RequestName}";
- //}
- //else
- //{
- // requestUrl = $"{CommonPage.RequestHttpsHost}/{RequestName}";
- //}
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
@@ -1132,6 +1114,8 @@
wr.Method = "POST";
wr.KeepAlive = true;
wr.Credentials = System.Net.CredentialCache.DefaultCredentials;
+
+ wr.Headers.Add(HttpRequestHeader.Authorization, Config.Instance.Token);
var rs = wr.GetRequestStream();
@@ -1171,23 +1155,24 @@
StreamReader reader2 = new StreamReader(stream2);
string result = reader2.ReadToEnd();
- if (RequestName == "ZigbeeDataShare/AddShareData")
- {
- return result;
- }
var data = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.ResponsePack>(result);
bool flage = UserCenterLogic.CheckNotEorrorMsg(data, requestUrl);
if (flage == true)
{
- return "1";
+ //缂栬緫鐨勬椂鍊欙紝杩欎釜涓滆タ浼氭槸null
+ return data.ResponseData == null ? "1" : data.ResponseData.ToString();
}
- return "0";
+
+ //Log鍑哄姏
+ IMessageCommon.Current.GetMsgByRequestName(RequestName, data, nvc);
+
+ return null;
}
catch
{
- return "-1";
+ return null;
}
finally
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index eaaeb52..929b8ce 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -814,7 +814,7 @@
try
{
//鏂紑杩滅▼Mqtt杩炴帴
- ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
+ await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
}
catch { }
@@ -871,9 +871,6 @@
//鍚屾浜戠鐨勭綉鍏砳d锛屽鏋滄湰鍦版嫢鏈変簯绔笉瀛樺湪鐨刬d锛屽垯琛ㄧず搴旇琚崲缁戜簡锛岀洿鎺ュ垹闄�
HdlGatewayLogic.Current.SynchronizeDbGateway();
}
-
- //鍒濆鍖栦綇瀹呭璞�
- Common.Config.Instance.Home = House.GetHouseByHouseId(Common.Config.Instance.HomeId);
//鍒濆鍖栨埧闂�(閮洩鍩庨偅杈逛笉鍋氬鐞�,闇�瑕佽繖閲岀壒娈婃墽琛屼竴姝�)
Room.RefreshAllRoomByLocation();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs
new file mode 100755
index 0000000..9396272
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayModuleUpdateForm.cs
@@ -0,0 +1,83 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.DeviceAirConditioner
+{
+ /// <summary>
+ /// 涓ぎ绌鸿皟鐨勬ā鍧楀崌绾х晫闈�
+ /// </summary>
+ public class ACZbGatewayModuleUpdateForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 璁惧mac鍦板潃
+ /// </summary>
+ private string deviceMac = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_deviceMac">璁惧mac鍦板潃</param>
+ public void ShowForm(string i_deviceMac)
+ {
+ this.deviceMac = i_deviceMac;
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAirConditioningModule));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ var frameBack = new FrameLayout();
+ frameBack.Height = Application.GetRealHeight(3);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(frameBack);
+
+ var listView = new VerticalListControl(29);
+ listView.Y = frameBack.Bottom;
+ listView.Height = bodyFrameLayout.Height - frameBack.Height;
+ listView.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(listView);
+
+ //鍗囩骇
+ var btnUpdate = new BottomClickButton();
+ btnUpdate.TextID = R.MyInternationalizationString.uLevelUp;
+ bodyFrameLayout.AddChidren(btnUpdate);
+ btnUpdate.ButtonClickEvent += (sender, e) =>
+ {
+ };
+ }
+
+ #endregion
+
+ private async void DoDeviceUpdate()
+ {
+ var listDevice = Common.LocalDevice.Current.GetDevicesByMac(this.deviceMac);
+ if (listDevice.Count == 0)
+ {
+ return;
+ }
+
+ }
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs
new file mode 100755
index 0000000..ce14a14
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/ACZbGatewayUpdateMenuForm.cs
@@ -0,0 +1,100 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter.DeviceAirConditioner
+{
+ /// <summary>
+ /// 涓ぎ绌鸿皟鐨勫崌绾ц彍鍗曠晫闈�
+ /// </summary>
+ public class ACZbGatewayUpdateMenuForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 璁惧mac鍦板潃
+ /// </summary>
+ private string deviceMac = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_deviceMac">璁惧mac鍦板潃</param>
+ /// <param name="hadNewVersion">鎷ユ湁鏂扮増鏈�</param>
+ public void ShowForm(string i_deviceMac, bool hadNewVersion)
+ {
+ this.deviceMac = i_deviceMac;
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFirmwareUpdate));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame(hadNewVersion);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame(bool hadNewVersion)
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ var frameBack = new FrameLayout();
+ frameBack.Height = Application.GetRealHeight(8);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(frameBack);
+
+ var listView = new VerticalListControl(12);
+ listView.Y = frameBack.Bottom;
+ listView.Height = bodyFrameLayout.Height;
+ listView.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(listView);
+
+ var btnNewVersion = new PicViewControl(78, 55);
+ //閫氫俊鑺墖
+ var rowComunication = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowComunication);
+ rowComunication.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCommunicationChip), 600);
+ rowComunication.AddRightArrow();
+ rowComunication.AddBottomLine();
+ rowComunication.ButtonClickEvent += (sender, e) =>
+ {
+ //杩欓噷鏄澶囩殑Ota鍗囩骇
+ btnNewVersion.Visible = false;
+ var form = new Device.DeviceFirmwareUpdateForm();
+ form.AddForm(this.deviceMac);
+ };
+ //鎻愮ず鏈夋柊鐗堟湰
+ btnNewVersion.UnSelectedImagePath = "Item/NewVersion.png";
+ btnNewVersion.Visible = hadNewVersion;
+ btnNewVersion.X = Application.GetRealWidth(242);
+ btnNewVersion.Y = Application.GetRealHeight(23);
+ rowComunication.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
+
+ //绌鸿皟妯″潡
+ var rowModel = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowModel);
+ rowModel.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uAirConditioningModule), 600);
+ rowModel.AddRightArrow();
+ rowModel.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new ACZbGatewayModuleUpdateForm();
+ form.AddForm(deviceMac);
+ };
+
+ //璋冩暣鍒楄〃楂樺害
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ #endregion
+ }
+}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
index 15f40b7..584adc1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -567,8 +567,8 @@
Y = Application.GetMinRealAverage(46),
Width = Application.GetMinRealAverage(81),
Height = Application.GetMinRealAverage(81),
- UnSelectedImagePath = scene.IconPath,
- };
+ UnSelectedImagePath = "Scene/SceneIcon.png"
+ };
rowLayout.AddChidren(devicePic);
var btnBindName = new Button()
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
index 3779405..03b207f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
@@ -33,6 +33,7 @@
Width = Application.GetRealWidth(1080 - 161),
Height = Application.GetRealWidth(69),
TextSize = 17,
+ IsBold = true
};
public FrameLayout btnBackFrameLayout = new FrameLayout
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
index bc46f31..0b8eb69 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -441,10 +441,10 @@
}
if (isExistScene)
{
- curSceneUI = Room.CurrentRoom.GetSceneUIBySceneId(bindDevice.BindScenesId);
+ curSceneUI = Room.CurrentRoom.GetSceneUIBySceneId(bindDevice.BindScenesId);
+ devicePic.UnSelectedImagePath = "Scene/SceneIcon.png";
if (curSceneUI == null)
{
- devicePic.UnSelectedImagePath = "Scene/SceneIcon.png";
if (string.IsNullOrEmpty(bindDevice.ESName))
{
btnBindName.Text = Language.StringByID(R.MyInternationalizationString.OffLineScene) + "_" + "ID" + "_" + bindDevice.BindScenesId.ToString();
@@ -456,7 +456,6 @@
}
else
{
- devicePic.UnSelectedImagePath = curSceneUI.IconPath;
btnBindName.Text = curSceneUI.Name;
if (curSceneUI.GetZone() != null)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
index 10cf90f..4981897 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
@@ -23,13 +23,17 @@
/// </summary>
private CurtainData curtainData = null;
/// <summary>
- /// 鍏佽鎺ユ敹涓婇檺浣�(0:涓嶅厑璁� 1:鍏佽)
+ /// 鎺ユ敹寮�闄愪綅 false:娌℃湁鎺ユ敹鍒� true:宸茬粡鎺ユ敹鍒�
/// </summary>
- private string receiveUplimit = "0";
+ private bool receiveOpenlimit = false;
/// <summary>
- /// 鍏佽鎺ユ敹涓嬮檺浣�(0:涓嶅厑璁� 1:鍏佽)
+ /// 鎺ユ敹鍚堥檺浣� false:娌℃湁鎺ユ敹鍒� true:宸茬粡鎺ユ敹鍒�
/// </summary>
- private string receiveDownLimit = "0";
+ private bool receiveCloseLimit = false;
+ /// <summary>
+ /// 鍙戦�佸尯鍒� 1:寮�闄愪綅 2:鍚堥檺浣�
+ /// </summary>
+ private int sendDiv = 0;
/// <summary>
/// 鏄惁澶囦唤绐楀笜鏁版嵁
/// </summary>
@@ -41,11 +45,11 @@
/// <summary>
/// 寮�闄愪綅鐨勮繘搴︽潯
/// </summary>
- private HorizontalSeekBar openSeekBar = null;
+ private SeekBarControl openSeekBar = null;
/// <summary>
/// 鍚堥檺浣嶇殑杩涘害鏉�
/// </summary>
- private HorizontalSeekBar closeSeekBar = null;
+ private SeekBarControl closeSeekBar = null;
#endregion
@@ -101,15 +105,7 @@
this.AddLimitRow();
//娣诲姞閲嶇疆鐢垫満琛�
this.AddElectricalMachineryRow();
- //淇濆瓨
- var btnSave = new BottomClickButton();
- btnSave.TextID = R.MyInternationalizationString.uSave;
- bodyFrameLayout.AddChidren(btnSave);
- btnSave.ButtonClickEvent += (sender, e) =>
- {
- //杩欎釜淇濆瓨娌″暐鎰忎箟
- this.CloseForm();
- };
+
//闄愪綅鏁版嵁鎺ユ敹
this.ReceiveLimitData();
});
@@ -170,7 +166,7 @@
private void AddLimitRow()
{
var frameBack = new FrameLayout();
- frameBack.Height = Application.GetRealHeight(679);
+ frameBack.Height = Application.GetRealHeight(956);
var rowLimit = new FrameRowControl(listView.rowSpace / 2);
rowLimit.UseClickStatu = false;
@@ -188,7 +184,7 @@
{
btnRinght.IsSelected = !btnRinght.IsSelected;
//灞曞紑鎶樺彔
- frameBack.Height = frameBack.Height > 10 ? 0 : Application.GetRealHeight(679);
+ frameBack.Height = frameBack.Height > 10 ? 0 : Application.GetRealHeight(956);
};
//搴曠嚎
rowLimit.AddBottomLine();
@@ -200,6 +196,10 @@
this.AddCloseLimitProgress(frameBack);
}
+ #endregion
+
+ #region 鈻� 寮�闄愪綅琛宊__________________________
+
/// <summary>
/// 娣诲姞寮�闄愪綅杩涘害鏉�
/// </summary>
@@ -209,7 +209,7 @@
//寮�闄愪綅
var btnProgressView = new NormalViewControl(200, 50, true);
btnProgressView.X = ControlCommonResourse.XXLeft;
- btnProgressView.Y = Application.GetRealHeight(60);
+ btnProgressView.Y = Application.GetRealHeight(78);
btnProgressView.TextSize = 12;
btnProgressView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnProgressView.TextID = R.MyInternationalizationString.uOpenLimit;
@@ -224,15 +224,9 @@
btnProgress1.Text = progressValue + "%";
frameBack.AddChidren(btnProgress1);
//杩涘害鏉�
- this.openSeekBar = new HorizontalSeekBar();
+ this.openSeekBar = new SeekBarControl(965);
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.ProgressBarColor = 0xff288bfd;
openSeekBar.Progress = progressValue;
frameBack.AddChidren(openSeekBar);
@@ -254,78 +248,134 @@
//绾�
var btnLine = new NormalViewControl(frameBack.Width - ControlCommonResourse.XXLeft * 2, ControlCommonResourse.BottomLineHeight, false);
btnLine.X = ControlCommonResourse.XXLeft;
- btnLine.Y = btnTemp2.Bottom + Application.GetRealHeight(69);
+ btnLine.Y = btnTemp2.Bottom + Application.GetRealHeight(156);
btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
frameBack.AddChidren(btnLine);
- int oldValue = progressValue;
- int waitTime = 4;//500姣涓哄崟浣�
- bool startWait = false;
- bool checking = false;
- openSeekBar.ProgressChanged += (sender, value) =>
+ //鍑忓彿
+ var btnMinus = new IconViewControl(104);
+ btnMinus.UseClickStatu = true;
+ btnMinus.X = Application.GetRealWidth(847);
+ btnMinus.Y = Application.GetRealHeight(46);
+ btnMinus.UnSelectedImagePath = "Item/MinusSign2.png";
+ btnMinus.SelectedImagePath = "Item/MinusSign2Selected.png";
+ frameBack.AddChidren(btnMinus);
+ btnMinus.ButtonClickEvent += (sender, e) =>
{
- //鍊肩户缁敼鍙�,鍒欑瓑寰呮椂闂磋繕鍘�
- waitTime = 4;
+ if (openSeekBar.Progress <= 0)
+ {
+ return;
+ }
+ openSeekBar.Progress -= 1;
+ openSeekBar.ProgressChangedEvent(1, openSeekBar.Progress);
+ };
+
+ //鍔犲彿
+ var btnPlus = new IconViewControl(104);
+ btnPlus.UseClickStatu = true;
+ btnPlus.X = btnMinus.Right;
+ btnPlus.Y = btnMinus.Y;
+ btnPlus.UnSelectedImagePath = "Item/PlusSign2.png";
+ btnPlus.SelectedImagePath = "Item/PlusSign2Selected.png";
+ frameBack.AddChidren(btnPlus);
+ btnPlus.ButtonClickEvent += (sender, e) =>
+ {
+ if (openSeekBar.Progress >= 100)
+ {
+ return;
+ }
+ openSeekBar.Progress += 1;
+ openSeekBar.ProgressChangedEvent(1, openSeekBar.Progress);
+ };
+
+ //淇濆瓨
+ var btnSave = new NormalViewControl(150, 60, true);
+ btnSave.X = Application.GetRealWidth(906);
+ btnSave.Y = btnTemp1.Bottom + Application.GetRealHeight(68);
+ btnSave.TextAlignment = TextAlignment.Center;
+ btnSave.TextID = R.MyInternationalizationString.uSave;
+ btnSave.TextColor = UserCenterColor.Current.TextOrangeColor;
+ frameBack.AddChidren(btnSave);
+ btnSave.ButtonClickEvent += (sender, e) =>
+ {
+ if (this.receiveOpenlimit == true)
+ {
+ //纭寮�闄愪綅鐐�
+ this.SaveOpenLimit();
+ }
+ };
+
+ int oldProValue = curtainData.OpenLimitPersent;
+ openSeekBar.ProgressChangedEvent += (div, value) =>
+ {
//寮�闄愪綅涓嶈兘澶т簬鍚堥檺浣�
if (value > closeSeekBar.Progress)
{
openSeekBar.Progress = closeSeekBar.Progress;
return;
}
- if (checking == false)
- {
- startWait = true;
- }
-
btnProgress1.Text = value + "%";
//鏁版嵁鍙樻洿,鐧惧垎姣�
curtainData.OpenLimitPersent = value;
};
+
HdlThreadLogic.Current.RunThread(async () =>
{
+ //澶勭悊涓�
+ bool checking = false;
while (openSeekBar.Parent != null)
{
- if (startWait == false)
+ int nowValue = curtainData.OpenLimitPersent;
+ if (oldProValue == nowValue || checking == true)
{
- await Task.Delay(200);
+ //鍊间笉绛夋墠澶勭悊
+ await Task.Delay(500);
continue;
}
- //寮�鍚�兼敼鍙樼瓑寰�
- await Task.Delay(500);
- waitTime--;
- if (waitTime <= 0)
+ oldProValue = nowValue;
+ checking = true;
+ if (curtainData.DeleteOpenLimit == true)
{
- //濡傛灉2绉掑唴鍊间笉鍐嶆敼鍙�,鍒欒繘琛屽垽鏂�
- startWait = false;
- checking = true;
-
- var value = curtainData.OpenLimitPersent;
- if (oldValue == value)
+ //閲嶇疆寮�闄愪綅鐐�
+ var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.UpLimit);
+ if (result == false)
{
- //鐩稿悓鏁板��
checking = false;
continue;
}
- oldValue = value;
- if (curtainData.DeleteOpenLimit == true)
- {
- //閲嶇疆寮�闄愪綅鐐�
- var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.UpLimit);
- if (result == false)
- {
- checking = false;
- continue;
- }
- curtainData.DeleteOpenLimit = false;
- }
- receiveUplimit = "1";
- //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
- curtainDevice.WcdGoToTiltValue(value);
- checking = false;
+ curtainData.DeleteOpenLimit = false;
}
+ //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
+ this.sendDiv = 1;
+ curtainDevice.WcdGoToTiltValue(nowValue);
+ checking = false;
}
});
}
+
+ /// <summary>
+ /// 纭寮�闄愪綅鐐�
+ /// </summary>
+ private void SaveOpenLimit()
+ {
+ //纭褰撳墠浣嶇疆涓哄紑闄愪綅?
+ string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainOpenLimitMsg);
+ this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
+ {
+ //鎵ц纭鍙婅鐩栦笂闄愪綅鐐�
+ var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
+ curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
+ if (result == true)
+ {
+ curtainData.DeleteOpenLimit = true;
+ this.receiveOpenlimit = false;
+ }
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鍚堥檺浣嶈___________________________
/// <summary>
/// 娣诲姞鍚堥檺浣嶈繘搴︽潯
@@ -336,7 +386,7 @@
//鍚堥檺浣�
var btnProgressView = new NormalViewControl(200, 50, true);
btnProgressView.X = ControlCommonResourse.XXLeft;
- btnProgressView.Y = Application.GetRealHeight(397);
+ btnProgressView.Y = Application.GetRealHeight(536);
btnProgressView.TextSize = 12;
btnProgressView.TextColor = UserCenterColor.Current.TextGrayColor1;
btnProgressView.TextID = R.MyInternationalizationString.uCloseLimit;
@@ -351,15 +401,9 @@
btnProgress1.Text = progressValue + "%";
frameBack.AddChidren(btnProgress1);
//杩涘害鏉�
- this.closeSeekBar = new HorizontalSeekBar();
+ this.closeSeekBar = new SeekBarControl(965);
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.ProgressBarColor = 0xff288bfd;
closeSeekBar.Progress = progressValue;
frameBack.AddChidren(closeSeekBar);
@@ -381,75 +425,126 @@
//绾�
var btnLine = new NormalViewControl(frameBack.Width - ControlCommonResourse.XXLeft * 2, ControlCommonResourse.BottomLineHeight, false);
btnLine.X = ControlCommonResourse.XXLeft;
- btnLine.Y = btnTemp2.Bottom + Application.GetRealHeight(69);
+ btnLine.Y = btnTemp2.Bottom + Application.GetRealHeight(156);
btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
frameBack.AddChidren(btnLine);
- int oldValue = progressValue;
- int waitTime = 4;//500姣涓哄崟浣�
- bool startWait = false;
- bool checking = false;
- closeSeekBar.ProgressChanged += (sender, value) =>
+ //鍑忓彿
+ var btnMinus = new IconViewControl(104);
+ btnMinus.UseClickStatu = true;
+ btnMinus.X = Application.GetRealWidth(847);
+ btnMinus.Y = Application.GetRealHeight(504);
+ btnMinus.UnSelectedImagePath = "Item/MinusSign2.png";
+ btnMinus.SelectedImagePath = "Item/MinusSign2Selected.png";
+ frameBack.AddChidren(btnMinus);
+ btnMinus.ButtonClickEvent += (sender, e) =>
{
- //鍊肩户缁敼鍙�,鍒欑瓑寰呮椂闂磋繕鍘�
- waitTime = 4;
- //鍚堥檺浣嶄笉鑳藉皬浜庡悎闄愪綅
- if (value < openSeekBar.Progress)
+ if (closeSeekBar.Progress <= 0)
{
+ return;
+ }
+ closeSeekBar.Progress -= 1;
+ closeSeekBar.ProgressChangedEvent(1, closeSeekBar.Progress);
+ };
+
+ //鍔犲彿
+ var btnPlus = new IconViewControl(104);
+ btnPlus.UseClickStatu = true;
+ btnPlus.X = btnMinus.Right;
+ btnPlus.Y = btnMinus.Y;
+ btnPlus.UnSelectedImagePath = "Item/PlusSign2.png";
+ btnPlus.SelectedImagePath = "Item/PlusSign2Selected.png";
+ frameBack.AddChidren(btnPlus);
+ btnPlus.ButtonClickEvent += (sender, e) =>
+ {
+ if (closeSeekBar.Progress >=100)
+ {
+ return;
+ }
+ closeSeekBar.Progress += 1;
+ closeSeekBar.ProgressChangedEvent(1, closeSeekBar.Progress);
+ };
+
+ //淇濆瓨
+ var btnSave = new NormalViewControl(150, 60, true);
+ btnSave.X = Application.GetRealWidth(906);
+ btnSave.Y = btnTemp1.Bottom + Application.GetRealHeight(68);
+ btnSave.TextAlignment = TextAlignment.Center;
+ btnSave.TextID = R.MyInternationalizationString.uSave;
+ btnSave.TextColor = UserCenterColor.Current.TextOrangeColor;
+ frameBack.AddChidren(btnSave);
+ btnSave.ButtonClickEvent += (sender, e) =>
+ {
+ if (this.receiveCloseLimit == true)
+ {
+ //淇濆瓨鍚堥檺浣嶇偣
+ this.SaveCloseLimit();
+ }
+ };
+
+ int oldProValue = curtainData.CloseLimitPersent;
+ closeSeekBar.ProgressChangedEvent += (div, value) =>
+ {
+ if (value < curtainData.OpenLimitPersent)
+ {
+ //鍚堥檺浣嶄笉鑳藉皬浜庡悎闄愪綅
closeSeekBar.Progress = openSeekBar.Progress;
return;
}
- if (checking == false)
- {
- startWait = true;
- }
-
btnProgress1.Text = value + "%";
//鏁版嵁鍙樻洿,鐧惧垎姣�
curtainData.CloseLimitPersent = value;
};
+
HdlThreadLogic.Current.RunThread(async () =>
{
+ //澶勭悊涓�
+ bool checking = false;
while (closeSeekBar.Parent != null)
{
- if (startWait == false)
+ int nowValue = curtainData.CloseLimitPersent;
+ if (oldProValue == nowValue || checking == true)
{
- await Task.Delay(200);
+ //鍊间笉绛夋墠澶勭悊
+ await Task.Delay(500);
continue;
}
- //寮�鍚�兼敼鍙樼瓑寰�
- await Task.Delay(500);
- waitTime--;
- if (waitTime <= 0)
+ checking = true;
+ oldProValue = nowValue;
+ if (curtainData.DeleteCloseLimit == true)
{
- //濡傛灉2绉掑唴鍊间笉鍐嶆敼鍙�,鍒欒繘琛屽垽鏂�
- startWait = false;
- checking = true;
-
- var value = curtainData.CloseLimitPersent;
- if (oldValue == value)
+ //閲嶇疆鍚堥檺浣嶇偣
+ var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.DownLimit);
+ if (result == false)
{
- //鐩稿悓鏁板��
- checking = false;
continue;
}
- oldValue = value;
- if (curtainData.DeleteCloseLimit == true)
- {
- //閲嶇疆鍚堥檺浣嶇偣
- var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.DownLimit);
- if (result == false)
- {
- checking = false;
- continue;
- }
- curtainData.DeleteCloseLimit = false;
- }
- receiveDownLimit = "1";
- //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
- curtainDevice.WcdGoToTiltValue(value);
- checking = false;
+ curtainData.DeleteCloseLimit = false;
}
+ //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
+ this.sendDiv = 2;
+ curtainDevice.WcdGoToTiltValue(nowValue);
+ checking = false;
+ }
+ });
+ }
+
+ /// <summary>
+ /// 淇濆瓨鍚堥檺浣嶇偣
+ /// </summary>
+ private void SaveCloseLimit()
+ {
+ //纭褰撳墠浣嶇疆涓哄悎闄愪綅?
+ string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainCloseLimitMsg);
+ this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
+ {
+ //鎵ц纭鍙婅鐩栧悎闄愪綅鐐�
+ var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
+ curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
+ if (result == true)
+ {
+ curtainData.DeleteCloseLimit = true;
+ this.receiveCloseLimit = false;
}
});
}
@@ -476,14 +571,35 @@
msg = msg.Replace("{0}", "\r\n");
this.ShowMassage(ShowMsgType.Confirm, msg, () =>
{
+ //寮�鍚繘搴︽潯
+ ProgressFormBar.Current.Start();
+ //姝e湪閲嶇疆鐢垫満
+ ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uElectricalMachineryResetting));
+ //閲嶇疆绐楀笜
HdlThreadLogic.Current.RunThread(async () =>
{
- //閲嶇疆绐楀笜
var result = await HdlDeviceCurtainLogic.Current.RestoreCurtain(curtainDevice);
if (result == false)
{
+ //鍏抽棴杩涘害鏉�
+ ProgressFormBar.Current.Close();
return;
}
+
+ //姣�10鐨勯暱搴﹀ぇ姒傛槸2绉�,澶氶鐣�1娆″嚭鏉�
+ int waitCount = ((curtainData.CurtainLength / 10) + 1) * 3;
+
+ int timeCount = 0;
+ while (timeCount <= waitCount)
+ {
+ //杩涘害鏉″��
+ ProgressFormBar.Current.SetValue(timeCount, waitCount);
+ timeCount++;
+ System.Threading.Thread.Sleep(1000);
+ }
+ //鍏抽棴杩涘害鏉�
+ ProgressFormBar.Current.Close();
+
//鑾峰彇鏁版嵁鍚�,澶囦唤绐楀笜鏁版嵁
this.backupCurtainData = true;
//閲嶆柊鍒濆鍖栫晫闈�
@@ -507,8 +623,9 @@
this.ShowProgressBar();
this.curtainData = new CurtainData();
- this.receiveUplimit = "0";
- this.receiveDownLimit = "0";
+ this.receiveOpenlimit = false;
+ this.receiveCloseLimit = false;
+ this.sendDiv = 0;
bool receiptData = false;
string mainkeys = LocalDevice.Current.GetDeviceMainKeys(curtainDevice);
@@ -617,55 +734,20 @@
{
return;
}
- lock (receiveUplimit)
+ foreach (var attriBute in device.DeviceStatusReport.AttriBute)
{
- if (receiveUplimit == "0" && receiveDownLimit == "0")
+ //绐楀笜鐧惧垎姣旀帹閫�
+ if (attriBute.AttributeId == 8)
{
- return;
- }
- foreach (var attriBute in device.DeviceStatusReport.AttriBute)
- {
- //绐楀笜鐧惧垎姣旀帹閫�
- if (attriBute.AttributeId == 8)
+ //寮�闄愪綅
+ if (sendDiv == 1)
{
- //涓婇檺浣�
- if (receiveUplimit == "1")
- {
- receiveUplimit = "0";
- openSeekBar.Progress = curtainData.OpenLimitPersent;
- //纭褰撳墠浣嶇疆{0}涓哄紑闄愪綅?
- string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainOpenLimitMsg);
- msg = msg.Replace("{0}", curtainData.OpenLimitPersent + "%");
- this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
- {
- //鎵ц纭鍙婅鐩栦笂闄愪綅鐐�
- var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
- curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
- if (result == true)
- {
- curtainData.DeleteOpenLimit = true;
- }
- });
- }
- //鍚堥檺浣�
- else if (receiveDownLimit == "1")
- {
- receiveDownLimit = "0";
- closeSeekBar.Progress = curtainData.CloseLimitPersent;
- //纭褰撳墠浣嶇疆{0}涓哄悎闄愪綅?
- string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainCloseLimitMsg);
- msg = msg.Replace("{0}", curtainData.CloseLimitPersent + "%");
- this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
- {
- //鎵ц纭鍙婅鐩栧悎闄愪綅鐐�
- var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
- curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
- if (result == true)
- {
- curtainData.DeleteCloseLimit = true;
- }
- });
- }
+ receiveOpenlimit = true;
+ }
+ //鍚堥檺浣�
+ else if (sendDiv == 2)
+ {
+ receiveCloseLimit = true;
}
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index 1368cc6..871c1ad 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -235,6 +235,8 @@
var arry = tempValue.Split(new string[] { "(" }, StringSplitOptions.RemoveEmptyEntries);
var objName = arry[0].Trim();
+ //鑾峰彇璁惧绫诲瀷
+ var deviceInfoType = Common.LocalDevice.Current.GetMyDeviceEnumInfo(this.listNewDevice);
foreach (var device in this.listNewDevice)
{
if (Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty)
@@ -244,6 +246,11 @@
var epointName = objName;
if (this.listNewDevice.Count > 1)
{
+ if (deviceInfoType.BeloneType == Common.DeviceBeloneType.A鎸夐敭闈㈡澘 && device.Type == DeviceType.TemperatureSensor)
+ {
+ //闈㈡澘鐨勬渶鍚庝竴涓洖璺槸娓╁害浼犳劅鍣�
+ epointName = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId11);
+ }
//XXXXX(N鍥炶矾)
epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareInfoForm.cs
deleted file mode 100755
index f18db7e..0000000
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareInfoForm.cs
+++ /dev/null
@@ -1,299 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-using ZigBee.Device;
-
-namespace Shared.Phone.UserCenter.Device
-{
- /// <summary>
- /// 璁惧鍥轰欢淇℃伅鐣岄潰
- /// </summary>
- public class DeviceFirmwareInfoForm : EditorCommonForm
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 璁惧mac鍦板潃
- /// </summary>
- private string deviceMac = null;
- /// <summary>
- /// 鍥轰欢淇℃伅
- /// </summary>
- private FirmwareVersionInfo deviceFirmware = null;
-
- #endregion
-
- #region 鈻� 鍒濆鍖朹____________________________
-
- /// <summary>
- /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
- /// </summary>
- /// <param name="i_deviceMac">璁惧mac鍦板潃</param>
- public void ShowForm(string i_deviceMac)
- {
- if (deviceMac != null && deviceMac != i_deviceMac)
- {
- //涓嶆槸鍚屼竴涓笢瑗�
- return;
- }
- this.deviceMac = i_deviceMac;
-
- //璁剧疆鏍囬淇℃伅
- base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFirmwareUpdate));
-
- //鍒濆鍖栦腑閮ㄦ帶浠�
- this.InitMiddleFrame();
-
- //鍘嗗彶鐗堟湰
- this.InitTopRightMenu();
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄦ帶浠�
- /// </summary>
- private void InitMiddleFrame()
- {
- var oTADevice = Common.LocalDevice.Current.GetOTADevice(deviceMac);
- //鑾峰彇璁惧鏈�鏂扮増鏈�
- this.deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.ZigbeeDevice,
- oTADevice.HwVersion.ToString(),
- oTADevice.ImgTypeId.ToString(),
- oTADevice.ImgVersion);
-
- if (deviceFirmware != null && deviceFirmware.FirmwareVersion > oTADevice.ImgVersion)
- {
- //鎷ユ湁鏂扮増鏈�
- this.InitControlByNewVersion();
- }
- else
- {
- //娌℃湁鏂扮増鏈�
- this.InitControlByNotNewVersion();
- }
- }
-
- #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) =>
- {
- //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
- this.ShowTopRightMenu();
- });
- }
-
- /// <summary>
- /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
- /// </summary>
- private void ShowTopRightMenu()
- {
- var frame = new TopRightMenuControl(1);
- //鍘嗗彶鐗堟湰
- var deviceMenu = Language.StringByID(R.MyInternationalizationString.uHistoryVersion);
- frame.AddRowMenu(deviceMenu, "", "", () =>
- {
- var form = new DeviceHistoryFirmwareVersionForm();
- form.AddForm(deviceMac);
- form.SelectFirmwareInfoEvent += (info) =>
- {
- this.deviceFirmware = info;
- //鎷ユ湁鏂扮増鏈�
- this.InitControlByNewVersion();
- };
- });
- }
-
- #endregion
-
- #region 鈻� 鎷ユ湁鏂扮増鏈琠________________________
-
- /// <summary>
- /// 鎷ユ湁鏂扮増鏈�
- /// </summary>
- private void InitControlByNewVersion()
- {
- //娓呯┖bodyFrame
- this.ClearBodyFrame();
-
- var oTADevice = Common.LocalDevice.Current.GetOTADevice(deviceMac);
-
- //鍗囩骇
- var btnUpdate = new BottomClickButton();
- btnUpdate.TextID = R.MyInternationalizationString.uLevelUp;
- bodyFrameLayout.AddChidren(btnUpdate);
- btnUpdate.ButtonClickEvent += (sender, e) =>
- {
- //鐣岄潰鍙冲垝涓嶅彲
- UserView.HomePage.Instance.ScrollEnabled = false;
- Shared.Common.CommonPage.BackKeyCanClick = false;
-
- var form = new DeviceFirmwareUpdateForm();
- form.CloseFormByClickBack = false;
- form.AddForm(oTADevice, deviceFirmware);
- //瀹屾垚鍗囩骇浜嬩欢
- form.FinishUpdateEvent += (() =>
- {
- //鍒濆鍖栦腑閮ㄦ帶浠�
- this.InitMiddleFrame();
- });
- };
-
- var frameWhiteBack = new FrameLayout();
- frameWhiteBack.Height = Application.GetRealHeight(286);
- frameWhiteBack.BackgroundColor = UserCenterColor.Current.White;
- bodyFrameLayout.AddChidren(frameWhiteBack);
-
- //褰撳墠鍥轰欢鐗堟湰
- var frameNow = new FrameRowControl();
- frameNow.UseClickStatu = false;
- frameNow.Y = Application.GetRealHeight(20);
- frameWhiteBack.AddChidren(frameNow);
- frameNow.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowFirmwareVersion), 500);
- frameNow.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 500);
- frameNow.AddBottomLine();
-
- //鏈�鏂板浐浠剁増鏈�
- var frameNew = new FrameRowControl();
- frameNew.UseClickStatu = false;
- frameNew.Y = frameNow.Bottom + Application.GetRealHeight(12);
- frameWhiteBack.AddChidren(frameNew);
- frameNew.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewFirmwareVersion), 500);
- frameNew.AddMostRightView(Common.LocalDevice.Current.AppendVersion(deviceFirmware.FirmwareVersion), 500);
- frameNew.AddBottomLine();
-
- //娣诲姞鍥轰欢浠嬬粛琛�
- int maxHeight = btnUpdate.Y - ControlCommonResourse.BottomButtonAndListViewSpace - frameNew.Bottom;
- this.AddUpdateContent(deviceFirmware, maxHeight, frameNew.Bottom);
- }
-
- #endregion
-
- #region 鈻� 娌℃湁鏂扮増鏈琠________________________
-
- /// <summary>
- /// 娌℃湁鏂扮増鏈�
- /// </summary>
- private void InitControlByNotNewVersion()
- {
- //娓呯┖bodyFrame
- this.ClearBodyFrame();
-
- var oTADevice = Common.LocalDevice.Current.GetOTADevice(deviceMac);
-
- var frameWhiteBack = new FrameLayout();
- frameWhiteBack.Height = Application.GetRealHeight(308);
- frameWhiteBack.BackgroundColor = UserCenterColor.Current.White;
- bodyFrameLayout.AddChidren(frameWhiteBack);
-
- //褰撳墠鍥轰欢鐗堟湰
- var frameNow = new FrameRowControl();
- frameNow.UseClickStatu = false;
- frameNow.Y = Application.GetRealHeight(20);
- frameWhiteBack.AddChidren(frameNow);
- frameNow.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowFirmwareVersion), 500);
- frameNow.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 500);
- frameNow.AddBottomLine();
-
- //鏈�鏂板浐浠剁増鏈�
- var frameNew = new FrameRowControl();
- frameNew.UseClickStatu = false;
- frameNew.Y = frameNow.Bottom + Application.GetRealHeight(12);
- frameWhiteBack.AddChidren(frameNew);
- frameNew.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewFirmwareVersion), 500);
- frameNew.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 500);
- }
-
- #endregion
-
- #region 鈻� 娣诲姞鍥轰欢浠嬬粛琛宊____________________
-
- /// <summary>
- /// 娣诲姞鍥轰欢浠嬬粛琛�
- /// </summary>
- /// <param name="versionInfo">鍥轰欢瀵硅薄</param>
- /// <param name="Maxheight">鏈�澶ч珮搴�</param>
- /// <param name="YY"></param>
- private void AddUpdateContent(FirmwareVersionInfo versionInfo, int Maxheight,int YY)
- {
- FrameListControl listFrame = null;
- VerticalListControl listView = null;
-
- var realHeight = Application.GetRealHeight(40 + 12) * versionInfo.UpdateContent.Count;
- realHeight += Application.GetRealHeight(17 + 12 + 49 + 8 + 63);
-
- //琛岄棿璺�
- int rowSpace = 0;
- if (realHeight > Maxheight)
- {
- realHeight = Maxheight;
- listView = new VerticalListControl(12);
- listView.Height = realHeight;
- listView.Y = YY;
- listView.BackgroundColor = UserCenterColor.Current.White;
- bodyFrameLayout.AddChidren(listView);
- rowSpace = listView.rowSpace / 2;
- }
- else
- {
- listFrame = new FrameListControl(12);
- listFrame.Height = realHeight;
- listFrame.Y = YY;
- listFrame.BackgroundColor = UserCenterColor.Current.White;
- bodyFrameLayout.AddChidren(listFrame);
- rowSpace = listFrame.rowSpace / 2;
- }
-
- //娣诲姞澶撮儴绌虹櫧闂撮殭
- var frameSpace1 = new FrameLayout();
- frameSpace1.Height = Application.GetRealHeight(17);
- listView?.AddChidren(frameSpace1);
- listFrame?.AddChidren(frameSpace1);
-
- //淇敼鍐呭
- var btnContentRow = new FrameRowControl(rowSpace);
- btnContentRow.UseClickStatu = false;
- btnContentRow.Height = Application.GetRealHeight(49);
- listView?.AddChidren(btnContentRow);
- listFrame?.AddChidren(btnContentRow);
- var btnContent = btnContentRow.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uEditorContent), 500);
- btnContent.TextSize = 12;
-
- //绋嶅井鍐嶆坊鍔犵┖鐧介棿闅�
- var frameSpace2 = new FrameLayout();
- frameSpace2.Height = Application.GetRealHeight(8);
- listView?.AddChidren(frameSpace2);
- listFrame?.AddChidren(frameSpace2);
-
- foreach (var msg in versionInfo.UpdateContent)
- {
- var btnRow = new FrameRowControl(rowSpace);
- btnRow.UseClickStatu = false;
- btnRow.Height = Application.GetRealHeight(40);
- listView?.AddChidren(btnRow);
- listFrame?.AddChidren(btnRow);
-
- var btnMsg = btnRow.AddLeftCaption(msg, 965);
- btnMsg.TextSize = 10;
- btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
- }
-
- //娣诲姞搴曢儴绌虹櫧闂撮殭
- var frameSpace3 = new FrameLayout();
- frameSpace3.Height = Application.GetRealHeight(63);
- listView?.AddChidren(frameSpace3);
- listFrame?.AddChidren(frameSpace3);
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs
index afe6c49..379690d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs
@@ -1,26 +1,25 @@
锘縰sing System;
using System.Collections.Generic;
using System.Text;
-using System.Threading.Tasks;
using ZigBee.Device;
namespace Shared.Phone.UserCenter.Device
{
/// <summary>
- /// 鍥轰欢鍗囩骇鐢婚潰
+ /// 璁惧鍥轰欢鍗囩骇鐣岄潰
/// </summary>
- public class DeviceFirmwareUpdateForm : DialogCommonForm
+ public class DeviceFirmwareUpdateForm : EditorCommonForm
{
#region 鈻� 鍙橀噺澹版槑___________________________
+ /// <summary>
+ /// 璁惧mac鍦板潃
+ /// </summary>
+ private string deviceMac = null;
/// <summary>
- /// 璁惧鐨凪ac鍦板潃
+ /// 鍥轰欢淇℃伅
/// </summary>
- private string deviceMac = string.Empty;
- /// <summary>
- /// 璁惧鎴愬姛鍗囩骇瀹屾垚鐨勫洖璋冨嚱鏁�
- /// </summary>
- public Action FinishUpdateEvent = null;
+ private FirmwareVersionInfo deviceFirmware = null;
#endregion
@@ -29,73 +28,262 @@
/// <summary>
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
- /// <param name="device">ota璁惧瀵硅薄</param>
- /// <param name="deviceFirmware">鍥轰欢鍗囩骇淇℃伅</param>
- public void ShowForm(OTADevice device, FirmwareVersionInfo deviceFirmware)
+ /// <param name="i_deviceMac">璁惧mac鍦板潃</param>
+ public void ShowForm(string i_deviceMac)
{
- this.deviceMac = device.DeviceAddr;
- //鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame(device, deviceFirmware);
+ if (deviceMac != null && deviceMac != i_deviceMac)
+ {
+ //涓嶆槸鍚屼竴涓笢瑗�
+ return;
+ }
+ this.deviceMac = i_deviceMac;
+
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFirmwareUpdate));
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+
+ //鍘嗗彶鐗堟湰
+ this.InitTopRightMenu();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄦ帶浠�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ var oTADevice = Common.LocalDevice.Current.GetOTADevice(deviceMac);
+ //鑾峰彇璁惧鏈�鏂扮増鏈�
+ this.deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.ZigbeeDevice,
+ oTADevice.HwVersion.ToString(),
+ oTADevice.ImgTypeId.ToString(),
+ oTADevice.ImgVersion);
+
+ if (deviceFirmware != null && deviceFirmware.FirmwareVersion > oTADevice.ImgVersion)
+ {
+ //鎷ユ湁鏂扮増鏈�
+ this.InitControlByNewVersion();
+ }
+ else
+ {
+ //娌℃湁鏂扮増鏈�
+ this.InitControlByNotNewVersion();
+ }
+ }
+
+ #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) =>
+ {
+ //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ this.ShowTopRightMenu();
+ });
}
/// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
- /// </summary>
- /// <param name="device">ota璁惧瀵硅薄</param>
- /// <param name="deviceFirmware">鍥轰欢鍗囩骇淇℃伅</param>
- private void InitMiddleFrame(OTADevice device, FirmwareVersionInfo deviceFirmware)
+ /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ /// </summary>
+ private void ShowTopRightMenu()
{
- var frameBack = new FrameLayout();
- frameBack.Width = Application.GetRealWidth(674);
- frameBack.Height = Application.GetRealHeight(386);
- frameBack.BackgroundColor = UserCenterColor.Current.White;
- frameBack.Gravity = Gravity.CenterHorizontal;
- frameBack.Y = Application.GetRealHeight(683);
- frameBack.Radius = (uint)Application.GetRealHeight(17);
- bodyFrameLayout.AddChidren(frameBack);
+ var frame = new TopRightMenuControl(1);
+ //鍘嗗彶鐗堟湰
+ var deviceMenu = Language.StringByID(R.MyInternationalizationString.uHistoryVersion);
+ frame.AddRowMenu(deviceMenu, "", "", () =>
+ {
+ var form = new DeviceHistoryFirmwareVersionForm();
+ form.AddForm(deviceMac);
+ form.SelectFirmwareInfoEvent += (info) =>
+ {
+ this.deviceFirmware = info;
+ //鎷ユ湁鏂扮増鏈�
+ this.InitControlByNewVersion();
+ };
+ });
+ }
- //杩涘害鏄剧ず鏂囨湰
- var btnText = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false);
- btnText.Y = Application.GetRealHeight(248);
- btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
- btnText.TextAlignment = TextAlignment.Center;
- //btnText.Text = "鍗囩骇涓�";
- frameBack.AddChidren(btnText);
+ #endregion
- //杩涘害鏉�
- var btnProRow = new FrameLayout();
- btnProRow.Gravity = Gravity.CenterHorizontal;
- btnProRow.Y = Application.GetRealHeight(161);
- btnProRow.Width = Application.GetRealWidth(559);
- btnProRow.Height = Application.GetRealHeight(29);
- btnProRow.BackgroundColor = 0xfff5f5f5;
- btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2;
- frameBack.AddChidren(btnProRow);
- var btnProgressBar = new FrameLayout();
- btnProgressBar.Width = 0;
- btnProgressBar.Height = btnProRow.Height;
- btnProgressBar.BackgroundColor = 0xfffb744a;
- btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
- btnProRow.AddChidren(btnProgressBar);
+ #region 鈻� 鎷ユ湁鏂扮増鏈琠________________________
- //杩涘害鍊兼枃鏈�
- var frameProgress = new FrameLayout();
- frameProgress.Width = Application.GetRealWidth(84);
- frameProgress.Height = Application.GetRealHeight(60);
- frameProgress.Y = Application.GetRealHeight(86);
- frameBack.AddChidren(frameProgress);
- frameProgress.X = btnProRow.X + btnProgressBar.Right - frameProgress.Width / 2;
- var btnProgressPic = new PicViewControl(84, 60);
- btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
- frameProgress.AddChidren(btnProgressPic);
- var btnProgressView = new NormalViewControl(84, 45, true);
- btnProgressView.TextSize = 10;
- btnProgressView.TextAlignment = TextAlignment.Center;
- btnProgressView.Text = "0%";
- frameProgress.AddChidren(btnProgressView);
+ /// <summary>
+ /// 鎷ユ湁鏂扮増鏈�
+ /// </summary>
+ private void InitControlByNewVersion()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
- //璁惧鍗囩骇
- this.DeviceUpdateMethod(device, deviceFirmware, btnText, btnProgressView, frameProgress, btnProgressBar, btnProRow.Width);
+ var oTADevice = Common.LocalDevice.Current.GetOTADevice(deviceMac);
+
+ //鍗囩骇
+ var btnUpdate = new BottomClickButton();
+ btnUpdate.TextID = R.MyInternationalizationString.uLevelUp;
+ bodyFrameLayout.AddChidren(btnUpdate);
+ btnUpdate.ButtonClickEvent += (sender, e) =>
+ {
+ //璁惧鍗囩骇
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ this.DoDeviceUpdate(oTADevice);
+ });
+ };
+
+ var frameWhiteBack = new FrameLayout();
+ frameWhiteBack.Height = Application.GetRealHeight(286);
+ frameWhiteBack.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(frameWhiteBack);
+
+ //褰撳墠鍥轰欢鐗堟湰
+ var frameNow = new FrameRowControl();
+ frameNow.UseClickStatu = false;
+ frameNow.Y = Application.GetRealHeight(20);
+ frameWhiteBack.AddChidren(frameNow);
+ frameNow.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowFirmwareVersion), 500);
+ frameNow.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 500);
+ frameNow.AddBottomLine();
+
+ //鏈�鏂板浐浠剁増鏈�
+ var frameNew = new FrameRowControl();
+ frameNew.UseClickStatu = false;
+ frameNew.Y = frameNow.Bottom + Application.GetRealHeight(12);
+ frameWhiteBack.AddChidren(frameNew);
+ frameNew.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewFirmwareVersion), 500);
+ frameNew.AddMostRightView(Common.LocalDevice.Current.AppendVersion(deviceFirmware.FirmwareVersion), 500);
+ frameNew.AddBottomLine();
+
+ //娣诲姞鍥轰欢浠嬬粛琛�
+ int maxHeight = btnUpdate.Y - ControlCommonResourse.BottomButtonAndListViewSpace - frameNew.Bottom;
+ this.AddUpdateContent(deviceFirmware, maxHeight, frameNew.Bottom);
+ }
+
+ #endregion
+
+ #region 鈻� 娌℃湁鏂扮増鏈琠________________________
+
+ /// <summary>
+ /// 娌℃湁鏂扮増鏈�
+ /// </summary>
+ private void InitControlByNotNewVersion()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ var oTADevice = Common.LocalDevice.Current.GetOTADevice(deviceMac);
+
+ var frameWhiteBack = new FrameLayout();
+ frameWhiteBack.Height = Application.GetRealHeight(308);
+ frameWhiteBack.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(frameWhiteBack);
+
+ //褰撳墠鍥轰欢鐗堟湰
+ var frameNow = new FrameRowControl();
+ frameNow.UseClickStatu = false;
+ frameNow.Y = Application.GetRealHeight(20);
+ frameWhiteBack.AddChidren(frameNow);
+ frameNow.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowFirmwareVersion), 500);
+ frameNow.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 500);
+ frameNow.AddBottomLine();
+
+ //鏈�鏂板浐浠剁増鏈�
+ var frameNew = new FrameRowControl();
+ frameNew.UseClickStatu = false;
+ frameNew.Y = frameNow.Bottom + Application.GetRealHeight(12);
+ frameWhiteBack.AddChidren(frameNew);
+ frameNew.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewFirmwareVersion), 500);
+ frameNew.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 500);
+ }
+
+ #endregion
+
+ #region 鈻� 娣诲姞鍥轰欢浠嬬粛琛宊____________________
+
+ /// <summary>
+ /// 娣诲姞鍥轰欢浠嬬粛琛�
+ /// </summary>
+ /// <param name="versionInfo">鍥轰欢瀵硅薄</param>
+ /// <param name="Maxheight">鏈�澶ч珮搴�</param>
+ /// <param name="YY"></param>
+ private void AddUpdateContent(FirmwareVersionInfo versionInfo, int Maxheight,int YY)
+ {
+ FrameListControl listFrame = null;
+ VerticalListControl listView = null;
+
+ var realHeight = Application.GetRealHeight(40 + 12) * versionInfo.UpdateContent.Count;
+ realHeight += Application.GetRealHeight(17 + 12 + 49 + 8 + 63);
+
+ //琛岄棿璺�
+ int rowSpace = 0;
+ if (realHeight > Maxheight)
+ {
+ realHeight = Maxheight;
+ listView = new VerticalListControl(12);
+ listView.Height = realHeight;
+ listView.Y = YY;
+ listView.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(listView);
+ rowSpace = listView.rowSpace / 2;
+ }
+ else
+ {
+ listFrame = new FrameListControl(12);
+ listFrame.Height = realHeight;
+ listFrame.Y = YY;
+ listFrame.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(listFrame);
+ rowSpace = listFrame.rowSpace / 2;
+ }
+
+ //娣诲姞澶撮儴绌虹櫧闂撮殭
+ var frameSpace1 = new FrameLayout();
+ frameSpace1.Height = Application.GetRealHeight(17);
+ listView?.AddChidren(frameSpace1);
+ listFrame?.AddChidren(frameSpace1);
+
+ //淇敼鍐呭
+ var btnContentRow = new FrameRowControl(rowSpace);
+ btnContentRow.UseClickStatu = false;
+ btnContentRow.Height = Application.GetRealHeight(49);
+ listView?.AddChidren(btnContentRow);
+ listFrame?.AddChidren(btnContentRow);
+ var btnContent = btnContentRow.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uEditorContent), 500);
+ btnContent.TextSize = 12;
+
+ //绋嶅井鍐嶆坊鍔犵┖鐧介棿闅�
+ var frameSpace2 = new FrameLayout();
+ frameSpace2.Height = Application.GetRealHeight(8);
+ listView?.AddChidren(frameSpace2);
+ listFrame?.AddChidren(frameSpace2);
+
+ foreach (var msg in versionInfo.UpdateContent)
+ {
+ var btnRow = new FrameRowControl(rowSpace);
+ btnRow.UseClickStatu = false;
+ btnRow.Height = Application.GetRealHeight(40);
+ listView?.AddChidren(btnRow);
+ listFrame?.AddChidren(btnRow);
+
+ var btnMsg = btnRow.AddLeftCaption(msg, 965);
+ btnMsg.TextSize = 10;
+ btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
+ }
+
+ //娣诲姞搴曢儴绌虹櫧闂撮殭
+ var frameSpace3 = new FrameLayout();
+ frameSpace3.Height = Application.GetRealHeight(63);
+ listView?.AddChidren(frameSpace3);
+ listFrame?.AddChidren(frameSpace3);
}
#endregion
@@ -105,18 +293,12 @@
/// <summary>
/// 璁惧鍗囩骇
/// </summary>
- /// <param name="device">璁惧瀵硅薄</param>
- /// <param name="deviceFirmware">鍥轰欢淇℃伅</param>
- /// <param name="btnText">鏍囬鎺т欢</param>
- /// <param name="btnProgressView">杩涘害鍊兼枃鏈殑鏄剧ず鎺т欢</param>
- /// <param name="frameProgress">杩涘害鍊艰兘澶熺Щ鍔ㄧ殑閭d釜妗嗘帶浠�</param>
- /// <param name="btnProgressBar">杩涘害鏉�</param>
- /// <param name="ProRowWidth">杩涘害鏉″鍣ㄧ殑鏈�澶у搴�</param>
- private void DeviceUpdateMethod(OTADevice device, FirmwareVersionInfo deviceFirmware, NormalViewControl btnText,
- NormalViewControl btnProgressView, FrameLayout frameProgress, FrameLayout btnProgressBar, int ProRowWidth)
+ private void DoDeviceUpdate(OTADevice oTADevice)
{
+ //鎵撳紑杩涘害鏉�
+ ProgressFormBar.Current.Start();
//璁惧鍗囩骇
- var updateLogic = new HdlDeviceUpdateLogic(device, deviceFirmware);
+ var updateLogic = new HdlDeviceUpdateLogic(oTADevice, deviceFirmware);
//鏇存柊鐘舵�佸彉鍖栫殑浜嬩欢
updateLogic.UpdateStatuChangedEvent += (div, msg) =>
{
@@ -126,79 +308,57 @@
{
//寮傚父
this.ShowMassage(ShowMsgType.Tip, msg);
- this.CloseForm();
+ ProgressFormBar.Current.Close();
}
else if (div == 0)
{
//涓�鑸俊鎭�
- btnText.Text = msg;
+ ProgressFormBar.Current.SetMsg(msg);
}
else if (div == 1)
{
//鍗囩骇瀹屾垚
+ ProgressFormBar.Current.Close();
this.ShowMassage(ShowMsgType.Tip, msg);
- //璋冪敤鍥炶皟鍑芥暟
- this.FinishUpdateEvent?.Invoke();
- this.CloseForm();
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ });
}
else if (div == 2)
{
//涓诲姩缁堟鍗囩骇
- this.CloseForm();
+ ProgressFormBar.Current.Close();
}
});
};
//杩涘害鍊兼敼鍙樹簨浠�
updateLogic.ProgressEvent += (value) =>
{
- Application.RunOnMainThread(() =>
- {
- //杩涘害鏉�
- decimal result = value / 100;
- int width = (int)(result * ProRowWidth);
- btnProgressBar.Width = width;
-
- //鏂囨湰鏄剧ず
- btnProgressView.Text = value + "%";
- //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩
- frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2;
- });
-
+ ProgressFormBar.Current.SetValue(value, 100);
};
//璁惧鍗囩骇寮�濮�
updateLogic.StartUpdateReady();
//缁堟鍗囩骇
- btnText.ButtonClickEvent += (sender, e) =>
+ ProgressFormBar.Current.MsgClickEvent += () =>
{
//鍐嶆璋冪敤,鍐呴儴鏉′欢杈炬垚鏃�,鍙互閫夋嫨缁堟鍗囩骇
updateLogic.StartUpdateReady();
};
- }
-
- #endregion
-
- #region 鈻� 鐣岄潰鍏抽棴___________________________
-
- /// <summary>
- /// 鐢婚潰鍏抽棴
- /// </summary>
- public override void CloseFormBefore()
- {
- //瀹夊崜鍙互鐐瑰嚮绯荤粺鐨勮繑鍥為敭
- UserView.HomePage.Instance.ScrollEnabled = true;
- Shared.Common.CommonPage.BackKeyCanClick = true;
-
- //鍗囩骇瀵硅薄
- if (FirmwareUpdateResourse.dicDeviceUpdateList.ContainsKey(deviceMac) == true
- && FirmwareUpdateResourse.dicDeviceUpdateList[deviceMac].IsFinishUpdate == true)
+ //鍏抽棴浜嬩欢
+ ProgressFormBar.Current.CloseEvent += () =>
{
- //濡傛灉璁惧宸茬粡鍗囩骇瀹屾垚锛岀晫闈㈠叧闂椂锛屽垯绉婚櫎鍐呭瓨
- FirmwareUpdateResourse.dicDeviceUpdateList[deviceMac].Dispose();
- FirmwareUpdateResourse.dicDeviceUpdateList.Remove(deviceMac);
- }
- this.FinishUpdateEvent = null;
-
- base.CloseFormBefore();
+ //鍗囩骇瀵硅薄
+ if (FirmwareUpdateResourse.dicDeviceUpdateList.ContainsKey(deviceMac) == true
+ && FirmwareUpdateResourse.dicDeviceUpdateList[deviceMac].IsFinishUpdate == true)
+ {
+ //濡傛灉璁惧宸茬粡鍗囩骇瀹屾垚锛岀晫闈㈠叧闂椂锛屽垯绉婚櫎鍐呭瓨
+ FirmwareUpdateResourse.dicDeviceUpdateList[deviceMac].Dispose();
+ FirmwareUpdateResourse.dicDeviceUpdateList.Remove(deviceMac);
+ }
+ };
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
index d611651..dfce7b9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
@@ -48,18 +48,35 @@
var rowName = new FrameRowControl(listView.rowSpace / 2);
rowName.UseClickStatu = false;
listView.AddChidren(rowName);
- rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 300);
+ rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 400);
rowName.AddMostRightView(Common.LocalDevice.Current.GetDeviceObjectText(listDevice), 600);
rowName.AddBottomLine();
//璁惧鍨嬪彿
string strModel = listDevice[0].DriveCode > 0 ? Language.StringByID(R.MyInternationalizationString.uVirtualDriveDevice) : listDevice[0].ModelIdentifier;
+ if (strModel == string.Empty)
+ {
+ //鏃犳硶璇嗗埆
+ strModel = Language.StringByID(R.MyInternationalizationString.uUnDistinguish);
+ }
var rowType = new FrameRowControl(listView.rowSpace / 2);
rowType.UseClickStatu = false;
listView.AddChidren(rowType);
- rowType.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uModelIdentifier), 300);
+ rowType.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uModelIdentifier), 400);
rowType.AddMostRightView(strModel, 600);
rowType.AddBottomLine();
+
+ //闀滃儚ID
+ var otaDevice = Common.LocalDevice.Current.GetOTADevice(listDevice[0].DeviceAddr);
+ if (otaDevice != null)
+ {
+ var rowImage = new FrameRowControl(listView.rowSpace / 2);
+ rowImage.UseClickStatu = false;
+ listView.AddChidren(rowImage);
+ rowImage.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uImageId), 400);
+ rowImage.AddMostRightView(otaDevice.ImgTypeId.ToString(), 400);
+ rowImage.AddBottomLine();
+ }
//鍥轰欢鐗堟湰
var oTADevice = Common.LocalDevice.Current.GetOTADevice(listDevice[0].DeviceAddr);
@@ -68,7 +85,7 @@
var rowVersion = new FrameRowControl(listView.rowSpace / 2);
rowVersion.UseClickStatu = false;
listView.AddChidren(rowVersion);
- rowVersion.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 300);
+ rowVersion.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 400);
rowVersion.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 600);
rowVersion.AddBottomLine();
}
@@ -77,7 +94,7 @@
var rowSerial = new FrameRowControl(listView.rowSpace / 2);
rowSerial.UseClickStatu = false;
listView.AddChidren(rowSerial);
- rowSerial.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSerialNumber), 300);
+ rowSerial.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSerialNumber), 400);
rowSerial.AddMostRightView(listDevice[0].SerialNumber != string.Empty ? listDevice[0].SerialNumber : listDevice[0].DeviceAddr, 600);
rowSerial.AddBottomLine();
@@ -94,7 +111,7 @@
var rowProtuct = new FrameRowControl(listView.rowSpace / 2);
rowProtuct.UseClickStatu = false;
listView.AddChidren(rowProtuct);
- rowProtuct.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uManufacturerName), 300);
+ rowProtuct.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uManufacturerName), 400);
rowProtuct.AddMostRightView(strProtuct, 600);
listView.AdjustRealHeight(Application.GetRealHeight(23));
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
index a6f7ada..98c72f0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -223,6 +223,9 @@
//娣诲姞銆愰�氱敤淇℃伅銆戣
this.AddGeneralInformationRow();
+ //娣诲姞銆愮┖璋冩ā鍧楃増鏈�(绌鸿皟涓撶敤)銆戣
+ this.AddAirConditionerModelVersionRow();
+
if (isHdlDevice == true)
{
//娣诲姞銆愬浐浠跺崌绾с�戣
@@ -728,6 +731,51 @@
#endregion
+ #region 鈻� 绌鸿皟妯″潡鐗堟湰(绌鸿皟涓撶敤)_____________
+
+ /// <summary>
+ /// 娣诲姞銆愮┖璋冩ā鍧楃増鏈�戣(娌充笢鐨勪腑澶┖璋�)
+ /// </summary>
+ private void AddAirConditionerModelVersionRow()
+ {
+ if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway)
+ {
+ //涓嶆槸涓ぎ绌鸿皟
+ return;
+ }
+ string caption = Language.StringByID(R.MyInternationalizationString.uAirConditionerModelVersion);
+ var rowVersion = new FrameRowControl(listview.rowSpace / 2);
+ rowVersion.UseClickStatu = false;
+ listview.AddChidren(rowVersion);
+ rowVersion.AddLeftCaption(caption, 600);
+ //鐗堟湰
+ var btnVersion = rowVersion.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uGetting), 800);
+ //搴曠嚎
+ rowVersion.AddBottomLine();
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+ //璇诲彇绌鸿皟妯″潡鐗堟湰
+ var result = await ((AC)listNewDevice[0]).ReadACFirewareVersionAsync();
+ if (result == null || result.readACFirewareVersionResponData == null || result.readACFirewareVersionResponData.Status != 0)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鑾峰彇澶辫触
+ btnVersion.TextID = R.MyInternationalizationString.uGettingFail;
+ });
+ }
+ else
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ btnVersion.Text = result.readACFirewareVersionResponData.FirewareVersion.Replace("-", string.Empty);
+ });
+ }
+ });
+ }
+
+ #endregion
+
#region 鈻� 鍥轰欢鍗囩骇___________________________
/// <summary>
@@ -762,9 +810,19 @@
rowUpDate.ButtonClickEvent += (sender, e) =>
{
+ if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway)
+ {
+ //杩欎釜鏄竴鑸澶囩殑鍗囩骇
+ var form = new DeviceFirmwareUpdateForm();
+ form.AddForm(listNewDevice[0].DeviceAddr);
+ }
+ else
+ {
+ //涓ぎ绌鸿皟鐨勫崌绾х殑璇濓紝鏄壒娈婄殑
+ var form = new DeviceAirConditioner.ACZbGatewayUpdateMenuForm();
+ form.AddForm(listNewDevice[0].DeviceAddr, btnNewVersion.Visible);
+ }
btnNewVersion.Visible = false;
- var form = new DeviceFirmwareInfoForm();
- form.AddForm(listNewDevice[0].DeviceAddr);
};
//璁剧疆璁惧鐨勭増鏈俊鎭�
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
index 7c33e57..1608b0c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -150,6 +150,7 @@
Width = Application.GetRealWidth(1080 - 161),
Height = Application.GetRealWidth(69),
TextSize = 17,
+ IsBold = true,
X = Application.GetRealWidth(161 - 116),
};
titleFrameLayout.AddChidren(title);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index 59956dd..af7eff0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -140,7 +140,7 @@
rowUpDate.ButtonClickEvent += (sender, e) =>
{
btnNewVersion.Visible = false;
- var form = new GatewayUpdate.GatewayFirmwareInfoForm();
+ var form = new GatewayUpdate.GatewayFirmwareUpdateForm();
form.AddForm(zbGateway);
};
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareInfoForm.cs
deleted file mode 100755
index dca0b5e..0000000
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareInfoForm.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-using ZigBee.Device;
-
-namespace Shared.Phone.UserCenter.GatewayUpdate
-{
- /// <summary>
- /// 缃戝叧鍥轰欢淇℃伅鐣岄潰
- /// </summary>
- public class GatewayFirmwareInfoForm : EditorCommonForm
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 褰撳墠閫夋嫨鐨勭綉鍏�
- /// </summary>
- private ZbGateway zbGateway = null;
- /// <summary>
- /// 鍗囩骇鍥轰欢淇℃伅(0:Linux鏂扮増鏈� 1:鍗忚皟鍣ㄦ柊鐗堟湰 2锝瀀:閮芥槸铏氭嫙椹卞姩鐨�)
- /// </summary>
- private List<FirmwareVersionInfo> listVersionInfo = null;
- /// <summary>
- /// 铏氭嫙椹卞姩鍙�
- /// </summary>
- private List<ZbGatewayData.DriveCodeObj> listVode = null;
-
- #endregion
-
- #region 鈻� 鍒濆鍖朹____________________________
-
- /// <summary>
- /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
- /// </summary>
- /// <param name="i_zbGateway">褰撳墠閫夋嫨鐨勭綉鍏�</param>
- public void ShowForm(ZbGateway i_zbGateway)
- {
- this.zbGateway = i_zbGateway;
-
- //璁剧疆鏍囬淇℃伅
- base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFirmwareUpdate));
-
- //鍒濆鍖栧彸涓婅鑿滃崟
- this.InitTopRightMenu();
-
- //鍒濆鍖栦腑閮ㄦ帶浠�
- this.InitMiddleFrame();
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄦ帶浠�
- /// </summary>
- private void InitMiddleFrame()
- {
- //娓呯┖bodyFrame
- this.ClearBodyFrame();
-
- HdlThreadLogic.Current.RunThread(async () =>
- {
- //寮�鍚繘搴︽潯
- this.ShowProgressBar();
-
- //鑾峰彇缃戝叧鏂扮増鏈俊鎭�
- this.listVersionInfo = await HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
- if (listVersionInfo == null)
- {
- //鍏抽棴杩涘害鏉�
- this.CloseProgressBar(ShowReLoadMode.YES);
- return;
- }
- //铏氭嫙椹卞姩鍙�
- this.listVode = await HdlGatewayLogic.Current.GetListVDDriveCode(this.zbGateway);
- //鍏抽棴杩涘害鏉�
- this.CloseProgressBar();
-
- HdlThreadLogic.Current.RunMain(() =>
- {
- //鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
- var yy = this.InitNowVersionControl();
- if (listVersionInfo[0] != null || listVersionInfo[1] != null || listVersionInfo[2] != null)
- {
- //鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
- this.InitNewVersionControl(yy);
- }
- });
- });
- }
-
- /// <summary>
- /// 鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
- /// </summary>
- private int InitNowVersionControl()
- {
- bodyFrameLayout.RemoveAll();
-
- var frameBack = new FrameLayout();
- frameBack.BackgroundColor = UserCenterColor.Current.White;
- frameBack.Height = Application.GetMinReal(800);
- bodyFrameLayout.AddChidren(frameBack);
-
- //褰撳墠鍥轰欢鐗堟湰
- var btnTitle = new NormalViewControl(700, 65, true);
- btnTitle.X = ControlCommonResourse.XXLeft;
- btnTitle.Y = Application.GetRealHeight(30);
- btnTitle.TextID = R.MyInternationalizationString.uNowFirmwareVersion;
- btnTitle.TextSize = 15;
- frameBack.AddChidren(btnTitle);
-
- var listView = new VerticalListControl(12);
- listView.Y = Application.GetRealHeight(109);
- listView.Height = Application.GetRealHeight(800);
- frameBack.AddChidren(listView);
-
- //Linux
- var rowLinux = new FrameRowControl(listView.rowSpace / 2);
- listView.AddChidren(rowLinux);
- rowLinux.AddLeftCaption("Linux", 300);
- rowLinux.AddRightArrow();
- rowLinux.ButtonClickEvent += (sender, e) =>
- {
- var form = new GatewayLinuxInfoForm();
- form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
- };
-
- //鍗忚皟鍣�
- var rowCoordinator = new FrameRowControl(listView.rowSpace / 2);
- listView.AddChidren(rowCoordinator);
- rowCoordinator.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCoordinator), 500);
- rowCoordinator.AddRightArrow();
- rowCoordinator.ButtonClickEvent += (sender, e) =>
- {
- var form = new GatewayCoordinatorInfoForm();
- form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
- };
-
- if (this.listVode != null)
- {
- //铏氭嫙椹卞姩
- var rowVirtual = new FrameRowControl(listView.rowSpace / 2);
- listView.AddChidren(rowVirtual);
- rowVirtual.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uVirtualDrive), 500);
- rowVirtual.AddRightArrow();
- rowVirtual.ButtonClickEvent += (sender, e) =>
- {
- var form = new GatewayVirtualDriveInfoForm();
- form.AddForm(listVode);
- };
- }
- //娌℃湁鏂扮増鏈�
- if (listVersionInfo[0] == null && listVersionInfo[1] == null && listVersionInfo[2] == null)
- {
- //鏈�鏂板浐浠剁増鏈�
- var rowNew = new FrameRowControl();
- rowNew.UseClickStatu = false;
- listView.AddChidren(rowNew);
- rowNew.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewFirmwareVersion), 500);
- rowNew.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 500);
- }
- //鍒掔嚎
- for (int i = 0; i < listView.ChildrenCount - 1; i++)
- {
- ((FrameRowControl)listView.GetChildren(i)).AddBottomLine();
- }
-
- //璋冩暣鐪熷疄楂樺害
- listView.AdjustRealHeight(Application.GetRealHeight(23));
- frameBack.Height = listView.Bottom;
-
- return frameBack.Bottom;
- }
-
- /// <summary>
- /// 鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
- /// </summary>
- private void InitNewVersionControl(int YY)
- {
- var frameBack = new FrameLayout();
- frameBack.Y = YY + Application.GetRealHeight(35);
- frameBack.BackgroundColor = UserCenterColor.Current.White;
- frameBack.Height = Application.GetMinReal(832);
- bodyFrameLayout.AddChidren(frameBack);
-
- //鏈�鏂板浐浠剁増鏈�
- var btnTitle = new NormalViewControl(700, 65, true);
- btnTitle.X = ControlCommonResourse.XXLeft;
- btnTitle.Y = Application.GetRealHeight(30);
- btnTitle.TextID = R.MyInternationalizationString.uNewFirmwareVersion;
- btnTitle.TextSize = 15;
- frameBack.AddChidren(btnTitle);
-
- var listView = new VerticalListControl(12);
- listView.Y = Application.GetRealHeight(109);
- listView.Height = frameBack.Height - Application.GetRealHeight(109);
- frameBack.AddChidren(listView);
-
- //Linux
- if (listVersionInfo[0] != null)
- {
- var rowLinux = new FrameRowControl(listView.rowSpace / 2);
- rowLinux.UseClickStatu = false;
- listView.AddChidren(rowLinux);
- rowLinux.AddLeftCaption("Linux", 300);
- rowLinux.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[0].FirmwareVersion), 300);
- rowLinux.AddBottomLine();
- }
-
- //鍗忚皟鍣�
- if (listVersionInfo[1] != null)
- {
- var rowCoordinator = new FrameRowControl(listView.rowSpace / 2);
- rowCoordinator.UseClickStatu = false;
- listView.AddChidren(rowCoordinator);
- rowCoordinator.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCoordinator), 500);
- rowCoordinator.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[1].FirmwareVersion), 300);
- rowCoordinator.AddBottomLine();
- }
-
- //铏氭嫙椹卞姩
- if (listVersionInfo[2] != null)
- {
- var rowVirtual = new FrameRowControl(listView.rowSpace / 2);
- rowVirtual.UseClickStatu = false;
- listView.AddChidren(rowVirtual);
- rowVirtual.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uVirtualDrive), 500);
- rowVirtual.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[2].FirmwareVersion), 300);
- rowVirtual.AddBottomLine();
- }
-
- //娣诲姞鍥轰欢浠嬬粛琛�
- this.AddUpdateContent(listView);
-
- //鍗囩骇
- var btnUpdate = new BottomClickButton();
- btnUpdate.TextID = R.MyInternationalizationString.uLevelUp;
- bodyFrameLayout.AddChidren(btnUpdate);
- btnUpdate.ButtonClickEvent += (sender, e) =>
- {
- ZbGateway realway = null;
- if (HdlGatewayLogic.Current.GetRealGateway(ref realway, zbGateway) == false)
- {
- //閿欒:缃戝叧瀵硅薄涓㈠け
- string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
- this.ShowMassage(ShowMsgType.Error, msg);
- return;
- }
- //鐣岄潰鍙冲垝涓嶅彲
- UserView.HomePage.Instance.ScrollEnabled = false;
- Shared.Common.CommonPage.BackKeyCanClick = false;
-
- var form = new GatewayFirmwareUpdateForm();
- form.CloseFormByClickBack = false;
- form.AddForm(realway, listVersionInfo[2], listVersionInfo[1], listVersionInfo[0], this.listVode);
- //瀹屾垚鍗囩骇浜嬩欢
- form.FinishUpdateEvent += (() =>
- {
- //鍒濆鍖栦腑閮ㄦ帶浠�
- this.InitMiddleFrame();
- });
- };
- }
-
- #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) =>
- {
- //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
- this.ShowTopRightMenu();
- });
- }
-
- /// <summary>
- /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
- /// </summary>
- private void ShowTopRightMenu()
- {
- var frame = new TopRightMenuControl(1);
- //鍘嗗彶鐗堟湰
- var deviceMenu = Language.StringByID(R.MyInternationalizationString.uHistoryVersion);
- frame.AddRowMenu(deviceMenu, "", "", () =>
- {
- var form = new GatewayHistoryFirmwareVersionForm();
- form.AddForm(zbGateway, listVersionInfo[2], listVersionInfo[1], listVersionInfo[0], listVode);
- form.SelectFirmwareInfoEvent += (info1,info2,info3,listCode) =>
- {
- listVersionInfo[2] = info1;
- listVersionInfo[1] = info2;
- listVersionInfo[0] = info3;
- listVode = listCode;
-
- //鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
- var yy = this.InitNowVersionControl();
- if (listVersionInfo[0] != null || listVersionInfo[1] != null || listVersionInfo[2] != null)
- {
- //鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
- this.InitNewVersionControl(yy);
- }
- };
- });
- }
-
- #endregion
-
- #region 鈻� 娣诲姞鍥轰欢浠嬬粛琛宊____________________
-
- /// <summary>
- /// 娣诲姞鍥轰欢浠嬬粛琛�
- /// </summary>
- /// <param name="listContent">鍒楄〃鎺т欢</param>
- private void AddUpdateContent(VerticalListControl listContent)
- {
- //淇敼鍐呭
- var frameContent = new FrameLayout();
- frameContent.Height = Application.GetRealHeight(87);
- listContent.AddChidren(frameContent);
- var btnContent = new NormalViewControl(500, 87, true);
- btnContent.X = ControlCommonResourse.XXLeft;
- btnContent.Y = Application.GetRealHeight(28);
- btnContent.TextID = R.MyInternationalizationString.uEditorContent;
- btnContent.TextSize = 12;
- frameContent.AddChidren(btnContent);
-
- foreach (var info in this.listVersionInfo)
- {
- if (info == null)
- {
- continue;
- }
- foreach (var msg in info.UpdateContent)
- {
- var btnRow = new FrameRowControl();
- btnRow.UseClickStatu = false;
- btnRow.Height = Application.GetRealHeight(40);
- listContent.AddChidren(btnRow);
-
- var btnMsg = btnRow.AddLeftCaption(msg, 965);
- btnMsg.TextSize = 10;
- btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
- }
- }
- //娣诲姞搴曢儴绌虹櫧闂撮殭
- var frameSpace3 = new FrameLayout();
- frameSpace3.Height = Application.GetRealHeight(58);
- listContent.AddChidren(frameSpace3);
- }
-
- #endregion
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
index 423d87f..ce5d9ed 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
@@ -6,36 +6,24 @@
namespace Shared.Phone.UserCenter.GatewayUpdate
{
/// <summary>
- /// 鍥轰欢鍗囩骇鐢婚潰
+ /// 缃戝叧鍥轰欢鍗囩骇鐣岄潰
/// </summary>
- public class GatewayFirmwareUpdateForm : DialogCommonForm
+ public class GatewayFirmwareUpdateForm : EditorCommonForm
{
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
- /// 瑕佸崌绾х殑缃戝叧
+ /// 褰撳墠閫夋嫨鐨勭綉鍏�
/// </summary>
- private ZbGateway upDatezbGateway = null;
+ private ZbGateway zbGateway = null;
/// <summary>
- /// 铏氭嫙璁惧鐨勫浐浠朵俊鎭�
+ /// 鍗囩骇鍥轰欢淇℃伅(0:Linux鏂扮増鏈� 1:鍗忚皟鍣ㄦ柊鐗堟湰 2锝瀀:閮芥槸铏氭嫙椹卞姩鐨�)
/// </summary>
- private FirmwareVersionInfo virtualFirmware = null;
- /// <summary>
- /// 鍗忚皟鍣ㄦ柊鐗堟湰鐨勫浐浠朵俊鎭�
- /// </summary>
- private FirmwareVersionInfo coordinatorFirmware = null;
- /// <summary>
- /// 缃戝叧鏂扮増鏈殑鍥轰欢淇℃伅
- /// </summary>
- private FirmwareVersionInfo gatewayFirmware = null;
+ private List<FirmwareVersionInfo> listVersionInfo = null;
/// <summary>
/// 铏氭嫙椹卞姩鍙�
/// </summary>
private List<ZbGatewayData.DriveCodeObj> listVode = null;
- /// <summary>
- /// 璁惧鎴愬姛鍗囩骇瀹屾垚鐨勫洖璋冨嚱鏁�
- /// </summary>
- public Action FinishUpdateEvent = null;
#endregion
@@ -44,99 +32,334 @@
/// <summary>
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
- /// <param name="i_zbGateway">缃戝叧</param>
- /// <param name="i_virtualFirmware">铏氭嫙璁惧鐨勫浐浠朵俊鎭�</param>
- /// <param name="i_coordinatorFirmware">鍗忚皟鍣ㄦ柊鐗堟湰鐨勫浐浠朵俊鎭�</param>
- /// <param name="i_gatewayFirmware">缃戝叧鏂扮増鏈殑鍥轰欢淇℃伅</param>
- /// <param name="i_listVode">铏氭嫙椹卞姩</param>
- public void ShowForm(ZbGateway i_zbGateway, FirmwareVersionInfo i_virtualFirmware, FirmwareVersionInfo i_coordinatorFirmware,
- FirmwareVersionInfo i_gatewayFirmware, List<ZbGatewayData.DriveCodeObj> i_listVode)
+ /// <param name="i_zbGateway">褰撳墠閫夋嫨鐨勭綉鍏�</param>
+ public void ShowForm(ZbGateway i_zbGateway)
{
- this.upDatezbGateway = i_zbGateway;
- this.virtualFirmware = i_virtualFirmware;
- this.coordinatorFirmware = i_coordinatorFirmware;
- this.gatewayFirmware = i_gatewayFirmware;
- this.listVode = i_listVode;
+ this.zbGateway = i_zbGateway;
- //鍒濆鍖栦腑閮ㄤ俊鎭�
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFirmwareUpdate));
+
+ //鍒濆鍖栧彸涓婅鑿滃崟
+ this.InitTopRightMenu();
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
this.InitMiddleFrame();
}
/// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// 鍒濆鍖栦腑閮ㄦ帶浠�
/// </summary>
private void InitMiddleFrame()
{
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ HdlThreadLogic.Current.RunThread(async () =>
+ {
+ //寮�鍚繘搴︽潯
+ this.ShowProgressBar();
+
+ //鑾峰彇缃戝叧鏂扮増鏈俊鎭�
+ this.listVersionInfo = await HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
+ if (listVersionInfo == null)
+ {
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar(ShowReLoadMode.YES);
+ return;
+ }
+ //铏氭嫙椹卞姩鍙�
+ this.listVode = await HdlGatewayLogic.Current.GetListVDDriveCode(this.zbGateway);
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
+ var yy = this.InitNowVersionControl();
+ if (listVersionInfo[0] != null || listVersionInfo[1] != null || listVersionInfo[2] != null)
+ {
+ //鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
+ this.InitNewVersionControl(yy);
+ }
+ });
+ });
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
+ /// </summary>
+ private int InitNowVersionControl()
+ {
+ bodyFrameLayout.RemoveAll();
+
var frameBack = new FrameLayout();
- frameBack.Width = Application.GetRealWidth(674);
- frameBack.Height = Application.GetRealHeight(386);
frameBack.BackgroundColor = UserCenterColor.Current.White;
- frameBack.Gravity = Gravity.CenterHorizontal;
- frameBack.Y = Application.GetRealHeight(683);
- frameBack.Radius = (uint)Application.GetRealHeight(17);
+ frameBack.Height = Application.GetMinReal(800);
bodyFrameLayout.AddChidren(frameBack);
- //杩涘害鏄剧ず鏂囨湰
- var btnText = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false);
- btnText.Y = Application.GetRealHeight(248);
- btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
- btnText.TextAlignment = TextAlignment.Center;
- //btnText.Text = "鍗囩骇涓�";
- frameBack.AddChidren(btnText);
+ //褰撳墠鍥轰欢鐗堟湰
+ var btnTitle = new NormalViewControl(700, 65, true);
+ btnTitle.X = ControlCommonResourse.XXLeft;
+ btnTitle.Y = Application.GetRealHeight(30);
+ btnTitle.TextID = R.MyInternationalizationString.uNowFirmwareVersion;
+ btnTitle.TextSize = 15;
+ frameBack.AddChidren(btnTitle);
- //杩涘害鏉�
- var btnProRow = new FrameLayout();
- btnProRow.Gravity = Gravity.CenterHorizontal;
- btnProRow.Y = Application.GetRealHeight(161);
- btnProRow.Width = Application.GetRealWidth(559);
- btnProRow.Height = Application.GetRealHeight(29);
- btnProRow.BackgroundColor = 0xfff5f5f5;
- btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2;
- frameBack.AddChidren(btnProRow);
- var btnProgressBar = new FrameLayout();
- btnProgressBar.Width = 0;
- btnProgressBar.Height = btnProRow.Height;
- btnProgressBar.BackgroundColor = 0xfffb744a;
- btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
- btnProRow.AddChidren(btnProgressBar);
+ var listView = new VerticalListControl(12);
+ listView.Y = Application.GetRealHeight(109);
+ listView.Height = Application.GetRealHeight(800);
+ frameBack.AddChidren(listView);
- //杩涘害鍊兼枃鏈�
- var frameProgress = new FrameLayout();
- frameProgress.Width = Application.GetRealWidth(84);
- frameProgress.Height = Application.GetRealHeight(60);
- frameProgress.Y = Application.GetRealHeight(86);
- frameBack.AddChidren(frameProgress);
- frameProgress.X = btnProRow.X + btnProgressBar.Right - frameProgress.Width / 2;
- var btnProgressPic = new PicViewControl(84, 60);
- btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
- frameProgress.AddChidren(btnProgressPic);
- var btnProgressView = new NormalViewControl(84, 45, true);
- btnProgressView.TextSize = 10;
- btnProgressView.TextAlignment = TextAlignment.Center;
- btnProgressView.Text = "0%";
- frameProgress.AddChidren(btnProgressView);
+ //Linux
+ var rowLinux = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowLinux);
+ rowLinux.AddLeftCaption("Linux", 300);
+ rowLinux.AddRightArrow();
+ rowLinux.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new GatewayLinuxInfoForm();
+ form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ };
- //璁惧鍗囩骇
- this.GatewayUpdateMethod(btnText, btnProgressView, frameProgress, btnProgressBar, btnProRow.Width);
+ //鍗忚皟鍣�
+ var rowCoordinator = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowCoordinator);
+ rowCoordinator.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCoordinator), 500);
+ rowCoordinator.AddRightArrow();
+ rowCoordinator.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new GatewayCoordinatorInfoForm();
+ form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+ };
+
+ if (this.listVode != null)
+ {
+ //铏氭嫙椹卞姩
+ var rowVirtual = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowVirtual);
+ rowVirtual.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uVirtualDrive), 500);
+ rowVirtual.AddRightArrow();
+ rowVirtual.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new GatewayVirtualDriveInfoForm();
+ form.AddForm(listVode);
+ };
+ }
+ //娌℃湁鏂扮増鏈�
+ if (listVersionInfo[0] == null && listVersionInfo[1] == null && listVersionInfo[2] == null)
+ {
+ //鏈�鏂板浐浠剁増鏈�
+ var rowNew = new FrameRowControl();
+ rowNew.UseClickStatu = false;
+ listView.AddChidren(rowNew);
+ rowNew.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNewFirmwareVersion), 500);
+ rowNew.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 500);
+ }
+ //鍒掔嚎
+ for (int i = 0; i < listView.ChildrenCount - 1; i++)
+ {
+ ((FrameRowControl)listView.GetChildren(i)).AddBottomLine();
+ }
+
+ //璋冩暣鐪熷疄楂樺害
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
+ frameBack.Height = listView.Bottom;
+
+ return frameBack.Bottom;
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
+ /// </summary>
+ private void InitNewVersionControl(int YY)
+ {
+ var frameBack = new FrameLayout();
+ frameBack.Y = YY + Application.GetRealHeight(35);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Height = Application.GetMinReal(832);
+ bodyFrameLayout.AddChidren(frameBack);
+
+ //鏈�鏂板浐浠剁増鏈�
+ var btnTitle = new NormalViewControl(700, 65, true);
+ btnTitle.X = ControlCommonResourse.XXLeft;
+ btnTitle.Y = Application.GetRealHeight(30);
+ btnTitle.TextID = R.MyInternationalizationString.uNewFirmwareVersion;
+ btnTitle.TextSize = 15;
+ frameBack.AddChidren(btnTitle);
+
+ var listView = new VerticalListControl(12);
+ listView.Y = Application.GetRealHeight(109);
+ listView.Height = frameBack.Height - Application.GetRealHeight(109);
+ frameBack.AddChidren(listView);
+
+ //Linux
+ if (listVersionInfo[0] != null)
+ {
+ var rowLinux = new FrameRowControl(listView.rowSpace / 2);
+ rowLinux.UseClickStatu = false;
+ listView.AddChidren(rowLinux);
+ rowLinux.AddLeftCaption("Linux", 300);
+ rowLinux.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[0].FirmwareVersion), 300);
+ rowLinux.AddBottomLine();
+ }
+
+ //鍗忚皟鍣�
+ if (listVersionInfo[1] != null)
+ {
+ var rowCoordinator = new FrameRowControl(listView.rowSpace / 2);
+ rowCoordinator.UseClickStatu = false;
+ listView.AddChidren(rowCoordinator);
+ rowCoordinator.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCoordinator), 500);
+ rowCoordinator.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[1].FirmwareVersion), 300);
+ rowCoordinator.AddBottomLine();
+ }
+
+ //铏氭嫙椹卞姩
+ if (listVersionInfo[2] != null)
+ {
+ var rowVirtual = new FrameRowControl(listView.rowSpace / 2);
+ rowVirtual.UseClickStatu = false;
+ listView.AddChidren(rowVirtual);
+ rowVirtual.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uVirtualDrive), 500);
+ rowVirtual.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listVersionInfo[2].FirmwareVersion), 300);
+ rowVirtual.AddBottomLine();
+ }
+
+ //娣诲姞鍥轰欢浠嬬粛琛�
+ this.AddUpdateContent(listView);
+
+ //鍗囩骇
+ var btnUpdate = new BottomClickButton();
+ btnUpdate.TextID = R.MyInternationalizationString.uLevelUp;
+ bodyFrameLayout.AddChidren(btnUpdate);
+ btnUpdate.ButtonClickEvent += (sender, e) =>
+ {
+ ZbGateway realway = null;
+ if (HdlGatewayLogic.Current.GetRealGateway(ref realway, zbGateway) == false)
+ {
+ //閿欒:缃戝叧瀵硅薄涓㈠け
+ string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
+ this.ShowMassage(ShowMsgType.Error, msg);
+ return;
+ }
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //缃戝叧鍗囩骇
+ DoGatewayUpdate(realway);
+ });
+ };
}
#endregion
- #region 鈻� 璁惧鍗囩骇___________________________
+ #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) =>
+ {
+ //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ this.ShowTopRightMenu();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
+ /// </summary>
+ private void ShowTopRightMenu()
+ {
+ var frame = new TopRightMenuControl(1);
+ //鍘嗗彶鐗堟湰
+ var deviceMenu = Language.StringByID(R.MyInternationalizationString.uHistoryVersion);
+ frame.AddRowMenu(deviceMenu, "", "", () =>
+ {
+ var form = new GatewayHistoryFirmwareVersionForm();
+ form.AddForm(zbGateway, listVersionInfo[2], listVersionInfo[1], listVersionInfo[0], listVode);
+ form.SelectFirmwareInfoEvent += (info1,info2,info3,listCode) =>
+ {
+ listVersionInfo[2] = info1;
+ listVersionInfo[1] = info2;
+ listVersionInfo[0] = info3;
+ listVode = listCode;
+
+ //鍒濆鍖栧綋鍓嶇増鏈殑鎺т欢
+ var yy = this.InitNowVersionControl();
+ if (listVersionInfo[0] != null || listVersionInfo[1] != null || listVersionInfo[2] != null)
+ {
+ //鍒濆鍖栨柊鐗堟湰鐨勬帶浠�
+ this.InitNewVersionControl(yy);
+ }
+ };
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 娣诲姞鍥轰欢浠嬬粛琛宊____________________
+
+ /// <summary>
+ /// 娣诲姞鍥轰欢浠嬬粛琛�
+ /// </summary>
+ /// <param name="listContent">鍒楄〃鎺т欢</param>
+ private void AddUpdateContent(VerticalListControl listContent)
+ {
+ //淇敼鍐呭
+ var frameContent = new FrameLayout();
+ frameContent.Height = Application.GetRealHeight(87);
+ listContent.AddChidren(frameContent);
+ var btnContent = new NormalViewControl(500, 87, true);
+ btnContent.X = ControlCommonResourse.XXLeft;
+ btnContent.Y = Application.GetRealHeight(28);
+ btnContent.TextID = R.MyInternationalizationString.uEditorContent;
+ btnContent.TextSize = 12;
+ frameContent.AddChidren(btnContent);
+
+ foreach (var info in this.listVersionInfo)
+ {
+ if (info == null)
+ {
+ continue;
+ }
+ foreach (var msg in info.UpdateContent)
+ {
+ var btnRow = new FrameRowControl();
+ btnRow.UseClickStatu = false;
+ btnRow.Height = Application.GetRealHeight(40);
+ listContent.AddChidren(btnRow);
+
+ var btnMsg = btnRow.AddLeftCaption(msg, 965);
+ btnMsg.TextSize = 10;
+ btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
+ }
+ }
+ //娣诲姞搴曢儴绌虹櫧闂撮殭
+ var frameSpace3 = new FrameLayout();
+ frameSpace3.Height = Application.GetRealHeight(58);
+ listContent.AddChidren(frameSpace3);
+ }
+
+ #endregion
+
+ #region 鈻� 缃戝叧鍗囩骇___________________________
/// <summary>
/// 缃戝叧鍗囩骇
/// </summary>
- /// <param name="btnText">鏍囬鎺т欢</param>
- /// <param name="btnProgressView">杩涘害鍊兼枃鏈殑鏄剧ず鎺т欢</param>
- /// <param name="frameProgress">杩涘害鍊艰兘澶熺Щ鍔ㄧ殑閭d釜妗嗘帶浠�</param>
- /// <param name="btnProgressBar">杩涘害鏉�</param>
- /// <param name="ProRowWidth">杩涘害鏉″鍣ㄧ殑鏈�澶у搴�</param>
- private void GatewayUpdateMethod(NormalViewControl btnText, NormalViewControl btnProgressView,
- FrameLayout frameProgress, FrameLayout btnProgressBar, int ProRowWidth)
+ private void DoGatewayUpdate(ZbGateway realway)
{
- //璁惧鍗囩骇
- var updateLogic = new HdlGatewayUpdateLogic(this.upDatezbGateway, virtualFirmware, coordinatorFirmware, gatewayFirmware);
+ //鎵撳紑杩涘害鏉�
+ ProgressFormBar.Current.Start();
+ //缃戝叧鍗囩骇
+ var updateLogic = new HdlGatewayUpdateLogic(realway, listVersionInfo[2], listVersionInfo[1], listVersionInfo[0]);
//鏇存柊鐘舵�佸彉鍖栫殑浜嬩欢
updateLogic.UpdateStatuChangedEvent += (div, msg) =>
{
@@ -146,70 +369,47 @@
{
//寮傚父
this.ShowMassage(ShowMsgType.Tip, msg);
- this.CloseForm();
+ ProgressFormBar.Current.Close();
}
else if (div == 0)
{
//涓�鑸俊鎭�
- btnText.Text = msg;
+ ProgressFormBar.Current.SetMsg(msg);
}
else if (div == 1)
{
//鍗囩骇瀹屾垚
- btnText.Text = msg;
+ ProgressFormBar.Current.Close();
this.ShowMassage(ShowMsgType.Tip, msg);
- //璋冪敤鍥炶皟鍑芥暟
- this.FinishUpdateEvent?.Invoke();
- this.CloseForm();
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ });
}
});
};
//杩涘害鍊兼敼鍙樹簨浠�
updateLogic.ProgressEvent += (value) =>
{
- Application.RunOnMainThread(() =>
- {
- //杩涘害鏉�
- int width = (int)(value * ProRowWidth);
- btnProgressBar.Width = width;
-
- //鏂囨湰鏄剧ず
- int persent = (int)(value * 100);
- btnProgressView.Text = persent + "%";
- //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩
- frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2;
- });
-
+ ProgressFormBar.Current.SetValue(value);
};
//缃戝叧鍗囩骇寮�濮�
updateLogic.StartUpdateReady();
- }
-
- #endregion
-
- #region 鈻� 鐣岄潰鍏抽棴___________________________
-
- /// <summary>
- /// 鐢婚潰鍏抽棴
- /// </summary>
- public override void CloseFormBefore()
- {
- //瀹夊崜鍙互鐐瑰嚮绯荤粺鐨勮繑鍥為敭
- UserView.HomePage.Instance.ScrollEnabled = true;
- Shared.Common.CommonPage.BackKeyCanClick = true;
-
- //鍗囩骇瀵硅薄
- string gwId = HdlGatewayLogic.Current.GetGatewayId(upDatezbGateway);
- if (FirmwareUpdateResourse.dicGatewayUpdateList.ContainsKey(gwId) == true
- && FirmwareUpdateResourse.dicGatewayUpdateList[gwId].IsFinishUpdate == true)
+ //鍏抽棴浜嬩欢
+ ProgressFormBar.Current.CloseEvent += () =>
{
- //濡傛灉缃戝叧宸茬粡鍗囩骇瀹屾垚锛岀晫闈㈠叧闂椂锛屽垯绉婚櫎鍐呭瓨
- FirmwareUpdateResourse.dicGatewayUpdateList[gwId].Dispose();
- FirmwareUpdateResourse.dicGatewayUpdateList.Remove(gwId);
- }
- this.FinishUpdateEvent = null;
-
- base.CloseFormBefore();
+ //鍗囩骇瀵硅薄
+ string gwId = HdlGatewayLogic.Current.GetGatewayId(realway);
+ if (FirmwareUpdateResourse.dicGatewayUpdateList.ContainsKey(gwId) == true
+ && FirmwareUpdateResourse.dicGatewayUpdateList[gwId].IsFinishUpdate == true)
+ {
+ //濡傛灉缃戝叧宸茬粡鍗囩骇瀹屾垚锛岀晫闈㈠叧闂椂锛屽垯绉婚櫎鍐呭瓨
+ FirmwareUpdateResourse.dicGatewayUpdateList[gwId].Dispose();
+ FirmwareUpdateResourse.dicGatewayUpdateList.Remove(gwId);
+ }
+ };
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
index 29e6cb7..429fcee 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
@@ -60,7 +60,9 @@
this.AddRowControl("璐﹀彿绫诲瀷", 400, Common.Config.Instance.Home.AccountType.ToString(), 400);
- this.AddRowControl("鏄惁杩滅▼杩炴帴", 400, ZigBee.Device.ZbGateway.IsRemote == true ? "鏄�" : "鍚�", 400);
+ this.AddRowControl("杩滅▼杩炴帴", 400, ZigBee.Device.ZbGateway.IsRemote == true ? "鏄�" : "鍚�", 400);
+
+ this.AddRowControl("鎷ユ湁杩滅▼鏉冮檺", 400, ZigBee.Device.ZbGateway.AllowRemoteCtrl == true ? "鏄�" : "鍚�", 400);
int count = HdlGatewayLogic.Current.GetAllLocalGateway().Count;
var row1 = new FrameRowControl(listView.rowSpace / 2);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs
index 37f8867..5e1a23c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberInfoForm.cs
@@ -176,7 +176,7 @@
//鎴愬憳娣诲姞鎴愬姛
var form = new AddMemberSuccessForm();
- form.AddForm(memberInfoRes);
+ form.AddForm(memberInfoRes, memberResult.DistributedMark);
form.FormCloseEvent += (() =>
{
this.CloseForm();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs
index 35b2fb0..c333302 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs
@@ -32,19 +32,20 @@
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
/// <param name="i_memberResult">鎴愬憳淇℃伅</param>
- public void ShowForm(MemberInfoRes i_memberResult)
+ /// <param name="i_iconMark">澶村儚鐨凪ark</param>
+ public void ShowForm(MemberInfoRes i_memberResult, string i_iconMark)
{
this.memberResult = i_memberResult;
//鍒濆鍖栦腑閮ㄦ帶浠�
- this.InitMiddleFrame();
+ this.InitMiddleFrame(i_iconMark);
}
/// <summary>
/// 鍒濆鍖栦腑閮ㄦ帶浠�
/// </summary>
- private void InitMiddleFrame()
+ private void InitMiddleFrame(string i_iconMark)
{
//鑳屾櫙妗�
var frame = new FrameLayout();
@@ -56,7 +57,7 @@
bodyFrameLayout.AddChidren(frame);
//鐢ㄦ埛鍥炬爣
- string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, memberResult.DistributedMark + ".png");
+ string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, i_iconMark + ".png");
var btnUserIcon = new ImageView();
btnUserIcon.Height = Application.GetMinRealAverage(207);
btnUserIcon.Width = Application.GetMinRealAverage(207);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
index 65a204d..0973115 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
@@ -257,12 +257,11 @@
{
HouseDistributedMark = Common.Config.Instance.Home.Id,
DistributedMark = this.memberInfo.DistributedMark,
- IsAllowRemoteCtrl = !btnSwitch.IsSelected,
- IsOtherAccountCtrl = Common.Config.Instance.isAdministrator
+ IsAllowRemoteCtrl = !btnSwitch.IsSelected
};
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
- var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl", true, pra);
+ var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl", false, pra);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
@@ -270,6 +269,8 @@
{
return;
}
+ this.memberInfo.IsAllowRemoteCtrl = !btnSwitch.IsSelected;
+
Application.RunOnMainThread(() =>
{
btnSwitch.IsSelected = !btnSwitch.IsSelected;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
index 9f840e4..36fcf3d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
@@ -223,6 +223,8 @@
Config.Instance.HomeId = info.Id;
Global.CreateHomeDirectory(info.Id);
+ //閲嶆柊鍒濆鍖栦綇瀹呭璞�
+ Config.Instance.Home = House.GetHouseByHouseId(info.Id);
Config.Instance.Save();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenterLogic.InitUserCenterMenmoryAndThread(false);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 99ce126..0e73874 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -428,6 +428,8 @@
}
}
}
+ //璋冩暣鍒楄〃鎺т欢楂樺害
+ listView.AdjustChidrenFrameHeight(listView.frameTable, Application.GetRealHeight(46));
//寮�鍚紶鎰熷櫒鎶ヨ鐩戣
this.StartCheckDeviceAlarm();
//寮�鍚澶囧湪绾跨洃娴�
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
index fc11533..d301389 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
@@ -122,231 +122,211 @@
{
try
{
+ if (common.DeviceStatusReport.AttriBute == null || common.DeviceStatusReport.AttriBute.Count == 0)
+ {
+ return;
+ }
for (int i = 0; deviceVerticalScrolViewLayout != null && i < deviceVerticalScrolViewLayout.ChildrenCount; i++)
{
var rowFL = deviceVerticalScrolViewLayout.GetChildren(i) as FrameLayout;
- var deviceUI = rowFL.Tag as DeviceUI;
- if (deviceUI.CommonDevice == null || rowFL.ChildrenCount == 0)
+ if (rowFL.ChildrenCount == 0)
{
//璁惧涓虹┖鎴栬�呮帶浠朵负绌�
continue;
}
- if (common.DeviceAddr != deviceUI.CommonDevice.DeviceAddr || common.DeviceEpoint != deviceUI.CommonDevice.DeviceEpoint)
- {
- //鍒ゆ柇鏄惁涓哄綋鍓嶈澶�
- continue;
- }
- var frameLayout = rowFL.GetChildren(0) as FrameLayout;
- switch (deviceUI.CommonDevice.Type)
- {
- case DeviceType.OnOffOutput:
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight;
- onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
+ for (int j=0;j<rowFL.ChildrenCount;j++)
+ {
+ var deviceUI = (rowFL.GetChildren(j) as FunctionMainView).Tag as DeviceUI;
+ if (deviceUI == null || deviceUI.CommonDevice == null)
+ {
+ //璁惧涓虹┖鎴栬�呮帶浠朵负绌�
+ continue;
+ }
+ if (common.DeviceAddr != deviceUI.CommonDevice.DeviceAddr || common.DeviceEpoint != deviceUI.CommonDevice.DeviceEpoint)
+ {
+ //鍒ゆ柇鏄惁涓哄綋鍓嶈澶�
+ continue;
+ }
- //璁板綍銆佹洿鏂扮姸鎬�
- if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0)
- {
- continue;
- }
- onOffOutputLight.OnOffStatus = onOffOutputLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- (rowFL.GetChildren(0) as FunctionMainView).IsSelected = onOffOutputLight.OnOffStatus == 1;
- (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
- //璁板綍鍥炲鏃堕棿
- onOffOutputLight.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.AirSwitch:
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
- airSwitch.DeviceStatusReport = common.DeviceStatusReport;
- for (int j = 0; j < frameLayout.ChildrenCount; j++)
+ switch (deviceUI.CommonDevice.Type)
+ {
+ case DeviceType.OnOffOutput:
+ //寮�鍏冲姛鑳�
+ if (common.DeviceStatusReport.CluterID == 6)
{
- var tempView = frameLayout.GetChildren(j);
- if (tempView.Tag == null)
- {
- continue;
- }
- if (tempView.Tag.ToString() == deviceStatus_OnOffStatus)
- {
- //璁板綍銆佹洿鏂扮姸鎬�
- if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
- airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData;
- (rowFL.GetChildren(0) as FunctionMainView).IsSelected = airSwitch.OnOffStatus == 1;
- (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
- //璁板綍鍥炲鏃堕棿
- airSwitch.LastDateTime = DateTime.Now;
- }
+ var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight;
+ onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
+ onOffOutputLight.OnOffStatus = onOffOutputLight.DeviceStatusReport.AttriBute[0].AttriButeData;
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = onOffOutputLight.OnOffStatus == 1;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
+ onOffOutputLight.LastDateTime = DateTime.Now;
+ }
+ break;
+
+ case DeviceType.AirSwitch:
+ //寮�鍏冲姛鑳�
+ if (common.DeviceStatusReport.CluterID == 6)
+ {
+ var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
+ airSwitch.DeviceStatusReport = common.DeviceStatusReport;
+ airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData;
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = airSwitch.OnOffStatus == 1;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
+ airSwitch.LastDateTime = DateTime.Now;
}
- }
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (common.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.CommonDevice.IsOnline = 1;
- deviceUI.CommonDevice.LastDateTime = DateTime.Now;
- }
- break;
-
- case DeviceType.WindowCoveringDevice:
- if (common.DeviceStatusReport.CluterID == 258)
- {
- if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+ //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
+ if (common.DeviceStatusReport.CluterID == 3)
{
- //绐楀笜绫诲瀷
- var rollerShade = deviceUI.CommonDevice as Rollershade;
- rollerShade.DeviceStatusReport = common.DeviceStatusReport;
- rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData;
- rollerShade.LastDateTime = DateTime.Now;
- (rowFL.GetChildren(0) as FunctionMainView).IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
- (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
+ deviceUI.CommonDevice.IsOnline = 1;
+ deviceUI.CommonDevice.LastDateTime = DateTime.Now;
}
- }
- if (common.DeviceStatusReport.CluterID == 3)
- {
- deviceUI.CommonDevice.IsOnline = 1;
- deviceUI.CommonDevice.LastDateTime = DateTime.Now;
- }
- break;
+ break;
- case DeviceType.Thermostat:
- //AC鍔熻兘
- if (common.DeviceStatusReport.CluterID == 513)
- {
- var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
- ac.DeviceStatusReport = common.DeviceStatusReport;
- var attriButeList = ac.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
+ case DeviceType.WindowCoveringDevice:
+ if (common.DeviceStatusReport.CluterID == 258)
{
- continue;
+ if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+ {
+ //绐楀笜绫诲瀷
+ var rollerShade = deviceUI.CommonDevice as Rollershade;
+ rollerShade.DeviceStatusReport = common.DeviceStatusReport;
+ rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData;
+ rollerShade.LastDateTime = DateTime.Now;
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
+ }
+ if (common.DeviceStatusReport.AttriBute[0].AttributeId == 8)
+ {
+ //绐楀笜鐧惧垎姣�
+ var rollerShade = deviceUI.CommonDevice as Rollershade;
+ rollerShade.DeviceStatusReport = common.DeviceStatusReport;
+ rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData;
+ rollerShade.LastDateTime = DateTime.Now;
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
+ }
}
-
- var curTemp = (attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default;
- switch (attriButeList[0].AttributeId)
+ if (common.DeviceStatusReport.CluterID == 3)
{
- case 0:
- //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
- ac.currentLocalTemperature = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
+ deviceUI.CommonDevice.IsOnline = 1;
+ deviceUI.CommonDevice.LastDateTime = DateTime.Now;
+ }
+ break;
- case 17:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鍐锋俯搴︼紝瀹為檯娓╁害涓衡�淐oolingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentCoolingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 18:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentHeatingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 4096:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentAutoSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 28:
- //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
- ac.currentSystemMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 4099:
- var value = Convert.ToString(attriButeList[0].AttriButeData, 2).PadLeft(16, '0');
- var modeStr = value.Substring(value.Length - 5, 5);
- for (int j = 0; j < modeStr.Length; j++)
+ case DeviceType.Thermostat:
+ //AC鍔熻兘
+ if (common.DeviceStatusReport.CluterID == 513)
+ {
+ var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
+ ac.DeviceStatusReport = common.DeviceStatusReport;
+ var attriButeList = ac.DeviceStatusReport.AttriBute;
+ foreach(var attList in attriButeList)
+ {
+ var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
+ switch (attList.AttributeId)
{
- ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
+ case 0:
+ //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
+ ac.currentLocalTemperature = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 17:
+ //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鍐锋俯搴︼紝瀹為檯娓╁害涓衡�淐oolingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+ ac.currentCoolingSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 18:
+ //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+ ac.currentHeatingSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4096:
+ //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+ ac.currentAutoSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+
+ case 28:
+ //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
+ ac.currentSystemMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4099:
+ var value = Convert.ToString(attList.AttriButeData, 2).PadLeft(16, '0');
+ var modeStr = value.Substring(value.Length - 5, 5);
+ for (int k = 0; k < modeStr.Length; k++)
+ {
+ ac.listSupportMode[k] = Convert.ToInt32(modeStr[k]) == 49 ? 1 : 0;
+ }
+ break;
}
- break;
+ }
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = ac.currentSystemMode != 0;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
}
- (rowFL.GetChildren(0) as FunctionMainView).IsSelected = ac.currentSystemMode != 0;
- (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
- }
- if (common.DeviceStatusReport.CluterID == 514)
- {
- var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
- var attriButeList = common.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
+ if (common.DeviceStatusReport.CluterID == 514)
{
- return;
+ var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
+ var attriButeList = common.DeviceStatusReport.AttriBute;
+ ac.DeviceStatusReport = common.DeviceStatusReport;
+ foreach(var attList in attriButeList)
+ {
+ switch (attList.AttributeId)
+ {
+ case 0:
+ ac.currentFanMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4096:
+ ac.currentFanSwingMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ }
+ }
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = ac.currentSystemMode != 0;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
}
- ac.DeviceStatusReport = common.DeviceStatusReport;
- switch (attriButeList[0].AttributeId)
+ //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
+ if (common.DeviceStatusReport.CluterID == 3)
{
- case 0:
- ac.currentFanMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentFanSwingMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
+ var ac = deviceUI.CommonDevice as AC;
+ ac.IsOnline = 1;
+ ac.LastDateTime = DateTime.Now;
}
- (rowFL.GetChildren(0) as FunctionMainView).IsSelected = ac.currentSystemMode != 0;
- (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
- }
- //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if (common.DeviceStatusReport.CluterID == 3)
- {
- var ac = deviceUI.CommonDevice as AC;
- ac.IsOnline = 1;
- ac.LastDateTime = DateTime.Now;
- }
- break;
+ break;
- case DeviceType.DimmableLight:
- //璋冨厜鐏姛鑳�
- //寮�鍏冲姛鑳�
- if (common.DeviceStatusReport.CluterID == 6)
- {
- var dimmableLight = deviceUI.CommonDevice as DimmableLight;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
+ case DeviceType.DimmableLight:
+ //璋冨厜鐏姛鑳�
+ if (common.DeviceStatusReport.CluterID == 6)
{
- return;
+ var dimmableLight = deviceUI.CommonDevice as DimmableLight;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
+ dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = dimmableLight.OnOffStatus == 1;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
+ dimmableLight.LastDateTime = DateTime.Now;
}
- dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
- (rowFL.GetChildren(0) as FunctionMainView).IsSelected = dimmableLight.OnOffStatus == 1;
- (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
- //璁板綍鍥炲鏃堕棿
- dimmableLight.LastDateTime = DateTime.Now;
- }
- //浜害
- if (common.DeviceStatusReport.CluterID == 8)
- {
- var dimmableLight = deviceUI.CommonDevice as DimmableLight;
- dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
+ //浜害
+ if (common.DeviceStatusReport.CluterID == 8)
{
- continue;
+ var dimmableLight = deviceUI.CommonDevice as DimmableLight;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
+ var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
+ switch (attriButeList[0].AttributeId)
+ {
+ case 0:
+ //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
+ dimmableLight.Level = attriButeList[0].AttriButeData;
+ dimmableLight.LastDateTime = DateTime.Now;
+ (rowFL.GetChildren(j) as FunctionMainView).IsSelected = true;
+ (rowFL.GetChildren(j) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
+ break;
+ }
}
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴�
- dimmableLight.Level = attriButeList[0].AttriButeData;
- dimmableLight.LastDateTime = DateTime.Now;
- (rowFL.GetChildren(0) as FunctionMainView).IsSelected = true;
- (rowFL.GetChildren(0) as FunctionMainView).StatuButton.Text = deviceUI.GetDeviceStatu();
- break;
- }
- }
- break;
+ break;
+ }
}
}
}
@@ -944,676 +924,689 @@
else
{
deviceVerticalScrolViewLayout = new VerticalScrolViewLayout { };
-
functionSceneBodyView.AddChidren(deviceVerticalScrolViewLayout);
for (int i = 0; i < deviceList.Count; i++)
{
- int t = i % 2;
- int tt = i / 2;
- int xx = 43 + i % 2 * (20 + 487);
- int yy = 14;
var device = deviceList[i];
- if (device == null || device.CommonDevice == null)
- {
- continue;
- }
-
- if (i % 2 == 0)
- {
- itemView = new FrameLayout()
+ //new System.Threading.Thread(() =>
+ //{
+ Application.RunOnMainThread(() =>
{
- Height = Application.GetRealHeight(14 + 348),
- Tag = device
- };
- deviceVerticalScrolViewLayout.AddChidren(itemView);
- }
-
- //鏀惰棌
- EventHandler<MouseEventArgs> collectionEvent = (sender, e) =>
- {
- if ((sender as Button).IsSelected)
- {
- Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName);
- (sender as Button).IsSelected = false;
- }
- else
- {
- Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(device.FileName);
- (sender as Button).IsSelected = true;
- }
- if (Room.CurrentRoom.IsLove)
- {
- RefreshBodyView();
- }
- };
-
- //////鍒ゆ柇璁惧鏄惁鏀寔鐨勫睘鎬� 濡傚紑鍏崇瓑鎺у埗
- if (device.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
- {
- //绐楀笜 鍗峰笜
- var rollerShade = (ZigBee.Device.Rollershade)device.CommonDevice;
- //涓嶄笂闈炶繙绋�
- if (rollerShade.Gateway == null)
- {
- continue;
- }
- if (rollerShade.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- ReadStatus(rollerShade, () =>
+ try
{
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice);
- });
- }
- else
- {
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - rollerShade.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice);
- }
- }
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(device.GetDeviceStatu());
- lightView.SetDeviceName(rollerShade.DeviceEpointName);
- //lightView.SetStatu(true);
- lightView.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
- lightView.SetCollect(true);
-
- lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- (device.CommonDevice as Rollershade).CurtainUpDownStopControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(CommonFormResouce.GetSwitchStatu(true));
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ int t = i % 2;
+ int tt = i / 2;
+ int xx = 43 + i % 2 * (20 + 487);
+ int yy = 14;
+ if (i % 2 == 0)
{
- if (Parent == null)
+ itemView = new FrameLayout()
{
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- (device.CommonDevice as Rollershade).CurtainUpDownStopControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(CommonFormResouce.GetSwitchStatu(false));
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ Height = Application.GetRealHeight(14 + 348),
+ };
+ deviceVerticalScrolViewLayout.AddChidren(itemView);
+ }
+ //鏀惰棌
+ EventHandler<MouseEventArgs> collectionEvent = (sender, e) =>
{
- if (Parent == null)
+ if ((sender as Button).IsSelected)
{
- return;
+ Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName);
+ (sender as Button).IsSelected = false;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
+ else
{
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ Common.Room.CurrentRoom.GetLoveRoom().AddDevice(device.FileName);
+ (sender as Button).IsSelected = true;
}
- });
- }
- };
+ if (Room.CurrentRoom.IsLove)
+ {
+ RefreshBodyView();
+ }
+ };
- lightView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
- UserView.HomePage.Instance.AddChidren(rollerShadeControl);
- UserView.HomePage.Instance.PageIndex += 1;
- UserView.HomePage.Instance.ScrollEnabled = false;
- //rollerShadeControl.action = RefreshBodyView;
- rollerShadeControl.Show(device, Room.CurrentRoom);
- };
-
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
- {
- //寮�鍏崇伅
- var light = device.CommonDevice as ToggleLight;
-
- //琛ヤ笂闈炶繙绋�
- if (light.Gateway == null)
- {
- continue;
- }
- if (light.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- ReadStatus(light, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
- });
- }
- else
- {
- if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
- }
- }
-
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(device.GetDeviceStatu());
- lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
- lightView.IsSelected = light.OnOffStatus == 1;
- lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
-
- var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
- if (dev == null)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
-
- lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- light.SwitchControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ if (device.CommonDevice.Type == DeviceType.WindowCoveringDevice)
{
- if (Parent == null)
+ //绐楀笜 鍗峰笜
+ var rollerShade = (ZigBee.Device.Rollershade)device.CommonDevice;
+ if (rollerShade.Gateway != null)
{
- return;
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (rollerShade.Gateway.IsVirtual)
+ {
+ ReadStatus(rollerShade, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice);
+ });
+ }
+ else
+ {
+ if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - rollerShade.LastDateTime).TotalSeconds)
+ {
+ ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var lightView = new FunctionMainView(xx, yy);
+ lightView.Tag = device;
+ itemView.AddChidren(lightView);
+ lightView.Init();
+ lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
+ lightView.SetStatuText(device.GetDeviceStatu());
+ lightView.SetDeviceName(rollerShade.DeviceEpointName);
+ //lightView.SetStatu(true);
+ lightView.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100;
+ lightView.SetCollect(true);
+
+ lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
+ {
+ (sender as Button).IsSelected = !(sender as Button).IsSelected;
+ if ((sender as Button).IsSelected)
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ (device.CommonDevice as Rollershade).CurtainUpDownStopControl(0);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(CommonFormResouce.GetSwitchStatu(true));
+ ((sender as Button).Parent as FunctionMainView).IsSelected = true;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ else
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ (device.CommonDevice as Rollershade).CurtainUpDownStopControl(1);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(CommonFormResouce.GetSwitchStatu(false));
+ ((sender as Button).Parent as FunctionMainView).IsSelected = false;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ };
+
+ lightView.CardBG.MouseUpEventHandler += (sender, e) =>
+ {
+ CommonPage.Instance.IsDrawerLockMode = true;
+ var rollerShadeControl = new Phone.Device.Curtain.RollerShadeControl();
+ UserView.HomePage.Instance.AddChidren(rollerShadeControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+ //rollerShadeControl.action = RefreshBodyView;
+ rollerShadeControl.Show(device, Room.CurrentRoom);
+ };
+
+ lightView.CollectButton.MouseUpEventHandler += collectionEvent;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- light.SwitchControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ }
+ else if (device.CommonDevice.Type == DeviceType.OnOffOutput)
{
- if (Parent == null)
- {
- return;
+ //寮�鍏崇伅
+ var light = device.CommonDevice as ToggleLight;
+ if (light.Gateway != null)
+ {
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (light.Gateway.IsVirtual)
+ {
+ ReadStatus(light, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
+ });
+ }
+ else
+ {
+ if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var lightView = new FunctionMainView(xx, yy);
+ itemView.AddChidren(lightView);
+ lightView.Init();
+ lightView.Tag = device;
+ lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
+ lightView.SetStatuText(device.GetDeviceStatu());
+ lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
+ lightView.IsSelected = light.OnOffStatus == 1;
+ lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
+
+ var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
+ if (dev == null)
+ {
+ lightView.CollectButton.IsSelected = false;
+ }
+ else
+ {
+ lightView.CollectButton.IsSelected = true;
+ }
+
+ lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
+ {
+ (sender as Button).IsSelected = !(sender as Button).IsSelected;
+ if ((sender as Button).IsSelected)
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ light.SwitchControl(1);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = true;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ else
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ light.SwitchControl(0);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = false;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ };
+
+ lightView.CardBG.MouseUpEventHandler += (sender, e) =>
+ {
+ CommonPage.Instance.IsDrawerLockMode = true;
+ if (device.CommonDevice.DfunctionType == DeviceFunctionType.A寮�鍏�)
+ {
+ var lightControl = new Phone.Device.Light.OnOffControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(device, Room.CurrentRoom);
+ }
+ else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A鎻掑骇)
+ {
+ var lightControl = new Phone.Device.Light.PlugControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(device, Room.CurrentRoom);
+ }
+ else
+ {
+ var lightControl = new Phone.Device.Light.LightControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(device, Room.CurrentRoom);
+ }
+ };
+
+ lightView.CollectButton.MouseUpEventHandler += collectionEvent;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- };
-
- lightView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- if (device.CommonDevice.DfunctionType == DeviceFunctionType.A寮�鍏�)
- {
- var lightControl = new Phone.Device.Light.OnOffControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(device, Room.CurrentRoom);
- }
- else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A鎻掑骇)
- {
- var lightControl = new Phone.Device.Light.PlugControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(device, Room.CurrentRoom);
- }
- else
- {
- var lightControl = new Phone.Device.Light.LightControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(device, Room.CurrentRoom);
- }
- };
-
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
-
- }
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
- {
- //绌烘皵寮�鍏�
- var airSwitch = device.CommonDevice as AirSwitch;
- //琛ヤ笂闈炶繙绋�
- if (airSwitch.Gateway == null)
- {
- continue;
- }
- if (airSwitch.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- ReadStatus(airSwitch, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - airSwitch.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
- }
- }
-
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(device.GetDeviceStatu());
- lightView.SetDeviceName(airSwitch.DeviceEpointName);
- //lightView.SetStatu(true);
- lightView.IsSelected = airSwitch.OnOffStatus == 1;
- lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
-
- lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- airSwitch.SwitchControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ }
+ else if (device.CommonDevice.Type == DeviceType.AirSwitch)
{
- if (Parent == null)
+ //绌烘皵寮�鍏�
+ var airSwitch = device.CommonDevice as AirSwitch;
+ if (airSwitch.Gateway != null)
{
- return;
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (airSwitch.Gateway.IsVirtual)
+ {
+ ReadStatus(airSwitch, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
+ });
+ }
+ else
+ {
+ if ((DateTime.Now - airSwitch.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
+ {
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var lightView = new FunctionMainView(xx, yy);
+ itemView.AddChidren(lightView);
+ lightView.Init();
+ lightView.Tag = device;
+ lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
+ lightView.SetStatuText(device.GetDeviceStatu());
+ lightView.SetDeviceName(airSwitch.DeviceEpointName);
+ //lightView.SetStatu(true);
+ lightView.IsSelected = airSwitch.OnOffStatus == 1;
+ lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
+
+ lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
+ {
+ (sender as Button).IsSelected = !(sender as Button).IsSelected;
+ if ((sender as Button).IsSelected)
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ airSwitch.SwitchControl(1);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = true;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ else
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ airSwitch.SwitchControl(0);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = false;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ };
+
+ lightView.CardBG.MouseUpEventHandler += (sender, e) =>
+ {
+ CommonPage.Instance.IsDrawerLockMode = true;
+ var lightControl = new Phone.Device.Light.AirSwitchControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(device, Room.CurrentRoom);
+ };
+
+ lightView.CollectButton.MouseUpEventHandler += collectionEvent;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- airSwitch.SwitchControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ }
+ else if (device.CommonDevice.Type == DeviceType.Thermostat)
{
- if (Parent == null)
+ //鎭掓俯鍣�-AC-绌鸿皟
+ var ac = device.CommonDevice as AC;
+ if (ac.Gateway != null)
{
- return;
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (ac.Gateway.IsVirtual)
+ {
+ ReadStatus(ac, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
+ });
+ }
+ else
+ {
+ if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
+ {
+ ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var lightView = new FunctionMainView(xx, yy);
+ itemView.AddChidren(lightView);
+ lightView.Init();
+ lightView.Tag = device;
+ lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
+ lightView.SetStatuText(device.GetDeviceStatu());
+ lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
+ lightView.IsSelected = ac.currentSystemMode != 0;
+ lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
+
+ lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
+ {
+ (sender as Button).IsSelected = !(sender as Button).IsSelected;
+ if ((sender as Button).IsSelected)
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ ac.Open();
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = true;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ else
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ ac.Close();
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = false;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ };
+
+ lightView.CardBG.MouseUpEventHandler += (sender, e) =>
+ {
+ CommonPage.Instance.IsDrawerLockMode = true;
+ var lightControl = new Phone.Device.AC.ACControl();
+ UserView.HomePage.Instance.AddChidren(lightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //lightControl.action = RefreshBodyView;
+ lightControl.Show(device, Room.CurrentRoom);
+ };
+
+ lightView.CollectButton.MouseUpEventHandler += collectionEvent;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- };
-
- lightView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var lightControl = new Phone.Device.Light.AirSwitchControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(device, Room.CurrentRoom);
- };
-
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
- {
- //鎭掓俯鍣�-AC-绌鸿皟
- var ac = device.CommonDevice as AC;
-
- //琛ヤ笂闈炶繙绋�
- if (ac.Gateway == null)
- {
- continue;
- }
- if (ac.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- ReadStatus(ac, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
- }
- }
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(device.GetDeviceStatu());
- lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
- lightView.IsSelected = ac.currentSystemMode != 0;
- lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
-
- lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- ac.Open();
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ }
+ else if (device.CommonDevice.Type == DeviceType.DimmableLight)
{
- if (Parent == null)
+ //璋冨厜鐏�
+ var dimmableLight = device.CommonDevice as DimmableLight;
+ if (dimmableLight.Gateway != null)
{
- return;
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(100 * i);
+ if (dimmableLight.Gateway.IsVirtual)
+ {
+ //鍙戦�佽鍙栫姸鎬佸懡浠�
+ ReadStatus(dimmableLight, () =>
+ {
+ ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice);
+ });
+ }
+ else
+ {
+ //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
+ if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
+ {
+ ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice);
+ }
+ }
+ })
+ { IsBackground = true }.Start();
+
+ var lightView = new FunctionMainView(xx, yy);
+ itemView.AddChidren(lightView);
+ lightView.Init();
+ lightView.Tag = device;
+ lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
+ lightView.SetStatuText(device.GetDeviceStatu());
+ lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
+ lightView.IsSelected = dimmableLight.OnOffStatus == 1;
+ lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
+
+ var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
+ if (dev == null)
+ {
+ lightView.CollectButton.IsSelected = false;
+ }
+ else
+ {
+ lightView.CollectButton.IsSelected = true;
+ }
+
+ lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
+ {
+ (sender as Button).IsSelected = !(sender as Button).IsSelected;
+ if ((sender as Button).IsSelected)
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ dimmableLight.SwitchControl(1);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = true;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ else
+ {
+ zbGateway = device.CommonDevice.Gateway;
+ sendedControlCommand = false;
+ zbGateway.ReportAction += UpdateDeviceControllStatu;
+ AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
+
+ dimmableLight.SwitchControl(0);
+
+ ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
+ ((sender as Button).Parent as FunctionMainView).IsSelected = false;
+
+ //鎺у埗寤舵椂鍥炶皟
+ DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ {
+ if (Parent == null)
+ {
+ return;
+ }
+ RemoveUpdateControlDeviceStatuAction(zbGateway);
+ if (sendedControlCommand == false)
+ {
+ DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ }
+ });
+ }
+ };
+
+ lightView.CardBG.MouseUpEventHandler += (sender, e) =>
+ {
+ CommonPage.Instance.IsDrawerLockMode = true;
+ var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
+ UserView.HomePage.Instance.AddChidren(dimmableLightControl);
+ UserView.HomePage.Instance.PageIndex += 1;
+ //dimmableLightControl.action = RefreshBodyView;
+ dimmableLightControl.Show(device, Room.CurrentRoom);
+ };
+ lightView.CollectButton.MouseUpEventHandler += collectionEvent;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
- }
- else
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- ac.Close();
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ }
+ else if (device.CommonDevice.Type == DeviceType.DoorLock)
{
- if (Parent == null)
+ //闂ㄩ攣
+ var dimmableLight = device.CommonDevice as DoorLock;
+
+ var lightView = new FunctionMainView(xx, yy);
+ itemView.AddChidren(lightView);
+ lightView.Init();
+ lightView.Tag = device;
+ lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
+ lightView.SetStatuText(device.GetDeviceStatu());
+ lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
+ lightView.IsSelected = dimmableLight.IsOnline == 1;
+ lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
+ lightView.CanControl(false);
+ var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
+ if (dev == null)
{
- return;
+ lightView.CollectButton.IsSelected = false;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
+ else
{
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ lightView.CollectButton.IsSelected = true;
}
- });
- }
- };
- lightView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var lightControl = new Phone.Device.AC.ACControl();
- UserView.HomePage.Instance.AddChidren(lightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //lightControl.action = RefreshBodyView;
- lightControl.Show(device, Room.CurrentRoom);
- };
-
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
- {
- //璋冨厜鐏�
- var dimmableLight = device.CommonDevice as DimmableLight;
- //琛ヤ笂闈炶繙绋�
- if (dimmableLight.Gateway == null)
- {
- continue;
- }
- if (dimmableLight.Gateway.IsVirtual)
- {
- //鍙戦�佽鍙栫姸鎬佸懡浠�
- ReadStatus(dimmableLight, () =>
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice);
- });
- }
- else
- {
- //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
- if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
- {
- ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice);
- }
- }
-
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(device.GetDeviceStatu());
- lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
- lightView.IsSelected = dimmableLight.OnOffStatus == 1;
- lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
-
- var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
- if (dev == null)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
-
- lightView.SwitchButton.MouseUpEventHandler += (sender, e) =>
- {
- (sender as Button).IsSelected = !(sender as Button).IsSelected;
- if ((sender as Button).IsSelected)
- {
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
-
- dimmableLight.SwitchControl(1);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = true;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
+ lightView.CardBG.MouseUpEventHandler += (sender, e) =>
+ {
+ CommonPage.Instance.IsDrawerLockMode = true;
+ var userDoorLockPage = new UserDoorLockPage(Room.CurrentRoom, device);
+ HomePage.Instance.AddChidren(userDoorLockPage);
+ HomePage.Instance.PageIndex += 1;
+ userDoorLockPage.Show();
+ };
+ lightView.CollectButton.MouseUpEventHandler += collectionEvent;
+ }
+ else
{
- if (Parent == null)
+ var lightView = new FunctionMainView(xx, yy);
+ itemView.AddChidren(lightView);
+ lightView.Init();
+ lightView.Tag = device;
+ lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
+ lightView.SetStatuText(device.GetDeviceStatu());
+ lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
+ lightView.CanControl(false);
+ lightView.IsSelected = device.CommonDevice.IsOnline == 1;
+ lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
+
+ var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
+ if (dev == null)
{
- return;
+ lightView.CollectButton.IsSelected = false;
}
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
+ else
{
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
+ lightView.CollectButton.IsSelected = true;
}
- });
+ lightView.CollectButton.MouseUpEventHandler += collectionEvent;
+ }
}
- else
+ catch(Exception ex)
{
- zbGateway = device.CommonDevice.Gateway;
- sendedControlCommand = false;
- zbGateway.ReportAction += UpdateDeviceControllStatu;
- AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, device.CommonDevice);
- dimmableLight.SwitchControl(0);
-
- ((sender as Button).Parent as FunctionMainView).SetStatuText(device.GetDeviceStatu());
- ((sender as Button).Parent as FunctionMainView).IsSelected = false;
-
- //鎺у埗寤舵椂鍥炶皟
- DeviceUI.SendCommandDelayAction(device.CommonDevice, () =>
- {
- if (Parent == null)
- {
- return;
- }
- RemoveUpdateControlDeviceStatuAction(zbGateway);
- if (sendedControlCommand == false)
- {
- DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
- }
- });
}
- };
-
- lightView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
- UserView.HomePage.Instance.AddChidren(dimmableLightControl);
- UserView.HomePage.Instance.PageIndex += 1;
- //dimmableLightControl.action = RefreshBodyView;
- dimmableLightControl.Show(device, Room.CurrentRoom);
- };
-
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.DoorLock)
- {
- //闂ㄩ攣
- var dimmableLight = device.CommonDevice as DoorLock;
- //琛ヤ笂闈炶繙绋�
- if (dimmableLight.Gateway == null)
- {
- continue;
- }
-
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(device.GetDeviceStatu());
- lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
- lightView.IsSelected = dimmableLight.IsOnline == 1;
- lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
- lightView.CanControl(false);
- var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
- if (dev == null)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
-
- lightView.CardBG.MouseUpEventHandler += (sender, e) =>
- {
- CommonPage.Instance.IsDrawerLockMode = true;
- var userDoorLockPage = new UserDoorLockPage(Room.CurrentRoom, device);
- HomePage.Instance.AddChidren(userDoorLockPage);
- HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
- };
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
- else
- {
- var lightView = new FunctionMainView(xx, yy);
- itemView.AddChidren(lightView);
- lightView.Init();
- lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath);
- lightView.SetStatuText(device.GetDeviceStatu());
- lightView.SetDeviceName(device.CommonDevice.DeviceEpointName);
- lightView.CanControl(false);
- lightView.IsSelected = device.CommonDevice.IsOnline == 1;
- lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName));
-
- var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
- if (dev == null)
- {
- lightView.CollectButton.IsSelected = false;
- }
- else
- {
- lightView.CollectButton.IsSelected = true;
- }
- lightView.CollectButton.MouseUpEventHandler += collectionEvent;
- }
+ });
+ //})
+ //{ IsBackground = true }.Start();
}
}
-
}
#endregion
@@ -1696,63 +1689,59 @@
/// GetDelayScene
/// </summary>
/// <param name="scrolViewLayout"></param>
- private void GetDelayScene(VerticalScrolViewLayout scrolViewLayout)
+ private async void GetDelayScene(VerticalScrolViewLayout scrolViewLayout)
{
- new System.Threading.Thread(async () =>
- {
- var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync();
- if (catDelaySceneResponseAllData == null)
- {
- return;
- }
- var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData;
- if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0)
- {
- return;
- }
- var delayList = catDelaySceneResponseData.DelayScenesList;
- Application.RunOnMainThread(() =>
+ var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync();
+ if (catDelaySceneResponseAllData == null)
+ {
+ return;
+ }
+ var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData;
+ if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0)
+ {
+ return;
+ }
+ var delayList = catDelaySceneResponseData.DelayScenesList;
+
+ for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
+ {
+ var iView = scrolViewLayout.GetChildren(i) as FrameLayout;
+ for (int j = 0; iView != null && j < iView.ChildrenCount; j++)
{
- for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
+ var sceneView = iView.GetChildren(j) as SceneMainView;
+ foreach (var delayScenesListResponseInfo in delayList)
{
- var iView = scrolViewLayout.GetChildren(i) as FrameLayout;
- for (int j = 0; iView != null && j < iView.ChildrenCount; j++)
+ if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
{
- var sceneView = iView.GetChildren(j) as SceneMainView;
- foreach (var delayScenesListResponseInfo in delayList)
+ var remainTime = delayScenesListResponseInfo.RemainTime;
+ sceneView.scene.RemainTime = remainTime;
+
+ if (remainTime > 0)
{
- if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
+ new System.Threading.Thread(() =>
{
- var times = delayScenesListResponseInfo.RemainTime;
- sceneView.scene.RemainTime = times;
- new System.Threading.Thread(() =>
+ while (remainTime-- > 0)
{
- while (times > 0)
- {
- System.Threading.Thread.Sleep(1000);
- Application.RunOnMainThread(() =>
- {
- sceneView.SetTimeText(CommonFormResouce.GetTimeString(times));
- });
- times -= 1;
- }
+ System.Threading.Thread.Sleep(1000);
Application.RunOnMainThread(() =>
{
- sceneView.SetTimeImage();
+ sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime));
});
- })
- { IsBackground = true }.Start();
-
- break;
- }
+ }
+ Application.RunOnMainThread(() =>
+ {
+ sceneView.scene.RemainTime = 0;
+ sceneView.SetTimeImage();
+ });
+ })
+ { IsBackground = true }.Start();
}
-
+ break;
}
}
- });
- })
- { IsBackground = true }.Start();
+ }
+ }
}
#endregion
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
index ba987ee..6185329 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
@@ -3,6 +3,7 @@
using Shared.Common;
using ZigBee.Device;
using Shared.Phone.Device.AC;
+using System.Text;
using Shared.Phone.Device.Account;
namespace Shared.Phone.UserView
@@ -78,6 +79,10 @@
{
try
{
+ if (common.DeviceStatusReport.AttriBute == null || common.DeviceStatusReport.AttriBute.Count == 0)
+ {
+ return;
+ }
switch (myDevice.Type)
{
case DeviceType.OnOffOutput:
@@ -86,11 +91,6 @@
{
var onOffOutputLight = (ToggleLight)myDevice;
onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
onOffOutputLight.OnOffStatus = onOffOutputLight.DeviceStatusReport.AttriBute[0].AttriButeData;
onOffOutputLight.LastDateTime = DateTime.Now;
}
@@ -108,13 +108,8 @@
{
var airSwitch = (AirSwitch)myDevice;
airSwitch.DeviceStatusReport = common.DeviceStatusReport;
- if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData;
airSwitch.LastDateTime = DateTime.Now;
-
}
//褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
if (common.DeviceStatusReport.CluterID == 3)
@@ -130,10 +125,6 @@
var rollershade = (Rollershade)myDevice;
rollershade.DeviceStatusReport = common.DeviceStatusReport;
var attriButeList = rollershade.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
switch (attriButeList[0].AttributeId)
{
case 0:
@@ -156,50 +147,44 @@
var ac = (AC)myDevice;
ac.DeviceStatusReport = common.DeviceStatusReport;
var attriButeList = ac.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
+ foreach(var attList in attriButeList)
{
- return;
- }
- //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
- var curTemp = (attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default;
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- ac.currentLocalTemperature = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 17:
- ac.currentCoolingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 18:
- ac.currentHeatingSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 4096:
- ac.currentAutoSetpoint = curTemp;
- ac.LastDateTime = DateTime.Now;
- break;
-
- case 28:
- ac.currentSystemMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4099:
- var value = Convert.ToString(attriButeList[0].AttriButeData, 2).PadLeft(16, '0');
- var modeStr = value.Substring(value.Length - 5, 5);
- for (int j = 0; j < modeStr.Length; j++)
- {
- ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
- }
- break;
-
- case 4097:
- ac.CleanStatu = attriButeList[0].AttriButeData == 42;
- break;
+ //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
+ var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
+ switch (attList.AttributeId)
+ {
+ case 0:
+ ac.currentLocalTemperature = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 17:
+ ac.currentCoolingSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 18:
+ ac.currentHeatingSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4096:
+ ac.currentAutoSetpoint = curTemp;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 28:
+ ac.currentSystemMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4099:
+ var value = Convert.ToString(attList.AttriButeData, 2).PadLeft(16, '0');
+ var modeStr = value.Substring(value.Length - 5, 5);
+ for (int j = 0; j < modeStr.Length; j++)
+ {
+ ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
+ }
+ break;
+ case 4097:
+ ac.CleanStatu = attList.AttriButeData == 42;
+ break;
+ }
}
}
@@ -207,21 +192,20 @@
{
var ac = (AC)myDevice;
var attriButeList = common.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
ac.DeviceStatusReport = common.DeviceStatusReport;
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- ac.currentFanMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
- case 4096:
- ac.currentFanSwingMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- break;
+ foreach(var attList in attriButeList)
+ {
+ switch (attList.AttributeId)
+ {
+ case 0:
+ ac.currentFanMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ case 4096:
+ ac.currentFanSwingMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ break;
+ }
}
}
@@ -240,11 +224,6 @@
{
var dimmableLight = (DimmableLight)myDevice;
dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
- //璁板綍銆佹洿鏂扮姸鎬�
- if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
- {
- return;
- }
dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData;
dimmableLight.LastDateTime = DateTime.Now;
}
@@ -254,10 +233,6 @@
var dimmableLight = (DimmableLight)myDevice;
dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
switch (attriButeList[0].AttributeId)
{
case 0:
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
index 6c9d52c..0b5fc0d 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -3517,7 +3517,8 @@
{
localIsConnected = false;
DebugPrintLog($"Local涓诲姩鏂紑_{s}");
- await localMqttClient.DisconnectAsync(new MQTTnet.Client.Disconnecting.MqttClientDisconnectOptions { }, CancellationToken.None);
+ //await localMqttClient.DisconnectAsync(new MQTTnet.Client.Disconnecting.MqttClientDisconnectOptions { }, CancellationToken.None);
+ await localMqttClient.DisconnectAsync();
}
}
catch (Exception ex)
@@ -3537,7 +3538,8 @@
{
remoteIsConnected = false;
DebugPrintLog($"Remote涓诲姩鏂紑_{s}");
- await RemoteMqttClient.DisconnectAsync(new MQTTnet.Client.Disconnecting.MqttClientDisconnectOptions { }, CancellationToken.None);
+ //await RemoteMqttClient.DisconnectAsync(new MQTTnet.Client.Disconnecting.MqttClientDisconnectOptions { }, CancellationToken.None);
+ await RemoteMqttClient.DisconnectAsync();
}
}
catch(Exception e) {
@@ -4365,7 +4367,6 @@
}
}
#endregion
- DebugPrintLog("缃戝叧杩斿洖鏁版嵁閫氱煡");
}
catch (Exception ex)
{
diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs
index 68f0599..23ea4c2 100755
--- a/ZigbeeApp/Shared/R.cs
+++ b/ZigbeeApp/Shared/R.cs
@@ -909,7 +909,7 @@
/// </summary>
public const int Save = 11021;
/// <summary>
- /// 鎻愮ず
+ /// 鎻愰啋
/// </summary>
public const int TIP = 11022;
/// <summary>
@@ -956,6 +956,10 @@
/// 閫夋嫨鍦烘櫙鍥剧墖
/// </summary>
public const int SelectScenePic = 11033;
+ /// <summary>
+ /// 纭畾瑕佺Щ闄よ鍔熻兘锛�
+ /// </summary>
+ public const int DeleteFunction = 11034;
#region 璁惧绫诲瀷
/// <summary>
@@ -4204,11 +4208,11 @@
/// </summary>
public const int uCommitCurtainLimitFail = 15812;
/// <summary>
- /// 纭褰撳墠浣嶇疆{0}涓哄紑闄愪綅?
+ /// 纭褰撳墠浣嶇疆涓哄紑闄愪綅?
/// </summary>
public const int uCommitCurtainOpenLimitMsg = 15813;
/// <summary>
- /// 纭褰撳墠浣嶇疆{0}涓哄悎闄愪綅?
+ /// 纭褰撳墠浣嶇疆涓哄悎闄愪綅?
/// </summary>
public const int uCommitCurtainCloseLimitMsg = 15814;
/// <summary>
@@ -4947,6 +4951,30 @@
/// 濡傛灉涓嶈缃綇瀹呯殑鍦扮悊浣嶇疆,鍒欎細褰卞搷鑷姩鍖栧湴鐞嗗洿鏍忓姛鑳界殑璁剧疆
/// </summary>
public const int uNotSetLocationWillAffectTheAutomaticGeofencingFunction = 16000;
+ /// <summary>
+ /// 绌鸿皟妯″潡鐗堟湰
+ /// </summary>
+ public const int uAirConditionerModelVersion = 16001;
+ /// <summary>
+ /// 閫氫俊鑺墖
+ /// </summary>
+ public const int uCommunicationChip = 16002;
+ /// <summary>
+ /// 绌鸿皟妯″潡
+ /// </summary>
+ public const int uAirConditioningModule = 16003;
+ /// <summary>
+ /// 鑾峰彇澶辫触
+ /// </summary>
+ public const int uGettingFail = 16004;
+ /// <summary>
+ /// 鏃犳硶璇嗗埆
+ /// </summary>
+ public const int uUnDistinguish = 16005;
+ /// <summary>
+ /// 姝e湪閲嶇疆鐢垫満
+ /// </summary>
+ public const int uElectricalMachineryResetting = 16006;
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽�
/// <summary>
@@ -5255,6 +5283,18 @@
/// 闀滃儚ID涓�2800鐨勮澶囩殑榛樿鍚嶅瓧锛欻06C
/// </summary>
public const int uDeviceModelId2800 = 30025;
+ /// <summary>
+ /// 闀滃儚ID涓�220鐨勮澶囩殑榛樿鍚嶅瓧锛氱畝绾�4鎸夐敭闈㈡澘
+ /// </summary>
+ public const int uDeviceModelId220 = 30026;
+ /// <summary>
+ /// 闀滃儚ID涓�221鐨勮澶囩殑榛樿鍚嶅瓧锛氱畝绾�3鎸夐敭闈㈡澘
+ /// </summary>
+ public const int uDeviceModelId221 = 30027;
+ /// <summary>
+ /// 闀滃儚ID涓�222鐨勮澶囩殑榛樿鍚嶅瓧锛氱畝绾�2鎸夐敭闈㈡澘
+ /// </summary>
+ public const int uDeviceModelId222 = 30028;
//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囨墍灞炵绫荤殑缈昏瘧鍚嶅瓧,浠�40000寮�濮嬧槄鈽呪槄鈽�
/// <summary>
diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems
index 62307b9..859a7ee 100755
--- a/ZigbeeApp/Shared/Shared.projitems
+++ b/ZigbeeApp/Shared/Shared.projitems
@@ -149,6 +149,8 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlThreadLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlWifiLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\AirConditioner\AirConditionerModeForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\AirConditioner\ACZbGatewayModuleUpdateForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\AirConditioner\ACZbGatewayUpdateMenuForm.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" />
@@ -206,7 +208,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Manage\GatewayGeneralInformationForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Manage\GatewayUploadAndDownLoadForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Update\GatewayCoordinatorInfoForm.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Update\GatewayFirmwareUpdateForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Update\GatewayVirtualDriveInfoForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HdlBackup\HdlAutoBackupForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HdlBackup\HdlBackupListForm.cs" />
@@ -282,7 +283,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelButtonSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFunctionSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\PirSensor\PirSensorBindTargetSettionForm.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceFirmwareInfoForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceFirmwareUpdateForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelBackLightSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceHistoryFirmwareVersionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceListMainForm.cs" />
@@ -293,7 +294,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceDryContactSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceFunctionSettionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Relay\RelayThreeLoadBackLightSettionForm.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Update\GatewayFirmwareInfoForm.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Update\GatewayFirmwareUpdateForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Update\GatewayHistoryFirmwareVersionForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Update\GatewayLinuxInfoForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Manage\GatewayListForm.cs" />
@@ -309,7 +310,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\MessageControls\ShowMsgControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\NormalControls\PicViewControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\DeviceControls\DeviceSelectControl.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\DeviceFirmwareUpdateForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceBindLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceFixedAttributeLogic.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlDeviceHardInfoLogic.cs" />
--
Gitblit v1.8.0