| | |
| | | |
| | | #region 房间顶部切换显示区域 |
| | | room = new Room() { roomName = Language.StringByID(StringId.All)}; |
| | | //if (DB_ResidenceData.rooms.Count > 0) |
| | | //{ |
| | | // room = DB_ResidenceData.rooms[0]; |
| | | //} |
| | | btnFoorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | |
| | | { |
| | | sensorListView.RemoveAll(); |
| | | int index = 0; |
| | | foreach (var sensor in DB_ResidenceData.functionList.sensorsEnvironmentalScience) |
| | | foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience) |
| | | { |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | if (sensor.bus_Data != null) |
| | | { |
| | | sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus_Data.SubnetID + "_" + sensor.bus_Data.DeviceID + "_" + sensor.bus_Data.loopId; |
| | | } |
| | | FrameLayout sensorView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(148), |
| | |
| | | }; |
| | | sensorView.AddChidren(btnSensorTitle); |
| | | btnSensorTitle.MouseUpEventHandler = (sender, e) => { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor); |
| | | MainPage.BasePageView.AddChidren(esp); |
| | | esp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endregion |
| | | }; |
| | | |
| | | var btnInfoIcon = new Button() |
| | |
| | | }; |
| | | infoView.AddChidren(btnTitle); |
| | | |
| | | switch (sensor.functionType) |
| | | switch (sensor.spk) |
| | | { |
| | | case FunctionType.PM25: |
| | | case SPK.SensorPm25: |
| | | btnTitle.Text = "PM2.5(ug/m²)"; |
| | | break; |
| | | case FunctionType.Temp: |
| | | case SPK.SensorTemperature: |
| | | btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)"; |
| | | break; |
| | | case FunctionType.TVOC: |
| | | case SPK.SensorTVOC: |
| | | btnTitle.Text = "TVOC(PPM)"; |
| | | break; |
| | | case FunctionType.CO2: |
| | | case SPK.SensorCO2: |
| | | btnTitle.Text = "CO2(PPM)"; |
| | | break; |
| | | case FunctionType.Humidity: |
| | | case SPK.SensorHumidity: |
| | | btnTitle.Text = Language.StringByID(StringId.Humidity) + "(%)"; |
| | | break; |
| | | } |
| | |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | if (DB_ResidenceData.residenceData.Rooms.Count < 2) |
| | | if (SpatialInfo.CurrentSpatial.RoomList.Count < 2) |
| | | { |
| | | } |
| | | else if (DB_ResidenceData.residenceData.Rooms.Count < 3) |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (DB_ResidenceData.residenceData.Rooms.Count < 4) |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | var showListRoom = new List<Room>(); |
| | | showListRoom.Add(new Room() { roomName = Language.StringByID(StringId.All) }); |
| | | showListRoom.AddRange(DB_ResidenceData.residenceData.Rooms); |
| | | showListRoom.AddRange(SpatialInfo.CurrentSpatial.RoomList); |
| | | |
| | | foreach (var roomTemp in showListRoom) |
| | | { |