| | |
| | | public void ShowForm(string deviceMac)
|
| | | {
|
| | | this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
|
| | | //排序
|
| | | this.listNewDevice.Sort((obj1, obj2) =>
|
| | | {
|
| | | if (obj1.DeviceEpoint > obj2.DeviceEpoint)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | return -1;
|
| | | });
|
| | |
|
| | | this.listDeviceType.Clear();
|
| | | foreach (var device in listNewDevice)
|
| | |
| | | btnNote.txtInput.FinishInputEvent += () =>
|
| | | {
|
| | | string oldName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
|
| | | if (btnNote.Text.Trim() == string.Empty)
|
| | | if (btnNote.Text == string.Empty)
|
| | | {
|
| | | btnNote.Text = oldName;
|
| | | }
|
| | | if (oldName != btnNote.Text.Trim())
|
| | | if (oldName != btnNote.Text)
|
| | | {
|
| | | //修改名字
|
| | | this.DeviceReName(btnNote.Text.Trim(), false);
|
| | | this.DeviceReName(btnNote.Text, false);
|
| | | }
|
| | | };
|
| | |
|
| | |
| | | {
|
| | | foreach (var device in this.listNewDevice)
|
| | | {
|
| | | //保存这个设备属于哪个区域
|
| | | device.DeviceRoomId = roomKeys;
|
| | | device.ReSave();
|
| | | var room = Room.CurrentRoom.GetRoomByDevice(device);
|
| | | string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | if (room == null)
|
| | |
| | | Room.CurrentRoom.ChangedRoom(device, roomKeys);
|
| | | }
|
| | | }
|
| | | //保存设备房间索引
|
| | | Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys);
|
| | | };
|
| | |
|
| | | //添加全部菜单
|
| | |
| | | //添加【门锁时间】行
|
| | | this.AddDoorLocksTimeRow();
|
| | | }
|
| | | }
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.AirConditioner_ZbGateway)
|
| | | {
|
| | | //添加【室内机设置】行(空调专用)
|
| | | this.AddIndoorUnitSettionRow();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | //手拉控制
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uHandPullControl);
|
| | | var btnFunction = new FrameRowControl(listview.rowSpace / 2);
|
| | | btnFunction.UseClickStatu = false;
|
| | | listview.AddChidren(btnFunction);
|
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //开关图标
|
| | |
| | |
|
| | | #endregion;
|
| | |
|
| | | #region ■ 室内机设置(空调)___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加【室内机设置】行(空调专用)
|
| | | /// </summary>
|
| | | private void AddIndoorUnitSettionRow()
|
| | | {
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.AirConditioner_ZbGateway)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //室内机设置
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uIndoorUnitSettion);
|
| | | var btnFunction = new FrameRowControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(btnFunction);
|
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //向右图标
|
| | | btnFunction.AddRightArrow();
|
| | | //底线
|
| | | btnFunction.AddBottomLine();
|
| | | btnFunction.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceAirConditioner.IndoorUnitListForm();
|
| | | form.AddForm(listNewDevice[0].DeviceAddr);
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 通用信息___________________________
|
| | |
|
| | | /// <summary>
|