| | |
| | | public void Show(Shared.Common.Room r) |
| | | { |
| | | room = r; |
| | | |
| | | |
| | | AddTop(); |
| | | |
| | | AddBodyView(); |
| | |
| | | }; |
| | | bodyFrameLayout.AddChidren(verticalScrolView); |
| | | |
| | | var confirm = new Device.CommonForm.CompleteButton(1700, 700, 127); |
| | | var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127); |
| | | confirm.SetTitle(R.MyInternationalizationString.Save); |
| | | AddChidren(confirm); |
| | | confirm.MouseUpEventHandler += (sender, e) => |
| | |
| | | selectDeviceAction?.Invoke(tempDevice); |
| | | } |
| | | }; |
| | | |
| | | var deviceList = GetTemperatrueDevices(); |
| | | for (int i = 0; i < deviceList.Count; i++) |
| | | { |
| | | var fl = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(127 + 20), |
| | | BackgroundColor=ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | verticalScrolView.AddChidren(fl); |
| | | var device = deviceList[i]; |
| | | var devRow = new DeviceInfoWithZoneRow(20 + i * (127 + 20)); |
| | | verticalScrolView.AddChidren(devRow); |
| | | var devRow = new DeviceInfoWithZoneRow(20); |
| | | fl.AddChidren(devRow); |
| | | devRow.Init(); |
| | | devRow.SetIcon(device.IconPath); |
| | | devRow.SetName(device.DeviceName); |
| | | devRow.SetZone(room.FloorName + ", " + room.Name); |
| | | |
| | | if(tempDevice!=null && tempDevice==device) |
| | | devRow.SetName(Common.LocalDevice.Current.GetDeviceEpointName(device)); |
| | | devRow.SetZone(Common.Room.CurrentRoom.GetRoomNameByDevice(device)); |
| | | if (i == deviceList.Count - 1) |
| | | { |
| | | devRow.HideLine(true); |
| | | } |
| | | |
| | | if (tempDevice!=null && tempDevice==device) |
| | | { |
| | | tempDeviceRow = devRow; |
| | | tempDevice = device; |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 温度传感器列表
|
| | | /// </summary>
|
| | | private List<ZigBee.Device.CommonDevice> GetTemperatrueDevices()
|
| | | {
|
| | | var listDevice = new List<ZigBee.Device.CommonDevice>();
|
| | | foreach (var device in Common.LocalDevice.Current.listAllDevice)
|
| | | {
|
| | | //获取温度传感器
|
| | | if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | }
|
| | | return listDevice;
|
| | | /// <summary> |
| | | /// 温度传感器列表 |
| | | /// </summary> |
| | | private List<ZigBee.Device.CommonDevice> GetTemperatrueDevices() |
| | | { |
| | | var listDevice = new List<ZigBee.Device.CommonDevice>(); |
| | | foreach (var device in Common.LocalDevice.Current.listAllDevice) |
| | | { |
| | | //获取温度传感器 |
| | | if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1) |
| | | { |
| | | listDevice.Add(device); |
| | | } |
| | | } |
| | | return listDevice; |
| | | } |
| | | |
| | | #endregion |