| | |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region 房间顶部切换显示区域 |
| | | room = new Room(); |
| | | if (DB_ResidenceData.rooms.Count > 0) |
| | | { |
| | | room = DB_ResidenceData.rooms[0]; |
| | | } |
| | | room = new Room() { name = Language.StringByID(StringId.All), sid = ""}; |
| | | //if (DB_ResidenceData.rooms.Count > 0) |
| | | //{ |
| | | // room = DB_ResidenceData.rooms[0]; |
| | | //} |
| | | btnFoorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | |
| | | }; |
| | | contentView.AddChidren(sensorListView); |
| | | |
| | | int index = 0; |
| | | foreach(var sensor in DB_ResidenceData.functionList.sensorsEnvironmentalScience) |
| | | { |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | } |
| | | LoadSenesorList(); |
| | | |
| | | LoadEventList(); |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.EnvironmentalScience)).LoadTopView(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSenesorList() |
| | | { |
| | | sensorListView.RemoveAll(); |
| | | int index = 0; |
| | | foreach (var sensor in DB_ResidenceData.functionList.sensorsEnvironmentalScience) |
| | | { |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSensorDiv(Sensor sensor,int index) |
| | | { |
| | | if (sensor.roomIdList.Contains(room.sid)) |
| | | if (room.sid == "" || sensor.roomIdList.Contains(room.sid)) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | if (sensor.bus_Data != null) |
| | |
| | | var dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(110), |
| | | BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(155), |
| | | BackgroundImagePath = "PersonalCenter/HomeList2bg.png", |
| | |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(200), |
| | | BackgroundImagePath = "PersonalCenter/HomeList3bg.png", |
| | |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(245), |
| | | BackgroundImagePath = "PersonalCenter/HomeList4bg.png", |
| | |
| | | } |
| | | |
| | | |
| | | var showListRoom = new List<Room>(); |
| | | showListRoom.Add(new Room() { name = Language.StringByID(StringId.All),sid = "" }); |
| | | showListRoom.AddRange(DB_ResidenceData.rooms); |
| | | |
| | | foreach (var roomTemp in DB_ResidenceData.rooms) |
| | | foreach (var roomTemp in showListRoom) |
| | | { |
| | | string roomName = roomTemp.name; |
| | | var btnRoomName = new Button() |
| | |
| | | dialog.Close(); |
| | | btnRoom.Text = roomName; |
| | | room = roomTemp; |
| | | LoadSenesorList(); |
| | | }; |
| | | } |
| | | |