From 83f5dcf34d961ac18cf393a21687bf5aca199181 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期五, 11 三月 2022 09:26:50 +0800
Subject: [PATCH] 引入全视通dll库
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 122 ++++++++++++++++++++++++----------------
1 files changed, 73 insertions(+), 49 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index c85fbd0..2a36e2c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -103,8 +103,8 @@
};
}
//鍒濆鍖栫綉鍏宠鎺т欢
- HdlGatewayResourse.NowSelectGatewayId = HdlGatewayResourse.AppOldSelectGatewayId;
- var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(HdlGatewayResourse.AppOldSelectGatewayId);
+ GatewayResourse.NowSelectGatewayId = GatewayResourse.AppOldSelectGatewayId;
+ var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId);
this.gatewayViewRow = new MyGatewayControl(nowGateway);
bodyFrameLayout.AddChidren(gatewayViewRow);
gatewayViewRow.InitControl();
@@ -171,8 +171,8 @@
private void InitDeviceListControl()
{
//鑾峰彇璁惧鍒楄〃
- var listDevice = HdlDeviceCommonLogic.Current.GetDeviceByGatewayID(HdlGatewayResourse.NowSelectGatewayId);
- var listSpecialOta = HdlDeviceCommonLogic.Current.GetSpecialOtaDevice(HdlGatewayResourse.NowSelectGatewayId);
+ var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(GatewayResourse.NowSelectGatewayId);
+ var listSpecialOta = Common.LocalDevice.Current.GetSpecialOtaDevice(GatewayResourse.NowSelectGatewayId);
listDevice.AddRange(listSpecialOta);
this.dicRowInfo.Clear();
@@ -196,7 +196,7 @@
foreach (var macAddress in this.dicRowInfo.Keys)
{
//鑾峰彇ota璁惧
- var ota = HdlDeviceCommonLogic.Current.GetOTADevice(macAddress);
+ var ota = Common.LocalDevice.Current.GetOTADevice(macAddress);
if (ota != null)
{
listOta.Add(ota);
@@ -229,7 +229,7 @@
//鍒涘缓涓�涓彲浠ュ睍寮�鍜屾敹缂╃殑FrameLayout,鐩稿綋浜庤彍鍗曟爮
var frameTable = new FrameListControl(29);
- frameTable.Height = HdlControlResourse.ListViewRowHeight + frameTable.rowSpace;
+ frameTable.Height = ControlCommonResourse.ListViewRowHeight + frameTable.rowSpace;
listView.AddChidren(frameTable);
rowInfo.frameTable = frameTable;
@@ -252,8 +252,8 @@
rowMenu.AddTag("btnNew", btnNew);
//妫�娴嬭澶囨槸鍚︽嫢鏈夊畾浣嶇殑鍔熻兘
- var listdevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceMac);
- if (listdevice.Count > 0 && HdlDeviceCommonLogic.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
+ var listdevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
+ if (listdevice.Count > 0 && Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
{
//瀹氫綅
var btnPosition = rowMenu.AddEditorControl(false);
@@ -261,7 +261,7 @@
btnPosition.ButtonClickEvent += (sender, e) =>
{
//瀹氫綅
- HdlDeviceCommonLogic.Current.SetFixedPositionCommand(listdevice[0], true);
+ Common.LocalDevice.Current.SetFixedPositionCommand(listdevice[0], true);
};
}
@@ -269,7 +269,7 @@
btnRight.ButtonClickEvent += (sender, e) =>
{
//鍥炶矾鏁板ぇ浜�1鎵嶅睍寮�
- var listMacDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceMac, false);
+ var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
if (listMacDevice.Count > 1)
{
btnRight.IsSelected = !btnRight.IsSelected;
@@ -278,7 +278,7 @@
}
else
{
- if (HdlDeviceCommonLogic.Current.IsMiniLight(listMacDevice[0]) == true)
+ if (LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
{
//mini澶滅伅鐨勫姛鑳借缃晫闈�
var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
@@ -302,14 +302,14 @@
//闅愯棌鑿滃崟
rowMenu.HideMenu();
//寮哄埗璺宠浆鐪熷疄璁惧鐣岄潰
- if (HdlUserCenterResourse.HideOption.GotoRealDeviceForm == 1)
+ if (UserCenterResourse.HideOption.GotoRealDeviceForm == 1)
{
var form2 = new DeviceAddSuccessForm();
form2.AddForm(deviceMac);
return;
}
- var listMacDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceMac, false);
- if (listMacDevice.Count > 0 && HdlDeviceCommonLogic.Current.IsMiniLight(listMacDevice[0]) == true)
+ var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
+ if (listMacDevice.Count > 0 && LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
{
//mini澶滅伅鐨勫姛鑳借缃晫闈�
var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
@@ -354,18 +354,18 @@
//瀹冨師鏉ョ殑楂樺害
int oldHeight = rowInfo.frameTable.Height;
//鍙樻洿鐨勯珮搴�,榛樿涓哄垪琛ㄩ殣钘�
- int heightValue = HdlControlResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace;
- var listDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceMac);
+ int heightValue = ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace;
+ var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
if (isShow == true)
{
//澶囨敞锛氶潰鏉夸腑鍙樉绀虹湡瀹炵殑璁惧锛屽叾浠栧睘浜庣粦瀹氱殑鍥炶矾涓嶆樉绀�
//鑾峰彇杩欎竴鍫嗚澶囨椂灞炰簬浠�涔堢被鍨嬬殑
- var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(listDevice);
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
{
- var listTemp = HdlDeviceCommonLogic.Current.GetMutilfunctionPanelByMac(listDevice);
+ var listTemp = Common.LocalDevice.Current.GetMutilfunctionPanelByMac(listDevice);
//灞曞紑妯″紡鏃讹紝鎵╁ぇ渚濇嵁涓�:瀹冩湁鍑犱釜瀛愭帶浠�
- heightValue = (listTemp.Count + 1) * (HdlControlResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
+ heightValue = (listTemp.Count + 1) * (ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
//鏍囬鑷繁灏辨槸涓�涓瓙鎺т欢
if (rowInfo.frameTable.ChildrenCount == 1)
{
@@ -380,9 +380,9 @@
|| deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment
|| deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment)
{
- var listTemp = HdlDeviceCommonLogic.Current.GetPanelMatchEpointByMac(listDevice);
+ var listTemp = Common.LocalDevice.Current.GetPanelMatchEpointByMac(listDevice);
//灞曞紑妯″紡鏃讹紝鎵╁ぇ渚濇嵁涓�:瀹冩湁鍑犱釜瀛愭帶浠�
- heightValue = (listTemp.Count + 1) * (HdlControlResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
+ heightValue = (listTemp.Count + 1) * (ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
//鏍囬鑷繁灏辨槸涓�涓瓙鎺т欢
if (rowInfo.frameTable.ChildrenCount == 1)
{
@@ -396,7 +396,7 @@
else
{
//灞曞紑妯″紡鏃讹紝鎵╁ぇ渚濇嵁涓�:瀹冩湁鍑犱釜瀛愭帶浠�
- heightValue = (listDevice.Count + 1) * (HdlControlResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
+ heightValue = (listDevice.Count + 1) * (ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
//鏍囬鑷繁灏辨槸涓�涓瓙鎺т欢
if (rowInfo.frameTable.ChildrenCount == 1)
{
@@ -428,9 +428,9 @@
//琛屾帶浠�
var rowDevice = new DeviceRoomControl(device, frame.rowSpace / 2);
- rowDevice.MainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
+ rowDevice.MainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
frame.AddChidren(rowDevice);
- rowDevice.frameTable.LeftOffset = Application.GetRealWidth(173) - HdlControlResourse.XXLeft;
+ rowDevice.frameTable.LeftOffset = Application.GetRealWidth(173) - ControlCommonResourse.XXLeft;
rowDevice.InitControl();
//搴曠嚎
rowDevice.frameTable.AddBottomLine();
@@ -439,11 +439,11 @@
//鍦ㄧ嚎鐘舵��
rowDevice.IsOnline = rowInfo.MenuRow.IsOnline;
//淇濆瓨鎺т欢
- string maikey = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
+ string maikey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
rowInfo.dicDetailRow[maikey] = rowDevice;
//妫�娴嬭澶囨槸鍚︽嫢鏈夊畾浣嶇殑鍔熻兘
- if (HdlDeviceCommonLogic.Current.DeviceIsCanFixedPosition(device) == true)
+ if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(device) == true)
{
//瀹氫綅
var btnPosition = rowDevice.AddEditorControl(false);
@@ -451,7 +451,7 @@
btnPosition.ButtonClickEvent += (sender, e) =>
{
//瀹氫綅
- HdlDeviceCommonLogic.Current.SetFixedPositionCommand(device);
+ Common.LocalDevice.Current.SetFixedPositionCommand(device);
};
}
@@ -489,6 +489,16 @@
{
//鏅鸿兘闂ㄩ攣
if (deviceEnumInfo.BeloneType == DeviceBeloneType.A鏅鸿兘闂ㄩ攣)
+ {
+ var form = new DeviceMacInfoEditorForm();
+ form.AddForm(device.DeviceAddr);
+ }
+ else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A鏅捐。鏋�)
+ {
+ var form = new DeviceMacInfoEditorForm();
+ form.AddForm(device.DeviceAddr);
+ }
+ else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A绌烘皵璐ㄩ噺)
{
var form = new DeviceMacInfoEditorForm();
form.AddForm(device.DeviceAddr);
@@ -709,7 +719,7 @@
return;
}
//濡傛灉鏄湪绾跨殑
- var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(HdlGatewayResourse.NowSelectGatewayId);
+ var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.NowSelectGatewayId);
if (HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(nowGateway) == true)
{
//妫�娴嬪箍鎾埌鐨勮繖涓綉鍏虫槸鍚︽嫢鏈変綇瀹匢D
@@ -742,7 +752,7 @@
}
//鑾峰彇鍏ㄩ儴璁惧
- int result = HdlDeviceCommonLogic.Current.SetDeviceToMemmoryByGateway(nowGateway.GwId, false);
+ int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway.GwId, false);
if (this.Parent == null)
{
return;
@@ -768,7 +778,7 @@
/// </summary>
private void StartGatewayOnlieCheckThread()
{
- string selectGwId = HdlGatewayResourse.NowSelectGatewayId;
+ string selectGwId = GatewayResourse.NowSelectGatewayId;
HdlThreadLogic.Current.RunThread(() =>
{
ZbGateway zbGateway = HdlGatewayLogic.Current.GetLocalGateway(selectGwId);
@@ -848,12 +858,12 @@
/// </summary>
private void RefreshDeviceOnlineStatu()
{
- string gwId = HdlGatewayResourse.NowSelectGatewayId;
+ string gwId = GatewayResourse.NowSelectGatewayId;
HdlThreadLogic.Current.RunThread(() =>
{
if (this.Parent == null) { return; }
//鑾峰彇璁惧鍒楄〃
- var listDevice = HdlDeviceCommonLogic.Current.GetDeviceByGatewayID(gwId);
+ var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(gwId);
var listCheck = new List<string>();
foreach (var device in listDevice)
{
@@ -862,7 +872,7 @@
{
//鍙涓�涓洖璺嵆鍙�
listCheck.Add(device.DeviceAddr);
- var deviceInfo = HdlDeviceCommonLogic.Current.ReadDeviceEpointDeviceInfo(device);
+ var deviceInfo = Common.LocalDevice.Current.ReadDeviceEpointDeviceInfo(device);
if (deviceInfo != null)
{
//鍙樻洿鍦ㄧ嚎鐘舵��
@@ -895,15 +905,15 @@
return;
}
//鍒锋柊璁惧鐨勫湪绾跨姸鎬�
- string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
- var localDevice = HdlDeviceCommonLogic.Current.GetDevice(mainkeys);
+ string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+ var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
if (localDevice != null)
{
//淇濆瓨鐘舵��
localDevice.IsOnline = device.IsOnline;
}
- rowInfo.MenuRow.IsOnline = HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(device);
+ rowInfo.MenuRow.IsOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
if (rowInfo.dicDetailRow != null)
{
foreach (var detailRow in rowInfo.dicDetailRow.Values)
@@ -979,10 +989,10 @@
return;
}
//娣诲姞鍗囩骇鍥轰欢淇℃伅(鎴愪笉鎴愬姛閮芥棤鎵�璋�)
- var result = HdlFirmwareUpdateLogic.Current.AddFirmwareVersionInfo(FirmwareLevelType.A璁惧, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
+ var result = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.A璁惧, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
//鑾峰彇璁惧鏈�鏂扮増鏈�
- var deviceFirmware = HdlFirmwareUpdateLogic.Current.GetFirmwareMostVersionInfo(FirmwareLevelType.A璁惧,
+ var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.A璁惧,
ota.HwVersion.ToString(),
ota.ImgTypeId.ToString(),
ota.ImgVersion);
@@ -1009,7 +1019,7 @@
}
});
}
- });
+ }, ShowErrorMode.NO);
}
#endregion
@@ -1025,11 +1035,11 @@
//鏂板缓涓�涓璞�
if (this.dicRowInfo.ContainsKey(deviceAddr) == false)
{
- var localDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceAddr);
+ var localDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceAddr);
if (localDevice.Count == 0)
{
//閽堝鍗曠函鍙湁涓�涓�200绔偣鐨勮澶�
- var ota = HdlDeviceCommonLogic.Current.GetOTADevice(deviceAddr);
+ var ota = Common.LocalDevice.Current.GetOTADevice(deviceAddr);
if (ota == null)
{
//鍏ョ綉涔嬪悗锛屽張鎶婂畠鍒犱簡
@@ -1039,8 +1049,8 @@
}
var rowNewInfo = new DeviceObjRowInfo();
rowNewInfo.DeviceMac = deviceAddr;
- rowNewInfo.MacName = HdlDeviceCommonLogic.Current.GetDeviceMacName(localDevice[0]);
- rowNewInfo.DeviveTypeName = HdlDeviceCommonLogic.Current.GetDeviceObjectText(localDevice);
+ rowNewInfo.MacName = Common.LocalDevice.Current.GetDeviceMacName(localDevice[0]);
+ rowNewInfo.DeviveTypeName = Common.LocalDevice.Current.GetDeviceObjectText(localDevice);
this.dicRowInfo[deviceAddr] = rowNewInfo;
//鍒涘缓鏂扮殑琛�
@@ -1061,8 +1071,8 @@
{
var rowInfo = this.dicRowInfo[deviceAddr];
//妫�娴嬭繖涓澶囨槸鍚﹁鍒犻櫎 2020.01.13鍙樻洿:杩藉姞Ota璁惧鐨勫垽鏂�
- if (HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceAddr).Count == 0
- && HdlDeviceCommonLogic.Current.GetOTADevice(deviceAddr) == null)
+ if (LocalDevice.Current.GetDevicesByMac(deviceAddr).Count == 0
+ && LocalDevice.Current.GetOTADevice(deviceAddr) == null)
{
//绉婚櫎鎺т欢
rowInfo.dicDetailRow = null;
@@ -1105,8 +1115,8 @@
}
//鑾峰彇璁惧绫诲瀷鐨�
- var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
- if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment)
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleEnvironment)
{
foreach (var outClu in device.OutClusterList)
{
@@ -1128,8 +1138,8 @@
{
var info = new DeviceObjRowInfo();
info.DeviceMac = mac;
- info.MacName = HdlDeviceCommonLogic.Current.GetDeviceMacName(dic[mac][0]);
- info.DeviveTypeName = HdlDeviceCommonLogic.Current.GetDeviceObjectText(dic[mac]);
+ info.MacName = Common.LocalDevice.Current.GetDeviceMacName(dic[mac][0]);
+ info.DeviveTypeName = Common.LocalDevice.Current.GetDeviceObjectText(dic[mac]);
this.dicRowInfo[mac] = info;
}
}
@@ -1143,6 +1153,20 @@
/// </summary>
public override int FormActionAgainEvent()
{
+ if (GatewayResourse.AppOldSelectGatewayId != this.gatewayViewRow.zbGatewayId)
+ {
+ //杩欎釜缃戝叧琚暣鎺変簡,闇�瑕侀噸鏂板垵濮嬪寲鐣岄潰
+ this.nowActionDeviceMac = null;
+ this.oldShowRightMuneRow = null;
+ //閲嶆柊閫夋嫨缃戝叧
+ HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
+
+ //鍒濆鍖栫晫闈�
+ this.InitMiddleFrame();
+
+ return 1;
+ }
+
if (this.nowActionDeviceMac != null)
{
//鍒锋柊鎸囧畾璁惧琛岀殑淇℃伅
--
Gitblit v1.8.0