 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
126 FXMAPFUNC(SEL_COMMAND,
MID_NEW_OSGVIEW, GUIApplicationWindow::onCmdNewOSG),
196 FXIMPLEMENT(
GUIApplicationWindow, FXMainWindow, GUIApplicationWindowMap, ARRAYNUMBER(GUIApplicationWindowMap))
208 myLoadThread(nullptr), myRunThread(nullptr),
210 myAlternateSimDelay(0.),
211 myRecentNets(a,
"nets"),
212 myConfigPattern(configPattern),
213 hadDependentBuild(false),
214 myShowTimeAsHMS(false),
215 myHaveNotifiedAboutSimEnd(false),
218 myPreviousCollisionNumber(0),
221 myEmergencyVehicleCount(0),
254 myGeoCoordinate =
new FXLabel(
myGeoFrame,
"N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)",
nullptr, LAYOUT_CENTER_Y);
299 gCurrentFolder = getApp()->reg().readStringEntry(
"SETTINGS",
"basedir",
"");
300 FXMainWindow::create();
318 FXint textWidth = getApp()->getNormalFont()->getTextWidth(
"8", 1) * 24;
322 show(PLACEMENT_DEFAULT);
324 if (getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 1) {
328 myShowTimeAsHMS = (getApp()->reg().readIntEntry(
"gui",
"timeasHMS", 0) == 1);
366 FXMainWindow::detach();
378 "&Open Simulation...\tCtrl+O\tOpen a simulation (Configuration file).",
381 "Open &Network...\tCtrl+N\tOpen a network.",
384 "Open Shapes \tCtrl+P\tLoad POIs and Polygons for visualization.",
387 "Open EdgeData \tCtrl+U\tLoad edge related data for visualization.",
390 "&Reload\tCtrl+R\tReloads the simulation / the network.",
394 "Save Configuration\tCtrl+Shift+S\tSave current options as a configuration file.",
397 "Close\tCtrl+W\tClose the simulation.",
400 FXMenuSeparator* sep1 =
new FXMenuSeparator(
myFileMenu);
402 sep1->setSelector(FXRecentFiles::ID_ANYFILES);
416 FXMenuSeparator* sep2 =
new FXMenuSeparator(
myFileMenu);
418 sep2->setSelector(FXRecentFiles::ID_ANYFILES);
434 "&Quit\tCtrl+Q\tQuit the Application.",
440 for (
auto i : vehicleClasses) {
447 "Edit Selected...\tCtrl+E\tOpens a dialog for editing the list of selected items.",
450 "Select lanes which allow...\t\tOpens a menu for selecting a vehicle class by which to selected lanes.",
454 "Edit Breakpoints\tCtrl+B\tOpens a dialog for editing breakpoints.",
457 "Edit Visualisation\tF9\tOpens a dialog for editing visualization settings.",
460 "Edit Viewport\tCtrl+I\tOpens a dialog for editing viewing area, zoom and rotation.",
464 "Open in Netedit\tCtrl+T\tOpens the netedit application with the current network.",
471 "Application Settings...\t\tOpen a Dialog for Application Settings editing.",
474 "Gaming Mode\tCtrl+G\tToggle gaming mode on/off.",
477 "Full Screen Mode\tCtrl+F\tToggle full screen mode on/off.",
483 "Locate &Junctions\t\tOpen a Dialog for Locating a Junction.",
486 "Locate &Edges\t\tOpen a Dialog for Locating an Edge.",
490 "Locate &Vehicles\t\tOpen a Dialog for Locating a Vehicle.",
494 "Locate &Persons\t\tOpen a Dialog for Locating a Person.",
497 "Locate &TLS\t\tOpen a Dialog for Locating a Traffic Light.",
500 "Locate &Additional\t\tOpen a Dialog for Locating an Additional Structure.",
503 "Locate P&oI\t\tOpen a Dialog for Locating a Point of Intereset.",
506 "Locate Po&lygon\t\tOpen a Dialog for Locating a Polygon.",
510 "Show Internal Structures\t\tShow internal junctions and streets in locator dialog.",
513 "Show Parking Vehicles\t\tShow parking vehicles in locator dialog.",
517 "Show vehicles outside the road network\t\tShow vehicles that are teleporting or driving remote-controlled outside the road network in locator dialog.",
523 "Run\tCtrl+A\tStart running the simulation.",
526 "Stop\tCtrl+S\tStop running the simulation.",
529 "Step\tCtrl+D\tPerform one simulation step.",
532 "Save\t\tSave the current simulation state to a file.",
539 "Show Status Line\t\tToggle the Status Bar on/off.",
542 "Show Message Window\t\tToggle the Message Window on/off.",
545 "Show Simulation Time\t\tToggle the Simulation Time on/off.",
548 "Show Simulation Delay\t\tToggle the Simulation Delay Entry on/off.",
565 sep1->setSelector(FXMDIClient::ID_MDI_ANY);
573 "Clear Message Window\t\tClear the message window.",
636 mySimDelaySlider =
new FXSlider(
myToolBar4,
mySimDelayTarget, FXDataTarget::ID_VALUE, LAYOUT_FIX_WIDTH | SLIDER_ARROW_UP | SLIDER_TICKS_TOP, 0, 0, 300, 10, 0, 0, 5, 0);
653 new FXLabel(
myToolBar8,
"Scale Traffic:\t\tScale traffic from flows and vehicles that are loaded incrementally from route files",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
665 new FXButton(
myToolBar5,
"\t\tOpen a new microscopic view.",
668 new FXButton(
myToolBar5,
"\t\tOpen a new 3D view.",
678 new FXLabel(
myToolBar6,
"Waiting Time:\t\tTime spent waiting accumulated for all vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
690 new FXLabel(
myToolBar7,
"Time Loss:\t\tTime lost due to being unable to drive with maximum speed for all vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
702 new FXLabel(
myToolBar9,
"Distance (km):\t\tTotal distance driven by DRT vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
714 new FXLabel(
myToolBar10,
"Emergency Vehicle waiting time:\t\tTime spent waiting accumulated for emergency vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
728 getApp()->reg().writeStringEntry(
"SETTINGS",
"basedir",
gCurrentFolder.text());
729 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", isMaximized() ? 1 : 0);
730 getApp()->reg().writeIntEntry(
"gui",
"timeasHMS",
myShowTimeAsHMS ? 1 : 0);
739 FXMenuCommand* mc =
dynamic_cast<FXMenuCommand*
>(menu);
740 if (mc->getText() ==
"Edit Selected...") {
749 const std::vector<MSLane*>& lanes = (*i)->getLanes();
750 for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
810 FXRegistry reg(
"SUMO netedit",
"Eclipse");
817 std::string netedit =
"netedit";
818 const char* sumoPath = getenv(
"SUMO_HOME");
819 if (sumoPath !=
nullptr) {
820 std::string newPath = std::string(sumoPath) +
"/bin/netedit";
822 netedit =
"\"" + newPath +
"\"";
831 cmd =
"start /B \"\" " + cmd;
843 FXFileDialog opendialog(
this,
"Open Simulation Configuration");
845 opendialog.setSelectMode(SELECTFILE_EXISTING);
850 if (opendialog.execute()) {
852 std::string file = opendialog.getFilename().text();
863 FXFileDialog opendialog(
this,
"Open Network");
865 opendialog.setSelectMode(SELECTFILE_EXISTING);
866 opendialog.setPatternList(
"SUMO nets (*.net.xml)\nAll files (*)");
870 if (opendialog.execute()) {
872 std::string file = opendialog.getFilename().text();
883 FXFileDialog opendialog(
this,
"Open Shapes");
885 opendialog.setSelectMode(SELECTFILE_EXISTING);
886 opendialog.setPatternList(
"Additional files (*.xml)\nAll files (*)");
890 if (opendialog.execute()) {
892 std::string file = opendialog.getFilename().text();
913 FXFileDialog opendialog(
this,
"Open EdgeData");
915 opendialog.setSelectMode(SELECTFILE_EXISTING);
916 opendialog.setPatternList(
"EdgeData files (*.xml)\nAll files (*)");
920 if (opendialog.execute()) {
922 std::string file = opendialog.getFilename().text();
941 getApp()->beginWaitCursor();
955 myStatusbar->getStatusLine()->setText(
"Already loading!");
958 std::string file((
const char*)ptr);
967 FXFileDialog opendialog(
this,
"Save Sumo Configuration");
969 opendialog.setSelectMode(SELECTFILE_ANY);
970 opendialog.setPatternList(
"Config (*.sumocfg)");
978 opendialog.getPatternText(opendialog.getCurrentPattern()).after(
'.').before(
')')).text();
979 std::ofstream out(file);
1000 sender->handle(
this,
1001 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1009 sender->handle(
this,
1011 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1019 sender->handle(
this,
1020 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1028 sender->handle(
this,
1030 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1040 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1049 getApp()->forceRefresh();
1057 getApp()->forceRefresh();
1066 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1082 FXFileDialog opendialog(
this,
"Save Simulation State");
1084 opendialog.setSelectMode(SELECTFILE_ANY);
1085 opendialog.setPatternList(
"Binary State (*.sbx)\nXML State (*.xml)");
1094 opendialog.getPatternText(opendialog.getCurrentPattern()).after(
'.').before(
')')).text();
1138 sender->handle(
this,
1140 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1148 sender->handle(
this,
1150 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1158 sender->handle(
this,
1160 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1169 sender->handle(
this, disable ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1181 sender->handle(
this,
TraCIServer::getInstance() ==
nullptr ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1212 d->show(PLACEMENT_OWNER);
1278 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
1279 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
1280 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
1281 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
1283 setDecorations(DECOR_NONE);
1284 place(PLACEMENT_MAXIMIZED);
1304 place(PLACEMENT_VISIBLE);
1305 setDecorations(DECOR_ALL);
1310 setWidth(getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600));
1311 setHeight(getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400));
1312 setX(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150));
1313 setY(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150));
1348 GUIApplicationWindow::onCmdNewOSG(FXObject*, FXSelector,
void*) {
1359 about->show(PLACEMENT_OWNER);
1365 FXEvent*
event = (FXEvent*)ptr;
1367 setDNDData(FROM_CLIPBOARD, event->target,
string);
1428 if (ec->
myNet ==
nullptr) {
1463 if (view ==
nullptr) {
1466 std::string settingsName = settings.
addSettings(view);
1479 std::vector<SUMOTime> breakpoints;
1483 std::sort(breakpoints.begin(), breakpoints.end());
1498 std::vector<SUMOTime> breakpoints;
1502 std::sort(breakpoints.begin(), breakpoints.end());
1511 setTitle(
"SUMO Interactive Traffic Light");
1514 setTitle(
"SUMO Interactive Demand-Responsive-Transport");
1523 off.
set(getApp()->reg().readRealEntry(
"viewport",
"x"),
1524 getApp()->reg().readRealEntry(
"viewport",
"y"),
1525 getApp()->reg().readRealEntry(
"viewport",
"z"));
1533 (*it)->setText(
"-");
1541 getApp()->endWaitCursor();
1555 if (backlog > running) {
1585 getApp()->forceRefresh();
1618 "\nDo you want to close all open files and views?";
1619 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
"Simulation ended",
"%s", text.c_str());
1633 #ifdef HAVE_DANGEROUS_SOUNDS // disable user-configurable command execution for public build
1636 for (; it != end; ++it) {
1670 if (veh->
getID().rfind(
"emergency", 0) == 0) {
1706 getApp()->beginWaitCursor();
1720 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1731 FXuint opts = MDI_TRACKING;
1735 if (oldView !=
nullptr) {
1767 (*it)->setText(
"-");
1801 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1825 myStatusbar->getStatusLine()->setText(text.c_str());
1826 myStatusbar->getStatusLine()->setNormalText(text.c_str());
1851 std::ostringstream str;
1852 str << std::setfill(
'0');
1860 str << std::setw(2);
1861 str << time / 3600000 <<
'-';
1863 str << std::setw(2) << time / 60000 <<
'-';
1866 str << std::setw(2) << time / 1000;
1867 if (!hideFraction) {
1868 str <<
'.' << std::setw(3) << time % 1000;
1876 const long handled = FXMainWindow::onKeyPress(o, sel, ptr);
1877 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1889 const long handled = FXMainWindow::onKeyRelease(o, sel, ptr);
1890 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1918 const std::vector<SUMOTime>
@ MID_LOCATEPOI
Locate poi - button.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
FXEX::FXLCDLabel * myLCDLabel
the simulation step display
void setToolBarVisibility(const bool value)
@notify about toggled gaming status
@ MID_LOCATETLS
Locate TLS - button.
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
void handleEvent_SimulationStep(GUIEvent *e)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ MID_HOTKEY_CTRL_I_EDITVIEWPORT
Open viewport editor.
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
bool listParking() const
return whether to list parking vehicles
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
double myAlternateSimDelay
The alternate simulation delay in milliseconds for toggling.
bool myAmFullScreen
whether to show the window in full screen mode
FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[]
#define GUIDesignSpinDial
virtual void copyViewportTo(GUISUMOAbstractView *view)
copy the viewport to the given view
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
long onCmdEditChosen(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Chosen.
FXHorizontalFrame * myCartesianFrame
FXHorizontalFrame * myGeoFrame
bool myTLSGame
current game mode
long onUpdOpen(FXObject *, FXSelector, void *)
Determines whether opening is enabled.
virtual bool simulationIsStopable() const
The XML-Handler for shapes loading network loading.
void setScale(double scale)
sets the demand scaling factor
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
void storeWindowSizeAndPos()
record window position and size in registry
@ MID_LOCATEEDGE
Locate edge - button.
@ EVENT_MESSAGE_OCCURRED
send when a message occured
long onUpdStop(FXObject *, FXSelector, void *)
Determines whether "stop" is enabled.
bool hasContainers() const
Returns whether containers are simulated.
@ MID_HOTKEY_CTRL_P
Load additional file with poi and polygons.
FXToolBarShell * myToolBarDrag4
RandomDistributor< std::string > myJamSounds
bool isStopped() const
Returns whether the vehicle is at a stop.
FXMDIClient * myMDIClient
The multi view panel.
static FXint fxexecute(FXString link)
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
Called on menu File->Open Network.
A single child window which contains a view of the simulation area.
FXSlider * mySimDelaySlider
void setFgColor(FXColor clr)
set/get forground color
void show()
sets the focus after the window is created
static void buildSUMOAccelerators(GUIApplicationWindow *GUIApp)
build SUMO Accelerators
FXStatusBar * myStatusbar
The status bar.
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
long onCmdSaveState(FXObject *, FXSelector, void *)
Called on "save state".
MSTransportableControl & getContainerControl() override
Returns the container control.
The application's "About" - dialog.
A logging window for the gui.
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
ShapeContainer & getShapeContainer()
Returns the shapes container.
long onCmdDemandScale(FXObject *, FXSelector, void *)
Called on "demand scale".
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
virtual FXGLCanvas * getBuildGLCanvas() const
get build GL Canvas
long onUpdNeedsSimulation(FXObject *, FXSelector, void *)
Determines whether some buttons which require an active simulation may be shown.
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
Called if the message window shall be cleared.
FXMenuPane * myLocatorMenu
void setTarget(FXObject *tgt)
set the target
#define GUIDesignSplitterMDI
MDI Splitter.
void create()
Creates the widget.
@ MID_TRACI_STATUS
update traci status
bool myWasStarted
the information whether the simulation was started before
long onCmdNetedit(FXObject *, FXSelector, void *)
Called on menu Edit->Netedit.
FXMenuPane * myWindowsMenu
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
#define GUIDesignStatusBar
design used in status bar
FXRealSpinner * myDemandScaleSpinner
the demand scale
void updateTimeLCD(SUMOTime time)
updates the simulation time display
virtual void create()
create GUIGlChildWindow
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
@ MID_HOTKEY_F1_ONLINEDOCUMENTATION
hot key <F1> open online documentation
MSInsertionControl & getInsertionControl()
Returns the insertion control.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
long onCmdTimeToggle(FXObject *, FXSelector, void *)
Called on "time toggle".
std::vector< FXButton * > myStatButtons
Buttons showing and running values and triggering statistic windows.
@ ID_RUNTHREAD_EVENT
The Simulation execution thread.
@ MID_NEW_MICROVIEW
Open a new microscopic view.
std::vector< GUIGlChildWindow * > myGLWindows
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
void loadConfigOrNet(const std::string &file, bool isNet)
int getWaitingForVehicleNumber() const
Returns the number of vehicles waiting for a ride.
std::vector< SUMOTime > & getBreakpoints()
const SUMOTime myBegin
the time the simulation shall start with
static void resetFont()
to be called when the font context is invalidated
@ MID_CLEARMESSAGEWINDOW
Clear simulation output.
bool myListTeleporting
information whether the locator should list teleporting vehicles
@ MID_HOTKEY_CTRL_R_RELOAD
Reload the previously loaded simulation.
int myPreviousCollisionNumber
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
FXEX::FXLCDLabel * myEmergencyVehicleLabel
static OptionsCont & getOptions()
Retrieves the options.
static void close()
close GUIIconSubSys
bool hasPersons() const
Returns whether persons are simulated.
@ MID_DELAY_TOOGLE
toogle delay between alternative value
@ MID_SHOWPERSONSTATS
Show person statistics.
const std::string & getMsg() const
Returns the message.
GUIApplicationWindow(FXApp *a, const std::string &configPattern)
Constructor.
SUMOTime myEmergencyVehicleCount
@ MID_LOCATEPERSON
Locate person - button.
@ MID_HOTKEY_F2_ABOUT
hot key <F2> open about dialog
@ EVENT_STATUS_OCCURRED
send when a status change occured
#define GUIDesignSplitter
virtual bool simulationIsStartable() const
long onUpdAddView(FXObject *, FXSelector, void *)
Determines whether adding a view is enabled.
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
void setSelector(FXSelector sel)
set the selector
virtual void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
@ MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS
save network as
FXCursor * getDefaultCursor()
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
virtual ~GUIApplicationWindow()
Destructor.
@ MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID
Toogle Gaming mode in SUMO and grid in NETEDIT.
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
Somebody wants our clipped text.
@ EVENT_SIMULATION_ENDED
Send when the simulation is over;.
const std::string & getFileName() const
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Storage for geometrical objects extended by mutexes.
Event sent when the the simulation is over.
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.
@ MID_NETEDIT
Open in netedit.
virtual void detach()
Detaches the tool/menu bar.
long onCmdOpenRecent(FXObject *, FXSelector, void *)
Called on opening a recent file.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
long onCmdShowStats(FXObject *, FXSelector, void *)
Called on commands from the statistic buttons.
long onCmdStop(FXObject *, FXSelector, void *)
Called on "stop".
@ MID_LISTINTERNAL
Locator configuration - menu entry.
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
@ MID_HOTKEY_ALT_F4_CLOSE
Main window closes.
@ VIEW_3D_OSG
plain 3D OSG view (
const std::string myFile
the name of the loaded file
@ EVENT_DEBUG_OCCURRED
send when a debug occured
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
bool myHaveNotifiedAboutSimEnd
whether the simulation end was already announced
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
std::string myConfigPattern
Input file pattern.
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
void setGroove(const FXint width)
set/get groove width - must be less than segment width
@ MID_HOTKEY_CTRL_B_EDITBREAKPOINT
Edit simulation breakpoints.
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
FXEX::FXLCDLabel * myWaitingTimeLabel
performance indicators
static std::string clipped
long onUpdOpenRecent(FXObject *, FXSelector, void *)
Determines whether opening a recent file is enabled.
const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
@ EVENT_WARNING_OCCURRED
send when a warning occured
FXMenuBar * myMenuBar
The application menu bar.
T get(std::mt19937 *which=0) const
Draw a sample of the distribution.
FXMutex & getBreakpointLock()
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
bool simulationAvailable() const
FXToolBarShell * myToolBarDrag7
static std::mt19937 myGamingRNG
A random number generator used to choose a gaming sound.
long onCmdListParking(FXObject *, FXSelector, void *)
Toggle listing of parking vehicles.
FXToolBarShell * myMenuBarDrag
virtual void buildToolBars()
Builds the tool bar.
@ MID_OPEN_NETWORK
Open network - ID.
void addSeparator()
Adds a a separator to this log window.
long onCmdFullScreen(FXObject *, FXSelector, void *)
Toggle full screen mode.
#define GUIDesignMDIButtonLeft
void clear()
Clears the window.
FXToolBarShell * myToolBarDrag3
long onCmdListInternal(FXObject *, FXSelector, void *)
Toggle listing of internal structures.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
MSNet::SimulationState getReason() const
Returns the reason the simulation has ended due.
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call
std::vector< FXMainWindow * > myTrackerWindows
virtual void eventOccurred()
FXToolBarShell * myToolBarDrag6
@ ID_LOADTHREAD_EVENT
The loading thread.
virtual void addToWindowsMenu(FXMenuPane *)
@ MID_HOTKEY_CTRL_F_FULSCREENMODE
Fullscreen mode - menu entry.
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
FXMenuPane * myControlMenu
bool myListParking
information whether the locator should list parking vehicles
void checkGamingEvents()
handles additional game-related events
@ MID_APPSETTINGS
Application settings - menu entry.
MSTransportableControl & getPersonControl() override
Returns the person control.
SUMOTime getTimeStep() const
Returns the time step the simulation has ended at.
void set(double x, double y)
set positions x and y
long onCmdAbout(FXObject *, FXSelector, void *)
Shows the about dialog.
FXToolBarShell * myToolBarDrag8
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
FXRecentFiles myRecentNets
List of recent nets.
FXDataTarget * mySimDelayTarget
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
long onCmdLocate(FXObject *, FXSelector, void *)
Called on menu commands from the Locator menu.
GUIGlID getGlID() const
Returns the numerical id of the object.
const std::vector< std::string > mySettingsFiles
the name of the settings file to load
@ SIMSTATE_ERROR_IN_SIM
An error occurred during the simulation step.
ViewType
Available view types.
virtual bool simulationIsStepable() const
#define GUIDesignToolBar
design for default toolbar
FXToolBarShell * myToolBarDrag1
for some menu detaching fun
The main window of the SUMO-gui.
FXEX::FXThreadEvent myRunThreadEvent
io-event with the run-thread
@ EVENT_SIMULATION_LOADED
send when a simulation has been loaded
const std::string & getViewType() const
Returns the parsed view type.
bool myShowTimeAsHMS
whether to show time as hour:minute:second
@ MID_WINDOW
Main window-ID.
@ MID_HOTKEY_F9_EDIT_VIEWSCHEME
open edit scheme menu
A point in 2D or 3D with translation and scaling methods.
GUICompleteSchemeStorage gSchemeStorage
const bool myOsgView
whether to load the OpenSceneGraph view
void setText(FXString lbl)
manipulate text in LCD label
double x() const
Returns the x-position.
An XML-handler for visualisation schemes.
std::string time2string(SUMOTime t)
@ SIMSTATE_LOADING
The simulation is loading.
bool myAmGaming
information whether the gui is currently in gaming mode
FXRealSpinner * mySimDelaySpinner
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
The dialog to change the application (gui) settings.
static const RGBColor RED
named colors
FXSynchQue< GUIEvent * > myEvents
List of got requests.
long onCmdStart(FXObject *, FXSelector, void *)
Called on "play".
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
FXCondition myEventCondition
the semaphore when waiting for event completion
@ MID_SIMSAVE
Save state to file.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
FXSplitter * myMainSplitter
The splitter that divides the main window into views and the log window.
long onCmdAppSettings(FXObject *, FXSelector, void *)
Opens the application settings menu (Settings->Application Settings...)
FXMenuPane * mySettingsMenu
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
@ EVENT_GLDEBUG_OCCURRED
send when a gldebug occured
FXString gCurrentFolder
The folder used as last.
FXMenuCascade * mySelectLanesMenuCascade
the menu cascades
long onCmdGaming(FXObject *, FXSelector, void *)
Toggle gaming mode.
SUMOTime string2time(const std::string &r)
int getCollisionCount() const
return the number of collisions
static double gTrackerInterval
the aggregation period for tracker windows in seconds
long onCmdNewView(FXObject *, FXSelector, void *)
Called if a new view shall be opened (2D view)
FXToolBarShell * myToolBarDrag5
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
FXGLVisual * myGLVisual
The gl-visual used.
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
@ MID_OPEN_CONFIG
Open configuration - ID.
@ MID_NEW_OSGVIEW
Open a new microscopic 3D view.
long onUpdReload(FXObject *, FXSelector, void *)
Determines whether reloading is enabled.
FXLabel * myGeoCoordinate
@ EVENT_SIMULATION_STEP
send when a simulation step has been performed
Editor for simulation breakpoints.
void clear()
Clears the list of selected objects.
@ MID_HOTKEY_CTRL_Q_CLOSE
Main window closes.
FXMenuPane * myFileMenu
the submenus
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
@ MID_DEMAND_SCALE
scale traffic
@ EVENT_ERROR_OCCURRED
send when a error occured
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a lane in the micro simulation (gui-version)
long onCmdOpenEdgeData(FXObject *, FXSelector, void *)
Called on menu File->Load EdgeData.
#define GUIDesignToolBarRaisedNextTop
design for first toolbar shell positioned in the next-top position of dock
void handleEvent_Message(GUIEvent *e)
long onCmdClose(FXObject *, FXSelector, void *)
Called on menu File->Close.
@ MID_HOTKEY_CTRL_W_CLOSESIMULATION
Close simulation - ID.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
GUIPerspectiveChanger & getChanger() const
get changer
FXRecentFiles myRecentConfigs
List of recent config files.
long onUpdStart(FXObject *sender, FXSelector, void *ptr)
Determines whether "play" is enabled.
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
@ MID_LOCATEJUNCTION
Locate junction - button.
GUIEventType getOwnType() const
returns the event type
double mySimDelay
the simulation delay in milliseconds
long onCmdOpenShapes(FXObject *, FXSelector, void *)
Called on menu File->Load Shapes.
double myJamSoundTime
waiting time after which vehicles trigger jam sounds
RandomDistributor< std::string > getEventDistribution(const std::string &id)
virtual void fillMenuBar()
Builds the menu bar.
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
FXToolBarShell * myToolBarDrag9
int myViewNumber
The current view number.
#define GUIDesignMDIButtonRight
MDIButton oriented to right.
const SUMOTime myEnd
the time the simulation shall end with
bool myListInternal
information whether the locator should list internal structures
FXMenuPane * mySelectByPermissions
long onCmdEditBreakpoints(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Breakpoints.
int getRunningNumber() const
Returns the number of build and inserted, but not yet deleted transportables.
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
@ MID_TIME_TOOGLE
toogle time display mode
long onCmdReload(FXObject *, FXSelector, void *)
Called on reload.
SUMOTime getSimEndTime() const
GUISelectedStorage gSelected
A global holder of selected objects.
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
Called on menu File->Open Configuration.
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
const std::string & getID() const
Returns the name of the vehicle.
long onCmdStep(FXObject *, FXSelector, void *)
Called on "step".
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
#define GUIDesignToolBarRaisedSameTop
design for first toolbar shell positioned in the same position of dock
@ MID_LOCATEVEHICLE
Locate vehicle - button.
virtual void sendBlockingEvent(GUIEvent *event)
Sends an event from the application thread to the GUI and waits until it is handled.
long onLoadThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the loading thread.
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
long onRunThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the simulation thread.
long onCmdListTeleporting(FXObject *, FXSelector, void *)
Toggle listing of teleporting vehicles.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
void loadConfigOrNet(const std::string &file, bool isNet)
begins the loading of the given file
void addDecals(const std::vector< Decal > &decals)
add decals
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out
static bool isReadable(std::string path)
Checks whether the given file is readable.
long onCmdDelayToggle(FXObject *, FXSelector, void *)
Called on "delay toggle".
@ MID_RECENTFILE
Loads a file previously loaded.
const bool myViewportFromRegistry
whether loading viewport from registry
RandomDistributor< std::string > myCollisionSounds
The class responsible for building and deletion of vehicles.
static void clearTextures()
clears loaded textures
GUIRunThread * myRunThread
the thread that runs simulations
@ MID_SHOWNETSTATS
Show network statistics.
GUIColorer laneColorer
The lane colorer.
static TraCIServer * getInstance()
double getSpeed() const
Returns the vehicle's current speed.
#define GUIDesignToolbarMenuBar
FXGLCanvas * getBuildGLCanvas() const
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const bool inComment=false) const
Writes the configuration.
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
virtual void create()
Creates the main window (required by FOX)
GUINet * myNet
the loaded net
@ MID_EDITCHOSEN
Open editor for selections.
void setHorizontal(const FXint len)
set/get segment horizontal length - must be more than twice the segment width
@ MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND
Perform a single simulation step in SUMO and open Demand Elements in NETEDIT.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
static const RGBColor GREEN
@ MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS
Start the simulation in SUMO and open Additionals Elemements in NETEDIT.
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
FXToolBarShell * myToolBarDrag2
static bool gRunAfterLoad
the simulation shall start direct after loading
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
FXEX::FXLCDLabel * myTimeLossLabel
long onUpdStep(FXObject *, FXSelector, void *)
Determines whether "step" is enabled.
void setVertical(const FXint len)
set/get segment vertical length - must be more than twice the segment width
double getTrackerInterval() const
void setStatusBarText(const std::string &text)
void checkGamingEventsDRT()
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
long onUpdTraCIStatus(FXObject *, FXSelector, void *)
Determines whether traci is active.
FXToolBar * myToolBar1
The application tool bar.
@ MID_SHOWVEHSTATS
Show vehicle statistics.
@ MID_LOCATEPOLY
Locate polygons - button.
#define GUIDesignButtonToolbarText
void addRecentFile(const FX::FXString &f, const bool isNet)
SUMOTime getCurrentSimTime() const
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
double getOverallProb() const
Return the sum of the probabilites assigned to the members.
@ MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in NETEDIT.
double getDelay() const
Returns the parsed delay.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
@ MID_LOCATEADD
Locate addtional structure - button.
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
void setActive(int scheme)
static FXbool userPermitsOverwritingWhenFileExists(FXWindow *const parent, const FXString &file)
Returns true if either the file given by its name does not exist or the user allows overwriting it.
long onCmdSaveConfig(FXObject *, FXSelector, void *)
Called on menu File->Close.
FXToolBarShell * myToolBarDrag10
@ MID_OPEN_EDGEDATA
Load edge data for visualization.
#define WRITE_MESSAGE(msg)
GUISUMOAbstractView * openNewView(GUISUMOViewParent::ViewType vt=GUISUMOViewParent::VIEW_2D_OPENGL)
@ VIEW_2D_OPENGL
plain 2D openGL view (
GUILoadThread * myLoadThread
the thread that loads simulations
virtual bool init(GUINet *net, SUMOTime start, SUMOTime end)
initialises the thread with the new simulation
FXEX::FXLCDLabel * myTotalDistanceLabel
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
FXMutex myEventMutex
the mutex for the waiting semaphore
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
void handleEvent_SimulationLoaded(GUIEvent *e)
void prepareDestruction()
void setThickness(const FXint width)
set/get segment width - must be less than half the segment length
Editor for the list of chosen objects.
void handleEvent_SimulationEnded(GUIEvent *e)
Representation of a vehicle in the micro simulation.