Skip to content

Commit

Permalink
feat(monitoring): add stationId to BatonDetection
Browse files Browse the repository at this point in the history
  • Loading branch information
NuttyShrimp committed Mar 8, 2023
1 parent f558b3c commit d28bbc0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Map<Integer, List<BatonDetection>> getBatonDetections() {
}
var batonDetections = batonDetectionMap.get(batonId);
var team = teamMap.get(batonTeamMap.get(batonId));
var batonDetection = new BatonDetection(Math.toIntExact(d.getTimestamp().getTime() / 1000), d.getRssi(), batonId, team.getName());
var batonDetection = new BatonDetection(Math.toIntExact(d.getTimestamp().getTime() / 1000), d.getRssi(),d.getStationId(), batonId, team.getName());
batonDetections.add(batonDetection);
});
return batonDetectionMap;
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/telraam/monitoring/models/BatonDetection.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.monitoring.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.models.auth.In;

public class BatonDetection {
@JsonProperty("detected_time")
Expand All @@ -9,12 +10,15 @@ public class BatonDetection {
private Integer rssi;
@JsonProperty("team_id")
private Integer teamId;
@JsonProperty("station_id")
private Integer stationId;
@JsonProperty("team_name")
private String teamName;

public BatonDetection(Integer detectionTime, Integer rssi, Integer teamId, String teamName) {
public BatonDetection(Integer detectionTime, Integer rssi, Integer stationId, Integer teamId, String teamName) {
this.detectionTime = detectionTime;
this.rssi = rssi;
this.stationId = stationId;
this.teamId = teamId;
this.teamName = teamName;
}
Expand All @@ -37,6 +41,12 @@ public Integer getTeamId() {
public void setTeamId(Integer teamId) {
this.teamId = teamId;
}
public Integer getStationId() {
return stationId;
}
public void setStationId(Integer stationId) {
this.stationId = stationId;
}
public String getTeamName() {
return teamName;
}
Expand Down

0 comments on commit d28bbc0

Please sign in to comment.