Skip to content

Commit

Permalink
Remove syso
Browse files Browse the repository at this point in the history
Signed-off-by: Guido Grune <[email protected]>
  • Loading branch information
gg-dim committed May 29, 2024
1 parent 1894074 commit 30623b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -108,15 +107,13 @@ public boolean handleNotify(String topic, ResourceDataNotification event) {
if (isCam) {
state.bike = isBikeToSouth(event);
state.bikeTimestamp = event.timestamp;
if (state.bike)
logger.log(Level.INFO, "Bike incoming ");
}

boolean isIlsa = "K440".equals(event.provider) && "color".equals(event.resource);
if (isIlsa) {
state.currentColor = (String) event.newValue;
state.trafficLightTimestamp = event.timestamp;
logger.log(Level.INFO, "Traffic light changed to: {0}", state.currentColor);
logger.log(Level.DEBUG, "Traffic light changed to: {0}", state.currentColor);
}

boolean conflict = state.isConflict();
Expand Down Expand Up @@ -165,14 +162,11 @@ private boolean isBikeToSouth(ResourceDataNotification event) {
for (Feature feature : features) {
Double heading = (Double) feature.properties.get("heading");
Double speed = (Double) feature.properties.get("speed");
Long time = (Long) feature.properties.get("time");
// Long time = (Long) feature.properties.get("time");
Long id = (Long) feature.properties.get("id");
Instant timestamp = event.timestamp;

Instant objectTime = Instant.ofEpochMilli(time);
System.out.println(System.currentTimeMillis() + " - conflict - " + id);
System.out.println(String.format( "Heading: %s Speed: %s Time: %s (%s - %s) Id: %s", heading, speed,
objectTime,objectTime.until(Instant.now(), ChronoUnit.SECONDS), timestamp.until(Instant.now(), ChronoUnit.SECONDS), id == null ? "" : id));
// Instant timestamp = event.timestamp;
//
// Instant objectTime = Instant.ofEpochMilli(time);
// logger.log(Level.INFO, "Heading: {0} Speed: {1} Time: {2} ({3} - {4}) Id: {5}", heading, speed,
// objectTime,objectTime.until(Instant.now(), ChronoUnit.SECONDS), timestamp.until(Instant.now(), ChronoUnit.SECONDS), id == null ? "" : id);
if (heading > MIN_HEADING && heading < MAX_HEADING && speed > MIN_BIKE_SPEED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,11 @@ private void onMessage(Message message) {
String[] split = topic.split("/");
String camId = split[2];
String classId = split[3];
if ("Felsenkeller".equals(camId) && "3".equals(classId)) {
System.out.println(System.currentTimeMillis() + " - " + topic);
}
if (topic.endsWith("config/retained")) {
updateConfig(message, camId);
} else if (topic.endsWith("lifesign")) {
} else {
if (split.length >= 4) {
if ("Felsenkeller".equals(camId) && "3".equals(classId)) {
System.out.println(System.currentTimeMillis() + " - " + topic);
}
update(message, camId, classId);
}
}
Expand All @@ -153,7 +147,6 @@ private SimplePushEventSource<Message> createSource(String camId, String classId
FeatureCollection geo = new FeatureCollection();
try {
for (Message message : messages) {
long start = System.currentTimeMillis();
BinaryResourceImpl resource = new BinaryResourceImpl();
resource.load(new ByteArrayInputStream(message.payload().array()), Collections.emptyMap());
EList<EObject> contents = resource.getContents();
Expand All @@ -175,11 +168,6 @@ private SimplePushEventSource<Message> createSource(String camId, String classId
feature.properties.put("speed", tc.getSpeed());
feature.properties.put("heading", gps.getHeading());
feature.properties.put("time", tc.getTime().getTime());
if ("Felsenkeller".equals(camId) && "3".equals(classId)) {
System.out
.println((System.currentTimeMillis() - start) + " ms - " + "====== " + id);
System.out.println(System.currentTimeMillis() + " - " + "====== " + id);
}
geo.features.add(feature);
}
sendEmpty.set(false);
Expand Down

0 comments on commit 30623b5

Please sign in to comment.