old mode 100644
new mode 100755
| | |
| | | if (listDataRoom.Count > 0)
|
| | | {
|
| | | //初始化房间和设备列表
|
| | | this.InitRoomAndDeviceRow(listDataRoom); |
| | | this.InitRoomAndDeviceRow(listDataRoom);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | /// </summary>
|
| | | /// <param name="listRoom">可以显示的房间对象</param>
|
| | | private void InitRoomAndDeviceRow(List<Common.Room> listRoom)
|
| | | { |
| | | //房间列表控件 |
| | | {
|
| | | //房间列表控件
|
| | | var roomContr = new RoomDeviceGroupMenuControl(listRoom);
|
| | | bodyFrameLayout.AddChidren(roomContr);
|
| | |
|
| | |
| | | listView.RecoverHeight();
|
| | |
|
| | | DeviceSimpleSelectControl oldSelectContr = null;
|
| | | var listDevice = this.dicShowDevice[roomId]; |
| | | //获取设备类型的 |
| | | 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; |
| | | 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]);
|
| | |
| | | {
|
| | | //底线
|
| | | contr.AddBottomLine();
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | contr.ButtonClickEvent += (sender, e) =>
|
| | | { |
| | | if (contr.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | contr.IsSelected = true; |
| | | {
|
| | | if (contr.IsSelected)
|
| | | {
|
| | | return;
|
| | | }
|
| | | 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; |
| | | //} |
| | | 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)
|
| | | {
|
| | |
| | | {
|
| | | bool canShow = false;
|
| | | //先清空
|
| | | this.dicShowDevice[room.Id] = new List<CommonDevice>(); |
| | | |
| | | this.dicShowDevice[room.Id] = new List<CommonDevice>();
|
| | |
|
| | | foreach (var deviceKeys in room.ListDevice)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
|
| | | if (device != null)
|
| | | {
|
| | | if (device.Type == DeviceType.FreshAir) |
| | | { |
| | | //canShow = true;// 这个界面不显示房间 |
| | | //收集可以显示的设备 |
| | | this.dicShowDevice[room.Id].Add(device); |
| | | } |
| | | if (device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | //canShow = true;// 这个界面不显示房间
|
| | | //收集可以显示的设备
|
| | | this.dicShowDevice[room.Id].Add(device);
|
| | | }
|
| | | }
|
| | |
|
| | |
|