Skip to content

Commit

Permalink
refactor: slight wording improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelger committed Sep 30, 2024
1 parent b27d705 commit 353bdd6
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class WeatherServerApp extends AbstractApplication<ServerOperatingSystem>
/**
* Save the last received DEN message for relaying.
*/
private Denm lastMessage = null;
private Denm lastReceivedMessage = null;


/**
Expand Down Expand Up @@ -86,7 +86,7 @@ public void processEvent(Event event) throws Exception {
* and thus the DENM is sent periodically at this interval.
*/
private void sample() {
if (lastMessage == null) {
if (lastReceivedMessage == null) {
getLog().infoSimTime(this, "No warning present.");
} else {
final Denm denm = constructDenm();
Expand All @@ -109,20 +109,20 @@ private void sample() {
* @return The constructed DENM
*/
private Denm constructDenm() {
final GeoCircle geoCircle = new GeoCircle(lastMessage.getEventLocation(), 3000.0D);
final GeoCircle geoCircle = new GeoCircle(lastReceivedMessage.getEventLocation(), 3000.0D);
final MessageRouting routing = getOs().getCellModule().createMessageRouting().geoBroadcastBasedOnUnicast(geoCircle);
return new Denm(routing,
new DenmContent(
lastMessage.getTime(),
lastMessage.getSenderPosition(),
lastMessage.getEventRoadId(),
lastMessage.getWarningType(),
lastMessage.getEventStrength(),
lastMessage.getCausedSpeed(),
lastMessage.getSenderDeceleration(),
lastMessage.getEventLocation(),
lastMessage.getEventArea(),
lastMessage.getExtendedContainer()
lastReceivedMessage.getTime(),
lastReceivedMessage.getSenderPosition(),
lastReceivedMessage.getEventRoadId(),
lastReceivedMessage.getWarningType(),
lastReceivedMessage.getEventStrength(),
lastReceivedMessage.getCausedSpeed(),
lastReceivedMessage.getSenderDeceleration(),
lastReceivedMessage.getEventLocation(),
lastReceivedMessage.getEventArea(),
lastReceivedMessage.getExtendedContainer()
),
200
);
Expand All @@ -140,11 +140,11 @@ public void onMessageReceived(ReceivedV2xMessage receivedV2xMessage) {
getLog().infoSimTime(this, "Ignoring message of type: {}", msg.getSimpleClassName());
return;
}
lastMessage = (Denm) msg;
getLog().debugSimTime(this, "DENM content: Sensor Type: {}", lastMessage.getWarningType().toString());
getLog().debugSimTime(this, "DENM content: Event position: {}", lastMessage.getEventLocation());
getLog().debugSimTime(this, "DENM content: Event Strength: {}", lastMessage.getEventStrength());
getLog().debugSimTime(this, "DENM content: Road Id of the Sender: {}", lastMessage.getEventRoadId());
lastReceivedMessage = (Denm) msg;
getLog().debugSimTime(this, "DENM content: Sensor Type: {}", lastReceivedMessage.getWarningType().toString());
getLog().debugSimTime(this, "DENM content: Event position: {}", lastReceivedMessage.getEventLocation());
getLog().debugSimTime(this, "DENM content: Event Strength: {}", lastReceivedMessage.getEventStrength());
getLog().debugSimTime(this, "DENM content: Road Id of the Sender: {}", lastReceivedMessage.getEventRoadId());
}

@Override
Expand Down

0 comments on commit 353bdd6

Please sign in to comment.