Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 43ed84df authored by Maxim Dudin's avatar Maxim Dudin
Browse files

#307 added an info message for scenarios with no contacts

parent c8c114a9
Pipeline #257617 passed with stages
in 132 minutes and 13 seconds
......@@ -38,16 +38,7 @@
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestriansNearbyProcessor",
"id" : 5,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianNearbyProcessor",
"attributes" : {
"maxDistanceForANearbyPedestrian" : 1.5,
"sampleEveryNthStep" : 1,
"allowedAbsenceTimestepsIfContactReturns" : 2,
"minTimespanOfContactTimesteps" : 5,
"printContactTrajectories" : false,
"printForPostVis" : false
}
"id" : 5
} ],
"isTimestamped" : true,
"isWriteMetaData" : false
......
......@@ -225,6 +225,8 @@ SettingsDialog.chbShowPedestrianIds.text=Show PedestrianIds
SettingsDialog.chbShowPedestrianInOutGroup.text=Show Pedestrian In/Outgroup
PostVis.chShowEvacTimeColor.text=Coloring by Evacuation Times
PostVis.chShowCriteriaColor.text=Coloring by Predicate
PostVis.ShowContactsErrorMessage.text=Contacts were not processed for this scenario. To process contacts for scenarios add PedestriansNearbyProcessor and a corresponding file contacts.txt to data output.
PostVis.additional.border.text=PostVis
PostVis.btnPlay.tooltip=Play (Space)
......
......@@ -33,6 +33,7 @@ public class DefaultSimulationConfig extends DefaultConfig {
private boolean showStairs = true;
private boolean showPedestrians = true;
private boolean showContacts = true;
private boolean contactsRecorded = false;
private boolean showWalkdirection = false;
private boolean showTargetPotentialField = false;
private boolean showTargetPotentielFieldMesh = false;
......@@ -109,6 +110,13 @@ public class DefaultSimulationConfig extends DefaultConfig {
return showContacts;
}
public boolean isContactsRecorded() {
return contactsRecorded;
}
public void setContactsRecorded(boolean contactsRecorded) {
this.contactsRecorded = contactsRecorded;
}
public boolean isShowWalkdirection() {
return showWalkdirection;
......
......@@ -104,6 +104,7 @@ public class PostvisualizationModel extends SimulationModel<PostvisualizationCon
this.simTimeStepLength = scenario.getAttributesSimulation().getSimTimeStepLength();
this.trajectories = new TableTrajectoryFootStep(trajectories);
if (contactTrajectories != null) {
this.config.setContactsRecorded(true);
this.contactData = new ContactData(contactTrajectories);
}
this.visTime = 0;
......
......@@ -33,6 +33,7 @@ import org.vadere.gui.postvisualization.control.ActionVisualizationMenu;
import org.vadere.gui.postvisualization.control.Player;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.gui.projectview.control.ActionDeselect;
import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.io.IOOutput;
import org.vadere.util.config.VadereConfig;
......@@ -178,6 +179,7 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar
public void actionPerformed(ActionEvent e) {
model.config.setShowPedestrians(!model.config.isShowPedestrians());
model.notifyObservers();
}
}, "ProjectView.btnShowPedestrian.tooltip");
......@@ -187,8 +189,13 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar
model) {
@Override
public void actionPerformed(ActionEvent e) {
model.config.setShowContacts(!model.config.isShowContacts());
model.notifyObservers();
if (!model.config.isContactsRecorded()) {
JOptionPane.showMessageDialog(ProjectView.getMainWindow(),
Messages.getString("PostVis.ShowContactsErrorMessage.text"));
} else {
model.config.setShowContacts(!model.config.isShowContacts());
model.notifyObservers();
}
}
}, "ProjectView.btnShowContacts.tooltip");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment