127 FXMAPFUNC(SEL_COMMAND,
MID_NEW_OSGVIEW, GUIApplicationWindow::onCmdNewOSG),
199 FXIMPLEMENT(
GUIApplicationWindow, FXMainWindow, GUIApplicationWindowMap, ARRAYNUMBER(GUIApplicationWindowMap))
211 myLoadThread(nullptr), myRunThread(nullptr),
213 myAlternateSimDelay(0.),
214 myRecentFiles(a,
"files"),
215 myConfigPattern(configPattern),
216 hadDependentBuild(false),
217 myShowTimeAsHMS(false),
218 myHaveNotifiedAboutSimEnd(false),
221 myPreviousCollisionNumber(0),
224 myEmergencyVehicleCount(0),
257 myGeoCoordinate =
new FXLabel(
myGeoFrame,
"N/A\t\tOriginal coordinate (before coordinate transformation in netconvert)",
nullptr, LAYOUT_CENTER_Y);
302 gCurrentFolder = getApp()->reg().readStringEntry(
"SETTINGS",
"basedir",
"");
303 FXMainWindow::create();
321 FXint textWidth = getApp()->getNormalFont()->getTextWidth(
"8", 1) * 24;
325 show(PLACEMENT_DEFAULT);
327 if (getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 1) {
331 myShowTimeAsHMS = (getApp()->reg().readIntEntry(
"gui",
"timeasHMS", 0) == 1);
369 FXMainWindow::detach();
381 "&Open Simulation...",
"Ctrl+O",
"Open a simulation (Configuration file).",
384 "Open &Network...",
"Ctrl+N",
"Open a network.",
387 "Open Shapes ",
"Ctrl+P",
"Load POIs and Polygons for visualization.",
390 "Open EdgeData ",
"Ctrl+U",
"Load edge related data for visualization.",
393 "&Reload",
"Ctrl+R",
"Reloads the simulation / the network.",
397 "Save Configuration",
"Ctrl+Shift+S",
"Save current options as a configuration file.",
400 "Close",
"Ctrl+W",
"Close the simulation.",
403 FXMenuSeparator* sep1 =
new FXMenuSeparator(
myFileMenu);
405 sep1->setSelector(FXRecentFiles::ID_ANYFILES);
421 "&Quit",
"Ctrl+Q",
"Quit the Application.",
427 for (
const auto& vehicleClass : vehicleClasses) {
434 "Edit Selected...",
"Ctrl+E",
"Opens a dialog for editing the list of selected items.",
437 "Select lanes which allow...\t\tOpens a menu for selecting a vehicle class by which to selected lanes.",
441 "Edit Breakpoints",
"Ctrl+B",
"Opens a dialog for editing breakpoints.",
444 "Edit Visualisation",
"F9",
"Opens a dialog for editing visualization settings.",
447 "Edit Viewport",
"Ctrl+I",
"Opens a dialog for editing viewing area, zoom and rotation.",
451 "Open in netedit",
"Ctrl+T",
"Opens the netedit application with the current network.",
458 "Application Settings...",
"",
"Open a Dialog for Application Settings editing.",
461 "Gaming Mode\tCtrl+G\tToggle gaming mode on/off.",
464 "Full Screen Mode\tCtrl+F\tToggle full screen mode on/off.",
470 "Locate &Junctions",
"Shift+J",
"Open a Dialog for Locating a Junction.",
473 "Locate &Edges",
"Shift+E",
"Open a Dialog for Locating an Edge.",
477 "Locate &Vehicles",
"Shift+V",
"Open a Dialog for Locating a Vehicle.",
481 "Locate &Persons",
"Shift+P",
"Open a Dialog for Locating a Person.",
484 "Locate &Container",
"Shift+C",
"Open a Dialog for Locating a Container.",
487 "Locate &TLS",
"Shift+T",
"Open a Dialog for Locating a Traffic Light.",
490 "Locate &Additional",
"Shift+A",
"Open a Dialog for Locating an Additional Structure.",
493 "Locate P&oI",
"Shift+O",
"Open a Dialog for Locating a Point of Interest.",
496 "Locate Po&lygon",
"Shift+L",
"Open a Dialog for Locating a Polygon.",
500 "Show Internal Structures\t\tShow internal junctions and streets in locator dialog.",
503 "Show Parking Vehicles\t\tShow parking vehicles in locator dialog.",
507 "Show vehicles outside the road network\t\tShow vehicles that are teleporting or driving remote-controlled outside the road network in locator dialog.",
513 "Run",
"Ctrl+A",
"Start running the simulation.",
516 "Stop",
"Ctrl+S",
"Stop running the simulation.",
519 "Step",
"Ctrl+D",
"Perform one simulation step.",
522 "Save",
"",
"Save the current simulation state to a file.",
529 "Show Status Line\t\tToggle the Status Bar on/off.",
532 "Show Message Window\t\tToggle the Message Window on/off.",
535 "Show Simulation Time\t\tToggle the Simulation Time on/off.",
538 "Show Simulation Delay\t\tToggle the Simulation Delay Entry on/off.",
543 "Tile &Horizontally",
"",
"",
546 "Tile &Vertically",
"",
"",
557 sep1->setSelector(FXMDIClient::ID_MDI_ANY);
565 "Clear Message Window",
"",
"Clear the message window.",
573 "&Online Documentation",
"F1",
"Open Online documentation.",
576 "&About",
"F12",
"About sumo-gui.",
649 new FXLabel(
myToolBar8,
"Scale Traffic:\t\tScale traffic from flows and vehicles that are loaded incrementally from route files",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
661 new FXButton(
myToolBar5,
"\t\tOpen a new microscopic view.",
664 new FXButton(
myToolBar5,
"\t\tOpen a new 3D view.",
674 new FXLabel(
myToolBar6,
"Waiting Time:\t\tTime spent waiting accumulated for all vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
686 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);
698 new FXLabel(
myToolBar9,
"Distance (km):\t\tTotal distance driven by DRT vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
710 new FXLabel(
myToolBar10,
"Emergency Vehicle waiting time:\t\tTime spent waiting accumulated for emergency vehicles",
nullptr, LAYOUT_TOP | LAYOUT_LEFT);
724 getApp()->reg().writeStringEntry(
"SETTINGS",
"basedir",
gCurrentFolder.text());
725 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", isMaximized() ? 1 : 0);
726 getApp()->reg().writeIntEntry(
"gui",
"timeasHMS",
myShowTimeAsHMS ? 1 : 0);
735 FXMenuCommand* mc =
dynamic_cast<FXMenuCommand*
>(menu);
736 if (mc->getText() ==
"Edit Selected...") {
745 const std::vector<MSLane*>& lanes = (*i)->getLanes();
746 for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
806 FXRegistry reg(
"SUMO netedit",
"Eclipse");
813 std::string netedit =
"netedit";
814 const char* sumoPath = getenv(
"SUMO_HOME");
815 if (sumoPath !=
nullptr) {
816 std::string newPath = std::string(sumoPath) +
"/bin/netedit";
818 netedit =
"\"" + newPath +
"\"";
827 cmd =
"start /B \"\" " + cmd;
839 FXFileDialog opendialog(
this,
"Open Simulation Configuration");
841 opendialog.setSelectMode(SELECTFILE_EXISTING);
846 if (opendialog.execute()) {
848 std::string file = opendialog.getFilename().text();
859 FXFileDialog opendialog(
this,
"Open Network");
861 opendialog.setSelectMode(SELECTFILE_EXISTING);
862 opendialog.setPatternList(
"SUMO nets (*.net.xml)\nAll files (*)");
866 if (opendialog.execute()) {
868 std::string file = opendialog.getFilename().text();
879 FXFileDialog opendialog(
this,
"Open Shapes");
881 opendialog.setSelectMode(SELECTFILE_EXISTING);
882 opendialog.setPatternList(
"Additional files (*.xml)\nAll files (*)");
886 if (opendialog.execute()) {
888 std::string file = opendialog.getFilename().text();
909 FXFileDialog opendialog(
this,
"Open EdgeData");
911 opendialog.setSelectMode(SELECTFILE_EXISTING);
912 opendialog.setPatternList(
"EdgeData files (*.xml)\nAll files (*)");
916 if (opendialog.execute()) {
918 std::string file = opendialog.getFilename().text();
937 getApp()->beginWaitCursor();
951 myStatusbar->getStatusLine()->setText(
"Already loading!");
954 std::string file((
const char*)ptr);
963 FXFileDialog opendialog(
this,
"Save SUMO Configuration");
965 opendialog.setSelectMode(SELECTFILE_ANY);
966 opendialog.setPatternList(
"Config (*.sumocfg)");
974 opendialog.getPatternText(opendialog.getCurrentPattern()).after(
'.').before(
')')).text();
975 std::ofstream out(file);
997 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1005 sender->handle(
this,
1007 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1015 sender->handle(
this,
1016 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1024 sender->handle(
this,
1026 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1036 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1045 getApp()->forceRefresh();
1053 getApp()->forceRefresh();
1062 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1078 FXFileDialog opendialog(
this,
"Save Simulation State");
1080 opendialog.setSelectMode(SELECTFILE_ANY);
1081 opendialog.setPatternList(
"GZipped State (*.xml.gz)\nXML State (*.xml)");
1090 opendialog.getPatternText(opendialog.getCurrentPattern()).after(
'.').before(
')')).text();
1134 sender->handle(
this,
1136 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1144 sender->handle(
this,
1146 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1154 sender->handle(
this,
1156 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1165 sender->handle(
this, disable ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1177 sender->handle(
this,
TraCIServer::getInstance() ==
nullptr ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1208 d->show(PLACEMENT_OWNER);
1274 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
1275 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
1276 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
1277 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
1279 setDecorations(DECOR_NONE);
1280 place(PLACEMENT_MAXIMIZED);
1300 place(PLACEMENT_VISIBLE);
1301 setDecorations(DECOR_ALL);
1306 setWidth(getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600));
1307 setHeight(getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400));
1308 setX(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150));
1309 setY(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150));
1344 GUIApplicationWindow::onCmdNewOSG(FXObject*, FXSelector,
void*) {
1355 about->show(PLACEMENT_OWNER);
1363 hall->show(PLACEMENT_OWNER);
1369 FXEvent*
event = (FXEvent*)ptr;
1371 setDNDData(FROM_CLIPBOARD, event->target,
string);
1432 if (ec->
myNet ==
nullptr) {
1467 if (view ==
nullptr) {
1470 std::string settingsName = settings.
addSettings(view);
1483 std::vector<SUMOTime> breakpoints;
1487 std::sort(breakpoints.begin(), breakpoints.end());
1509 std::vector<SUMOTime> breakpoints;
1513 std::sort(breakpoints.begin(), breakpoints.end());
1522 setTitle(
"SUMO Interactive Traffic Light");
1525 setTitle(
"SUMO Interactive Demand-Responsive-Transport");
1534 off.
set(getApp()->reg().readRealEntry(
"viewport",
"x"),
1535 getApp()->reg().readRealEntry(
"viewport",
"y"),
1536 getApp()->reg().readRealEntry(
"viewport",
"z"));
1544 (*it)->setText(
"-");
1552 getApp()->endWaitCursor();
1566 if (backlog > running) {
1596 getApp()->forceRefresh();
1629 "\nDo you want to close all open files and views?";
1630 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
"Simulation ended",
"%s", text.c_str());
1644 #ifdef HAVE_DANGEROUS_SOUNDS
1647 for (; it != end; ++it) {
1681 if (veh->
getID().rfind(
"emergency", 0) == 0) {
1717 getApp()->beginWaitCursor();
1731 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1742 FXuint opts = MDI_TRACKING;
1746 if (oldView !=
nullptr) {
1778 (*it)->setText(
"-");
1793 for (FXMainWindow*
const window : trackerWindows) {
1814 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1838 myStatusbar->getStatusLine()->setText(text.c_str());
1839 myStatusbar->getStatusLine()->setNormalText(text.c_str());
1860 std::ostringstream str;
1861 str << std::setfill(
'0');
1869 str << std::setw(2);
1870 str << time / 3600000 <<
'-';
1872 str << std::setw(2) << time / 60000 <<
'-';
1875 str << std::setw(2) << time / 1000;
1876 if (!hideFraction) {
1877 str <<
'.' << std::setw(3) << time % 1000;
1885 const long handled = FXMainWindow::onKeyPress(o, sel, ptr);
1886 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1898 const long handled = FXMainWindow::onKeyRelease(o, sel, ptr);
1899 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1927 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_DELAY_TOOGLE
toogle delay between alternative value
@ 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_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_SHOWNETSTATS
Show network statistics.
@ ID_LOADTHREAD_EVENT
The loading thread.
@ MID_EDITCHOSEN
Open editor for selections.
@ MID_SHOWPERSONSTATS
Show person statistics.
@ MID_HOTKEY_ALT_F4_CLOSE
Main window closes.
@ MID_TIME_TOOGLE
toogle 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_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID
Toogle Gaming mode in SUMO and grid in NETEDIT.
@ 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
@ EVENT_GLDEBUG_OCCURRED
send when a gldebug occured
@ EVENT_SIMULATION_ENDED
Send when the simulation is over;.
@ EVENT_ERROR_OCCURRED
send when a error occured
@ EVENT_SIMULATION_LOADED
send when a simulation has been loaded
@ EVENT_STATUS_OCCURRED
send when a status change occured
@ EVENT_SIMULATION_STEP
send when a simulation step has been performed
@ EVENT_DEBUG_OCCURRED
send when a debug occured
@ EVENT_MESSAGE_OCCURRED
send when a message occured
@ EVENT_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 setGroove(const FXint width)
set/get groove width - must be less than segment width
void setHorizontal(const FXint len)
set/get segment horizontal length - must be more than twice the segment width
void setThickness(const FXint width)
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
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)
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.
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 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)
FXRecentFiles myRecentFiles
List of recent files.
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.
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
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.
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
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(std::mt19937 *which=0) const
Draw a sample of the distribution.
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
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.