| | |
| | | {
|
| | | if (listDataRoom.Count > 0)
|
| | | {
|
| | | //初始化房间和设备列表
|
| | | //初始化房间和设备列表 |
| | | this.InitRoomAndDeviceRow(listDataRoom);
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | DeviceSimpleSelectControl oldSelectContr = null;
|
| | | var listDevice = this.dicShowDevice[roomId];
|
| | | //获取设备类型的
|
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
|
| | | //检查符合的设备
|
| | | List<CommonDevice> listSupportDevice = new List<CommonDevice> { };
|
| | | foreach (var dev in listDevice)
|
| | | {
|
| | | //新风面板的新风设备,则不显示
|
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (dev.Type == DeviceType.FreshAir)
|
| | | {
|
| | | listSupportDevice.Add(dev);
|
| | | }
|
| | | }
|
| | |
|
| | | DeviceSimpleSelectControl oldDeviceSimpleSelectControl = null;
|
| | | int curIndex = 0;
|
| | | for (int i = 0; i < listSupportDevice.Count; i++)
|
| | | {
|
| | | string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(listSupportDevice[i]);
|
| | | var contr = new DeviceSimpleSelectControl(listDevice[i], false, this.listView.rowSpace / 2);
|
| | | var contr = new DeviceSimpleSelectControl(listSupportDevice[i], false, this.listView.rowSpace / 2);
|
| | | listView.AddChidren(contr);
|
| | | contr.InitControl();
|
| | | if (i != listDevice.Count - 1)
|
| | | if (i != listSupportDevice.Count - 1)
|
| | | {
|
| | | //底线
|
| | | contr.AddBottomLine();
|
| | | }
|
| | |
|
| | | contr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | contr.IsSelected = !contr.IsSelected;
|
| | | //选择了别的设备
|
| | | if (contr.IsSelected == true)
|
| | | if (contr.IsSelected)
|
| | | {
|
| | | if (oldSelectContr != null)
|
| | | {
|
| | | oldSelectContr.IsSelected = false;
|
| | | }
|
| | | oldSelectContr = contr;
|
| | | this.bindTargetKey = mainKey;
|
| | | return;
|
| | | }
|
| | | //取消选择
|
| | | else
|
| | | {
|
| | | oldSelectContr = null;
|
| | | this.bindTargetKey = string.Empty;
|
| | | }
|
| | | contr.IsSelected = true;
|
| | | oldSelectContr = contr;
|
| | | this.bindTargetKey = mainKey;
|
| | | //contr.IsSelected = !contr.IsSelected;
|
| | | ////选择了别的设备
|
| | | //if (contr.IsSelected == true)
|
| | | //{
|
| | | // if (oldSelectContr != null)
|
| | | // {
|
| | | // oldSelectContr.IsSelected = false;
|
| | | // }
|
| | | // oldSelectContr = contr;
|
| | | // this.bindTargetKey = mainKey;
|
| | | //}
|
| | | ////取消选择
|
| | | //else
|
| | | //{
|
| | | // oldSelectContr = null;
|
| | | // this.bindTargetKey = string.Empty;
|
| | | //}
|
| | | };
|
| | | if (this.bindTargetKey == mainKey)
|
| | | {
|
| | |
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
|
| | | if (device != null)
|
| | | {
|
| | | canShow = true;
|
| | | //收集可以显示的设备
|
| | | this.dicShowDevice[room.Id].Add(device);
|
| | | if (device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | //canShow = true;// 这个界面不显示房间
|
| | | //收集可以显示的设备
|
| | | this.dicShowDevice[room.Id].Add(device);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | return canShow;
|
| | | }
|