| | |
| | | /// <summary>
|
| | | /// 列表控件
|
| | | /// </summary>
|
| | | private VerticalListControl listview = null;
|
| | | private FrameListControl listview = null;
|
| | | /// <summary>
|
| | | /// 设备的设备类型
|
| | | /// </summary>
|
| | |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | var listBackControl = new VerticalFrameControl();
|
| | | listBackControl.Height = bodyFrameLayout.Height;
|
| | | bodyFrameLayout.AddChidren(listBackControl);
|
| | |
|
| | | //初始化桌布
|
| | | var tableContr = new InformationEditorControl();
|
| | | this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
|
| | | this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1368);
|
| | |
|
| | | //图片
|
| | | var btnPic = new DeviceInfoIconControl();
|
| | | btnPic.Y = Application.GetRealHeight(92);
|
| | | btnPic.Gravity = Gravity.CenterHorizontal;
|
| | | bodyFrameLayout.AddChidren(btnPic);
|
| | | listBackControl.frameTable.AddChidren(btnPic);
|
| | | btnPic.InitControl(listNewDevice[0]);
|
| | |
|
| | | //设备备注
|
| | |
| | | //划线
|
| | | btnType.AddBottomLine();
|
| | |
|
| | | //所属区域
|
| | | //安装位置
|
| | | var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(rowBeloneArea);
|
| | | rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), this.listNewDevice);
|
| | | rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uInstallationLocation), this.listNewDevice);
|
| | | //底线
|
| | | rowBeloneArea.AddBottomLine();
|
| | |
|
| | | var listCheck = new List<string>();
|
| | | rowBeloneArea.SelectRoomEvent += (roomKeys) =>
|
| | | {
|
| | | //选择未分配时,清空
|
| | | if (roomKeys == string.Empty) { listCheck = new List<string>(); }
|
| | | foreach (var device in this.listNewDevice)
|
| | | {
|
| | | if (device is OTADevice)
|
| | | {
|
| | | //针对单纯只有一个200端点的设备
|
| | | continue;
|
| | | }
|
| | | if (roomKeys == string.Empty)
|
| | | {
|
| | | //如果选择的是未分配,则它的全部回路无条件全部清空房间
|
| | | HdlRoomLogic.Current.ChangedRoom(device, roomKeys);
|
| | | continue;
|
| | | }
|
| | | var room = HdlRoomLogic.Current.GetRoomByDevice(device);
|
| | |
| | | {
|
| | | //这里有点特殊,如果回路没有设置有区域的时候,才设置
|
| | | listCheck.Add(mainKeys);
|
| | | HdlRoomLogic.Current.ChangedRoom(device, roomKeys);
|
| | | }
|
| | | else if (this.deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir
|
| | | && device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | //新风面板的新风设备,则区域跟着模块一起
|
| | | HdlRoomLogic.Current.ChangedRoom(device, roomKeys);
|
| | | }
|
| | | else if (listCheck.Contains(mainKeys) == true)
|
| | |
| | | this.AddAllMenuRow();
|
| | |
|
| | | //初始化桌布完成
|
| | | tableContr.FinishInitControl(bodyFrameLayout, this.listview);
|
| | | tableContr.FinishInitControl();
|
| | | tableContr = null;
|
| | |
|
| | | //保存
|
| | |
| | | this.CloseForm();
|
| | | }
|
| | | };
|
| | | //如果当前住宅是虚拟住宅的话,让所有菜单都不能点击
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | for (int i = 0; i < listview.ChildrenCount; i++)
|
| | | {
|
| | | var myRow = listview.GetChildren(i) as FrameRowControl;
|
| | | if (myRow != null)
|
| | | {
|
| | | myRow.UseClickStatu = false;
|
| | | myRow.CanClick = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | //添加【按键设置】行(面板专用)
|
| | | this.AddPanelSettionRow();
|
| | | }
|
| | |
|
| | | if (this.IsFangyueFreshaAirPanel() == false)
|
| | | //方悦新风面板没有功能设置
|
| | | if (deviceEnumInfo.ConcreteType != DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | | //添加【功能设置】行
|
| | | this.AddFunctionSettionRow();
|
| | |
| | | };
|
| | | actionNone = () =>
|
| | | {
|
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock, action);
|
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock);
|
| | | };
|
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone);
|
| | | }
|
| | |
| | | };
|
| | | actionNone = () =>
|
| | | {
|
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock, action);
|
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock);
|
| | | };
|
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone);
|
| | |
|
| | |
| | | if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword) == false)
|
| | | {
|
| | | btnswitch.IsSelected = true;
|
| | | }
|
| | | //如果当前住宅是虚拟住宅的话,让所有菜单都不能点击
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | btnswitch.CanClick = false;
|
| | | }
|
| | |
|
| | | btnswitch.ButtonClickEvent += async (sender, e) =>
|
| | |
| | | form.AddForm(listNewDevice[0]);
|
| | | }
|
| | | };
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 按键设置(方悦)_____________________
|
| | |
|
| | | /// <summary>
|
| | | /// 是否是方悦新风面板
|
| | | /// </summary>
|
| | | private bool IsFangyueFreshaAirPanel()
|
| | | {
|
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | |
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //开关图标
|
| | | var btnSwitch = btnFunction.AddMostRightSwitchIcon();
|
| | | //如果当前住宅是虚拟住宅的话,让所有菜单都不能点击
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | btnSwitch.CanClick = false;
|
| | | }
|
| | | //底线
|
| | | btnFunction.AddBottomLine();
|
| | | btnSwitch.ButtonClickEvent += async (sender, e) =>
|
| | |
| | | var title = Language.StringByID(R.MyInternationalizationString.uSelectFunctionType);
|
| | |
|
| | | var form = new BottomItemSelectForm();
|
| | | form.CancelCallEvent = true;//允许取消
|
| | | form.AddForm(title, listText, nowSelectNo);
|
| | | form.FinishSelectEvent += (selectNo) =>
|
| | | {
|
| | | btnFunction.Text = listText[selectNo];
|
| | | if (selectNo == -1)
|
| | | {
|
| | | //选择取消
|
| | | btnFunction.Text = string.Empty;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnFunction.Text = listText[selectNo];
|
| | | }
|
| | | nowSelectNo = selectNo;
|
| | | //记录起当前选择的功能类型
|
| | | if (selectNo == 0)
|
| | |
| | | this.listNewDevice[0].IconPath = "Device/Light.png";
|
| | | }
|
| | | }
|
| | | else
|
| | | else if (selectNo == 2)
|
| | | {
|
| | | this.listNewDevice[0].DfunctionType = DeviceFunctionType.A插座;
|
| | | if (this.listNewDevice[0].IsCustomizeImage == false)
|
| | | {
|
| | | //重新设置图片
|
| | | this.listNewDevice[0].IconPath = "Device/Socket1.png";
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | this.listNewDevice[0].DfunctionType = DeviceFunctionType.A未定义;
|
| | | if (this.listNewDevice[0].IsCustomizeImage == false)
|
| | | {
|
| | | //重新设置图片
|
| | | this.listNewDevice[0].IconPath = "Device/Switch.png";
|
| | | }
|
| | | }
|
| | | this.listNewDevice[0].ReSave();
|
| | |
| | | btnNewVersion.Visible = false;
|
| | | };
|
| | |
|
| | | //设置设备的版本信息
|
| | | this.SetDeviceVersionInfo(btnNewVersion, oTADevice);
|
| | | //如果当前住宅不是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | //设置设备的版本信息
|
| | | this.SetDeviceVersionInfo(btnNewVersion, oTADevice);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="i_deviceName">deviceName.</param>
|
| | | private async void DeviceReName(string i_deviceName, bool closeForm)
|
| | | {
|
| | | //开启进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | //修改MAC名
|
| | | string deviceName = i_deviceName.Trim();
|
| | | var result = await Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | |
| | | {
|
| | | //检测此回路是否拥有定位功能(拿端点最小的那个回路去定位)
|
| | | bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]);
|
| | | if (this.deviceEnumInfo.BeloneType == DeviceBeloneType.A智能门锁)
|
| | | {
|
| | | canTest = false;
|
| | | }
|
| | | else if (this.deviceEnumInfo.BeloneType == DeviceBeloneType.A传感器
|
| | | && this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir)
|
| | | {
|
| | | //传感器除了Pir都没有定位功能
|
| | | canTest = false;
|
| | | }
|
| | | var frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1);
|
| | |
|
| | | var frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1);
|
| | | string deviceMenu = string.Empty;
|
| | | if (canTest == true)
|
| | | {
|
| | |
| | | deviceMenu = Language.StringByID(R.MyInternationalizationString.uDelete);
|
| | | frame.AddRowMenu(deviceMenu, "Item/DeleteIcon2.png", "Item/DeleteIcon2Selected.png", () =>
|
| | | {
|
| | | //如果当前住宅是虚拟住宅,此功能无效
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //确认删除该设备及功能?
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uDeleteDeviceMsg);
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|