92 #define MIN_DRAW_DELAY 20
129 FXMAPFUNC(SEL_COMMAND,
MID_NEW_OSGVIEW, GUIApplicationWindow::onCmdNewOSG),
201 FXIMPLEMENT(
GUIApplicationWindow, FXMainWindow, GUIApplicationWindowMap, ARRAYNUMBER(GUIApplicationWindowMap))
213 myLoadThread(nullptr), myRunThread(nullptr),
215 myAlternateSimDelay(0.),
216 myRecentNetworksAndConfigs(a,
"files"),
217 myConfigPattern(configPattern),
218 hadDependentBuild(false),
219 myShowTimeAsHMS(false),
220 myHaveNotifiedAboutSimEnd(false),
223 myPreviousCollisionNumber(0),
226 myEmergencyVehicleCount(0),
262 myGeoCoordinate =
new FXLabel(
myGeoFrame,
"N/A\t\tOriginal coordinate (before coordinate transformation in netconvert)",
nullptr, LAYOUT_CENTER_Y);
307 gCurrentFolder = getApp()->reg().readStringEntry(
"SETTINGS",
"basedir",
"");
308 FXMainWindow::create();
326 FXint textWidth = getApp()->getNormalFont()->getTextWidth(
"8", 1) * 24;
330 show(PLACEMENT_DEFAULT);
332 if (getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 1) {
336 myShowTimeAsHMS = (getApp()->reg().readIntEntry(
"gui",
"timeasHMS", 0) == 1);
374 FXMainWindow::detach();
386 "New Window",
"Ctrl+Shift+N",
"Open a new sumo-gui window.",
390 "&Open Simulation...",
"Ctrl+O",
"Open a simulation (Configuration file).",
393 "Open &Network...",
"Ctrl+N",
"Open a network.",
396 "Open Shapes ",
"Ctrl+P",
"Load POIs and Polygons for visualization.",
399 "Open EdgeData ",
"Ctrl+U",
"Load edge related data for visualization.",
402 "&Reload",
"Ctrl+R",
"Reloads the simulation / the network.",
406 "Save Configuration",
"Ctrl+Shift+S",
"Save current options as a configuration file.",
409 "Close",
"Ctrl+W",
"Close the simulation.",
412 FXMenuSeparator* sep1 =
new FXMenuSeparator(
myFileMenu);
413 sep1->setSelector(FXRecentFiles::ID_ANYFILES);
430 "&Quit",
"Ctrl+Q",
"Quit the Application.",
436 for (
const auto& vehicleClass : vehicleClasses) {
443 "Edit Selected...",
"Ctrl+E",
"Opens a dialog for editing the list of selected items.",
446 "Select lanes which allow...\t\tOpens a menu for selecting a vehicle class by which to selected lanes.",
450 "Edit Breakpoints",
"Ctrl+B",
"Opens a dialog for editing breakpoints.",
453 "Edit Visualisation",
"F9",
"Opens a dialog for editing visualization settings.",
456 "Edit Viewport",
"Ctrl+I",
"Opens a dialog for editing viewing area, zoom and rotation.",
460 "Open in netedit",
"Ctrl+T",
"Opens the netedit application with the current network.",
467 "Application Settings",
"Ctrl+H",
"Open a Dialog for Application Settings editing.",
470 "Gaming Mode\tCtrl+G\tToggle gaming mode on/off.",
473 "Full Screen Mode",
"Ctrl+F",
"Toggle full screen mode on/off.",
480 "Locate &Junctions",
"Shift+J",
"Open a Dialog for Locating a Junction.",
483 "Locate &Edges",
"Shift+E",
"Open a Dialog for Locating an Edge.",
487 "Locate &Vehicles",
"Shift+V",
"Open a Dialog for Locating a Vehicle.",
491 "Locate &Persons",
"Shift+P",
"Open a Dialog for Locating a Person.",
494 "Locate &Container",
"Shift+C",
"Open a Dialog for Locating a Container.",
497 "Locate &TLS",
"Shift+T",
"Open a Dialog for Locating a Traffic Light.",
500 "Locate &Additional",
"Shift+A",
"Open a Dialog for Locating an Additional Structure.",
503 "Locate P&oI",
"Shift+O",
"Open a Dialog for Locating a Point of Interest.",
506 "Locate Po&lygon",
"Shift+L",
"Open 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.",
524 "Run",
"Ctrl+A",
"Start running the simulation.",
527 "Stop",
"Ctrl+S",
"Stop running the simulation.",
530 "Step",
"Ctrl+D",
"Perform one simulation step.",
533 "Save",
"",
"Save the current simulation state to a file.",
540 "Show Status Line\t\tToggle the Status Bar on/off.",
543 "Show Message Window\t\tToggle the Message Window on/off.",
546 "Show Simulation Time\t\tToggle the Simulation Time on/off.",
549 "Show Simulation Delay\t\tToggle the Simulation Delay Entry on/off.",
554 "Tile &Horizontally",
"",
"",
557 "Tile &Vertically",
"",
"",
568 sep1->setSelector(FXMDIClient::ID_MDI_ANY);
576 "Clear Message Window",
"",
"Clear the message window.",
584 "&Online Documentation",
"F1",
"Open Online documentation.",
587 "&About",
"F12",
"About sumo-gui.",
660 new FXLabel(
myToolBar8,
"Scale Traffic:\t\tScale traffic from flows and vehicles that are loaded incrementally from route files",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
672 new FXButton(
myToolBar5,
"\t\tOpen a new microscopic view.",
675 new FXButton(
myToolBar5,
"\t\tOpen a new 3D view.",
685 new FXLabel(
myToolBar6,
"Waiting Time:\t\tTime spent waiting accumulated for all vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
697 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);
709 new FXLabel(
myToolBar9,
"Distance (km):\t\tTotal distance driven by DRT vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
721 new FXLabel(
myToolBar10,
"Emergency Vehicle waiting time:\t\tTime spent waiting accumulated for emergency vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
735 getApp()->reg().writeStringEntry(
"SETTINGS",
"basedir",
gCurrentFolder.text());
736 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", isMaximized() ? 1 : 0);
737 getApp()->reg().writeIntEntry(
"gui",
"timeasHMS",
myShowTimeAsHMS ? 1 : 0);
746 FXMenuCommand* mc =
dynamic_cast<FXMenuCommand*
>(menu);
747 if (mc->getText() ==
"Edit Selected...") {
756 const std::vector<MSLane*>& lanes = (*i)->getLanes();
757 for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
817 FXRegistry reg(
"SUMO netedit",
"netedit");
824 std::string netedit =
"netedit";
825 const char* sumoPath = getenv(
"SUMO_HOME");
826 if (sumoPath !=
nullptr) {
827 std::string newPath = std::string(sumoPath) +
"/bin/netedit";
829 netedit =
"\"" + newPath +
"\"";
838 cmd =
"start /B \"\" " + cmd;
849 FXRegistry reg(
"SUMO sumo-gui",
"sumo-gui");
850 std::string sumo_gui =
"sumo-gui";
851 const char* sumoPath = getenv(
"SUMO_HOME");
852 if (sumoPath !=
nullptr) {
853 std::string newPath = std::string(sumoPath) +
"/bin/sumo_gui";
855 sumo_gui =
"\"" + newPath +
"\"";
858 std::string cmd = sumo_gui;
864 cmd =
"start /B \"\" " + cmd;
876 FXFileDialog opendialog(
this,
"Open Simulation Configuration");
878 opendialog.setSelectMode(SELECTFILE_EXISTING);
883 if (opendialog.execute()) {
885 std::string file = opendialog.getFilename().text();
896 FXFileDialog opendialog(
this,
"Open Network");
898 opendialog.setSelectMode(SELECTFILE_EXISTING);
899 opendialog.setPatternList(
"SUMO nets (*.net.xml)\nAll files (*)");
903 if (opendialog.execute()) {
905 std::string file = opendialog.getFilename().text();
916 FXFileDialog opendialog(
this,
"Open Shapes");
918 opendialog.setSelectMode(SELECTFILE_EXISTING);
919 opendialog.setPatternList(
"Additional files (*.xml)\nAll files (*)");
923 if (opendialog.execute()) {
925 std::string file = opendialog.getFilename().text();
946 FXFileDialog opendialog(
this,
"Open EdgeData");
948 opendialog.setSelectMode(SELECTFILE_EXISTING);
949 opendialog.setPatternList(
"EdgeData files (*.xml)\nAll files (*)");
953 if (opendialog.execute()) {
955 std::string file = opendialog.getFilename().text();
974 getApp()->beginWaitCursor();
988 myStatusbar->getStatusLine()->setText(
"Already loading!");
991 std::string file((
const char*)ptr);
1000 FXFileDialog opendialog(
this,
"Save SUMO Configuration");
1002 opendialog.setSelectMode(SELECTFILE_ANY);
1003 opendialog.setPatternList(
"Config (*.sumocfg)");
1011 opendialog.getPatternText(opendialog.getCurrentPattern()).after(
'.').before(
')')).text();
1033 sender->handle(
this,
1034 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1042 sender->handle(
this,
1044 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1052 sender->handle(
this,
1053 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1061 sender->handle(
this,
1063 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1073 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1082 getApp()->forceRefresh();
1090 getApp()->forceRefresh();
1099 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1115 FXFileDialog opendialog(
this,
"Save Simulation State");
1117 opendialog.setSelectMode(SELECTFILE_ANY);
1118 opendialog.setPatternList(
"GZipped State (*.xml.gz)\nXML State (*.xml)");
1127 opendialog.getPatternText(opendialog.getCurrentPattern()).after(
'.').before(
')')).text();
1171 sender->handle(
this,
1173 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1181 sender->handle(
this,
1183 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1191 sender->handle(
this,
1193 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1202 sender->handle(
this, disable ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1214 sender->handle(
this,
TraCIServer::getInstance() ==
nullptr ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1245 d->show(PLACEMENT_OWNER);
1313 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
1314 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
1315 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
1316 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
1318 setDecorations(DECOR_NONE);
1319 place(PLACEMENT_MAXIMIZED);
1339 place(PLACEMENT_VISIBLE);
1340 setDecorations(DECOR_ALL);
1345 setWidth(getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600));
1346 setHeight(getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400));
1347 setX(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150));
1348 setY(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150));
1383 GUIApplicationWindow::onCmdNewOSG(FXObject*, FXSelector,
void*) {
1394 about->show(PLACEMENT_OWNER);
1402 hall->show(PLACEMENT_OWNER);
1408 FXEvent*
event = (FXEvent*)ptr;
1410 setDNDData(FROM_CLIPBOARD, event->target,
string);
1471 if (ec->
myNet ==
nullptr) {
1506 if (view ==
nullptr) {
1539 std::vector<SUMOTime> breakpoints;
1544 breakpoints.push_back(t);
1546 std::sort(breakpoints.begin(), breakpoints.end());
1555 setTitle(
"SUMO Interactive Traffic Light");
1558 setTitle(
"SUMO Interactive Demand-Responsive-Transport");
1567 off.
set(getApp()->reg().readRealEntry(
"viewport",
"x"),
1568 getApp()->reg().readRealEntry(
"viewport",
"y"),
1569 getApp()->reg().readRealEntry(
"viewport",
"z"));
1577 (*it)->setText(
"-");
1585 getApp()->endWaitCursor();
1599 if (t - myLastStepEventMillis < MIN_DRAW_DELAY && myRunThread->simulationIsStopable()) {
1608 if (backlog > running) {
1638 getApp()->forceRefresh();
1671 "\nDo you want to close all open files and views?";
1672 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
"Simulation ended",
"%s", text.c_str());
1686 #ifdef HAVE_DANGEROUS_SOUNDS
1689 for (; it != end; ++it) {
1723 if (veh->
getID().rfind(
"emergency", 0) == 0) {
1759 getApp()->beginWaitCursor();
1773 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1784 FXuint opts = MDI_TRACKING;
1788 if (oldView !=
nullptr) {
1820 (*it)->setText(
"-");
1835 for (FXMainWindow*
const window : trackerWindows) {
1856 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1880 myStatusbar->getStatusLine()->setText(text.c_str());
1881 myStatusbar->getStatusLine()->setNormalText(text.c_str());
1902 std::ostringstream str;
1903 str << std::setfill(
'0');
1911 str << std::setw(2);
1912 str << time / 3600000 <<
'-';
1914 str << std::setw(2) << time / 60000 <<
'-';
1917 str << std::setw(2) << time / 1000;
1918 if (!hideFraction) {
1919 str <<
'.' << std::setw(3) << time % 1000;
1927 const long handled = FXMainWindow::onKeyPress(o, sel, ptr);
1928 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1940 const long handled = FXMainWindow::onKeyRelease(o, sel, ptr);
1941 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1969 const std::vector<SUMOTime>
@ MID_HOTKEY_CTRL_Q_CLOSE
Main window closes.
@ ID_RUNTHREAD_EVENT
The Simulation execution thread.
@ MID_LOCATEPERSON
Locate person - button.
@ MID_LISTINTERNAL
Locator configuration - menu entry.
@ MID_NEW_MICROVIEW
Open a new microscopic view.
@ MID_LOCATEJUNCTION
Locate junction - button.
@ MID_OPEN_CONFIG
Open configuration - ID.
@ MID_HOTKEY_CTRL_W_CLOSESIMULATION
Close simulation - ID.
@ MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS
Perform a single simulation step in SUMO and open Demand Elements in NETEDIT.
@ MID_HOTKEY_F9_EDIT_VIEWSCHEME
open edit scheme menu
@ MID_LOCATEPOLY
Locate polygons - button.
@ MID_TRACI_STATUS
update traci status
@ MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS
save network as
@ MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS
Edit simulation breakpoints in SUMO and open Data Elements in NETEDIT.
@ MID_HOTKEY_F1_ONLINEDOCUMENTATION
open online documentation
@ MID_HOTKEY_CTRL_R_RELOAD
Reload the previously loaded simulation.
@ MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in NETEDIT.
@ MID_LOCATEADD
Locate addtional structure - button.
@ MID_LOCATEPOI
Locate poi - button.
@ MID_OPEN_NETWORK
Open network - ID.
@ MID_DEMAND_SCALE
scale traffic
@ MID_HOTKEY_CTRL_I_EDITVIEWPORT
Open viewport editor.
@ MID_RECENTFILE
Loads a file previously loaded.
@ MID_APPSETTINGS
Application settings - menu entry.
@ MID_HOTKEY_CTRL_SHIFT_N_NEWWINDOW
Open a New Window.
@ MID_HOTKEY_SHIFT_F11_HALLOFFAME
show the hall of fame dialog
@ MID_NETEDIT
Open in netedit.
@ MID_CLEARMESSAGEWINDOW
Clear simulation output.
@ MID_OPEN_EDGEDATA
Load edge data for visualization.
@ MID_HOTKEY_CTRL_F_FULSCREENMODE
Fullscreen mode - menu entry.
@ MID_SIMSAVE
Save state to file.
@ MID_HOTKEY_CTRL_G_GAMINGMODE_TOGGLEGRID
Toggle Gaming mode in SUMO and grid in NETEDIT.
@ MID_SHOWNETSTATS
Show network statistics.
@ ID_LOADTHREAD_EVENT
The loading thread.
@ MID_EDITCHOSEN
Open editor for selections.
@ MID_SHOWPERSONSTATS
Show person statistics.
@ MID_DELAY_TOGGLE
toggle delay between alternative value
@ MID_HOTKEY_ALT_F4_CLOSE
Main window closes.
@ MID_TIME_TOGGLE
toggle time display mode
@ MID_LOCATEEDGE
Locate edge - button.
@ MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS
Start the simulation in SUMO and open Additionals Elemements in NETEDIT.
@ MID_LOCATEVEHICLE
Locate vehicle - button.
@ MID_LOCATETLS
Locate TLS - button.
@ MID_NEW_OSGVIEW
Open a new microscopic 3D view.
@ MID_HOTKEY_F12_ABOUT
open about dialog
@ MID_SHOWVEHSTATS
Show vehicle statistics.
@ MID_HOTKEY_CTRL_P
Load additional file with poi and polygons.
@ MID_WINDOW
Main window-ID.
@ MID_LOCATECONTAINER
Locate container - button.
FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[]
GUICompleteSchemeStorage gSchemeStorage
#define GUIDesignSpinDial
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
#define GUIDesignMDIButtonLeft
#define GUIDesignToolBarRaisedSameTop
design for first toolbar shell positioned in the same position of dock
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
#define GUIDesignToolBar
design for default toolbar
#define GUIDesignSplitter
#define GUIDesignSplitterMDI
MDI Splitter.
#define GUIDesignToolbarMenuBar
#define GUIDesignToolBarRaisedNextTop
design for first toolbar shell positioned in the next-top position of dock
#define GUIDesignButtonToolbarText
#define GUIDesignMDIButtonRight
MDIButton oriented to right.
#define GUIDesignStatusBar
design used in status bar
@ SIMULATION_ENDED
Send when the simulation is over;.
@ MESSAGE_OCCURRED
send when a message occured
@ GLDEBUG_OCCURRED
send when a gldebug occured
@ ERROR_OCCURRED
send when a error occured
@ SIMULATION_STEP
send when a simulation step has been performed
@ SIMULATION_LOADED
send when a simulation has been loaded
@ STATUS_OCCURRED
send when a status change occured
@ DEBUG_OCCURRED
send when a debug occured
@ WARNING_OCCURRED
send when a warning occured
GUISelectedStorage gSelected
A global holder of selected objects.
FXString gCurrentFolder
The folder used as last.
#define WRITE_MESSAGE(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void setTarget(FXObject *tgt)
set the target
void setSelector(FXSelector sel)
set the selector
void setHorizontal(const FXint len)
set/get segment horizontal length - must be more than twice the segment width
void setThickness(const FXint w)
set/get segment width - must be less than half the segment length
void setText(FXString lbl)
manipulate text in LCD label
void setVertical(const FXint len)
set/get segment vertical length - must be more than twice the segment width
void setFgColor(FXColor clr)
set/get forground color
void setGroove(const FXint w)
set/get groove width - must be less than segment width
static FXint fxexecute(FXString link)
static bool isReadable(std::string path)
Checks whether the given file is readable.
static void resetFont()
to be called when the font context is invalidated
The main window of the SUMO-gui.
long onUpdReload(FXObject *, FXSelector, void *)
Determines whether reloading is enabled.
long onCmdShowStats(FXObject *, FXSelector, void *)
Called on commands from the statistic buttons.
FXToolBarShell * myToolBarDrag2
long onCmdTimeToggle(FXObject *, FXSelector, void *)
Called on "time toggle".
virtual void sendBlockingEvent(GUIEvent *event)
Sends an event from the application thread to the GUI and waits until it is handled.
void handleEvent_Message(GUIEvent *e)
GUILoadThread * myLoadThread
the thread that loads simulations
FXEX::FXLCDLabel * myTimeLossLabel
void handleEvent_SimulationEnded(GUIEvent *e)
FXMenuCheck * myGamingModeCheckbox
menu checkbox to activate game mode
int myViewNumber
The current view number.
FXEX::FXLCDLabel * myTotalDistanceLabel
FXToolBarShell * myToolBarDrag4
long onCmdAbout(FXObject *, FXSelector, void *)
Shows the about dialog.
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
Somebody wants our clipped text.
long onUpdTraCIStatus(FXObject *, FXSelector, void *)
Determines whether traci is active.
long onUpdStep(FXObject *, FXSelector, void *)
Determines whether "step" is enabled.
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out
long onCmdAppSettings(FXObject *, FXSelector, void *)
Opens the application settings menu (Settings->Application Settings...)
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
void handleEvent_SimulationLoaded(GUIEvent *e)
FXToolBarShell * myToolBarDrag9
FXRealSpinner * mySimDelaySpinner
void handleEvent_SimulationStep(GUIEvent *e)
bool myHaveNotifiedAboutSimEnd
whether the simulation end was already announced
void setStatusBarText(const std::string &text)
get status bar text (can be implemented in children)
FXToolBarShell * myToolBarDrag10
void addRecentFile(const FX::FXString &f)
long onCmdStop(FXObject *, FXSelector, void *)
Called on "stop".
virtual void setDelay(double delay)
Sets the delay of the parent application.
double myJamSoundTime
waiting time after which vehicles trigger jam sounds
FXMenuPane * myControlMenu
FXEX::FXLCDLabel * myWaitingTimeLabel
performance indicators
FXRealSpinner * myDemandScaleSpinner
the demand scale
FXSynchQue< GUIEvent * > myEvents
List of got requests.
FXRecentNetworks myRecentNetworksAndConfigs
List of recent networks and configs.
FXToolBarShell * myToolBarDrag7
double mySimDelay
the simulation delay in milliseconds
SUMOTime getCurrentSimTime() const
get current sim time (must be implemented in all children)
long onUpdAddView(FXObject *, FXSelector, void *)
Determines whether adding a view is enabled.
FXToolBarShell * myToolBarDrag1
for some menu detaching fun
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
long onRunThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the simulation thread.
SUMOTime myEmergencyVehicleCount
FXCursor * getDefaultCursor()
void checkGamingEventsDRT()
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
long onCmdListTeleporting(FXObject *, FXSelector, void *)
Toggle listing of teleporting vehicles.
long onCmdNewWindow(FXObject *, FXSelector, void *)
Called on menu File->New Window.
long onCmdStep(FXObject *, FXSelector, void *)
Called on "step".
FXMutex myEventMutex
the mutex for the waiting semaphore
FXMenuPane * mySelectByPermissions
double getTrackerInterval() const
get tracker interval (must be implemented in all children)
long onCmdClose(FXObject *, FXSelector, void *)
Called on menu File->Close.
virtual void buildToolBars()
Builds the tool bar.
long onCmdDelayToggle(FXObject *, FXSelector, void *)
Called on "delay toggle".
FXMenuPane * myFileMenu
the submenus
long onCmdStart(FXObject *, FXSelector, void *)
Called on "play".
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
void loadConfigOrNet(const std::string &file)
FXToolBar * myToolBar1
The application tool bar.
FXMenuPane * mySettingsMenu
bool myWasStarted
the information whether the simulation was started before
virtual void addToWindowsMenu(FXMenuPane *)
FXSplitter * myMainSplitter
The splitter that divides the main window into views and the log window.
FXEX::FXLCDLabel * myEmergencyVehicleLabel
long onCmdListParking(FXObject *, FXSelector, void *)
Toggle listing of parking vehicles.
long onCmdListInternal(FXObject *, FXSelector, void *)
Toggle listing of internal structures.
bool myTLSGame
current game mode
long onCmdFullScreen(FXObject *, FXSelector, void *)
Toggle full screen mode.
GUIApplicationWindow(FXApp *a, const std::string &configPattern)
Constructor.
GUISUMOAbstractView * openNewView(GUISUMOViewParent::ViewType vt=GUISUMOViewParent::VIEW_2D_OPENGL)
FXEX::FXLCDLabel * myLCDLabel
the simulation step display
long onCmdEditBreakpoints(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Breakpoints.
long onCmdOpenShapes(FXObject *, FXSelector, void *)
Called on menu File->Load Shapes.
FXToolBarShell * myMenuBarDrag
const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
FXToolBarShell * myToolBarDrag8
long onUpdStart(FXObject *sender, FXSelector, void *ptr)
Determines whether "play" is enabled.
FXGLCanvas * getBuildGLCanvas() const
get build GL Canvas (must be implemented in all children)
RandomDistributor< std::string > myJamSounds
long onCmdNewView(FXObject *, FXSelector, void *)
Called if a new view shall be opened (2D view)
GUIRunThread * myRunThread
the thread that runs simulations
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
Called if the message window shall be cleared.
long onCmdNetedit(FXObject *, FXSelector, void *)
Called on menu Edit->Netedit.
virtual void create()
Creates the main window (required by FOX)
FXEX::FXThreadEvent myRunThreadEvent
io-event with the run-thread
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
FXToolBarShell * myToolBarDrag5
FXMenuPane * myWindowsMenu
long onCmdDemandScale(FXObject *, FXSelector, void *)
Called on "demand scale".
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
RandomDistributor< std::string > myCollisionSounds
FXMenuCascade * mySelectLanesMenuCascade
the menu cascades
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
Called on menu File->Open Network.
std::string myConfigPattern
Input file pattern.
virtual void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
int myPreviousCollisionNumber
long onCmdEditChosen(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Chosen.
virtual void detach()
Detaches the tool/menu bar.
long onCmdOpenRecent(FXObject *, FXSelector, void *)
Called on opening a recent file.
long onUpdOpenRecent(FXObject *, FXSelector, void *)
Determines whether opening a recent file is enabled.
bool myShowTimeAsHMS
whether to show time as hour:minute:second
double myAlternateSimDelay
The alternate simulation delay in milliseconds for toggling.
long onUpdStop(FXObject *, FXSelector, void *)
Determines whether "stop" is enabled.
FXDataTarget * mySimDelayTarget
long onCmdSaveConfig(FXObject *, FXSelector, void *)
Called on menu File->Close.
FXMenuPane * myLocatorMenu
void updateTimeLCD(SUMOTime time)
updates the simulation time display
long onCmdSaveState(FXObject *, FXSelector, void *)
Called on "save state".
FXToolBarShell * myToolBarDrag3
long onLoadThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the loading thread.
long onCmdReload(FXObject *, FXSelector, void *)
Called on reload.
long onUpdNeedsSimulation(FXObject *, FXSelector, void *)
Determines whether some buttons which require an active simulation may be shown.
long onUpdOpen(FXObject *, FXSelector, void *)
Determines whether opening is enabled.
long onCmdHallOfFame(FXObject *, FXSelector, void *)
Shows the Hall of Fame dialog.
long onCmdLocate(FXObject *, FXSelector, void *)
Called on menu commands from the Locator menu.
FXToolBarShell * myToolBarDrag6
FXSlider * mySimDelaySlider
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
Called on menu File->Open Configuration.
long onCmdOpenEdgeData(FXObject *, FXSelector, void *)
Called on menu File->Load EdgeData.
FXCondition myEventCondition
the semaphore when waiting for event completion
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
FXMenuBar * myMenuBar
The application menu bar.
static std::mt19937 myGamingRNG
A random number generator used to choose a gaming sound.
long myLastStepEventMillis
last time the simulation view was redrawn due to a simStep
virtual ~GUIApplicationWindow()
Destructor.
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
virtual void fillMenuBar()
Builds the menu bar.
std::vector< FXButton * > myStatButtons
Buttons showing and running values and triggering statistic windows.
virtual void eventOccurred()
void checkGamingEvents()
handles additional game-related events
long onCmdGaming(FXObject *, FXSelector, void *)
Toggle gaming mode.
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
static FXMenuTitle * buildFXMenuTitle(FXComposite *p, const std::string &text, FXIcon *icon, FXMenuPane *menuPane)
build menu title
static FXMenuCommand * buildFXMenuCommandRecentFile(FXComposite *p, const std::string &text, FXObject *tgt, FXSelector sel)
build menu command (for recent files)
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
static FXMenuCommand * buildFXMenuCommandShortcut(FXComposite *p, const std::string &text, const std::string &shortcut, const std::string &info, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
The application's "About" - dialog.
void create()
Creates the widget.
The dialog to change the application (gui) settings.
Editor for simulation breakpoints.
void show()
sets the focus after the window is created
Editor for the list of chosen objects.
The SUMO User Conference "Hall of Fame" - dialog / easter egg.
void create()
Creates the widget.
const std::string & getMsg() const
Returns the message.
Event sent when the the simulation is over.
MSNet::SimulationState getReason() const
Returns the reason the simulation has ended due.
SUMOTime getTimeStep() const
Returns the time step the simulation has ended at.
const SUMOTime myBegin
the time the simulation shall start with
GUINet * myNet
the loaded net
const std::vector< std::string > mySettingsFiles
the name of the settings file to load
const bool myOsgView
whether to load the OpenSceneGraph view
const SUMOTime myEnd
the time the simulation shall end with
const bool myViewportFromRegistry
whether loading viewport from registry
const std::string myFile
the name of the loaded file
GUIEventType getOwnType() const
returns the event type
virtual void create()
create GUIGlChildWindow
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
virtual FXGLCanvas * getBuildGLCanvas() const
get build GL Canvas
GUIGlID getGlID() const
Returns the numerical id of the object.
static double gTrackerInterval
the aggregation period for tracker windows in seconds
static bool gRunAfterLoad
the simulation shall start direct after loading
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
static void close()
close GUIIconSubSys
Representation of a lane in the micro simulation (gui-version)
void loadConfigOrNet(const std::string &file)
begins the loading of the given file
const std::string & getFileName() const
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call
bool myListParking
information whether the locator should list parking vehicles
std::vector< FXMainWindow * > myTrackerWindows
bool myListTeleporting
information whether the locator should list teleporting vehicles
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
FXMDIClient * myMDIClient
The multi view panel.
FXHorizontalFrame * myGeoFrame
FXLabel * myGeoCoordinate
bool listParking() const
return whether to list parking vehicles
void updateChildren()
update childrens
FXHorizontalFrame * myCartesianFrame
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
bool myListInternal
information whether the locator should list internal structures
void storeWindowSizeAndPos()
record window position and size in registry
bool myAmFullScreen
fox need this
FXStatusBar * myStatusbar
The status bar.
FXGLVisual * myGLVisual
The gl-visual used.
bool myAmGaming
information whether the gui is currently in gaming mode
std::vector< GUIGlChildWindow * > myGLWindows
A logging window for the gui.
void addSeparator()
Adds a a separator to this log window.
void clear()
Clears the window.
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
MSTransportableControl & getPersonControl() override
Returns the person control.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
MSTransportableControl & getContainerControl() override
Returns the container control.
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
void setActive(int scheme)
FXMutex & getBreakpointLock()
std::vector< SUMOTime > & getBreakpoints()
virtual bool simulationIsStartable() const
virtual bool simulationIsStepable() const
virtual bool init(GUINet *net, SUMOTime start, SUMOTime end)
initialises the thread with the new simulation
SUMOTime getSimEndTime() const
virtual bool simulationIsStopable() const
bool simulationAvailable() const
void prepareDestruction()
void addDecals(const std::vector< Decal > &decals)
add decals
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
GUIPerspectiveChanger & getChanger() const
get changer
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
virtual void copyViewportTo(GUISUMOAbstractView *view)
copy the viewport to the given view
virtual bool setColorScheme(const std::string &)
set color scheme
A single child window which contains a view of the simulation area.
ViewType
Available view types.
@ VIEW_3D_OSG
plain 3D OSG view (
@ VIEW_2D_OPENGL
plain 2D openGL view (
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
void setToolBarVisibility(const bool value)
about toggled gaming status
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
void clear()
Clears the list of selected objects.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
An XML-handler for visualisation schemes.
double getDelay() const
Returns the parsed delay.
const std::string & getViewType() const
Returns the parsed view type.
const std::string & getSettingName() const
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
RandomDistributor< std::string > getEventDistribution(const std::string &id)
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
Storage for geometrical objects extended by mutexes.
static void buildSUMOAccelerators(GUIApplicationWindow *GUIApp)
build SUMO Accelerators
static void clearTextures()
clears loaded textures
static std::string clipped
GUIColorer laneColorer
The lane colorer.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
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.
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isStopped() const
Returns whether the vehicle is at a stop.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
@ SIMSTATE_LOADING
The simulation is loading.
@ SIMSTATE_ERROR_IN_SIM
An error occurred during the simulation step.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
ShapeContainer & getShapeContainer()
Returns the shapes container.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
bool hasContainers() const
Returns whether containers are simulated.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
bool hasPersons() const
Returns whether persons are simulated.
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.
int getRunningNumber() const
Returns the number of build and inserted, but not yet deleted transportables.
int getWaitingForVehicleNumber() const
Returns the number of transportables waiting for a ride.
The class responsible for building and deletion of vehicles.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
void setScale(double scale)
sets the demand scaling factor
int getCollisionCount() const
return the number of collisions
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Representation of a vehicle in the micro simulation.
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
double getSpeed() const
Returns the vehicle's current speed.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
The XML-Handler for shapes loading network loading.
const std::string & getID() const
Returns the id.
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const bool inComment=false) const
Writes the configuration.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
void set(double x, double y)
set positions x and y
double x() const
Returns the x-position.
double y() const
Returns the y-position.
static const RGBColor GREEN
static const RGBColor RED
named colors
double getOverallProb() const
Return the sum of the probabilites assigned to the members.
T get(SumoRNG *which=nullptr) const
Draw a sample of the distribution.
static std::string transcodeToLocal(const std::string &utf8String)
convert a string from UTF-8 to the local codepage
A few system-specific functions.
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
static long getCurrentMillis()
Returns the current time in milliseconds.
static TraCIServer * getInstance()
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false)
Runs the given handler on the given file; returns if everything's ok.