2.12.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 @@ ...@@ -38,16 +38,7 @@
} }
}, { }, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestriansNearbyProcessor", "type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestriansNearbyProcessor",
"id" : 5, "id" : 5
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianNearbyProcessor",
"attributes" : {
"maxDistanceForANearbyPedestrian" : 1.5,
"sampleEveryNthStep" : 1,
"allowedAbsenceTimestepsIfContactReturns" : 2,
"minTimespanOfContactTimesteps" : 5,
"printContactTrajectories" : false,
"printForPostVis" : false
}
} ], } ],
"isTimestamped" : true, "isTimestamped" : true,
"isWriteMetaData" : false "isWriteMetaData" : false
......
...@@ -225,6 +225,8 @@ SettingsDialog.chbShowPedestrianIds.text=Show PedestrianIds ...@@ -225,6 +225,8 @@ SettingsDialog.chbShowPedestrianIds.text=Show PedestrianIds
SettingsDialog.chbShowPedestrianInOutGroup.text=Show Pedestrian In/Outgroup SettingsDialog.chbShowPedestrianInOutGroup.text=Show Pedestrian In/Outgroup
PostVis.chShowEvacTimeColor.text=Coloring by Evacuation Times PostVis.chShowEvacTimeColor.text=Coloring by Evacuation Times
PostVis.chShowCriteriaColor.text=Coloring by Predicate 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.additional.border.text=PostVis
PostVis.btnPlay.tooltip=Play (Space) PostVis.btnPlay.tooltip=Play (Space)
......
...@@ -33,6 +33,7 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -33,6 +33,7 @@ public class DefaultSimulationConfig extends DefaultConfig {
private boolean showStairs = true; private boolean showStairs = true;
private boolean showPedestrians = true; private boolean showPedestrians = true;
private boolean showContacts = true; private boolean showContacts = true;
private boolean contactsRecorded = false;
private boolean showWalkdirection = false; private boolean showWalkdirection = false;
private boolean showTargetPotentialField = false; private boolean showTargetPotentialField = false;
private boolean showTargetPotentielFieldMesh = false; private boolean showTargetPotentielFieldMesh = false;
...@@ -109,6 +110,13 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -109,6 +110,13 @@ public class DefaultSimulationConfig extends DefaultConfig {
return showContacts; return showContacts;
} }
public boolean isContactsRecorded() {
return contactsRecorded;
}
public void setContactsRecorded(boolean contactsRecorded) {
this.contactsRecorded = contactsRecorded;
}
public boolean isShowWalkdirection() { public boolean isShowWalkdirection() {
return showWalkdirection; return showWalkdirection;
......
...@@ -104,6 +104,7 @@ public class PostvisualizationModel extends SimulationModel<PostvisualizationCon ...@@ -104,6 +104,7 @@ public class PostvisualizationModel extends SimulationModel<PostvisualizationCon
this.simTimeStepLength = scenario.getAttributesSimulation().getSimTimeStepLength(); this.simTimeStepLength = scenario.getAttributesSimulation().getSimTimeStepLength();
this.trajectories = new TableTrajectoryFootStep(trajectories); this.trajectories = new TableTrajectoryFootStep(trajectories);
if (contactTrajectories != null) { if (contactTrajectories != null) {
this.config.setContactsRecorded(true);
this.contactData = new ContactData(contactTrajectories); this.contactData = new ContactData(contactTrajectories);
} }
this.visTime = 0; this.visTime = 0;
......
...@@ -33,6 +33,7 @@ import org.vadere.gui.postvisualization.control.ActionVisualizationMenu; ...@@ -33,6 +33,7 @@ import org.vadere.gui.postvisualization.control.ActionVisualizationMenu;
import org.vadere.gui.postvisualization.control.Player; import org.vadere.gui.postvisualization.control.Player;
import org.vadere.gui.postvisualization.model.PostvisualizationModel; import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.gui.projectview.control.ActionDeselect; 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.Scenario;
import org.vadere.simulator.projects.io.IOOutput; import org.vadere.simulator.projects.io.IOOutput;
import org.vadere.util.config.VadereConfig; import org.vadere.util.config.VadereConfig;
...@@ -178,6 +179,7 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar ...@@ -178,6 +179,7 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
model.config.setShowPedestrians(!model.config.isShowPedestrians()); model.config.setShowPedestrians(!model.config.isShowPedestrians());
model.notifyObservers(); model.notifyObservers();
} }
}, "ProjectView.btnShowPedestrian.tooltip"); }, "ProjectView.btnShowPedestrian.tooltip");
...@@ -187,8 +189,13 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar ...@@ -187,8 +189,13 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar
model) { model) {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
model.config.setShowContacts(!model.config.isShowContacts()); if (!model.config.isContactsRecorded()) {
model.notifyObservers(); JOptionPane.showMessageDialog(ProjectView.getMainWindow(),
Messages.getString("PostVis.ShowContactsErrorMessage.text"));
} else {
model.config.setShowContacts(!model.config.isShowContacts());
model.notifyObservers();
}
} }
}, "ProjectView.btnShowContacts.tooltip"); }, "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