| | |
| | | /// </summary> |
| | | DateTime waitGetDoorLockPower = DateTime.MaxValue; |
| | | /// <summary> |
| | | /// 逻辑中是否有常开模式
|
| | | /// 逻辑中是否有常开模式 |
| | | /// </summary> |
| | | private bool haveLogicNormallyOpenMode = false;
|
| | | private bool haveLogicNormallyOpenMode = false; |
| | | |
| | | /// <summary> |
| | | /// 当前电量 |
| | |
| | | bool IsClick = true; |
| | | #endregion |
| | | |
| | | /// <summary>
|
| | | /// UI显示 |
| | | /// <summary> |
| | | /// UI显示 |
| | | /// </summary> |
| | | public void Show() |
| | | {
|
| | | { |
| | | this.TopFrameLayout(this, ""); |
| | | this.MidFrameLayout(this); |
| | | |
| | |
| | | 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); |
| | |
| | | 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.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); |
| | |
| | | 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", |
| | |
| | | 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), |
| | |
| | | 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", |
| | |
| | | progressFrameLayoutMatch = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealHeight(84),//639-35 |
| | | Height = Application.GetRealHeight(446), |
| | | Height = Application.GetRealHeight(446 + 30), |
| | | X = Application.GetMinReal(51), |
| | | BackgroundColor = ZigbeeColor.Current.XMWhite, |
| | | }; |
| | |
| | | |
| | | var progressFrameLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealHeight(17),//639-35 |
| | | Width = Application.GetRealHeight(15),//639-35 |
| | | Height = Application.GetRealHeight(440), |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = ZigbeeColor.Current.XMVerticalSeekBar, |
| | | }; |
| | |
| | | |
| | | progressButton = new Button() |
| | | { |
| | | Width = Application.GetMinReal(84),//639-35 |
| | | Height = Application.GetMinReal(93), |
| | | Width = Application.GetMinRealAverage(84),//639-35 |
| | | Height = Application.GetMinRealAverage(93), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(347), |
| | | UnSelectedImagePath = "DoorLock/UnLockButton.png", |
| | |
| | | |
| | | 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", |
| | |
| | | |
| | | 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", |
| | |
| | | //电量 |
| | | 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", |
| | |
| | | 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", |
| | |
| | | //常开 |
| | | 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", |
| | |
| | | Height = Application.GetRealHeight(138), |
| | | Y = Application.GetRealHeight(1100), |
| | | BackgroundColor = ZigbeeColor.Current.XMBlack, |
| | | Radius = 6, |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnCurrentFrameLayout); |
| | | #endregion |
| | |
| | | #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", |
| | |
| | | { |
| | | 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, |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnCurrentFrameLayout.AddChidren(btnCurrentRoomName); |
| | | #endregion |
| | | #endregion |
| | | } |
| | | |
| | | #region 音量弹窗 |
| | |
| | | |
| | | 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", |
| | |
| | | |
| | | 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,//选中进度条颜色 |
| | |
| | | if (tempDoor.doorLockOperatingEventNotificationCommand != null) |
| | | { |
| | | //非主人不弹这个窗口 |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1)
|
| | | {
|
| | | return;
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | return; |
| | | } |
| | | if (doorLock.IsDoorLockNormallyMode)
|
| | | {
|
| | | if (doorLock.IsDoorLockNormallyMode) |
| | | { |
| | | if (canOpenNormallyMode) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | |
| | | 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(() => |
| | | { |
| | |
| | | { |
| | | if (doorLock.IsDoorLockNormallyMode) |
| | | { |
| | | if (canOpenNormallyMode)
|
| | | {
|
| | | if (canOpenNormallyMode) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Action<bool> action = (obj) => |
| | |
| | | { |
| | | OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); |
| | | } |
| | | }
|
| | | } |
| | | else |
| | | { |
| | | OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); |
| | |
| | | action = () => |
| | | { |
| | | //WJC的代码:系统密码支持操作门锁后,调用温居城的界面【常开自动化】 |
| | | if (doorLock == null)
|
| | | {
|
| | | if (doorLock == null) |
| | | { |
| | | ///防止抛异常 |
| | | return;
|
| | | }
|
| | | ///备注:WJC的
|
| | | 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();
|
| | | return; |
| | | } |
| | | ///备注:WJC的 |
| | | 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(); |
| | | //返回按键清空当前逻辑定义的LogicAction |
| | | UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = null; |
| | | //是否存在常开模式 |
| | |
| | | }; |
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action); |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | } |
| | | |
| | | /// <summary> |
| | | /// 常开模式状态更新 |
| | | /// </summary> |
| | | private void UpdateNomallyOpenStatus() |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(deviceRename)) |
| | | { |
| | | btnDoorLockTitle.Text = deviceRename;
|
| | | //改房间
|
| | | btnDoorLockTitle.Text = deviceRename; |
| | | //改房间 |
| | | HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id); |
| | | deviceUI.ReSave(); |
| | | } |