| | |
| | | }; |
| | | flMain.AddChidren(progressBackground); |
| | | |
| | | var progressValue = (currentVolume * (Convert.ToInt32(((float)100 / 15) * 100))) / 100; |
| | | //var progressValue = (currentVolume * (Convert.ToInt32(((float)100 / 15) * 100))) / 100; |
| | | progressText = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Y = Application.GetRealHeight(89), |
| | | TextColor = ZigbeeColor.Current.XMGray2, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = progressValue.ToString() + "%", |
| | | Text = currentVolume.ToString() + "%", |
| | | }; |
| | | |
| | | diyImageVerticalSeekBar = new DiyImageVerticalSeekBar() |
| | |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | ProgressTextSize = 12,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(17),//进度条的宽度 |
| | | Progress = progressValue, |
| | | Progress = currentVolume, |
| | | }; |
| | | progressBackground.AddChidren(progressText); |
| | | progressBackground.AddChidren(diyImageVerticalSeekBar); |
| | | diyImageVerticalSeekBar.OnProgressChangedEvent += (sender, e) => |
| | | { |
| | | int curVolume = -1; |
| | | if (e == 0) |
| | | { |
| | | curVolume = 0; |
| | | } |
| | | else if (e == 100) |
| | | { |
| | | curVolume = 14; |
| | | } |
| | | else |
| | | { |
| | | int comandValue = e; |
| | | int comandValueTemp = (comandValue * 100) / (Convert.ToInt32(((float)100 / 15) * 100)); |
| | | curVolume = comandValueTemp; |
| | | } |
| | | curVolume = e; |
| | | currentVolume = curVolume; |
| | | progressText.Text = e.ToString() + "%"; |
| | | }; |
| | |
| | | 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 () => |
| | |
| | | alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.CancelNomallyOpenModeWithLogic, msg, confirm); |
| | | } |
| | | alert.Show(); |
| | | |
| | | alert.MsgControlClickEvent += async () => |
| | | { |
| | | if (IsFromReport) |
| | | { |
| | | //取消常开 |
| | | //上报“常开模式”已被取消,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) |
| | |
| | | } |
| | | 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) |
| | |
| | | {
|
| | | //添加App开启常开模式的历史记录
|
| | | HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9002, string.Empty); |
| | | |
| | | //app确认取消“常开模式”成功 |
| | | NormallyOpenModeValue(false); |
| | | UpdateNomallyOpenStatus(); |
| | | string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess); |
| | |
| | | }; |
| | | } |
| | | |
| | | ///// <summary> |
| | | /// <summary> |
| | | /// 常开模式失效时间处理 |
| | | /// </summary> |
| | | private void NomallyOpenModeInvalidTimeDialog() |
| | |
| | | alertTimeInValidSetting2.Show(); |
| | | return; |
| | | } |
| | | //常开模式失效时间设置成功 |
| | | var temp = int.Parse(obj); |
| | | DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp; |
| | | Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); |