From e8d65cc090cee90ebe2d7087f95316d1fccdc74a Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期五, 26 八月 2022 16:44:01 +0800
Subject: [PATCH] 更新全视通dll
---
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 534 +++++++++++++++++++++--------------------------------------
1 files changed, 191 insertions(+), 343 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
index f7bd9c0..67009a0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -17,12 +17,24 @@
public UserDoorLockPage(Room room, CommonDevice doorLock)
{
//寰愭鐨勯棬閿佺晫闈㈡墦寮�(缃戝叧鍏ㄥ眬鎺ユ敹鏃朵娇鐢�)
- ControlCommonResourse.IsDoorLockPageOpen = true;
+ //ControlCommonResourse.IsDoorLockPageOpen = true;
this.doorLock = doorLock as ZigBee.Device.DoorLock;
currentRoom = room;
deviceUI = doorLock;
BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor;
ZbGateway.StatusList.Add(this);
+ Application.RunOnMainThread(() =>
+ {
+ UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction += (DoorlockKey, status) =>
+ {
+ var key = doorLock.DeviceAddr;
+ if (DoorlockKey == key)
+ {
+ DoorLockCommonInfo.NormallyOpenModeValue(this.doorLock, status);
+ UpdateNomallyOpenStatus();
+ }
+ };
+ });
}
#region 鍙橀噺鐢虫槑
@@ -39,15 +51,16 @@
/// </summary>
DateTime waitGetDoorLockPower = DateTime.MaxValue;
/// <summary>
- /// 閫昏緫涓槸鍚︽湁甯稿紑妯″紡
+ /// 閫昏緫涓槸鍚︽湁甯稿紑妯″紡
/// </summary>
- private bool HaveLogicNormallyOpenMode = false;
+ private bool haveLogicNormallyOpenMode = false;
+
/// <summary>
/// 褰撳墠鐢甸噺
/// </summary>
bool canVolume = false;
/// <summary>
- /// 淇濈暀涓婁竴娆¢煶閲�
+ /// 鏄惁鏀寔甯稿紑
/// </summary>
bool canOpenNormallyMode = false;
/// <summary>
@@ -77,7 +90,7 @@
/// <summary>
/// 涓儴甯冨眬涓棬閿佸悕绉版樉绀�
/// </summary>
- Button btnDoorLockTitle;
+ NormalViewControl btnDoorLockTitle;
/// <summary>
/// 鍒嗕韩
/// </summary>
@@ -90,6 +103,7 @@
/// 璁剧疆FrameLayout
/// </summary>
FrameLayout btnFuncSetFrameLayout;
+ FrameLayout progressFrameLayoutMatch;
/// <summary>
/// 鐐瑰嚮寮�甯冨眬
/// </summary>
@@ -180,11 +194,11 @@
bool IsClick = true;
#endregion
- /// <summary>
- /// UI鏄剧ず
+ /// <summary>
+ /// UI鏄剧ず
/// </summary>
public void Show()
- {
+ {
this.TopFrameLayout(this, "");
this.MidFrameLayout(this);
@@ -207,8 +221,8 @@
btnFuncSet = new Button
{
X = Application.GetRealWidth(103),
- Height = Application.GetMinReal(69),
- Width = Application.GetMinReal(69),
+ Height = Application.GetMinRealAverage(69),
+ Width = Application.GetMinRealAverage(69),
UnSelectedImagePath = "DoorLock/SettingIcon.png",
};
btnFuncSetFrameLayout.AddChidren(btnFuncSet);
@@ -217,7 +231,7 @@
ClickHandle();
- if (doorLock.IsOnline == 1)
+ if (Common.LocalDevice.Current.CheckDeviceIsOnline(doorLock) == true)
{
ReadDoorLockUserInfo();
}
@@ -241,22 +255,21 @@
Height = Application.GetRealHeight(1238),
Width = Application.GetRealWidth(965),
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
- Radius = 6,
+ Radius = (uint)Application.GetRealHeight(17),
};
this.midFrameLayout.AddChidren(midTopFrameLayout);
- //闂ㄩ攣鏍囬
- btnDoorLockTitle = new Button()
- {
- Width = Application.GetRealWidth(250),
- Height = Application.GetRealHeight(60),
- X = Application.GetRealWidth(372),
- Y = Application.GetRealHeight(46),
- TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
- TextSize = 15,
- TextAlignment = TextAlignment.Center,
- IsBold = true,
- };
+ //璁惧鍚嶇О
+ btnDoorLockTitle = new NormalViewControl(100, 60, true);
+ btnDoorLockTitle.Y = Application.GetRealHeight(46);
+ btnDoorLockTitle.TextSize = 15;
+ btnDoorLockTitle.IsBold = true;
+ btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
+ btnDoorLockTitle.Width = btnDoorLockTitle.GetRealWidthByText();
+ btnDoorLockTitle.Width = Application.GetRealWidth(500);
+
+ btnDoorLockTitle.TextAlignment = TextAlignment.Center;
+ btnDoorLockTitle.Gravity = Gravity.CenterHorizontal;
midTopFrameLayout.AddChidren(btnDoorLockTitle);
//璁板綍
@@ -269,8 +282,8 @@
midTopFrameLayout.AddChidren(btnRecordFrameLayout);
btnRecord = new Button()
{
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
+ Width = Application.GetMinRealAverage(69),
+ Height = Application.GetMinRealAverage(69),
X = Application.GetRealWidth(46),
Y = Application.GetRealHeight(46),
UnSelectedImagePath = "DoorLock/RecordIcon.png",
@@ -287,16 +300,16 @@
midTopFrameLayout.AddChidren(btnCollectFrameLayout);
btnCollect = new Button()
{
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
+ Width = Application.GetMinRealAverage(69),
+ Height = Application.GetMinRealAverage(69),
X = Application.GetRealWidth(15),
Y = Application.GetRealHeight(46),
UnSelectedImagePath = "Item/Collection.png",
SelectedImagePath = "Item/CollectionSelected.png"
};
- btnCollectFrameLayout.AddChidren(btnCollect);
-
- //褰撳墠鐘舵��
+ btnCollectFrameLayout.AddChidren(btnCollect);
+
+ //褰撳墠鐘舵��
btnStatus = new Button()
{
Width = Application.GetRealWidth(132 + 351),
@@ -321,16 +334,16 @@
TextSize = 10,
TextAlignment = TextAlignment.CenterLeft,
};
- midTopFrameLayout.AddChidren(btnCurrentPowerText);
-#if Android
- btnCurrentPowerText.X = btnStatus.Right + Application.GetRealWidth(20);
+ midTopFrameLayout.AddChidren(btnCurrentPowerText);
+#if Android
+ btnCurrentPowerText.X = btnStatus.Right + Application.GetRealWidth(20);
#endif
//闂ㄩ攣寮�/鍏冲浘鐗�
btnDoorLockPic = new Button()
{
- Width = Application.GetMinReal(383),
- Height = Application.GetMinReal(343),
+ Width = Application.GetMinRealAverage(383),
+ Height = Application.GetMinRealAverage(343),
X = Application.GetRealWidth(161),
Y = Application.GetRealHeight(415),
UnSelectedImagePath = "DoorLock/DoorLockPicClose.png",
@@ -366,30 +379,39 @@
};
btnFrameLayout.AddChidren(closeFrameLayout);
+ progressFrameLayoutMatch = new FrameLayout()
+ {
+ Width = Application.GetRealHeight(84),//639-35
+ Height = Application.GetRealHeight(446 + 30),
+ X = Application.GetMinReal(51),
+ BackgroundColor = ZigbeeColor.Current.XMWhite,
+ };
+ btnFrameLayout.AddChidren(progressFrameLayoutMatch);
+
var progressFrameLayout = new FrameLayout()
{
- Width = Application.GetRealWidth(9),//639-35
- Height = Application.GetRealHeight(446),
- X = Application.GetRealWidth(95),
- Y = Application.GetRealHeight(0),
+ Width = Application.GetRealHeight(15),//639-35
+ Height = Application.GetRealHeight(440),
+ Radius = (uint)Application.GetRealHeight(17),
+ Gravity = Gravity.CenterHorizontal,
BackgroundColor = ZigbeeColor.Current.XMVerticalSeekBar,
};
- btnFrameLayout.AddChidren(progressFrameLayout);
+ progressFrameLayoutMatch.AddChidren(progressFrameLayout);
progressButton = new Button()
{
- Width = Application.GetMinReal(84),//639-35
- Height = Application.GetMinReal(93),
- X = Application.GetRealWidth(58),
+ Width = Application.GetMinRealAverage(84),//639-35
+ Height = Application.GetMinRealAverage(93),
+ Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(347),
UnSelectedImagePath = "DoorLock/UnLockButton.png",
};
- btnFrameLayout.AddChidren(progressButton);
+ progressFrameLayoutMatch.AddChidren(progressButton);
btnDoorOpenPic = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(164),
Y = Application.GetRealHeight(6),
UnSelectedImagePath = "DoorLock/DoorLockOpen.png",
@@ -398,8 +420,8 @@
btnDoorClosePic = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(164),
Y = Application.GetRealHeight(117),
UnSelectedImagePath = "DoorLock/DoorLockClose.png",
@@ -410,8 +432,8 @@
//鐢甸噺
btnPower = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(253),
Y = Application.GetRealHeight(994),
UnSelectedImagePath = "DoorLock/PowerOffline.png",
@@ -429,8 +451,8 @@
midTopFrameLayout.AddChidren(btnVolumeFrameLayout);
btnVolume = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(40),
Y = Application.GetRealHeight(40),
UnSelectedImagePath = "DoorLock/VolumeIcon.png",
@@ -441,16 +463,16 @@
//甯稿紑
btnNormallyOpenFrameLayout = new FrameLayout()
{
- Width = Application.GetRealWidth(81 + 80),
- Height = Application.GetRealHeight(81 + 80),
+ Width = Application.GetMinRealAverage(81 + 80),
+ Height = Application.GetMinRealAverage(81 + 80),
X = Application.GetRealWidth(631 - 40),
Y = Application.GetRealHeight(994 - 40),
};
midTopFrameLayout.AddChidren(btnNormallyOpenFrameLayout);
btnNormallyOpen = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(40),
Y = Application.GetRealHeight(40),
UnSelectedImagePath = "DoorLock/NormallyOpen.png",
@@ -474,7 +496,7 @@
Height = Application.GetRealHeight(138),
Y = Application.GetRealHeight(1100),
BackgroundColor = ZigbeeColor.Current.XMBlack,
- Radius = 6,
+ Radius = (uint)Application.GetRealHeight(17),
};
midTopFrameLayout.AddChidren(btnCurrentFrameLayout);
#endregion
@@ -482,8 +504,8 @@
#region 褰撳墠鎴块棿
var btnCurrentRoomPic = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(58),
Y = Application.GetRealHeight(29),
UnSelectedImagePath = "DoorLock/RoomPic.png",
@@ -494,7 +516,7 @@
{
Width = Application.GetRealWidth(172),
Height = Application.GetRealHeight(49),
- X = Application.GetRealWidth(150),
+ X = btnCurrentRoomPic.Right + Application.GetRealWidth(12),
Y = Application.GetRealHeight(46),
Text = currentRoom.Name,
TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
@@ -502,7 +524,7 @@
TextAlignment = TextAlignment.CenterLeft,
};
btnCurrentFrameLayout.AddChidren(btnCurrentRoomName);
- #endregion
+ #endregion
}
#region 闊抽噺寮圭獥
@@ -528,8 +550,8 @@
var progressBackground = new FrameLayout()
{
- Width = Application.GetRealWidth(271),
- Height = Application.GetRealHeight(700),
+ Width = Application.GetMinRealAverage(271),
+ Height = Application.GetMinRealAverage(700),
X = Application.GetRealWidth(403),
Y = Application.GetRealHeight(582),
BackgroundImagePath = "DoorLock/ProgressBackground.png",
@@ -548,8 +570,8 @@
diyImageVerticalSeekBar = new DiyImageVerticalSeekBar()
{
- Width = Application.GetRealWidth(271),
- Height = Application.GetRealHeight(447 + 63),
+ Width = Application.GetMinRealAverage(271),
+ Height = Application.GetMinRealAverage(447 + 63),
Y = Application.GetRealHeight(155),
IsProgressTextShow = false,//鏄剧ず鐧惧垎姣�
ProgressBarColor = ZigbeeColor.Current.XMProgressBarColor,//閫変腑杩涘害鏉¢鑹�
@@ -593,19 +615,22 @@
if (tempDoor.doorLockOperatingEventNotificationCommand != null)
{
//闈炰富浜轰笉寮硅繖涓獥鍙�
- if (UserCenterResourse.UserInfo.AuthorityNo != 1)
- {
- return;
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ return;
}
- string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
- if (doorLock.IsDoorLockNormallyMode.ContainsKey(key))
- {
- if (doorLock.IsDoorLockNormallyMode[key] == true)
- {
- if (canOpenNormallyMode)
+ if (doorLock.IsDoorLockNormallyMode)
+ {
+ if (canOpenNormallyMode)
+ {
+ Application.RunOnMainThread(() =>
{
- Application.RunOnMainThread(() => { NomallyOpenModeInvalidDialog(true); });
- }
+ Action<bool> action = (obj) =>
+ {
+ UpdateNomallyOpenStatus();
+ };
+ DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.ServicePush, haveLogicNormallyOpenMode, action);
+ });
}
}
}
@@ -654,7 +679,7 @@
canOpenNormallyMode = DoorLockCommonInfo.CanNormallyOpen(doorLock);
if (canOpenNormallyMode)
{
- //鑾峰彇闂ㄩ攣甯稿紑妯″紡
+ //1銆佽幏鍙栭棬閿佸父寮�妯″紡
var resultRes = await DoorLockCommonInfo.GetNormallyOpenMode(doorLock);
if (resultRes == null)
{
@@ -677,12 +702,19 @@
{
tempRes = false;
}
+ DoorLockCommonInfo.NormallyOpenModeValue(doorLock, tempRes);
- NormallyOpenModeValue(tempRes);
- HaveLogicNormallyOpenMode = await Shared.Phone.Device.Logic.SkipView.Exist();
- Application.RunOnMainThread(() =>
+ Application.RunOnMainThread(async () =>
{
- UpdateNomallyOpenStatus();
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(2, doorLock);
+ if (resTemp == 0)
+ {
+ haveLogicNormallyOpenMode = false;
+ }
+ else
+ {
+ haveLogicNormallyOpenMode = true;
+ }
});
}
}
@@ -698,14 +730,14 @@
canVolume = DoorLockCommonInfo.CanVolume(doorLock);
if (canVolume)
{
- //璇诲彇闊抽噺
+ //2銆佽鍙栭煶閲�
var resultRes = await doorLock.GetVolumeAsync();
if (resultRes == null || resultRes.volumeResponseData == null)
{
var listDevice = new List<CommonDevice> { };
listDevice.Add(doorLock);
var devTemp = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
- if (devTemp.ConcreteType == DeviceConcreteType.IntelligentLocks_Sone)
+ if (devTemp.ConcreteType != DeviceConcreteType.IntelligentLocks_H06C)
{
Application.RunOnMainThread(() =>
{
@@ -732,7 +764,7 @@
});
}
- //璇诲彇闂ㄩ攣鐢甸噺锛氱皣ID锛�1 灞炴�D 33
+ //3銆佽鍙栭棬閿佺數閲忥細绨嘔D锛�1 灞炴�D 33
doorLock.ReadAttri(Cluster_ID.Power, AttriButeId.DoorLockPower);
//涓婃姤鐢甸噺绛�1绉�
System.Threading.Thread.Sleep(1000);
@@ -745,6 +777,7 @@
{
Application.RunOnMainThread(() =>
{
+ UpdateNomallyOpenStatus();
CommonPage.Loading.Hide();
});
}
@@ -773,13 +806,11 @@
//璁剧疆
EventHandler<MouseEventArgs> btnFuncSetHander = (sender, e) =>
{
- //鎵撳紑鍏朵粬鐣岄潰鏃跺墠绉婚櫎
- RemoveFromParent();
var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(currentRoom, doorLock);
Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
functionSetting.Show();
-
+ //DoorLockCommonInfo.canShowDialog = false;
functionSetting.devicNameAction += (deviceRename) =>
{
if (!string.IsNullOrEmpty(deviceRename))
@@ -810,6 +841,7 @@
//鍘嗗彶璁板綍 ---- stan
var form = new DeviceDoorLock.DoorLockHistoryLogForm();
form.AddForm(this.doorLock.DeviceAddr);
+ //DoorLockCommonInfo.canShowDialog = false;
};
btnRecordFrameLayout.MouseDownEventHandler += handerRecord;
btnRecord.MouseDownEventHandler += handerRecord;
@@ -833,26 +865,24 @@
//寮�閿佷簨浠�
EventHandler<MouseEventArgs> hander1 = async (sender, e) =>
{
-
- string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
- if (doorLock.IsDoorLockNormallyMode.ContainsKey(key))
+ if (doorLock.IsDoorLockNormallyMode)
{
- if (doorLock.IsDoorLockNormallyMode[key] == true)
+ if (canOpenNormallyMode)
{
- if (canOpenNormallyMode)
- {
- NomallyOpenModeInvalidDialog(false);
- }
- else
+ Application.RunOnMainThread(() =>
{
- OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus);
- }
+ Action<bool> action = (obj) =>
+ {
+ UpdateNomallyOpenStatus();
+ };
+ DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action);
+ });
}
else
{
OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus);
}
- }
+ }
else
{
OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus);
@@ -860,19 +890,26 @@
};
openFrameLayout.MouseUpEventHandler += hander1;
btnDoorOpenPic.MouseUpEventHandler += hander1;
+ if (progressButton.Y == Application.GetRealHeight(10))
+ {
+ progressFrameLayoutMatch.MouseUpEventHandler += hander1;
+ }
//鍏抽攣浜嬩欢
EventHandler<MouseEventArgs> hander2 = (sender, e) =>
{
if (canOpenNormallyMode)
{
- var key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
- if (doorLock.IsDoorLockNormallyMode.ContainsKey(key))
+ if (doorLock.IsDoorLockNormallyMode)
{
- if (doorLock.IsDoorLockNormallyMode[key] == true)
+ Application.RunOnMainThread(() =>
{
- NomallyOpenModeInvalidDialog();
- }
+ Action<bool> action = (obj) =>
+ {
+ UpdateNomallyOpenStatus();
+ };
+ DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action);
+ });
}
}
else
@@ -1015,256 +1052,68 @@
}
#endregion
- #region 甯稿紑妯″紡
- /// <summary>
- /// 闂ㄩ攣甯稿紑妯″紡鍊�
- /// </summary>
- public void NormallyOpenModeValue(bool value)
- {
- string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
- if (doorLock.IsDoorLockNormallyMode.ContainsKey(key))
- {
- doorLock.IsDoorLockNormallyMode[key] = value;
- }
- else
- {
- doorLock.IsDoorLockNormallyMode.Add(key, value);
- }
- }
-
+ #region 甯稿紑妯″紡
/// <summary>
/// 甯稿紑妯″紡澶勭悊
/// </summary>
private async void NomallyOpenDialog()
- {
- if (!btnNormallyOpen.IsSelected)
- {
- if (UserCenterResourse.UserInfo.AuthorityNo != 1)
- {
- this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.OnlyMasterOperate));
- return;
- }
-
- if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
- {
- SystemSecondAuthentication();
- return;
- }
-
- action = () =>
- {
- string msg = Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n");
- var confirm = Language.StringByID(R.MyInternationalizationString.Confrim);
- var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.Confirm, msg, confirm);
- alert.Show();
-
- alert.ConfirmClickEvent += async () =>
- {
- Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
- var result = await doorLock.SetNormallyOpenModeFuncAsync(true);
- if (result == null || result.defaultControlResponseData == null)
- {
- string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
- this.ShowTipMsg(msg0);
- return;
- }
- if (result.defaultControlResponseData.status != 0)
- {
- string msg1 = Language.StringByID(R.MyInternationalizationString.OpenNormallyOpenModeFailed);
- this.ShowTipMsg(msg1);
- return;
- }
- else
- {
- //娣诲姞App寮�鍚父寮�妯″紡鐨勫巻鍙茶褰�
- HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9001, string.Empty);
-
- //姣忔閲嶆柊璁剧疆甯稿紑锛岄粯璁ゆ椂闂撮兘鏄�12灏忔椂
- DoorLockCommonInfo.NormallyOpenModeInvalidTime = 12;
- NormallyOpenModeValue(true);
- UpdateNomallyOpenStatus();
- CommonPage.Loading.Hide();
-
- //甯稿紑妯″紡寮�鍚彁绀�
- string msgNomallyModeIsTurnOn = Language.StringByID(R.MyInternationalizationString.NomallyModeIsTurnOn);
- var doorLockInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockInValidSetting);
- var alertNomallyModeIsTurnOn = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.DoorLockLogic, msgNomallyModeIsTurnOn, doorLockInValidSetting);
- alertNomallyModeIsTurnOn.Show();
- alertNomallyModeIsTurnOn.MsgControlClickEvent += async () =>
- {
- //榛樿鍒涘缓鐗规畩閫昏緫
- DoorLockCommonInfo.NormallyOpenModeInvalidTime = 12;
- Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
- };
-
- //鐐瑰嚮鑷姩鍖�
- alertNomallyModeIsTurnOn.LogicClickEvent += () =>
- {
- //閫昏緫璋冪敤鍓嶈寰楃Щ闄�
- ZbGateway.StatusList.Remove(this);
- //璋冪敤閫昏緫鐣岄潰
- Shared.Phone.Device.Logic.SkipView.SkipAddLogic(2, doorLock);
- };
- alertNomallyModeIsTurnOn.InvalidClickEvent += async () =>
- {
- NomallyOpenModeInvalidTimeDialog();
- };
- }
- };
- };
- HdlCheckLogic.Current.CheckSecondarySecurity(action);
- }
- else
- {
- NomallyOpenModeInvalidDialog();
- }
- }
-
- /// <summary>
- /// 甯稿紑妯″紡澶辨晥澶勭悊
- /// </summary>
- public void NomallyOpenModeInvalidDialog(bool IsFromReport = false)
{
if (UserCenterResourse.UserInfo.AuthorityNo != 1)
{
this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.OnlyMasterOperate));
return;
}
- string msg = Language.StringByID(R.MyInternationalizationString.NomallyModeIsCanceled).Replace("{0}", "\r\n");
- var confirm = Language.StringByID(R.MyInternationalizationString.SureCancel);
- var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.NomallyOpenMode, msg, confirm);
- if (HaveLogicNormallyOpenMode)
+
+ if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
{
- //鏈夐�昏緫璁剧疆鐨勫脊绐�
- alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.CancelNomallyOpenModeWithLogic, msg, confirm);
+ SystemSecondAuthentication();
+ return;
}
- alert.Show();
- alert.MsgControlClickEvent += async () =>
+ action = () =>
{
- if (IsFromReport)
+ //WJC鐨勪唬鐮侊細绯荤粺瀵嗙爜鏀寔鎿嶄綔闂ㄩ攣鍚庯紝璋冪敤娓╁眳鍩庣殑鐣岄潰銆愬父寮�鑷姩鍖栥��
+ if (doorLock == null)
{
- //涓婃姤鈥滃父寮�妯″紡鈥濆凡琚彇娑堬紝app榛樿浜嗏�滃父寮�妯″紡鈥濊鍙栨秷
- NormallyOpenModeValue(false);
- UpdateNomallyOpenStatus();
- }
- else
- {
- //app榛樿鈥滃父寮�妯″紡鈥濊繕鏄紑鍚�
- NormallyOpenModeValue(true);
- UpdateNomallyOpenStatus();
- }
- };
- alert.CancelClickEvent += async () =>
- {
- if (IsFromReport)
- {
- //涓婃姤鈥滃父寮�妯″紡鈥濆凡琚彇娑堬紝app閲嶆柊寮�鍚�滃父寮�妯″紡鈥�
- Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
- var result = await doorLock.SetNormallyOpenModeFuncAsync(true);
- if (result == null || result.defaultControlResponseData == null)
- {
- string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
- this.ShowTipMsg(msg0);
- NormallyOpenModeValue(false);
- UpdateNomallyOpenStatus();
- return;
- }
- if (result.defaultControlResponseData.status != 0)
- {
- string msg1 = Language.StringByID(R.MyInternationalizationString.OpenNormallyOpenModeFailed);
- this.ShowTipMsg(msg1);
- NormallyOpenModeValue(false);
- UpdateNomallyOpenStatus();
- return;
- }
- else
- {
- //淇濇寔鈥滃父寮�鎴愬姛鈥�
- NormallyOpenModeValue(true);
- UpdateNomallyOpenStatus();
- CommonPage.Loading.Hide();
- }
- }
- else
- {
- //app鎿嶄綔涓嶅彇娑堚�滃父寮�妯″紡鈥�
- NormallyOpenModeValue(true);
- UpdateNomallyOpenStatus();
- }
- };
- alert.ConfirmClickEvent += async () =>
- {
- if (IsFromReport)
- {
- //涓婃姤闂ㄩ攣鈥滃父寮�妯″紡鈥濆凡缁忓彇娑堬紝鐜板湪app纭鈥滃父寮�妯″紡鈥濆彇娑�
- NormallyOpenModeValue(false);
- UpdateNomallyOpenStatus();
- }
- else
- {
- //app鎿嶄綔鍙栨秷鈥滃父寮�妯″紡鈥�
- Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
- var result = await doorLock.SetNormallyOpenModeFuncAsync(false);
- if (result == null || result.defaultControlResponseData == null)
- {
- string msg0 = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
- this.ShowTipMsg(msg0);
- return;
- }
- if (result.defaultControlResponseData.status != 0)
- {
- string msg1 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeFailed);
- this.ShowTipMsg(msg1);
- return;
- }
- else
- {
- //娣诲姞App寮�鍚父寮�妯″紡鐨勫巻鍙茶褰�
- HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9002, string.Empty);
- //app纭鍙栨秷鈥滃父寮�妯″紡鈥濇垚鍔�
- NormallyOpenModeValue(false);
- UpdateNomallyOpenStatus();
- string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess);
- this.ShowTipMsg(msg2);
- Shared.Phone.Device.Logic.SkipView.LockCloseLogic(doorLock);
- }
- }
- };
- }
-
- /// <summary>
- /// 甯稿紑妯″紡澶辨晥鏃堕棿澶勭悊
- /// </summary>
- private void NomallyOpenModeInvalidTimeDialog()
- {
- //澶辨晥璁剧疆
- string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime);
- var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim);
- var alertTimeInValidSetting = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim);
- alertTimeInValidSetting.Show();
-
- alertTimeInValidSetting.InvalidTimeAction += (obj) =>
- {
- Regex rg = new Regex("^[0-9]+$");
- if (!rg.IsMatch(obj))
- {
- //蹇呴』鏄暟瀛�
- string msg0 = Language.StringByID(R.MyInternationalizationString.NormallyOpenModeInvalidTimeTip);
- this.ShowTipMsg(msg0);
-
- string msgTimeInValidSetting2 = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime);
- var timeConfrim2 = Language.StringByID(R.MyInternationalizationString.Confrim);
- var alertTimeInValidSetting2 = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting2, timeConfrim2);
- alertTimeInValidSetting2.Show();
+ ///闃叉鎶涘紓甯�
return;
}
- //甯稿紑妯″紡澶辨晥鏃堕棿璁剧疆鎴愬姛
- var temp = int.Parse(obj);
- DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp;
- Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
+ ///澶囨敞锛歐JC鐨�
+ Shared.Phone.Device.Logic.Send.CurrentDoorLock = doorLock;
+ ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱
+ Common.Logic.LogicDviceList.Clear();
+ if (Common.Logic.LogicDviceList.Count == 0)
+ {
+ Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
+ }
+ var addLogicPage = new Shared.Phone.Device.Logic.SoneLogicList();
+ UserView.HomePage.Instance.AddChidren(addLogicPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ addLogicPage.Show();
+ addLogicPage.action += async (w) =>
+ {
+ DoorLockCommonInfo.NormallyOpenModeValue(doorLock, w);
+ UpdateNomallyOpenStatus();
+ //杩斿洖鎸夐敭娓呯┖褰撳墠閫昏緫瀹氫箟鐨凩ogicAction
+ UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = null;
+ //鏄惁瀛樺湪甯稿紑妯″紡
+ var resTemp = Shared.Common.Logic.SoneLogicList;
+ if (resTemp.Count == 0)
+ {
+ haveLogicNormallyOpenMode = false;
+ }
+ else
+ {
+ haveLogicNormallyOpenMode = true;
+ }
+
+ UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction -= addLogicPage.updateCurrentDoorlockActionTemp;
+ };
};
+ HdlCheckLogic.Current.CheckSecondarySecurity(action);
+
}
+
/// <summary>
/// 甯稿紑妯″紡鐘舵�佹洿鏂�
/// </summary>
@@ -1275,8 +1124,7 @@
btnNormallyOpenFrameLayout.Width = Application.GetRealWidth(0);
return;
}
- string key = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
- if (doorLock.IsDoorLockNormallyMode[key] == true)
+ if (doorLock.IsDoorLockNormallyMode)
{
btnNormallyOpen.IsSelected = true;
btnDoorLockPic.IsSelected = true;
@@ -1284,7 +1132,7 @@
btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.DoorLockOpen);
}
- else if (doorLock.IsDoorLockNormallyMode[key] == false)
+ else if (!doorLock.IsDoorLockNormallyMode)
{
btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.CLose);
btnDoorLockPic.IsSelected = false;
@@ -1348,8 +1196,8 @@
{
if (!string.IsNullOrEmpty(deviceRename))
{
- btnDoorLockTitle.Text = deviceRename;
- //鏀规埧闂�
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
deviceUI.ReSave();
}
@@ -1366,13 +1214,13 @@
/// </summary>
public override void RemoveFromParent()
{
- //寰愭鐨勯棬閿佺晫闈㈠叧闂�(缃戝叧鍏ㄥ眬鎺ユ敹鏃朵娇鐢�)
- ControlCommonResourse.IsDoorLockPageOpen = false;
+ UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction = null;
if (IsDrawerLockMode)
{
CommonPage.Instance.IsDrawerLockMode = false;
}
ZbGateway.StatusList.Remove(this);
+ DoorLockCommonInfo.LogicAction = null;
base.RemoveFromParent();
}
#endregion
--
Gitblit v1.8.0