| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared.Common; |
| | | using Shared.Phone.UserView; |
| | | using ZigBee.Device; |
| | | |
| | | namespace Shared.Phone.UserCenter.DoorLock |
| | |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="doorLock"></param> |
| | | public FunctionSetting(ZigBee.Device.DoorLock doorLock) |
| | | public FunctionSetting(Room room, CommonDevice doorLock) |
| | | { |
| | | //闪退 |
| | | this.doorLock = doorLock; |
| | | this.doorLock = doorLock as ZigBee.Device.DoorLock; |
| | | currentRoom = room; |
| | | deviceUI = doorLock; |
| | | listNewDevice.Add(doorLock); |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; |
| | | } |
| | |
| | | |
| | | #region 变量申明 |
| | | public ZigBee.Device.DoorLock doorLock = null; |
| | | /// <summary> |
| | | /// 当前房间 |
| | | /// </summary> |
| | | Room currentRoom; |
| | | /// <summary> |
| | | /// 设备UI对象 |
| | | /// </summary> |
| | | CommonDevice deviceUI; |
| | | /// <summary> |
| | | /// 设备需要保存的设备名字 |
| | | /// </summary> |
| | |
| | | #endregion |
| | | |
| | | #region UI显示 |
| | | /// <summary>
|
| | | /// UI显示 |
| | | /// <summary> |
| | | /// UI显示 |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.XMBlack, |
| | | TextSize = 15, |
| | | Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock), |
| | | Text = HdlDeviceCommonLogic.Current.GetDeviceMacName(doorLock), |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnDeviceText); |
| | | |
| | |
| | | listview.RemoveAll(); |
| | | //设备备注 |
| | | string caption = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm); |
| | | string deviceName = Common.LocalDevice.Current.GetDeviceMacName(doorLock); |
| | | string deviceName = HdlDeviceCommonLogic.Current.GetDeviceMacName(doorLock); |
| | | var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2); |
| | | btnNote.txtInput.MaxByte = 48;//限制只能输入48个字节 |
| | | listview.AddChidren(btnNote); |
| | | btnNote.InitControl(); |
| | | //划线 |
| | | btnNote.AddBottomLine(); |
| | | btnNote.txtInput.FinishInputEvent += () => |
| | | { |
| | | string oldName = Common.LocalDevice.Current.GetDeviceMacName(doorLock); |
| | | string oldName = HdlDeviceCommonLogic.Current.GetDeviceMacName(doorLock); |
| | | if (btnNote.Text == string.Empty) |
| | | { |
| | | btnNote.Text = oldName; |
| | |
| | | var listCheck = new List<string>(); |
| | | rowBeloneArea.SelectRoomEvent += (roomKeys) => |
| | | { |
| | | //选择未分配时,清空 |
| | | if (roomKeys == string.Empty) { listCheck = new List<string>(); } |
| | | foreach (var device in this.listNewDevice) |
| | | { |
| | | if (roomKeys == string.Empty) |
| | | { |
| | | //如果选择的是未分配,则它的全部回路无条件全部清空房间 |
| | | HdlRoomLogic.Current.ChangedRoom(device, roomKeys); |
| | | continue; |
| | | } |
| | | var room = HdlRoomLogic.Current.GetRoomByDevice(device); |
| | | string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device); |
| | | string mainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device); |
| | | if (room == null) |
| | | { |
| | | //这里有点特殊,如果回路没有设置有区域的时候,才设置 |
| | |
| | | } |
| | | } |
| | | //保存设备房间索引 |
| | | Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys); |
| | | HdlRoomLogic.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys); |
| | | }; |
| | | |
| | | //设备模块 |
| | | caption = Language.StringByID(R.MyInternationalizationString.BelongModel); |
| | | deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice); |
| | | caption = Language.StringByID(R.MyInternationalizationString.BelongDevice); |
| | | deviceName = HdlDeviceCommonLogic.Current.GetDeviceObjectText(listNewDevice); |
| | | var btnType = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2); |
| | | btnType.UseClickStatu = false; |
| | | listview.AddChidren(btnType); |
| | |
| | | bottomFrameLayout.AddChidren(btnFinish); |
| | | btnFinish.ButtonClickEvent += (sender, e) => |
| | | { |
| | | string oldName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]); |
| | | string oldName = HdlDeviceCommonLogic.Current.GetDeviceMacName(listNewDevice[0]); |
| | | if (btnNote.Text.Trim() == string.Empty) |
| | | { |
| | | btnNote.Text = oldName; |
| | |
| | | /// </summary> |
| | | private void AddAllMenuRow() |
| | | { |
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1) |
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1) |
| | | { |
| | | //添加【临时密码】行 |
| | | this.AddTempPasswordRow(); |
| | |
| | | }; |
| | | actionNone = async () => |
| | | { |
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock, action); |
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock); |
| | | }; |
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone); |
| | | }; |
| | |
| | | |
| | | btnswitch.ButtonClickEvent += async (sender, e) => |
| | | { |
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1) |
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1) |
| | | { |
| | | if (btnswitch.IsSelected == true) |
| | | { |
| | |
| | | var doorLock = this.listNewDevice[0] as ZigBee.Device.DoorLock; |
| | | btnRow.ButtonClickEvent += async (sender, e) => |
| | | { |
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1) |
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1) |
| | | { |
| | | var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "DoorLockTime"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage); |
| | |
| | | /// 设备重命名 |
| | | /// </summary> |
| | | /// <param name="i_deviceName">deviceName.</param> |
| | | private async void DeviceReName(string i_deviceName, bool closeForm) |
| | | private void DeviceReName(string i_deviceName, bool closeForm) |
| | | { |
| | | //开启进度条 |
| | | this.ShowProgressBar(); |
| | | |
| | | //修改MAC名 |
| | | string deviceName = i_deviceName.Trim(); |
| | | var result = await Common.LocalDevice.Current.ReMacName(listNewDevice, deviceName); |
| | | var result = HdlDeviceCommonLogic.Current.ReMacName(listNewDevice, deviceName); |
| | | //关闭进度条 |
| | | this.CloseProgressBar(); |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 移除方法 |
| | | /// <summary> |
| | | /// 重写移除方法 |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | base.RemoveFromParent(); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | |