| | |
| | | Y = Application.GetRealHeight(92), |
| | | UnSelectedImagePath = "ZigeeLogic/drop-down.png", |
| | | }; |
| | | topRowLayout.AddChidren(dropdown); |
| | | |
| | | topRowLayout.AddChidren(dropdown);
|
| | |
|
| | | #endregion |
| | | |
| | |
|
| | | ///没有房间直接返回去; |
| | | if (Common.Room.Lists.Count == 0) |
| | | var listAllRoom = UserCenter.HdlRoomLogic.Current.GetAllListRooms(); |
| | | if (listAllRoom.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | |
| | | dropdown.Visible = false; |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | roomlists.AddRange(Common.Room.Lists); |
| | | roomlists.AddRange(listAllRoom); |
| | | } |
| | | else |
| | | { |
| | |
| | | roomTextButton = roomnameBtn; |
| | | roomnameBtn.IsSelected = true; |
| | | |
| | | var list = new List<DeviceUI>(); |
| | | foreach (var device in room.DeviceUIList) |
| | | var list = new List<CommonDevice>(); |
| | | foreach (var deviceKeys in room.ListDevice) |
| | | { |
| | | if (device.CommonDevice == null) |
| | | var device = LocalDevice.Current.GetDevice(deviceKeys); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!deviceTypeList.Contains(device.CommonDevice.Type)) |
| | | if (!deviceTypeList.Contains(device.Type)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | roomTextButton = roomnameBtn; |
| | | roomnameBtn.IsSelected = true; |
| | | |
| | | var list = new List<DeviceUI>(); |
| | | foreach (var device in room.DeviceUIList) |
| | | { |
| | | if (device.CommonDevice == null) |
| | | var list = new List<CommonDevice>(); |
| | | foreach (var deviceKeys in room.ListDevice) |
| | | {
|
| | | var device = LocalDevice.Current.GetDevice(deviceKeys); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!deviceTypeList.Contains(device.CommonDevice.Type)) |
| | | if (!deviceTypeList.Contains(device.Type)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | /// 加载该区域所有设备视图方法 |
| | | /// </summary>0 |
| | | /// <param name="devicelist">Devicelist.</param> |
| | | void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol) |
| | | void AllDeviceTypeView(List<CommonDevice> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol) |
| | | { |
| | | List<string> devicetypelist = new List<string>(); |
| | | devicetypelist.Clear(); |
| | | #region ------排列设备类型------ |
| | | ///暂时隐藏灯光和窗帘设备 |
| | | var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.ColorDimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput); |
| | | var lightjosn = devicelist.Find((device) => device.Type == DeviceType.ColorDimmableLight || device.Type == DeviceType.OnOffOutput); |
| | | if (lightjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights)); |
| | | } |
| | | var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice); |
| | | var curtainjosn = devicelist.Find((device) => device.Type == DeviceType.WindowCoveringDevice); |
| | | if (curtainjosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains)); |
| | | } |
| | | |
| | | var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone || device.CommonDevice.Type == DeviceType.TemperatureSensor); |
| | | var iASZonejosn = devicelist.Find((device) => device.Type == DeviceType.IASZone || device.Type == DeviceType.TemperatureSensor); |
| | | if (iASZonejosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor)); |
| | | } |
| | | var onOffSwitchjson = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.OnOffSwitch); |
| | | var onOffSwitchjson = devicelist.Find((device) => device.Type == DeviceType.OnOffSwitch); |
| | | if (onOffSwitchjson != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch)); |
| | | } |
| | | var doorLock = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DoorLock); |
| | | var doorLock = devicelist.Find((device) => device.Type == DeviceType.DoorLock); |
| | | if (doorLock != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock)); |
| | |
| | | /// </summary> |
| | | /// <param name="deviceTypelist">Device typelist.</param> |
| | | /// <param name="devicelist">设备列表</param> |
| | | void ConditionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist) |
| | | void ConditionDeviceView(List<DeviceType> deviceTypelist, List<CommonDevice> devicelist) |
| | | { |
| | | middle.RemoveAll(); |
| | | |
| | | foreach (var common in devicelist) |
| | | { |
| | | |
| | | if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type)) |
| | | if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.Type)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | var devicename = new Button |
| | | { |
| | | Text = common.CommonDevice.DeviceEpointName, |
| | | Text = common.DeviceEpointName, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | SelectedTextColor = ZigbeeColor.Current.LogicAddColor, |
| | | TextSize = 14, |
| | | }; |
| | | deviceRow.AddChidren(devicename); |
| | | switch (common.CommonDevice.Type) |
| | | switch (common.Type) |
| | | { |
| | | case DeviceType.OnOffOutput: |
| | | { |
| | |
| | | break; |
| | | case DeviceType.IASZone: |
| | | { |
| | | var iASZonedevice = common.CommonDevice as IASZone; |
| | | var iASZonedevice = common as IASZone; |
| | | if (iASZonedevice.DeviceID != 1026) |
| | | { |
| | | break; |
| | |
| | | break; |
| | | case DeviceType.TemperatureSensor: |
| | | { |
| | | var temperatureSensor = common.CommonDevice as TemperatureSensor; |
| | | var temperatureSensor = common as TemperatureSensor; |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | deviceIconBtn.UnSelectedImagePath = $"ZigeeLogic/temperature.png"; |
| | |
| | | devicename.IsSelected = true; |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | CurrentDeviceView(flMain, common.CommonDevice, false); |
| | | CurrentDeviceView(flMain, common, false); |
| | | }; |
| | | deviceFramelayout.MouseUpEventHandler += devicclick; |
| | | bjFramelayout.MouseUpEventHandler += devicclick; |