From 0087dd7734e71dfcfd1bb54db394ad7855021ffd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 24 七月 2020 10:18:08 +0800
Subject: [PATCH] 新版本
---
ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 18 +
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs | 2
ZigbeeApp/Home.Ios/Resources/DeviceName.ini | 3
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 5
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs | 6
ZigbeeApp/Shared/Common/CommonPage.cs | 4
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 4
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll | 0
ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 12
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs | 23 +
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs | 58 ++-
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs | 6
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs | 8
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs | 12
ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs | 10
ZigbeeApp/GateWay.Droid/Resources/drawable/Loading.png | 0
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs | 6
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 1
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs | 10
ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs | 8
ZigbeeApp/Shared/Phone/UserView/HomePage.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs | 88 ++++
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs | 129 ++++--
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs | 10
ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs | 73 +--
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll | 0
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs | 94 ++++
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs | 5
ZigbeeApp/Home.Ios/Info.plist | 4
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 39 +
ZigbeeApp/Shared/Common/Device.cs | 93 +++-
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 63 +--
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs | 2
ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs | 14
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs | 6
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs | 10
ZigbeeApp/Shared/Shared.projitems | 1
ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs | 9
ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs | 2
/dev/null | 167 ---------
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs | 9
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs | 13
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs | 24 +
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs | 6
ZigbeeApp/GateWay.Droid/Assets/DeviceName.ini | 3
51 files changed, 603 insertions(+), 475 deletions(-)
diff --git a/ZigbeeApp/GateWay.Droid/Assets/DeviceName.ini b/ZigbeeApp/GateWay.Droid/Assets/DeviceName.ini
index 7a871b7..be83f7f 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/DeviceName.ini
+++ b/ZigbeeApp/GateWay.Droid/Assets/DeviceName.ini
@@ -105,6 +105,9 @@
MGCD01/M-ZB.10 = 1306 / 鍚搁《寮忕噧姘斾紶鎰熷櫒 / 鍚搁《寮忕噧姘斾紶鎰熷櫒 / 1200 / 浼犳劅鍣� / 浼犳劅鍣�
;PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
MSPM25/M-ZB.10 = 1307 / PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� / PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� / 1307 / 绌烘皵璐ㄩ噺 / 浼犳劅鍣�
+;娓╂箍搴︿紶鎰熷櫒(杩欎釜涓滆タ濂藉儚鏈変袱涓�)
+MTH01/M-ZB.10 = 1308 / 娓╂箍搴︿紶鎰熷櫒 / 娓╂箍搴︿紶鎰熷櫒 / 1200 / 浼犳劅鍣� / 浼犳劅鍣�
+MSHIM01/M-ZB.10 = 1308 / 娓╂箍搴︿紶鎰熷櫒 / 娓╂箍搴︿紶鎰熷櫒 / 1200 / 浼犳劅鍣� / 浼犳劅鍣�
;***************************************************************
; 缁х數鍣ㄨ澶�
diff --git a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml
index 858cdee..2509196 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="0120071701" android:installLocation="auto" android:versionName="1.1.0120071701">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120072302" android:installLocation="auto" android:versionName="1.1.0120072302">
<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/drawable/Loading.png b/ZigbeeApp/GateWay.Droid/Resources/drawable/Loading.png
index 68960e6..80be5ba 100755
--- a/ZigbeeApp/GateWay.Droid/Resources/drawable/Loading.png
+++ b/ZigbeeApp/GateWay.Droid/Resources/drawable/Loading.png
Binary files differ
diff --git a/ZigbeeApp/Home.Ios/Info.plist b/ZigbeeApp/Home.Ios/Info.plist
index 6e30abb..480436c 100755
--- a/ZigbeeApp/Home.Ios/Info.plist
+++ b/ZigbeeApp/Home.Ios/Info.plist
@@ -54,9 +54,9 @@
<key>aps-environment</key>
<string>development</string>
<key>CFBundleShortVersionString</key>
- <string>1.1.012007061</string>
+ <string>1.1.012007231</string>
<key>CFBundleVersion</key>
- <string>202007061</string>
+ <string>202007231</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
diff --git a/ZigbeeApp/Home.Ios/Resources/DeviceName.ini b/ZigbeeApp/Home.Ios/Resources/DeviceName.ini
index 7a871b7..be83f7f 100755
--- a/ZigbeeApp/Home.Ios/Resources/DeviceName.ini
+++ b/ZigbeeApp/Home.Ios/Resources/DeviceName.ini
@@ -105,6 +105,9 @@
MGCD01/M-ZB.10 = 1306 / 鍚搁《寮忕噧姘斾紶鎰熷櫒 / 鍚搁《寮忕噧姘斾紶鎰熷櫒 / 1200 / 浼犳劅鍣� / 浼犳劅鍣�
;PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
MSPM25/M-ZB.10 = 1307 / PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� / PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� / 1307 / 绌烘皵璐ㄩ噺 / 浼犳劅鍣�
+;娓╂箍搴︿紶鎰熷櫒(杩欎釜涓滆タ濂藉儚鏈変袱涓�)
+MTH01/M-ZB.10 = 1308 / 娓╂箍搴︿紶鎰熷櫒 / 娓╂箍搴︿紶鎰熷櫒 / 1200 / 浼犳劅鍣� / 浼犳劅鍣�
+MSHIM01/M-ZB.10 = 1308 / 娓╂箍搴︿紶鎰熷櫒 / 娓╂箍搴︿紶鎰熷櫒 / 1200 / 浼犳劅鍣� / 浼犳劅鍣�
;***************************************************************
; 缁х數鍣ㄨ澶�
diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs
old mode 100755
new mode 100644
index 54532c3..15b6819
--- a/ZigbeeApp/Shared/Common/CommonPage.cs
+++ b/ZigbeeApp/Shared/Common/CommonPage.cs
@@ -42,7 +42,7 @@
/// <summary>
/// 鐗堟湰鍙�
/// </summary>
- public static string CodeIDString = "1.1.0120072102";
+ public static string CodeIDString = "1.1.012007231";
/// <summary>
/// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee)
/// </summary>
@@ -378,7 +378,7 @@
DeviceType = deviceType
};
var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(RegIDObj);
- var reverObj = CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/SignZigbeeNeedPushRegID", System.Text.Encoding.UTF8.GetBytes(requestJson));
+ var reverObj = CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/SignZigbeeNeedPushRegID", System.Text.Encoding.UTF8.GetBytes(requestJson), 4);
if (reverObj == null)
{
//璋冭瘯:璁板綍鏋佸厜ID
diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs
index b94b3e0..8b92a87 100755
--- a/ZigbeeApp/Shared/Common/Device.cs
+++ b/ZigbeeApp/Shared/Common/Device.cs
@@ -267,22 +267,8 @@
listDriveDevice.Add(device);
}
}
- if (listDriveDevice.Count > 0)
- {
- //濡傛灉铏氭嫙璁惧杩樻病鏈夊悕瀛楃殑璇�
- HdlThreadLogic.Current.RunThread(() =>
- {
- //濡傛灉涓嶈繖鏍锋斁鍦ㄤ竴涓嚎绋嬮噷,鏈夊彲鑳藉Dictionary浜х敓褰卞搷
- foreach (var myDevice in listDriveDevice)
- {
- //鏍规嵁璁惧绫诲瀷鑾峰彇鍚嶇О
- var dName = this.GetDeviceObjectText(new List<CommonDevice>() { myDevice }, false);
- //鍦ㄧ鐐瑰悕瀛楃殑鍚庨潰闄勫姞銆愬洖璺�戝瓧鏍�
- dName += "(" + myDevice.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
- this.ReName(myDevice, dName, ShowErrorMode.NO);
- }
- });
- }
+ //璁剧疆铏氭嫙璁惧鐨勯粯璁ゅ悕瀛�
+ this.SetDriveDeviceDefultName(listDriveDevice);
//鍙湁瀹屽叏鑾峰彇鐨勬椂鍊�,鎵嶄細鍘诲鐞嗗垹闄ょ殑闂
if (statu != 1)
@@ -532,6 +518,42 @@
}
}
return true;
+ }
+
+ /// <summary>
+ /// 璁剧疆铏氭嫙璁惧鐨勯粯璁ゅ悕瀛�
+ /// </summary>
+ /// <param name="listDriveDevice">铏氭嫙璁惧鍒楄〃</param>
+ private void SetDriveDeviceDefultName(List<CommonDevice> listDriveDevice)
+ {
+ if (listDriveDevice.Count == 0)
+ {
+ return;
+ }
+ //濡傛灉铏氭嫙璁惧杩樻病鏈夊悕瀛楃殑璇�
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //濡傛灉涓嶈繖鏍锋斁鍦ㄤ竴涓嚎绋嬮噷,鏈夊彲鑳藉Dictionary浜х敓褰卞搷
+ foreach (var myDevice in listDriveDevice)
+ {
+ string dName = string.Empty;
+ if (this.IsMiniLight(myDevice) == true)
+ {
+ //Mini澶滅伅
+ dName = Language.StringByID(R.MyInternationalizationString.uMiniNightLight);
+ }
+ else
+ {
+ //鏍规嵁璁惧绫诲瀷鑾峰彇鍚嶇О
+ dName = this.GetDeviceObjectText(new List<CommonDevice>() { myDevice }, false);
+ //鍦ㄧ鐐瑰悕瀛楃殑鍚庨潰闄勫姞銆愬洖璺�戝瓧鏍�
+ dName += "(" + myDevice.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
+ }
+ this.ReName(myDevice, dName, ShowErrorMode.NO);
+
+ System.Threading.Thread.Sleep(100);
+ }
+ });
}
///<summary >
@@ -847,9 +869,9 @@
//闂ㄩ攣娌℃湁瀹氫綅鍔熻兘
return false;
}
+ var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
if (device.Type == DeviceType.IASZone)
{
- var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_Pir)
{
//浼犳劅鍣ㄩ櫎浜哖ir閮芥病鏈夊畾浣嶅姛鑳�
@@ -860,6 +882,11 @@
//鐞冨瀷绉诲姩浼犳劅鍣ㄨ櫧鐒舵槸鐢垫睜璁惧,浣嗘槸瀹冩湁瀹氫綅鍔熻兘
return true;
}
+ return false;
+ }
+ //娓╂箍搴︿紶鎰熷櫒娌℃湁瀹氫綅鍔熻兘
+ if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_TemperatrueHumidity)
+ {
return false;
}
@@ -1854,7 +1881,8 @@
info.ObjectTypeName = this.dicDeviceModelIdEnum["A418"].A绫诲瀷鍚嶅瓧;//璋冨厜妯″潡
}
else if (info.BeloneType == DeviceBeloneType.A浼犳劅鍣�
- || device.Type == DeviceType.TemperatureSensor)
+ || device.Type == DeviceType.TemperatureSensor
+ || device.Type == DeviceType.FreshAirHumiditySensor)
{
//浼犳劅鍣ㄥ悎骞�
info.ConcreteType = DeviceConcreteType.Sensor;
@@ -2051,14 +2079,14 @@
//璁剧疆浼犳劅鍣ㄥ叿浣撶殑绫诲瀷
info.BeloneType = DeviceBeloneType.A娓╂箍搴︿紶鎰熷櫒;
info.ConcreteText = this.dicDeviceModelIdEnum["A411"].A瀹樻柟鍚嶅瓧;
- info.ConcreteType = DeviceConcreteType.Sensor_TemperatureHumidity;
+ info.ConcreteType = DeviceConcreteType.Sensor_TemperatrueHumidity;
}
else if (temperatrue == true && humidity == false)
{
//璁剧疆浼犳劅鍣ㄥ叿浣撶殑绫诲瀷
info.BeloneType = DeviceBeloneType.A娓╁害浼犳劅鍣�;
info.ConcreteText = this.dicDeviceModelIdEnum["A412"].A瀹樻柟鍚嶅瓧;
- info.ConcreteType = DeviceConcreteType.Sensor_Temperature;
+ info.ConcreteType = DeviceConcreteType.Sensor_Temperatrue;
}
else if (temperatrue == false && humidity == true)
{
@@ -2707,15 +2735,14 @@
listCheck.Add(mainkeys);
//鍒锋柊涓�涓嬫湰鍦扮紦瀛�
var localDevice = this.GetDevice(mainkeys);
- if (localDevice != null)
+ var tempDevice = localDevice == null ? device : localDevice;
+
+ //鍒锋柊灞炴��
+ this.SetDeviceInfoToMain(tempDevice, device);
+ if (this.RefreshDeviceFunctionType(tempDevice, device, false) == true)
{
- //鍒锋柊灞炴��
- this.SetDeviceInfoToMain(localDevice, device);
- if (this.RefreshDeviceFunctionType(localDevice, device, false) == true)
- {
- //闇�瑕佸彂閫佸姛鑳界被鍨嬬粰缃戝叧
- listFucDevice.Add(localDevice);
- }
+ //闇�瑕佸彂閫佸姛鑳界被鍨嬬粰缃戝叧
+ listFucDevice.Add(tempDevice);
}
}
}
@@ -3371,6 +3398,10 @@
/// PM2.5绌烘皵璐ㄩ噺浼犳劅鍣�
/// </summary>
Sensor_PMTwoPointFive = 1307,
+ /// <summary>
+ /// 娓╂箍搴︿紶鎰熷櫒
+ /// </summary>
+ Sensor_TemperatrueHumidity = 1308,
/// <summary>
/// 杩愬姩浼犳劅鍣�
@@ -3381,13 +3412,9 @@
/// </summary>
Sensor_Keyfob = -1307,
/// <summary>
- /// 娓╂箍搴︿紶鎰熷櫒
- /// </summary>
- Sensor_TemperatureHumidity = -1308,
- /// <summary>
/// 娓╁害浼犳劅鍣�
/// </summary>
- Sensor_Temperature = -1309,
+ Sensor_Temperatrue = -1309,
/// <summary>
/// 婀垮害浼犳劅鍣�
/// </summary>
diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll
index b1faab1..ff36866 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.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll
index 0a412cd..712d419 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/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
index ca045b2..3c1a90e 100755
--- a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
@@ -844,6 +844,8 @@
var result = await HdlSceneLogic.Current.EditorSceneNameFromGateway(this.editorScene, this.cloneScene.Name);
if (result == false)
{
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
return;
}
}
@@ -851,10 +853,10 @@
{
//淇敼鍦烘櫙
var result = await HdlSceneLogic.Current.EditorSceneFromGateway(this.editorScene, this.listAdjustTarget);
- //鍏抽棴杩涘害鏉�
- this.CloseProgressBar();
if (result == false)
{
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
return;
}
}
@@ -904,6 +906,9 @@
//缂栬緫鍦烘櫙,涓婚〉闇�瑕侀噸鏂板埛鏂�
UserView.UserPage.Instance.RefreshAllForm = true;
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
+
HdlThreadLogic.Current.RunMain(() =>
{
//璋冪敤鍥炶皟鍑芥暟
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
index f087c86..415ff8d 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs
@@ -47,6 +47,12 @@
//鎵撳紑
this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
i_device.SwitchControl(1);
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鑾峰彇鐏厜浜害
+ System.Threading.Thread.Sleep(300);
+ HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
+ });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
index af972a0..aa7e70f 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorTemperatureRowControl.cs
@@ -47,6 +47,12 @@
//鎵撳紑
this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
i_device.SwitchControl(1);
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鑾峰彇鐏厜浜害
+ System.Threading.Thread.Sleep(300);
+ HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
+ });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
index 2189dc5..67d3581 100755
--- a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
@@ -842,7 +842,7 @@
HomePage.Instance.ShowLoginLoadView();
});
var resultRegID = Shared.Common.CommonPage.Instance.PushRegID();
- var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
+ var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
UserCenterLogic.InitUserCenterMenmoryAndThread();
//鍚姩ZigBee
@@ -1111,7 +1111,7 @@
Config.Instance.Save();
var resultRegID = CommonPage.Instance.PushRegID();
- var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
+ var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
UserCenterLogic.InitUserCenterMenmoryAndThread();
//鍚姩ZigBee
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
index 38323c9..44324a3 100755
--- a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
@@ -112,7 +112,7 @@
//缁戝畾绗笁鏂�
BindAuthUser(Config.Instance.Guid, OpenID);
}
- var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
+ var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
UserCenterLogic.InitUserCenterMenmoryAndThread();
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
index a4001f1..5a87885 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
@@ -132,6 +132,7 @@
seekBarColor.SeekBarPadding = Application.GetRealWidth(60);
seekBarColor.IsProgressTextShow = true;
seekBarColor.ProgressBarColor = UserCenterColor.Current.Transparent;
+ seekBarColor.ProgressBarUnEnableColor = UserCenterColor.Current.Transparent;
seekBarColor.SeekBarBackgroundColor = UserCenterColor.Current.Transparent;
seekBarColor.ProgressTextSize = 14;
seekBarColor.ProgressTextColor = UserCenterColor.Current.TextGrayColor2;
@@ -161,6 +162,7 @@
this.btnBuzzerSwitch = new IconBigViewControl(81, 81);
btnBuzzerSwitch.UnSelectedImagePath = "Item/Switch.png";
btnBuzzerSwitch.SelectedImagePath = "Item/SwitchSelected.png";
+ btnBuzzerSwitch.IsSelected = ((ColorTemperatureLight)this.device).IsBuzzerRing;
frameWhiteBack.AddChidren(btnBuzzerSwitch);
btnBuzzerSwitch.InitControl();
btnBuzzerSwitch.UseClickStatu = false;
@@ -200,6 +202,12 @@
};
btnMiniSwitch.IsSelected = ((LightBase)this.device).OnOffStatus == 1;
this.canSetProgressValue = btnMiniSwitch.IsSelected;
+ if (btnMiniSwitch.IsSelected == false)
+ {
+ //鍦ㄦ病鏈夋墦寮�澶滅伅寮�鍏充箣鍓�,涓嶅厑璁告粦鍔�
+ seekBarLight.Enable = false;
+ seekBarColor.Enable = false;
+ }
//浜害寮�濮嬫粦鍔ㄧ殑浜嬩欢
seekBarLight.OnStartTrackingTouchEvent += (sender, e) =>
@@ -347,7 +355,13 @@
{
//褰撴槸鎵撳紑鐘舵�佹椂,缃戝叧璇村畠浼氶粯璁ゆ妸浜害鍙樻垚100%
//浠ラ槻涓囦竴,杩欓噷鍐嶆璇诲彇涓�涓�
- ((ColorTemperatureLight)device).ReadLevel();
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ ((ColorTemperatureLight)device).ReadLevel();
+ System.Threading.Thread.Sleep(300);
+ ((ColorTemperatureLight)device).ReadColorTemperature();
+ });
+
}
}
});
@@ -379,25 +393,19 @@
//濡傛灉浣忓畢鏄櫄鎷熶綇瀹�
if (Common.Config.Instance.Home.IsVirtually == true)
{
- //((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
- ////鍒锋柊寮�鍏崇姸鎬�
- //this.RefreshSwitchStatu(isOpen);
+ ((ColorTemperatureLight)this.device).IsBuzzerRing = isOpen;
+ //鍒锋柊寮�鍏崇姸鎬�
+ this.RefreshSwitchStatu(isOpen);
return;
}
//妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
- this.StartCheckResponeResult(new List<ButtonBase> { this.btnBuzzerSwitch.btnIcon }, (result) =>
+ this.btnBuzzerSwitch.CanClick = false;
+ this.StartCheckResponeResult(new List<ButtonBase>(), (result) =>
{
HdlThreadLogic.Current.RunMain(() =>
{
- //鎺ユ敹鍒扮綉鍏冲洖澶�
- if (result == true)
- {
- this.btnBuzzerSwitch.IsSelected = isOpen;
- //bool statu = ((LightBase)this.device).OnOffStatus == 1;
- ////鍒锋柊寮�鍏崇姸鎬�
- //this.RefreshSwitchStatu(statu);
- }
+ this.btnBuzzerSwitch.CanClick = true;
});
});
//鍙戦�佸懡浠�
@@ -463,11 +471,13 @@
/// <param name="isOpen">鎵撳紑鐘舵��</param>
private void RefreshSwitchStatu(bool isOpen)
{
- if (this.isColorProgressing == true)
+ //鍒锋柊铚傞福鍣ㄥ紑鍏崇姸鎬�
+ bool isBuzzerRing = ((ColorTemperatureLight)this.device).IsBuzzerRing;
+ if (this.btnBuzzerSwitch.IsSelected != isBuzzerRing)
{
- //濡傛灉鏄壊娓╂粦鍔ㄧ殑璇�,涓嶉渶瑕佸埛鏂扮晫闈�
- return;
+ this.btnBuzzerSwitch.IsSelected = isBuzzerRing;
}
+
if (isOpen == true)
{
//浜害鏄繀椤昏鍒锋柊鐨� 浜害 XX
@@ -482,13 +492,25 @@
//褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
seekBarColor.Progress = (int)(((ColorTemperatureLight)this.device).ColorTemperature / 100);
}
- this.btnMiniSwitch.IsSelected = true;
+ if (this.btnMiniSwitch.IsSelected == false)
+ {
+ this.btnMiniSwitch.IsSelected = true;
+ }
+ //婊戝姩鏉″彲浠ユ粦鍔�
+ seekBarLight.Enable = true;
+ seekBarColor.Enable = true;
}
else
{
//鍙樻洿瀛楁牱:鍏抽棴
this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
- this.btnMiniSwitch.IsSelected = false;
+ if (this.btnMiniSwitch.IsSelected == true)
+ {
+ this.btnMiniSwitch.IsSelected = false;
+ }
+ //婊戝姩鏉′笉鍙互婊戝姩
+ seekBarLight.Enable = false;
+ seekBarColor.Enable = false;
}
//鍥炲鐨勭粨鏋滆,澶勪簬鎵撳紑鐘舵�佹墠鑳藉彂閫�
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
index 0fda2b2..8313777 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs
@@ -47,6 +47,12 @@
//鎵撳紑
this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
i_device.SwitchControl(1);
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鑾峰彇鐏厜浜害
+ System.Threading.Thread.Sleep(300);
+ HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
+ });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
index 633c0ff..60fe1f3 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorTemperatureCardControl.cs
@@ -47,6 +47,12 @@
//鎵撳紑
this.SetDeviceStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
i_device.SwitchControl(1);
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //鑾峰彇鐏厜浜害
+ System.Threading.Thread.Sleep(300);
+ HdlDeviceAttributeLogic.Current.SendLevelStatuComand(i_device);
+ });
}
else
{
diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
index 4e2b13b..f28273d 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
@@ -544,8 +544,8 @@
bodyFrameLayout.RemoveAll();
bodyFrameLayout.Height = Application.GetRealHeight(750);
this.listBodyContr.RecoverTableHeight();
- this.dicSceneCardControl.Clear();
- this.dicDeviceCardControl.Clear();
+ this.dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
+ this.dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
var listDevice = new List<CommonDevice>();
foreach (var mainkeys in HdlRoomLogic.Current.NowMainPageRoom.ListDevice)
@@ -804,8 +804,8 @@
bodyFrameLayout.RemoveAll();
bodyFrameLayout.Height = Application.GetRealHeight(750);
this.listBodyContr.RecoverTableHeight();
- this.dicSceneCardControl.Clear();
- this.dicDeviceCardControl.Clear();
+ this.dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
+ this.dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
var listScene = new List<SceneUI>();
foreach (int sceneId in HdlRoomLogic.Current.NowMainPageRoom.ListSceneId)
@@ -1161,6 +1161,10 @@
#endregion
+ #region 鈻� 浼犳劅鍣ㄧ姸鎬佽繕鍘焈____________________
+
+ #endregion
+
#region 鈻� 鍒囨崲妤煎眰___________________________
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
index 1882d5f..eba0af0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
@@ -11,7 +11,18 @@
{
#region 鈻� 鍙橀噺澹版槑___________________________
- private uint nowProgressBarColor = 0;
+ /// <summary>
+ /// 杩涘害鏉″彲鐢ㄦ椂鐨勮儗鏅壊
+ /// </summary>
+ private uint ProgressBarEnableColor = 0;
+ /// <summary>
+ /// 杩涘害鏉′笉鍙敤鏃剁殑鑳屾櫙鑹�(榛樿鐏拌壊)
+ /// </summary>
+ public uint ProgressBarUnEnableColor = 0xffe8e8e8;
+ /// <summary>
+ /// 褰撳墠鍙敤鐘舵��
+ /// </summary>
+ private bool nowEnable = true;
/// <summary>
/// 鎺т欢鑳藉惁浣跨敤
/// </summary>
@@ -19,16 +30,20 @@
{
set
{
+ //鐘舵�佹病鏈夋敼鍙�
+ if (nowEnable == value) { return; }
+ nowEnable = value;
+
this.IsClickable = value;
if (value == true)
{
//鍘熸潵鐨勯鑹�
- base.ProgressBarColor = nowProgressBarColor;
+ base.ProgressBarColor = ProgressBarEnableColor;
}
else
{
//鐏拌壊
- base.ProgressBarColor = 0xffe8e8e8;
+ base.ProgressBarColor = ProgressBarUnEnableColor;
}
}
}
@@ -40,7 +55,7 @@
{
set
{
- nowProgressBarColor = value;
+ ProgressBarEnableColor = value;
base.ProgressBarColor = value;
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
index 342b670..9ae4829 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
@@ -69,7 +69,7 @@
var pra = new MessageInfoPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
- var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotCheck" });
+ var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotCheck" }, false);
if (string.IsNullOrEmpty(result) == true)
{
//鍑洪敊锛岄渶瑕侀噸鏂拌鍙�
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
index 9c94480..ec80f72 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
@@ -375,7 +375,7 @@
/// 鍙戦�佽幏鍙栫伅鍏夌姸鎬佸懡浠�
/// </summary>
/// <param name="device">绐楀笜</param>
- private void SendLevelStatuComand(CommonDevice device)
+ public void SendLevelStatuComand(CommonDevice device)
{
if (device == null)
{
@@ -422,6 +422,12 @@
colorDevice.ReadLevel();
System.Threading.Thread.Sleep(300);
colorDevice.ReadColorTemperature();
+ if (LocalDevice.Current.IsMiniLight(device) == true)
+ {
+ //mini澶滅伅闇�瑕佽鍙栬渹楦e櫒鐘舵��
+ System.Threading.Thread.Sleep(300);
+ colorDevice.ReadBuzzerStatu();
+ }
})
{ IsBackground = true }.Start();
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
index 285c6f6..8be19e6 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
@@ -133,7 +133,7 @@
private static int GetFirmwareVersionAndSetToMemmory(FirmwareLevelType levelType, GetFirmwareVersionPra pra)
{
var listCheck = new List<string> { "NotCheck" };
- string resultValue = UserCenterLogic.GetResponseDataByRequestHttps("FirmwareMana/DetectionPlatformUploadFirmware", false, pra, listCheck);
+ string resultValue = UserCenterLogic.GetResponseDataByRequestHttps("FirmwareMana/DetectionPlatformUploadFirmware", false, pra, listCheck, false);
if (string.IsNullOrEmpty(resultValue) == true)
{
return -1;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
index fc831b0..bb9ce8a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -196,7 +196,7 @@
/// </summary>
/// <param name="zbGateway">缃戝叧</param>
/// <param name="mode">鏄惁鏄剧ず閿欒</param>
- public async Task<bool> AddNewGateway(ZbGateway zbGateway, ShowErrorMode mode)
+ public bool AddNewGateway(ZbGateway zbGateway, ShowErrorMode mode)
{
//璁剧疆缃戝叧鐨勭粡绾害
bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude, ShowErrorMode.NO);
@@ -205,7 +205,7 @@
return falge;
}
//鎵ц娣诲姞缃戝叧鍒板唴瀛�
- var result = await this.DoAddGatewayToMemory(zbGateway, mode);
+ var result = this.DoAddGatewayToMemory(zbGateway, mode);
//鍓嶇殑缃戝叧缁戝畾鍦ㄤ簡褰撳墠璐﹀彿涓嬬殑涓嶅悓浣忓畢閲岄潰
if (result == 0)
{
@@ -250,7 +250,7 @@
/// <param name="zbGateway">缃戝叧瀵硅薄</param>
/// <param name="mode">鏄惁鏄剧ず閿欒</param>
/// <returns></returns>
- private async Task<int> DoAddGatewayToMemory(ZbGateway zbGateway, ShowErrorMode mode)
+ private int DoAddGatewayToMemory(ZbGateway zbGateway, ShowErrorMode mode)
{
if (zbGateway == null)
{
@@ -278,7 +278,7 @@
//璁剧疆浣忓畢ID鍒扮綉鍏�
if (result.HomeId != Common.Config.Instance.HomeId)
{
- bool flage2 = await this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, mode);
+ bool flage2 = this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, mode);
if (flage2 == false)
{
if (mode == ShowErrorMode.YES)
@@ -337,10 +337,28 @@
/// <param name="zbGateway"></param>
/// <param name="HomeId"></param>
/// <returns></returns>
- public async Task<bool> SetHomeIdToGateway(ZbGateway zbGateway, string HomeId, ShowErrorMode mode)
+ public bool SetHomeIdToGateway(ZbGateway zbGateway, string HomeId, ShowErrorMode mode)
{
- ZbGateway realWay = null;
- if (this.GetRealGateway(ref realWay, zbGateway) == false)
+ //璐﹀彿ID
+ string accountId = string.Empty;
+ if (HomeId != string.Empty)
+ {
+ if (UserCenterResourse.UserInfo.AuthorityNo == 1)
+ {
+ //涓昏处鍙�
+ accountId = Config.Instance.Guid;
+ }
+ else
+ {
+ accountId = Config.Instance.Home.MainUserDistributedMark;
+ }
+ }
+ var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 82 } };
+ var data = new Newtonsoft.Json.Linq.JObject { { "HomeId", HomeId }, { "AccountId", accountId } };
+ jObject.Add("Data", data);
+ //浣忓畢ID鐨勮缃�,鍥哄畾浣跨敤灞�鍩熺綉,涓嶅瓨鍦ㄨ繙绋嬬殑璇存硶
+ var result = this.SendJobjectDataToGateway(zbGateway, "GwSetHomeId", jObject.ToString(), "GwSetHomeId_Respon", 5, true);
+ if (result.ErrorMsgDiv == -1)
{
if (mode == ShowErrorMode.YES)
{
@@ -350,13 +368,11 @@
}
return false;
}
-
- var info = await realWay.GwSetHomeIdAsync(HomeId);
- if (info != null && info.gwSetHomeIdData != null)
+ if (result.ErrorMsgDiv == 0)
{
- return true;
+ return false;
}
- return false;
+ return true;
}
/// <summary>
@@ -372,7 +388,7 @@
//鑾峰彇鎺у埗涓讳汉璐﹀彿鐨凾oken
bindGateway.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
- var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" });
+ var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" }, false);
if (result == "Error")
{
return -1;
@@ -418,7 +434,7 @@
/// </summary>
/// <param name="zbGateway">缃戝叧</param>
/// <param name="btnMsg">娑堟伅鎺т欢</param>
- public async Task<int> ReBindNewGateway(ZbGateway zbGateway, NormalViewControl btnMsg = null)
+ public int ReBindNewGateway(ZbGateway zbGateway, NormalViewControl btnMsg = null)
{
if (zbGateway == null)
{
@@ -435,7 +451,7 @@
}
//璁剧疆浣忓畢ID鍒扮綉鍏�
- bool flage2 = await this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, ShowErrorMode.YES);
+ bool flage2 = this.SetHomeIdToGateway(zbGateway, Common.Config.Instance.HomeId, ShowErrorMode.YES);
if (flage2 == false)
{
//鍚戠綉鍏宠缃綇瀹匢D澶辫触
@@ -470,7 +486,7 @@
btnMsg.TextID = R.MyInternationalizationString.uGatewayDataIsChangingPleaseWhait;
});
}
- await Task.Delay(8000);
+ System.Threading.Thread.Sleep(8000);
//鑾峰彇缃戝叧鐨勪俊鎭�
ZbGatewayData.GetGwData result = null;
@@ -484,7 +500,7 @@
}
count--;
//鏈�澶氬啀绛�20绉�
- await Task.Delay(4000);
+ System.Threading.Thread.Sleep(4000);
}
if (result == null)
{
@@ -579,12 +595,10 @@
/// 鎵ц鍒囨崲缃戝叧鎿嶄綔
/// </summary>
/// <param name="gatewayId"></param>
- public async Task<bool> DoSwitchGateway(string gatewayId)
+ public bool DoSwitchGateway(string gatewayId)
{
- var zbGateway = this.GetLocalGateway(gatewayId);
-
//閲嶆柊鑾峰彇鍦ㄧ嚎缃戝叧鐨勪俊鎭�
- var result = await this.GetOnlineGatewayInfo(gatewayId);
+ var result = this.GetOnlineGatewayInfo(gatewayId);
if (result == false)
{
return false;
@@ -603,7 +617,7 @@
/// </summary>
/// <param name="gatewayId"></param>
/// <returns></returns>
- private async Task<bool> GetOnlineGatewayInfo(string gatewayId)
+ private bool GetOnlineGatewayInfo(string gatewayId)
{
//鏄剧ず杩涘害鏉�
ProgressBar.Show();
@@ -616,7 +630,7 @@
//閲嶆柊璁剧疆浣忓畢ID(杩欎釜搴旇鏄笉缁忚繃APP,鐩存帴鎶婄綉鍏虫仮澶嶄簡鍑哄巶璁剧疆)
if (this.HomeIdIsEmpty(realWay.HomeId) == true)
{
- int result2 = await this.ReBindNewGateway(realWay);
+ int result2 = this.ReBindNewGateway(realWay);
if (result2 == 0)
{
//鍑虹幇鏈煡閿欒,璇风◢鍚庡啀璇�
@@ -675,25 +689,15 @@
/// <summary>
/// 鍒犻櫎缃戝叧锛屽寘鎷簯绔拰鏈湴(澶辫触鏃朵笉浼氭樉绀轰俊鎭紝骞朵笖浼氳繑鍥瀟rue)
/// </summary>
- /// <param name="zbGateway"></param>
- public async Task<bool> DeleteGateway(ZbGateway zbGateway)
- {
- //绉婚櫎鏈湴缃戝叧淇℃伅
- return await this.DeleteGateway(zbGateway.GwId);
- }
-
- /// <summary>
- /// 鍒犻櫎缃戝叧锛屽寘鎷簯绔拰鏈湴(澶辫触鏃朵笉浼氭樉绀轰俊鎭紝骞朵笖浼氳繑鍥瀟rue)
- /// </summary>
/// <param name="zbGatewayID"></param>
- public async Task<bool> DeleteGateway(string zbGatewayID)
+ public bool DeleteGateway(string zbGatewayID)
{
ZbGateway realWay = null;
this.GetRealGateway(ref realWay, zbGatewayID);
//娓呯┖缃戝叧鐨勪綇瀹匢D 缃戝叧瑙g粦澶辫触 涓嶇悊瀹�,鍥犱负缃戝叧鍙互鎸夋寜閿己鍒舵悳绱㈠緱鍒�
if (realWay != null)
{
- await this.SetHomeIdToGateway(realWay, string.Empty, ShowErrorMode.NO);
+ this.SetHomeIdToGateway(realWay, string.Empty, ShowErrorMode.NO);
}
//鍒犻櫎浜戠鐨勭綉鍏�
@@ -1487,24 +1491,39 @@
#endregion
- #region 鈻� 娓呯┖鐪熷疄缃戝叧鍒楄〃___________________
+ #region 鈻� 娓呯┖鐪熷疄缃戝叧閾炬帴___________________
/// <summary>
- /// 娓呯┖鍏ㄩ儴鐨勭湡瀹炵墿鐞嗙綉鍏冲璞�
+ /// 娓呯┖鍏ㄩ儴鐨勭湡瀹炵墿鐞嗙綉鍏崇殑閾炬帴
/// </summary>
- public void ClearAllRealGateway()
+ /// <param name="roadGateway">鏄惁鍔犺浇鏈湴鐨勭綉鍏冲璞″埌鐪熷疄鍒楄〃涓�</param>
+ public void ClearAllRealGatewayConection(bool roadGateway)
{
- //鍥犱负閭d竴鐬棿锛屾湁鍙兘mqtt浼氬姞鍥炴潵,鎵�浠ュ厛鍔犵紦瀛�
- var list = new List<ZbGateway>();
- list.AddRange(ZbGateway.GateWayList);
- //鐒跺悗娓呯┖鎺�
- ZbGateway.GateWayList.Clear();
- //鏈�鍚庡啀鏂紑mqtt杩炴帴
- for (int i = 0; i < list.Count; i++)
+ //鏂紑mqtt杩炴帴(鍗充娇淇濆瓨鍦ㄥ唴瀛樺綋涓篃娌¢棶棰�,鍥犱负濡傛灉骞挎挱涓嶅埌,鍒欏畠涓嶄細寤虹珛閾炬帴)
+ for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
- list[i].DisConnectLocalMqttClient("G");
+ ZbGateway.GateWayList[i].DisConnectLocalMqttClient("G");
}
- list.Clear();
+ //鍔犺浇鏈湴缃戝叧瀵硅薄
+ if (roadGateway == true)
+ {
+ List<string> listFile = this.GetAllGatewayFile();
+ //鍙嶅簭鍒楀寲娣诲姞鍒扮紦瀛�
+ foreach (string file in listFile)
+ {
+ //浠庢枃浠朵腑鍙嶅簭鍒楀寲鍑虹綉鍏冲璞�
+ var gateway = this.GetGatewayFromFile(file);
+ if (gateway == null)
+ {
+ continue;
+ }
+ var tempWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.GwId == gateway.GwId));
+ if (tempWay == null)
+ {
+ ZbGateway.GateWayList.Add(tempWay);
+ }
+ }
+ }
}
#endregion
@@ -1639,12 +1658,16 @@
/// <returns></returns>
public int IsMainGateway(string waiID)
{
- ZbGateway zbGateway = null;
- if (this.GetRealGateway(ref zbGateway, waiID) == false)
+ var realWay = ZbGateway.GateWayList.Find((obj) =>
+ {
+ return obj.GwId == waiID;
+ });
+ //铏氭嫙缃戝叧涔熻繑鍥� 0
+ if (realWay == null || realWay.IsVirtual == true)
{
return 0;
}
- return zbGateway.IsMainGateWay == true ? 1 : 2;
+ return realWay.IsMainGateWay == true ? 1 : 2;
}
#endregion
@@ -1811,7 +1834,7 @@
//鑾峰彇鎺у埗涓讳汉璐﹀彿鐨凾oken
pra.ReqDto.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
- var result = UserCenterLogic.GetResponseDataByRequestHttps("App/GetSingleHomeGatewayPagger", true, pra, list);
+ var result = UserCenterLogic.GetResponseDataByRequestHttps("App/GetSingleHomeGatewayPagger", true, pra, list, false);
if (string.IsNullOrEmpty(result) == true)
{
canBreak = true;
@@ -1943,7 +1966,7 @@
List<string> listNotShowError = new List<string>() { "NoExist", "NoBind", "NoRecord", "NotCheck" };
- bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/ReleaseGatewayToHome", true, Pra, listNotShowError);
+ bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/ReleaseGatewayToHome", true, Pra, listNotShowError, false);
if (result == false)
{
return false;
@@ -1996,7 +2019,7 @@
{
bindGateway.BindGateways.Clear();
bindGateway.BindGateways.Add(gwId);
- var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" });
+ var result = UserCenterLogic.GetResultCodeByRequestHttps("App/BindGatewayToHome", true, bindGateway, new List<string> { "NotCheck" }, false);
if (result == "Success")
{
this.listBackupGwId.Remove(gwId);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
index dcd3593..117fe8c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -277,6 +277,24 @@
#endregion
+ #region 鈻� 铚傞福鍣ㄦ帹閫�
+ //铚傞福鍣ㄦ暟鎹�
+ else if (report.DeviceStatusReport.CluterID == 1282)
+ {
+ //mini澶滅伅
+ if (Common.LocalDevice.Current.IsMiniLight(locadevice) == true)
+ {
+ foreach (var attData in report.DeviceStatusReport.AttriBute)
+ {
+ if (attData.AttributeId == 0)
+ {
+ ((ColorTemperatureLight)locadevice).IsBuzzerRing = attData.AttriButeData == 1 ? true : false;
+ }
+ }
+ }
+ }
+ #endregion
+
#region 鈻� 绐楀笜鏁版嵁
//绐楀笜鏁版嵁
else if (report.DeviceStatusReport.CluterID == 258)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs
index 6187c50..c92cefd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlResidenceLogic.cs
@@ -206,9 +206,11 @@
/// <summary>
/// 鑾峰彇浜戠浣忓畢鍒楄〃
/// </summary>
- public List<string> GetHomeListsFromDb()
+ /// <param name="checkNetwork">鏄惁妫�娴嬬綉缁�,濡傛灉璁剧疆妫�娴嬬殑璇�,褰撲笉鑳借仈缃戞椂,鐩存帴杩斿洖鏈湴浣忓畢</param>
+ /// <returns></returns>
+ public List<string> GetHomeListsFromDb(bool checkNetwork)
{
- if (HdlWifiLogic.Current.CanAccessHttp == false)
+ if (checkNetwork == true && HdlWifiLogic.Current.CanAccessHttp == false)
{
//褰撳墠鏃犳硶鑱旂綉
return Config.Instance.HomeFilePathList;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
index 32f3a09..0917329 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
@@ -1708,11 +1708,6 @@
{
return false;
}
-
- if (zoneId > 3)
- {
- zoneId = 3;
- }
//鐘舵�佸彉鏇�
var result = await Safeguard.DisablePushMessageAsync(zoneId, statu);
if (result == null || result.disablePushMessageResponseData == null || result.disablePushMessageResponseData.Result == 1)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
index 37fe00a..1f3fe59 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
@@ -411,11 +411,14 @@
}
//閲嶆柊鍒濆鍖朣ocket
ZigBee.Common.Application.FindGateWaySocket.Stop();
+ System.Threading.Thread.Sleep(100);
+
//鏂帀鏈湴杩炴帴
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
//鏂帀杩滅▼
ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
+ //濡傛灉鏄痺ifi
if (value == 2)
{
ZigBee.Common.Application.FindGateWaySocket.Start();
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index b841920..2f61f5d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -22,15 +22,9 @@
/// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
/// <param name="obj">涓�涓被</param>
/// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
- /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
- public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+ /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
+ public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
{
- if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
- {
- //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
- ShowNotNetMsg(listNotShowError);
- return false;
- }
//鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
var connectMode = GetHttpConnectMode(checkAuthority);
//鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -39,7 +33,8 @@
{
if (setAgain == false)
{
- //涓嶆寚瀹氶噸鍙�
+ //褰撳墠鏃犳硶璁块棶缃戠粶
+ ShowNotNetMsg(listNotShowError);
return false;
}
byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -61,17 +56,10 @@
/// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
/// <param name="obj">涓�涓被</param>
/// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
- /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
+ /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
/// </param>
- public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+ public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
{
- if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
- {
- //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
- ShowNotNetMsg(listNotShowError);
- return "Error";
- }
-
//鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
var connectMode = GetHttpConnectMode(checkAuthority);
//鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -80,7 +68,8 @@
{
if (setAgain == false)
{
- //涓嶆寚瀹氶噸鍙�
+ //褰撳墠鏃犳硶璁块棶缃戠粶
+ ShowNotNetMsg(listNotShowError);
return "Error";
}
byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -105,16 +94,10 @@
/// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
/// <param name="obj">涓�涓被</param>
/// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
- /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
+ /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
/// </param>
- public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+ public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
{
- if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
- {
- //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
- ShowNotNetMsg(listNotShowError);
- return null;
- }
//鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
var connectMode = GetHttpConnectMode(checkAuthority);
//鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -123,7 +106,8 @@
{
if (setAgain == false)
{
- //涓嶆寚瀹氶噸鍙�
+ //褰撳墠鏃犳硶璁块棶缃戠粶
+ ShowNotNetMsg(listNotShowError);
return null;
}
byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -154,15 +138,9 @@
/// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
/// <param name="obj">涓�涓被</param>
/// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
- /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
- public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+ /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
+ public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
{
- if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
- {
- //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
- ShowNotNetMsg(listNotShowError);
- return null;
- }
//鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
var connectMode = GetHttpConnectMode(checkAuthority);
//鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -172,7 +150,8 @@
{
if (setAgain == false)
{
- //涓嶆寚瀹氶噸鍙�
+ //褰撳墠鏃犳硶璁块棶缃戠粶
+ ShowNotNetMsg(listNotShowError);
return null;
}
revertObj = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -537,7 +516,7 @@
//鏂紑杩滅▼Mqtt杩炴帴,閲嶆柊杩炴帴
HdlThreadLogic.Current.RunThread(async () =>
{
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
}, ShowErrorMode.NO);
}
@@ -618,7 +597,7 @@
//娓呯┖褰撳墠浣忓畢id
Config.Instance.HomeId = string.Empty;
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(false);
//鏂紑杩滅▼Mqtt杩炴帴
HdlThreadLogic.Current.RunThread(async () =>
@@ -674,8 +653,8 @@
}
else if (view is UserView.UserPage)
{
- var form = ((UserView.UserPage)view).GetNowActionForm();
- form?.FormActionAgainEvent();
+ //鍒锋柊涓婚〉
+ UserView.UserPage.Instance.ReFreshControl();
return;
}
else
@@ -861,7 +840,7 @@
//鏂紑杩滅▼Mqtt杩炴帴,閲嶆柊杩炴帴
HdlThreadLogic.Current.RunThread(async () =>
{
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
}, ShowErrorMode.NO);
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index 568ce9c..8d3f858 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -269,7 +269,8 @@
btnRight.ButtonClickEvent += (sender, e) =>
{
//鍥炶矾鏁板ぇ浜�1鎵嶅睍寮�
- if (Common.LocalDevice.Current.GetDevicesCountByMac(deviceMac) > 1)
+ var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
+ if (listMacDevice.Count > 1)
{
btnRight.IsSelected = !btnRight.IsSelected;
//灞曞紑鎴栬�呮姌鍙犳槑缁嗗垪琛�
@@ -277,9 +278,20 @@
}
else
{
+ if (LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
+ {
+ //mini澶滅伅鐨勫姛鑳借缃晫闈�
+ var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
+ var form = new MainPage.DeviceDetailInfoForm();
+ form.AddForm(listMacDevice[0], room);
+ }
+ else
+ {
+ //璁惧淇℃伅鐣岄潰
+ var form = new DeviceMacInfoEditorForm();
+ form.AddForm(deviceMac);
+ }
btnNew.Visible = false;
- var form = new DeviceMacInfoEditorForm();
- form.AddForm(deviceMac);
//鐣岄潰璺宠浆,璁板綍褰撳墠鐨勬鍦ㄦ搷浣滅殑璁惧鐨凪ac鍦板潃
this.nowActionDeviceMac = deviceMac;
}
@@ -296,9 +308,22 @@
form2.AddForm(deviceMac);
return;
}
+ var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
+ if (LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
+ {
+ //mini澶滅伅鐨勫姛鑳借缃晫闈�
+ var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
+ var form = new MainPage.DeviceDetailInfoForm();
+ form.AddForm(listMacDevice[0], room);
+ }
+ else
+ {
+ //璁惧淇℃伅鐣岄潰
+ var form = new DeviceMacInfoEditorForm();
+ form.AddForm(deviceMac);
+ }
+
btnNew.Visible = false;
- var form = new DeviceMacInfoEditorForm();
- form.AddForm(deviceMac);
//鐣岄潰璺宠浆,璁板綍褰撳墠鐨勬鍦ㄦ搷浣滅殑璁惧鐨凪ac鍦板潃
this.nowActionDeviceMac = deviceMac;
};
@@ -674,7 +699,7 @@
/// <summary>
/// 婊戝姩鎺т欢涓嬫媺鍒锋柊
/// </summary>
- private async void ListViewBeginHeaderRefreshing()
+ private void ListViewBeginHeaderRefreshing()
{
//濡傛灉褰撳墠浣忓畢鏄櫄鎷熺殑
if (Common.Config.Instance.Home.IsVirtually == true)
@@ -701,7 +726,7 @@
{
//鏄剧ず杩涘害鏉�
ProgressBar.Show();
- int result2 = await HdlGatewayLogic.Current.ReBindNewGateway(realWay);
+ int result2 = HdlGatewayLogic.Current.ReBindNewGateway(realWay);
//鍏抽棴杩涘害鏉�
ProgressBar.Close();
if (result2 == -1)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs
index f19425c..05aa07c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySearchForm.cs
@@ -239,7 +239,7 @@
HdlThreadLogic.Current.RunThread(() =>
{
//娓呯┖鍏ㄩ儴鍒楄〃
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
ZigBee.Common.Application.IsSearchingGateway = true;
int index = 1;
@@ -253,7 +253,7 @@
if (timeCount == 10)
{
//5绉掑悗娓呯┖缃戝叧鍒楄〃
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
ZigBee.Common.Application.IsSearchingGateway = true;
}
if (timeCount % 2 == 0)
@@ -316,7 +316,7 @@
private void StartCheckGatewayThread()
{
this.isGatewaySearching = true;
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
int count = 0;
while (this.Parent != null && this.isGatewaySearching == true)
@@ -331,7 +331,7 @@
}
count = 0;
- await this.CheckZbGatewayAndSetRow();
+ this.CheckZbGatewayAndSetRow();
if (this.newGatewayGetting == true)
{
@@ -345,7 +345,7 @@
/// <summary>
/// 妫�娴嬫悳绱㈠埌鐨勭綉鍏�
/// </summary>
- private async Task<bool> CheckZbGatewayAndSetRow()
+ private bool CheckZbGatewayAndSetRow()
{
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
@@ -383,7 +383,7 @@
if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
{
//娣诲姞鎼滅储鍒扮殑缃戝叧鍒扮紦瀛�(鎵ц缃戝叧淇濆瓨鎿嶄綔)
- var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
+ var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
if (result == false)
{
continue;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs
index c959bbf..0800856 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs
@@ -54,25 +54,35 @@
rowWifi.InitControl();
rowWifi.AddBottomLine();
rowWifi.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
+ //涓嬫媺鍥炬爣鏄亸鍙崇殑
+ rowWifi.RightOffset = -Application.GetRealWidth(18);
+ var btnDrop = rowWifi.AddMostRightEmptyIcon(58, 58);
+ btnDrop.UnSelectedImagePath = "Item/Down.png";
+ rowWifi.ChangedChidrenBindMode(btnDrop, ChidrenBindMode.NotBind);
+ btnDrop.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ずWifi涓嬫媺鍒楄〃
+ this.ShowWifiListView(rowWifi);
+ };
//瀵嗙爜
- var btnPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
- btnPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
- frameBack.AddChidren(btnPsw);
- btnPsw.InitControl();
- btnPsw.txtInput.SecureTextEntry = true;
- btnPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
- var btnView = btnPsw.AddMostRightEmptyIcon(81, 81);
+ var rowPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
+ rowPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
+ frameBack.AddChidren(rowPsw);
+ rowPsw.InitControl();
+ rowPsw.txtInput.SecureTextEntry = true;
+ rowPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
+ var btnView = rowPsw.AddMostRightEmptyIcon(81, 81);
btnView.UnSelectedImagePath = "Item/HidenPWD.png";
btnView.SelectedImagePath = "Item/UnHidenPWD.png";
- btnPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
+ rowPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
btnView.ButtonClickEvent += (sender, e) =>
{
btnView.IsSelected = !btnView.IsSelected;
- btnPsw.txtInput.SecureTextEntry = !btnPsw.txtInput.SecureTextEntry;
+ rowPsw.txtInput.SecureTextEntry = !rowPsw.txtInput.SecureTextEntry;
};
- var btnMsg = new NormalViewControl(btnPsw.txtInput.Width, false);
+ var btnMsg = new NormalViewControl(rowPsw.txtInput.Width, false);
btnMsg.X = ControlCommonResourse.XXLeft;
btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23);
btnMsg.TextSize = 12;
@@ -102,14 +112,14 @@
btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
return;
}
- if (btnPsw.Text == string.Empty)
+ if (rowPsw.Text == string.Empty)
{
//璇疯緭鍏ifi瀵嗙爜
btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
return;
}
//鍙戦�佸瘑鐮�
- var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, btnPsw.Text);
+ var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, rowPsw.Text);
if (result == false)
{
//瀵嗙爜鍙戦�佸け璐�
@@ -125,6 +135,60 @@
#endregion
+ #region 鈻� 鏄剧ずWifi涓嬫媺鍒楄〃___________________
+
+ /// <summary>
+ /// 鏄剧ずWifi涓嬫媺鍒楄〃
+ /// </summary>
+ /// <param name="rowWifi"></param>
+ private void ShowWifiListView(FrameCaptionInputControl rowWifi)
+ {
+ //涓�涓彲浠ラ伄浣廈ody鐨勪笢瑗�
+ var frameTran = new NormalFrameLayout();
+ frameTran.Height = bodyFrameLayout.Height;
+ frameTran.BackgroundColor = UserCenterColor.Current.DialogBackColor;
+ bodyFrameLayout.AddChidren(frameTran);
+ frameTran.ButtonClickEvent += (sender, e) =>
+ {
+ frameTran.RemoveFromParent();
+ };
+ //鐧借壊鑳屾櫙妗�
+ var frameList = new NormalFrameLayout();
+ frameList.Y = rowWifi.Bottom;
+ frameList.Gravity = Gravity.CenterHorizontal;
+ frameList.Width = frameTran.Width - ControlCommonResourse.XXLeft * 2;
+ frameList.Height = this.GetPictrueRealSize(1200);
+ frameList.Radius = (uint)Application.GetRealWidth(17);
+ frameList.BackgroundColor = UserCenterColor.Current.White;
+ frameTran.AddChidren(frameList);
+ //鍒楄〃鎺т欢
+ var listView = new VerticalListControl();
+ listView.Height = frameList.Height;
+ frameList.AddChidren(listView);
+
+ for (int i = 1; i <= 10; i++)
+ {
+ var frameRow = new FrameRowControl();
+ listView.AddChidren(frameRow);
+ //wifi鍚嶅瓧
+ var btnWifi = new NormalViewControl(frameRow.Width, frameRow.Height - ControlCommonResourse.BottomLineHeight, false);
+ btnWifi.X = ControlCommonResourse.XXLeft;
+ btnWifi.Text = "Application Software" + i;
+ frameRow.AddChidren(btnWifi, ChidrenBindMode.BindEvent);
+ //搴曠嚎
+ var btnLine = new NormalViewControl(frameRow.Width, ControlCommonResourse.BottomLineHeight, false);
+ btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+ btnLine.Y = btnWifi.Bottom;
+ frameRow.AddChidren(btnLine, ChidrenBindMode.BindEvent);
+ frameRow.ButtonClickEvent += (sender, e) =>
+ {
+ rowWifi.Text = btnWifi.Text;
+ frameTran.RemoveFromParent();
+ };
+ }
+ }
+ #endregion
+
#region 鈻� 鐣岄潰鍏抽棴___________________________
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
index 726b27a..9539160 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
@@ -292,10 +292,10 @@
private void StartCheckGatewayThread()
{
this.isGatewaySearching = true;
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//娓呯┖鍏ㄩ儴鍒楄〃
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
ZigBee.Common.Application.IsSearchingGateway = true;
int count = 0;
@@ -311,7 +311,7 @@
}
count = 0;
- await this.CheckZbGatewayAndSetRow();
+ this.CheckZbGatewayAndSetRow();
if (this.newGatewayGetting == true)
{
@@ -325,7 +325,7 @@
/// <summary>
/// 妫�娴嬫悳绱㈠埌鐨勭綉鍏筹紝鐒跺悗娣诲姞鍒扮敾闈㈢殑琛岄噷闈�
/// </summary>
- private async Task<bool> CheckZbGatewayAndSetRow()
+ private bool CheckZbGatewayAndSetRow()
{
List<string> listId = new List<string>();
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
@@ -389,7 +389,7 @@
if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
{
//娣诲姞鎼滅储鍒扮殑缃戝叧鍒扮紦瀛�(鎵ц缃戝叧淇濆瓨鎿嶄綔)
- var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
+ var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
if (result == false)
{
continue;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs
index 3b35e26..dbe4e4b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSearchForm.cs
@@ -249,7 +249,7 @@
if (timeCount == 10)
{
//5绉掑悗娓呯┖缃戝叧鍒楄〃
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
ZigBee.Common.Application.IsSearchingGateway = true;
}
if (timeCount % 2 == 0)
@@ -312,7 +312,7 @@
private void StartCheckGatewayThread()
{
this.isGatewaySearching = true;
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
int count = 0;
while (this.Parent != null && this.isGatewaySearching == true)
@@ -327,7 +327,7 @@
}
count = 0;
- await this.CheckZbGatewayAndSetRow();
+ this.CheckZbGatewayAndSetRow();
if (this.newGatewayGetting == true)
{
@@ -341,7 +341,7 @@
/// <summary>
/// 妫�娴嬫悳绱㈠埌鐨勭綉鍏�
/// </summary>
- private async Task<bool> CheckZbGatewayAndSetRow()
+ private bool CheckZbGatewayAndSetRow()
{
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
@@ -379,7 +379,7 @@
if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
{
//娣诲姞鎼滅储鍒扮殑缃戝叧鍒扮紦瀛�(鎵ц缃戝叧淇濆瓨鎿嶄綔)
- var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
+ var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
if (result == false)
{
continue;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs
index c3a2d29..7c52b22 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs
@@ -1,6 +1,5 @@
锘縰sing System;
using System.Collections.Generic;
-using System.Security.Cryptography;
using System.Text;
namespace Shared.Phone.UserCenter.GatewayAdd
@@ -52,25 +51,35 @@
rowWifi.InitControl();
rowWifi.AddBottomLine();
rowWifi.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
+ //涓嬫媺鍥炬爣鏄亸鍙崇殑
+ rowWifi.RightOffset = -Application.GetRealWidth(18);
+ var btnDrop = rowWifi.AddMostRightEmptyIcon(58, 58);
+ btnDrop.UnSelectedImagePath = "Item/Down.png";
+ rowWifi.ChangedChidrenBindMode(btnDrop, ChidrenBindMode.NotBind);
+ btnDrop.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ずWifi涓嬫媺鍒楄〃
+ this.ShowWifiListView(rowWifi);
+ };
//瀵嗙爜
- var btnPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
- btnPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
- frameBack.AddChidren(btnPsw);
- btnPsw.InitControl();
- btnPsw.txtInput.SecureTextEntry = true;
- btnPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
- var btnView = btnPsw.AddMostRightEmptyIcon(81, 81);
+ var rowPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
+ rowPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
+ frameBack.AddChidren(rowPsw);
+ rowPsw.InitControl();
+ rowPsw.txtInput.SecureTextEntry = true;
+ rowPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
+ var btnView = rowPsw.AddMostRightEmptyIcon(81, 81);
btnView.UnSelectedImagePath = "Item/HidenPWD.png";
btnView.SelectedImagePath = "Item/UnHidenPWD.png";
- btnPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
+ rowPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
btnView.ButtonClickEvent += (sender, e) =>
{
btnView.IsSelected = !btnView.IsSelected;
- btnPsw.txtInput.SecureTextEntry = !btnPsw.txtInput.SecureTextEntry;
+ rowPsw.txtInput.SecureTextEntry = !rowPsw.txtInput.SecureTextEntry;
};
- var btnMsg = new NormalViewControl(btnPsw.txtInput.Width, false);
+ var btnMsg = new NormalViewControl(rowPsw.txtInput.Width, false);
btnMsg.X = ControlCommonResourse.XXLeft;
btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23);
btnMsg.TextSize = 12;
@@ -100,14 +109,14 @@
btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
return;
}
- if (btnPsw.Text == string.Empty)
+ if (rowPsw.Text == string.Empty)
{
//璇疯緭鍏ifi瀵嗙爜
btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
return;
}
//鍙戦�佸瘑鐮�
- var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, btnPsw.Text);
+ var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, rowPsw.Text);
if (result == false)
{
//瀵嗙爜鍙戦�佸け璐�
@@ -115,13 +124,68 @@
return;
}
- var form = new WirelessApDirection3Form();
- this.AddFromAndRemoveNowForm(form);
+ this.CloseForm();
+ var form = new MiniGatewayDirection3Form();
+ form.AddForm();
};
}
#endregion
+ #region 鈻� 鏄剧ずWifi涓嬫媺鍒楄〃___________________
+
+ /// <summary>
+ /// 鏄剧ずWifi涓嬫媺鍒楄〃
+ /// </summary>
+ /// <param name="rowWifi"></param>
+ private void ShowWifiListView(FrameCaptionInputControl rowWifi)
+ {
+ //涓�涓彲浠ラ伄浣廈ody鐨勪笢瑗�
+ var frameTran = new NormalFrameLayout();
+ frameTran.Height = bodyFrameLayout.Height;
+ frameTran.BackgroundColor = UserCenterColor.Current.DialogBackColor;
+ bodyFrameLayout.AddChidren(frameTran);
+ frameTran.ButtonClickEvent += (sender, e) =>
+ {
+ frameTran.RemoveFromParent();
+ };
+ //鐧借壊鑳屾櫙妗�
+ var frameList = new NormalFrameLayout();
+ frameList.Y = rowWifi.Bottom;
+ frameList.Gravity = Gravity.CenterHorizontal;
+ frameList.Width = frameTran.Width - ControlCommonResourse.XXLeft * 2;
+ frameList.Height = this.GetPictrueRealSize(1200);
+ frameList.Radius = (uint)Application.GetRealWidth(17);
+ frameList.BackgroundColor = UserCenterColor.Current.White;
+ frameTran.AddChidren(frameList);
+ //鍒楄〃鎺т欢
+ var listView = new VerticalListControl();
+ listView.Height = frameList.Height;
+ frameList.AddChidren(listView);
+
+ for (int i = 1; i <= 10; i++)
+ {
+ var frameRow = new FrameRowControl();
+ listView.AddChidren(frameRow);
+ //wifi鍚嶅瓧
+ var btnWifi = new NormalViewControl(frameRow.Width, frameRow.Height - ControlCommonResourse.BottomLineHeight, false);
+ btnWifi.X = ControlCommonResourse.XXLeft;
+ btnWifi.Text = "Application Software" + i;
+ frameRow.AddChidren(btnWifi, ChidrenBindMode.BindEvent);
+ //搴曠嚎
+ var btnLine = new NormalViewControl(frameRow.Width, ControlCommonResourse.BottomLineHeight, false);
+ btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+ btnLine.Y = btnWifi.Bottom;
+ frameRow.AddChidren(btnLine, ChidrenBindMode.BindEvent);
+ frameRow.ButtonClickEvent += (sender, e) =>
+ {
+ rowWifi.Text = btnWifi.Text;
+ frameTran.RemoveFromParent();
+ };
+ }
+ }
+ #endregion
+
#region 鈻� 鐣岄潰鍏抽棴___________________________
/// <summary>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs
index 73e09d6..a70a6b3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessUdpSearchForm.cs
@@ -249,7 +249,7 @@
if (timeCount == 10)
{
//5绉掑悗娓呯┖缃戝叧鍒楄〃
- HdlGatewayLogic.Current.ClearAllRealGateway();
+ HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
ZigBee.Common.Application.IsSearchingGateway = true;
}
if (timeCount % 2 == 0)
@@ -312,7 +312,7 @@
private void StartCheckGatewayThread()
{
this.isGatewaySearching = true;
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
int count = 0;
while (this.Parent != null && this.isGatewaySearching == true)
@@ -327,7 +327,7 @@
}
count = 0;
- await this.CheckZbGatewayAndSetRow();
+ this.CheckZbGatewayAndSetRow();
if (this.newGatewayGetting == true)
{
@@ -341,7 +341,7 @@
/// <summary>
/// 妫�娴嬫悳绱㈠埌鐨勭綉鍏�
/// </summary>
- private async Task<bool> CheckZbGatewayAndSetRow()
+ private bool CheckZbGatewayAndSetRow()
{
for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
{
@@ -379,7 +379,7 @@
if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
{
//娣诲姞鎼滅储鍒扮殑缃戝叧鍒扮紦瀛�(鎵ц缃戝叧淇濆瓨鎿嶄綔)
- var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
+ var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
if (result == false)
{
continue;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index 58fdae5..fb1d954 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -330,7 +330,7 @@
private void CheckNewVersion(PicViewControl btnNewVersion)
{
//鑾峰彇缃戝叧鐗堟湰淇℃伅
- var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
+ var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway, ShowErrorMode.NO);
if (result == null)
{
return;
@@ -380,9 +380,9 @@
/// </summary>
/// <param name="gatewayId"></param>
/// <param name="online"></param>
- private async void DoSwitchGateway()
+ private void DoSwitchGateway()
{
- var result = await HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
+ var result = HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
if (result == false)
{
return;
@@ -425,13 +425,13 @@
/// <param name="row"></param>
private void DeleteGateway(string strWayId)
{
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
//鍒犻櫎浜戠缃戝叧
- bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
+ bool result = HdlGatewayLogic.Current.DeleteGateway(strWayId);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
if (result == false)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
index 8b60ed8..d0b5faf 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -238,12 +238,12 @@
/// </summary>
/// <param name="strWayId"></param>
/// <param name="row"></param>
- private async void DeleteGateway(string strWayId)
+ private void DeleteGateway(string strWayId)
{
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
//鍒犻櫎浜戠缃戝叧
- bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
+ bool result = HdlGatewayLogic.Current.DeleteGateway(strWayId);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
if (result == false)
@@ -273,9 +273,9 @@
/// </summary>
/// <param name="gatewayId"></param>
/// <param name="online"></param>
- private async void DoSwitchGateway(string gatewayId)
+ private void DoSwitchGateway(string gatewayId)
{
- var result = await HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
+ var result = HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
if (result == false)
{
return;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
index eea6e72..5411559 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
@@ -40,14 +40,21 @@
btnMsg.TextID = R.MyInternationalizationString.uIsReBindingPleaseWaiting;
bodyFrameLayout.AddChidren(btnMsg);
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
- await System.Threading.Tasks.Task.Delay(1000);
- int value = await HdlGatewayLogic.Current.ReBindNewGateway(i_gateway, btnMsg);
+ System.Threading.Thread.Sleep(1000);
+ int value = HdlGatewayLogic.Current.ReBindNewGateway(i_gateway, btnMsg);
if (value == 1)
{
//鎴愬姛
i_dicZbGatewayDiv[i_gateway.GwId] = 1;
+ //鎴戣寰楄繖閲岄渶瑕佽幏鍙栦竴涓嬫柊缃戝叧鐨勮澶囧垪琛�
+ Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(i_gateway, true);
+ if (i_gateway.IsMainGateWay == true)
+ {
+ //濡傛灉瀹冩槸涓荤綉鍏�,鍒欏埛鏂板満鏅垪琛�
+ HdlSceneLogic.Current.RefreshSceneUIList(true);
+ }
}
else if (value == 0)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
index ca44a7a..70d86b1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewaySearchListForm.cs
@@ -178,12 +178,9 @@
/// </summary>
public override void CloseFormBefore()
{
- var userPageForm = UserView.UserPage.Instance.GetNowActionForm();
- if (userPageForm != null && userPageForm.FormID == "UserMainForm")
- {
- //鍒锋柊涓婚〉
- UserView.UserPage.Instance.ReFreshControl();
- }
+ //鍒锋柊涓婚〉
+ UserView.UserPage.Instance.ReFreshControl();
+
base.CloseFormBefore();
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs
index 73f495e..15592dc 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionDirectoryListForm.cs
@@ -63,7 +63,7 @@
row1.AddBottomLine();
row1.ButtonClickEvent += (sender, e) =>
{
- var form = new HideOptionFileListForm();
+ var form = new HideOptionSearchAllFile();
form.AddForm(Common.Config.Instance.FullPath);
};
@@ -99,7 +99,7 @@
row1.ButtonClickEvent += (sender, e) =>
{
- var form = new HideOptionFileListForm();
+ var form = new HideOptionSearchAllFile();
form.AddForm(directoryValue);
};
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs
deleted file mode 100755
index a4a3e23..0000000
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileListForm.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Shared.Phone.UserCenter.HideOption
-{
- /// <summary>
- /// 鏈湴缂撳瓨鏂囦欢鍒楄〃鐨勭晫闈�
- /// </summary>
- public class HideOptionFileListForm : EditorCommonForm
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 瑙e瘑
- /// </summary>
- private bool decryptPassword = false;
-
- #endregion
-
- #region 鈻� 鍒濆鍖朹____________________________
-
- /// <summary>
- /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
- /// </summary>
- public void ShowForm(string directory)
- {
- //璁剧疆澶撮儴淇℃伅
- base.SetTitleText("鏂囦欢鍒楄〃");
-
- var btnButton = new NormalViewControl(200, 69, true);
- btnButton.Gravity = Gravity.CenterVertical;
- btnButton.X = bodyFrameLayout.Width - Application.GetRealWidth(200) - ControlCommonResourse.XXLeft;
- btnButton.TextColor = UserCenterColor.Current.TopLayoutTitleText;
- btnButton.TextAlignment = TextAlignment.BottomRight;
- btnButton.TextSize = 17;
- btnButton.Text = "缈昏瘧";
- topFrameLayout.AddChidren(btnButton);
- btnButton.ButtonClickEvent += (sender, e) =>
- {
- if (this.decryptPassword == false)
- {
- this.decryptPassword = true;
- //鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame(directory);
- }
- };
-
- //鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame(directory);
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
- /// </summary>
- private void InitMiddleFrame(string directory)
- {
- this.ClearBodyFrame();
-
- var listAllFile = HdlFileLogic.Current.GetFileFromDirectory(directory);
- listAllFile.Sort();
-
- var listView = new VerticalListControl(23);
- listView.BackgroundColor = UserCenterColor.Current.White;
- listView.Height = bodyFrameLayout.Height;
- bodyFrameLayout.AddChidren(listView);
-
- for (int i = 0; i < listAllFile.Count; i++)
- {
- this.AddRowControl(listView, listAllFile[i], directory, i != listAllFile.Count - 1);
- }
- listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(50));
-
- var btnButon = new BottomClickButton();
- btnButon.Text = "鍒犻櫎鏂囦欢澶�";
- bodyFrameLayout.AddChidren(btnButon);
- btnButon.ButtonClickEvent += (sender, e) =>
- {
- this.ShowMassage(ShowMsgType.Confirm, "鏄惁娓呴櫎璇ユ枃浠跺す", () =>
- {
- try
- {
- System.IO.Directory.Delete(directory, true);
- this.CloseForm();
- }
- catch (Exception ex)
- {
- this.ShowMassage(ShowMsgType.Error, "娓呴櫎缂撳瓨鏂囦欢澶瑰紓甯�");
- HdlLogLogic.Current.WriteLog(ex, "娓呴櫎缂撳瓨鏂囦欢澶瑰紓甯�");
- }
- });
- };
- if (directory == Common.Config.Instance.FullPath)
- {
- btnButon.CanClick = false;
- }
- }
-
- private void AddRowControl(VerticalListControl listView, string fileName, string directory, bool addLine)
- {
- string fileNewName = fileName;
- if (decryptPassword == true && fileName.StartsWith("Device_") == false)
- {
- try
- {
- fileNewName = UserCenterLogic.DecryptPassword(UserCenterResourse.FileEncryptKey, fileName);
- }
- catch { fileNewName = fileName; }
- }
-
- var row1 = new RowLayoutControl(listView.rowSpace / 2);
- listView.AddChidren(row1);
- var btnName = row1.frameTable.AddLeftCaption(fileNewName, 800);
- btnName.IsMoreLines = true;
- if (addLine == true)
- {
- row1.frameTable.AddBottomLine();
- }
- row1.frameTable.AddRightArrow();
-
- var btnUpLoad = row1.AddEditorControl();
- btnUpLoad.Text = "涓婁紶";
- btnUpLoad.ButtonClickEvent += (sender, e) =>
- {
- this.ShowMassage(ShowMsgType.Confirm, "鏄惁涓婁紶璇ユ枃浠�(娴嬭瘯)?", () =>
- {
- HdlThreadLogic.Current.RunThread(() =>
- {
- string tagrtFile = System.IO.Path.Combine(directory, fileName);
- HdlBackupLogic.Current.UpLoadByteDataToOptionBackup(fileName, HdlFileLogic.Current.ReadFileByteContent(tagrtFile));
- });
- });
- };
-
- var btnDelete = row1.AddDeleteControl();
- btnDelete.ButtonClickEvent += (sender, e) =>
- {
- this.ShowMassage(ShowMsgType.Confirm, "鏄惁娓呴櫎璇ョ紦瀛樻枃浠�", () =>
- {
- var myFile = System.IO.Path.Combine(Common.Config.Instance.FullPath, directory, fileName);
- try
- {
- System.IO.File.Delete(myFile);
- row1.RemoveFromParent();
- }
- catch (Exception ex)
- {
- this.ShowMassage(ShowMsgType.Error, "娓呴櫎缂撳瓨鏂囦欢寮傚父");
- HdlLogLogic.Current.WriteLog(ex, "娓呴櫎缂撳瓨鏂囦欢寮傚父");
- }
- });
- };
-
- row1.frameTable.ButtonClickEvent += (sender, e) =>
- {
- var form = new HideOptionFileContentForm();
- form.AddForm(System.IO.Path.Combine(Common.Config.Instance.FullPath, directory, fileName));
- };
- }
-
- #endregion
-
- #region 鈻� 涓�鑸柟娉昣__________________________
-
- #endregion
- }
-}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
index 5cc33dd..2731bce 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs
@@ -69,13 +69,13 @@
this.AddNormalRowControl("鎵嬫満鑾峰彇鐨処P", 600, new Shared.Net.NetWiFi().BroadcastIpAddress.ToString(), 600);
- if (ZigBee.Common.Application.FindGateWaySocket.busSocket == null)
+ if (ZigBee.Common.Application.FindGateWaySocket.udpClient == null)
{
this.AddNormalRowControl("Socket閾炬帴", 400, "鏈垵濮嬪寲", 400);
}
else
{
- this.AddNormalRowControl("Socket閾炬帴", 400, ZigBee.Common.Application.FindGateWaySocket.busSocket.Connected == true ? "true" : "false", 400);
+ this.AddNormalRowControl("Socket閾炬帴", 400, "宸插垵濮嬪寲", 400);
}
int count = ZbGateway.GateWayList.Count;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs
index 401554a..34348bd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionSearchAllFile.cs
@@ -131,6 +131,30 @@
}
}
listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(50));
+
+ var btnButon = new BottomClickButton();
+ btnButon.Text = "鍒犻櫎鏂囦欢澶�";
+ bodyFrameLayout.AddChidren(btnButon);
+ btnButon.ButtonClickEvent += (sender, e) =>
+ {
+ this.ShowMassage(ShowMsgType.Confirm, "鏄惁娓呴櫎璇ユ枃浠跺す", () =>
+ {
+ try
+ {
+ System.IO.Directory.Delete(directory, true);
+ this.CloseForm();
+ }
+ catch (Exception ex)
+ {
+ this.ShowMassage(ShowMsgType.Error, "娓呴櫎缂撳瓨鏂囦欢澶瑰紓甯�");
+ HdlLogLogic.Current.WriteLog(ex, "娓呴櫎缂撳瓨鏂囦欢澶瑰紓甯�");
+ }
+ });
+ };
+ if (directory == Common.Config.Instance.FullPath)
+ {
+ btnButon.CanClick = false;
+ }
}
private void AddDirectoryRowControl(VerticalListControl listView, string directoryName, string directory, bool addLine)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs
index e88ead1..d730def 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs
@@ -358,7 +358,7 @@
return;
}
pra.Account = dicMemberAccount[keys];
- var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" });
+ var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" }, false);
if (result == null)
{
continue;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
index 2f15977..9ffe23b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
@@ -416,7 +416,7 @@
{
var pra = new AccountInfoPra();
pra.Account = memberInfo.Account;
- var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" });
+ var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" }, false);
if (result == null)
{
return;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
index c384d1e..ab608cf 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
@@ -124,7 +124,7 @@
{
//鑾峰彇浣忓畢淇℃伅
var Pra = new GetResidenceInfoPra();
- string resultData = UserCenterLogic.GetResponseDataByRequestHttps("App/GetHomePager", false, Pra, new List<string> { "NotCheck" });
+ string resultData = UserCenterLogic.GetResponseDataByRequestHttps("App/GetHomePager", false, Pra, new List<string> { "NotCheck" }, false);
if (string.IsNullOrEmpty(resultData) == true)
{
return false;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index f0438a2..c19b63e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -693,6 +693,7 @@
var myHouse = HdlResidenceLogic.Current.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]);
//鍒囨崲浣忓畢
Common.Config.Instance.HomeId = myHouse.Id;
+ Common.Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(myHouse.Id);
Common.Global.CreateHomeDirectory(myHouse.Id);
Common.Config.Instance.Save();
diff --git a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
index 8503e8e..55e728a 100755
--- a/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/HomePage.cs
@@ -64,7 +64,7 @@
//鐧诲綍鎴愬姛,鎴栬�呮病鏈夌綉缁滈兘鍙互鐧诲綍
if (loginSuccess == 1 || loginSuccess == 2)
{
- var homes = UserCenter.HdlResidenceLogic.Current.GetHomeListsFromDb();
+ var homes = UserCenter.HdlResidenceLogic.Current.GetHomeListsFromDb(true);
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
//鍚姩ZigBee
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
index 91553e0..b3f93e1 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
@@ -160,13 +160,13 @@
{
try
{
- if (FindGateWaySocket.busSocket == null || FindGateWaySocket.busSocket.Available <= 0)
+ if (FindGateWaySocket.udpClient == null || FindGateWaySocket.udpClient.Available <= 0)
{
System.Threading.Thread.Sleep(500);
continue;
- }
- var bytes = new byte[1024];
- var len = FindGateWaySocket.busSocket.Receive(bytes, bytes.Length, System.Net.Sockets.SocketFlags.None);
+ }
+ var ipEndPoint = new System.Net.IPEndPoint(0, 0);
+ var bytes = FindGateWaySocket.udpClient.Receive(ref ipEndPoint);
if (bytes[43] == 0xA2)
{
//骞挎挱鍥炲缃戝叧鐨勫熀鏈俊鎭鐞�
@@ -284,7 +284,14 @@
}
}
}
- catch { }
+ catch (Exception ex)
+ {
+ //璋冭瘯鐢�
+ if (Shared.Phone.UserCenter.UserCenterResourse.HideOption.WriteSocketReceiveDataToFile == 1)
+ {
+ Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(3, "Receive寮傚父\r\n" + ex.Message);
+ }
+ }
}
})
{ IsBackground = true }.Start();
@@ -390,24 +397,19 @@
public static class FindGateWaySocket
{
//鏈湴Socket
- public static Socket busSocket;
+ public static UdpClient udpClient;
/// <summary>
/// 鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳�
/// </summary>
/// <param name="port"></param>
- public static void Start(int port = 7624)
+ public static void Start()
{
- if (IsRunning)
+ if (udpClient!=null)
{
return;
}
- //瀹氫箟缃戠粶绫诲瀷锛屾暟鎹繛鎺ョ被鍨嬪拰缃戠粶鍗忚UDP
- busSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
- busSocket.EnableBroadcast = true;
- busSocket.ReceiveTimeout = 1000;
- busSocket.SendTimeout = 1000;
- busSocket.Bind(new IPEndPoint(IPAddress.Any, port));
+ udpClient = new UdpClient { EnableBroadcast = true };
}
/// <summary>
@@ -417,23 +419,12 @@
{
try
{
- busSocket?.Close();
+ udpClient?.Close();
}
catch { }
- busSocket = null;
+ udpClient = null;
Console.WriteLine("BusSocket鍏抽棴鎴愬姛!");
- }
-
- /// <summary>
- /// 褰撳墠鐨凷ocket鏄惁杩愯
- /// </summary>
- public static bool IsRunning
- {
- get
- {
- return busSocket == null ? false : true;
- }
}
/// <summary>
@@ -444,11 +435,11 @@
{
try
{
- if (IsRunning)
+ if (udpClient == null)
{
- busSocket.BeginSendTo(bytes, 0, bytes.Length, SocketFlags.None, iPEndPoint, new AsyncCallback(asyncEndSend), null);
+ return;
}
-
+ udpClient.Send(bytes, bytes.Length, iPEndPoint);
}
catch (Exception ex)
{
@@ -459,28 +450,8 @@
}
}
}
-
- /// <summary>
- /// 寮傛鍙戦�佹暟鎹粨鏉�
- /// </summary>
- /// <param name="iar"></param>
- private static void asyncEndSend(IAsyncResult iar)
- {
- try
- {
- int bytesSent = busSocket.EndSendTo(iar);
- }
- catch (Exception ex)
- {
- //璋冭瘯鐢�
- if (Shared.Phone.UserCenter.UserCenterResourse.HideOption.WriteSocketReceiveDataToFile == 1)
- {
- Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(3, "寮傛鍙戦�佺粨鏉熷紓甯�(asyncEndSend)\r\n" + ex.Message);
- }
- }
- }
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs
index 1f2a4b8..6dcd028 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ColorTemperatureLight.cs
@@ -28,6 +28,12 @@
public int ColorTemperature = 0;
/// <summary>
+ ///铚傞福鍣ㄦ槸鍚﹀湪鍝嶇潃(true:鍝嶇潃 false:涓嶅搷)
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public bool IsBuzzerRing = false;
+
+ /// <summary>
/// 璇诲彇浜害
/// </summary>
public void ReadLevel()
@@ -43,6 +49,14 @@
ReadAttri(Device.Cluster_ID.ColorControl, AttriButeId.LevelControl);
}
+ /// <summary>
+ /// 璇诲彇铚傞福鍣ㄧ姸鎬�(灏忓鐏笓鐢�)
+ /// </summary>
+ public void ReadBuzzerStatu()
+ {
+ ReadAttri((Cluster_ID)1282, 0);
+ }
+
///<summary >
///璁剧疆璁惧浜害锛圠evel锛�
///<para>value:浜害鍊煎彇鍊艰寖鍥达細0-254</para>
diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems
index 7de833c..651aaa1 100755
--- a/ZigbeeApp/Shared/Shared.projitems
+++ b/ZigbeeApp/Shared/Shared.projitems
@@ -291,7 +291,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HdlBackup\HdlBackupListForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionDirectoryListForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionFileContentForm.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionFileListForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionGatewayListForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionMainForm.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionMemoryListDeviceForm.cs" />
--
Gitblit v1.8.0