| | |
| | | /// <summary>
|
| | | /// 桌布控件
|
| | | /// </summary>
|
| | | private FrameLayout frameTable = null;
|
| | | private NormalFrameLayout frameTable = null;
|
| | | /// <summary>
|
| | | /// 房间对象
|
| | | /// </summary>
|
| | |
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //桌布控件
|
| | | this.frameTable = new FrameLayout();
|
| | | this.frameTable = new NormalFrameLayout();
|
| | | frameTable.Y = frameBack.Bottom;
|
| | | frameTable.Height = bodyFrameLayout.Height - frameBack.Height;
|
| | | bodyFrameLayout.AddChidren(frameTable);
|
| | |
| | | tempRoom.Name = Language.StringByID(R.MyInternationalizationString.uOther);
|
| | | foreach (var mainKeys in this.listEsixtDevice)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(mainKeys);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(mainKeys);
|
| | | if (device == null)
|
| | | {
|
| | | continue;
|
| | |
| | | //采用后备操作 -> 新建一个临时房间对象出来
|
| | | if (HdlRoomLogic.Current.GetRoomByDevice(device) == null)
|
| | | {
|
| | | tempRoom.ListDevice.Add(Common.LocalDevice.Current.GetDeviceMainKeys(device));
|
| | | tempRoom.ListDevice.Add(HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | //界面关闭
|
| | | this.CloseForm();
|
| | | };
|
| | | //查看模板时,不允许编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | btnOk.CanClick = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | var listDevice = new List<ZigBee.Device.CommonDevice>();
|
| | | foreach (var deviceKeys in room.ListDevice)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
|
| | | //检测设备
|
| | | if (this.CheckCanShowDevice(device) == true)
|
| | | {
|
| | |
| | | for (int i = 0; i < listDevice.Count; i++)
|
| | | {
|
| | | var device = listDevice[i];
|
| | | string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | string mainKey = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
|
| | |
|
| | | var rowDevice = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(rowDevice);
|
| | | //图标
|
| | | var btnIcon = rowDevice.AddLeftIcon(81);
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
|
| | | HdlDeviceCommonLogic.Current.SetDeviceIconToControl(btnIcon, device);
|
| | | //设备名称
|
| | | var btnName = rowDevice.AddLeftCaption(Common.LocalDevice.Current.GetDeviceEpointName(device), 700);
|
| | | var btnName = rowDevice.AddLeftCaption(HdlDeviceCommonLogic.Current.GetDeviceEpointName(device), 700);
|
| | | btnName.TextSize = 15;
|
| | | //选择
|
| | | var btnSelect = rowDevice.AddMostRightEmptyIcon(58, 58);
|
| | |
| | | listEsixtDevice.Remove(mainKey);
|
| | | }
|
| | | };
|
| | | //查看模板时,不允许编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | rowDevice.CanClick = false;
|
| | | }
|
| | | }
|
| | | listDevice = null;
|
| | | //调整控件真实高度
|
| | |
| | | foreach (var deviceKeys in room.ListDevice)
|
| | | {
|
| | | //检测该设备能否显示
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
|
| | | if (this.CheckCanShowDevice(device) == false)
|
| | | {
|
| | | continue;
|
| | |
| | | return false;
|
| | | }
|
| | | //如果是传感器,或者是没有开关簇的话(这里判断的是输入簇)
|
| | | if ((device.Type == ZigBee.Device.DeviceType.IASZone) || Common.LocalDevice.Current.InDeviceIsCanOnOff(device) == false)
|
| | | if ((device.Type == ZigBee.Device.DeviceType.IASZone) || HdlDeviceCommonLogic.Current.InDeviceIsCanOnOff(device) == false)
|
| | | {
|
| | | return false;
|
| | | }
|